parent
a5d446156b
commit
9d0bbcb5fc
@ -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, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 |
||||||
|
appId: self.return_data.appId, // 必填,公众号的唯一标识 |
||||||
|
timestamp: self.return_data.timeStamp, // 必填,生成签名的时间戳 |
||||||
|
nonceStr: self.return_data.nonceStr, // 必填,生成签名的随机串 |
||||||
|
signature: self.return_data.sign, // 必填,签名,见附录1 |
||||||
|
jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 |
||||||
|
}); |
||||||
|
uni.hideLoading(); |
||||||
|
jweixin.ready(function() { |
||||||
|
jweixin.checkJsApi({ |
||||||
|
jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2, |
||||||
|
success: function(res) {}, |
||||||
|
fail: function(res) {} |
||||||
|
}); |
||||||
|
jweixin.chooseWXPay({ |
||||||
|
appId: self.return_data.appId, |
||||||
|
timestamp: self.return_data |
||||||
|
.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 |
||||||
|
nonceStr: self.return_data.nonceStr, // 支付签名随机串,不长于 32 位 |
||||||
|
package: self.return_data |
||||||
|
.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_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 |
||||||
|
}); |
||||||
|
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 |
||||||
|
/*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> |
@ -1,396 +1,489 @@ |
|||||||
<template> |
<template> |
||||||
<view> |
<view> |
||||||
<!-- 顶部导航 --> |
<!-- 顶部导航 --> |
||||||
<view class="topTabBar" :style="{position:headerPosition,top:headerTop}"> |
<view class="topTabBar" :style="{position:headerPosition,top:headerTop}"> |
||||||
<view class="grid" v-for="(grid,tbIndex) in orderType" :key="tbIndex" @tap="showType(tbIndex)"> |
<view class="grid" v-for="(grid,tbIndex) in orderType" :key="tbIndex" @tap="showType(tbIndex)"> |
||||||
<view class="text" :class="[tbIndex==tabbarIndex?'on':'']">{{grid}}</view> |
<view class="text" :class="[tbIndex==tabbarIndex?'on':'']">{{grid}}</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<!-- 考虑非APP端长列表和复杂的DOM使用scroll-view会卡顿,所以漂浮顶部选项卡使用page本身的滑动 --> |
<!-- 考虑非APP端长列表和复杂的DOM使用scroll-view会卡顿,所以漂浮顶部选项卡使用page本身的滑动 --> |
||||||
<view class="order-list"> |
<view class="order-list"> |
||||||
<view class="list"> |
<view class="list"> |
||||||
<view class="onorder" v-if="orderList.length==0"> |
<view class="onorder" v-if="orderList.length==0"> |
||||||
<image :src="imagewxUrl+imgadres"></image> |
<image :src="imagewxUrl+imgadres"></image> |
||||||
</view> |
</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="width96 height40"> |
||||||
<view class="width50 flleft aliitem fotlt font16"> |
<view class="width50 flleft aliitem fotlt font16"> |
||||||
<image src="../../static/img/order1.png" style="width: 50rpx;height: 50rpx;"></image> |
<image src="../../static/img/order1.png" style="width: 50rpx;height: 50rpx;"></image> |
||||||
话费充值 |
话费充值 |
||||||
</view> |
</view> |
||||||
<view class="width50 flright fotrt fcor666 font15"> |
<view class="width50 flright fotrt fcor666 font15"> |
||||||
{{row.createTimed | formatDate('-')}} |
{{row.createTimed | formatDate('-')}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="width96 line1 mart10"></view> |
<view class="width96 line1 mart10"></view> |
||||||
|
|
||||||
<view class="width96 height60 mart10"> |
<view class="width96 height60 mart10"> |
||||||
<view class="width70 flleft fotlt "> |
<view class="width70 flleft fotlt "> |
||||||
<view class="font16 fontwig6 text1 fcor333"> |
<view class="font16 fontwig6 text1 fcor333"> |
||||||
{{row.remarks}} |
{{row.operatorName}} |
||||||
</view> |
</view> |
||||||
<view class="font15 text1 fcor999 mart5"> |
<view class="font15 text1 fcor999 mart5"> |
||||||
数量 : 1 |
数量 : 1 |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="width30 flright fotrt fcor666 font15 fotrt"> |
<view class="width30 flright fotrt fcor666 font15 fotrt"> |
||||||
<view class="font16 fontwig6 text1 fcor333" v-if="row.payType == 1 || row.payType == 3"> |
<view class="font16 fontwig6 text1 fcor333"> |
||||||
¥{{row.payPrice}} |
¥{{row.payRealPrice}} |
||||||
</view> |
</view> |
||||||
<view class="font16 fontwig6 text1 fcor333 aliitem" style="justify-content: flex-end;" v-else> |
<view class="fotrt font15 text1 fcor999 mart5">{{typeText[row.payStatus]}}</view> |
||||||
<image style="width: 15px;height: 15px;" |
</view> |
||||||
src="../../static/img/jfx.png"> |
</view> |
||||||
</image>{{row.payPrice*100}} |
<view class="width96 line1 mart10 marb5" v-if="row.payStatus == 101"> |
||||||
</view> |
</view> |
||||||
<view class="fotrt font15 text1 fcor999 mart5">{{typeText[row.status]}}</view> |
<view class="btns" v-if="row.payStatus == 101"> |
||||||
</view> |
<block> |
||||||
</view> |
<view class="default" @tap.stop="cancelRechargeOrder(row.id)">取消订单</view> |
||||||
|
<view class="pay" @tap.stop="toPayment(row)">付款</view> |
||||||
</view> |
</block> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
</view> |
||||||
</template> |
</view> |
||||||
<script> |
|
||||||
import { |
</template> |
||||||
getUserOrderListhuafei |
<script> |
||||||
} from '../../Utils/Api.js'; |
import { |
||||||
let app = getApp() |
getUserOrderListhuafei, |
||||||
export default { |
cancelRechargeOrder |
||||||
data() { |
} from '../../Utils/Api.js'; |
||||||
return { |
let app = getApp() |
||||||
headerPosition: "fixed", |
export default { |
||||||
imagewxUrl: app.globalData.imageWxImg, |
data() { |
||||||
imgadres: 'noorder.png', |
return { |
||||||
imgadres1: 'dhf.png', |
headerPosition: "fixed", |
||||||
headerTop: "0px", |
imagewxUrl: app.globalData.imageWxImg, |
||||||
typeText: { |
imgadres: 'noorder.png', |
||||||
1: '等待付款', |
imgadres1: 'dhf.png', |
||||||
2: '订单已支付', |
headerTop: "0px", |
||||||
3: '订单已完成', |
typeText: { |
||||||
4: '订单已取消', |
101: '等待付款', |
||||||
5: '订单已退款' |
102: '订单已支付', |
||||||
}, |
100: '订单已完成', |
||||||
// 退换货 |
104: '订单已取消', |
||||||
orderType: ['全部', '待支付', '已支付', '已完成', '已取消', '已退款'], |
105: '订单已退款' |
||||||
//订单列表 演示数据 |
}, |
||||||
orderList: [], |
// 退换货 |
||||||
list: [], |
orderType: ['全部', '待支付', '已支付', '已完成', '已取消', '已退款'], |
||||||
tabbarIndex: 0, |
//订单列表 演示数据 |
||||||
pageNum: 1, |
orderList: [], |
||||||
pageSize: 10, |
tabbarIndex: 0, |
||||||
isNoMoreData: false, |
pageNum: 1, |
||||||
loadingText: '', |
pageSize: 10, |
||||||
typeId: '', |
isNoMoreData: false, |
||||||
imageUrl: app.globalData.imgUrl, |
loadingText: '', |
||||||
reFresh: "" |
typeId: '', |
||||||
} |
imageUrl: app.globalData.imgUrl, |
||||||
}, |
reFresh: "" |
||||||
|
} |
||||||
onLoad(option) { |
}, |
||||||
// #ifdef H5 |
|
||||||
this.headerTop = '44px'; |
onLoad(option) { |
||||||
// #endif |
// #ifdef H5 |
||||||
let tbIndex = parseInt(option.tbIndex) + 1; |
this.headerTop = '44px'; |
||||||
this.list = this.orderList[tbIndex]; |
// #endif |
||||||
this.tabbarIndex = tbIndex; |
let tbIndex = parseInt(option.tbIndex) + 1; |
||||||
this.typeId = tbIndex; |
this.tabbarIndex = tbIndex; |
||||||
this.getUserOrderListhuafei(); |
if (tbIndex == 0) { |
||||||
}, |
this.typeId = ''; |
||||||
onPageScroll(e) { |
} |
||||||
return; |
if (tbIndex == 1) { |
||||||
//兼容iOS端下拉时顶部漂移 |
this.typeId = 101; |
||||||
this.headerPosition = e.scrollTop >= 0 ? "fixed" : "absolute"; |
} |
||||||
}, |
if (tbIndex == 2) { |
||||||
onReachBottom() { |
this.typeId = 102; |
||||||
this.getUserOrderListhuafei(); |
} |
||||||
}, |
if (tbIndex == 3) { |
||||||
filters: { |
this.typeId = 100; |
||||||
toFixed: function(x) { |
} |
||||||
return parseFloat(x).toFixed(2); |
if (tbIndex == 4) { |
||||||
}, |
this.typeId = 104; |
||||||
//过滤器 用于格式化时间 |
} |
||||||
formatDate: function(value, spe = '/') { |
if (tbIndex == 5) { |
||||||
let data = new Date(value); |
this.typeId = 105; |
||||||
let year = data.getFullYear(); |
} |
||||||
let month = data.getMonth() + 1; |
this.getUserOrderListhuafei(); |
||||||
let day = data.getDate(); |
}, |
||||||
let h = data.getHours(); |
onPageScroll(e) { |
||||||
let mm = data.getMinutes(); |
return; |
||||||
let s = data.getSeconds(); |
//兼容iOS端下拉时顶部漂移 |
||||||
month = month >= 10 ? month : "0" + month; |
this.headerPosition = e.scrollTop >= 0 ? "fixed" : "absolute"; |
||||||
day = day >= 10 ? day : "0" + day; |
}, |
||||||
h = h >= 10 ? h : "0" + h; |
onReachBottom() { |
||||||
mm = mm >= 10 ? mm : "0" + mm; |
this.getUserOrderListhuafei(); |
||||||
s = s >= 10 ? s : "0" + s; |
}, |
||||||
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`; |
filters: { |
||||||
} |
toFixed: function(x) { |
||||||
}, |
return parseFloat(x).toFixed(2); |
||||||
methods: { |
}, |
||||||
//查询订单列表 |
//过滤器 用于格式化时间 |
||||||
getUserOrderListhuafei() { |
formatDate: function(value, spe = '/') { |
||||||
uni.showLoading({ |
let data = new Date(value); |
||||||
title: '加载中...' |
let year = data.getFullYear(); |
||||||
}) |
let month = data.getMonth() + 1; |
||||||
if (this.isNoMoreData) { |
let day = data.getDate(); |
||||||
uni.hideLoading() |
let h = data.getHours(); |
||||||
return false; |
let mm = data.getMinutes(); |
||||||
} |
let s = data.getSeconds(); |
||||||
let statusId = this.typeId; |
month = month >= 10 ? month : "0" + month; |
||||||
|
day = day >= 10 ? day : "0" + day; |
||||||
let pagenum = this.pageNum; |
h = h >= 10 ? h : "0" + h; |
||||||
let params = { |
mm = mm >= 10 ? mm : "0" + mm; |
||||||
status: statusId, |
s = s >= 10 ? s : "0" + s; |
||||||
pageNum: this.pageNum, |
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`; |
||||||
pageSize: this.pageSize |
} |
||||||
} |
}, |
||||||
|
watch: { |
||||||
getUserOrderListhuafei(params).then(res => { |
//监听reFresh,如果有修改就执行监听器 |
||||||
if (res.return_code == '000000' && res.return_data.list != '') { |
reFresh: function() { |
||||||
uni.hideLoading(); |
this.tabbarIndex = 0; |
||||||
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; |
this.typeId = ''; |
||||||
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
this.pageNum = 1; |
||||||
this.isNoMoreData = true; |
this.orderList = [] |
||||||
} |
this.isNoMoreData = false; |
||||||
this.orderList = this.orderList.concat(res.return_data.list); |
this.getUserOrderListhuafei(); |
||||||
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
} |
||||||
} else { |
}, |
||||||
this.orderList = []; |
methods: { |
||||||
uni.hideLoading() |
//查询订单列表 |
||||||
} |
getUserOrderListhuafei() { |
||||||
}) |
uni.showLoading({ |
||||||
|
title: '加载中...' |
||||||
|
}) |
||||||
}, |
if (this.isNoMoreData) { |
||||||
showType(tbIndex) { |
uni.hideLoading() |
||||||
this.tabbarIndex = tbIndex; |
return false; |
||||||
this.pageNum = 1; |
} |
||||||
this.orderList = [] |
let statusId = this.typeId; |
||||||
this.isNoMoreData = false; |
|
||||||
if (tbIndex == 0) { |
let pagenum = this.pageNum; |
||||||
this.typeId = ''; |
let params = { |
||||||
} else { |
status: statusId, |
||||||
this.typeId = tbIndex; |
pageNum: this.pageNum, |
||||||
} |
pageSize: this.pageSize |
||||||
this.getUserOrderListhuafei(); |
} |
||||||
}, |
|
||||||
} |
getUserOrderListhuafei(params).then(res => { |
||||||
} |
if (res.return_code == '000000' && res.return_data.list != '') { |
||||||
</script> |
uni.hideLoading(); |
||||||
|
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; |
||||||
<style lang="scss"> |
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
||||||
page { |
this.isNoMoreData = true; |
||||||
background-color: #f3f3f3; |
} |
||||||
} |
this.orderList = this.orderList.concat(res.return_data.list); |
||||||
|
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
||||||
.zspec { |
} else { |
||||||
font-size: 22rpx; |
this.orderList = []; |
||||||
background-color: #0083f5; |
uni.hideLoading() |
||||||
color: #FFFFFF; |
} |
||||||
height: 40rpx; |
}) |
||||||
display: -webkit-box; |
}, |
||||||
display: -webkit-flex; |
//跳转详情 |
||||||
display: flex; |
jumpDetails(e) { |
||||||
width: 44px; |
uni.navigateTo({ |
||||||
-webkit-box-align: center; |
url: '../rechargeDetails/rechargeDetails?id=' + e |
||||||
-webkit-align-items: center; |
}) |
||||||
align-items: center; |
}, |
||||||
padding: 0 15rpx; |
//取消订单 |
||||||
border-radius: 4px; |
cancelRechargeOrder(row) { |
||||||
margin-bottom: 10px; |
let that = this; |
||||||
margin-left: 5px; |
uni.showModal({ |
||||||
} |
title: '取消订单', |
||||||
|
content: '确定取消此订单?', |
||||||
|
success: (res) => { |
||||||
.loading-text { |
if (res.confirm) { |
||||||
width: 100%; |
uni.showLoading({ |
||||||
display: flex; |
title: '加载中...' |
||||||
justify-content: center; |
}) |
||||||
align-items: center; |
let params = { |
||||||
height: 60upx; |
orderId: row, |
||||||
color: #979797; |
} |
||||||
font-size: 24upx; |
cancelRechargeOrder(params).then(res => { |
||||||
} |
if (res.return_code == '000000') { |
||||||
|
uni.hideLoading(); |
||||||
.topTabBar { |
uni.showToast({ |
||||||
width: 100%; |
title: res.return_data, |
||||||
position: fixed; |
icon: 'none', |
||||||
top: 0; |
duration: 2000 |
||||||
z-index: 10; |
}) |
||||||
background-color: #f8f8f8; |
this.pageNum = 1; |
||||||
height: 80upx; |
this.orderList = [] |
||||||
display: flex; |
this.isNoMoreData = false; |
||||||
justify-content: space-around; |
that.getUserOrderListhuafei(); |
||||||
|
} else { |
||||||
.grid { |
uni.showToast({ |
||||||
width: 20%; |
title: res.return_msg, |
||||||
height: 80upx; |
icon: 'none', |
||||||
display: flex; |
duration: 2000 |
||||||
justify-content: center; |
}) |
||||||
align-items: center; |
uni.hideLoading() |
||||||
color: #444; |
} |
||||||
font-size: 28upx; |
}) |
||||||
|
} else if (res.cancel) { |
||||||
.text { |
console.log('用户点击取消'); |
||||||
height: 76upx; |
} |
||||||
display: flex; |
} |
||||||
align-items: center; |
}); |
||||||
|
}, |
||||||
&.on { |
//去支付 |
||||||
color: #0083f5; |
toPayment(row) { |
||||||
border-bottom: solid 4upx #0083f5; |
uni.redirectTo({ |
||||||
} |
url: '../recharge-pay/recharge-pay?goodsId=' + row.goodsId + '&payPrice=' + row.payRealPrice+'&orderId='+row.id |
||||||
} |
}) |
||||||
|
}, |
||||||
} |
showType(tbIndex) { |
||||||
} |
this.tabbarIndex = tbIndex; |
||||||
|
this.pageNum = 1; |
||||||
.order-list { |
this.orderList = [] |
||||||
margin-top: 80upx; |
this.isNoMoreData = false; |
||||||
padding-top: 20upx; |
if (tbIndex == 0) { |
||||||
width: 100%; |
this.typeId = ''; |
||||||
|
} |
||||||
.list { |
if (tbIndex == 1) { |
||||||
width: 94%; |
this.typeId = 101; |
||||||
margin: 0 auto; |
} |
||||||
|
if (tbIndex == 2) { |
||||||
.onorder { |
this.typeId = 102; |
||||||
width: 100%; |
} |
||||||
height: 50vw; |
if (tbIndex == 3) { |
||||||
display: flex; |
this.typeId = 100; |
||||||
justify-content: center; |
} |
||||||
align-content: center; |
if (tbIndex == 4) { |
||||||
flex-wrap: wrap; |
this.typeId = 104; |
||||||
|
} |
||||||
image { |
if (tbIndex == 5) { |
||||||
width: 70vw; |
this.typeId = 105; |
||||||
margin-top: 150px; |
} |
||||||
} |
this.getUserOrderListhuafei(); |
||||||
|
}, |
||||||
.text { |
} |
||||||
width: 100%; |
} |
||||||
height: 60upx; |
</script> |
||||||
font-size: 28upx; |
|
||||||
color: #444; |
<style lang="scss"> |
||||||
display: flex; |
page { |
||||||
justify-content: center; |
background-color: #f3f3f3; |
||||||
align-items: center; |
} |
||||||
} |
|
||||||
} |
.zspec { |
||||||
|
font-size: 22rpx; |
||||||
.row { |
background-color: #0083f5; |
||||||
width: calc(100% - 40upx); |
color: #FFFFFF; |
||||||
padding: 10upx 20upx; |
height: 40rpx; |
||||||
border-radius: 10upx; |
display: -webkit-box; |
||||||
background-color: #fff; |
display: -webkit-flex; |
||||||
margin-bottom: 20upx; |
display: flex; |
||||||
|
width: 44px; |
||||||
.type { |
-webkit-box-align: center; |
||||||
font-size: 26upx; |
-webkit-align-items: center; |
||||||
color: #0083f5; |
align-items: center; |
||||||
height: 50upx; |
padding: 0 15rpx; |
||||||
display: flex; |
border-radius: 4px; |
||||||
align-items: center; |
margin-bottom: 10px; |
||||||
} |
margin-left: 5px; |
||||||
|
} |
||||||
.order-info { |
|
||||||
width: 100%; |
|
||||||
display: flex; |
.loading-text { |
||||||
|
width: 100%; |
||||||
.left { |
display: flex; |
||||||
flex-shrink: 0; |
justify-content: center; |
||||||
width: 25vw; |
align-items: center; |
||||||
height: 25vw; |
height: 60upx; |
||||||
|
color: #979797; |
||||||
image { |
font-size: 24upx; |
||||||
width: 25vw; |
} |
||||||
height: 25vw; |
|
||||||
border-radius: 10upx; |
.topTabBar { |
||||||
} |
width: 100%; |
||||||
} |
position: fixed; |
||||||
|
top: 0; |
||||||
.right { |
z-index: 10; |
||||||
width: 100%; |
background-color: #f8f8f8; |
||||||
margin-left: 10upx; |
height: 80upx; |
||||||
position: relative; |
display: flex; |
||||||
|
justify-content: space-around; |
||||||
.name { |
|
||||||
width: 100%; |
.grid { |
||||||
font-size: 18px; |
width: 20%; |
||||||
display: -webkit-box; |
height: 80upx; |
||||||
-webkit-box-orient: vertical; |
display: flex; |
||||||
-webkit-line-clamp: 2; |
justify-content: center; |
||||||
overflow: hidden; |
align-items: center; |
||||||
} |
color: #444; |
||||||
|
font-size: 28upx; |
||||||
.spec { |
|
||||||
color: #a7a7a7; |
.text { |
||||||
font-size: 14px; |
height: 76upx; |
||||||
} |
display: flex; |
||||||
|
align-items: center; |
||||||
.price-number { |
|
||||||
width: 100%; |
&.on { |
||||||
font-size: 15px; |
color: #0083f5; |
||||||
display: flex; |
border-bottom: solid 4upx #0083f5; |
||||||
|
} |
||||||
.price { |
} |
||||||
font-size: 14px; |
|
||||||
margin-right: 5upx; |
} |
||||||
} |
} |
||||||
|
|
||||||
} |
.order-list { |
||||||
} |
margin-top: 80upx; |
||||||
} |
padding-top: 20upx; |
||||||
|
width: 100%; |
||||||
.detail { |
|
||||||
display: flex; |
.list { |
||||||
justify-content: flex-end; |
width: 94%; |
||||||
align-items: flex-end; |
margin: 0 auto; |
||||||
height: 60upx; |
|
||||||
font-size: 26upx; |
.onorder { |
||||||
|
width: 100%; |
||||||
.sum { |
height: 50vw; |
||||||
padding: 0 8upx; |
display: flex; |
||||||
display: flex; |
justify-content: center; |
||||||
align-items: flex-end; |
align-content: center; |
||||||
|
flex-wrap: wrap; |
||||||
.price { |
|
||||||
font-size: 30upx; |
image { |
||||||
} |
width: 70vw; |
||||||
} |
margin-top: 150px; |
||||||
|
} |
||||||
} |
|
||||||
|
.text { |
||||||
.btns { |
width: 100%; |
||||||
height: 80upx; |
height: 60upx; |
||||||
display: flex; |
font-size: 28upx; |
||||||
align-items: center; |
color: #444; |
||||||
justify-content: flex-end; |
display: flex; |
||||||
|
justify-content: center; |
||||||
view { |
align-items: center; |
||||||
min-width: 120upx; |
} |
||||||
height: 70rpx; |
} |
||||||
padding: 0 20upx; |
|
||||||
border-radius: 50upx; |
.row { |
||||||
display: flex; |
width: calc(100% - 40upx); |
||||||
justify-content: center; |
padding: 10upx 20upx; |
||||||
align-items: center; |
border-radius: 10upx; |
||||||
font-size: 28upx; |
background-color: #fff; |
||||||
margin-left: 20upx; |
margin-bottom: 20upx; |
||||||
} |
|
||||||
|
.type { |
||||||
.default { |
font-size: 26upx; |
||||||
border: solid 1upx #ccc; |
color: #0083f5; |
||||||
color: #666; |
height: 50upx; |
||||||
} |
display: flex; |
||||||
|
align-items: center; |
||||||
.pay { |
} |
||||||
background-color: #0083f5; |
|
||||||
color: #FFFFFF; |
.order-info { |
||||||
} |
width: 100%; |
||||||
} |
display: flex; |
||||||
} |
|
||||||
} |
.left { |
||||||
} |
flex-shrink: 0; |
||||||
|
width: 25vw; |
||||||
|
height: 25vw; |
||||||
|
|
||||||
|
image { |
||||||
|
width: 25vw; |
||||||
|
height: 25vw; |
||||||
|
border-radius: 10upx; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.right { |
||||||
|
width: 100%; |
||||||
|
margin-left: 10upx; |
||||||
|
position: relative; |
||||||
|
|
||||||
|
.name { |
||||||
|
width: 100%; |
||||||
|
font-size: 18px; |
||||||
|
display: -webkit-box; |
||||||
|
-webkit-box-orient: vertical; |
||||||
|
-webkit-line-clamp: 2; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.spec { |
||||||
|
color: #a7a7a7; |
||||||
|
font-size: 14px; |
||||||
|
} |
||||||
|
|
||||||
|
.price-number { |
||||||
|
width: 100%; |
||||||
|
font-size: 15px; |
||||||
|
display: flex; |
||||||
|
|
||||||
|
.price { |
||||||
|
font-size: 14px; |
||||||
|
margin-right: 5upx; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.detail { |
||||||
|
display: flex; |
||||||
|
justify-content: flex-end; |
||||||
|
align-items: flex-end; |
||||||
|
height: 60upx; |
||||||
|
font-size: 26upx; |
||||||
|
|
||||||
|
.sum { |
||||||
|
padding: 0 8upx; |
||||||
|
display: flex; |
||||||
|
align-items: flex-end; |
||||||
|
|
||||||
|
.price { |
||||||
|
font-size: 30upx; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
.btns { |
||||||
|
height: 80upx; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: flex-end; |
||||||
|
|
||||||
|
view { |
||||||
|
min-width: 120upx; |
||||||
|
height: 70rpx; |
||||||
|
padding: 0 20upx; |
||||||
|
border-radius: 50upx; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
font-size: 28upx; |
||||||
|
margin-left: 20upx; |
||||||
|
} |
||||||
|
|
||||||
|
.default { |
||||||
|
border: solid 1upx #ccc; |
||||||
|
color: #666; |
||||||
|
} |
||||||
|
|
||||||
|
.pay { |
||||||
|
background-color: #0083f5; |
||||||
|
color: #FFFFFF; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue