|
@@ -1,150 +1,167 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
|
- <view class="inner">
|
|
|
|
|
- <!-- 时间、价格 -->
|
|
|
|
|
- <view class="time-price">
|
|
|
|
|
- <text class="time">请在{{payLimitTime}}前完成支付</text>
|
|
|
|
|
- <view class="price-box">
|
|
|
|
|
- <text class="unit">¥</text>
|
|
|
|
|
- <text class="num" >{{payMoney.toFixed(2)}}</text>
|
|
|
|
|
|
|
+ <template v-if="order">
|
|
|
|
|
+ <view class="inner">
|
|
|
|
|
+ <!-- 时间、价格 -->
|
|
|
|
|
+ <view class="time-price">
|
|
|
|
|
+ <text class="time">请在{{payLimitTime}}前完成支付</text>
|
|
|
|
|
+ <view class="price-box">
|
|
|
|
|
+ <text class="unit">¥</text>
|
|
|
|
|
+ <text class="num" >{{payMoney?payMoney:'0.00'}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="desc" v-if="payType==2">代收金额{{payDelivery?payDelivery.toFixed(2):'0.00'}},请您在收到快递后支付尾款给快递人员。</text>
|
|
|
|
|
+ <text class="desc" v-if="payType==3">货到付款金额{{payDelivery?payDelivery.toFixed(2):'0.00'}},请您在收到快递后支付给快递人员。</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <text class="desc" v-if="payType==2">代收金额{{payDelivery.toFixed(2)}},请您在收到快递后支付尾款给快递人员。</text>
|
|
|
|
|
- <text class="desc" v-if="payType==3">货到付款金额{{payDelivery.toFixed(2)}},请您在收到快递后支付给快递人员。</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- 支付方式 -->
|
|
|
|
|
- <view class="pay-type">
|
|
|
|
|
- <view class="title">支付方式</view>
|
|
|
|
|
- <!-- 改价订单只能选择微信支付和物流代收 -->
|
|
|
|
|
- <radio-group @change="payTypeChange" v-if="order.isEditMoney!=null&&order.isEditMoney==1">
|
|
|
|
|
- <view class="item" >
|
|
|
|
|
- <view class="left" >
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
- <text class="text">微信支付</text>
|
|
|
|
|
|
|
+ <!-- 支付方式 -->
|
|
|
|
|
+ <view class="pay-type">
|
|
|
|
|
+ <view class="title">支付方式</view>
|
|
|
|
|
+ <!-- 改价订单只能选择微信支付和先定后付(物流代收) -->
|
|
|
|
|
+ <radio-group @change="payTypeChange" v-if="order.isEditMoney!=null&&order.isEditMoney==1">
|
|
|
|
|
+ <view class="item" >
|
|
|
|
|
+ <view class="left" >
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
+ <text class="text">全款支付</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="1" :checked="order.payType=='1'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="1" :checked="order.payType=='1'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item" >
|
|
|
|
|
- <view class="left">
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
|
|
|
|
|
- <text class="text">物流代收</text>
|
|
|
|
|
|
|
+ <view class="item" >
|
|
|
|
|
+ <view class="left">
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <text class="text">先定后付</text>
|
|
|
|
|
+ <view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="2" :checked="order.payType=='2'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="2" :checked="order.payType=='2'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- </radio-group>
|
|
|
|
|
-
|
|
|
|
|
- <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==3">
|
|
|
|
|
- <view class="item" >
|
|
|
|
|
- <view class="left" >
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
- <text class="text">微信支付</text>
|
|
|
|
|
|
|
+ </radio-group>
|
|
|
|
|
+
|
|
|
|
|
+ <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==3">
|
|
|
|
|
+ <view class="item" >
|
|
|
|
|
+ <view class="left" >
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
+ <text class="text">全款支付</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="1" :checked="order.payType=='1'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="1" :checked="order.payType=='1'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item" >
|
|
|
|
|
- <view class="left">
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
|
|
|
|
|
- <text class="text">物流代收</text>
|
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
|
+ <view class="left">
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <text class="text">先定后付</text>
|
|
|
|
|
+ <view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="2" :checked="order.payType=='2'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="2" :checked="order.payType=='2'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
|
|
|
|
|
- <view class="item">
|
|
|
|
|
- <view class="left">
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
|
|
|
|
|
- <text class="text">货到付款</text>
|
|
|
|
|
|
|
+ <!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
|
|
|
|
|
+ <view class="item">
|
|
|
|
|
+ <view class="left">
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
|
|
|
|
|
+ <text class="text">货到付款</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="3" :checked="order.payType=='3'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="3" :checked="order.payType=='3'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- </radio-group>
|
|
|
|
|
- <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==2">
|
|
|
|
|
- <view class="item" v-if="payType==1||payType==4" >
|
|
|
|
|
- <view class="left" >
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
- <text class="text">微信支付</text>
|
|
|
|
|
|
|
+ </radio-group>
|
|
|
|
|
+ <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==2">
|
|
|
|
|
+ <view class="item" v-if="payType==1||payType==4" >
|
|
|
|
|
+ <view class="left" >
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
+ <text class="text">全款支付</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="1" :checked="order.payType=='1'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="1" :checked="order.payType=='1'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item" v-if="payType==2||payType==4">
|
|
|
|
|
- <view class="left" >
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
|
|
|
|
|
- <text class="text">物流代收</text>
|
|
|
|
|
|
|
+ <view class="item" v-if="payType==2||payType==4">
|
|
|
|
|
+ <view class="left" >
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <text class="text">先定后付</text>
|
|
|
|
|
+ <view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="2" :checked="order.payType=='2'" />
|
|
|
|
|
+ </label>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="2" :checked="order.payType=='2'" />
|
|
|
|
|
- </label>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
|
|
|
|
|
|
|
+ <!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
|
|
|
|
|
+ <view class="item">
|
|
|
|
|
+ <view class="left">
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
|
|
|
|
|
+ <text class="text">货到付款</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="3" :checked="order.payType=='3'" />
|
|
|
|
|
+ </label>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </radio-group>
|
|
|
|
|
+ <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&&(order.orderCreateType==1)">
|
|
|
|
|
+ <view class="item" >
|
|
|
|
|
+ <view class="left" >
|
|
|
|
|
+ <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
+ <text class="text">全款支付</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <radio :value="1" checked />
|
|
|
|
|
+ </label>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </radio-group>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-info" v-show="payType=='2'">
|
|
|
|
|
+ <view class="title" style="margin-bottom: 20rpx;">定金金额</view>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <u--input type="text" v-model="editAmount" placeholder="请输入定金金额" class="intxt" maxlength="8"></u--input>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- 订单详情查看 -->
|
|
|
|
|
+ <view class="order-info">
|
|
|
|
|
+ <view class="title">订单信息</view>
|
|
|
<view class="item">
|
|
<view class="item">
|
|
|
- <view class="left">
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
|
|
|
|
|
- <text class="text">货到付款</text>
|
|
|
|
|
|
|
+ <text class="label">订单编号</text>
|
|
|
|
|
+ <view class="sn-box">
|
|
|
|
|
+ <view class="text" v-if="!combinationOrderId">{{orderCode}}</view>
|
|
|
|
|
+ <view v-else>
|
|
|
|
|
+ <view class="text" v-for="item in order.orderCodes" :key="item">{{item}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="copy-btn" @click="copyOrderSn(orderCode)">复制</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <label>
|
|
|
|
|
- <radio :value="3" :checked="order.payType=='3'" />
|
|
|
|
|
- </label>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- </radio-group>
|
|
|
|
|
- <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&&(order.orderCreateType==1)">
|
|
|
|
|
- <view class="item" >
|
|
|
|
|
- <view class="left" >
|
|
|
|
|
- <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
|
|
|
|
|
- <text class="text">微信支付</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <label>
|
|
|
|
|
- <radio :value="1" checked />
|
|
|
|
|
- </label>
|
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
|
+ <text class="label">下单时间</text>
|
|
|
|
|
+ <text class="text">{{order.createTime}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- </radio-group>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- 订单详情查看 -->
|
|
|
|
|
- <view class="order-info">
|
|
|
|
|
- <view class="title">订单信息</view>
|
|
|
|
|
- <view class="item">
|
|
|
|
|
- <text class="label">订单编号</text>
|
|
|
|
|
- <view class="sn-box">
|
|
|
|
|
- <view class="text" v-if="!combinationOrderId">{{orderCode}}</view>
|
|
|
|
|
- <view v-else>
|
|
|
|
|
- <view class="text" v-for="item in order.orderCodes" :key="item">{{item}}</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="copy-btn" @click="copyOrderSn(orderCode)">复制</view>
|
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
|
+ <text class="label">订单金额</text>
|
|
|
|
|
+ <text class="text" v-if="order!=null">{{order.payPrice.toFixed(2)}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <view class="item">
|
|
|
|
|
+ <text class="label">支付方式</text>
|
|
|
|
|
+ <text class="text">全款支付</text>
|
|
|
|
|
+ </view> -->
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="item">
|
|
|
|
|
- <text class="label">下单时间</text>
|
|
|
|
|
- <text class="text">{{order.createTime}}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item">
|
|
|
|
|
- <text class="label">订单金额</text>
|
|
|
|
|
- <text class="text" v-if="order!=null">{{order.payPrice.toFixed(2)}}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <!-- <view class="item">
|
|
|
|
|
- <text class="label">支付方式</text>
|
|
|
|
|
- <text class="text">微信支付</text>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="btn-box">
|
|
|
|
|
+ <view class="btn" @click="payOrder()">去支付</view>
|
|
|
|
|
+ <!-- <view class="other-btn" >
|
|
|
|
|
+ 亲友代付
|
|
|
|
|
+ <button class="share" data-name="shareBtn" open-type="share">分享</button>
|
|
|
</view> -->
|
|
</view> -->
|
|
|
-
|
|
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="btn-box">
|
|
|
|
|
- <view class="btn" @click="payOrder()">去支付</view>
|
|
|
|
|
- <!-- <view class="other-btn" >
|
|
|
|
|
- 亲友代付
|
|
|
|
|
- <button class="share" data-name="shareBtn" open-type="share">分享</button>
|
|
|
|
|
- </view> -->
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </template>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -152,7 +169,7 @@
|
|
|
import {getUserInfo} from '@/api/user'
|
|
import {getUserInfo} from '@/api/user'
|
|
|
|
|
|
|
|
import {getStoreConfig} from './api/common.js'
|
|
import {getStoreConfig} from './api/common.js'
|
|
|
- import {editPayType,pay,getStoreOrderById,payByCombinationId,getStoreOrderByCombinationId,editPayTypeByCombinationId} from '@/api/myStoreOrder.js'
|
|
|
|
|
|
|
+ import {editPayType,pay,getStoreOrderById,payByCombinationId,getStoreOrderByCombinationId,editPayTypeByCombinationId,selectPayInfo} from '@/api/myStoreOrder.js'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -167,25 +184,32 @@
|
|
|
combinationOrderId: '',
|
|
combinationOrderId: '',
|
|
|
orderCode: "",
|
|
orderCode: "",
|
|
|
// 需要开处方的订单id
|
|
// 需要开处方的订单id
|
|
|
- prescribeOrder: ""
|
|
|
|
|
|
|
+ prescribeOrder: "",
|
|
|
|
|
+ payTypeKey: '',
|
|
|
|
|
+ companyUserId: '',
|
|
|
|
|
+ editAmount: '',
|
|
|
|
|
+ payMethod: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
|
|
+ this.payMethod=option.payMethod||'';
|
|
|
|
|
+ this.payTypeKey = option.payTypeKey||'';
|
|
|
|
|
+ this.companyUserId = option.companyUserId||'';
|
|
|
this.combinationOrderId = option.combinationOrderId ? decodeURIComponent(option.combinationOrderId) : ''
|
|
this.combinationOrderId = option.combinationOrderId ? decodeURIComponent(option.combinationOrderId) : ''
|
|
|
this.orderId=option.orderId ? JSON.parse(option.orderId) : '';
|
|
this.orderId=option.orderId ? JSON.parse(option.orderId) : '';
|
|
|
- uni.showShareMenu({
|
|
|
|
|
- withShareTicket:true,
|
|
|
|
|
- //小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
|
|
|
|
|
- menus:["shareAppMessage"] //不设置默认发送给朋友
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // uni.showShareMenu({
|
|
|
|
|
+ // withShareTicket:true,
|
|
|
|
|
+ // //小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
|
|
|
|
|
+ // menus:["shareAppMessage"] //不设置默认发送给朋友
|
|
|
|
|
+ // })
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.$isLogin().then(res => {
|
|
this.$isLogin().then(res => {
|
|
|
if(res){
|
|
if(res){
|
|
|
if(this.combinationOrderId) {
|
|
if(this.combinationOrderId) {
|
|
|
- this.getStoreOrderByCombinationId()
|
|
|
|
|
|
|
+ this.getStoreOrderByCombinationId(1)
|
|
|
} else {
|
|
} else {
|
|
|
- this.getStoreOrderById();
|
|
|
|
|
|
|
+ this.getStoreOrderById(1);
|
|
|
}
|
|
}
|
|
|
this.getStoreConfig();
|
|
this.getStoreConfig();
|
|
|
this.getUserInfo();
|
|
this.getUserInfo();
|
|
@@ -197,15 +221,15 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
//发送给朋友
|
|
//发送给朋友
|
|
|
- onShareAppMessage(res) {
|
|
|
|
|
- const combinationOrderId = this.combinationOrderId ? `&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
|
|
|
|
|
- return {
|
|
|
|
|
- title: "帮TA支付",
|
|
|
|
|
- path: '/pages_shopping/user/otherPaymentOrder?orderId='+this.orderId + combinationOrderId,
|
|
|
|
|
- imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // onShareAppMessage(res) {
|
|
|
|
|
+ // const combinationOrderId = this.combinationOrderId ? `&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
|
|
|
|
|
+ // return {
|
|
|
|
|
+ // title: "帮TA支付",
|
|
|
|
|
+ // path: '/pages_shopping/user/otherPaymentOrder?orderId='+this.orderId + combinationOrderId,
|
|
|
|
|
+ // imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // },
|
|
|
methods: {
|
|
methods: {
|
|
|
getUserInfo(){
|
|
getUserInfo(){
|
|
|
getUserInfo().then(
|
|
getUserInfo().then(
|
|
@@ -224,6 +248,30 @@
|
|
|
rej => {}
|
|
rej => {}
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
+ getPayInfo() {
|
|
|
|
|
+ const param = {
|
|
|
|
|
+ dataKey:this.payTypeKey,
|
|
|
|
|
+ userId: this.companyUserId,
|
|
|
|
|
+ }
|
|
|
|
|
+ selectPayInfo(param).then(res => {
|
|
|
|
|
+ if(res.code==200){
|
|
|
|
|
+ this.payType=res.data.payType;
|
|
|
|
|
+ this.order.payType=res.data.payType;
|
|
|
|
|
+ if(this.combinationOrderId) {
|
|
|
|
|
+ this.editPayTypeByCombinationId(res.data.payType)
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.editPayType(res.data.payType)
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title: "请求失败",
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ rej => {}
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
getStoreConfig(){
|
|
getStoreConfig(){
|
|
|
getStoreConfig().then(
|
|
getStoreConfig().then(
|
|
|
res => {
|
|
res => {
|
|
@@ -237,6 +285,9 @@
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
payTypeChange(e){
|
|
payTypeChange(e){
|
|
|
|
|
+ if(e.detail.value ==2) {
|
|
|
|
|
+ this.editAmount = this.editAmount || this.order.payPrice
|
|
|
|
|
+ }
|
|
|
if(this.combinationOrderId) {
|
|
if(this.combinationOrderId) {
|
|
|
this.editPayTypeByCombinationId(e.detail.value)
|
|
this.editPayTypeByCombinationId(e.detail.value)
|
|
|
}else {
|
|
}else {
|
|
@@ -255,7 +306,7 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- getStoreOrderById(){
|
|
|
|
|
|
|
+ getStoreOrderById(type){
|
|
|
var data = {orderId:this.orderId};
|
|
var data = {orderId:this.orderId};
|
|
|
var that=this;
|
|
var that=this;
|
|
|
uni.showLoading();
|
|
uni.showLoading();
|
|
@@ -275,9 +326,15 @@
|
|
|
this.order.payType=1;
|
|
this.order.payType=1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ this.editAmount = this.order.payMoney
|
|
|
|
|
+ this.payType = this.order.payType
|
|
|
if(that.order.paid!=1) {
|
|
if(that.order.paid!=1) {
|
|
|
// 1支付成功就不用调用这个接口
|
|
// 1支付成功就不用调用这个接口
|
|
|
- this.editPayType(this.order.payType)
|
|
|
|
|
|
|
+ if(type==1&&this.payTypeKey) {
|
|
|
|
|
+ this.getPayInfo()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.editPayType(this.order.payType)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
}else{
|
|
@@ -291,12 +348,24 @@
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- editPayType(payType){
|
|
|
|
|
- var data = {orderId:this.orderId,payType:payType};
|
|
|
|
|
|
|
+ async editPayType(payType){
|
|
|
|
|
+ let data = {}
|
|
|
|
|
+ if(payType==2) {
|
|
|
|
|
+ if (!this.isValidAmount(this.editAmount)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: "请输入正确的金额,且必须大于0"
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ data = {editAmount:this.editAmount,orderId:this.orderId,payType:payType};
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data = {orderId:this.orderId,payType:payType};
|
|
|
|
|
+ }
|
|
|
var that=this;
|
|
var that=this;
|
|
|
uni.showLoading();
|
|
uni.showLoading();
|
|
|
- editPayType(data).then(
|
|
|
|
|
- res => {
|
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ editPayType(data).then(res => {
|
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
@@ -304,18 +373,21 @@
|
|
|
//this.payType=this.order.payType
|
|
//this.payType=this.order.payType
|
|
|
this.payMoney=this.order.payMoney;
|
|
this.payMoney=this.order.payMoney;
|
|
|
this.payDelivery=this.order.payDelivery;
|
|
this.payDelivery=this.order.payDelivery;
|
|
|
|
|
+ this.payType = payType
|
|
|
|
|
+ resolve(res); // 成功回调
|
|
|
}else{
|
|
}else{
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon:'none',
|
|
icon:'none',
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
|
});
|
|
});
|
|
|
|
|
+ reject(res); // 失败回调
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- rej => {}
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ reject(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- getStoreOrderByCombinationId() {
|
|
|
|
|
|
|
+ getStoreOrderByCombinationId(type) {
|
|
|
var data = {combinationId:this.combinationOrderId};
|
|
var data = {combinationId:this.combinationOrderId};
|
|
|
var that=this;
|
|
var that=this;
|
|
|
uni.showLoading();
|
|
uni.showLoading();
|
|
@@ -336,8 +408,13 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
that.prescribeOrder = res.prescribeOrder;
|
|
that.prescribeOrder = res.prescribeOrder;
|
|
|
- this.editPayTypeByCombinationId(this.order.payType)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.editAmount = this.order.payMoney
|
|
|
|
|
+ this.payType = this.order.payType
|
|
|
|
|
+ if(type==1&&this.payTypeKey) {
|
|
|
|
|
+ this.getPayInfo()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.editPayTypeByCombinationId(this.order.payType)
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon:'none',
|
|
icon:'none',
|
|
@@ -349,13 +426,24 @@
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
editPayTypeByCombinationId(payType){
|
|
editPayTypeByCombinationId(payType){
|
|
|
- var data = {combinationOrderId:this.combinationOrderId,payType:payType};
|
|
|
|
|
- var that=this;
|
|
|
|
|
|
|
+ let data ={}
|
|
|
|
|
+ if(payType==2) {
|
|
|
|
|
+ if (!this.isValidAmount(this.editAmount)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: "请输入正确的金额,且必须大于0"
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ data = {editAmount: this.editAmount,combinationOrderId:this.combinationOrderId,payType:payType};
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data = {combinationOrderId:this.combinationOrderId,payType:payType};
|
|
|
|
|
+ }
|
|
|
|
|
+ let that = this
|
|
|
uni.showLoading();
|
|
uni.showLoading();
|
|
|
- editPayTypeByCombinationId(data).then(
|
|
|
|
|
- res => {
|
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ editPayTypeByCombinationId(data).then(res => {
|
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
|
- console.log(res);
|
|
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
that.order=res.order;
|
|
that.order=res.order;
|
|
|
that.orderCode = res.order.orderCodes ? res.order.orderCodes.join(',') : "";
|
|
that.orderCode = res.order.orderCodes ? res.order.orderCodes.join(',') : "";
|
|
@@ -363,24 +451,36 @@
|
|
|
this.payMoney=this.order.payMoney;
|
|
this.payMoney=this.order.payMoney;
|
|
|
this.payDelivery=this.order.payDelivery;
|
|
this.payDelivery=this.order.payDelivery;
|
|
|
that.prescribeOrder = res.prescribeOrder;
|
|
that.prescribeOrder = res.prescribeOrder;
|
|
|
|
|
+ this.payType = payType
|
|
|
|
|
+ console.log('this.order.payMoney==',this.payMoney,this.order.payMoney);
|
|
|
|
|
+ resolve(res); // 成功回调
|
|
|
}else{
|
|
}else{
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon:'none',
|
|
icon:'none',
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
|
});
|
|
});
|
|
|
|
|
+ reject(res); // 失败回调
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- rej => {}
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ reject(err);
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- payOrder(){
|
|
|
|
|
|
|
+ async payOrder(){
|
|
|
if(this.combinationOrderId) {
|
|
if(this.combinationOrderId) {
|
|
|
|
|
+ if(this.order.payType==2&&this.payMoney!=this.editAmount){
|
|
|
|
|
+ await this.editPayTypeByCombinationId(this.order.payType)
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ }
|
|
|
let data = {combinationOrderId:this.combinationOrderId,payType:this.order.payType,appId: getApp().globalData.appId};
|
|
let data = {combinationOrderId:this.combinationOrderId,payType:this.order.payType,appId: getApp().globalData.appId};
|
|
|
|
|
+ if(this.order.payType==2) {
|
|
|
|
|
+ data = {editAmount:this.editAmount,combinationOrderId:this.combinationOrderId,payType:this.order.payType,appId: getApp().globalData.appId};
|
|
|
|
|
+ }
|
|
|
let that=this;
|
|
let that=this;
|
|
|
uni.showLoading();
|
|
uni.showLoading();
|
|
|
payByCombinationId(data).then(
|
|
payByCombinationId(data).then(
|
|
|
res => {
|
|
res => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
|
this.payfun(res)
|
|
this.payfun(res)
|
|
|
}else{
|
|
}else{
|
|
@@ -393,7 +493,14 @@
|
|
|
rej => {}
|
|
rej => {}
|
|
|
);
|
|
);
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if(this.order.payType==2&&this.payMoney!=this.editAmount){
|
|
|
|
|
+ await this.editPayType(this.order.payType)
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ }
|
|
|
let data = {orderId:this.order.id,payType:this.order.payType,appId: getApp().globalData.appId};
|
|
let data = {orderId:this.order.id,payType:this.order.payType,appId: getApp().globalData.appId};
|
|
|
|
|
+ if(this.order.payType==2) {
|
|
|
|
|
+ data = {editAmount:this.editAmount,orderId:this.order.id,payType:this.order.payType,appId: getApp().globalData.appId};
|
|
|
|
|
+ }
|
|
|
let that=this;
|
|
let that=this;
|
|
|
uni.showLoading();
|
|
uni.showLoading();
|
|
|
pay(data).then(
|
|
pay(data).then(
|
|
@@ -415,31 +522,58 @@
|
|
|
const that = this
|
|
const that = this
|
|
|
console.log(res.result);
|
|
console.log(res.result);
|
|
|
if(res.payType==1||res.payType==2){
|
|
if(res.payType==1||res.payType==2){
|
|
|
- uni.requestPayment({
|
|
|
|
|
- provider: 'wxpay',
|
|
|
|
|
- timeStamp: res.result.timeStamp,
|
|
|
|
|
- nonceStr: res.result.nonceStr,
|
|
|
|
|
- // package: res.result.packageValue,
|
|
|
|
|
- package: res.result.packageStr,
|
|
|
|
|
- signType: res.result.signType,
|
|
|
|
|
- paySign: res.result.paySign,
|
|
|
|
|
- success: function(res) {
|
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
- uni.redirectTo({
|
|
|
|
|
- url:"/pages_shopping/success?order="+JSON.stringify(that.order)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- fail: function(err) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon:'none',
|
|
|
|
|
- title:'fail:' + JSON.stringify(err),
|
|
|
|
|
- });
|
|
|
|
|
- console.log('fail:' + JSON.stringify(err));
|
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if(res.type&&res.type=='yb') {
|
|
|
|
|
+ let prePayTn = JSON.parse(res.data.prePayTn)
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ provider: 'wxpay',
|
|
|
|
|
+ timeStamp: prePayTn.timeStamp,
|
|
|
|
|
+ nonceStr: prePayTn.nonceStr,
|
|
|
|
|
+ package: prePayTn.package,
|
|
|
|
|
+ signType: prePayTn.signType,
|
|
|
|
|
+ paySign: prePayTn.paySign,
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ uni.redirectTo({
|
|
|
|
|
+ url:"/pages_shopping/success?order="+JSON.stringify(that.order)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function(err) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title:'fail:' + JSON.stringify(err),
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('fail:' + JSON.stringify(err));
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ provider: 'wxpay',
|
|
|
|
|
+ timeStamp: res.result.timeStamp,
|
|
|
|
|
+ nonceStr: res.result.nonceStr,
|
|
|
|
|
+ // package: res.result.packageValue,
|
|
|
|
|
+ package: res.result.packageStr,
|
|
|
|
|
+ signType: res.result.signType,
|
|
|
|
|
+ paySign: res.result.paySign,
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ uni.redirectTo({
|
|
|
|
|
+ url:"/pages_shopping/success?order="+JSON.stringify(that.order)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function(err) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title:'fail:' + JSON.stringify(err),
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('fail:' + JSON.stringify(err));
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if(res.payType==3){
|
|
else if(res.payType==3){
|
|
|
|
|
+ // 货到付款
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
// 能支付的订单表示已经开过处方了
|
|
// 能支付的订单表示已经开过处方了
|
|
|
// if(that.order.isPrescribe){
|
|
// if(that.order.isPrescribe){
|
|
@@ -458,6 +592,20 @@
|
|
|
})
|
|
})
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ isValidAmount(amount) {
|
|
|
|
|
+ // 1. 必须是数字或数字字符串
|
|
|
|
|
+ const num = parseFloat(amount);
|
|
|
|
|
+ if (isNaN(num)) return false;
|
|
|
|
|
+
|
|
|
|
|
+ // // 2. 必须大于0
|
|
|
|
|
+ if (num <= 0) return false;
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 最多两位小数(可选)
|
|
|
|
|
+ const str = String(amount).trim();
|
|
|
|
|
+ if (!/^\d+(\.\d{1,2})?$/.test(str)) return false;
|
|
|
|
|
+
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|