1.对接工会卡支付

yj-dev
杨杰 4 years ago
parent a8652867b7
commit da1cca7a66
  1. 46
      pages.json
  2. 133
      pages/order/confirmation.vue
  3. 140
      pages/pay/payment/payment.vue
  4. 10
      pages/tabBar/user/user.vue
  5. 4
      pages/user/bindingCard/bindingCard.vue
  6. 3
      pages/user/order_details/order_details.vue
  7. 49
      pages/user/unionCard/unionCard.vue

@ -1,17 +1,6 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/user/bindingCardList/bindingCardList",
"style" :
{
"navigationBarTitleText": "卡列表",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/tabBar/home/home",
"style": {
"navigationBarTextStyle": "white",
@ -30,6 +19,17 @@
}
}
},{
"path" : "pages/user/bindingCardList/bindingCardList",
"style" :
{
"navigationBarTitleText": "卡列表",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/login/login",
"style": {
"navigationBarBackgroundColor": "#0083f5",
@ -289,26 +289,32 @@
}, {
"path": "pages/user/deposit/deposit",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"enablePullDownRefresh": false,
"navigationBarTitleText": "充值",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/pay/payment/payment",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"enablePullDownRefresh": false,
"navigationBarTitleText": "订单支付",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/pay/success/success",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"enablePullDownRefresh": false,
"navigationBarTitleText": "支付成功",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
},
{

@ -10,16 +10,14 @@
<view class="price-number mart10">
<view class="price font16" v-if="couponList.payType == 1">{{couponList.discountPrice}}</view>
<view class="price font16" v-else>
<image style="width: 15px;height: 15px;"
src="../../static/img/jfx.png">
<image style="width: 15px;height: 15px;" src="../../static/img/jfx.png">
</image>{{couponList.discountPrice*100}}
</view>
<view class="number fcor666 font13 margle" v-if="couponList.payType == 1">
{{couponList.salesPrice}}
</view>
<view class="number fcor666 font13 margle" v-else>
<image style="width: 15px;height: 15px;"
src="../../static/img/jfh.png">
<image style="width: 15px;height: 15px;" src="../../static/img/jfh.png">
</image>{{couponList.salesPrice*100}}
</view>
<view class="flright fotrt paddleft10">x1</view>
@ -35,8 +33,7 @@
{{couponList.discountPrice}}
</view>
<view class="width40 flright alijun paddtright10 font15 fontwig6 fcor666 aliitem" v-else>
<image style="width: 15px;height: 15px;"
src="../../static/img/jfx.png">
<image style="width: 15px;height: 15px;" src="../../static/img/jfx.png">
</image>{{couponList.discountPrice*100}}
</view>
</view>
@ -98,13 +95,13 @@
</view>
</view>
<view class="width94 line1 mart5 marb5" v-if="couponList.payType == 1 || couponList.payType==3 "></view>
<view class="height50 width100 backcorfff" @tap="paytype='gonghuika'">
<view class="height50 width100 backcorfff" @tap="paytype='gonghuika'">
<view class="width70 flleft fcor333 fontwig6 font16 text1" style="padding-left: 4%;">
工会卡支付<text class="font14 fcor666 margle">可用余额: </text>
工会卡支付<text class="font14 fcor666 margle">可用余额: {{tongCardPrice}}</text>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;">
<radio :checked="paytype=='gonghuika'" color="#0083f5" />
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view>
</view>
</view>
@ -125,8 +122,7 @@
<view class="settlement">
<view class="sum">实付:<view class="money" v-if="couponList.payType == 1">{{paytheprice}}</view>
<view class="money aliitem" v-else>
<image style="width: 15px;height: 15px;vertical-align: sub;"
src="../../static/img/jfx.png">
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../static/img/jfx.png">
</image>{{paytheprice*100}}
</view>
</view>
@ -171,7 +167,9 @@
bindUserPhone,
orderToPay,
orderToGoldPay,
findUser
findUser,
hltUnionCardPay,
getHuiLianTongCardBalance
} from '../../Utils/Api.js';
import wybPopup from '../../components/wyb-popup/wyb-popup.vue';
import ssPaymentPassword from '../../components/sanshui-payment-password'
@ -206,18 +204,29 @@
PaymentPassword: '',
isture: true,
orderId: '',
jumpType:''
jumpType: '',
tongCardPrice: 0,
balanceCardNo : ''
};
},
onLoad(option) {
this.couponId = option.id;
this.getCouponById();
this.getUserNormalDiscountList();
},
onShow() {
this.user = app.globalData.userInfo;
this.findUser();
let that =this;
that.paytype = '';
that.user = app.globalData.userInfo;
that.findUser();
uni.getStorage({
key: 'balanceCardNo',
success(e) {
that.balanceCardNo = e.data;
that.getHuiLianTongCardBalance();
}
})
},
onHide() {
@ -254,7 +263,7 @@
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
uni.setStorage({
uni.setStorage({
key: "user",
data: res.return_data
})
@ -329,6 +338,19 @@
}
})
},
//
//
getHuiLianTongCardBalance() {
let params = {
cardNo: this.balanceCardNo
}
getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') {
this.tongCardPrice = res.return_data.balance;
}
});
},
// H5
jumpH5Bding() {
uni.navigateTo({
@ -400,7 +422,24 @@
}
})
},
//
changeRiado() {
if (!this.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
orderToPay(item) {
let that = this;
@ -453,7 +492,7 @@
}
})
} else if (that.paytype == 'jinbi') {
if(!that.user.isSetPayPwd){
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../login/updatePas/updatePas'
})
@ -461,6 +500,24 @@
}
that.isture = false;
that.$refs.paymentPassword.modalFun('show');
} else if (that.paytype == 'gonghuika') {
if (!that.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.isture = false;
that.$refs.paymentPassword.modalFun('show');
} else {
uni.showToast({
title: '请选择支付方式',
@ -475,18 +532,49 @@
uni.showLoading({
title: '支付中...'
})
if (this.paytype == 'jinbi') {
let params = {
"orderId": this.orderId,
"password": this.PaymentPassword
}
orderToGoldPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '../pay/success/success?id=' + this.couponId
});
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
let params = {
"orderId": this.orderId,
"cardNo": this.balanceCardNo,
"password": this.PaymentPassword
}
orderToGoldPay(params).then(res => {
hltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url:'../pay/success/success?id=' + this.couponId
url: '../pay/success/success?id=' + this.couponId
});
return;
}
@ -500,8 +588,9 @@
title: res.return_msg,
icon: 'none'
})
})
},
payRequest: function(self) {
uni.showLoading({

@ -6,8 +6,8 @@
<view class="row">
<view class="nominal">订单金额:</view>
<view class="text" v-if="pryType == 1">{{amount}} </view>
<view class="text" v-if="pryType == 2">{{amount*100}} 个积分 (当前积分:{{user.gold}})</view>
<view class="text" v-if="pryType == 3">{{amount}}(当前积分:{{user.gold}})</view>
<view class="text" v-if="pryType == 2">{{amount*100}} 个积分</view>
<view class="text" v-if="pryType == 3">{{amount}}</view>
</view>
</view>
</view>
@ -25,12 +25,25 @@
</image>
</view>
<view class="center">
积分支付
积分支付(积分:{{user.gold}})
</view>
<view class="right">
<radio :checked="paytype=='jinbi'" color="#0083f5" />
</view>
</view>
<view class="row" @tap="paytype='gonghuika'">
<view class="left">
<image
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjE2ODUyMjc2NDc1IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI0MDMiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTEyIDUwOS4xbS00NDQuNCAwYTQ0NC40IDQ0NC40IDAgMSAwIDg4OC44IDAgNDQ0LjQgNDQ0LjQgMCAxIDAtODg4LjggMFoiIGZpbGw9IiNGQUIwMDEiIHAtaWQ9IjI0MDQiPjwvcGF0aD48cGF0aCBkPSJNODg3LjcgNDU5LjFjMC0xMzIuNS01OC0yNTEuMy0xNTAtMzMyLjdDNjcxLjYgODcuMiA1OTQuNCA2NC43IDUxMiA2NC43Yy0yNDUuNCAwLTQ0NC40IDE5OS00NDQuNCA0NDQuNCAwIDEzMi41IDU4IDI1MS4zIDE1MCAzMzIuNyA2Ni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0LjMgMTEuNi0yNS45IDI1LjktMjUuOWg5Mi4yYzE0LjMgMCAyNS45LTExLjYgMjUuOS0yNS45di0xMC45YzAtMTQuOC0xMi40LTI2LjYtMjcuMi0yNS45LTM4LjggMS43LTc3LjUgMi43LTExNC42IDMtMTIuMSAwLjEtMjIuOS04LjMtMjUuNC0yMC4xIDAtMC4yLTAuMS0wLjQtMC4xLTAuNi0zLjQtMTYuMSA4LjMtMzEuNCAyNC44LTMxLjggMTE4LTIuNyAyNDUuOS0xMC42IDMzOC4zLTIyLjggMTEuNi0xLjUgMjIuNyA0LjkgMjcuMiAxNS43bDEuMSAyLjZjNi42IDE1LjgtMy40IDMzLjYtMjAuNCAzNS44LTM2LjkgNC45LTc3LjIgOC43LTExOS4zIDExLjktMTMuNSAxLTIzLjkgMTIuMy0yMy45IDI1Ljl2MTcuM2MwIDE0LjMgMTEuNiAyNS45IDI1LjkgMjUuOWg5N2MxNC4zIDAgMjUuOSAxMS42IDI1LjkgMjUuOXYxNTguM3oiIGZpbGw9IiNGRkZGRkYiIHAtaWQ9IjI0MDciPjwvcGF0aD48L3N2Zz4=">
</image>
</view>
<view class="center">
工会卡支付(余额:{{tongCardPrice}})
</view>
<view class="right">
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view>
</view>
<view class="row" @tap="paytype='wxpay'" v-if="pryType == 1 || pryType==3 ">
<view class="left">
<image :src="imagewxUrl+imgadres"></image>
@ -61,7 +74,9 @@
<script>
import {
orderToPay,
orderToGoldPay
orderToGoldPay,
getHuiLianTongCardBalance,
hltUnionCardPay
} from '../../../Utils/Api.js'
import ssPaymentPassword from '../../../components/sanshui-payment-password'
let app = getApp();
@ -83,7 +98,9 @@
user: '',
couponId: '',
jumpType: '',
PaymentPassword: ''
PaymentPassword: '',
balanceCardNo: '',
tongCardPrice: 0
};
},
onLoad(e) {
@ -101,7 +118,48 @@
}
this.amount = parseFloat(e.amount).toFixed(2);
},
onShow() {
let that = this;
uni.getStorage({
key: 'balanceCardNo',
success(e) {
that.balanceCardNo = e.data;
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.balanceCardNo
}
getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') {
this.tongCardPrice = res.return_data.balance;
}
});
},
//
orderToPay() {
let that = this;
@ -160,13 +218,30 @@
}
})
} else if (that.paytype == 'jinbi') {
if(!that.user.isSetPayPwd){
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
that.$refs.paymentPassword.modalFun('show');
} else if (that.paytype == 'gonghuika') {
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');
} else {
uni.showToast({
title: '请选择支付方式',
@ -180,26 +255,57 @@
uni.showLoading({
title: '支付中...'
})
if (this.paytype == 'jinbi') {
let params = {
"orderId": this.orderNo,
"password": this.PaymentPassword
}
orderToGoldPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
if (this.jumpType == 4) {
uni.reLaunch({
url: '/pages/tabBar/user/user'
});
return;
}
uni.reLaunch({
url: '../success/success?id=' + this.couponId
});
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
let params = {
"orderId": this.orderNo,
"cardNo": this.balanceCardNo,
"password": this.PaymentPassword
}
orderToGoldPay(params).then(res => {
hltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
if (this.jumpType == 4) {
uni.reLaunch({
url: '/pages/tabBar/user/user'
});
return;
}
uni.reLaunch({
url: '../success/success?id=' + this.couponId
});
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
@ -207,12 +313,10 @@
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
},
payRequest: function(self) {
@ -237,10 +341,10 @@
jweixin.chooseWXPay({
appId: self.return_data.appId,
timestamp: self.return_data
.timeStamp, // jssdk使timestamp使timeStampS
.timeStamp, // jssdk使timestamp使timeStampS
nonceStr: self.return_data.nonceStr, // 32
package: self.return_data
.package, // prepay_idprepay_id=***
.package, // prepay_idprepay_id=***
signType: 'MD5', // 'SHA1'使'MD5'
paySign: self.return_data.sign, //
success: function(res) {

@ -210,11 +210,11 @@
],
//
czList: [
{
url: '../../user/bindingCardList/bindingCardList',
text: '卡列表',
img: '../../../static/img/pas.png'
},
// {
// url: '../../user/bindingCardList/bindingCardList',
// text: '',
// img: '../../../static/img/pas.png'
// },
{
url: '../../user/unionCard/unionCard',
text: '卡记录',

@ -149,6 +149,10 @@
bindHuiLianTongCard(params).then(res => {
uni.hideLoading()
if (res.return_code == '000000') {
uni.setStorage({
key: "balanceCardNo",
data: this.cardNoNumber
})
uni.showToast({
title: '绑定成功',
icon: "success",

@ -89,6 +89,9 @@
<view class="right" v-if="recinfo.payType == 3">
积分
</view>
<view class="right" v-if="recinfo.payType == 4">
工会卡
</view>
</view>
<view class="row" v-if="recinfo.totalPrice">
<view class="left">

@ -23,7 +23,7 @@
<view class="li">
<text class="font15 fcor333">开始时间</text>
<view class="flex1">
<picker mode="date" :value="start_date" :start="start_date" @change="bindDateChange">
<picker mode="date" :value="start_date" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="date">{{start_date}}</view>
</picker>
</view>
@ -31,7 +31,7 @@
<view class="li">
<text class="font15 fcor333">结束时间</text>
<view class="flex1">
<picker mode="date" :value="end_date" :start="end_date" @change="bindDateChange2">
<picker mode="date" :value="end_date" :start="startDate" :end="endDate" @change="bindDateChange2">
<view class="date">{{end_date}}</view>
</picker>
</view>
@ -66,6 +66,7 @@
getHuiLianTongCardBalance,
getHuiLianTongCardConsume
} from '../../../Utils/Api.js';
let app = getApp();
export default {
data() {
const currentDate = this.getDate({
@ -93,12 +94,45 @@
cardConsumeList : [],
pageNum: 1,
pageSize: 10,
isNoMoreData: false
isNoMoreData: false,
user: ''
}
},
onLoad() {
},
onShow() {
this.user = app.globalData.userInfo;
if (!this.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
this.getUserCardList();
},
//
onReachBottom() {
this.getHuiLianTongCardConsume();
},
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
methods: {
//
bindDateChange: function(e) {
@ -162,6 +196,7 @@
},
//
getHuiLianTongCardConsumeOpen(){
this.pageNum = 1;
this.isNoMoreData = false;
this.cardConsumeList = [];
this.getHuiLianTongCardConsume();
@ -170,12 +205,12 @@
//
getHuiLianTongCardConsume() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
return false;
}
uni.showLoading({
title: '加载中...'
})
let pagenum = this.pageNum;
let Time1 = new Date(this.start_date);
let timestemp1 = Time1.getTime();
@ -199,7 +234,7 @@
this.cardConsumeList = [];
uni.hideLoading();
uni.showToast({
title:res.return_msg,
title:'请求超时稍后重试!',
icon:'none',
duration: 2000
})

Loading…
Cancel
Save