|
|
@@ -1,11 +1,38 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <input class="uni-input" name="withdradesc" type="number" v-model="amount" placeholder="请输入金额" />
|
|
|
- <button @click="save">提交</button>
|
|
|
+ <div class="app-content">
|
|
|
+ <!-- <div class="tabs-wrap"> -->
|
|
|
+ <app-tabs :tabs="tabs" :currentTab="tabIndex" :isFixed="true" :borderLeft="true" @change="tabChange" itemWidth="50%" />
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- 直接付款 -->
|
|
|
+ <template v-if="true">
|
|
|
+ <div class="logo-wrap">
|
|
|
+ <div class="logo-img">
|
|
|
+ <img src="../../static/images/user/attr-default.png" alt mode="widthFix" />
|
|
|
+ </div>
|
|
|
+ <div class="app-size-30">国兰花尚</div>
|
|
|
+ </div>
|
|
|
+ <div class="pay-input-wrap">
|
|
|
+ <pay-input-module :focus="inpFocus" :num="amount" @focusFn="focusFn" @blurFn="blurFn" @clickKey="clickKeyFn" />
|
|
|
+ <div class="balance">
|
|
|
+ <span>账户余额 ¥</span>
|
|
|
+ <span class="app-size-30">2872.09</span>
|
|
|
+ </div>
|
|
|
+ <!-- 按钮 -->
|
|
|
+ <div class="btn-wrap">
|
|
|
+ <div class="button-com success">余额支付</div>
|
|
|
+ <div class="button-com success">微信支付</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!-- 我要配送 -->
|
|
|
+ <template v-else></template>
|
|
|
+ <!-- <button @click="_pay">提交</button> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import appTabs from '@/components/plugin/tabs'
|
|
|
+import payInputModule from './components/pay-input'
|
|
|
import { getMiniAppUrl } from '@/utils/common'
|
|
|
import { getCheckLogin } from '@/utils/auth'
|
|
|
import wexinPay from '@/utils/pay/wxPay'
|
|
|
@@ -13,11 +40,26 @@ import { pay } from '@/api/pay'
|
|
|
import { oauth } from '@/api/login'
|
|
|
export default {
|
|
|
name: 'pay',
|
|
|
+ components: {
|
|
|
+ appTabs,
|
|
|
+ payInputModule
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
constant: this.$constant,
|
|
|
option: '',
|
|
|
- amount: 10
|
|
|
+ amount: '',
|
|
|
+ inpFocus: false,
|
|
|
+ // tab
|
|
|
+ tabIndex: 0,
|
|
|
+ tabs: [
|
|
|
+ {
|
|
|
+ name: '直接付款'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '我要配送'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
@@ -25,7 +67,7 @@ export default {
|
|
|
account: 12358,
|
|
|
shopId: 15680
|
|
|
}
|
|
|
- this.init()
|
|
|
+ // this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
@@ -39,7 +81,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- save() {
|
|
|
+ _pay() {
|
|
|
let params = {
|
|
|
prePrice: this.amount,
|
|
|
sourceType: 1,
|
|
|
@@ -52,6 +94,22 @@ export default {
|
|
|
// window.location.href = res.data.pay_button.mweb_url
|
|
|
})
|
|
|
},
|
|
|
+ // tab切换
|
|
|
+ tabChange(e) {
|
|
|
+ this.tabIndex = e.index
|
|
|
+ },
|
|
|
+ // 点击输入框
|
|
|
+ focusFn() {
|
|
|
+ this.inpFocus = true
|
|
|
+ },
|
|
|
+ // 失焦
|
|
|
+ blurFn() {
|
|
|
+ this.inpFocus = false
|
|
|
+ },
|
|
|
+ // 点击键盘
|
|
|
+ clickKeyFn(val) {
|
|
|
+ this.amount = val
|
|
|
+ },
|
|
|
// 支付成功
|
|
|
paySuccess() {
|
|
|
alert('支付成功!')
|
|
|
@@ -64,9 +122,33 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- .uni-input {
|
|
|
- border: 1px solid #666;
|
|
|
- margin-bottom: 20px;
|
|
|
- padding-left: 10px;
|
|
|
+ .logo-wrap {
|
|
|
+ padding-top: 170px;
|
|
|
+ padding-bottom: 60px;
|
|
|
+ text-align: center;
|
|
|
+ .logo-img {
|
|
|
+ width: 120px;
|
|
|
+ margin: 0 auto 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .pay-input-wrap {
|
|
|
+ background-color: #fff;
|
|
|
+ border-top-left-radius: 20px;
|
|
|
+ border-top-right-radius: 20px;
|
|
|
+ padding: 50px 80px 28px;
|
|
|
+ .balance {
|
|
|
+ margin-top: 30px;
|
|
|
+ color: $fontColor2;
|
|
|
+ }
|
|
|
+ .btn-wrap {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 64px;
|
|
|
+ .button-com {
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ padding-top: 30px;
|
|
|
+ padding-bottom: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|