This commit is contained in:
duan 2025-01-14 09:49:46 +08:00
commit 1281fd5513
13 changed files with 283 additions and 113 deletions

View File

@ -2,7 +2,7 @@
"version" : "1.0",
"configurations" : [
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-android"
},
{

View File

@ -19,4 +19,10 @@ export const commonType = (num) => {
return http.request({
url: `/common/type/${num}`,
})
}
export function getCommonConfig(){
return http.request({
url:'common/getAppUseKv'
})
}

View File

@ -109,4 +109,13 @@ export function goldPay(data){
'content-type':'application/x-www-form-urlencoded'
}}
})
}
//获取转盘抽奖次数
export function getDrawCount(data){
return http.request({
url: 'discSpinning/drawCount',
method:'GET',
data
})
}

View File

@ -5,11 +5,11 @@
@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" :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"
: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>
@ -21,12 +21,11 @@
<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"
: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(item,index)"
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
@popupShow="popupShow($event,item,index)"></list-item-vue>
: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(item,index)" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
</view>
</cell>
</list>
@ -120,7 +119,7 @@
</view>
<view class="u-m-t-10">
<text class="font-bold u-font-26 color-333">温馨提示</text>
<text class="u-m-t-10 u-font-24 color-999">一经购买不予退款未满18岁需在监护人的指导同意下进行付费操作</text>
<text class="u-m-t-10 u-font-24 color-999">{{$common.payTips}}</text>
</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">
@ -155,6 +154,10 @@
</template>
<script setup>
import {
useCommonStore
} from '@/store/common.js'
const $common=useCommonStore()
// #ifdef APP
const domModule = uni.requireNativePlugin('dom')
// #endif
@ -317,7 +320,7 @@
console.log('disappear nowIndex' + nowIndex.value);
console.log('cacheIndex' + cacheIndex);
nowIndex.value = cacheIndex
const item=props.list[nowIndex.value]
const item = props.list[nowIndex.value]
if (!item.videoUrl) {
popupShow('pay', item, nowIndex.value)
}
@ -331,6 +334,7 @@
async function payOrder(data) {
const res = await Api.payOrder(data)
if (res) {
uni.setStorageSync('nobuyCourseId',popup.data.courseId)
// #ifdef APP
uni.navigateTo({
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
@ -339,6 +343,7 @@
// #ifdef H5
window.location.href = res.h5Url
// #endif
popupClose()
}
}
//
@ -400,6 +405,7 @@
function jiClick(item, index) {
initing=false
let newCurrent = (current.value + 1) % 3;
videoList.value[newCurrent] = item;
current.value = newCurrent;
@ -426,24 +432,27 @@
clearTimeout(positonmer)
console.log('goListPosition:' + index)
const el = refList.value[index]
if ($mountedComponents[props.list.length - 1] && $mountedComponents[index]) {
domModule.scrollToElement(el, {
animated: false
})
initing = false;
const item = props.list[index]
setVideoList(item)
insertHistory()
} else {
//
positonmer = setTimeout(() => {
goListPosition(index)
}, 200)
if (initing) {
if (!$mountedComponents[props.list.length - 1]) {
positonmer = setTimeout(() => {
goListPosition(index)
}, 200)
return
}
}
domModule.scrollToElement(el, {
animated: false
})
initing = false;
const item = props.list[index]
setVideoList(item)
insertHistory()
}
function popupClose(key) {
if (key) {
popup[key] = false
@ -698,11 +707,11 @@
'width': '750rpx',
}
})
function videoListUpdata(){
videoList.value=videoList.value.map(v=>{
const item=props.list.find(listItem=>listItem.courseDetailsId==v.courseDetailsId)
return item?item:v
function videoListUpdata() {
videoList.value = videoList.value.map(v => {
const item = props.list.find(listItem => listItem.courseDetailsId == v.courseDetailsId)
return item ? item : v
})
}
defineExpose({

17
main.js
View File

@ -1,6 +1,12 @@
import App from './App'
import uviewPlus from 'uview-plus'
import * as Pinia from "pinia";
import {
createUnistorage
} from "pinia-plugin-unistorage";
import {
useCommonStore
} from '@/store/common.js'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
@ -18,9 +24,16 @@ import {
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
const store = Pinia.createPinia();
store.use(createUnistorage());
app.use(uviewPlus)
app.use(store)
const $common = useCommonStore()
$common.init()
return {
app
app,
Pinia
}
}
// #endif

View File

@ -8,5 +8,8 @@
"pre-commit": "^1.2.2",
"to-arraybuffer": "^1.0.1",
"uview-plus": "^3.3.61"
},
"devDependencies": {
"pinia-plugin-unistorage": "^0.1.2"
}
}

View File

@ -50,7 +50,8 @@
"path": "pages/me/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}, {
"path": "pages/me/contact",
@ -171,33 +172,29 @@
}
},
{
"path" : "pages/task/prizeList",
"style" :
{
"navigationBarTitleText" : "任务"
"path": "pages/task/prizeList",
"style": {
"navigationBarTitleText": "任务"
}
},
{
"path" : "pages/task/receiveMember",
"style" :
{
"navigationBarTitleText" : "",
"path": "pages/task/receiveMember",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/me/prizeDraw",
"style" :
{
"navigationBarTitleText" : "抽奖"
"path": "pages/me/prizeDraw",
"style": {
"navigationBarTitleText": "抽奖"
}
},
{
"path" : "pages/pays/pays",
"style" :
{
"navigationBarTitleText" : ""
"path": "pages/pays/pays",
"style": {
"navigationBarTitleText": ""
}
}
],

View File

@ -45,15 +45,6 @@
<image v-if="datas.isExamine == 0" @click="goMsg('/me/VjgyqAzklr/VjgyqAzklr')" src="@/static/index/red-pack-new.gif"
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
<u-modal :show="datas.ruleShow" v-if="datas.isExamine == 0" confirm-text="知道了" @confirm='datas.ruleShow = false'
:title="datas.rule_title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)">
<view class="" style="padding-top: 30rpx;text-align: left;">
<scroll-view scroll-y="true" style="max-height: 50vh;">
<rich-text style="color:#666" :nodes="datas.rule_content"></rich-text>
</scroll-view>
</view>
</u-modal>
<u-modal :show="datas.version.show" :confirm-text="datas.version.confirmText" :showCancelButton="datas.version.cancelText" @confirm='confirmUpdateVersion'
:title="datas.version.title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
<view class="" style="padding-top: 30rpx;text-align: left;">
@ -62,6 +53,13 @@
</scroll-view>
</view>
</u-modal>
<up-modal :show="datas.ruleShow" v-if="datas.isExamine == 0" confirm-text="知道了" title="规则说明" :title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
<view class="u-p-30 u-text-left">
<scroll-view scroll-y="true" style="max-height: 50vh;" >
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="datas.rule_content"></rich-text>
</scroll-view>
</view>
</up-modal>
</template>
<script setup>
@ -71,6 +69,7 @@ import {
import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js'
import {
onLoad,
onReady,
onReachBottom
} from '@dcloudio/uni-app'
import contentlist from './components/contentlist.vue'
@ -88,7 +87,9 @@ let datas = reactive({
ruleShow: false,
rule_title: '', //
rule_content: '', //
ruleIndex: 0,
ruleList: [],
//ios 1
isExamine: uni.getStorageSync('isExamine'),
@ -104,9 +105,14 @@ onLoad(() => {
versionUpdate()
getMsg()
getrecomVideo()
getPop()
})
onReady(() => {
announcement({type: 0}).then(res=>{
datas.ruleList = res
ruleInit()
datas.ruleShow = true
})
})
onReachBottom(() => {
++datas.page
getrecomVideo()
@ -184,6 +190,27 @@ function confirmUpdateVersion(){
plus.runtime.openURL(iosLink, function(res) {});
}
}
function ruleInit(){
datas.rule_title = datas.ruleList[datas.ruleIndex].title
datas.rule_content = datas.ruleList[datas.ruleIndex].content
}
/**
* 规则确认
*/
function ruleConfirm() {
datas.ruleShow = false
datas.ruleIndex++
console.log(datas.ruleIndex >= datas.ruleList.length)
if( datas.ruleIndex >= datas.ruleList.length) {
datas.ruleIndex = 0
return
}
setTimeout(res=>{
ruleInit()
datas.ruleShow = true
},300)
}
//
function goMsg(url) {
// if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
@ -201,15 +228,7 @@ function goMsg(url) {
//#endif
// }
}
//
async function getPop() {
let res = await announcement()
if (res.state == 1) {
datas.ruleShow = true
datas.rule_title = res.title
datas.rule_content = res.content
}
}
//
function moreVideo() {
uni.navigateTo({

View File

@ -111,7 +111,7 @@
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js';
@ -162,8 +162,17 @@ function toTask() {
});
}
onLoad(() => {});
onShow(() => {
onPullDownRefresh(async () => {
await selectByUserIdAjax();
await collectVideoSummaryAjax();
await selectUserMoneyAjax();
userInfo.value = uni.getStorageSync('userInfo');
setTimeout(() => {
uni.stopPullDownRefresh();
}, 500);
});
onLoad(() => {
selectByUserIdAjax();
collectVideoSummaryAjax();
selectUserMoneyAjax();

View File

@ -1,13 +1,12 @@
<template>
<view class="container">
<up-navbar title="申请提现"
@rightClick="data.ruleShow = true"
bgColor="rgb(255, 117, 129)"
leftIconColor="#FFF"
:titleStyle ="{color:'#FFF'}" >
<template #right>
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
<text class="rule-btn" @click="data.ruleShow = true">规则</text>
<text class="rule-btn" @click="showRule">规则</text>
</view>
</template>
</up-navbar>
@ -72,13 +71,13 @@
</view>
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title-style="{fontWeight:'700'}" @confirm="data.ruleShow=false" confirm-color="rgb(255, 117, 129)">
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
<view class="u-p-30 u-text-left">
<scroll-view scroll-y="true" style="max-height: 50vh;" >
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="data.ruleInfo"></rich-text>
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="data.rule_content"></rich-text>
</scroll-view>
</view>
</up-modal>
<view style="width: 0;height: 0;overflow: hidden;">
@ -96,27 +95,14 @@
import { onReady,onLoad,onShow,onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
import { selectUserById } from '@/api/user/user.js';
import { announcement } from '@/api/index/index.js';
import { commonType } from '@/api/init.js';
import { linkTo } from '@/utils/app.js';
let data = reactive({
ruleShow: true,
ruleInfo: `
用户在平台中对奖励提现的适用以下规则
<br/>
<br/>
1用户的收益达到最低提现金额要求后可以申请提现每日只可以提现一笔
<br/>
2用户需要通过支付宝提现需按照要求绑定支付宝账号并填写提现金额或其他提现所需信息请确保提供的信息准确无误以免提现失败
<br/>
3如果用户发现显示提现失败需确认当前填写或绑定的支付宝账号或银行卡账号是否正确以及支付宝账号是否可用如果用户发现显示提现成功但没到账
<br/>
(1)如果用户有多个支付宝账号请检查用户是否提现到了其他支付宝账号
<br/>
(2)高峰期提现人数多会导致网络拥堵显示提现成功之后72小时内属于正常现象请耐心等候
<br/>
4每日08:00至次日18:00为提现时间活动的对应奖励可能延迟到账提现通常会在72小时内到账如遇双休日节假日提现到账时间可能会延长活动高峰期间由于网络拥堵用户可能存在短时间内无法提现的情况平台将尽最大努力及时恢复提现功能但无需因此承担任何责任
<br/>`,
rule_title: "",
rule_content: "",
money: '',
mayMoney: '0',
list: [],
@ -129,16 +115,24 @@
adRewardedVideoloadNum: 0,
isWithdraw: false,
userInfo: null,
ruleIndex: 0,
ruleList: []
})
const adRewarded = ref(null);
onLoad(() => {
getExtractFei();
getMoneyDetail();
})
onShow(() => {
getcashMoney()
getUserInfo();
announcement({type: 1}).then(res=>{
data.ruleList = res
ruleInit()
data.ruleShow = true
})
})
onReady(() => {
nextTick(()=>{
@ -150,14 +144,49 @@
onReachBottom(() => {
if (data.page * data.limit < data.totalCount) {
data.page = data.page + 1;
data.getMoneyDetail();
getMoneyDetail();
}
})
onPullDownRefresh(() => {
data.page = 1;
data.list = []
data.getMoneyDetail();
getMoneyDetail();
})
function ruleInit(){
data.rule_title = data.ruleList[data.ruleIndex].title
data.rule_content = data.ruleList[data.ruleIndex].content
}
/**
* 规则弹窗打开
*/
function showRule() {
if( data.ruleList.length <= 0) {
uni.showToast({
title: "暂未配置规则",
icon: 'none'
})
return
}
ruleInit()
data.ruleShow = true
}
/**
* 规则确认
*/
function ruleConfirm() {
data.ruleShow = false
data.ruleIndex++
console.log(data.ruleIndex >= data.ruleList.length)
if( data.ruleIndex >= data.ruleList.length) {
data.ruleIndex = 0
return
}
setTimeout(res=>{
ruleInit()
data.ruleShow = true
},300)
}
function getUserInfo() {
selectUserById().then(res=>{
data.userInfo = res;

View File

@ -31,8 +31,7 @@
getOrderInfo({
orderId: state.orderId
}).then(res => {
console.log(res);
if (res.data == 1) {
if (res == 1) {
uni.hideLoading()
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'

View File

@ -1,7 +1,8 @@
<template>
<view class="min-page">
<my-video-list ref="refVideoList" v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
:info="state"></my-video-list>
<my-video-list ref="refVideoList" v-if="state.list.length" @swiperChange="swiperChange" :list="state.list"
@update="update" :info="state"></my-video-list>
</view>
</template>
@ -12,14 +13,15 @@
} from '@dcloudio/uni-app'
import * as Api from '@/api/video/index.js'
import {
reactive, ref
reactive,
ref
} from 'vue'
import {
slice
} from 'lodash'
const boxStyle = {
height: '835px'
}
const sysInfo = uni.getSystemInfoSync()
let isFirstLoad = true
let options = {}
const state = reactive({
collect: 0,
@ -28,10 +30,11 @@
price: 0,
title: ''
})
const refVideoList=ref(null)
const refVideoList = ref(null)
async function init() {
try {
const res = await Api.getVideoDetail(options)
isFirstLoad = false
Object.assign(state, res)
state.list = res.list
} catch (error) {
@ -49,11 +52,10 @@
index,
item
}) {
if(item){
if (item) {
state.list[index] = item
}else{
} else {
await init()
refVideoList.value.videoListUpdata()
}
}
onLoad((opt) => {
@ -67,8 +69,22 @@
data
}) {}
onShow(() => {
init()
onShow(async () => {
if (!isFirstLoad) {
await init()
refVideoList.value.videoListUpdata()
const drawRes = await Api.getDrawCount()
console.log(drawRes);
const nobuyCourseId = uni.getStorageSync('nobuyCourseId')
const item = state.list.find(v => v.courseId == nobuyCourseId)
uni.clearStorageSync('nobuyCourseId')
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
.videoUrl) {
uni.navigateTo({
url: '/pages/me/prizeDraw'
})
}
}
})
</script>

61
store/common.js Normal file
View File

@ -0,0 +1,61 @@
import {
defineStore
} from "pinia";
import {getCommonConfig} from '@/api/init.js'
const $map = {
882: 'isWxIosPay',
833: 'checkIosLogin',
834: 'checkIosPay',
835: 'checkWxLogin',
836: 'checkPhoneLogin',
108: 'isOpenWxWebAutoLogin',
817: 'zhengbu',
818: 'danbu',
252: 'adUnitId',
821: 'playType',
251: 'isGuanggao',
254: 'isGuanggaody',
202: 'kefu',
206: 'kefuPhone',
204: 'kefuUrl',
203: 'kefuAppId',
248: 'isVips',
249: 'moreSearch',
49: 'AppUrl',
823: 'OfferID',
824: 'payEnv',
825: 'moneyTips',
855: 'kmPaySel',
849: 'homeTypeSel',
856: 'syPaySel',
857: 'imId',
858: 'isAccountPay',
860: 'dyadUnitId',
881: '',
109: '',
922: 'withdrawNum',
500:'payTips'
}
export const useCommonStore = defineStore("common", {
state() {
return {
payTips:'付款完成后不要忘记抽红包哦'
};
},
actions:{
async init(){
const res=await getCommonConfig()
if(res){
for (let i in $map) {
const key = $map[i]
if (key) {
this[key]=res[i]
}
}
}
console.log(res);
}
},
unistorage: true, // 开启后对 state 的数据读写都将持久化
});