1.修改扫码支付的页面

dev
杨杰 2 years ago
parent fd9cc64bf6
commit f1a67b1131
  1. 154
      pages/index/index.vue
  2. 2
      pages/welcome/welcome.vue

@ -9,7 +9,8 @@
<view class="width40w mart10 line1"></view>
</view>
<!-- 商家优惠 -->
<view class="height50 width100 mart10 backcorfff" v-if="storeList.discountActivity !== '' && storeList.discountActivity !== null">
<view class="height50 width100 mart10 backcorfff"
v-if="storeList.discountActivity !== '' && storeList.discountActivity !== null">
<view class="width50 flleft fcor666 font16 alijusstart" style="padding-left: 5%;">
门店优惠
</view>
@ -67,7 +68,7 @@
</view>
<view class="width60 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;"
v-if="deductionPrice != 0 && user" @click="showPopup()">
暂无优惠券
-{{deductionPrice}}
<image style="width: 40rpx;height: 40rpx;" src="../../static/jt.png"></image>
</view>
<view class="width60 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;"
@ -124,7 +125,7 @@
@click="radioChanges(discout)">
<view class="margle20">
<view class="yhprice">
<radio :checked="discout.id == memDiscountId.indexOf(discout.id)" color="#0083f5" />
<radio :checked="discout.id == memDiscountId" color="#0083f5" />
</view>
<view class="font16 fontwig6 fcor333 text1">{{discout.discountName}}</view>
</view>
@ -145,7 +146,6 @@
<view class="btn mart30" @tap="doReg">立即登录</view>
</view>
<!-- </view> -->
</wybPopup>
</view>
</template>
@ -186,7 +186,7 @@
reNum: 0, //
priceValue: [0, 0], //
discountList: '', //
memDiscountId: [], //
memDiscountId: '', //
numKeybordList: [
[1, 2, 3],
[4, 5, 6],
@ -211,35 +211,8 @@
getCodeisWaiting: false,
}
},
mounted() {
// this.openKeyBoard('number');
},
mounted() {},
onLoad: function() {
// var arr1 = window.location.href;
// var arr2 = arr1.split('=');
// if (arr2[1].length == 12) {
// var arr3 = arr2[1].split('#/');
// app.globalData.snNo = arr3[0];
// uni.setStorage({
// key: "snNumber",
// data: arr3[0]
// })
// this.jumpWeb();
// } else {
// let that = this;
// var arr4 = arr2[2].split('&');
// app.globalData.code = arr4[0];
// uni.getStorage({
// key: 'snNumber',
// success(e) {
// app.globalData.snNo = e.data;
// that.getQrCodeDetail();
// }
// })
// }
// if (app.globalData.code) {
// this.getH5AccessToken();
// }
if (app.globalData.snNo) {
this.getQrCodeDetail();
}
@ -258,16 +231,15 @@
str += item.toString();
})
parice = str - (this.priceValue[1] / 10 / 10);
if(str == 0){
if (str == 0) {
this.calculation(0);
}
if(str){
if (str) {
this.calculation(str);
}
if (parice > 0) {
this.cjstu = false;
} else {
// this.payPrice = 0;
this.priceValue = [0, 0];
}
this.inputPrice = str;
@ -375,6 +347,7 @@
})
this.$refs.popups.hide();
this.getUserAccount();
this.queryUserDiscountList();
} else {
this.showtoastdes = res.return_msg;
uni.showToast({
@ -389,6 +362,10 @@
showPopuplogin() {
this.$refs.popups.show();
},
//
showPopup() {
this.$refs.popup.show();
},
//
getUserAccount() {
getUserAccount().then(res => {
@ -416,11 +393,12 @@
calculation(item) {
let storetype = '';
let storeprice = '';
if(this.storeList.discountActivity !='' && this.storeList.discountActivity !=null){
if (item >= this.storeList.discountActivity.discountCondition && this.storeList.discountActivity.discountType == 1) {
if (this.storeList.discountActivity != '' && this.storeList.discountActivity != null) {
if (item >= this.storeList.discountActivity.discountCondition && this.storeList.discountActivity
.discountType == 1) {
storetype = this.storeList.discountActivity.discountType;
storeprice = this.storeList.discountActivity.discountPrice;
}else{
} else {
storetype = this.storeList.discountActivity.discountType;
storeprice = this.storeList.discountActivity.discountPrice;
}
@ -430,8 +408,8 @@
transactionPrice: item,
storeDiscountType: storetype,
storeDiscountPrice: storeprice,
userDiscountType: '',
userDiscountPrice: ''
userDiscountType: this.memDiscountId,
userDiscountPrice: this.deductionPrice
}
calculation(datas).then(res => {
if (res.return_code == '000000') {
@ -441,19 +419,6 @@
}
});
},
//H5 openId
// getH5AccessToken(item) {
// let params = {
// code: app.globalData.code
// }
// getH5AccessToken(params).then(res => {
// if (res.return_code == '000000' && res.return_data.openid) {
// app.globalData.openId = res.return_data.openid;
// } else {
// this.jumpWeb();
// }
// });
// },
//
getQrCodeDetail() {
let datas = {
@ -467,13 +432,63 @@
}
})
},
//
showPopup() {
this.$refs.popup.show();
},
//
radioChanges(item) {
// this.rechangeload();
if (this.inputPrice == '') {
uni.showToast({
title: '请输入正确的支付金额',
duration: 2000,
icon: 'none'
})
this.payPrice = 0;
this.plateNumberList = [];
this.$refs.popup.hide();
return;
}
if (this.memDiscountId == item.id) { //
this.memDiscountId = '';
this.deductionPrice = '0.00';
this.calculation(this.inputPrice);
} else { //
if (item.discountType == 1) {
if (this.inputPrice >= item.discountCondition) {
this.memDiscountId = item.id;
//
this.deductionPrice = item.discountPrice;
let oldprice = this.inputPrice - this.deductionPrice;
this.calculation(oldprice);
} else {
uni.showToast({
title: '请满' + item.discountCondition + '使用此券',
icon: 'none',
duration: 2000
})
}
}
if (item.discountType == 2) {
this.memDiscountId = item.id;
//
this.deductionPrice = item.discountPrice;
let oldprice = this.inputPrice - this.deductionPrice;
this.calculation(oldprice);
}
if (item.discountType == 3) {
this.memDiscountId = item.id;
//
this.deductionPrice = parseFloat(this.inputPrice - (this.inputPrice * item.discountPrice)).toFixed(
2);
let oldprice = parseFloat(this.inputPrice * item.discountPrice).toFixed(2);
this.calculation(oldprice);
}
}
this.$refs.popup.hide();
},
rechangeload() {
this.isUse = false;
this.$nextTick(() => (this.isUse = true))
},
//
jumpWeb() {
@ -488,31 +503,13 @@
//
confirm() {
let lenth = this.plateNumberList.length - 1;
// if (!this.payPrice) {
// uni.showToast({
// title: '',
// duration: 2000,
// icon: 'none'
// })
// return;
// }
if (this.plateNumberList[lenth] == '.') {
uni.showToast({
title: '请输入正确的支付金额',
duration: 2000,
icon: 'none'
})
this.payPrice = 0;
this.plateNumberList = [];
return;
}
var n = String(this.payPrice)
var t = n.charAt(0)
// .
n = n.replace(/^\./g, '')
// ..
n = n.replace(/\.{2,}/g, '.')
if (n == 0) {
if (n == 0 || this.plateNumberList[lenth] == '') {
uni.showToast({
title: '请输入正确的支付金额',
duration: 2000,
@ -641,7 +638,8 @@
});
jweixin.chooseWXPay({
appId: self.appId,
timestamp: self.timeStamp, // jssdk使timestamp使timeStampS
timestamp: self
.timeStamp, // jssdk使timestamp使timeStampS
nonceStr: self.nonceStr, // 32
package: self.package, // prepay_idprepay_id=***
signType: self.signType, // 'SHA1'使'MD5'

@ -60,7 +60,7 @@
url:'../index/index'
})
} else {
this.jumpcdx();
this.jumpWeb();
}
});
},

Loading…
Cancel
Save