瀏覽代碼

[业态增加全部]

tags/广东版3.2.1
meo 6 年之前
父節點
當前提交
04698b60f3
共有 2 個檔案被更改,包括 19 行新增3 行删除
  1. +18
    -2
      pages/index/coupons/index.js
  2. +1
    -1
      pages/user/index.wxml

+ 18
- 2
pages/index/coupons/index.js 查看文件

@@ -187,9 +187,12 @@ Component({
type: 1
}
}).then(res => {
console.log(res)
let businessObj = [{id:0,title: "全部",type: 1}];
that.setData({
tabs: res.data.list
tabs: res.data.list.concat(businessObj).sort(compare("id"))
});
console.log(that.data.tabs)
})
.catch(err => {
wx.showToast({
@@ -208,4 +211,17 @@ Component({
})
that.getList(0, 1);
}
});
});
function compare(pro) {
return function (obj2, obj1) {
var val1 = obj1[pro];
var val2 = obj2[pro];
if (val1 < val2) {
return 1;
} else if (val1 > val2) {
return -1;
} else {
return 0;
}
}
}

+ 1
- 1
pages/user/index.wxml 查看文件

@@ -74,7 +74,7 @@
<navigator url="/pages/specialcourtesy/specialcourtesy">
<view class="user-btn app-border-bottom">
<view>
<image style='width:50rpx;' class='icons' src="./../../assets/img/gift.png" mode='widthFix'></image>我的特权</view>
<image style='width:50rpx;' class='icons' src="./../../assets/img/gift.png" mode='widthFix'></image>特享礼遇</view>
<view>
<text class="iconfont icon-right"></text>
</view>


Loading…
取消
儲存