Просмотр исходного кода

[卡消费]

tags/广东版3.2.1
meo 6 лет назад
Родитель
Сommit
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", display: "none",
showbutton: false, showbutton: false,
hidden: "hidden", hidden: "hidden",
height: "auto",
height: "",
more: "点击查看更多", more: "点击查看更多",
showMore: true showMore: true
}, },
@@ -63,22 +63,22 @@ Page({
// 点击查看更多 // 点击查看更多
more: function() { more: function() {
let that = this; 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({ this.setData({
hidden: "hidden", hidden: "hidden",
height: "auto",
height: 4* 140 + 'rpx',
more: "点击查看更多", more: "点击查看更多",
showMore: true showMore: true
}) })
}
// else {
// this.setData({
// hidden: "",
// height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx',
// more: "点击查看更多",
// showMore: false
// })
// }
}
}, },
onLoad(options) { onLoad(options) {
let that = this; let that = this;
@@ -141,9 +141,10 @@ Page({
}) })
if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length<=4){ if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length<=4){
that.setData({ 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({ that.setData({
height: 4 * 140 + 'rpx' height: 4 * 140 + 'rpx'
}) })


+ 91
- 89
pages/cardorder/index/index.js Просмотреть файл

@@ -29,9 +29,11 @@ Page({
}, },
onShow: function() { onShow: function() {
let that = this; 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); that.getList(4, 1);
}else{
} else {
that.getList('5,6,7', 1); that.getList('5,6,7', 1);
} }
wx.setStorage({ wx.setStorage({
@@ -42,7 +44,7 @@ Page({
index: 2 index: 2
}) })
}, },
userule:function(){
userule: function() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/cardorder/userule/userule', url: '/pages/cardorder/userule/userule',
}) })
@@ -52,15 +54,15 @@ Page({
let that = this; let that = this;
wx.scanCode({ wx.scanCode({
success: (res) => { 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({ wx.navigateTo({
url: `/pages/scanPay/scanPay?merChant=${res.result}&cardid=${e.currentTarget.dataset.cardid}&remainingAmount=${e.currentTarget.dataset.remainingamount}`, url: `/pages/scanPay/scanPay?merChant=${res.result}&cardid=${e.currentTarget.dataset.cardid}&remainingAmount=${e.currentTarget.dataset.remainingamount}`,
}) })
}else{
} else {
wx.showToast({ wx.showToast({
title:"未识别到商户二维码",
icon:"none",
title: "未识别到商户二维码",
icon: "none",
mask: false mask: false
}) })
} }
@@ -88,101 +90,101 @@ Page({
e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}`
}); });
}, },
gotoBuy:function(){
gotoBuy: function() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/discountCardList/discountCardList', url: '/pages/discountCardList/discountCardList',
}) })
}, },
getList(key, pageNum) { getList(key, pageNum) {
var that = this; 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({ 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({ handleChangeScroll({
detail detail


+ 3
- 3
pages/grade/grade.wxss Просмотреть файл

@@ -57,7 +57,7 @@
padding-left: 3rpx; padding-left: 3rpx;
margin-right: 30rpx; 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; margin-right: 0;
} }


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


+ 1
- 1
pages/order/detail/index.wxss Просмотреть файл

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


.classif > view text { .classif > view text {


+ 0
- 13
pages/scanPay/scanPay.js Просмотреть файл

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


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


Загрузка…
Отмена
Сохранить