|
|
@ -32,11 +32,47 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- //支付方式 --> |
|
|
|
|
|
|
|
<view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式</view> |
|
|
|
|
|
|
|
<view class="line1"></view> |
|
|
|
|
|
|
|
<view class="width100 backcorfff"> |
|
|
|
|
|
|
|
<!-- <view class="height50 width100 backcorfff" @tap="paytype='weixin'"> |
|
|
|
|
|
|
|
<view class="width50 flleft fcor333 fontwig6 font16" style="padding-left: 4%;"> |
|
|
|
|
|
|
|
微信支付 |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" |
|
|
|
|
|
|
|
style="align-items: center;"> |
|
|
|
|
|
|
|
<radio :checked="paytype=='weixin'" color="#0083f5" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="width94 line1 mart5 marb5"></view> --> |
|
|
|
|
|
|
|
<view class="line1"></view> |
|
|
|
|
|
|
|
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='weixin'"> |
|
|
|
|
|
|
|
<view class="width60 flleft fontwig6"> |
|
|
|
|
|
|
|
微信支付 |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flright width30 fotct"> |
|
|
|
|
|
|
|
<radio :checked="paytype=='weixin'" @click="changeRiado()" color="#0083f5" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="line1"></view> |
|
|
|
|
|
|
|
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='gonghuika'"> |
|
|
|
|
|
|
|
<view class="width60 flleft fontwig6"> |
|
|
|
|
|
|
|
工会卡支付<text class="font14 fcor666 margle">余额: {{tongCardPrice}}元</text> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flright width30 fotct"> |
|
|
|
|
|
|
|
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view> |
|
|
|
<view class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view> |
|
|
|
<view class="width95 paddleft10 font14 fcor999 mart5">1.<text |
|
|
|
<view class="width95 paddleft10 font14 fcor999 mart5">1.<text |
|
|
|
class="fcor089 fontwig6">请先加油后下单</text>,即您到站后,与工作人员确认油号,抢号后再付款。</view> |
|
|
|
class="fcor089 fontwig6">请先加油后下单</text>,即您到站后,与工作人员确认油号,抢号后再付款。</view> |
|
|
|
<view class="width95 paddleft10 font14 fcor999 mart5"> |
|
|
|
<view class="width95 paddleft10 font14 fcor999 mart5"> |
|
|
|
2.请勿先付款后加油,若您已下单付款。请于24小时内到加油站完成加油;若您48小时内未完成加油,请及时发起退单;逾期退单可能会退单失败。</view> |
|
|
|
2.请勿先付款后加油,若您已下单付款。请于24小时内到加油站完成加油;若您48小时内未完成加油,请及时发起退单;逾期退单可能会退单失败。</view> |
|
|
|
|
|
|
|
<view class="height80 width100"></view> |
|
|
|
<!-- 底部按钮 --> |
|
|
|
<!-- 底部按钮 --> |
|
|
|
<view class="footer"> |
|
|
|
<view class="footer"> |
|
|
|
<view class="width50 flleft fcoreb5 padleft15 font15"> |
|
|
|
<view class="width50 flleft fcoreb5 padleft15 font15"> |
|
|
@ -44,26 +80,39 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<button class="reBtn flright" @click="orderToPay">去支付</button> |
|
|
|
<button class="reBtn flright" @click="orderToPay">去支付</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle"/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { |
|
|
|
import { |
|
|
|
getOrderById, |
|
|
|
getOrderById, |
|
|
|
orderToPay |
|
|
|
orderToPay, |
|
|
|
|
|
|
|
getHuiLianTongCardBalance, |
|
|
|
|
|
|
|
hltUnionCardPay |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
|
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; |
|
|
|
let app = getApp(); |
|
|
|
let app = getApp(); |
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
// #endif |
|
|
|
// #endif |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
|
|
|
|
components: { |
|
|
|
|
|
|
|
ssPaymentPassword |
|
|
|
|
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
orderNo: '', |
|
|
|
orderNo: '', |
|
|
|
couponId: '', |
|
|
|
couponId: '', |
|
|
|
payprice: '', |
|
|
|
payprice: '', |
|
|
|
orderList: '', |
|
|
|
orderList: '', |
|
|
|
refulAdress: '' |
|
|
|
refulAdress: '', |
|
|
|
|
|
|
|
tongCardPrice: 0, |
|
|
|
|
|
|
|
balanceCardNo: '', |
|
|
|
|
|
|
|
user: '', |
|
|
|
|
|
|
|
paytype: '', |
|
|
|
|
|
|
|
PaymentPassword: '', |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(e) { |
|
|
|
onLoad(e) { |
|
|
@ -73,7 +122,81 @@ |
|
|
|
this.refulAdress = e.adres; |
|
|
|
this.refulAdress = e.adres; |
|
|
|
this.getOrderById(); |
|
|
|
this.getOrderById(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onShow() { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
that.paytype = ''; |
|
|
|
|
|
|
|
that.user = app.globalData.userInfo; |
|
|
|
|
|
|
|
uni.getStorage({ |
|
|
|
|
|
|
|
key: 'balanceCardNo', |
|
|
|
|
|
|
|
success(e) { |
|
|
|
|
|
|
|
that.balanceCardNo = e.data; |
|
|
|
|
|
|
|
that.getHuiLianTongCardBalance(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
//密码支付完成 |
|
|
|
|
|
|
|
submitHandle(e) { |
|
|
|
|
|
|
|
this.PaymentPassword = e.value; |
|
|
|
|
|
|
|
if(this.PaymentPassword == ''){ |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '请勿手动关闭弹窗', |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '支付中...' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
"orderId": this.orderNo, |
|
|
|
|
|
|
|
"cardNo": this.balanceCardNo, |
|
|
|
|
|
|
|
"password": this.PaymentPassword |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
hltUnionCardPay(params).then(res => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '支付成功' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
|
|
url: '/pages/goods/refuel-succes/refuel-succes?id=' +this.orderNo |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (res.return_code == '102130') { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//获取选择支付方式 |
|
|
|
|
|
|
|
changeRiado() { |
|
|
|
|
|
|
|
if (!this.user.isSetHltCard) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
title: '当前账号还未绑定,前往绑定', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
success() { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../user/bindingCard/bindingCard' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
getOrderById() { |
|
|
|
getOrderById() { |
|
|
|
uni.showLoading({ |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中...' |
|
|
|
title: '加载中...' |
|
|
@ -88,58 +211,106 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//查询工会卡余额 |
|
|
|
|
|
|
|
getHuiLianTongCardBalance() { |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
cardNo: this.balanceCardNo |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
getHuiLianTongCardBalance(params).then(res => { |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.tongCardPrice = res.return_data.balance; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
//获取订单数据 |
|
|
|
//获取订单数据 |
|
|
|
orderToPay() { |
|
|
|
orderToPay() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
let params = { |
|
|
|
if (that.paytype == '') { |
|
|
|
"orderId": that.orderNo, |
|
|
|
uni.showToast({ |
|
|
|
"openId": app.globalData.openId, |
|
|
|
title: '请选择支付方式', |
|
|
|
"orderScene": "GOODS_ORDER" |
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
orderToPay(params).then(res => { |
|
|
|
if (that.paytype == 'weixin') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
let params = { |
|
|
|
// #ifdef MP |
|
|
|
"orderId": that.orderNo, |
|
|
|
uni.showLoading({ |
|
|
|
"openId": app.globalData.openId, |
|
|
|
title: '支付中...' |
|
|
|
"orderScene": "GOODS_ORDER" |
|
|
|
}) |
|
|
|
} |
|
|
|
uni.requestPayment({ |
|
|
|
orderToPay(params).then(res => { |
|
|
|
"appId": res.return_data.appId, |
|
|
|
if (res.return_code == '000000') { |
|
|
|
"nonceStr": res.return_data.nonceStr, |
|
|
|
// #ifdef MP |
|
|
|
"package": res.return_data.package, |
|
|
|
uni.showLoading({ |
|
|
|
"paySign": res.return_data.sign, |
|
|
|
title: '支付中...' |
|
|
|
"signType": "MD5", |
|
|
|
}) |
|
|
|
"timeStamp": res.return_data.timeStamp, |
|
|
|
uni.requestPayment({ |
|
|
|
success: function(res) { |
|
|
|
"appId": res.return_data.appId, |
|
|
|
uni.hideLoading(); |
|
|
|
"nonceStr": res.return_data.nonceStr, |
|
|
|
uni.showToast({ |
|
|
|
"package": res.return_data.package, |
|
|
|
title: '支付成功' |
|
|
|
"paySign": res.return_data.sign, |
|
|
|
}) |
|
|
|
"signType": "MD5", |
|
|
|
uni.reLaunch({ |
|
|
|
"timeStamp": res.return_data.timeStamp, |
|
|
|
url: '/pages/goods/refuel-succes/refuel-succes?id=' + that |
|
|
|
success: function(res) { |
|
|
|
.orderNo |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
uni.showToast({ |
|
|
|
}, |
|
|
|
title: '支付成功' |
|
|
|
fail: function(err) { |
|
|
|
}) |
|
|
|
uni.hideLoading(); |
|
|
|
uni.reLaunch({ |
|
|
|
}, |
|
|
|
url: '/pages/goods/refuel-succes/refuel-succes?id=' +that.orderNo |
|
|
|
}); |
|
|
|
}); |
|
|
|
// #endif |
|
|
|
}, |
|
|
|
|
|
|
|
fail: function(err) { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
//判断是否是公众号 |
|
|
|
//判断是否是公众号 |
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
|
//判断微信浏览器 |
|
|
|
//判断微信浏览器 |
|
|
|
that.payRequest(res); |
|
|
|
that.payRequest(res); |
|
|
|
// #endif |
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: res.return_msg, |
|
|
|
title: res.return_msg, |
|
|
|
icon: 'none' |
|
|
|
icon: 'none' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(that.paytype == 'gonghuika'){ |
|
|
|
|
|
|
|
if (!that.user.isSetPayPwd) { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!that.user.isSetHltCard) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
title: '当前账号还未绑定,前往绑定', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
success() { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../user/bindingCard/bindingCard' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
payRequest: function(self) { |
|
|
|
payRequest: function(self) { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
uni.showLoading({ |
|
|
|
title: '支付中...' |
|
|
|
title: '支付中...' |
|
|
|
}) |
|
|
|
}) |
|
|
@ -232,7 +403,7 @@ |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
|
|
.reBtn { |
|
|
|
.reBtn { |
|
|
|
width: 120px; |
|
|
|
width: 120px; |
|
|
|
background-color: #089bf5; |
|
|
|
background-color: #089bf5; |
|
|
|