增加支付前的确认弹窗

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 data
}) })
} }
//记录支付跳转
export const insertuserisopen = (data) => {
return http.request({
url: 'order/insertuserisopen',
data
})
}

View File

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

View File

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

View File

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