|
@@ -24,32 +24,49 @@
|
|
|
<div class="btn" @click="close">关闭</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 未支付 -->
|
|
|
- <div v-if="type === 2">
|
|
|
- <div class="icon">
|
|
|
-
|
|
|
+ <!-- 未支付 / 支付失败-->
|
|
|
+ <div v-if="type === 2 || type == 4">
|
|
|
+ <div class="icon" v-if="type == 2">
|
|
|
<i class="el-icon-warning warning"></i>
|
|
|
</div>
|
|
|
- <div class="message">请支付后取衣</div>
|
|
|
- <div class="cell">
|
|
|
+ <div class="icon" v-if="type == 4">
|
|
|
+ <i class="el-icon-error error"></i>
|
|
|
+ </div>
|
|
|
+ <div class="message" v-if="type == 2">请支付后取衣</div>
|
|
|
+ <div class="message" v-if="type == 4">{{ errorMessage }}</div>
|
|
|
+ <div class="cell" v-if="type == 2">
|
|
|
<div class="label">需支付金额</div>
|
|
|
<div class="amount_box">
|
|
|
<span>¥</span>
|
|
|
<span>{{ orderInfo.payAmount }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="cell">
|
|
|
+ <div class="cell" style="position: relative;" v-if="type == 2 || !hideUser">
|
|
|
<div class="label">支付方式</div>
|
|
|
<el-radio-group v-model="payType" @input="changePayType">
|
|
|
<el-radio-button :label="3">余额</el-radio-button>
|
|
|
<el-radio-button :label="2">现金</el-radio-button>
|
|
|
<el-radio-button :label="0">微信/支付宝</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
+ <span style="position: absolute;bottom: 0; margin-left: 100px; font-size: 12px; color: #f56c6c;" v-if="payType == 3 && appUserInfo.balance < orderInfo.payAmount">
|
|
|
+ 余额不足,需要额外支付¥{{ handelAmount(orderInfo.payAmount - appUserInfo.balance) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="cell" style="margin-top: 20px;" v-if="payType == 3 && appUserInfo.balance < orderInfo.payAmount">
|
|
|
+ <div class="label">额外支付方式</div>
|
|
|
+ <el-radio-group v-model="otherPayType" @input="changeOtherPayType">
|
|
|
+ <el-radio :label="2">现金</el-radio>
|
|
|
+ <el-radio :label="0">微信/支付宝</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div class="cell" v-if="otherPayType === 0">
|
|
|
+ <div class="label">付款码</div>
|
|
|
+ <el-input ref="autoOtherFocus" v-model="authCode" clearable placeholder="请选择付款码" />
|
|
|
</div>
|
|
|
<el-descriptions border direction="vertical" :column="3" :labelStyle="{ width: '140px' }" v-if="payType == '3'" style="margin: 0 30px">
|
|
|
<el-descriptions-item label="用户" v-if="appUserInfo">{{ appUserInfo.realName }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="当前余额(元)" v-if="appUserInfo">{{ handelAmount(appUserInfo.rechargeBalance + appUserInfo.giveBalance) }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="支付后余额(元)" v-if="appUserInfo">{{ handelAmount(appUserInfo.rechargeBalance + appUserInfo.giveBalance - orderInfo.payAmount) }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="当前余额(元)" v-if="appUserInfo">{{ handelAmount(appUserInfo.balance) }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付后余额(元)" v-if="appUserInfo">{{ handelAmount(appUserInfo.balance - orderInfo.payAmount) }}</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
<div class="cell" v-if="payType == 0">
|
|
|
<div class="label">付款码</div>
|
|
@@ -57,8 +74,8 @@
|
|
|
<el-input ref="autoFocus" v-model="authCode" clearable placeholder="请选择付款码" />
|
|
|
</div>
|
|
|
<div class="btn_box">
|
|
|
- <div class="btn" style="color: #67c23a" @click="pay">确认支付</div>
|
|
|
- <div class="line"></div>
|
|
|
+ <div class="btn" style="color: #67c23a" @click="pay" v-if="type == 2 || !hideUser">确认支付</div>
|
|
|
+ <div class="line" v-if="type == 2 || !hideUser"></div>
|
|
|
<div class="btn" @click="close">关闭</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -72,11 +89,9 @@
|
|
|
<el-button type="primary" style="width: 70%; height: 40px; margin: 20px 15%" @click="close" v-if="showPaySuccessBtn">已确认支付</el-button>
|
|
|
</div>
|
|
|
<!-- 支付失败 -->
|
|
|
- <div v-if="type == 4">
|
|
|
- <div class="icon">
|
|
|
- <i class="el-icon-error error"></i>
|
|
|
- </div>
|
|
|
- <div class="message">{{ errorMessage }}</div>
|
|
|
+ <!-- <div v-if="type == 4">
|
|
|
+
|
|
|
+
|
|
|
<div class="cell" v-if="!hideUser">
|
|
|
<div class="label">支付方式</div>
|
|
|
<el-radio-group v-model="payType" @input="changePayType">
|
|
@@ -87,12 +102,11 @@
|
|
|
</div>
|
|
|
<el-descriptions border direction="vertical" :column="3" :labelStyle="{ width: '140px' }" v-if="payType == '3' && !hideUser" style="margin: 0 30px">
|
|
|
<el-descriptions-item label="用户" v-if="appUserInfo">{{ appUserInfo.realName }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="当前余额(元)" v-if="appUserInfo">{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="支付后余额(元)" v-if="appUserInfo">{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance - orderInfo.payAmount }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="当前余额(元)" v-if="appUserInfo">{{ appUserInfo.balance }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付后余额(元)" v-if="appUserInfo">{{ appUserInfo.balance - orderInfo.payAmount }}</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
<div class="cell" v-if="payType == 0 && !hideUser">
|
|
|
<div class="label">付款码</div>
|
|
|
- <!-- @change="handleQuery" -->
|
|
|
<el-input ref="autoFocus" v-model="authCode" clearable placeholder="请选择付款码" />
|
|
|
</div>
|
|
|
<div class="btn_box">
|
|
@@ -100,7 +114,7 @@
|
|
|
<div class="line" v-if="!hideUser"></div>
|
|
|
<div class="btn" @click="close">关闭</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<!-- 支付成功打印小票 -->
|
|
|
<div v-if="type === 6">
|
|
|
<div class="icon">
|
|
@@ -162,7 +176,8 @@ export default {
|
|
|
time: '',
|
|
|
showPaySuccessBtn: false,
|
|
|
resultCount: 0,
|
|
|
- errorMessage: ''
|
|
|
+ errorMessage: '',
|
|
|
+ otherPayType: 2
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -184,6 +199,7 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
handelAmount(e) {
|
|
|
+ if (e < 0) return 0
|
|
|
return e.toFixed(2)
|
|
|
},
|
|
|
openSelected(info) {
|
|
@@ -209,8 +225,9 @@ export default {
|
|
|
}
|
|
|
console.log(this.type, appUserInfo)
|
|
|
if (appUserInfo) {
|
|
|
- this.appUserInfo = appUserInfo
|
|
|
- }
|
|
|
+ appUserInfo.balance = appUserInfo.rechargeBalance + appUserInfo.giveBalance + appUserInfo.welfareBalance
|
|
|
+ this.appUserInfo = appUserInfo
|
|
|
+ }
|
|
|
if (type == 0) {
|
|
|
//微信支付宝支付
|
|
|
this.payType = 0
|
|
@@ -242,6 +259,7 @@ export default {
|
|
|
this.payType = 3
|
|
|
this.showPaySuccessBtn = false
|
|
|
if (appUserInfo) {
|
|
|
+ appUserInfo.balance = appUserInfo.rechargeBalance + appUserInfo.giveBalance + appUserInfo.welfareBalance
|
|
|
this.appUserInfo = appUserInfo
|
|
|
}
|
|
|
console.log('aasss', this.appUserInfo)
|
|
@@ -377,6 +395,7 @@ export default {
|
|
|
getMemberInfoById({
|
|
|
appUserId: id
|
|
|
}).then((response) => {
|
|
|
+ response.data.balance = response.data.rechargeBalance + response.data.giveBalance + response.data.welfareBalance
|
|
|
this.appUserInfo = response.data
|
|
|
})
|
|
|
},
|
|
@@ -389,34 +408,49 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ changeOtherPayType() {
|
|
|
+ if (this.otherPayType == 0) {
|
|
|
+ this.$nextTick((_) => {
|
|
|
+ this.$refs.autoOtherFocus.focus()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
handleQuery(e, event) {
|
|
|
console.log(event)
|
|
|
console.log(this.authCode)
|
|
|
},
|
|
|
|
|
|
pay() {
|
|
|
- if (this.payType == 0 && !this.authCode) {
|
|
|
+ if ((this.payType == 0 || this.otherPayType == 0) && !this.authCode) {
|
|
|
this.type = 4
|
|
|
this.errorMessage = '请先扫码'
|
|
|
this.authCode = ''
|
|
|
this.changePayType()
|
|
|
return
|
|
|
}
|
|
|
- if (this.payType == 3 && this.appUserInfo.rechargeBalance + this.appUserInfo.giveBalance < this.orderInfo.payAmount) {
|
|
|
- this.errorMessage = '余额不足'
|
|
|
- this.type = 4
|
|
|
- this.authCode = ''
|
|
|
- this.changePayType()
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.payType == 3 && this.appUserInfo.balance < this.orderInfo.payAmount) {
|
|
|
+ // this.errorMessage = '余额不足'
|
|
|
+ // this.type = 4
|
|
|
+ // this.authCode = ''
|
|
|
+ // this.changePayType()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
this.type = 3
|
|
|
- clothOrderPay({
|
|
|
+ //
|
|
|
+ let params = {
|
|
|
appUserId: this.orderInfo.appUserId,
|
|
|
payType: this.payType,
|
|
|
authCode: this.authCode,
|
|
|
orderNo: this.orderInfo.orderNo,
|
|
|
payAmount: this.orderInfo.payAmount
|
|
|
- })
|
|
|
+ }
|
|
|
+ if (this.payType == 3 && this.appUserInfo.balance < this.orderInfo.payAmount) {
|
|
|
+ params.memberPayAmount = this.appUserInfo.balance
|
|
|
+ params.payType = 8
|
|
|
+ params.otherPayType = this.otherPayType
|
|
|
+ }
|
|
|
+ clothOrderPay(params)
|
|
|
.then((res) => {
|
|
|
console.log('支付结果', res)
|
|
|
if (res) {
|