You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1124 lines
29 KiB
1124 lines
29 KiB
<template>
|
|
<view>
|
|
|
|
<view class="width94 comorder mart10">
|
|
<view class="height100p width94 goodsimg">
|
|
<image class="flleft" mode="widthFix" v-if="rechargeModel == 3" src="../static/cz1.jpg"></image>
|
|
<image class="flleft" mode="widthFix" v-if="rechargeModel == 2" src="../static/cz3.jpg"></image>
|
|
<image class="flleft" mode="widthFix" v-if="rechargeModel == 1" src="../static/cz2.jpg"></image>
|
|
<view class="tcrig">
|
|
<view class="font18 fontwig6 fcor333 text1" v-if="rechargeModel == 1">电信话费充值</view>
|
|
<view class="font18 fontwig6 fcor333 text1" v-if="rechargeModel == 2">移动话费充值</view>
|
|
<view class="font18 fontwig6 fcor333 text1" v-if="rechargeModel == 3">联通话费充值</view>
|
|
<view class="font13 fcor666 mart10">规格: 默认</view>
|
|
<view class="price-number mart10">
|
|
<view class="price font16">¥{{orderPrice}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<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">
|
|
¥{{orderPrice}}
|
|
</view>
|
|
</view>
|
|
<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%;">
|
|
优惠抵扣<text class="yhqky">{{OrderPreList.length}}张可用</text>
|
|
</view>
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
|
|
style="align-items: center;" v-if="deductionPrice == 0">
|
|
未使用
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/img/jt.png"></image>
|
|
</view>
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcoreb5 alijun"
|
|
style="align-items: center;" v-else>
|
|
-¥{{deductionPrice}}
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/img/jt.png"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="width94 comorder mart10">
|
|
<!-- <view class="fotct paddtop20 fcor666 font14 fontspec" style="margin-left: 30%;">抵扣金额 : ¥{{priceValue[1] / 10 /10}}
|
|
</view> -->
|
|
<view class="width92 alijusstart paddtop20">
|
|
<view class="width30 fcor333 fontwig6 font16">
|
|
积分抵扣
|
|
</view>
|
|
<view class="cj-slider">
|
|
<view class="flleft fotct font14 fcor666" style="width: 15%;">0</view>
|
|
<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 == 2" 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>
|
|
<view class="width94 line1 mart15 marb5"></view>
|
|
<view class="height50 width100 backcorfff">
|
|
<view class="width70 flleft fcor333 fontwig6 font16 text1" style="padding-left: 4%;">
|
|
抵扣金额
|
|
</view>
|
|
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
|
|
style="align-items: center;">
|
|
¥{{priceValue[1] / 100}}
|
|
</view>
|
|
</view>
|
|
<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>
|
|
<view class="width100" v-for="(item,index) in paytypeList" :key="index">
|
|
<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 font16" style="padding-left: 4%;">
|
|
微信支付
|
|
</view>
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
|
|
style="align-items: center;" v-if="isUse">
|
|
<radio :checked="paytype=='2'" color="#0083f5" />
|
|
</view>
|
|
</view>
|
|
<view class="width94 line1 mart5 marb5" v-if="item == 3"></view>
|
|
<view class="height50 width100 backcorfff" @tap="paytype='3'" v-if="item == 3">
|
|
<view class="width70 flleft fcor666 font16 text1" style="padding-left: 4%;">
|
|
汇联通工会卡<text class="font14 fcor666 margle">可用余额: {{tongCardPrice}}元</text>
|
|
</view>
|
|
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
|
|
style="align-items: center;" v-if="isUse">
|
|
<radio :checked="paytype=='3'" @click="changeRiado()" color="#0083f5" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<image :src="imagewxUrl+imgadres1" class="width100 mart20 marb30" mode="widthFix"></image>
|
|
<view class="width100 height60"></view>
|
|
<view class="footer">
|
|
<view class="settlement">
|
|
<!-- v-if="paytype == '2' || paytype == '3' " -->
|
|
<view class="sum">实付:<view class="money">
|
|
¥{{payPrice}}</view>
|
|
<!-- <view class="money aliitem" v-else>
|
|
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../static/img/jfx.png">
|
|
</image>{{payPrice*100}}
|
|
</view> -->
|
|
</view>
|
|
<!-- #ifdef MP -->
|
|
<button class="btn" open-type="getPhoneNumber" v-if="user == null"
|
|
@getphonenumber="loginByPhone">立即支付</button>
|
|
<button class="btn" v-else @tap="toPay">立即支付</button>
|
|
<!-- #endif -->
|
|
<!-- #ifdef H5 -->
|
|
<button class="btn" v-if="user.phone == null" @click="jumpH5Bding">立即支付</button>
|
|
<button class="btn" v-else @tap="toPay">立即支付</button>
|
|
<!-- #endif -->
|
|
|
|
</view>
|
|
</view>
|
|
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="6" :showCloseIcon="true">
|
|
<view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view>
|
|
<view class="width92 height110 tccs mart10" v-for="(items, index) in OrderPreList" :key="items"
|
|
@click="radioChanges(items)">
|
|
<image mode="widthFix" class="flleft mart10" :src="imageUrl+items.discountImg"></image>
|
|
<view class="contrig">
|
|
<view class="width80p flleft">
|
|
<view class="font16 fontwig6 fcor333 text1 paddtop25">{{items.discountName}}</view>
|
|
<view class="font13 fcor999 mart5">有效期至:{{items.useEndTime | timeFormat('yyyy-mm-dd')}}</view>
|
|
</view>
|
|
<view class="width20 flright">
|
|
<view class="yhprice">
|
|
<radio color="#0083f5" :checked="items.id == memDiscountId" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</wybPopup>
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" />
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
addOrderPay,
|
|
orderToPayByWx,
|
|
findUser,
|
|
orderToGoldPayunion,
|
|
hltUnionCardPayghk,
|
|
getHuiLianTongCardBalance,
|
|
loginByPhone,
|
|
getUserOrderPreList,
|
|
findById
|
|
} from '../../Utils/Api.js';
|
|
import wybPopup from '../../components/wyb-popup/wyb-popup.vue';
|
|
import cjSlider from '../../components/cj-slider/cj-slider.vue';
|
|
import ssPaymentPassword from '../../components/sanshui-payment-password';
|
|
let app = getApp();
|
|
// #ifdef H5
|
|
var jweixin = require('jweixin-module');
|
|
// #endif
|
|
export default {
|
|
components: {
|
|
wybPopup,
|
|
cjSlider,
|
|
ssPaymentPassword
|
|
},
|
|
data() {
|
|
return {
|
|
imageUrl: app.globalData.imgUrl,
|
|
imagewxUrl: app.globalData.imageWxImg,
|
|
imgadres1: 'arrive_time_img.jpeg',
|
|
deductionPrice: '0.00',
|
|
paytheprice: '',
|
|
radioStatus: true,
|
|
memDiscountId: '',
|
|
user: '',
|
|
paytype: '',
|
|
PaymentPassword: '',
|
|
orderId: '',
|
|
jumpType: '',
|
|
tongCardPrice: 0,
|
|
//话费充值
|
|
orderPrice: 0,
|
|
payPrice: 0,
|
|
//保存价格
|
|
saveprice: 0,
|
|
rechargeContent: '',
|
|
rechargeModel: '',
|
|
objectId: '',
|
|
OrderPreList: [],
|
|
reType: '', //充值类型
|
|
rechargeDes: '', // 话费详情
|
|
paytypeList: [], //支付方式
|
|
priceValue: [0, 0], // 积分可以指定默认值
|
|
changePrice: '', //滑动值
|
|
isDiscount: true,
|
|
availIntegal: '', // 可用积分
|
|
isUse: true // 是否禁用状态
|
|
|
|
};
|
|
},
|
|
onLoad(options) {
|
|
this.orderPrice = options.orderPrice;
|
|
this.payPrice = options.payPrice;
|
|
this.saveprice = options.payPrice;
|
|
this.rechargeContent = options.rechargeContent;
|
|
this.rechargeModel = options.rechargeModel;
|
|
this.objectId = options.objectId;
|
|
this.reType = options.rechargeType;
|
|
},
|
|
onShow() {
|
|
let that = this;
|
|
// that.paytype = '2';
|
|
that.findUser();
|
|
that.getUserOrderPreList();
|
|
},
|
|
onHide() {
|
|
|
|
},
|
|
methods: {
|
|
//查询详情
|
|
findById() {
|
|
uni.showLoading({
|
|
title: '加载中'
|
|
})
|
|
let showType;
|
|
// #ifdef H5
|
|
showType = 2;
|
|
// #endif
|
|
// #ifdef MP
|
|
showType = 1;
|
|
// #endif
|
|
let datas = {
|
|
platformId: showType,
|
|
id: this.objectId
|
|
}
|
|
findById(datas).then(res => {
|
|
if (res.return_code == '000000') {
|
|
uni.hideLoading();
|
|
this.rechargeDes = res.return_data;
|
|
this.paytypeList = res.return_data.productPayTypeString.split(',');
|
|
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1);
|
|
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.availIntegal = this.user.gold;
|
|
} else {
|
|
this.availIntegal = payprice;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
//查询积分
|
|
findUser() {
|
|
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",
|
|
data: res.return_data
|
|
})
|
|
}
|
|
});
|
|
},
|
|
//查询优惠券
|
|
getUserOrderPreList() {
|
|
let params = {
|
|
useScope: 3
|
|
}
|
|
getUserOrderPreList(params).then(res => {
|
|
if (res.return_code == '000000') {
|
|
this.OrderPreList = res.return_data;
|
|
}
|
|
});
|
|
},
|
|
//显示弹出
|
|
showPopup() {
|
|
this.$refs.popup.show();
|
|
},
|
|
//查询工会卡余额
|
|
//查询详情
|
|
getHuiLianTongCardBalance() {
|
|
if (!this.user.hltCardNo) {
|
|
return;
|
|
}
|
|
let params = {
|
|
cardNo: this.user.hltCardNo.cardNo
|
|
}
|
|
getHuiLianTongCardBalance(params).then(res => {
|
|
if (res.return_code == '000000') {
|
|
this.tongCardPrice = res.return_data.balance;
|
|
}
|
|
|
|
});
|
|
},
|
|
// H5获取手机号
|
|
jumpH5Bding() {
|
|
uni.navigateTo({
|
|
url: '/pages/login/register'
|
|
})
|
|
},
|
|
//选择优惠券
|
|
radioChanges(item) {
|
|
this.paytheprice = this.orderPrice;
|
|
this.rechangeload();
|
|
if (this.memDiscountId == item.id) { // 如果已经选中,则取消选中
|
|
this.memDiscountId = '';
|
|
this.deductionPrice = '0.00';
|
|
this.priceCaluc(this.saveprice);
|
|
|
|
} else { // 否则进行选中赋值
|
|
this.memDiscountId = item.id;
|
|
if (item.discountType == 1) {
|
|
//满减价格
|
|
this.deductionPrice = item.discountPrice;
|
|
let oldprice = this.paytheprice - this.deductionPrice;
|
|
this.priceCaluc(oldprice);
|
|
}
|
|
if (item.discountType == 2) {
|
|
//抵扣价格
|
|
this.deductionPrice = item.discountPrice;
|
|
let oldprice = this.paytheprice - this.deductionPrice;
|
|
this.priceCaluc(oldprice);
|
|
}
|
|
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.priceCaluc(oldprice);
|
|
}
|
|
}
|
|
this.$refs.popup.hide();
|
|
},
|
|
//计算价格
|
|
priceCaluc(item) {
|
|
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.availIntegal = this.user.gold;
|
|
this.priceValue[1] = 0;
|
|
// if (this.availIntegal < this.priceValue[1]) {
|
|
// this.priceValue[1] = this.user.gold;
|
|
// this.reload();
|
|
// }
|
|
} else {
|
|
this.availIntegal = payprice;
|
|
this.priceValue[1] = 0;
|
|
// this.reload();
|
|
}
|
|
this.reload();
|
|
this.calculatepayPrice();
|
|
},
|
|
//计算支付价格
|
|
calculatepayPrice() {
|
|
if (this.deductionPrice == 0) {
|
|
this.payPrice = parseFloat(this.saveprice - (parseFloat(this.priceValue[1] / 100).toFixed(2))).toFixed(
|
|
2);
|
|
} else {
|
|
this.payPrice = parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed(2)) - this
|
|
.deductionPrice).toFixed(2);
|
|
}
|
|
},
|
|
rechangeload() {
|
|
this.isUse = false;
|
|
this.$nextTick(() => (this.isUse = true))
|
|
},
|
|
//刷新组件
|
|
reload() {
|
|
this.isDiscount = false;
|
|
this.$nextTick(() => (this.isDiscount = true))
|
|
},
|
|
// 微信获取手机号
|
|
loginByPhone(PhoneNumber) {
|
|
if (PhoneNumber.detail.iv == undefined) {
|
|
uni.showToast({
|
|
title: "用户取消授权",
|
|
icon: "none"
|
|
});
|
|
return;
|
|
}
|
|
let params = {
|
|
openId: app.globalData.openId,
|
|
iv: PhoneNumber.detail.iv,
|
|
encryptedData: PhoneNumber.detail.encryptedData
|
|
}
|
|
loginByPhone(params).then(res => {
|
|
if (res.return_code == '000000') {
|
|
app.globalData.userInfo = res.return_data
|
|
.object
|
|
.highUser;
|
|
app.globalData.token = res.return_data.uniqueCode;
|
|
uni.setStorage({
|
|
key: "token",
|
|
data: res.return_data.uniqueCode
|
|
})
|
|
uni.setStorage({
|
|
key: "user",
|
|
data: res.return_data
|
|
.object
|
|
.highUser
|
|
})
|
|
let that = this;
|
|
that.toPay();
|
|
}
|
|
});
|
|
},
|
|
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: '请选择支付方式',
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
return;
|
|
}
|
|
// #ifdef H5
|
|
uni.showLoading({
|
|
title: '提交订单中...'
|
|
})
|
|
let params = {
|
|
"memDiscountId": that.memDiscountId,
|
|
"rechargeContent": that.rechargeContent,
|
|
"goodsId": that.objectId,
|
|
"integralNum": that.priceValue[1],
|
|
"password": ''
|
|
}
|
|
addOrderPay(params).then(res => {
|
|
if (res.return_code == '000000') {
|
|
uni.hideLoading();
|
|
that.orderId = res.return_data.id;
|
|
let params = {
|
|
"orderId": res.return_data.id,
|
|
"openId": app.globalData.openId,
|
|
"openIdType": 2
|
|
}
|
|
that.orderToPayByWx(params);
|
|
} else {
|
|
uni.hideLoading();
|
|
uni.showToast({
|
|
title: res.return_msg,
|
|
icon: 'none',
|
|
duration: 2000
|
|
});
|
|
}
|
|
})
|
|
// #endif
|
|
// #ifdef MP
|
|
uni.requestSubscribeMessage({
|
|
tmplIds: ['ZO6kC3oJv0zj9QzL0htsF-mM9vAElcgPZEcUGglxsoU'],
|
|
success(res) {
|
|
uni.showLoading({
|
|
title: '提交订单中...'
|
|
})
|
|
let params = {
|
|
"memDiscountId": that.memDiscountId,
|
|
"rechargeContent": that.rechargeContent,
|
|
"goodsId": that.objectId,
|
|
"integralNum": that.priceValue[1],
|
|
"password": ''
|
|
}
|
|
addOrderPay(params).then(res => {
|
|
if (res.return_code == '000000') {
|
|
uni.hideLoading();
|
|
that.orderId = res.return_data.id;
|
|
let params = {
|
|
"orderId": res.return_data.id,
|
|
"openId": app.globalData.openId
|
|
}
|
|
that.orderToPayByWx(params);
|
|
} else {
|
|
uni.hideLoading();
|
|
uni.showToast({
|
|
title: res.return_msg,
|
|
icon: 'none',
|
|
duration: 2000
|
|
});
|
|
}
|
|
})
|
|
},
|
|
fail(res) {},
|
|
})
|
|
// #endif
|
|
},
|
|
//获取选择支付方式
|
|
changeRiado() {
|
|
if (!this.user.isSetHltCard) {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: '当前账号还未绑定,前往绑定',
|
|
duration: 2000,
|
|
success() {
|
|
setTimeout(() => {
|
|
uni.navigateTo({
|
|
url: '../../pages/user/bindingCard/bindingCard'
|
|
})
|
|
}, 1000)
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
},
|
|
//弹出优惠券
|
|
showPopup() {
|
|
this.$refs.popup.show();
|
|
},
|
|
//获取订单数据
|
|
orderToPayByWx(item) {
|
|
let that = this;
|
|
if (that.paytype == '2') {
|
|
orderToPayByWx(item).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.orderId
|
|
})
|
|
},
|
|
fail: function(err) {
|
|
uni.hideLoading();
|
|
uni.navigateBack({})
|
|
},
|
|
});
|
|
// #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 {
|
|
uni.showToast({
|
|
title: '请选择支付方式',
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
},
|
|
submitHandle(e) {
|
|
uni.showLoading({
|
|
title: '支付中...'
|
|
})
|
|
this.PaymentPassword = e.value;
|
|
if (this.PaymentPassword == '') {
|
|
uni.showToast({
|
|
title: '请勿手动关闭弹窗',
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
uni.hideLoading();
|
|
return;
|
|
}
|
|
if (this.payPrice == 0) {
|
|
let params = {
|
|
"memDiscountId": this.memDiscountId,
|
|
"rechargeContent": this.rechargeContent,
|
|
"goodsId": this.objectId,
|
|
"integralNum": this.priceValue[1],
|
|
"password": this.PaymentPassword
|
|
}
|
|
addOrderPay(params).then(res => {
|
|
uni.hideLoading();
|
|
if (res.return_code == '000000') {
|
|
this.orderId = res.return_data.id;
|
|
uni.reLaunch({
|
|
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
|
|
this.orderId
|
|
})
|
|
return;
|
|
}
|
|
if (res.return_code == '102130') {
|
|
uni.navigateTo({
|
|
url: '../../login/updatePas/updatePas'
|
|
})
|
|
return;
|
|
}
|
|
uni.showToast({
|
|
title: res.return_msg,
|
|
icon: 'none',
|
|
duration: 2000
|
|
});
|
|
})
|
|
return;
|
|
}
|
|
let params = {
|
|
"orderId": this.orderId,
|
|
"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=' +
|
|
this.orderId
|
|
})
|
|
return;
|
|
}
|
|
if (res.return_code == '102130') {
|
|
uni.navigateTo({
|
|
url: '../../login/updatePas/updatePas'
|
|
})
|
|
return;
|
|
}
|
|
uni.showToast({
|
|
title: res.return_msg,
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
payRequest: function(self) {
|
|
let that = this;
|
|
uni.showLoading({
|
|
title: '支付中...'
|
|
})
|
|
jweixin.config({
|
|
// debug: false, // 开启调试模式,调用的所有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.orderId
|
|
})
|
|
},
|
|
cancel: function(r) {
|
|
uni.navigateBack({})
|
|
},
|
|
fail: function(res) {
|
|
uni.navigateBack({})
|
|
}
|
|
});
|
|
});
|
|
|
|
jweixin.error(function(res) {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: '支付失败了',
|
|
duration: 4000
|
|
});
|
|
});
|
|
},
|
|
blockStart() {},
|
|
blockMoving() {
|
|
// console.log('正在滑动中')
|
|
},
|
|
//滑动结束
|
|
blockEnd() {
|
|
this.isDiscount = 1;
|
|
if (this.deductionPrice == 0) {
|
|
this.payPrice = parseFloat(this.saveprice - parseFloat(this.priceValue[1] / 100).toFixed(2)).toFixed(
|
|
2);
|
|
} else {
|
|
this.payPrice = parseFloat(this.orderPrice - parseFloat(this.priceValue[1] / 100).toFixed(2) - this
|
|
.deductionPrice).toFixed(2);
|
|
}
|
|
if (this.payPrice == 0) {
|
|
this.isUse = false;
|
|
this.paytype = '';
|
|
} else {
|
|
this.isUse = true;
|
|
}
|
|
},
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
background-color: #f7f7f7;
|
|
}
|
|
|
|
.comorder {
|
|
background-color: #FFFFFF;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.j {
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
margin-top: 30rpx;
|
|
}
|
|
|
|
.cj-slider {
|
|
width: 100%;
|
|
align-items: center;
|
|
display: flex;
|
|
}
|
|
|
|
.goodsimg {
|
|
align-items: center;
|
|
display: flex;
|
|
|
|
image {
|
|
width: 170rpx;
|
|
max-height: 170rpx;
|
|
}
|
|
}
|
|
|
|
.yhprice {
|
|
margin-top: -30px;
|
|
}
|
|
|
|
.price-number {
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-end;
|
|
font-size: 28upx;
|
|
height: 40upx;
|
|
|
|
.price {
|
|
color: #FE4545;
|
|
display: flex;
|
|
max-width: 50%;
|
|
align-items: center;
|
|
}
|
|
|
|
.number {
|
|
display: flex;
|
|
align-items: center;
|
|
width: 50%;
|
|
text-decoration: line-through;
|
|
|
|
}
|
|
}
|
|
|
|
.yhqky {
|
|
background: #ff0034;
|
|
color: #ffffff;
|
|
font-size: 14px;
|
|
padding-left: 5px;
|
|
padding-right: 5px;
|
|
margin-left: 8px;
|
|
padding-top: 2px;
|
|
padding-bottom: 2px;
|
|
}
|
|
|
|
|
|
|
|
.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;
|
|
}
|
|
}
|
|
|
|
.tccs {
|
|
box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, 0.2);
|
|
border: 1px solid #f6f6f6;
|
|
border-radius: 8px;
|
|
|
|
image {
|
|
float: left;
|
|
width: 170rpx;
|
|
max-height: 170rpx;
|
|
margin-left: 10px;
|
|
}
|
|
}
|
|
|
|
.tcrig {
|
|
margin-left: 20rpx;
|
|
}
|
|
|
|
.contrig {
|
|
margin-left: 180rpx;
|
|
}
|
|
|
|
.info {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-end;
|
|
width: 92%;
|
|
}
|
|
|
|
.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: 40upx;
|
|
display: flex;
|
|
|
|
.left {
|
|
font-size: 28upx;
|
|
}
|
|
|
|
.right {
|
|
margin-left: 40upx;
|
|
font-size: 26upx;
|
|
color: #999;
|
|
|
|
input {
|
|
font-size: 26upx;
|
|
color: #999;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.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 {
|
|
width: 50%;
|
|
font-size: 18px;
|
|
margin-right: 10upx;
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
|
|
.money {
|
|
color: #eb5823;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
|
|
.btn {
|
|
padding: 0 50rpx;
|
|
height: 80rpx;
|
|
background-color: #0083f5;
|
|
color: #fff;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
font-size: 30upx;
|
|
border-radius: 40upx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.goods-list {
|
|
width: 100%;
|
|
padding: 0;
|
|
|
|
.tis {
|
|
width: 100%;
|
|
height: 60upx;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
font-size: 32upx;
|
|
}
|
|
|
|
.row {
|
|
width: calc(92%);
|
|
height: calc(22vw + 40upx);
|
|
margin: 20upx auto;
|
|
|
|
border-radius: 15upx;
|
|
box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
|
|
display: flex;
|
|
align-items: center;
|
|
position: relative;
|
|
overflow: hidden;
|
|
z-index: 4;
|
|
border: 0;
|
|
|
|
.menu {
|
|
.icon {
|
|
color: #fff;
|
|
// font-size: 25upx;
|
|
}
|
|
|
|
position: absolute;
|
|
width: 30%;
|
|
height: 100%;
|
|
right: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
background-color: red;
|
|
color: #fff;
|
|
z-index: 2;
|
|
}
|
|
|
|
.carrier {
|
|
.checkbox-box {
|
|
padding-left: 20upx;
|
|
flex-shrink: 0;
|
|
height: 22vw;
|
|
margin-right: 20upx;
|
|
}
|
|
|
|
position: absolute;
|
|
width: 94%;
|
|
margin-left: 3%;
|
|
padding: 0 0;
|
|
height: 100%;
|
|
z-index: 3;
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.goods-info {
|
|
width: 100%;
|
|
display: flex;
|
|
padding-right: 20upx;
|
|
|
|
.img {
|
|
width: 22vw;
|
|
height: 22vw;
|
|
border-radius: 10upx;
|
|
overflow: hidden;
|
|
flex-shrink: 0;
|
|
margin-right: 10upx;
|
|
|
|
image {
|
|
width: 22vw;
|
|
height: 22vw;
|
|
}
|
|
}
|
|
|
|
.info {
|
|
width: 100%;
|
|
height: 22vw;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
position: relative;
|
|
|
|
.title {
|
|
width: 100%;
|
|
font-size: 16px;
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-line-clamp: 2;
|
|
// text-align: justify;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.spec {
|
|
font-size: 14px;
|
|
color: #a7a7a7;
|
|
height: 30upx;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0;
|
|
border-radius: 15upx;
|
|
margin-bottom: 20vw;
|
|
}
|
|
|
|
.price-number {
|
|
position: absolute;
|
|
width: 100%;
|
|
bottom: 0upx;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-end;
|
|
font-size: 28upx;
|
|
height: 60upx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|