1.对接话费充值 积分抵扣

yj-dev
杨杰 3 years ago
parent a5d446156b
commit 9d0bbcb5fc
  1. 12
      Utils/Api.js
  2. 2
      Utils/Request.js
  3. 24
      pages.json
  4. 42
      pages/goods/refuel-details/refuel-details.vue
  5. 4
      pages/tabBar/category/category.vue
  6. 2
      pages/tabBar/home/home.vue
  7. 4
      pages/tabBar/user/user.vue
  8. 17
      pages/user/order_list/order_list.vue
  9. 12
      subPages/Phone-recharge-details/Phone-recharge-details.vue
  10. 41
      subPages/recharge-centre/recharge-centre.vue
  11. 562
      subPages/recharge-pay/recharge-pay.vue
  12. 505
      subPages/rechargeDetails/rechargeDetails.vue
  13. 215
      subPages/unionComfirmation/unionComfirmation.vue
  14. 139
      subPages/unionPay-orderList/unionPay-orderList.vue

@ -221,6 +221,10 @@ export const setCacheParam = params => {
export const getPhoneOrderById = params => {
return POST('GET', `${base}/outRechargeOrder/getOrderById`, params).then(res => res.data);
}
// 取消话费订单
export const cancelRechargeOrder = params => {
return POST('GET', `${base}/outRechargeOrder/cancelOrder`, params).then(res => res.data);
}
//优惠券包列表
export const getDiscountPackageList = params => {
return POST('GET', `${base}/discountPackage/getDiscountPackageList`, params).then(res => res.data);
@ -437,12 +441,12 @@ export const findById = params => {
return POST('GET', `${base}/outRechargePrice/findById`, params).then(res => res.data);
}
//提交订单
export const orderToUNionPay = params => {
return POST('POST', `${base}/outRechargeOrder/orderToPay`, params).then(res => res.data);
export const orderToPayByWx = params => {
return POST('POST', `${base}/czOrder/orderToPayByWx`, params).then(res => res.data);
}
//工会卡支付
export const hltUnionCardPayUnion = params => {
return POST('POST', `${base}/outRechargeOrder/hltUnionCardPay`, params).then(res => res.data);
export const hltUnionCardPayghk = params => {
return POST('POST', `${base}/czOrder/hltUnionCardPay`, params).then(res => res.data);
}
//话费列表
export const getUserOrderListhuafei = params => {

@ -58,7 +58,7 @@ function request(method, url, data) {
},
fail(err) {
uni.showToast({
title: '请求失败',
title: '网络异常',
icon: 'none',
duration: 1500,
})

@ -172,7 +172,6 @@
{
"path": "pages/goods/goods",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTitleText": "详情",
@ -472,7 +471,6 @@
"navigationBarTextStyle": "white"
}
}
],
"subpackages": [{
"root": "subPages",
@ -672,6 +670,28 @@
"navigationBarTextStyle": "white"
}
}, {
"path": "rechargeDetails/rechargeDetails",
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
} ,{
"path" : "recharge-pay/recharge-pay",
"style" :
{
"navigationBarTitleText": "支付",
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
}
]
}],

@ -66,7 +66,7 @@
<view class="width90 height40 mart10" style="border: 1px solid #f2f2f2;">
<view class="width8 flleft"></view>
<input type="digit" class="font16 width60 flleft height40" placeholder="输入金额(保留2位小数)" v-model="inputMoney"
@blur="Listeningfocus" />
@input="Listeningfocus" />
<view class="width30 height40 flright font14 fcor999 fotct"
style="border-left: 1px solid #f2f2f2;line-height: 40px;">
{{oilLiters}}L
@ -423,7 +423,7 @@
var a = /^[0-9]+(\.[0-9]{1})?$/;
var b = /^[0-9]+(.[0-9]{1})?$/;
var c = /^([1-9][0-9]*)+(\.[0-9]{1,2})?$/;
if (this.inputMoney == '' || this.inputMoney < 10 || !(c.test(this.inputMoney))) {
if (this.inputMoney == '') {
uni.showToast({
title: '请输入正确加油金额',
icon: "none",
@ -441,38 +441,25 @@
this.totalPreferences = '0';
return;
}
// let inputs = this.inputMoney.split('.');
// if (inputs[1] != undefined && inputs[1].length > 1) {
// uni.showToast({
// title: '1',
// icon: "none",
// duration:2000
// });
// return;
// }
if (parseInt(this.inputMoney) > parseInt(this.xzMoney)) {
uni.showToast({
title: '加油金额不能超过' + this.xzMoney + '元',
icon: "none",
duration: 2000
});
this.inputMoney = this.xzMoney;
this.totalPrice = '0.00';
this.discountPrice = '0.00';
this.litre = '';
this.inputMoney = '';
this.oilLiters = '0';
this.discount = '0';
this.oilSubsidy = '0';
this.litersPreferences = '0';
this.pricePreferences = '0';
this.totalPreferences = '0';
return;
}
//
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4);
// this.totalPrice = this.numFilter(arr1);
this.oilPriceDiscountCompute();
//
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2);
// if (this.priceVip != this.priceGun) {
// let gbprice = parseFloat(this.litre * this.priceGun).toFixed(2);
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(0);
// }
},
//
oilPriceDiscountCompute() {
@ -525,7 +512,8 @@
*/
postionIng() {
let that = this;
if (that.inputMoney == '' || that.inputMoney < 10) {
var c = /^([1-9][0-9]*)+(\.[0-9]{1,2})?$/;
if (that.inputMoney == '' || that.inputMoney < 10 || !(c.test(this.inputMoney))) {
uni.showToast({
title: '请输入正确金额',
icon: "none",

@ -191,6 +191,10 @@
this.MerchantList = res.return_data;
this.showCategoryIndex = res.return_data[0].merchantName;
this.showCategoryIndexId = res.return_data[0].id;
this.pageNum = 1;
this.pageSize = 10;
this.isNoMoreData = false;
this.categoryList = [];
this.getStoreListByMerchant();
} else {

@ -265,7 +265,7 @@
methods: {
jumpcdx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
},
//
getCmsContentcmsContent() {

@ -65,6 +65,8 @@
<view class="title">话费充值</view>
<view class="list">
<view class="box" v-for="(row,index) in huafeiList" :key="index" @tap="toOrdehuafeirList(index)">
<uni-badge style="width: 20px;position: absolute; left: 15%;" v-if="row.text == '待支付' && rechargeOrderNum "
:text="rechargeOrderNum" type="error" size="normal"></uni-badge>
<view class="img">
<view class="icon" :class="row.icon"></view>
</view>
@ -158,6 +160,7 @@
textnum: '',
textSend: '',
therrNum: '',
rechargeOrderNum:'', //
headerTop: null,
statusTop: null,
showHeader: true,
@ -362,6 +365,7 @@
this.textnum = res.return_data.unusedCouponNum;
this.textSend = res.return_data.unusedDiscount;
this.therrNum = res.return_data.unpaid;
this.rechargeOrderNum = res.return_data.rechargeOrderNum;
uni.setStorage({
key: "user",
data: res.return_data

@ -294,22 +294,7 @@
}
});
},
doCancelOrder(ordersn) {
let typeNum = this.orderList.length;
for (let i = 0; i < typeNum; i++) {
let list = this.orderList[i];
let orderNum = list.length;
if (orderNum > 0 && list[0].type == 'unpaid') {
for (let j = 0; j < orderNum; j++) {
if (this.orderList[i][j].ordersn == ordersn) {
this.orderList[i][j].type = 'cancelled';
break;
}
}
}
}
},
//
toPayment(row) {
let payTypes;
if (row.payType == 1 || row.payType == null) {

@ -20,7 +20,7 @@
</view>
<view class="width90 mart15 height22">
<view class="flleft fcor333 width50 font15">支付成功</view>
<view class="flright fcor666 width50 fotrt font13">{{phoneorderdes.payPrice}}</view>
<view class="flright fcor666 width50 fotrt font13">{{phoneorderdes.payRealPrice}}</view>
</view>
<view class="width90 fcor666 font13">
{{phoneorderdes.payTime | timeFormat('yyyy-mm-dd')}} {{phoneorderdes.payTime | timeFormat('hh:mm')}}
@ -28,15 +28,19 @@
<view class="linec6 width90 mart10"></view>
<view class="width90 mart10 fcor333 font15">
话费充值 : {{phoneorderdes.userPhone}}{{phoneorderdes.remarks}}
话费充值 : {{phoneorderdes.userPhone}}{{phoneorderdes.operatorName}}
</view>
<view class="width90 mart15 height22">
<view class="flleft fcor333 width50 font15">订单总额</view>
<view class="flright fcor666 width50 fotrt font13">{{phoneorderdes.orderPrice == null ? '0': phoneorderdes.orderPrice}}</view>
</view>
<view class="width90 mart15 height22">
<view class="flleft fcor333 width50 font15">优惠</view>
<view class="flright fcor666 width50 fotrt font13">{{phoneorderdes.deductionPrice == null ? '0': phoneorderdes.deductionPrice}}</view>
<view class="flleft fcor333 width50 font15">优惠券抵扣</view>
<view class="flright fcor666 width50 fotrt font13">{{phoneorderdes.discountDeductionPrice == null ? '0': phoneorderdes.discountDeductionPrice}}</view>
</view>
<view class="width90 mart15 height22">
<view class="flleft fcor333 width50 font15">积分抵扣</view>
<view class="flright fcor666 width50 fotrt font13">{{phoneorderdes.integralDeductionPrice == null ? '0': phoneorderdes.integralDeductionPrice}}</view>
</view>
<view class="width90 mart15 height22">
<view class="flleft fcor333 width50 font15">实际支付金额</view>

@ -121,8 +121,7 @@
import QSTabs from '../../components/QS-tabs/QS-tabs.vue';
import {
getListOutRechargePrice,
addOrderPay,
orderToUNionPay
addOrderPay
} from '../../Utils/Api.js';
export default {
components: {
@ -304,44 +303,6 @@
}
})
// uni.showLoading({
// title: '...'
// })
// 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);
// } else {
// uni.showToast({
// title: res.return_msg,
// icon: "none"
// })
// }
// })
},
//
orderToUNionPay(item) {
orderToUNionPay(item).then(res => {
if (res.return_code == '000000') {
//
// #ifdef H5
//
this.payRequest(res);
// #endif
} else {
uni.showToast({
title: res.return_msg,
icon: 'none'
})
}
})
},
//
payRequest: function(self) {

@ -0,0 +1,562 @@
<template>
<view>
<view class="block">
<view class="content">
<view class="orderinfo">
<view class="row">
<view class="nominal">支付金额:</view>
<view class="text">{{payPrice}} </view>
</view>
</view>
</view>
</view>
<view class="block">
<view class="title">
选择支付方式
</view>
<view class="content">
<view class="pay-list">
<view class="width100" v-for="(item,index) in paytypeList" :key="index">
<view class="row" v-if="item == 3" @tap="paytype='3'">
<view class="left">
<image style="border-radius: 50%;" src='../../static/img/ghkpay.png'></image>
</view>
<view class="center">
汇联通工会卡(余额:{{tongCardPrice}})
</view>
<view class="right">
<radio :checked="paytype=='3'" @click="changeRiado()" color="#0083f5" />
</view>
</view>
<view class="row" v-if="item == 2" @tap="paytype='2'">
<view class="left">
<image :src="imagewxUrl+imgadres"></image>
</view>
<view class="center">
微信支付
</view>
<view class="right">
<radio :checked="paytype=='2'" color="#0083f5" />
</view>
</view>
</view>
</view>
</view>
</view>
<view class="pay">
<view class="btn" @tap="orderToPay">立即支付</view>
<view class="tis">
点击立即支付即代表您同意<view class="terms">
条款协议
</view>
</view>
</view>
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" />
</view>
</template>
<script>
import {
orderToPayByWx,
orderToGoldPay,
getHuiLianTongCardBalance,
hltUnionCardPayghk,
oilCardPay,
findUser,
findById
} 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 {
amount: 0,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wxpay.png',
imgadres1: 'oilcard.png',
orderNo: '',
goodsid: '', //id
user: '',
PaymentPassword: '',
tongCardPrice: 0,
payPrice: '', //
oilPirce: 0, //
paytypeList: [], //
rechargeDes: '', //
};
},
onLoad(e) {
this.orderNo = e.orderId;
this.goodsid = e.goodsId;
this.payPrice = e.payPrice;
if (!app.globalData.userInfo) {
this.findUser();
}
},
onShow() {
let that = this;
that.user = app.globalData.userInfo;
if (this.user.hltCardNo) {
that.getHuiLianTongCardBalance();
}
that.findById();
if (app.globalData.userInfo) {
that.findUser();
}
},
methods: {
//
findById() {
uni.showLoading({
title: '加载中'
})
let showType;
// #ifdef H5
showType = 2;
// #endif
// #ifdef MP
showType = 1;
// #endif
let datas = {
platformId: showType,
id: this.goodsid
}
findById(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.rechargeDes = res.return_data;
this.paytypeList = res.return_data.productPayTypeString.split(',');
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1);
}
});
},
//
findUser() {
let params;
findUser(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
if (res.return_data.oilCard) {
this.oilPirce = res.return_data.oilCard.amount;
}
uni.setStorage({
key: "user",
data: res.return_data
})
}
});
},
//
changeRiado() {
if (!this.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
changeRiado1() {
if (!this.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../pages/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 == '2') {
// #ifdef H5
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"openIdType": 2
}
// #endif
// #ifdef MP
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
}
// #endif
orderToPayByWx(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: '../Phone-recharge-details/Phone-recharge-details?id=' +
that.orderNo
})
},
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 == '3') {
if (that.tongCardPrice < that.payPrice) {
uni.showToast({
icon: 'none',
title: '工会卡余额不足',
duration: 2000,
});
return;
}
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} else if (that.paytype == 'oilcard') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} else {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
}
},
submitHandle(e) {
this.PaymentPassword = e.value;
uni.showLoading({
title: '支付中...'
})
if (this.paytype == '3') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPayghk(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
that.orderNo
})
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
// if (this.paytype == 'oilcard') {
// let params = {
// "orderId": this.orderNo,
// "cardNo": this.user.oilCard.cardNo,
// "password": this.PaymentPassword
// }
// oilCardPay(params).then(res => {
// uni.hideLoading();
// if (res.return_code == '000000') {
// uni.showToast({
// title: ''
// })
// uni.reLaunch({
// url: '../../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'
// })
// })
// return;
// }
},
payRequest: function(self) {
uni.showLoading({
title: '支付中...'
})
jweixin.config({
// debug: true, // ,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, //
success: function(res) {
//
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
that.orderNo
})
},
cancel: function(r) {},
fail: function(res) {}
});
});
jweixin.error(function(res) {
uni.showToast({
icon: 'none',
title: '支付失败了',
duration: 4000
});
// configerrorconfigdebugresSPA
/*alert("config信息验证失败");*/
});
},
}
}
</script>
<style lang="scss">
.block {
width: 94%;
padding: 0 3% 40upx 3%;
.title {
width: 100%;
font-size: 34upx;
}
.content {
.orderinfo {
width: 100%;
border-bottom: solid 1upx #eee;
.row {
width: 100%;
height: 90upx;
display: flex;
align-items: center;
.nominal {
flex-shrink: 0;
font-size: 32upx;
color: #7d7d7d;
}
.text {
width: 70%;
margin-left: 10upx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 32upx;
}
}
}
.pay-list {
width: 100%;
border-bottom: solid 1upx #eee;
.row {
width: 100%;
height: 120upx;
display: flex;
align-items: center;
.left {
width: 100upx;
flex-shrink: 0;
display: flex;
align-items: center;
image {
width: 80upx;
height: 80upx;
}
}
.center {
width: 100%;
font-size: 30upx;
}
.right {
width: 100upx;
flex-shrink: 0;
display: flex;
justify-content: flex-end;
}
}
}
}
}
.pay {
margin-top: 20upx;
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
.btn {
width: 70%;
height: 80upx;
border-radius: 80upx;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
background-color: #0083f5;
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.2);
}
.tis {
margin-top: 10upx;
width: 100%;
font-size: 24upx;
display: flex;
justify-content: center;
align-items: baseline;
color: #999;
.terms {
color: #5a9ef7;
}
}
}
</style>

@ -0,0 +1,505 @@
<template>
<view>
<view class="width100 font18 fcorfff fotct height40 backcorf06">{{typeText[recinfo.payStatus]}}</view>
<!-- 购买商品列表 -->
<view class="buy-list">
<!-- v-for="(row,index) in buylist" :key="index" -->
<view class="row">
<view class="goods-info">
<view class="img">
<image mode="widthFix" v-if="recinfo.operatorType == 3" src="../static/cz1.jpg"></image>
<image mode="widthFix" v-if="recinfo.operatorType == 2" src="../static/cz3.jpg"></image>
<image mode="widthFix" v-if="recinfo.operatorType == 1" src="../static/cz2.jpg"></image>
</view>
<view class="info">
<view class="title">{{recinfo.operatorName}}</view>
<view class="price-number">
{{recinfo.orderPrice}}
</view>
</view>
</view>
</view>
</view>
<!-- 提示-备注 -->
<view class="order">
<view class="row" v-if="recinfo.orderNo">
<view class="left">
订单流水 :
</view>
<view class="right">
{{recinfo.orderNo}}
</view>
</view>
<view class="row" v-if="recinfo.paySerialNo">
<view class="left">
支付流水 :
</view>
<view class="right">
{{recinfo.paySerialNo}}
</view>
</view>
<view class="row" v-if="recinfo.payType">
<view class="left">
支付方式 :
</view>
<view class="right" v-if="recinfo.payType == 1">
支付宝
</view>
<view class="right" v-if="recinfo.payType == 2">
微信
</view>
<view class="right" v-if="recinfo.payType == 3">
汇联通工会卡
</view>
</view>
<view class="row" v-if="recinfo.rechargeStatus">
<view class="left">
充值状态 :
</view>
<view class="right" v-if="recinfo.rechargeStatus == 201 || recinfo.rechargeStatus == 204">
充值中
</view>
<view class="right" v-if="recinfo.rechargeStatus == 202">
充值成功
</view>
<view class="right" v-if="recinfo.rechargeStatus == 203">
充值失败
</view>
</view>
<view class="row" v-if="recinfo.orderPrice">
<view class="left">
订单总额 :
</view>
<view class="right">
{{recinfo.orderPrice}}
</view>
</view>
<view class="row" v-if="recinfo.discountDeductionPrice">
<view class="left">
优惠券金额 :
</view>
<view class="right">
{{recinfo.discountDeductionPrice}}
</view>
</view>
<view class="row">
<view class="left">
应付金额 :
</view>
<view class="right">
{{recinfo.outRechargePrice.payPrice}}
</view>
</view>
<view class="row" v-if="recinfo.integralDeductionPrice">
<view class="left">
积分抵扣金额 :
</view>
<view class="right">
{{recinfo.integralDeductionPrice}}
</view>
</view>
<view class="row">
<view class="left">
实付金额 :
</view>
<view class="right">
{{recinfo.payRealPrice}}
</view>
</view>
<view class="row">
<view class="left">
下单时间 :
</view>
<view class="right">
{{recinfo.createTimed | formatDate('-')}}
</view>
</view>
<view class="row" v-if="recinfo.payTime">
<view class="left">
支付时间 :
</view>
<view class="right">
{{recinfo.payTime | formatDate('-')}}
</view>
</view>
<view class="row" v-if="recinfo.cancelTime">
<view class="left">
取消时间 :
</view>
<view class="right">
{{recinfo.cancelTime | formatDate('-')}}
</view>
</view>
<view class="row" v-if="recinfo.refundTime">
<view class="left">
退款时间 :
</view>
<view class="right">
{{recinfo.refundTime | formatDate('-')}}
</view>
</view>
<view class="row" v-if="recinfo.finishTime">
<view class="left">
完成时间 :
</view>
<view class="right">
{{recinfo.finishTime | formatDate('-')}}
</view>
</view>
</view>
<view class="width100 height60"></view>
<view class="footer" v-if="recinfo.payStatus == 101">
<view class="settlement">
<view class="sum">合计:
<view class="money">{{recinfo.payRealPrice}}</view>
</view>
<view class="btn" @tap="cancelOrder" style="border: 1px solid #0083f5;color: #0083f5;">取消订单</view>
<view class="btn" @tap="toPay" style="background-color: #0083f5;color: #fff;">去支付</view>
</view>
</view>
</view>
</template>
<script>
import {
getPhoneOrderById,
cancelRechargeOrder,
} from '../../Utils/Api.js'
let app = getApp()
export default {
data() {
return {
buylist: [], //
goodsPrice: 0.0, //
sumPrice: 0.0, //
freight: 12.00, //
note: '', //
int: 1200, //
deduction: 0, //
recinfo: [],
orderId: '',
imageUrl: app.globalData.imgUrl,
preByOrderInfo: '',
typeText: {
101: '等待付款',
102: '订单已支付',
100: '订单已完成',
104: '订单已取消',
105: '订单已退款'
},
};
},
onShow() {
//
this.getPhoneOrderById();
},
onHide() {
},
onLoad(option) {
this.orderId = option.id
},
filters: {
toFixed: function(x) {
return parseFloat(x).toFixed(2);
},
//
formatDate: function(value, spe = '/') {
let data = new Date(value);
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
let h = data.getHours();
let mm = data.getMinutes();
let s = data.getSeconds();
month = month >= 10 ? month : "0" + month;
day = day >= 10 ? day : "0" + day;
h = h >= 10 ? h : "0" + h;
mm = mm >= 10 ? mm : "0" + mm;
s = s >= 10 ? s : "0" + s;
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
}
},
methods: {
getPhoneOrderById() {
uni.showLoading({
title: '加载中...'
})
let params = {
orderId: this.orderId,
}
getPhoneOrderById(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
this.recinfo = res.return_data;
} else {
uni.hideLoading()
}
})
},
//
cancelOrder() {
let that = this;
uni.showModal({
title: '取消订单',
content: '确定取消此订单?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '加载中...'
})
let params = {
orderId: this.recinfo.id
}
cancelRechargeOrder(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
let pages = getCurrentPages() //
let prePage = pages[pages.length - 2] //
prePage.$vm.reFresh = Math.random() //
uni.navigateBack() //
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
uni.hideLoading()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
toPay() {
uni.redirectTo({
url: '../recharge-pay/recharge-pay?goodsId=' + this.recinfo.goodsId + '&payPrice=' + this
.recinfo.payRealPrice+'&orderId='+this.recinfo.id
})
},
}
}
</script>
<style lang="scss">
.addr {
width: 86%;
padding: 20upx 3%;
margin: 30upx auto 20upx auto;
box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
border-radius: 20upx;
display: flex;
.icon {
width: 80upx;
height: 80upx;
display: flex;
align-items: center;
image {
width: 60upx;
height: 60upx;
}
}
.tel-name {
width: 100%;
display: flex;
font-size: 32upx;
.tel {
margin-left: 40upx;
}
}
.addres {
width: 100%;
font-size: 26upx;
color: #999;
}
}
.buy-list {
width: 86%;
padding: 10upx 3%;
margin: 30upx auto 20upx auto;
box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
border-radius: 20upx;
.row {
margin: 20rpx 0;
.goods-info {
width: 100%;
display: flex;
.img {
width: 80px;
max-height: 80px;
border-radius: 10upx;
overflow: hidden;
flex-shrink: 0;
margin-right: 10upx;
image {
width: 80px;
max-height: 80px;
}
}
.info {
width: 100%;
height: 17vw;
overflow: hidden;
display: flex;
flex-wrap: wrap;
position: relative;
.title {
width: 100%;
font-size: 32upx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
// text-align: justify;
overflow: hidden;
max-height: 25px;
}
.price-number {
position: absolute;
width: 100%;
bottom: 0upx;
display: flex;
justify-content: space-between;
align-items: flex-end;
font-size: 28upx;
height: 40upx;
color: #fe4343;
}
}
}
}
}
.order {
width: 86%;
padding: 10upx 3%;
margin: 30upx auto 20upx auto;
box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
border-radius: 20upx;
.row {
margin: 20upx 0;
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #f4f4f4;
display: flex;
.left {
font-size: 28upx;
}
.right {
margin-left: 40upx;
font-size: 26upx;
color: #999;
input {
font-size: 26upx;
color: #999;
}
}
}
}
.blck {
width: 100%;
height: 100upx;
}
.footer {
width: 92%;
padding: 0 4%;
background-color: #fbfbfb;
height: 100upx;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 28upx;
position: fixed;
bottom: 0upx;
z-index: 5;
.settlement {
width: 100%;
display: flex;
justify-content: flex-end;
align-items: center;
.sum {
color: #FE1A1A;
width: 50%;
font-size: 28upx;
margin-right: 10upx;
display: flex;
height: 26px;
line-height: 26px;
justify-content: flex-start;
.money {
font-size: 20px;
font-weight: 600;
display: flex;
align-items: center;
}
}
.btn {
padding: 0 20upx;
height: 70rpx;
width: 25%;
margin-left: 10px;
display: flex;
justify-content: center;
align-items: center;
font-size: 30upx;
border-radius: 40upx;
}
}
}
.detail {
width: 86%;
padding: 10upx 3%;
margin: 30upx auto 20upx auto;
box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
border-radius: 20upx;
.row {
height: 60upx;
display: flex;
justify-content: space-between;
align-items: center;
.nominal {
font-size: 28upx;
}
.content {
font-size: 26upx;
color: #0083f5;
}
}
}
</style>

@ -25,7 +25,15 @@
{{orderPrice}}
</view>
</view>
<!-- #ifdef MP -->
<view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff">
<view class="width50 flleft fcor333 fontwig6 font16" style="padding-left: 4%;">
折扣金额
</view>
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor999">
{{saveprice}}
</view>
</view>
<view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff" v-if="reType == 2" @click="showPopup()">
<view class="width50 flleft fcor333 fontwig6 font16" style="padding-left: 4%;">
@ -42,7 +50,6 @@
<image style="width: 40rpx;height: 40rpx;" src="../../static/img/jt.png"></image>
</view>
</view>
<!-- #endif -->
</view>
<view class="width94 comorder mart10">
@ -54,8 +61,12 @@
</view>
<view class="cj-slider">
<view class="flleft fotct font14 fcor666" style="width: 15%;">0</view>
<cj-slider style="width: 60%; float:left;" v-model="priceValue" :min="0" :max="availIntegal"
:step="1" :blockWidth="40" @start="blockStart" @moving="blockMoving" @end="blockEnd" />
<cj-slider style="width: 60%; float:left;" v-if="isDiscount" v-model="priceValue" :min="0"
:max="availIntegal" :step="1" :blockWidth="40" @start="blockStart" @moving="blockMoving"
@end="blockEnd" />
<cj-slider style="width: 60%; float:left;" v-if="!isDiscount" v-model="priceValue" :min="0"
:max="availIntegal" :step="1" :blockWidth="40" @start="blockStart" @moving="blockMoving"
@end="blockEnd" />
<view class="flright fotrt font14 fcor666" style="width: 25%;">{{availIntegal}}</view>
</view>
</view>
@ -76,16 +87,6 @@
</view>
</view>
<view class="width100" v-for="(item,index) in paytypeList" :key="index">
<!-- <view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff" @tap="paytype='jinbi'">
<view class="width70 flleft fcor333 fontwig6 font16 text1" style="padding-left: 4%;">
积分支付<text class="font14 fcor666 margle">可用积分: {{user.gold}}</text>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;">
<radio :checked="paytype=='jinbi'" color="#0083f5" />
</view>
</view> -->
<view class="width94 line1 mart5 marb5" v-if="item == 2"></view>
<view class="height50 width100 backcorfff" @tap="paytype='2'" v-if="item == 2">
<view class="width50 flleft fcor666 fontwig6 font16" style="padding-left: 4%;">
@ -157,11 +158,10 @@
<script>
import {
addOrderPay,
orderToUNionPay,
orderToPayByWx,
findUser,
orderToGoldPay,
orderToGoldPayunion,
hltUnionCardPayUnion,
hltUnionCardPayghk,
getHuiLianTongCardBalance,
loginByPhone,
getUserOrderPreList,
@ -208,9 +208,10 @@
rechargeDes: '', //
paytypeList: [], //
priceValue: [0, 0], //
changePrice: '', //
isDiscount: false,
availIntegal: '', //
isUse: true, //
isIntegral: false //使
isUse: true //
};
},
@ -226,12 +227,8 @@
onShow() {
let that = this;
// that.paytype = '2';
that.user = app.globalData.userInfo;
that.findUser();
that.findById();
// #ifdef MP
that.getUserOrderPreList();
// #endif
},
onHide() {
@ -259,30 +256,25 @@
this.rechargeDes = res.return_data;
this.paytypeList = res.return_data.productPayTypeString.split(',');
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1);
if (res.return_data.integralDiscount == 100) {
let payprice = parseFloat(res.return_data.payPrice * 100).toFixed(0);
let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2);
let pprice = parseFloat(res.return_data.payPrice * 100).toFixed(0)
let payprice = parseFloat(res.return_data.payPrice * 100 * zkprice).toFixed(
0);
if (payprice > this.user.gold) {
// this.priceValue[1] = this.user.gold;
this.availIntegal = this.user.gold;
} else {
// this.priceValue[1] = payprice;
this.availIntegal = payprice;
}
} else {
let payprice1 = parseFloat(res.return_data.payPrice * 100).toFixed(0);
// this.priceValue[1] = payprice1;
this.availIntegal = payprice1;
}
}
});
},
//
findUser() {
let params;
findUser(params).then(res => {
findUser().then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
this.findById();
this.getHuiLianTongCardBalance();
uni.setStorage({
key: "user",
@ -309,6 +301,9 @@
//
//
getHuiLianTongCardBalance() {
if (!this.user.hltCardNo) {
return;
}
let params = {
cardNo: this.user.hltCardNo.cardNo
}
@ -325,14 +320,14 @@
url: '/pages/login/register'
})
},
//
radioChanges(item) {
this.paytheprice = this.orderPrice;
this.isDiscount = false;
if (this.memDiscountId == item.id) { //
this.memDiscountId = '';
this.payPrice = this.saveprice;
this.isDiscount = true;
this.deductionPrice = '0.00';
// this.priceValue[1] = parseFloat(this.saveprice * 100).toFixed(0);
this.availIntegal = parseFloat(this.saveprice * 100).toFixed(0);
this.priceCaluc(this.saveprice);
} else { //
@ -341,23 +336,19 @@
//
this.deductionPrice = item.discountPrice;
let oldprice = this.paytheprice - this.deductionPrice;
this.availIntegal = parseFloat(oldprice * 100).toFixed(0);
// this.priceValue[1] = parseFloat(this.payPrice * 100).toFixed(0);
this.priceCaluc(oldprice);
} else if (item.discountType == 2) {
}
if (item.discountType == 2) {
//
this.deductionPrice = item.discountPrice;
let oldprice = this.paytheprice - this.deductionPrice;
this.availIntegal = parseFloat(oldprice * 100).toFixed(0);
// this.priceValue[1] = parseFloat(this.payPrice * 100).toFixed(0);
this.priceCaluc(oldprice);
} else if (item.discountType == 3) {
}
if (item.discountType == 3) {
//
this.deductionPrice = parseFloat(this.paytheprice - (this.paytheprice * item.discountPrice))
.toFixed(2);
let oldprice = parseFloat(this.paytheprice * item.discountPrice).toFixed(2);
this.availIntegal = parseFloat(oldprice * 100).toFixed(0);
// this.priceValue[1] = parseFloat(this.payPrice * 100).toFixed(0);
this.priceCaluc(oldprice);
}
}
@ -365,29 +356,30 @@
},
//
priceCaluc(item) {
console.log('======' + item);
if (this.rechargeDes.integralDiscount == 100) {
let payprice = parseFloat(item * 100).toFixed(0);
let zkprice = parseFloat(this.rechargeDes.integralDiscount / 100).toFixed(2);
let pprice = parseFloat(item * 100).toFixed(0);
let payprice = parseFloat(item * 100 * zkprice).toFixed(0);
if (payprice > this.user.gold) {
// this.priceValue[1] = this.user.gold;
this.availIntegal = this.user.gold;
if (this.isIntegral) {
this.payPrice = (parseFloat(this.availIntegal / 100).toFixed(0)) - (this.priceValue[1] / 100);
}else{
this.payPrice = parseFloat(this.availIntegal / 100).toFixed(0);
if (this.availIntegal < this.priceValue[1]) {
this.priceValue[1] = this.user.gold;
this.isDiscount = true;
}
// this.payPrice = parseFloat(this.availIntegal / 100).toFixed(0);
// console.log('=====' + this.payPrice);
} else {
// this.priceValue[1] = payprice;
this.availIntegal = payprice;
this.payPrice = parseFloat(this.availIntegal / 100).toFixed(0);
this.priceValue[1] = 0;
this.isDiscount = true;
}
this.calculatepayPrice();
},
//
calculatepayPrice() {
if (this.deductionPrice == 0) {
this.payPrice = parseFloat(this.saveprice - (parseFloat(this.priceValue[1] / 100).toFixed(2))).toFixed(
2);
} else {
let payprice1 = parseFloat(item * 100).toFixed(0);
// this.priceValue[1] = payprice1;
this.availIntegal = payprice1;
this.payPrice = item - parseFloat(this.availIntegal / 100).toFixed(0);
this.payPrice = parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed(2)) - this
.deductionPrice).toFixed(2);
}
},
//
@ -427,6 +419,16 @@
},
toPay() {
let that = this;
if (that.payPrice == 0) {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
})
return;
}
that.$refs.paymentPassword.modalFun('show');
return;
}
if (that.paytype == '') {
uni.showToast({
title: '请选择支付方式',
@ -443,7 +445,7 @@
"memDiscountId": that.memDiscountId,
"rechargeContent": that.rechargeContent,
"goodsId": that.objectId,
"integralNum": '',
"integralNum": that.priceValue[1],
"password": ''
}
addOrderPay(params).then(res => {
@ -455,7 +457,7 @@
"openId": app.globalData.openId,
"openIdType": 2
}
that.orderToUNionPay(params);
that.orderToPayByWx(params);
} else {
uni.hideLoading();
uni.showToast({
@ -477,7 +479,7 @@
"memDiscountId": that.memDiscountId,
"rechargeContent": that.rechargeContent,
"goodsId": that.objectId,
"integralNum": '',
"integralNum": that.priceValue[1],
"password": ''
}
addOrderPay(params).then(res => {
@ -488,7 +490,7 @@
"orderId": res.return_data.id,
"openId": app.globalData.openId
}
that.orderToUNionPay(params);
that.orderToPayByWx(params);
} else {
uni.hideLoading();
uni.showToast({
@ -526,10 +528,10 @@
this.$refs.popup.show();
},
//
orderToUNionPay(item) {
orderToPayByWx(item) {
let that = this;
if (that.paytype == '2') {
orderToUNionPay(item).then(res => {
orderToPayByWx(item).then(res => {
if (res.return_code == '000000') {
// #ifdef MP
uni.showLoading({
@ -547,9 +549,6 @@
uni.showToast({
title: '支付成功'
})
// uni.switchTab({
// url: '../../pages/tabBar/user/user'
// })
uni.reLaunch({
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
that.orderId
@ -575,32 +574,7 @@
})
}
})
}
// else if (that.paytype == 'jinbi') {
// if (that.user.gold < that.payPrice * 100) {
// uni.showToast({
// icon: 'none',
// title: '',
// duration: 2000,
// success() {
// setTimeout(() => {
// uni.navigateTo({
// url: '../../pages/user/deposit/deposit'
// })
// }, 1000)
// }
// });
// return;
// }
// if (!that.user.isSetPayPwd) {
// uni.navigateTo({
// url: '../../pages/login/updatePas/updatePas'
// })
// return;
// }
// that.$refs.paymentPassword.modalFun('show');
// }
else if (that.paytype == '3') {
} else if (that.paytype == '3') {
if (that.tongCardPrice < that.payPrice) {
uni.showToast({
icon: 'none',
@ -652,17 +626,18 @@
uni.showLoading({
title: '支付中...'
})
if (this.paytype == 'jinbi') {
if (this.payPrice == 0) {
let params = {
"orderId": this.orderId,
"memDiscountId": this.memDiscountId,
"rechargeContent": this.rechargeContent,
"goodsId": this.objectId,
"integralNum": this.priceValue[1],
"password": this.PaymentPassword
}
orderToGoldPayunion(params).then(res => {
uni.hideLoading();
addOrderPay(params).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.hideLoading();
this.orderId = res.return_data.id;
uni.reLaunch({
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
this.orderId
@ -677,8 +652,9 @@
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
icon: 'none',
duration: 2000
});
})
return;
}
@ -687,7 +663,7 @@
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPayUnion(params).then(res => {
hltUnionCardPayghk(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
@ -753,8 +729,12 @@
that.orderId
})
},
cancel: function(r) {},
fail: function(res) {}
cancel: function(r) {
uni.navigateBack({})
},
fail: function(res) {
uni.navigateBack({})
}
});
});
@ -770,25 +750,24 @@
blockMoving() {
// console.log('')
},
//
blockEnd() {
console.log('=======' + this.priceValue[1]);
console.log('=======' + this.priceValue);
if (this.priceValue[1] > 0) {
this.isIntegral = true;
this.isDiscount = false;
if (this.deductionPrice == 0) {
this.payPrice = parseFloat(this.saveprice - parseFloat(this.priceValue[1] / 100).toFixed(2)).toFixed(
2);
} else {
this.isIntegral = false;
this.payPrice = parseFloat(this.orderPrice - parseFloat(this.priceValue[1] / 100).toFixed(2) - this
.deductionPrice).toFixed(2);
}
this.payPrice = this.payPrice - parseFloat(this.priceValue[1] / 100).toFixed(0);
if (this.payPrice == 0) {
this.isUse = false;
this.paytype = '';
} else {
this.isUse = true;
}
// console.log('')
}
},
}
}
</script>

@ -12,7 +12,7 @@
<view class="onorder" v-if="orderList.length==0">
<image :src="imagewxUrl+imgadres"></image>
</view>
<view class="row" v-for="(row,index) in orderList" :key="index">
<view class="row" v-for="(row,index) in orderList" :key="index" @click="jumpDetails(row.id)">
<view class="width96 height40">
<view class="width50 flleft aliitem fotlt font16">
<image src="../../static/img/order1.png" style="width: 50rpx;height: 50rpx;"></image>
@ -27,25 +27,27 @@
<view class="width96 height60 mart10">
<view class="width70 flleft fotlt ">
<view class="font16 fontwig6 text1 fcor333">
{{row.remarks}}
{{row.operatorName}}
</view>
<view class="font15 text1 fcor999 mart5">
数量 : 1
</view>
</view>
<view class="width30 flright fotrt fcor666 font15 fotrt">
<view class="font16 fontwig6 text1 fcor333" v-if="row.payType == 1 || row.payType == 3">
{{row.payPrice}}
<view class="font16 fontwig6 text1 fcor333">
{{row.payRealPrice}}
</view>
<view class="font16 fontwig6 text1 fcor333 aliitem" style="justify-content: flex-end;" v-else>
<image style="width: 15px;height: 15px;"
src="../../static/img/jfx.png">
</image>{{row.payPrice*100}}
<view class="fotrt font15 text1 fcor999 mart5">{{typeText[row.payStatus]}}</view>
</view>
<view class="fotrt font15 text1 fcor999 mart5">{{typeText[row.status]}}</view>
</view>
<view class="width96 line1 mart10 marb5" v-if="row.payStatus == 101">
</view>
<view class="btns" v-if="row.payStatus == 101">
<block>
<view class="default" @tap.stop="cancelRechargeOrder(row.id)">取消订单</view>
<view class="pay" @tap.stop="toPayment(row)">付款</view>
</block>
</view>
</view>
</view>
</view>
@ -54,7 +56,8 @@
</template>
<script>
import {
getUserOrderListhuafei
getUserOrderListhuafei,
cancelRechargeOrder
} from '../../Utils/Api.js';
let app = getApp()
export default {
@ -66,17 +69,16 @@
imgadres1: 'dhf.png',
headerTop: "0px",
typeText: {
1: '等待付款',
2: '订单已支付',
3: '订单已完成',
4: '订单已取消',
5: '订单已退款'
101: '等待付款',
102: '订单已支付',
100: '订单已完成',
104: '订单已取消',
105: '订单已退款'
},
// 退
orderType: ['全部', '待支付', '已支付', '已完成', '已取消', '已退款'],
//
orderList: [],
list: [],
tabbarIndex: 0,
pageNum: 1,
pageSize: 10,
@ -93,9 +95,25 @@
this.headerTop = '44px';
// #endif
let tbIndex = parseInt(option.tbIndex) + 1;
this.list = this.orderList[tbIndex];
this.tabbarIndex = tbIndex;
this.typeId = tbIndex;
if (tbIndex == 0) {
this.typeId = '';
}
if (tbIndex == 1) {
this.typeId = 101;
}
if (tbIndex == 2) {
this.typeId = 102;
}
if (tbIndex == 3) {
this.typeId = 100;
}
if (tbIndex == 4) {
this.typeId = 104;
}
if (tbIndex == 5) {
this.typeId = 105;
}
this.getUserOrderListhuafei();
},
onPageScroll(e) {
@ -127,6 +145,17 @@
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
}
},
watch: {
//reFresh,
reFresh: function() {
this.tabbarIndex = 0;
this.typeId = '';
this.pageNum = 1;
this.orderList = []
this.isNoMoreData = false;
this.getUserOrderListhuafei();
}
},
methods: {
//
getUserOrderListhuafei() {
@ -160,8 +189,59 @@
uni.hideLoading()
}
})
},
//
jumpDetails(e) {
uni.navigateTo({
url: '../rechargeDetails/rechargeDetails?id=' + e
})
},
//
cancelRechargeOrder(row) {
let that = this;
uni.showModal({
title: '取消订单',
content: '确定取消此订单?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '加载中...'
})
let params = {
orderId: row,
}
cancelRechargeOrder(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
this.pageNum = 1;
this.orderList = []
this.isNoMoreData = false;
that.getUserOrderListhuafei();
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
uni.hideLoading()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
toPayment(row) {
uni.redirectTo({
url: '../recharge-pay/recharge-pay?goodsId=' + row.goodsId + '&payPrice=' + row.payRealPrice+'&orderId='+row.id
})
},
showType(tbIndex) {
this.tabbarIndex = tbIndex;
@ -170,8 +250,21 @@
this.isNoMoreData = false;
if (tbIndex == 0) {
this.typeId = '';
} else {
this.typeId = tbIndex;
}
if (tbIndex == 1) {
this.typeId = 101;
}
if (tbIndex == 2) {
this.typeId = 102;
}
if (tbIndex == 3) {
this.typeId = 100;
}
if (tbIndex == 4) {
this.typeId = 104;
}
if (tbIndex == 5) {
this.typeId = 105;
}
this.getUserOrderListhuafei();
},

Loading…
Cancel
Save