小程序相关
"tabBar": { "selectedColor": "#1296db", "list": [{ "pagePath": "pages/index/index", "text": "首页", "iconPath": "images/ico-home.png", "selectedIconPath": "images/ico-home-d.png" },{ "pagePath": "pages/setting/setting", "text": "设置", "iconPath": "images/ico-setting.png", "selectedIconPath": "images/ico-setting-d.png" },{ "pagePath": "pages/help/help", "text": "帮助", "iconPath": "images/ico-help.png", "selectedIconPath": "images/ico-help-d.png" }]
常见数据类型循环赋值:(数字判断类型)
balMsg:[ { balType:0, date:"2020-02-11", money:205 }, { balType:0, date:"2020-06-29", money:19.5 }, { balType:1, date:"2020-01-22", money:50.26 }, { balType:1, date:"2019-04-02", money:100 }, ] }, myFn:function(){ console.log("执行"); for (let i = 0; i < this.data.balMsg.length; i++) { if( this.data.balMsg[i].balType == 0){ var a1="balMsg["+i+"].balType" this.setData({ [a1]:"返利" }) }else if(this.data.balMsg[i].balType == 1){ var a2="balMsg["+i+"].balType" this.setData({ [a2]:"提现" }) } } },
常见for循环写法:
wx:for="{{shippingAdd}}" wx:for-item="i" wx:key="k"