|
|
@@ -17,7 +17,7 @@
|
|
|
</div>
|
|
|
<div class="pay-input-wrap">
|
|
|
<pay-input-module :focus="inpFocus" :num="amount" @focusFn="focusFn" @blurFn="blurFn" @clickKey="clickKeyFn" />
|
|
|
- <div class="balance" v-if="!$util.isEmpty(shopUser)">
|
|
|
+ <div class="balance" v-if="!$util.isEmpty(shopUser) && shopUser.userAsset.balance != '0.00'">
|
|
|
<span>账户余额 ¥</span>
|
|
|
<span class="app-size-30">{{ shopUser.userAsset.balance }}</span>
|
|
|
</div>
|
|
|
@@ -41,7 +41,7 @@
|
|
|
</div>
|
|
|
<div class="module-com pay-input-wrap">
|
|
|
<pay-input-module :focus="inpFocus" :num="amount" @focusFn="focusFn" @blurFn="blurFn" @clickKey="clickKeyFn" />
|
|
|
- <div class="balance" v-if="!$util.isEmpty(shopUser)">
|
|
|
+ <div class="balance" v-if="!$util.isEmpty(shopUser) && shopUser.userAsset.balance != '0.00'">
|
|
|
<span>账户余额 ¥</span>
|
|
|
<span class="app-size-30">{{ shopUser.userAsset.balance }}</span>
|
|
|
</div>
|
|
|
@@ -63,8 +63,8 @@
|
|
|
<!-- 按钮 -->
|
|
|
<div class="btn-wrap">
|
|
|
<button v-if="!$util.isEmpty(shopUser) && shopUser.userAsset.balance && shopUser.userAsset.balance != '0.00'" class="button-com red" @click="balancePayFn">余额支付</button>
|
|
|
- <button class="button-com green" v-if="isWxBrowser()" @click="wexinPayFn">微信支付</button>
|
|
|
- <button class="button-com red" v-else @click="aliPayFn">支付宝支付</button>
|
|
|
+ <button class="button-com green" v-if="isWxBrowser()" @click="wexinPayFn">微信支付</button>
|
|
|
+ <button class="button-com red" v-else @click="aliPayFn">支付宝支付</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</block>
|
|
|
@@ -82,6 +82,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</modal-module>
|
|
|
+ <!-- 阿里支付 -->
|
|
|
+ <div class="al-pay" v-html="aliPayHtml" ref="alipayWap"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -130,6 +132,7 @@ export default {
|
|
|
payWay: 0 // 0微信 1支付宝 2余额
|
|
|
},
|
|
|
// 支付相关 ============
|
|
|
+ aliPayHtml: '',
|
|
|
passwordModal: false,
|
|
|
modalForm: {
|
|
|
payPassword: ''
|
|
|
@@ -157,6 +160,9 @@ export default {
|
|
|
// }
|
|
|
this.specialInit()
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.inpFocus = true
|
|
|
+ },
|
|
|
methods: {
|
|
|
isWxBrowser: isWxBrowser,
|
|
|
specialInit() {
|
|
|
@@ -183,18 +189,34 @@ export default {
|
|
|
host = recharge
|
|
|
} else {
|
|
|
params = {
|
|
|
- needSend: this.tabIndex == 0 ? '1' : '0',
|
|
|
- prePrice: this.amount
|
|
|
+ needSend: this.tabIndex == 0 ? '0' : '1',
|
|
|
+ prePrice: this.amount,
|
|
|
+ payWay: this.form.payWay
|
|
|
// sourceType: 1,
|
|
|
// shopId: 15680
|
|
|
}
|
|
|
+ if (this.tabIndex == 1) {
|
|
|
+ let deliveryForm = this.$refs.appDelivery.form ? this.$refs.appDelivery.form : {}
|
|
|
+ let deliveryRegion = this.$refs.appDelivery.region ? this.$refs.appDelivery.region : {}
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ ...deliveryForm,
|
|
|
+ ...deliveryRegion
|
|
|
+ }
|
|
|
+ }
|
|
|
host = fastPay
|
|
|
}
|
|
|
host(params).then(res => {
|
|
|
if (this.form.payWay == 0) {
|
|
|
wexinPay(res.data, this.paySuccess, this.payFail)
|
|
|
- } else {
|
|
|
- location.href = res.data
|
|
|
+ } else if (this.form.payWay == 1) {
|
|
|
+ console.log('res', res)
|
|
|
+ return false
|
|
|
+ this.aliPayHtml = res
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.alipayWap.children[0].submit()
|
|
|
+ })
|
|
|
+ // location.href = res.data
|
|
|
}
|
|
|
// window.location.href = res.data.pay_button.mweb_url
|
|
|
})
|
|
|
@@ -202,6 +224,7 @@ export default {
|
|
|
// tab切换
|
|
|
tabChange(e) {
|
|
|
this.tabIndex = e.index
|
|
|
+ this.inpFocus = true
|
|
|
},
|
|
|
// 点击输入框
|
|
|
focusFn() {
|
|
|
@@ -340,8 +363,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.shop-logo-wrap {
|
|
|
- padding: 0 0 20px 30px;
|
|
|
- @include disFlex(center, flex-start);
|
|
|
+ padding-bottom: 20px;
|
|
|
+ @include disFlex(center, center);
|
|
|
.logo-img {
|
|
|
width: 80px;
|
|
|
border-radius: 50%;
|