This commit is contained in:
parent
8167f71bfd
commit
47b4284326
|
@ -9,6 +9,14 @@
|
|||
// +----------------------------------------------------------------------
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
/**
|
||||
* 校验支付密码是否正确
|
||||
* @param numType
|
||||
*/
|
||||
export function verifyPwd(data) {
|
||||
return request.post("order/verifyPwd", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车列表
|
||||
* @param numType boolean true 购物车数量,false=购物车产品数量
|
||||
|
|
|
@ -16,6 +16,13 @@ export function addCart(data) {
|
|||
return request.post(`user/cart/create`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺 获取商品
|
||||
*/
|
||||
export function getProductInfo1(data) {
|
||||
return request.get(`order_mix`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺id 获取店铺信息
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
<template>
|
||||
<uni-popup ref="payModal" type="center" safeArea :animation="true">
|
||||
<view class="payModal">
|
||||
<view class="payModal-title">{{code == 101?'未设置密码':'支付密码错误'}}</view>
|
||||
<view class="payModal-btns">
|
||||
<view class="wrap" style="display: flex;flex: 1;" v-if="code == 101">
|
||||
<view class="payModal-btns-left payModal-common" @click="handleClick(1)">设置密码</view>
|
||||
<view class="payModal-btns-right payModal-common" @click="handleClick(2)">取消</view>
|
||||
</view>
|
||||
<view class="wrap" style="display: flex;flex: 1;" v-else>
|
||||
<view class="payModal-btns-left payModal-common" @click="handleClick(1)">忘记密码</view>
|
||||
<view class="payModal-btns-right payModal-common" @click="handleClick(2)">重试</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 打开
|
||||
handleOpen(code) {
|
||||
this.code = code;
|
||||
this.$refs.payModal.open();
|
||||
},
|
||||
|
||||
// 关闭
|
||||
handleClose() {
|
||||
this.$refs.payModal.close();
|
||||
},
|
||||
|
||||
handleClick(type) {
|
||||
if (type == 1) {
|
||||
this.$emit('left', this.code);
|
||||
} else {
|
||||
this.$emit("right", this.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.payModal {
|
||||
width: 600rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
|
||||
.payModal-title {
|
||||
text-align: center;
|
||||
padding: 40rpx 50rpx 50rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
border-bottom: 2rpx solid #e6e6e6;
|
||||
}
|
||||
|
||||
.payModal-btns {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
.payModal-btns-left {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
border-right: 2rpx solid #e6e6e6;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.payModal-btns-right {
|
||||
color: #2a5ac2;
|
||||
}
|
||||
|
||||
.payModal-common {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,248 @@
|
|||
<template>
|
||||
<view>
|
||||
<uni-popup ref="popup" type="bottom" :mask-background-color="isPay?'rgba(0,0,0,.8)':'transparent'" safeArea
|
||||
backgroundColor="transparent" :animation="true" @maskClick="maskClick">
|
||||
<view class="popup-wrap" :style="{'border-radius':isPay?'': 0}">
|
||||
<view class="paybox" v-if="isPay">
|
||||
<view class="paybox-title">
|
||||
<view class="paybox-title-left"></view>
|
||||
<view class="paybox-title-middle">请输入支付密码</view>
|
||||
<view class="paybox-titler-right" @click="handleClose">
|
||||
<u-icon name="close" size="18" color="#666" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="paybox-input">
|
||||
<u-code-input v-model="value" mode="box" dot readonly></u-code-input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="keyboard">
|
||||
<view class="keyboard-left" :style="{width:isPay?'100%':''}">
|
||||
<block v-for="(item,indx) in keys" :key="indx">
|
||||
<view class="keyboard-left-item active del" v-if="item=='del'" @click="handleClick(item)">
|
||||
<image style="width: 48rpx;height: 48rpx;" src="@/static/del.webp" />
|
||||
</view>
|
||||
|
||||
<view class="keyboard-left-item word active"
|
||||
:style="{width:isPay?'0%':'',border:isPay?'0':''}" v-else-if="item == '.'"
|
||||
@click="handleClick(item)">
|
||||
{{isPay?'':item}}
|
||||
</view>
|
||||
|
||||
<view class="keyboard-left-item word active"
|
||||
:style="{width:(isPay && item == '0')?'66.66%':''}" v-else @click="handleClick(item)">
|
||||
{{item}}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="keyboard-right" :style="{width:isPay?'0%':''}">
|
||||
<view class="keyboard-right-clear word active" @click="handleClear">清空</view>
|
||||
<view class="keyboard-right-pay word active-pay" @click="handlePay">{{txt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "popups",
|
||||
props: {
|
||||
txt: {
|
||||
type: String,
|
||||
default: '付款'
|
||||
},
|
||||
isPay: { //区分支付密码还是输入数字
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keys: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '.', 'del'],
|
||||
value: '',
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
value(newVal, oldVal) {
|
||||
// 输入密码走此处
|
||||
if (newVal.length == 6 && this.isPay) {
|
||||
this.handlePay();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 键盘点击
|
||||
handleClick(item) {
|
||||
if (this.value.length >= 10) return;
|
||||
if (item == ".") {
|
||||
if (!this.value) {
|
||||
this.value = '0.';
|
||||
} else {
|
||||
if (this.value.indexOf('.') > -1) return;
|
||||
this.value = this.value + item;
|
||||
}
|
||||
} else if (item == 'del') {
|
||||
if (this.value == "0.")
|
||||
this.value = this.value.substring(0, 0);
|
||||
else
|
||||
this.value = this.value.substring(0, this.value.length - 1);
|
||||
} else if (item == 0) {
|
||||
if (this.isPay) {
|
||||
this.value = this.value + item;
|
||||
} else {
|
||||
if (this.value) {
|
||||
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3)
|
||||
return;
|
||||
this.value = this.value + item;
|
||||
} else {
|
||||
this.value = this.value + item;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3) return;
|
||||
this.value = this.value + item;
|
||||
}
|
||||
|
||||
this.$emit('change', this.value);
|
||||
},
|
||||
|
||||
// 清空
|
||||
handleClear() {
|
||||
this.value = '';
|
||||
this.$emit('clear');
|
||||
},
|
||||
|
||||
// 付款
|
||||
handlePay() {
|
||||
// 如果最后一位是. 去除
|
||||
if (this.value && this.value.endsWith('.')) {
|
||||
this.value = this.value.replace('.', '');
|
||||
}
|
||||
|
||||
this.$emit('confirm', this.value);
|
||||
this.handleClose();
|
||||
},
|
||||
|
||||
// 开启
|
||||
handleOpen() {
|
||||
this.value = '';
|
||||
console.log('123:' + this.value);
|
||||
this.$refs.popup.open();
|
||||
},
|
||||
|
||||
// 关闭
|
||||
handleClose() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
|
||||
maskClick() {
|
||||
// 如果最后一位是. 去除
|
||||
if (this.value && this.value.endsWith('.')) {
|
||||
this.value = this.value.replace('.', '');
|
||||
}
|
||||
this.$emit('change', this.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup-wrap {
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
|
||||
.paybox {
|
||||
.paybox-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 40rpx;
|
||||
|
||||
.paybox-title-left {}
|
||||
|
||||
.paybox-title-middle {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.paybox-titler-right {}
|
||||
}
|
||||
|
||||
.paybox-input {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
/deep/.u-code-input__item {
|
||||
background-color: #E6E6E6;
|
||||
border-radius: 8rpx;
|
||||
border: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
display: flex;
|
||||
padding-bottom: 20rpx;
|
||||
border-top: 2rpx solid #E6E6E6;
|
||||
|
||||
.keyboard-left {
|
||||
width: 75%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.keyboard-left-item {
|
||||
width: 33.3%;
|
||||
height: 120rpx;
|
||||
line-height: 102rpx;
|
||||
border-bottom: 2rpx solid #E6E6E6;
|
||||
border-right: 2rpx solid #E6E6E6;
|
||||
}
|
||||
|
||||
.del {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard-right {
|
||||
width: 25%;
|
||||
|
||||
.keyboard-right-clear {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
line-height: 226rpx;
|
||||
}
|
||||
|
||||
.keyboard-right-pay {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
line-height: 226rpx;
|
||||
text-align: center;
|
||||
background-color: #40AE36;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.word {
|
||||
font-weight: 600;
|
||||
font-size: 34rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.active:active {
|
||||
background-color: rgba(232, 232, 232, 0.5);
|
||||
}
|
||||
|
||||
.active-pay:active {
|
||||
opacity: .9;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,167 @@
|
|||
<template>
|
||||
<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,0)" safeArea backgroundColor="#fff"
|
||||
:animation="true" @maskClick="maskClick">
|
||||
|
||||
<view style="padding:40rpx;display: flex;justify-content: center;align-items: center;">
|
||||
<u-code-input v-model="value" mode="box" dot readonly></u-code-input>
|
||||
</view>
|
||||
|
||||
<view class="keyboard">
|
||||
<view class="keyboard-left">
|
||||
<block v-for="(item,indx) in keys" :key="indx">
|
||||
<view class="keyboard-left-item word active" v-if="item != 'del'" @click="handleClick(item)">
|
||||
{{item}}
|
||||
</view>
|
||||
<view class="keyboard-left-item active del" v-else @click="handleClick(item)">
|
||||
<image style="width: 48rpx;height: 48rpx;" src="@/static/del.webp" />
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="keyboard-right">
|
||||
<view class="keyboard-right-clear word active" @click="handleClear">清空</view>
|
||||
<view class="keyboard-right-pay word active-pay" @click="handlePay">付款</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "popups",
|
||||
data() {
|
||||
return {
|
||||
keys: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '.', 'del'],
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 键盘点击
|
||||
handleClick(item) {
|
||||
if (this.value.length >= 10) return;
|
||||
if (item == ".") {
|
||||
if (!this.value) {
|
||||
this.value = '0.';
|
||||
} else {
|
||||
if (this.value.indexOf('.') > -1) return;
|
||||
this.value = this.value + item;
|
||||
}
|
||||
} else if (item == 'del') {
|
||||
if (this.value == "0.")
|
||||
this.value = this.value.substring(0, 0);
|
||||
else
|
||||
this.value = this.value.substring(0, this.value.length - 1);
|
||||
} else if (item == 0) {
|
||||
if (this.value) {
|
||||
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3)
|
||||
return;
|
||||
|
||||
this.value = this.value + item;
|
||||
}
|
||||
} else {
|
||||
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3) return;
|
||||
this.value = this.value + item;
|
||||
}
|
||||
|
||||
this.$emit('change', this.value);
|
||||
},
|
||||
|
||||
// 清空
|
||||
handleClear() {
|
||||
this.value = '';
|
||||
this.$emit('clear');
|
||||
},
|
||||
|
||||
// 付款
|
||||
handlePay() {
|
||||
// 如果最后一位是. 去除
|
||||
if (this.value && this.value.endsWith('.')) {
|
||||
this.value = this.value.replace('.', '');
|
||||
}
|
||||
|
||||
this.$emit('confirm', this.value);
|
||||
this.handleClose();
|
||||
},
|
||||
|
||||
// 开启
|
||||
handleOpen() {
|
||||
this.$refs.popup.open();
|
||||
},
|
||||
|
||||
// 关闭
|
||||
handleClose() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
|
||||
maskClick() {
|
||||
// 如果最后一位是. 去除
|
||||
if (this.value && this.value.endsWith('.')) {
|
||||
this.value = this.value.replace('.', '');
|
||||
}
|
||||
this.$emit('change', this.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.keyboard {
|
||||
display: flex;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.keyboard-left {
|
||||
width: 75%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.keyboard-left-item {
|
||||
width: 33.3%;
|
||||
height: 120rpx;
|
||||
line-height: 102rpx;
|
||||
border-bottom: 2rpx solid #E6E6E6;
|
||||
border-right: 2rpx solid #E6E6E6;
|
||||
}
|
||||
|
||||
.del {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard-right {
|
||||
width: 25%;
|
||||
|
||||
.keyboard-right-clear {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
line-height: 226rpx;
|
||||
}
|
||||
|
||||
.keyboard-right-pay {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
line-height: 226rpx;
|
||||
text-align: center;
|
||||
background-color: #40AE36;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.word {
|
||||
font-weight: 600;
|
||||
font-size: 34rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.active:active {
|
||||
background-color: rgba(232, 232, 232, 0.5);
|
||||
}
|
||||
|
||||
.active-pay:active {
|
||||
opacity: .9;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,66 +1,73 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="v-navbar">
|
||||
<view v-if="!isWeixin" class="v-navbar">
|
||||
<u-navbar title="提货付款" :safeAreaInsetTop="false" :fixed="false" @leftClick="leftClick" bgColor="transparent"
|
||||
leftIconColor="#fff" :titleStyle="{color:'#fff',fontWeight:'bold',fontSize:'32rpx'}">
|
||||
leftIconColor="#333" :titleStyle="{color:'#333',fontWeight:'bold',fontSize:'32rpx'}">
|
||||
</u-navbar>
|
||||
</view>
|
||||
<view v-if="merchantInfo && !isEmpty">
|
||||
<view class="v-desc">
|
||||
<view>
|
||||
<view class="v-desc-main">确认提货付款</view>
|
||||
<view class="v-desc-sub">{{merchantInfo.merchant.mer_name}}</view>
|
||||
</view>
|
||||
<u-image :showLoading="true" :src="merchantInfo.merchant.mer_avatar" width="182rpx" height="182rpx"
|
||||
:radius="10" />
|
||||
<view style="height: 50rpx;"></view>
|
||||
<view class="wrap">
|
||||
<view class="shop">
|
||||
<image src="@/static/shop_logo.webp" style="width: 62rpx;height: 54rpx;" />
|
||||
<text class="shop-name" v-if="mer_name">{{mer_name||''}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 付款金额 -->
|
||||
<view class="v-con">
|
||||
<view class="v-con-text">付款金额</view>
|
||||
<view class="v-con-input" style="margin-right: 10px;">
|
||||
<text style="color: #303133;font-size:46rpx;">¥</text>
|
||||
<u--input type="digit" fontSize="23" v-model="cartForm.total_amount" placeholder="请输入金额"
|
||||
border="none" placeholderStyle="color:#999;font-size:30rpx" @input="validateDecimal">
|
||||
<view class="v-con-text">订单金额</view>
|
||||
<view class="v-con-input" @click="handleOpenKeyboard">
|
||||
<text style="color: #303133;font-size:32rpx;">¥</text>
|
||||
<u--input type="text" fontSize="23" height="112rpx" placeholder="请输入金额" border="none" readonly
|
||||
v-model="cartForm.total_amount" placeholderStyle="color:#999;font-size:32rpx">
|
||||
</u--input>
|
||||
<view class="placeholder"></view>
|
||||
</view>
|
||||
|
||||
<view class="v-wrap" v-if="cartForm.total_amount">
|
||||
<view class="v-wrap-money">
|
||||
<text class="icon">¥</text>
|
||||
<text class="num">{{cartForm.total_amount}}</text>
|
||||
<view class="v-con-group">
|
||||
<view class="v-con-group-title">
|
||||
<view class="v-con-group-title-left">套餐详情</view>
|
||||
<view class="v-con-group-title-right" @click.stop="handleOpen">
|
||||
<text>{{isOpen?'折叠':'展开'}}</text>
|
||||
<u-icon :name="isOpen?'arrow-down' : 'arrow-right'" size="15"></u-icon>
|
||||
</view>
|
||||
<view class="v-wrap-desc">
|
||||
<view class="v-wrap-desc-main">实物提货券</view>
|
||||
<view class="v-wrap-desc-sub">即买即用</view>
|
||||
</view>
|
||||
<scroll-view scroll-y>
|
||||
<view class="v-con-group-list" :style="{'max-height':isOpen?'400rpx':'0'}">
|
||||
<block v-for="(item,indx) in merchantInfo" :key="indx">
|
||||
<view class="v-con-group-list-item">
|
||||
<image :src="item.image" :showLoading="true" style="width:86rpx;height:86rpx;" />
|
||||
<text class="line1">{{item.store_name}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="v-btn-wrap">
|
||||
<view class="v-btn" @click="submitOrder">提交订单</view>
|
||||
<view class="v-btn-wrap" @click="cartForm.total_amount?submitOrder():null">
|
||||
<view class="v-btn">{{Number(cartForm.total_amount||0).toFixed(2)}}元 确认支付</view>
|
||||
</view>
|
||||
|
||||
<!-- 登陆 -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun" />
|
||||
</view>
|
||||
|
||||
<!-- 无商户信息提示 -->
|
||||
<view v-else class="empty">
|
||||
<image src="/static/images/no_thing.png"></image>
|
||||
<text style="margin-top: 60rpx;">{{tips}}</text>
|
||||
<!-- 登陆 -->
|
||||
<authorize :isAuto="isAuto" :isGoIndex="false" :isShowAuth="isShowAuth" @authColse="authColse"
|
||||
@onLoadFun="onLoadFun">
|
||||
<!-- <view class="empty">
|
||||
<authorize v-show="!isWeixin" ref="authRef" :isAuto="isAuto" :isGoIndex="false" :isShowAuth="isShowAuth"
|
||||
@authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 键盘 -->
|
||||
<popups ref="popups" @confirm="handleConfirm" @clear="handleClear" @change="handleChange"></popups>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var that;
|
||||
|
||||
import {
|
||||
getProductInfo,
|
||||
getProductInfo1,
|
||||
addCart,
|
||||
orderCheck
|
||||
} from "@/api/payment.js";
|
||||
|
@ -69,17 +76,23 @@
|
|||
mapGetters
|
||||
} from "vuex";
|
||||
import authorize from '@/components/Authorize';
|
||||
import { Toast } from "../../libs/uniApi";
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi";
|
||||
import popups from "@/components/popups/index.vue";
|
||||
export default {
|
||||
components: {
|
||||
authorize
|
||||
authorize,
|
||||
popups
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: false,
|
||||
isEmpty: true,
|
||||
// isWeixin: this.$wechat.isWeixin(),
|
||||
isWeixin: false,
|
||||
cartForm: {
|
||||
product_id: '',
|
||||
product_attr_unique: '',
|
||||
|
@ -103,29 +116,67 @@ import { Toast } from "../../libs/uniApi";
|
|||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
mer_id: '',
|
||||
tips: '暂未登陆~'
|
||||
changeTxt: '展开',
|
||||
isOpen: false,
|
||||
keyBoardShow: false,
|
||||
mer_name: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(opt) {
|
||||
that = this;
|
||||
this.mer_id = opt.mer_id;
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (!this.isLogin) {
|
||||
Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id);
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true;
|
||||
if (this.isWeixin) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.authRef.toWecahtAuth();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.checkForm.cart_id = [];
|
||||
this.getProductInfoByMerid(this.mer_id);
|
||||
this.getProductInfoByMerid();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateDecimal(event) {
|
||||
let val = (this.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
|
||||
// 打开键盘
|
||||
handleOpenKeyboard() {
|
||||
if (!this.isLogin) {
|
||||
Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id);
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true;
|
||||
if (this.isWeixin) {
|
||||
this.$nextTick(() => {
|
||||
this.cartForm.total_amount = val;
|
||||
this.$refs.authRef.toWecahtAuth();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$refs.popups.handleOpen();
|
||||
}
|
||||
},
|
||||
|
||||
// 键盘提交
|
||||
handleConfirm(e) {
|
||||
if (!e) return;
|
||||
this.cartForm.total_amount = e;
|
||||
this.submitOrder();
|
||||
},
|
||||
|
||||
// 清空
|
||||
handleClear() {
|
||||
this.cartForm.total_amount = '';
|
||||
this.merchantInfo = [];
|
||||
},
|
||||
|
||||
// 输入数字
|
||||
handleChange(e) {
|
||||
this.cartForm.total_amount = e;
|
||||
uni.$u.debounce(that.getProductInfoByMerid, 200)
|
||||
},
|
||||
|
||||
leftClick(e) {
|
||||
|
@ -133,60 +184,94 @@ import { Toast } from "../../libs/uniApi";
|
|||
url: '/pages/index/index'
|
||||
})
|
||||
},
|
||||
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e;
|
||||
},
|
||||
|
||||
onLoadFun() {
|
||||
this.getProductInfoByMerid(this.mer_id);
|
||||
this.isShowAuth = false;
|
||||
},
|
||||
|
||||
// 提交订单
|
||||
submitOrder() {
|
||||
async submitOrder() {
|
||||
if (!this.cartForm.total_amount) {
|
||||
return this.$util.Tips({
|
||||
title: "请输入付款金额!"
|
||||
})
|
||||
}
|
||||
// 订单
|
||||
this.cartForm.product_id = this.merchantInfo.product_id;
|
||||
this.cartForm.product_type = this.merchantInfo.product_type;
|
||||
this.cartForm.product_attr_unique = this.merchantInfo.sku[''].unique;
|
||||
|
||||
let that = this;
|
||||
addCart(this.cartForm).then(res => {
|
||||
// 购物车ID
|
||||
// 循环加入购物车
|
||||
for (var i = 0; i < that.merchantInfo.length; i++) {
|
||||
let info = {
|
||||
product_id: that.merchantInfo[i].product_id,
|
||||
product_attr_unique: that.merchantInfo[i].unique,
|
||||
cart_num: that.merchantInfo[i].num,
|
||||
is_new: 1,
|
||||
product_type: 0,
|
||||
source: 999,
|
||||
total_amount: that.cartForm.total_amount
|
||||
};
|
||||
|
||||
try {
|
||||
let res = await addCart(info);
|
||||
that.checkForm.cart_id.push(res.data.cart_id);
|
||||
} catch (e) {
|
||||
return that.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (that.checkForm.cart_id && that.checkForm.cart_id.length > 0) {
|
||||
orderCheck(that.checkForm).then(res1 => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/payment/settlement?cartId=" + this.checkForm
|
||||
.cart_id + "&money=" + this.cartForm.total_amount +
|
||||
"&merName=" + this.merchantInfo.merchant.mer_name,
|
||||
url: "/pages/payment/settlement",
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('datas', res1.data.platformConsumption);
|
||||
}
|
||||
})
|
||||
}).catch(err=>{
|
||||
Toast(err.message || err)
|
||||
});
|
||||
}).catch((err) => {
|
||||
this.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
})
|
||||
uni.setStorageSync('datas', {
|
||||
platformConsumption: res1.data.platformConsumption ||
|
||||
[],
|
||||
productData: that.merchantInfo,
|
||||
checkForm: that.checkForm,
|
||||
money: that.cartForm.total_amount,
|
||||
merName: that.mer_name,
|
||||
money: that.cartForm.total_amount,
|
||||
key: res1.data.key
|
||||
})
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
Toast(err.message || err)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getProductInfoByMerid(merid) {
|
||||
let that = this;
|
||||
getProductInfo({
|
||||
mer_id: merid
|
||||
// 折叠商品
|
||||
handleOpen() {
|
||||
this.isOpen = !this.isOpen;
|
||||
},
|
||||
|
||||
// 根据店铺获取商品
|
||||
getProductInfoByMerid(merid, money) {
|
||||
getProductInfo1({
|
||||
mer_id: that.mer_id,
|
||||
money: that.cartForm.total_amount
|
||||
}).then(res => {
|
||||
this.merchantInfo = res.data;
|
||||
if (!that.cartForm.total_amount) {
|
||||
this.mer_name = res.data.merchant;
|
||||
} else {
|
||||
that.merchantInfo = res.data.list;
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.tips = err.message || err.smg || err;
|
||||
this.$util.Tips({
|
||||
that.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
}, () => {
|
||||
|
||||
})
|
||||
// #ifdef APP
|
||||
setTimeout(() => {
|
||||
|
@ -200,49 +285,6 @@ import { Toast } from "../../libs/uniApi";
|
|||
that.isEmpty = true;
|
||||
// #endif
|
||||
})
|
||||
},
|
||||
|
||||
// 图片保存
|
||||
handleSavePic() {
|
||||
// 获取要保存的图片路径或URL
|
||||
let imageUrl = this.qrcodeUrl; // 这里使用了网络上的图片作为示例
|
||||
|
||||
// #ifdef H5
|
||||
var a = document.createElement("a");
|
||||
a.download = imageUrl;
|
||||
a.href = imageUrl;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
let that = this;
|
||||
uni.downloadFile({
|
||||
url: imageUrl,
|
||||
success(res) {
|
||||
if (res.statusCode === 200) {
|
||||
let tempFilePath = res.tempFilePath; // 临时文件路径
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: tempFilePath,
|
||||
success() {
|
||||
return that.$util.Tips({
|
||||
title: '图片已保存至相册!'
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
console.error('保存失败', err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('下载失败', res.statusCode);
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.error('下载失败', err);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -250,11 +292,11 @@ import { Toast } from "../../libs/uniApi";
|
|||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FCDFAD;
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 130rpx 0 150rpx;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
|
||||
image,
|
||||
|
@ -274,7 +316,7 @@ import { Toast } from "../../libs/uniApi";
|
|||
.container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
background-image: url("https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c582c202402291601584806.webp");
|
||||
// background-image: url("https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c582c202402291601584806.webp");
|
||||
background-size: 100% auto;
|
||||
background-repeat: no-repeat;
|
||||
padding-top: var(--status-bar-height);
|
||||
|
@ -304,34 +346,56 @@ import { Toast } from "../../libs/uniApi";
|
|||
}
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 52rpx 0 54rpx;
|
||||
}
|
||||
|
||||
.shop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 54rpx;
|
||||
|
||||
text {
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.v-con {
|
||||
position: absolute;
|
||||
top: 436rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 710rpx;
|
||||
height: 680rpx;
|
||||
background: linear-gradient(180deg, #FEB992 0%, #FFFFFF 31%, #FFFFFF 100%);
|
||||
border-radius: 20rpx;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 -4rpx 0px 0px #fff;
|
||||
padding: 53rpx 30rpx 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto 150rpx;
|
||||
|
||||
.v-con-text {
|
||||
margin-bottom: 60rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #2E2E2E;
|
||||
line-height: 16rpx;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.v-con-input {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 83rpx;
|
||||
padding: 0 0 40rpx 12rpx;
|
||||
height: 112rpx;
|
||||
margin-bottom: 32rpx;
|
||||
border-bottom: 1rpx solid #D6D6D6;
|
||||
|
||||
/deep/.uni-input-input {
|
||||
height: 112rpx;
|
||||
font-weight: bold;
|
||||
font-size: 72rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.v-wrap {
|
||||
|
@ -340,9 +404,6 @@ import { Toast } from "../../libs/uniApi";
|
|||
padding-left: 20rpx;
|
||||
width: 666rpx;
|
||||
height: 210rpx;
|
||||
background-image: url("https://lihai001.oss-cn-chengdu.aliyuncs.com/def/2f9c2202402291652415355.webp");
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.v-wrap-money {
|
||||
display: flex;
|
||||
|
@ -377,37 +438,92 @@ import { Toast } from "../../libs/uniApi";
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.v-con-group {
|
||||
.v-con-group-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.v-con-group-title-left {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.v-con-group-title-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
margin-right: 18rpx;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.v-con-group-list {
|
||||
transition: max-height linear .1s;
|
||||
|
||||
.v-con-group-list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14rpx;
|
||||
|
||||
text {
|
||||
margin-left: 30rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.v-btn-wrap {
|
||||
position: fixed;
|
||||
z-index: 11;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
background-color: #FDD6A6;
|
||||
|
||||
.v-btn {
|
||||
width: 650rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background: #FF8056;
|
||||
box-shadow: 0rpx 3rpx 3rpx 1rpx rgba(255, 94, 12, 0.4);
|
||||
border-radius: 55rpx 55rpx 55rpx 55rpx;
|
||||
border: 1rpx solid #FF8056;
|
||||
font-weight: 600;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background: #40AE36;
|
||||
border-radius: 10rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
|
||||
&:active {
|
||||
opacity: .8;
|
||||
}
|
||||
}
|
||||
// position: fixed;
|
||||
// z-index: 11;
|
||||
// bottom: 0;
|
||||
// left: 0;
|
||||
// display: flex;
|
||||
// justify-content: center;
|
||||
// align-items: center;
|
||||
// width: 100%;
|
||||
// height: 240rpx;
|
||||
// background-color: #FDD6A6;
|
||||
|
||||
// .v-btn {
|
||||
// width: 650rpx;
|
||||
// height: 100rpx;
|
||||
// line-height: 100rpx;
|
||||
// background: #FF8056;
|
||||
// box-shadow: 0rpx 3rpx 3rpx 1rpx rgba(255, 94, 12, 0.4);
|
||||
// border-radius: 55rpx 55rpx 55rpx 55rpx;
|
||||
// border: 1rpx solid #FF8056;
|
||||
// font-weight: 600;
|
||||
// font-size: 32rpx;
|
||||
// color: #FFFFFF;
|
||||
// text-align: center;
|
||||
|
||||
// &:active {
|
||||
// opacity: .8;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -10,20 +10,21 @@
|
|||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
|
||||
<block v-for="(item,indx) in productData" :key="indx">
|
||||
<view class="product-item">
|
||||
<view class="img-box">
|
||||
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/89ad3202402292014108303.jpg" width="170rpx"
|
||||
height="180rpx" />
|
||||
<image :src="item.image" width="170rpx" height="180rpx" />
|
||||
</view>
|
||||
<view class="content event_content">
|
||||
<view class="name line1">
|
||||
{{payForm.money}}元实物提货券
|
||||
{{item.store_name}}
|
||||
</view>
|
||||
<view style="margin-top: 30rpx;color: #FF5C2D;">
|
||||
¥{{payForm.money}}
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -44,9 +45,6 @@
|
|||
<block v-if="item.value == 'balance'">
|
||||
{{userInfo.now_money}}
|
||||
</block>
|
||||
<block v-else-if="item.value == 'merBalance'">
|
||||
{{moneyInfo.extract_money}}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
@ -63,9 +61,6 @@
|
|||
<block v-if="item.value == 'balance'">
|
||||
{{userInfo.now_money}}
|
||||
</block>
|
||||
<block v-else-if="item.value == 'merBalance'">
|
||||
{{moneyInfo.extract_money}}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
@ -81,7 +76,7 @@
|
|||
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>补贴抵扣</view>
|
||||
<block v-if="platformConsumption.length > 0" >
|
||||
<block v-if="platformConsumption.length > 0">
|
||||
<view class='discount money red_packet' @click="couponTap3()">
|
||||
<text v-if="consumption_id">-¥{{consumption_money||'0.00'}}</text>
|
||||
<text v-else>有补贴补贴未选</text>
|
||||
|
@ -106,6 +101,13 @@
|
|||
<view class='settlement' :class='couponData.status != "noAddress" ? "" : "disabled"' style='z-index:100'
|
||||
@tap="SubOrder">{{couponData.status != "noAddress" ? '提交订单':'选择地址'}}</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 支付密码 键盘 -->
|
||||
<popups ref="popups" :isPay="true" @confirm="handleConfirm" @clear="handleClear" @change="handleChange" />
|
||||
|
||||
<!-- 密码错误事件处理 -->
|
||||
<payPwd ref="payPwd" @left="handleLeft" @right="handleRight"></payPwd>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -126,7 +128,6 @@
|
|||
} from '@/api/order.js';
|
||||
import {
|
||||
getUserInfo,
|
||||
getAdminApplyAPI
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
openPaySubscribe
|
||||
|
@ -141,8 +142,17 @@
|
|||
orderPay,
|
||||
orderCheck
|
||||
} from "@/api/payment.js";
|
||||
import {
|
||||
verifyPwd
|
||||
} from '@/api/order.js';
|
||||
import payPwd from "@/components/payPwd/index.vue";
|
||||
import popups from "@/components/popups/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
payPwd,
|
||||
popups
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
platformConsumption: [],
|
||||
|
@ -173,13 +183,6 @@
|
|||
title: '可用余额:',
|
||||
payStatus: this.$store.getters.globalData.yue_pay_status,
|
||||
},
|
||||
{
|
||||
"name": "商户余额",
|
||||
"icon": "icon-icon-test",
|
||||
value: 'merBalance',
|
||||
title: '可用余额:',
|
||||
payStatus: this.$store.getters.globalData.yue_pay_status,
|
||||
},
|
||||
{
|
||||
"name": "线下支付",
|
||||
"icon": "icon-yinhangqia",
|
||||
|
@ -213,7 +216,6 @@
|
|||
couponId: 0, //优惠券id
|
||||
cartId: '', //购物车id
|
||||
userInfo: {}, //用户信息
|
||||
moneyInfo: {}, //商户余额信息
|
||||
coupon_price: 0, //优惠券抵扣金额
|
||||
ChangePrice: 0, //使用积分抵扣变动后的金额
|
||||
formIds: [], //收集formid
|
||||
|
@ -259,7 +261,9 @@
|
|||
pay_type: '',
|
||||
money: '',
|
||||
merName: '',
|
||||
return_url: ''
|
||||
return_url: '',
|
||||
key: '',
|
||||
source: 999,
|
||||
},
|
||||
checkForm: {
|
||||
address_id: '',
|
||||
|
@ -269,8 +273,11 @@
|
|||
source: 999,
|
||||
takes: [],
|
||||
use_coupon: {},
|
||||
use_integral: false
|
||||
use_integral: false,
|
||||
key: ''
|
||||
},
|
||||
productData: [],
|
||||
orderData: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -283,12 +290,12 @@
|
|||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
options.money = parseFloat(options.money).toFixed(2);
|
||||
this.payForm.cart_id = options.cartId;
|
||||
this.payForm.money = options.money;
|
||||
this.payForm.merName = options.merName;
|
||||
this.checkForm.cart_id = options.cartId.split(',');
|
||||
this.total_coupon = options.money;
|
||||
// options.money = parseFloat(options.money).toFixed(2);
|
||||
// this.payForm.cart_id = options.cartId;
|
||||
// this.payForm.money = options.money;
|
||||
// this.payForm.merName = options.merName;
|
||||
// this.checkForm.cart_id = options.cartId.split(',');
|
||||
// this.total_coupon = options.money;
|
||||
|
||||
// this.platformConsumption = [{
|
||||
// balance: "39000.00",
|
||||
|
@ -301,10 +308,18 @@
|
|||
// uid: 889
|
||||
// }]
|
||||
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
eventChannel.on('datas', (data) => {
|
||||
this.platformConsumption = data;
|
||||
})
|
||||
|
||||
let data = uni.getStorageSync("datas");
|
||||
this.productData = data.productData;
|
||||
this.platformConsumption = data.platformConsumption || [];
|
||||
|
||||
this.checkForm.cart_id = data.checkForm.cart_id;
|
||||
this.payForm.cart_id = this.checkForm.cart_id;
|
||||
this.payForm.money = data.money;
|
||||
this.payForm.merName = data.merName;
|
||||
this.payForm.key = data.key;
|
||||
this.total_coupon = data.money;
|
||||
this.checkForm.key = data.key;
|
||||
|
||||
// #ifdef H5
|
||||
this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5'
|
||||
|
@ -339,7 +354,7 @@
|
|||
orderCheck({
|
||||
...this.checkForm,
|
||||
consumption_id: this.consumption_id
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
this.total_coupon = res.data.order_price;
|
||||
this.consumption_money = res.data.consumption_money;
|
||||
this.payForm.consumption_id = this.consumption_id;
|
||||
|
@ -361,8 +376,7 @@
|
|||
// 获取个人信息
|
||||
getUserInfo() {
|
||||
getUserInfo().then(res => {
|
||||
this.userInfo = res.data;
|
||||
this.loadMoneyInfo();
|
||||
this.userInfo = res.data
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -378,13 +392,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
loadMoneyInfo(){
|
||||
//获取账户金额以及冻结金额 重新调了一次接口
|
||||
getAdminApplyAPI(this.userInfo.service.mer_id).then(res => {
|
||||
this.moneyInfo = res.data;
|
||||
})
|
||||
},
|
||||
|
||||
payment: function(data) {
|
||||
let that = this;
|
||||
createOrder(data).then(res => {
|
||||
|
@ -586,11 +593,66 @@
|
|||
});
|
||||
}
|
||||
this.payForm.pay_type = that.payType;
|
||||
|
||||
// 设置支付密码
|
||||
if (that.payType == 'balance' || that.payType == 'merBalance') {
|
||||
this.$refs.popups.handleOpen();
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '订单支付中',
|
||||
mask: true
|
||||
});
|
||||
this.truePayOrder(data);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 输入密码回调
|
||||
handleConfirm(e) {
|
||||
// 验证密码是否正确
|
||||
verifyPwd({
|
||||
withdrawal_pwd: e
|
||||
}).then(res => {
|
||||
// 密码是否有效 状态码判断
|
||||
const code = res.data.code;
|
||||
this.$set(this.payForm, 'withdrawal_pwd', e);
|
||||
|
||||
if (code == 100) { //密码正确
|
||||
uni.showLoading({
|
||||
title: '订单支付中',
|
||||
mask: true
|
||||
});
|
||||
this.truePayOrder(this.payForm);
|
||||
} else {
|
||||
this.$refs.payPwd.handleOpen(code);
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
|
||||
// 弹框左边按钮 101 未设置密码 102 忘记密码 都去设置密码
|
||||
handleLeft(code) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/users/user_modify_pwd/index?type=payPwd"
|
||||
});
|
||||
this.$refs.payPwd.handleClose();
|
||||
},
|
||||
|
||||
// 弹框右边按钮 取消 重试
|
||||
handleRight(code) {
|
||||
if (code == 101) { //取消
|
||||
this.$refs.payPwd.handleClose(code);
|
||||
} else {
|
||||
this.$refs.payPwd.handleClose();
|
||||
this.$refs.popups.handleOpen();
|
||||
}
|
||||
},
|
||||
|
||||
handleClear() {},
|
||||
handleChange() {},
|
||||
|
||||
truePayOrder() {
|
||||
// #ifdef MP
|
||||
openPaySubscribe().then(() => {
|
||||
that.payment(this.payForm);
|
||||
|
@ -598,7 +660,7 @@
|
|||
// #endif
|
||||
|
||||
// #ifndef MP
|
||||
that.payment(this.payForm);
|
||||
this.payment(this.payForm);
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,8 +186,15 @@
|
|||
:order_id="currentTab"></cash>
|
||||
|
||||
<!-- 提现提示 -->
|
||||
<u-modal :show="tipShow" title="提示" content='工作日当日10点前提现当日12点到账, 当日16点前提现当日18点到账, 当日18点后提现次日12点到账, 周末节假日提现, 下一工作日18点前到账'
|
||||
<u-modal :show="tipShow" title="提示"
|
||||
content='工作日当日10点前提现当日12点到账, 当日16点前提现当日18点到账, 当日18点后提现次日12点到账, 周末节假日提现, 下一工作日18点前到账'
|
||||
@confirm="tipShow = false"></u-modal>
|
||||
|
||||
<!-- 支付密码 键盘 -->
|
||||
<popups ref="popups" :isPay="true" @confirm="handleConfirm" @clear="handleClear" @change="handleChange" />
|
||||
|
||||
<!-- 密码错误事件处理 -->
|
||||
<payPwd ref="payPwd" @left="handleLeft" @right="handleRight"></payPwd>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -198,7 +205,6 @@
|
|||
getLisApplyAPI,
|
||||
getAccountApplyAPI,
|
||||
postAccountApplyAPI,
|
||||
|
||||
} from '@/api/user.js'
|
||||
import {
|
||||
extractCash,
|
||||
|
@ -217,10 +223,18 @@
|
|||
import {
|
||||
Toast
|
||||
} from '../../../libs/uniApi';
|
||||
import {
|
||||
verifyPwd
|
||||
} from '@/api/order.js';
|
||||
import payPwd from "@/components/payPwd/index.vue";
|
||||
import popups from "@/components/popups/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
cash,
|
||||
authorize
|
||||
authorize,
|
||||
payPwd,
|
||||
popups
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -278,7 +292,8 @@
|
|||
pay_close: false,
|
||||
pay_type: [],
|
||||
source: '',
|
||||
merId: ''
|
||||
merId: '',
|
||||
modes: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -487,18 +502,20 @@
|
|||
financial_bank_branch: this.mode.bank_address,
|
||||
financial_type: 1
|
||||
}
|
||||
console.log(mode);
|
||||
postCreateApplyAPI(this.merId, mode).then(res => {
|
||||
this.modes = mode;
|
||||
|
||||
this.$refs.popups.handleOpen();
|
||||
},
|
||||
|
||||
trueWithdraw() {
|
||||
postCreateApplyAPI(this.merId, this.modes).then(res => {
|
||||
// 提现申请
|
||||
// that.postCreate(e.detail.value.extract_price)
|
||||
Toast(res.message)
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1000)
|
||||
|
||||
console.log(res);
|
||||
}).catch(err => {
|
||||
Toast(err)
|
||||
setTimeout(() => {
|
||||
|
@ -509,6 +526,53 @@
|
|||
|
||||
})
|
||||
},
|
||||
|
||||
// 输入密码回调
|
||||
handleConfirm(e) {
|
||||
// 验证密码是否正确
|
||||
verifyPwd({
|
||||
withdrawal_pwd: e
|
||||
}).then(res => {
|
||||
// 密码是否有效 状态码判断
|
||||
const code = res.data.code;
|
||||
this.$set(this.modes, 'withdrawal_pwd', e);
|
||||
|
||||
if (code == 100) { //密码正确
|
||||
uni.showLoading({
|
||||
title: '订单支付中',
|
||||
mask: true
|
||||
});
|
||||
this.trueWithdraw();
|
||||
} else {
|
||||
this.$refs.payPwd.handleOpen(code);
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
|
||||
// 弹框左边按钮 101 未设置密码 102 忘记密码 都去设置密码
|
||||
handleLeft(code) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/users/user_modify_pwd/index?type=payPwd"
|
||||
});
|
||||
this.$refs.payPwd.handleClose();
|
||||
},
|
||||
|
||||
// 弹框右边按钮 取消 重试
|
||||
handleRight(code) {
|
||||
if (code == 101) { //取消
|
||||
this.$refs.payPwd.handleClose(code);
|
||||
} else {
|
||||
this.$refs.payPwd.handleClose();
|
||||
this.$refs.popups.handleOpen();
|
||||
}
|
||||
},
|
||||
|
||||
handleClear() {},
|
||||
handleChange() {},
|
||||
|
||||
|
||||
async postCreate(price) {
|
||||
const data = {
|
||||
extract_money: price,
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue