1.修改话费充值

master
杨杰 3 years ago
parent 105b307fa4
commit 92f206495f
  1. 6
      high-unionPay/Utils/Api.js
  2. 4
      high-unionPay/manifest.json
  3. 170
      high-unionPay/pages/pay/payment/payment.vue
  4. 6
      high-unionPay/pages/tabBar/user/user.vue
  5. 90
      high-unionPay/pages/unionPay/recharge-centre/recharge-centre.vue
  6. 46
      high-unionPay/pages/unionPay/unionPay.vue

@ -169,12 +169,14 @@ export const getListOutRechargePrice = params => {
export const orderToUNionPay = params => {
return POST('POST', `${base}/outRechargeOrder/orderToPay`, params).then(res => res.data);
}
//银联提交订单
export const unionPay = params => {
return POST('POST', `${base}/order/unionPay`, params).then(res => res.data);
}
// 银联话费充值
export const orderToUnionPayphone = params => {
return POST('POST', `${base}/outRechargeOrder/orderToUnionPay`, params).then(res => res.data);
}
/**

@ -80,7 +80,7 @@
}
}
},
"title" : "嗨森逛",
"title" : "嗨加油",
"router" : {
"mode" : "hash",
"base" : "/unionPay"
@ -89,7 +89,7 @@
"port" : "",
"https" : false
},
"domain" : "https://hsg.dctpay.com",
"domain" : "https://hsgcs.dctpay.com",
"template" : "index.html"
}
}

@ -18,9 +18,9 @@
</view>
<view class="content">
<view class="pay-list">
<view class="row" @tap="paytype='jinbi'" v-if="pryType == 2 || pryType==3 ">
<view class="row" @tap="paytype='jinbi'">
<view class="left">
<image src="../../../static/img/jfx.png"></image>
<image src="../../../static/img/jfx.png"></image>
</view>
<view class="center">
积分支付(积分:{{user.gold}})
@ -34,13 +34,13 @@
<image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image>
</view>
<view class="center">
汇联通工会卡(余额:{{tongCardPrice}})
银联支付
</view>
<view class="right">
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
<radio :checked="paytype=='gonghuika'" color="#0083f5" />
</view>
</view>
<view class="row" @tap="paytype='wxpay'" v-if="pryType == 1 || pryType==3 ">
<!-- <view class="row" @tap="paytype='wxpay'" v-if="pryType == 1 || pryType==3 ">
<view class="left">
<image :src="imagewxUrl+imgadres"></image>
</view>
@ -50,7 +50,7 @@
<view class="right">
<radio :checked="paytype=='wxpay'" color="#0083f5" />
</view>
</view>
</view> -->
</view>
</view>
</view>
@ -71,8 +71,8 @@
import {
orderToPay,
orderToGoldPay,
getHuiLianTongCardBalance,
hltUnionCardPay
hltUnionCardPay,
unionPay
} from '../../../Utils/Api.js'
import ssPaymentPassword from '../../../components/sanshui-payment-password'
let app = getApp();
@ -113,100 +113,15 @@
this.amount = parseFloat(e.amount).toFixed(2);
},
onShow() {
let that = this;
let that = this;
that.user = app.globalData.userInfo;
that.getHuiLianTongCardBalance();
},
methods: {
//
changeRiado() {
if (!this.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
//
getHuiLianTongCardBalance() {
let params = {
cardNo: this.user.hltCardNo.cardNo
}
getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') {
this.tongCardPrice = res.return_data.balance;
}
});
},
//
orderToPay() {
let that = this;
if (that.paytype == 'wxpay') {
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: '支付成功'
})
if (that.jumpType == 4) {
uni.reLaunch({
url: '/pages/tabBar/user/user'
});
return;
}
uni.reLaunch({
url: '../success/success?id=' + that.couponId
});
},
fail: function(err) {
uni.hideLoading();
},
});
// #endif
//
// #ifdef H5
//
that.payRequest(res);
// #endif
} else {
uni.showToast({
title: res.return_msg,
icon: 'none'
})
}
})
} else if (that.paytype == 'jinbi') {
if (that.paytype == 'jinbi') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
@ -215,28 +130,7 @@
}
that.$refs.paymentPassword.modalFun('show');
} else 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');
that.unionPay();
} else {
uni.showToast({
title: '请选择支付方式',
@ -245,6 +139,48 @@
})
}
},
//
unionPay() {
let goods = {
"orderId": this.orderNo
}
unionPay(goods).then(res => {
if (res.return_code == '000000') {
this.uniontopay(res.return_data.prepayid);
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
});
}
})
},
//
uniontopay(item) {
let that = this;
upsdk.pluginReady(function() {
upsdk.pay({
tn: item,
success: function(res) {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '../success/success?id=' + this.couponId
});
},
fail: function(err) {
uni.showToast({
title: err.msg,
icon: 'none',
duration: 2000
})
// , err.msg , TN,
}
});
});
},
submitHandle(e) {
this.PaymentPassword = e.value;
uni.showLoading({

@ -63,9 +63,9 @@
<uni-badge text="1" type="error" />
</view> -->
<uni-badge style="width: 20px;position: absolute; right: 30%;" v-if="row.text == '我的卡券' && textnum "
<uni-badge style="width: 20px;position: absolute; right: 53%;" v-if="row.text == '我的卡券' && textnum "
:text="textnum" type="error" size="normal"></uni-badge>
<uni-badge style="width: 20px;position: absolute; right: 53%;"
<uni-badge style="width: 20px;position: absolute; right: 30%;"
v-if="row.text == '我的优惠券' && textSend " :text="textSend" type="error" size="normal"></uni-badge>
<view class="img">
<image :src="imagewxUrl+row.img"></image>
@ -492,7 +492,7 @@
padding-left: 20px;
padding-right: 20px;
text-align: right;
height: 100upx;
height: 50upx;
/* #ifdef APP-PLUS */
margin-top: var(--status-bar-height);

@ -61,14 +61,11 @@
</template>
<script>
// #ifdef H5
var jweixin = require('jweixin-module');
// #endif
let app = getApp();
import {
getListOutRechargePrice,
addOrderPay,
orderToUNionPay
orderToUnionPayphone
} from '../../../Utils/Api.js';
export default {
data() {
@ -167,11 +164,8 @@
addOrderPay(params).then(res => {
uni.hideLoading()
if (res.return_code == '000000') {
let params = {
"orderId": res.return_data.id,
"openId": app.globalData.openId
}
this.orderToUNionPay(params);
this.orderToUnionPayphone(res.return_data.id);
} else {
uni.showToast({
title: res.return_msg,
@ -179,17 +173,15 @@
})
}
})
},
//
orderToUNionPay(item) {
orderToUNionPay(item).then(res => {
orderToUnionPayphone(item) {
let params = {
"orderId" : item
}
orderToUnionPayphone(params).then(res => {
if (res.return_code == '000000') {
//
// #ifdef H5
//
this.payRequest(res);
// #endif
this.uniontopay(res.return_data.prepayid);
} else {
uni.showToast({
title: res.return_msg,
@ -198,63 +190,29 @@
}
})
},
//
payRequest: function(self) {
uni.showLoading({
title: '支付中...'
})
jweixin.config({
// debug: false, // ,apialertpclogpc
appId: self.return_data.appId, //
timestamp: self.return_data.timeStamp, //
nonceStr: self.return_data.nonceStr, //
signature: self.return_data.sign, // 1
jsApiList: ['chooseWXPay'] // 使JSJS2
});
uni.hideLoading();
jweixin.ready(function() {
jweixin.checkJsApi({
jsApiList: ['chooseWXPay'], // JSJS2,
success: function(res) {},
fail: function(res) {}
});
jweixin.chooseWXPay({
appId: self.return_data.appId,
timestamp: self.return_data
.timeStamp, // jssdk使timestamp使timeStampS
nonceStr: self.return_data.nonceStr, // 32
package: self.return_data
.package, // prepay_idprepay_id=***
signType: 'MD5', // 'SHA1'使'MD5'
paySign: self.return_data.sign, //
//
uniontopay(item) {
let that = this;
upsdk.pluginReady(function() {
upsdk.pay({
tn: item,
success: function(res) {
//
uni.showToast({
title: '支付成功'
})
if (that.jumpType == 4) {
uni.reLaunch({
url: '/pages/tabBar/user/user'
});
return;
}
uni.reLaunch({
url: '../success/success?id=' + that.couponId
url: '/pages/tabBar/user/user'
});
},
cancel: function(r) {},
fail: function(res) {}
});
});
jweixin.error(function(res) {
uni.showToast({
icon: 'none',
title: '支付失败了',
duration: 4000
fail: function(err) {
uni.showToast({
title: err.msg,
icon: 'none',
duration: 2000
})
// , err.msg , TN,
}
});
// configerrorconfigdebugresSPA
/*alert("config信息验证失败");*/
});
},
}

@ -1,43 +1,33 @@
<template>
<view>
<image class="width90" mode="widthFix" src="../../static/img/unionimg/union1.jpg" @click="jumpunionpay"></image>
<image class="width90" mode="widthFix" src="../../static/img/unionimg/union2.jpg" @click="topay"></image>
<view class="mart15 font16 fcor333">{{arr3}}</view>
<view class="mart15 font16 fcor333">{{arr4}}</view>
<view class="mart15 font16 fcor333">{{arr5}}</view>
<view class="mart15 font16 fcor333">支付信息{{arr6}}</view>
<image class="width90" mode="widthFix" src="../../static/img/unionimg/union2.jpg"></image>
</view>
</template>
<script>
let app = getApp()
export default {
data() {
return {
arr3: '',
arr4: '',
arr5: [],
arr6:''
}
},
onLoad(options) {
// if (JSON.stringify(options) != "{}") {
// this.arr3 = decodeURIComponent(options)
// this.arr4 = options;
// let arr = [];
// for (let s of options) {
// const item = {
// key: s,
// value: options[s]
// }
// arr.push(item);
// }
// this.arr5 = arr;
// }
uni.getStorage({
key: "user",
success(e) {
app.globalData.userInfo = e.data //token
uni.getStorage({
key: 'token',
success(e) {
app.globalData.token = e.data;
}
})
},
fail: res => {}
})
},
methods: {
//
@ -47,13 +37,9 @@
tn: '554191640461075760517',
mode:'00',
success: function(res) {
console.log('======='+res)
this.arr6 = JSON.stringify(res);
// ,
},
fail: function(err) {
console.log('======='+err)
this.arr6 = JSON.stringify(err.msg);
// , err.msg , TN,
}
});

Loading…
Cancel
Save