This commit is contained in:
3321822538@qq.com 2024-10-14 18:03:01 +08:00
parent c6cd07b711
commit 147e16a632
2 changed files with 30 additions and 27 deletions

View File

@ -19,8 +19,8 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.2.106:10002', baseUrl: 'http://192.168.2.106:10002',
baseUrl: 'https://kg.chuangtewl.com/prod-api', // baseUrl: 'https://kg.chuangtewl.com/prod-api',
// loadingText: '努力加载中~', // loadingText: '努力加载中~',
// loadingTime: 1000, // loadingTime: 1000,
// 设置自定义头部content-type // 设置自定义头部content-type

View File

@ -127,6 +127,7 @@
立即支付 立即支付
</view> </view>
</view> </view>
<view class="mask" v-if="zhifuflag"></view>
<view class="mask" v-if="czflag"></view> <view class="mask" v-if="czflag"></view>
<view class="czdh" v-if="jzflag"> <view class="czdh" v-if="jzflag">
@ -161,10 +162,11 @@
export default { export default {
data() { data() {
return { return {
flags:false,
jzflag:false, jzflag:false,
progress: 0, progress: 0,
isLoading: false, isLoading: false,
zhifuflag:true, zhifuflag:false,
indexactive: -1, indexactive: -1,
checked: false, checked: false,
lanyaflag: false, lanyaflag: false,
@ -447,16 +449,16 @@
mapGearTimeToGearAmount(suitList) { mapGearTimeToGearAmount(suitList) {
// suitList // suitList
suitList.forEach(suit => { suitList.forEach(suit => {
const gearTime = suit.gearTime; const gearTime = suit.gearTime
const gearAmount = suit.gearAmount; const gearAmount = suit.gearAmount
const arr = new Array(gearTime.length).fill(null); const arr = new Array(gearTime.length).fill(null)
gearTime.forEach((time, index) => { gearTime.forEach((time, index) => {
if (time >= 0 && time < gearAmount.length) { if (time >= 0 && time < gearAmount.length) {
arr[index] = gearAmount[time]; arr[index] = gearAmount[time]
} }
}); })
suit.arr = arr; suit.arr = arr
}); })
}, },
btnzhifu() { btnzhifu() {
if (this.checked == false) { if (this.checked == false) {
@ -474,14 +476,15 @@
}else if(this.mchShowBillMobile == true && this.phonenumber == ''){ }else if(this.mchShowBillMobile == true && this.phonenumber == ''){
this.getPhoneNumber() this.getPhoneNumber()
}else { }else {
this.zhifuflag = true
this.getzhifu() this.getzhifu()
} }
}, },
// //
getPhoneNumber(e){ getPhoneNumber(e){
// console.log(e,'121212');
this.$u.put(`/app/user/bindWxMobile?mobileCode=${e.detail.code}`).then(res =>{ this.$u.put(`/app/user/bindWxMobile?mobileCode=${e.detail.code}`).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.zhifuflag = true
this.getzhifu() this.getzhifu()
}else{ }else{
uni.showToast({ uni.showToast({
@ -499,7 +502,6 @@
title: '准备支付中...' title: '准备支付中...'
}) })
this.getzfqd() this.getzfqd()
this.zhifuflag = false
let that = this let that = this
let data = { let data = {
deviceNo: that.id, deviceNo: that.id,
@ -543,7 +545,7 @@
signType: res.data.payParams.signType, signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign, paySign: res.data.payParams.paySign,
success: (res) => { success: (res) => {
this.zhifuflag = true this.zhifuflag = false
// console.log(res, '') // console.log(res, '')
if (that.timer) { if (that.timer) {
clearInterval(this.timer) clearInterval(this.timer)
@ -558,7 +560,7 @@
uni.setStorageSync('time', that.expireTimeStr) uni.setStorageSync('time', that.expireTimeStr)
}, },
fail(err) { fail(err) {
this.zhifuflag = true that.zhifuflag = false
// //
uni.showToast({ uni.showToast({
title: '支付失败', title: '支付失败',
@ -568,7 +570,7 @@
} }
}) })
}else{ }else{
this.zhifuflag = true that.zhifuflag = false
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -591,7 +593,7 @@
signType: res.data.payParams.signType, signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign, paySign: res.data.payParams.paySign,
success: (res) => { success: (res) => {
this.zhifuflag = true this.zhifuflag = false
// console.log(res, '') // console.log(res, '')
if (that.timer) { if (that.timer) {
clearInterval(this.timer) clearInterval(this.timer)
@ -605,7 +607,7 @@
uni.setStorageSync('time', that.expireTimeStr) uni.setStorageSync('time', that.expireTimeStr)
}, },
fail(err) { fail(err) {
this.zhifuflag = true that.zhifuflag = false
// //
uni.showToast({ uni.showToast({
title: '支付失败', title: '支付失败',
@ -615,7 +617,7 @@
} }
}) })
}else{ }else{
this.zhifuflag = true that.zhifuflag = false
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -628,12 +630,13 @@
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}) })
that.zhifuflag = false
}else if(res.code == 500){ }else if(res.code == 500){
uni.showToast({ uni.showToast({
title:res.msg, title:res.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); })
} }
}) })
} else { } else {
@ -683,7 +686,7 @@
title: '准备支付中...' title: '准备支付中...'
}) })
this.getzfqd() this.getzfqd()
this.zhifuflag = false this.zhifuflag = true
let that = this let that = this
let data = { let data = {
deviceNo: that.id, deviceNo: that.id,
@ -743,7 +746,7 @@
customData: '11open' customData: '11open'
}) })
setTimeout(() => { setTimeout(() => {
that.zhifuflag = true that.zhifuflag = false
uni.reLaunch({ uni.reLaunch({
// url: '/pages/shouye/index' // url: '/pages/shouye/index'
url:'/page_components/eletj?id=' + that.orderno url:'/page_components/eletj?id=' + that.orderno
@ -782,7 +785,7 @@
uni.setStorageSync('time', that.expireTimeStr) uni.setStorageSync('time', that.expireTimeStr)
}, },
fail(err) { fail(err) {
this.zhifuflag = true this.zhifuflag = false
setTimeout(() => { setTimeout(() => {
this.czflag = false this.czflag = false
uni.hideLoading() uni.hideLoading()
@ -796,7 +799,7 @@
} }
}) })
}else{ }else{
this.zhifuflag = true this.zhifuflag = false
} }
}) })
}else{ }else{
@ -848,7 +851,7 @@
}) })
that.$u.get(`/app/bill/recharge/${dingobj}/bluetoothSuccess`).then(res => { that.$u.get(`/app/bill/recharge/${dingobj}/bluetoothSuccess`).then(res => {
if (res.code == 200) { if (res.code == 200) {
that.zhifuflag = true that.zhifuflag = false
console.log('蓝牙离线充值成功11') console.log('蓝牙离线充值成功11')
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
@ -885,7 +888,7 @@
uni.setStorageSync('time', that.expireTimeStr) uni.setStorageSync('time', that.expireTimeStr)
}, },
fail(err) { fail(err) {
this.zhifuflag = true this.zhifuflag = false
setTimeout(() => { setTimeout(() => {
this.czflag = false this.czflag = false
uni.hideLoading() uni.hideLoading()
@ -899,7 +902,7 @@
} }
}) })
}else{ }else{
this.zhifuflag = true this.zhifuflag = false
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -935,7 +938,7 @@
}, },
// //
btnactive(item) { btnactive(item) {
this.zhifuflag = true // this.zhifuflag = true
this.prices = item.price this.prices = item.price
this.sytime = item.value this.sytime = item.value
this.zfobj = item this.zfobj = item