feat(pay): 分享下单注册支付
This commit is contained in:
parent
76a91884c9
commit
f0bc328d52
7
App.vue
7
App.vue
|
@ -9,13 +9,14 @@ export default {
|
|||
}
|
||||
const whiteList = [
|
||||
'pages/shareRegist/index',
|
||||
// 'pages/shareRegist/success',
|
||||
'pages/shareRegist/success',
|
||||
'pages/login/index',
|
||||
'pages/pay/success',
|
||||
// 'pages/wechatPay/bfPay/',
|
||||
// 'pages/wechatPay/hfPay/',
|
||||
'pages/shareArea/hiList',
|
||||
// 'pages/shareArea/hiOrder',
|
||||
// 'pages/pay/hiPay'
|
||||
'pages/shareArea/hiOrder',
|
||||
'pages/pay/hiPay',
|
||||
]
|
||||
if (whiteList.indexOf(options.path) !== -1) return
|
||||
this.$store.dispatch('GetInfo')
|
||||
|
|
|
@ -19,7 +19,7 @@ module.exports = vm => {
|
|||
|
||||
//#ifdef DEV_SERVER
|
||||
console.log('DEV_SERVER')
|
||||
config.baseURL = 'http://localhost:8080'
|
||||
config.baseURL = 'http://t-app.beida666.com/prod-api'
|
||||
//#endif
|
||||
|
||||
//#ifdef QA_SERVER
|
||||
|
|
|
@ -329,6 +329,7 @@ import {
|
|||
PAY_AUTH,
|
||||
} from '@/util/constant.js'
|
||||
var payStatus
|
||||
let getRegisterInfoTimeoutFlag = null
|
||||
export default {
|
||||
components: {
|
||||
successDialog,
|
||||
|
@ -390,6 +391,10 @@ export default {
|
|||
// 获取银行卡
|
||||
// this.getBankList()
|
||||
},
|
||||
onUnload() {
|
||||
clearTimeout(getRegisterInfoTimeoutFlag)
|
||||
clearInterval(payStatus)
|
||||
},
|
||||
methods: {
|
||||
closewxPopup() {
|
||||
this.wxPopup = false
|
||||
|
@ -421,10 +426,16 @@ export default {
|
|||
},
|
||||
fansOrder() {
|
||||
api.fansOrder(this.orderCode).then(res => {
|
||||
this.isLoading = false
|
||||
this.isPw = false
|
||||
removeToken()
|
||||
this.$refs.successDialog.showSuccess(res.data)
|
||||
if (res.data) {
|
||||
this.isLoading = false
|
||||
this.isPw = false
|
||||
removeToken()
|
||||
this.$refs.successDialog.showSuccess(res.data)
|
||||
} else {
|
||||
getRegisterInfoTimeoutFlag = setTimeout(() => {
|
||||
this.fansOrder()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
},
|
||||
payPw() {
|
||||
|
@ -701,7 +712,12 @@ export default {
|
|||
clearInterval(payStatus)
|
||||
this.wxPopup = false
|
||||
// this.showSucce = true
|
||||
this.fansOrder()
|
||||
uni.showLoading({
|
||||
title: '正在获取注册信息,请不要关闭当前页面',
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.fansOrder()
|
||||
}, 2000)
|
||||
} else {
|
||||
api.payStatus(data).then(res => {
|
||||
that.sucPay = res.data
|
||||
|
|
|
@ -44,13 +44,18 @@
|
|||
<view class="action-section">
|
||||
<view class="button-group">
|
||||
<button
|
||||
v-if="!isRecharge"
|
||||
v-if="!isRecharge && !isSharePay"
|
||||
class="btn btn-secondary"
|
||||
@click="goToOrderList"
|
||||
>
|
||||
查看订单
|
||||
</button>
|
||||
<button class="btn btn-primary" @click="goToHome">返回首页</button>
|
||||
<button v-if="!isSharePay" class="btn btn-primary" @click="goToHome">
|
||||
返回首页
|
||||
</button>
|
||||
<button v-else class="btn btn-primary" @click="goToLogin">
|
||||
去登录
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -60,7 +65,7 @@
|
|||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { payStatus, registerInfo } from '@/config/pay.js'
|
||||
import { payStatus, registerInfo, fansOrder } from '@/config/pay.js'
|
||||
import successDialog from '@/components/successDialog.vue'
|
||||
|
||||
let paySetTimeoutFlag = null
|
||||
|
@ -94,9 +99,19 @@ export default {
|
|||
// 获取传递的参数
|
||||
const extParam = JSON.parse(atob(options.extParam || '{}'))
|
||||
console.log(extParam, '..extParam')
|
||||
this.isSharePay = extParam.isSharePay
|
||||
this.specialArea = extParam.specialArea
|
||||
this.isRecharge = extParam.isRecharge
|
||||
this.orderCode = extParam.orderCode || ''
|
||||
if (this.isSharePay) {
|
||||
uni.showLoading({
|
||||
title: '正在获取注册信息,请不要关闭当前页面',
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.getShareRegistInfo()
|
||||
}, 500)
|
||||
return
|
||||
}
|
||||
if (this.orderCode) {
|
||||
setTimeout(() => {
|
||||
this.pollingPayStatus(this.orderCode)
|
||||
|
@ -154,7 +169,7 @@ export default {
|
|||
},
|
||||
successClose() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/mine/order/index',
|
||||
url: this.isSharePay ? '/pages/login/index' : '/pages/mine/order/index',
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -164,6 +179,24 @@ export default {
|
|||
url: '/pages/index/index',
|
||||
})
|
||||
},
|
||||
goToLogin() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/index',
|
||||
})
|
||||
},
|
||||
getShareRegistInfo() {
|
||||
fansOrder(this.orderCode).then(res => {
|
||||
if (res.data) {
|
||||
removeToken()
|
||||
uni.hideLoading()
|
||||
this.$refs.successDialog.showSuccess(res.data)
|
||||
} else {
|
||||
getRegisterInfoTimeoutFlag = setTimeout(() => {
|
||||
this.getShareRegistInfo()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
<text class="hero-main">新人专享特惠</text>
|
||||
<text class="hero-sub">精选好物·品质优选</text>
|
||||
</view>
|
||||
<view class="promotion-banner">
|
||||
<!-- <view class="promotion-banner">
|
||||
<text class="promo-text">限时优惠·新人福利</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -89,7 +89,7 @@ export default {
|
|||
},
|
||||
getCode() {
|
||||
api.fansConvertCode(this.pkParent).then(res => {
|
||||
this.placeParent = res.msg
|
||||
this.placeParent = res.data
|
||||
uni.setStorageSync('placeParent', this.placeParent)
|
||||
})
|
||||
},
|
||||
|
@ -103,6 +103,10 @@ export default {
|
|||
})
|
||||
},
|
||||
goBuy(item) {
|
||||
const params = {
|
||||
...item,
|
||||
pkParent: this.pkParent,
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/shareArea/hiOrder?allData=' + JSON.stringify(item),
|
||||
})
|
||||
|
@ -298,17 +302,16 @@ export default {
|
|||
align-items: baseline;
|
||||
|
||||
.currency {
|
||||
color: #005bac;
|
||||
color: #ff6b35;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #005bac;
|
||||
color: #ff6b35;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
animation: priceHighlight 2s ease-in-out infinite 1s;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,17 +431,6 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
@keyframes priceHighlight {
|
||||
0%,
|
||||
100% {
|
||||
color: #005bac;
|
||||
}
|
||||
50% {
|
||||
color: #0066cc;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes promoBreathe {
|
||||
0%,
|
||||
100% {
|
||||
|
|
Loading…
Reference in New Issue