浏览代码

[卡消费]

tags/广东版3.2.1
meo 6 年前
父节点
当前提交
50c15997f0
共有 5 个文件被更改,包括 110 次插入120 次删除
  1. +15
    -14
      pages/ConsumeDetail/ConsumeDetail.js
  2. +91
    -89
      pages/cardorder/index/index.js
  3. +3
    -3
      pages/grade/grade.wxss
  4. +1
    -1
      pages/order/detail/index.wxss
  5. +0
    -13
      pages/scanPay/scanPay.js

+ 15
- 14
pages/ConsumeDetail/ConsumeDetail.js 查看文件

@@ -50,7 +50,7 @@ Page({
display: "none",
showbutton: false,
hidden: "hidden",
height: "auto",
height: "",
more: "点击查看更多",
showMore: true
},
@@ -63,22 +63,22 @@ Page({
// 点击查看更多
more: function() {
let that = this;
if (that.data.height == 'auto') {
if (that.data.more == '点击查看更多') {
this.setData({
hidden: "",
height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx',
more: "点击收起",
showMore: true
})
}
else {
this.setData({
hidden: "hidden",
height: "auto",
height: 4* 140 + 'rpx',
more: "点击查看更多",
showMore: true
})
}
// else {
// this.setData({
// hidden: "",
// height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx',
// more: "点击查看更多",
// showMore: false
// })
// }
}
},
onLoad(options) {
let that = this;
@@ -141,9 +141,10 @@ Page({
})
if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length<=4){
that.setData({
height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx'
height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx',
showMore:false
})
} else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length >= 4){
} else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length > 4){
that.setData({
height: 4 * 140 + 'rpx'
})


+ 91
- 89
pages/cardorder/index/index.js 查看文件

@@ -29,9 +29,11 @@ Page({
},
onShow: function() {
let that = this;
if (that.data.current_scroll==4){
console.log("onShow")
console.log(that.data.current_scroll)
if (that.data.current_scroll == "4") {
that.getList(4, 1);
}else{
} else {
that.getList('5,6,7', 1);
}
wx.setStorage({
@@ -42,7 +44,7 @@ Page({
index: 2
})
},
userule:function(){
userule: function() {
wx.navigateTo({
url: '/pages/cardorder/userule/userule',
})
@@ -52,15 +54,15 @@ Page({
let that = this;
wx.scanCode({
success: (res) => {
console.log(JSON.parse(res.result).merchant_id)
if(JSON.parse(res.result).merchant_id&&e.currentTarget.dataset.cardid&&e.currentTarget.dataset.remainingamount){
console.log(JSON.parse(res.result).merchant_id)
if (JSON.parse(res.result).merchant_id && e.currentTarget.dataset.cardid && e.currentTarget.dataset.remainingamount) {
wx.navigateTo({
url: `/pages/scanPay/scanPay?merChant=${res.result}&cardid=${e.currentTarget.dataset.cardid}&remainingAmount=${e.currentTarget.dataset.remainingamount}`,
})
}else{
} else {
wx.showToast({
title:"未识别到商户二维码",
icon:"none",
title: "未识别到商户二维码",
icon: "none",
mask: false
})
}
@@ -88,101 +90,101 @@ Page({
e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}`
});
},
gotoBuy:function(){
gotoBuy: function() {
wx.navigateTo({
url: '/pages/discountCardList/discountCardList',
})
},
getList(key, pageNum) {
var that = this;
console.log(key)
if (that.data.allow_load) {
that.setData({
loading: true,
content: "小主,我在玩命加载中...",
});
if (key == 4) {
var data = {
pageNum: pageNum,
pageSize: 6,
couponType: "7",
couponOrderStatus: 4
}
} else if (key == '5,6,7') {
var data = {
pageNum: pageNum,
pageSize: 6,
couponType: "7",
statusStr: "5,6,7"
}
// if (that.data.allow_load) {
that.setData({
loading: true,
content: "小主,我在玩命加载中...",
});
if (key == "4") {
var data = {
pageNum: pageNum,
pageSize: 6,
couponType: "7",
couponOrderStatus: 4
}
Http.get({
url: config.api.cardorderList,
data: data
})
.then(res => {
if (res.code == 200) {
that.setData({
showPage: true
})
}
res.data.list.map(file => {
file.expiredTime = util.formatTime(file.expiredTime, "yyyy.MM.dd")
if (file.couponOrderStatus == 5 || file.couponOrderStatus == 6 || file.couponOrderStatus == 7) {
file.background = 'rgba(179,180,181,1)';
file.showImg = true;
} else if (file.couponOrderStatus == 4) {
if (file.remainingAmount > 0 && 29900 >= file.remainingAmount) {
file.background = '#7184E2'
} else if (file.remainingAmount >= 30000 && 49900 >= file.remainingAmount) {
file.background = '#63AAE6'
} else if (file.remainingAmount >= 50000 && 99900 >= file.remainingAmount) {
file.background = '#E2A471'
} else if (file.remainingAmount >= 100000){
file.background = '#E67663'
}
} else if (key == '5,6,7') {
var data = {
pageNum: pageNum,
pageSize: 6,
couponType: "7",
statusStr: "5,6,7"
}
}
Http.get({
url: config.api.cardorderList,
data: data
})
.then(res => {
console.log(res)
if (res.code == 200) {
that.setData({
showPage: true
})
}
res.data.list.map(file => {
file.expiredTime = util.formatTime(file.expiredTime, "yyyy.MM.dd")
if (file.couponOrderStatus == 5 || file.couponOrderStatus == 6 || file.couponOrderStatus == 7) {
file.background = 'rgba(179,180,181,1)';
file.showImg = true;
} else if (file.couponOrderStatus == 4) {
if (file.remainingAmount > 0 && 29900 >= file.remainingAmount) {
file.background = '#7184E2'
} else if (file.remainingAmount >= 30000 && 49900 >= file.remainingAmount) {
file.background = '#63AAE6'
} else if (file.remainingAmount >= 50000 && 99900 >= file.remainingAmount) {
file.background = '#E2A471'
} else if (file.remainingAmount >= 100000) {
file.background = '#E67663'
}
}

});
setTimeout(function() {
that.setData({
loading: false
});
setTimeout(function() {
that.setData({
loading: false
});
}, 1400);
if (pageNum >= res.data.pages) {
that.setData({
allow_load: false
});
}
if (pageNum == 1) {
that.setData({
list: []
})
}
var tmpArr = that.data.list;
tmpArr.push.apply(tmpArr, res.data.list);
}, 1400);
if (pageNum >= res.data.pages && pageNum != 1) {
that.setData({
list: tmpArr
allow_load: false
});
}
if (pageNum == 1) {
that.setData({
list: []
})
}
var tmpArr = that.data.list;
tmpArr.push.apply(tmpArr, res.data.list);
that.setData({
list: tmpArr
})
.catch(err => {
wx.showModal({
title: '提示',
content: err.errMsg,
showCancel: false
})
})
.catch(err => {
wx.showModal({
title: '提示',
content: err.errMsg,
showCancel: false
})
} else {
that.setData({
loading: true,
content: "——— 再拉裤子就掉了啦 ———"
});
setTimeout(function() {
that.setData({
loading: false
});
}, 1400);
}
})
// } else {
// that.setData({
// loading: true,
// content: "——— 再拉裤子就掉了啦 ———"
// });
// setTimeout(function() {
// that.setData({
// loading: false
// });
// }, 1400);
// }
},
handleChangeScroll({
detail


+ 3
- 3
pages/grade/grade.wxss 查看文件

@@ -57,7 +57,7 @@
padding-left: 3rpx;
margin-right: 30rpx;
}
.scroll-view-item:nth-of-type(1),.scroll-view-item:nth-of-type(8){
.scroll-view-item:nth-of-type(1){
margin-right: 0;
}

@@ -191,8 +191,8 @@ visibility: hidden;
margin-left: 10rpx;
}
.growthbg{
margin:0 40rpx;
padding: 0 30rpx;
margin:80rpx auto 30rpx;
width: 700rpx;
}
.growthbg image{
display: block;


+ 1
- 1
pages/order/detail/index.wxss 查看文件

@@ -140,7 +140,7 @@ page {
line-height: 94rpx;
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #eee;
/* border-bottom: 1rpx solid #eee; */
}

.classif > view text {


+ 0
- 13
pages/scanPay/scanPay.js 查看文件

@@ -94,11 +94,6 @@ Page({
success: (res) => {
console.log(res)
if (parseInt(res.isEnrolled) <= 0) {
// wx.showModal({
// title: '错误',
// content: '您暂未录入指纹信息,请录入后重试',
// showCancel: false
// })
that.gotoPayMoney();
return
}
@@ -116,11 +111,6 @@ Page({
},
fail: (err) => {
console.error(err);
// wx.showModal({
// title: '抱歉',
// content: '您的设备不支持指纹识别',
// showCancel: false
// })
that.gotoPayMoney();
}
})
@@ -150,7 +140,6 @@ Page({
if (res.code == 200) {
res.data.list.map(file => {
file.merchantVoList.map(files => {
console.log(files.id)
if (files.id == that.data.merChant.merchant_id) {
file.flag = true
}
@@ -177,8 +166,6 @@ Page({
cardId: ids,
remainingAmount: e.currentTarget.dataset.remainingamount
})


},
showModel: function() {
this.setData({


正在加载...
取消
保存