增加支付前的确认弹窗

This commit is contained in:
2026-04-17 18:01:37 +08:00
parent b9ff810dfe
commit ebcfca2386
4 changed files with 1054 additions and 1041 deletions

View File

@@ -83,3 +83,11 @@ export const userPrizeExchange = (data) => {
data
})
}
//记录支付跳转
export const insertuserisopen = (data) => {
return http.request({
url: 'order/insertuserisopen',
data
})
}

View File

@@ -1,90 +1,32 @@
<template>
<list
v-if="showAndriod"
:bounce="false"
:loadmoreoffset="wHeight * 3"
:show-scrollbar="false"
ref="listBox"
:pagingEnabled="true"
@loadmore="loadmore"
:scrollable="scrollable"
>
<list v-if="showAndriod" :bounce="false" :loadmoreoffset="wHeight * 3" :show-scrollbar="false" ref="listBox"
:pagingEnabled="true" @loadmore="loadmore" :scrollable="scrollable">
<cell v-for="(item, index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
<list-item-vue
:total="list.length"
:item="item"
:current="current"
:isCollect="isCollect"
:isAndriod="isAndriod"
:showAndriod="showAndriod"
:isIos="isIos"
:isH5="isH5"
:isTabbar="isTabbar"
@playStatusChange="playStatusChange"
:height="wHeight"
:isCommand="isCommand"
:showControls="control.showControls"
@toDetail="toDetail(item, index)"
@itemMounted="itemMounted"
@controlstoggles="controlstoggles"
:index="index"
:instance="instance"
:nowIndex="nowIndex"
@appear="appear($event, item, index)"
:playSpeeds="playSpeeds"
@disappear="disappear($event, item, index)"
@dianzanClick="dianzanClick(item, index)"
@share="share(item)"
@zhuijuClick="zhuijuClick(item)"
@progressScroll="progressScroll"
@progressScrollEnd="progressScrollEnd"
@popupShow="popupShow($event, item, index)"
></list-item-vue>
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
:isAndriod="isAndriod" :showAndriod="showAndriod" :isIos="isIos" :isH5="isH5" :isTabbar="isTabbar"
@playStatusChange="playStatusChange" :height="wHeight" :isCommand="isCommand"
:showControls="control.showControls" @toDetail="toDetail(item, index)" @itemMounted="itemMounted"
@controlstoggles="controlstoggles" :index="index" :instance="instance" :nowIndex="nowIndex"
@appear="appear($event, item, index)" :playSpeeds="playSpeeds"
@disappear="disappear($event, item, index)" @dianzanClick="dianzanClick(item, index)"
@share="share(item)" @zhuijuClick="zhuijuClick(item)" @progressScroll="progressScroll"
@progressScrollEnd="progressScrollEnd" @popupShow="popupShow($event, item, index)"></list-item-vue>
</view>
</cell>
</list>
<view v-if="isH5 || isIos" class="w-full box" style="width: 100vw">
<swiper
@longpress="popupShow('speed')"
:style="{ height: wHeight + 'px' }"
v-if="videoList.length"
@change="swiperChange"
:current="current"
:circular="true"
vertical
class="u-flex-1"
@transition="transition"
:indicator-dots="false"
:autoplay="false"
:interval="0"
:duration="200"
>
<swiper @longpress="popupShow('speed')" :style="{ height: wHeight + 'px' }" v-if="videoList.length"
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
<swiper-item v-for="(item, index) in videoList" :key="index">
<list-item-vue
:total="list.length"
:item="item"
:isCommand="isCommand"
:height="wHeight"
:isAndriod="isAndriod"
:showAndriod="showAndriod"
:isIos="isIos"
:isH5="isH5"
:isTabbar="isTabbar"
@playStatusChange="playStatusChange"
:showControls="control.showControls"
:current="current"
:isCollect="isCollect"
@toDetail="toDetail(item, index)"
@controlstoggles="controlstoggles"
:playSpeeds="playSpeeds"
:index="index"
:nowIndex="nowIndex"
@dianzanClick="dianzanClick(item, index)"
@share="share(item)"
@zhuijuClick="zhuijuClick(item)"
@popupShow="popupShow($event, item, index)"
></list-item-vue>
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :height="wHeight"
:isAndriod="isAndriod" :showAndriod="showAndriod" :isIos="isIos" :isH5="isH5" :isTabbar="isTabbar"
@playStatusChange="playStatusChange" :showControls="control.showControls" :current="current"
:isCollect="isCollect" @toDetail="toDetail(item, index)" @controlstoggles="controlstoggles"
:playSpeeds="playSpeeds" :index="index" :nowIndex="nowIndex"
@dianzanClick="dianzanClick(item, index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
@popupShow="popupShow($event, item, index)"></list-item-vue>
</swiper-item>
</swiper>
</view>
@@ -104,21 +46,19 @@
</view>
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('show')"></up-icon>
</view>
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll" :style="{ height: xuanjiData.height + 'px' }" :scroll-top="xuanjiData.scrollTop" :show-scrollbar="false">
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll" :style="{ height: xuanjiData.height + 'px' }"
:scroll-top="xuanjiData.scrollTop" :show-scrollbar="false">
<view class="ji-list u-flex u-flex-row u-flex-wrap">
<view
class="ji-item u-flex-xy-center u-text-center"
@click="jiClick(item, index)"
<view class="ji-item u-flex-xy-center u-text-center" @click="jiClick(item, index)"
:class="[nowIndex == index ? 'active' : '', (index + 1) % 3 == 0 ? 'mr-0' : '', 'ji-item' + index]"
v-for="(item, index) in list"
:key="index"
>
v-for="(item, index) in list" :key="index">
<text class="u-font-28" :class="{ 'color-fff': nowIndex == index }">{{ index + 1 }}</text>
<view class="lock u-flex-xy-center" v-if="!item.videoUrl">
<up-icon name="lock" :size="14" color="#fff"></up-icon>
<!-- <image class="lock-icon" src="@/static/images/lock.png" mode=""></image> -->
</view>
<image v-if="nowIndex == index" class="playing" src="@/static/images/playIng.png" mode=""></image>
<image v-if="nowIndex == index" class="playing" src="@/static/images/playIng.png" mode="">
</image>
</view>
</view>
</scroll-view>
@@ -167,27 +107,20 @@
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('show')"></up-icon>
</view>
<view :style="{ height: xuanjiData.height + 'px', overflow: 'hidden' }">
<scroll-view
scroll-y="true"
class="u-m-t-30 xuanji-scroll"
:style="{ height: xuanjiData.height + 'px' }"
:scroll-top="xuanjiData.scrollTop"
:show-scrollbar="false"
>
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll"
:style="{ height: xuanjiData.height + 'px' }" :scroll-top="xuanjiData.scrollTop"
:show-scrollbar="false">
<view class="ji-list u-flex u-flex-row u-flex-wrap">
<view
class="ji-item u-flex-xy-center u-text-center"
@click="jiClick(item, index)"
<view class="ji-item u-flex-xy-center u-text-center" @click="jiClick(item, index)"
:class="[nowIndex == index ? 'active' : '', (index + 1) % 3 == 0 ? 'mr-0' : '', 'ji-item' + index]"
v-for="(item, index) in list"
:key="index"
>
v-for="(item, index) in list" :key="index">
<text class="u-font-28" :class="{ 'color-fff': nowIndex == index }">{{ index + 1 }}</text>
<view class="lock u-flex-xy-center" v-if="!item.videoUrl">
<up-icon name="lock" :size="14" color="#fff"></up-icon>
<!-- <image class="lock-icon" src="@/static/images/lock.png" mode=""></image> -->
</view>
<image v-if="nowIndex == index" class="playing" src="@/static/images/playIng.png" mode=""></image>
<image v-if="nowIndex == index" class="playing" src="@/static/images/playIng.png" mode="">
</image>
</view>
</view>
</scroll-view>
@@ -258,7 +191,8 @@
</view>
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
<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 class="u-flex u-flex-row u-flex-y-center">
<text class="u-font-28 color-333">我已经阅读并同意</text>
@@ -277,14 +211,16 @@
<text class="font-bold color-333 u-font-28">倍速:</text>
<view class="u-flex u-flex-row speed-list">
<text class="speed-list-item u-font-28" @click="changeSpeed(index)" :class="{ active: index == speeds.active }" v-for="(item, index) in speeds.list">
<text class="speed-list-item u-font-28" @click="changeSpeed(index)"
:class="{ active: index == speeds.active }" v-for="(item, index) in speeds.list">
{{ item.num }}x
</text>
</view>
</view>
</up-popup>
<!-- 达到每天支付赠送抽奖次数上限时弹窗确认 -->
<up-popup :show="popup.payConfirm" mode="center" :round="22" @close="popupClose('payConfirm')" :customStyle="payConfirmCustomStyle">
<up-popup :show="popup.payConfirm" mode="center" :round="22" @close="popupClose('payConfirm')"
:customStyle="payConfirmCustomStyle">
<view class="u-p-32">
<text class="u-font-32 color-333 font-bold u-text-center">付款确认</text>
<view class="u-p-l-14 u-p-r-14">
@@ -304,7 +240,8 @@
</up-popup>
<!-- 绑定微信 -->
<up-popup :show="popup.bindWx" mode="center" :round="22" @close="popupClose('bindWx')" :customStyle="payConfirmCustomStyle">
<up-popup :show="popup.bindWx" mode="center" :round="22" @close="popupClose('bindWx')"
:customStyle="payConfirmCustomStyle">
<view class="u-p-32">
<text class="u-font-32 color-333 font-bold u-text-center">绑定微信</text>
<view class="u-p-l-14 u-p-r-14">
@@ -322,21 +259,47 @@
</template>
<script setup>
import {getPayMoney} from '@/api/order/index.js'
import { toBindWx } from '@/utils/wx.js';
import { useCommonStore } from '@/store/common.js';
import { getElRect } from '@/utils/util.js';
import {
insertuserisopen
} from '@/api/index/index.js'
import {
getPayMoney
} from '@/api/order/index.js'
import {
toBindWx
} from '@/utils/wx.js';
import {
useCommonStore
} from '@/store/common.js';
import {
getElRect
} from '@/utils/util.js';
const $common = useCommonStore();
// #ifdef APP
const domModule = uni.requireNativePlugin('dom');
// #endif
import listItemVue from './list-item.vue';
import { returnShareUrl } from '@/commons/config.js';
import {
returnShareUrl
} from '@/commons/config.js';
import color from '@/commons/color.js';
import { debounce, throttle } from 'lodash';
import {
debounce,
throttle
} from 'lodash';
import * as Api from '@/api/video/index.js';
import infoBox from '@/utils/infoBox.js';
import { computed, reactive, ref, watch, nextTick, onMounted, getCurrentInstance, onUnmounted } from 'vue';
import {
computed,
reactive,
ref,
watch,
nextTick,
onMounted,
getCurrentInstance,
onUnmounted
} from 'vue';
function to2(n) {
if (n) {
return n.toFixed(2)
@@ -435,8 +398,7 @@ function controlstoggles(e) {
}
const speeds = reactive({
list: [
{
list: [{
name: '0.5x',
num: 0.5
},
@@ -519,7 +481,8 @@ async function xuanjiInit() {
const height = 44;
const marginBottom = 10;
const oneItemHeight = height + marginBottom;
const scrollTop = Math.ceil((nowIndex.value + 1) / 3) * oneItemHeight - xuanjiData.height / 2 + oneItemHeight / 2;
const scrollTop = Math.ceil((nowIndex.value + 1) / 3) * oneItemHeight - xuanjiData.height / 2 + oneItemHeight /
2;
if (props.list.length <= 15) {
xuanjiData.scrollTop = 0;
return;
@@ -546,7 +509,8 @@ async function xuanjiInit() {
};
}
}
xuanjiData.scrollTop = xuanjiData.items[nowIndex.value].top - xuanjiData.height / 2 + xuanjiData.items[nowIndex.value].height / 2;
xuanjiData.scrollTop = xuanjiData.items[nowIndex.value].top - xuanjiData.height / 2 + xuanjiData.items[nowIndex
.value].height / 2;
console.log(xuanjiData);
// #endif
}
@@ -584,12 +548,50 @@ async function payOrder(data) {
if (res) {
uni.setStorageSync('nobuyCourseId', popup.data.courseDetailsId);
// #ifdef APP
uni.showModal({
title: '提示',
content: '是否立即前往支付',
showCancel: true,
confirmText: '立即支付',
success(action) {
if (action.confirm) {
insertuserisopen({
order_id: data.orderId,
user_sure: 1
}).then(() => {
uni.navigateTo({
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
});
})
}
}
})
// uni.navigateTo({
// url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
// });
// #endif
// #ifdef H5
uni.showModal({
title: '提示',
content: '是否立即前往支付',
showCancel: true,
confirmText: '立即支付',
success(action) {
if (action.confirm) {
insertuserisopen({
order_id: data.orderId,
user_sure: 1
}).then(() => {
window.location.href = res.h5Url;
})
}
}
})
// window.location.href = res.h5Url;
// #endif
popupClose();
}
@@ -643,6 +645,7 @@ async function payConfirm() {
orderId: res.orders.ordersId
});
} else {
uni.showLoading()
console.log('延迟开始')
setTimeout(() => {
@@ -654,8 +657,7 @@ async function payConfirm() {
}, 200)
}
} else {
}
} else {}
} catch (error) {
console.log(error);
}
@@ -889,7 +891,9 @@ function videoPlay(videoId, courseDetailsId) {}
function ended() {}
function share(item) {
const { qdCode } = uni.getStorageSync('userInfo') || {};
const {
qdCode
} = uni.getStorageSync('userInfo') || {};
const urls =
returnShareUrl() +
'/me/detail/detail?id=' +
@@ -1041,6 +1045,7 @@ async function getDanjiPrice(){
})
nowNewDanjiPrice.value = res
}
function loadmore() {
console.log('loadmore');
}
@@ -1168,8 +1173,7 @@ defineExpose({
}
}
.zhuiju {
}
.zhuiju {}
}
.poster-popup {
@@ -1291,14 +1295,12 @@ defineExpose({
align-items: center;
text-align: center;
.playing {
}
.playing {}
&.active {
background-color: #ffffff;
.playing {
}
.playing {}
}
}
}

View File

@@ -2,8 +2,8 @@
"name" : "斯耀短剧",
"appid" : "__UNI__E0B05B1",
"description" : "",
"versionName" : "1.3.5",
"versionCode" : 135,
"versionName" : "1.3.6",
"versionCode" : 136,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@@ -131,6 +131,7 @@
queryInviter()
getBgImg()
data.erweima = config.shareUrl + `/pages/login/register/?invitation=${data.invitationCode}&qdCode=${uni.getStorageSync('userInfo').qdCode}`
data.erweima='https://mh-box.sxczgkj.com/pages/login/register/?invitation=7LCV0147KG50&qdCode=ymf123'
console.log(data.erweima)
})
@@ -217,6 +218,7 @@
}
function qrR(path) {
console.log('qr',path);
data.erweimapath = path;
}
@@ -229,6 +231,7 @@
}).then(res => {
data.bgImg = res[0].imageUrl
data.tuiguang = res[0].describes
console.log('getBgImg',data);
// data.bgImg = "https://jiaoyu.xianmxkj.com/img/20230822/27d37f847db9481bb3dc54cd12258147.jpg"
});
}