|
@@ -1,58 +1,58 @@
|
|
|
<template>
|
|
|
- <view class="">
|
|
|
- <!-- #ifdef MP-ALIPAY -->
|
|
|
- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="支付中" leftIconSize="0"></u-navbar>
|
|
|
- <!-- #endif -->
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="支付中"></u-navbar>
|
|
|
- <!-- #endif -->
|
|
|
- <!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
|
|
- <view v-if="pagesNum > 1">
|
|
|
- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="支付中" />
|
|
|
- </view>
|
|
|
- <view v-else>
|
|
|
- <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :border="true" title="支付中">
|
|
|
- <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
- <u-icon name="arrow-left" size="20" color="#333"></u-icon>
|
|
|
- </view>
|
|
|
- </u-navbar>
|
|
|
- </view>
|
|
|
+ <view class="">
|
|
|
+ <!-- #ifdef MP-ALIPAY -->
|
|
|
+ <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="支付中" leftIconSize="0"></u-navbar>
|
|
|
<!-- #endif -->
|
|
|
- <!-- <web-view :src='info'></web-view> -->
|
|
|
- <view class="btn" v-if="paystatus == 0">
|
|
|
- <u-button class="btn1" @click="openPay(1)" text="前往第三方支付" shape="circle"></u-button>
|
|
|
- </view>
|
|
|
- <view class="btn" v-else>
|
|
|
- <u-button class="btn1" @click="toPurchase" text="我已支付,去开奖" shape="circle"></u-button>
|
|
|
- <u-button class="btn2" @click="openPay(2)" text="还未支付,前往第三方支付" shape="circle"></u-button>
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="支付中"></u-navbar>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
|
|
+ <view v-if="pagesNum > 1">
|
|
|
+ <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="支付中" />
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :border="true" title="支付中">
|
|
|
+ <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
+ <u-icon name="arrow-left" size="20" color="#333"></u-icon>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
+ </view>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- <web-view :src='info'></web-view> -->
|
|
|
+ <view class="btn" v-if="paystatus == 0">
|
|
|
+ <u-button class="btn1" @click="openPay(1)" text="前往第三方支付" shape="circle"></u-button>
|
|
|
+ </view>
|
|
|
+ <view class="btn" v-else>
|
|
|
+ <u-button class="btn1" @click="toPurchase" text="我已支付,去开奖" shape="circle"></u-button>
|
|
|
+ <u-button class="btn2" @click="openPay(2)" text="还未支付,前往第三方支付" shape="circle"></u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script>
|
|
|
import $http from '@/utils/request.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- info: 'https://openapi.ysepay.com/gateway.do?',
|
|
|
- pagesNum: '',
|
|
|
- orderId: '',
|
|
|
- paystatus: 0,
|
|
|
+ info: 'https://openapi.ysepay.com/gateway.do?',
|
|
|
+ pagesNum: '',
|
|
|
+ orderId: '',
|
|
|
+ paystatus: 0,
|
|
|
}
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- this.pagesNum = getCurrentPages().length
|
|
|
- this.paystatus = sessionStorage.getItem('paystatus') ? 1 : 0
|
|
|
},
|
|
|
- onLoad(opthios) {
|
|
|
- if(opthios.orderId){
|
|
|
- this.orderId = opthios.orderId
|
|
|
- }
|
|
|
- let data = sessionStorage.getItem('viewUrlData')
|
|
|
- data = JSON.parse(data)
|
|
|
- Object.keys(data).forEach(item=>{
|
|
|
- this.info = this.info + item + '=' + encodeURIComponent(data[item]) + '&'
|
|
|
- })
|
|
|
+ onShow() {
|
|
|
+ this.pagesNum = getCurrentPages().length
|
|
|
+ this.paystatus = sessionStorage.getItem('paystatus') ? 1 : 0
|
|
|
+ },
|
|
|
+ onLoad(opthios) {
|
|
|
+ if(opthios.orderId){
|
|
|
+ this.orderId = opthios.orderId
|
|
|
+ }
|
|
|
+ let data = sessionStorage.getItem('viewUrlData')
|
|
|
+ data = JSON.parse(data)
|
|
|
+ Object.keys(data).forEach(item=>{
|
|
|
+ this.info = this.info + item + '=' + encodeURIComponent(data[item]) + '&'
|
|
|
+ })
|
|
|
|
|
|
// if(opthios.viewUrl){
|
|
|
// let data = JSON.parse(decodeURIComponent(opthios.viewUrl))
|
|
@@ -60,78 +60,78 @@
|
|
|
// this.info = this.info + item + '=' + encodeURIComponent(data[item]) + '&'
|
|
|
// })
|
|
|
// }
|
|
|
- // location.href = this.info
|
|
|
+ // location.href = this.info
|
|
|
// window.open(this.info);
|
|
|
- },
|
|
|
- onUnload() {
|
|
|
- sessionStorage.removeItem('paystatus');
|
|
|
- sessionStorage.removeItem('viewUrlData');
|
|
|
- },
|
|
|
- methods: {
|
|
|
- openPay(e) {
|
|
|
- if(e == 1){
|
|
|
- sessionStorage.setItem('paystatus', '1');
|
|
|
- window.open(this.info);
|
|
|
- }else{
|
|
|
- window.open(this.info);
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- toPurchase() {
|
|
|
- let _this = this
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- });
|
|
|
- $http.post('/api/v1/mp/user/ticket/query', {
|
|
|
- orderId: this.orderId,
|
|
|
- }).then(res => {
|
|
|
- uni.hideLoading();
|
|
|
- if (res.code == 0) {
|
|
|
- if(res.data.status != 3) {
|
|
|
- uni.showToast({
|
|
|
- title: '支付成功',
|
|
|
- icon: 'success',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- uni.redirectTo({
|
|
|
- url: `/packagePrize/purchase/index?boxId=${ res.data.boxId }&orderId=${ this.orderId }&isTry=0`
|
|
|
- })
|
|
|
- }, 500)
|
|
|
- }else {
|
|
|
- uni.$u.toast('盲票已开奖');
|
|
|
- setTimeout(() => {
|
|
|
- uni.switchTab({
|
|
|
- url: `/pages/index/index`
|
|
|
- })
|
|
|
- }, 500)
|
|
|
- }
|
|
|
- }else {
|
|
|
- uni.$u.toast(res.msg);
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- uni.hideLoading();
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ sessionStorage.removeItem('paystatus');
|
|
|
+ sessionStorage.removeItem('viewUrlData');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ openPay(e) {
|
|
|
+ if(e == 1){
|
|
|
+ sessionStorage.setItem('paystatus', '1');
|
|
|
+ window.open(this.info);
|
|
|
+ }else{
|
|
|
+ window.open(this.info);
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ toPurchase() {
|
|
|
+ let _this = this
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ $http.post('/api/v1/mp/user/ticket/query', {
|
|
|
+ orderId: this.orderId,
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code == 0) {
|
|
|
+ if(res.data.status != 3) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付成功',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/packagePrize/purchase/index?boxId=${ res.data.boxId }&orderId=${ this.orderId }&isTry=0`
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ }else {
|
|
|
+ uni.$u.toast('共富券已开奖');
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.switchTab({
|
|
|
+ url: `/pages/index/index`
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ uni.$u.toast(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.btn {
|
|
|
- margin: 156rpx 41rpx 0 41rpx;
|
|
|
- .btn1 {
|
|
|
- background: linear-gradient(180deg, #FEA052 0%, #FF8D2F 100%);
|
|
|
- border-radius: 2px;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
- .btn2 {
|
|
|
- margin-top: 51rpx;
|
|
|
- border-radius: 2px;
|
|
|
- background-color: #EFEFEF;
|
|
|
- color: #666666;
|
|
|
- }
|
|
|
+.btn {
|
|
|
+ margin: 156rpx 41rpx 0 41rpx;
|
|
|
+ .btn1 {
|
|
|
+ background: linear-gradient(180deg, #FEA052 0%, #FF8D2F 100%);
|
|
|
+ border-radius: 2px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ .btn2 {
|
|
|
+ margin-top: 51rpx;
|
|
|
+ border-radius: 2px;
|
|
|
+ background-color: #EFEFEF;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|