增加支付
This commit is contained in:
@@ -66,3 +66,47 @@ export function tuijianVideo(data){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//解锁10集视频
|
||||||
|
export function buyTenVideo(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'order/insertCourseOrders/limit10',
|
||||||
|
method:'GET',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//解锁单集或者全部视频
|
||||||
|
export function buyVideo(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'order/insertCourseOrders',
|
||||||
|
method:'GET',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//订单支付
|
||||||
|
export function payOrder(data){
|
||||||
|
let payType='h5'
|
||||||
|
// #ifdef APP
|
||||||
|
payType='app'
|
||||||
|
// #endif
|
||||||
|
return http.request({
|
||||||
|
url: 'wuyou/payOrder/'+data.orderId+'?payType='+payType,
|
||||||
|
method:'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取订单支付状态
|
||||||
|
export function getOrderInfo(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'wuyou/queryOrder/'+data.orderId,
|
||||||
|
method:'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//金币解锁
|
||||||
|
export function goldPay(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'order/payOrders',
|
||||||
|
method:'POST',
|
||||||
|
data:{...data,header:{
|
||||||
|
'content-type':'application/x-www-form-urlencoded'
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -5,12 +5,12 @@
|
|||||||
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
|
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
|
||||||
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
||||||
<swiper-item v-for="(item,index) in videoList" :key="index">
|
<swiper-item v-for="(item,index) in videoList" :key="index">
|
||||||
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand"
|
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :rightStyle="rightStyle"
|
||||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
:infoStyle="infoStyle" :showControls="control.showControls" :current="current"
|
||||||
:showControls="control.showControls" :current="current" :isCollect="isCollect"
|
:isCollect="isCollect" @toDetail="toDetail(item,index)" @controlstoggles="controlstoggles"
|
||||||
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
|
:playSpeeds="playSpeeds" :index="index" :nowIndex="nowIndex"
|
||||||
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||||
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
|
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -22,12 +22,12 @@
|
|||||||
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
||||||
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
||||||
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
||||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
:rightStyle="rightStyle" :infoStyle="infoStyle" :isCommand="isCommand"
|
||||||
:isCommand="isCommand" :showControls="control.showControls" @toDetail="toDetail(item,index)"
|
:showControls="control.showControls" @toDetail="toDetail(item,index)" @itemMounted="itemMounted"
|
||||||
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
|
@controlstoggles="controlstoggles" :index="index" :instance="instance" :nowIndex="nowIndex"
|
||||||
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
|
@appear="appear($event,item,index)" :playSpeeds="playSpeeds" @disappear="disappear(item,index)"
|
||||||
@disappear="disappear(item,index)" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||||
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
|
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||||
</view>
|
</view>
|
||||||
</cell>
|
</cell>
|
||||||
</list>
|
</list>
|
||||||
@@ -125,7 +125,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
||||||
<view class="u-flex-y-center">
|
<view class="u-flex-y-center">
|
||||||
<up-checkbox usedAlone shape="circle" v-model:checked="isAgree" :activeColor="color.main"></up-checkbox>
|
<up-checkbox usedAlone shape="circle" v-model:checked="isAgree"
|
||||||
|
:activeColor="color.main"></up-checkbox>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-row u-flex-y-center">
|
<view class="u-flex u-flex-row u-flex-y-center">
|
||||||
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
||||||
@@ -213,7 +214,7 @@
|
|||||||
showControls: true
|
showControls: true
|
||||||
})
|
})
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
control.showControls=false
|
control.showControls = false
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
const customStyle = computed(() => {
|
const customStyle = computed(() => {
|
||||||
@@ -229,7 +230,7 @@
|
|||||||
|
|
||||||
function controlstoggles(e) {
|
function controlstoggles(e) {
|
||||||
control.showControls = e.detail.show
|
control.showControls = e.detail.show
|
||||||
console.log(control.showControls );
|
console.log(control.showControls);
|
||||||
control.showBack = control.showControls
|
control.showBack = control.showControls
|
||||||
console.log(control);
|
console.log(control);
|
||||||
}
|
}
|
||||||
@@ -292,8 +293,8 @@
|
|||||||
pay: false,
|
pay: false,
|
||||||
payTips: false,
|
payTips: false,
|
||||||
speed: false,
|
speed: false,
|
||||||
data:null,
|
data: null,
|
||||||
payType:null
|
payType: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -325,25 +326,68 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//非金币支付
|
||||||
|
async function payOrder(data) {
|
||||||
|
const res = await Api.payOrder(data)
|
||||||
|
console.log(res);
|
||||||
|
if (res) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
|
||||||
|
});
|
||||||
|
return
|
||||||
|
// #ifdef APP
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/pays/pays?orderId=' + res.orderId + '&url=' + res.h5Url
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
window.location.href = res.h5Url
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//金币支付
|
||||||
|
async function goldPay(data) {
|
||||||
|
const res = await Api.goldPay(data)
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
//确认支付
|
//确认支付
|
||||||
function payConfirm() {
|
async function payConfirm() {
|
||||||
console.log(isAgree.value);
|
|
||||||
if (!isAgree.value) {
|
if (!isAgree.value) {
|
||||||
return infoBox.showToast('请阅读并同意 《付费须知说明》')
|
return infoBox.showToast('请阅读并同意 《付费须知说明》')
|
||||||
}
|
}
|
||||||
|
const [type, num] = popup.payType.split('-');
|
||||||
|
console.log(type, num);
|
||||||
let data = {
|
let data = {
|
||||||
courseId: this.courseId
|
courseId: popup.data.courseId
|
||||||
}
|
}
|
||||||
if(popup.payType=='all'){
|
if (num == 1) {
|
||||||
|
data.courseDetailsId = popup.data.courseDetailsId
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data)
|
||||||
|
if (res) {
|
||||||
|
if(type=='gold'){
|
||||||
|
goldPay({
|
||||||
|
orderId: res.orders.ordersId
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
payOrder({
|
||||||
|
orderId: res.orders.ordersId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function payBtnClick(type,num) {
|
function payBtnClick(type, num) {
|
||||||
popup.payType=`${type}-${num}`
|
console.log(type, num);
|
||||||
popupClose()
|
popup.payType = `${type}-${num}`
|
||||||
|
popupClose('show')
|
||||||
popupShow('payTips')
|
popupShow('payTips')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +414,10 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//滚动到指定位置
|
//滚动到指定位置
|
||||||
|
let positonmer = null
|
||||||
|
|
||||||
function goListPosition(index) {
|
function goListPosition(index) {
|
||||||
|
clearTimeout(positonmer)
|
||||||
console.log('goListPosition:' + index)
|
console.log('goListPosition:' + index)
|
||||||
const el = refList.value[index]
|
const el = refList.value[index]
|
||||||
if ($mountedComponents[props.list.length - 1]) {
|
if ($mountedComponents[props.list.length - 1]) {
|
||||||
@@ -382,7 +429,7 @@
|
|||||||
setVideoList(item)
|
setVideoList(item)
|
||||||
insertHistory()
|
insertHistory()
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
positonmer = setTimeout(() => {
|
||||||
goListPosition(index)
|
goListPosition(index)
|
||||||
}, 30)
|
}, 30)
|
||||||
}
|
}
|
||||||
@@ -400,12 +447,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupShow(key = 'show',item,index) {
|
function popupShow(key = 'show', item, index) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
popup[key] = true
|
popup[key] = true
|
||||||
|
if (item) {
|
||||||
popup['data'] = item
|
popup['data'] = item
|
||||||
popup['index'] = index
|
popup['index'] = index
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let jinbiBili = ref(0)
|
let jinbiBili = ref(0)
|
||||||
@@ -602,7 +651,7 @@
|
|||||||
}
|
}
|
||||||
console.log(videoList.value);
|
console.log(videoList.value);
|
||||||
if (!item.videoUrl) {
|
if (!item.videoUrl) {
|
||||||
popupShow('pay',item,index)
|
popupShow('pay', item, index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +681,7 @@
|
|||||||
const nowDanjiPrice = computed(() => {
|
const nowDanjiPrice = computed(() => {
|
||||||
return videoList.value[current.value].price
|
return videoList.value[current.value].price
|
||||||
})
|
})
|
||||||
const rightStyle=computed(()=>{
|
const rightStyle = computed(() => {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
return {
|
return {
|
||||||
transform: `translateX(${!control.showControls?'0':60}px)`
|
transform: `translateX(${!control.showControls?'0':60}px)`
|
||||||
@@ -644,7 +693,7 @@
|
|||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
const infoStyle=computed(()=>{
|
const infoStyle = computed(() => {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
return {
|
return {
|
||||||
transform: `translateX(${!control.showControls?0:'-110%'})`
|
transform: `translateX(${!control.showControls?0:'-110%'})`
|
||||||
@@ -656,6 +705,7 @@
|
|||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
|
|
||||||
function loadmore() {
|
function loadmore() {
|
||||||
console.log('loadmore');
|
console.log('loadmore');
|
||||||
}
|
}
|
||||||
|
|||||||
49
http/http.js
49
http/http.js
@@ -1,20 +1,27 @@
|
|||||||
// 导入全局属性
|
// 导入全局属性
|
||||||
import { sm4DecryptByResData } from "@/utils/encryptUtil.js";
|
import {
|
||||||
|
sm4DecryptByResData
|
||||||
|
} from "@/utils/encryptUtil.js";
|
||||||
import infoBox from "@/utils/infoBox.js";
|
import infoBox from "@/utils/infoBox.js";
|
||||||
import { reject } from "lodash";
|
import {
|
||||||
|
reject
|
||||||
|
} from "lodash";
|
||||||
import config from "@/commons/config.js";
|
import config from "@/commons/config.js";
|
||||||
// 测试服
|
// 测试服
|
||||||
let baseUrl = config.baseApiUrl + "app";
|
let baseUrl = config.baseApiUrl + "app";
|
||||||
const loadingShowTime = 200;
|
const loadingShowTime = 200;
|
||||||
|
|
||||||
function getHeader() {
|
function getHeader(data) {
|
||||||
const headerObject = {};
|
const header = data ? data.header : {}
|
||||||
|
const headerObject = {
|
||||||
|
...header
|
||||||
|
};
|
||||||
headerObject["token"] = uni.getStorageSync("token");
|
headerObject["token"] = uni.getStorageSync("token");
|
||||||
return headerObject;
|
return headerObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通用处理逻辑
|
// 通用处理逻辑
|
||||||
function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||||
// 判断是否请求完成(用作 是否loading )
|
// 判断是否请求完成(用作 是否loading )
|
||||||
// 包括: 'ing', 'ingLoading', 'finish'
|
// 包括: 'ing', 'ingLoading', 'finish'
|
||||||
let reqState = "ing";
|
let reqState = "ing";
|
||||||
@@ -44,11 +51,14 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||||||
|
|
||||||
reqFinishFunc(); // 请求完毕的动作
|
reqFinishFunc(); // 请求完毕的动作
|
||||||
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
||||||
let { statusCode, data } = httpData;
|
let {
|
||||||
|
statusCode,
|
||||||
|
data
|
||||||
|
} = httpData;
|
||||||
// 避免混淆重新命名
|
// 避免混淆重新命名
|
||||||
let bodyData = data;
|
let bodyData = data;
|
||||||
if(isreturm){
|
if (isreturm) {
|
||||||
return Promise.resolve(bodyData.data || bodyData.page|| bodyData);
|
return Promise.resolve(bodyData.data || bodyData.page || bodyData);
|
||||||
}
|
}
|
||||||
if (statusCode == 500) {
|
if (statusCode == 500) {
|
||||||
isShowErrorToast = true;
|
isShowErrorToast = true;
|
||||||
@@ -92,7 +102,7 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构造请求成功的响应数据
|
// 构造请求成功的响应数据
|
||||||
return Promise.resolve(bodyData.data || bodyData.page|| bodyData);
|
return Promise.resolve(bodyData.data || bodyData.page || bodyData);
|
||||||
})
|
})
|
||||||
.catch((res) => {
|
.catch((res) => {
|
||||||
|
|
||||||
@@ -136,12 +146,11 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||||||
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
||||||
return commonsProcess(showLoading, () => {
|
return commonsProcess(showLoading, () => {
|
||||||
return uni.request(
|
return uni.request(
|
||||||
Object.assign(
|
Object.assign({
|
||||||
{
|
|
||||||
url: baseUrl + uri,
|
url: baseUrl + uri,
|
||||||
data: data,
|
data: data,
|
||||||
method: method,
|
method: method,
|
||||||
header: getHeader(),
|
header: getHeader(data),
|
||||||
},
|
},
|
||||||
extParams
|
extParams
|
||||||
)
|
)
|
||||||
@@ -158,16 +167,17 @@ function request(args) {
|
|||||||
method = "GET",
|
method = "GET",
|
||||||
showLoading = true,
|
showLoading = true,
|
||||||
extParams = {},
|
extParams = {},
|
||||||
isreturm=false
|
isreturm = false
|
||||||
} = args
|
} = args
|
||||||
if (params) {
|
if (params) {
|
||||||
let result = ''
|
let result = ''
|
||||||
Object.keys(params).forEach((key) => {
|
Object.keys(params).forEach((key) => {
|
||||||
if (!Object.is(params[key], undefined) && !Object.is(params[key], null) && !Object.is(JSON.stringify(params[key]), '{}')) {
|
if (!Object.is(params[key], undefined) && !Object.is(params[key], null) && !Object.is(JSON
|
||||||
|
.stringify(params[key]), '{}')) {
|
||||||
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + "&"
|
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + "&"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
url = url+'?'+(result.slice(0,result.length-1))
|
url = url + '?' + (result.slice(0, result.length - 1))
|
||||||
params = null
|
params = null
|
||||||
}
|
}
|
||||||
let headerObject = {}
|
let headerObject = {}
|
||||||
@@ -177,11 +187,11 @@ function request(args) {
|
|||||||
url: slash(baseUrl, url),
|
url: slash(baseUrl, url),
|
||||||
data: params || data,
|
data: params || data,
|
||||||
method: method,
|
method: method,
|
||||||
header: getHeader()
|
header: getHeader(data)
|
||||||
}, extParams)
|
}, extParams)
|
||||||
|
|
||||||
)
|
)
|
||||||
},isreturm)
|
}, isreturm)
|
||||||
}
|
}
|
||||||
// 处理/
|
// 处理/
|
||||||
function slash(baseUrl, url) {
|
function slash(baseUrl, url) {
|
||||||
@@ -206,13 +216,12 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
|||||||
return commonsProcess(showLoading, () => {
|
return commonsProcess(showLoading, () => {
|
||||||
return uni
|
return uni
|
||||||
.uploadFile(
|
.uploadFile(
|
||||||
Object.assign(
|
Object.assign({
|
||||||
{
|
|
||||||
url: baseUrl + uri,
|
url: baseUrl + uri,
|
||||||
formData: data,
|
formData: data,
|
||||||
name: "file",
|
name: "file",
|
||||||
filePath: file.path || file.url,
|
filePath: file.path || file.url,
|
||||||
header: getHeader(),
|
header: getHeader(data),
|
||||||
},
|
},
|
||||||
extParams
|
extParams
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -192,6 +192,13 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText" : "抽奖"
|
"navigationBarTitleText" : "抽奖"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/pays/pays",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
86
pages/pays/pays.vue
Normal file
86
pages/pays/pays.vue
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<view style="width: 100%;">
|
||||||
|
<web-view id="webview" :src="state.url" style="width: 100%;"></web-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
reactive
|
||||||
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
onShow,onHide,onUnload,onLoad
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
import {
|
||||||
|
getOrderInfo
|
||||||
|
} from '@/api/video/index.js'
|
||||||
|
const state = reactive({
|
||||||
|
orderId: '',
|
||||||
|
timer: null,
|
||||||
|
maxAjaxNum: 5,
|
||||||
|
ajaxNum: 0,
|
||||||
|
url: null, //要打开的外部链接
|
||||||
|
viewerUrl: '/hybrid/html/web/viewer.html',
|
||||||
|
webviewStyles: {
|
||||||
|
width: '750px',
|
||||||
|
height: '100%',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function getOrder() {
|
||||||
|
getOrderInfo({
|
||||||
|
orderId: state.orderId
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res.data);
|
||||||
|
if (res.data == 1) {
|
||||||
|
uni.hideLoading()
|
||||||
|
const sysInfo = uni.getSystemInfoSync();
|
||||||
|
let isIos = sysInfo.platform == 'ios'
|
||||||
|
if (isIos) {
|
||||||
|
uni.navigateBack()
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
state.timer = setTimeout(() => {
|
||||||
|
clearTimeout(state.timer)
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// #ifdef APP
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付中'
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onShow(() => {
|
||||||
|
getOrder()
|
||||||
|
})
|
||||||
|
onHide(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
onUnload(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
onLoad((option) => {
|
||||||
|
state.url = option.url
|
||||||
|
state.orderId = option.orderId
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.webview {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="min-page">
|
<view class="min-page">
|
||||||
<my-video-list v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
<my-video-list v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
||||||
:info="state"
|
:info="state"></my-video-list>
|
||||||
></my-video-list>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -18,8 +17,8 @@
|
|||||||
import {
|
import {
|
||||||
slice
|
slice
|
||||||
} from 'lodash'
|
} from 'lodash'
|
||||||
const boxStyle={
|
const boxStyle = {
|
||||||
height:'835px'
|
height: '835px'
|
||||||
}
|
}
|
||||||
let options = {}
|
let options = {}
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@@ -44,8 +43,12 @@
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function update({index,item}){
|
|
||||||
state.list[index]=item
|
function update({
|
||||||
|
index,
|
||||||
|
item
|
||||||
|
}) {
|
||||||
|
state.list[index] = item
|
||||||
}
|
}
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
Object.assign(options, opt)
|
Object.assign(options, opt)
|
||||||
@@ -56,11 +59,10 @@
|
|||||||
current,
|
current,
|
||||||
direction,
|
direction,
|
||||||
data
|
data
|
||||||
}) {
|
}) {}
|
||||||
}
|
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
init()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -71,8 +73,8 @@
|
|||||||
background-color: #000;
|
background-color: #000;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.u-popup{
|
|
||||||
|
.u-popup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user