Browse Source

[ID1001383][修改]:[云端测试:C端-1.门店出现重复数据,2.业态展示商户也有问题,3.每次默认在全部下]

tags/湖南版5.1.4
meo 6 years ago
parent
commit
f9bd93bf85
5 changed files with 17 additions and 62 deletions
  1. +0
    -21
      pages/discountCardList/discountCardList.js
  2. +11
    -33
      pages/index/searchbar/index.js
  3. +4
    -4
      pages/index/searchbar/index.wxml
  4. +1
    -4
      pages/main/coupons/index.js
  5. +1
    -0
      pages/spellDetail/index.json

+ 0
- 21
pages/discountCardList/discountCardList.js View File

@@ -50,27 +50,6 @@ Page({
})
}
},
onShow: function () {
let that = this;
Http.get({
url: config.api.businessList
}).then(res => {
console.log(res)
let businessObj = [{ id: 0, title: "全部", type: 1, createDate: 0}];
that.setData({
tabs: res.data.concat(businessObj).sort(compare("createDate"))
});
console.log(that.data.tabs)
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
//点击跳转到券详情页面
gotouse: function (e) {
console.log(e.currentTarget.dataset.couponid)


+ 11
- 33
pages/index/searchbar/index.js View File

@@ -21,7 +21,6 @@ Page({
jumpIndex(e) {
let that = this;
let index = e.currentTarget.dataset.menuindex;
console.log(index)
that.setData({
indexId: index,
businessId: index
@@ -43,7 +42,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this
let that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
@@ -51,34 +50,26 @@ Page({
});
}
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
that.getBussiness();
that.getList(1,0);
that.getList(1, 0);
},
getBussiness:function(){
let that = this;
Http.get({
url: config.api.businessList,
}).then(res => {
console.log(res)
let businessObj = [{ id: 0, title: "全部", type: 1, createDate:0}];
that.setData({
lists: res.data.concat(businessObj).sort(compare("createDate"))
lists: [{ id: 0, title: "全部", type: 1 }].concat(res.data)
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
getList: function (page, businessId) {
let that = this;
@@ -148,16 +139,3 @@ Page({
}
}
})
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;
}
}
}

+ 4
- 4
pages/index/searchbar/index.wxml View File

@@ -3,11 +3,11 @@
<view style='float: left' class='left'>
<scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{winHeight}}px'>
<view class='all clear'>
<block wx:key="lists" wx:for="{{lists}}">
<view bindtap='jumpIndex' data-menuindex='{{index}}'>
<block wx:for="{{lists}}" wx:key="{{index}}">
<view bindtap='jumpIndex' data-menuindex='{{item.id}}'>
<view class='text-style'>
<text class="{{indexId==index?'active1':''}}">{{item.title}}</text>
<text class="{{indexId==index?'active':''}}"></text>
<text class="{{indexId==item.id?'active1':''}}">{{item.title}}</text>
<text class="{{indexId==item.id?'active':''}}"></text>
</view>
</view>
</block>


+ 1
- 4
pages/main/coupons/index.js View File

@@ -185,12 +185,9 @@ Component({
Http.get({
url: config.api.businessList
}).then(res => {
console.log(res)
let businessObj = [{ id: 0, title: "全部", type: 1, createDate:0}];
that.setData({
tabs: res.data.concat(businessObj).sort(compare("createDate"))
tabs: [{ id: 0, title: "全部", type: 1 }].concat(res.data)
});
console.log(that.data.tabs)
})
.catch(err => {
wx.showToast({


+ 1
- 0
pages/spellDetail/index.json View File

@@ -2,5 +2,6 @@
"navigationBarTitleText": "拼团详情",
"usingComponents": {},
"navigationBarBackgroundColor": "#F13C42",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true
}

Loading…
Cancel
Save