1.修改团油工会卡支付

yj-dev
杨杰 3 years ago
parent eb4cdcda19
commit 4feb309e5c
  1. 261
      pages/goods/refuel-confirm/refuel-confirm.vue
  2. 2
      pages/user/positioning/positioning.vue
  3. 4
      uni.scss

@ -32,11 +32,47 @@
</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="width95 paddleft10 font14 fcor999 mart5">1.<text
class="fcor089 fontwig6">请先加油后下单</text>,即您到站后,与工作人员确认油号,抢号后再付款</view>
<view class="width95 paddleft10 font14 fcor999 mart5">
2.请勿先付款后加油,若您已下单付款请于24小时内到加油站完成加油;若您48小时内未完成加油,请及时发起退单;逾期退单可能会退单失败</view>
<view class="height80 width100"></view>
<!-- 底部按钮 -->
<view class="footer">
<view class="width50 flleft fcoreb5 padleft15 font15">
@ -44,26 +80,39 @@
</view>
<button class="reBtn flright" @click="orderToPay">去支付</button>
</view>
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle"/>
</view>
</template>
<script>
import {
getOrderById,
orderToPay
orderToPay,
getHuiLianTongCardBalance,
hltUnionCardPay
} from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
let app = getApp();
// #ifdef H5
var jweixin = require('jweixin-module');
// #endif
export default {
components: {
ssPaymentPassword
},
data() {
return {
orderNo: '',
couponId: '',
payprice: '',
orderList: '',
refulAdress: ''
refulAdress: '',
tongCardPrice: 0,
balanceCardNo: '',
user: '',
paytype: '',
PaymentPassword: '',
}
},
onLoad(e) {
@ -73,7 +122,81 @@
this.refulAdress = e.adres;
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: {
//
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() {
uni.showLoading({
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() {
let that = this;
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER"
if (that.paytype == '') {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
return;
}
orderToPay(params).then(res => {
if (res.return_code == '000000') {
// #ifdef MP
uni.showLoading({
title: '支付中...'
})
uni.requestPayment({
"appId": res.return_data.appId,
"nonceStr": res.return_data.nonceStr,
"package": res.return_data.package,
"paySign": res.return_data.sign,
"signType": "MD5",
"timeStamp": res.return_data.timeStamp,
success: function(res) {
uni.hideLoading();
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/pages/goods/refuel-succes/refuel-succes?id=' + that
.orderNo
});
},
fail: function(err) {
uni.hideLoading();
},
});
// #endif
if (that.paytype == 'weixin') {
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER"
}
orderToPay(params).then(res => {
if (res.return_code == '000000') {
// #ifdef MP
uni.showLoading({
title: '支付中...'
})
uni.requestPayment({
"appId": res.return_data.appId,
"nonceStr": res.return_data.nonceStr,
"package": res.return_data.package,
"paySign": res.return_data.sign,
"signType": "MD5",
"timeStamp": res.return_data.timeStamp,
success: function(res) {
uni.hideLoading();
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/pages/goods/refuel-succes/refuel-succes?id=' +that.orderNo
});
},
fail: function(err) {
uni.hideLoading();
},
});
// #endif
//
// #ifdef H5
//
that.payRequest(res);
// #endif
//
// #ifdef H5
//
that.payRequest(res);
// #endif
} else {
uni.showToast({
title: res.return_msg,
icon: 'none'
} else {
uni.showToast({
title: res.return_msg,
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) {
let that = this;
uni.showLoading({
title: '支付中...'
})
@ -232,7 +403,7 @@
display: flex;
justify-content: space-between;
align-items: center;
.reBtn {
width: 120px;
background-color: #089bf5;

@ -7,7 +7,7 @@
<view class="posacname actives mart20">{{posName}}</view>
<view class="width90 mart20 font14 fcor333">其他地区</view>
<view class="posheadname mart20 flleft font14" :class="{'actives':posId===item.regionId}"
v-for="(item,index) in posList" @click="change(item)">
v-for="(item,index) in posList" :key="index" @click="change(item)">
{{item.regionName}}
</view>
</view>

@ -151,10 +151,6 @@ $uni-font-size-paragraph:30upx;
margin-left: 6px;
}
.paddleft10 {
margin-left: 10px;
}
.margle20 {
margin-left: 20px;
}

Loading…
Cancel
Save