|
@@ -2,16 +2,16 @@
|
|
|
<div class="share-pay container">
|
|
|
<div class="section supplier">
|
|
|
<div class="info">
|
|
|
- <span class="name">上海维沙美容美发经营管理有限公司</span>
|
|
|
- <span class="mobile">15889588265</span>
|
|
|
+ <span class="name">{{ authUser.name }}</span>
|
|
|
+ <span class="mobile">{{ authUser.mobile }}</span>
|
|
|
</div>
|
|
|
<div class="current-down">
|
|
|
<span class="tip">倒计时</span>
|
|
|
- <span class="bg">72</span>
|
|
|
+ <span class="bg">{{ countDownTime.hh * 1 + countDownTime.dd * 24 * 1 }}</span>
|
|
|
<span class="exp">:</span>
|
|
|
- <span class="bg">26</span>
|
|
|
+ <span class="bg">{{ countDownTime.mm }}</span>
|
|
|
<span class="exp">:</span>
|
|
|
- <span class="bg">30</span>
|
|
|
+ <span class="bg">{{ countDownTime.ss }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="section package">
|
|
@@ -19,11 +19,11 @@
|
|
|
<span class="vip-icon" />
|
|
|
<span>购买认证通会员</span>
|
|
|
<span>套餐</span>
|
|
|
- <span>1年</span>
|
|
|
+ <span>{{ formatMonth }}</span>
|
|
|
</div>
|
|
|
<div class="total">
|
|
|
<span>支付总额:</span>
|
|
|
- <span class="price">¥5980.00</span>
|
|
|
+ <span class="price">¥{{ orderPayLink.unpaidAmount | formatPrice }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="section bank">
|
|
@@ -33,14 +33,16 @@
|
|
|
<pay-bank
|
|
|
:data="orderInfo"
|
|
|
:show-price="false"
|
|
|
- :coty-status="false"
|
|
|
+ :copy-status="false"
|
|
|
:pay-way="3"
|
|
|
- @pay-confirm="handlePayConfirm"
|
|
|
+ :confirm="confirmVisiable"
|
|
|
+ @change="handleBankChange"
|
|
|
+ @pay-confirm="handleConfirmPay"
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="submit">
|
|
|
<div class="container">
|
|
|
- <el-button type="danger">立即支付</el-button>
|
|
|
+ <el-button type="danger" @click="onSubmit">立即支付</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -48,17 +50,103 @@
|
|
|
|
|
|
<script>
|
|
|
import PayBank from '@/views/components/payment/pay-bank.vue'
|
|
|
+import { checkedOtherPaySuccess, fetchPayInfoWithLinkLogo } from '@/api/pay'
|
|
|
+import { countDown } from '@/utils'
|
|
|
export default {
|
|
|
components: {
|
|
|
PayBank
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- orderInfo: {}
|
|
|
+ confirmVisiable: false,
|
|
|
+ linkLogo: '',
|
|
|
+ orderPayLink: {},
|
|
|
+ authUser: {},
|
|
|
+ submitInfo: {},
|
|
|
+ timer: null,
|
|
|
+ countDownTime: {}
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ orderInfo() {
|
|
|
+ return {
|
|
|
+ pageType: 4,
|
|
|
+ payAmount: this.orderPayLink.unpaidAmount,
|
|
|
+ vipId: '',
|
|
|
+ vipRecordId: this.orderPayLink.authVipRecordId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formatMonth() {
|
|
|
+ const vipMonth = this.orderPayLink.vipMonth
|
|
|
+ return vipMonth % 12 ? `${vipMonth}月` : `${vipMonth / 12}年`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init()
|
|
|
+ console.log(this.linkLogo)
|
|
|
+ },
|
|
|
methods: {
|
|
|
- handlePayConfirm() {}
|
|
|
+ // 初始化
|
|
|
+ init() {
|
|
|
+ this.linkLogo = this.$route.params.linkLogo
|
|
|
+ this.fetchPayInfoWithLinkLogo()
|
|
|
+ },
|
|
|
+ // 确认支付
|
|
|
+ handleBankChange(e) {
|
|
|
+ console.log(e)
|
|
|
+ console.log(e)
|
|
|
+ this.submitInfo = e
|
|
|
+ },
|
|
|
+ // 获取订单信息
|
|
|
+ fetchPayInfoWithLinkLogo() {
|
|
|
+ fetchPayInfoWithLinkLogo({ linkLogo: this.linkLogo }).then(res => {
|
|
|
+ const result = JSON.parse(res.data)
|
|
|
+ this.orderPayLink = result.orderPayLink
|
|
|
+ this.authUser = result.authUser
|
|
|
+ console.log(result)
|
|
|
+ this.countDown()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 确认支付事件
|
|
|
+ handleConfirmPay(e) {
|
|
|
+ this.redirectUrlQuery = {
|
|
|
+ payAmount: e.data.payAmount
|
|
|
+ }
|
|
|
+ checkedOtherPaySuccess({ mbOrderId: e.data.mbOrderId }).then(res => {
|
|
|
+ res = JSON.parse(res.data)
|
|
|
+ if (res.data.status === '1') {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/share/pay-success',
|
|
|
+ query: this.redirectUrlQuery
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/share/pay-faild',
|
|
|
+ query: this.redirectUrlQuery
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 跳转支付
|
|
|
+ onSubmit() {
|
|
|
+ if (this.submitInfo.data && this.submitInfo.data.payUrl) {
|
|
|
+ this.confirmVisiable = true
|
|
|
+ window.open(this.submitInfo.data.payUrl, '_blank')
|
|
|
+ } else {
|
|
|
+ this.$message.warning('请选择银行')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 倒计时
|
|
|
+ countDown() {
|
|
|
+ const diffTime = new Date(this.orderPayLink.effectiveTime).getTime()
|
|
|
+ const loadTime = new Date().getTime()
|
|
|
+ this.timer && clearTimeout(this.timer)
|
|
|
+ countDown(diffTime, loadTime, {}, item => {
|
|
|
+ this.countDownTime = item.conttainer
|
|
|
+ this.timer = item.t
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|