From 940cf8c2e72c1cc4fb4b81a7ea2ceb93ca0b08de Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Sat, 18 Jan 2025 09:51:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ios=E5=AF=A9=E6=A0=B8?=
=?UTF-8?q?=E6=99=82=E5=80=99=E7=9A=84=E8=A6=96=E9=A0=BB=E6=92=AD=E6=94=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.hbuilderx/launch.json | 4 +-
api/video/index.js | 90 ++++++++++++----------
components/my-video-list/my-video-list.vue | 68 +++++++++-------
manifest.json | 4 +-
pages.json | 12 ++-
pages/index/index.vue | 12 +--
pages/me/index.vue | 2 +-
pages/task/index.vue | 24 +++---
pages/video/detail.nvue | 50 ++++++++++--
store/common.js | 33 +++++---
10 files changed, 189 insertions(+), 110 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 15f1188..a814c8a 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -2,11 +2,11 @@
"version" : "1.0",
"configurations" : [
{
- "playground" : "custom",
+ "playground" : "standard",
"type" : "uni-app:app-android"
},
{
- "playground" : "standard",
+ "playground" : "custom",
"type" : "uni-app:app-ios"
}
]
diff --git a/api/video/index.js b/api/video/index.js
index 4031e69..01890cf 100644
--- a/api/video/index.js
+++ b/api/video/index.js
@@ -3,17 +3,24 @@ import http from '@/http/http.js'
//获取短剧视频详情
export function getVideoDetail(data) {
return http.request({
- url: 'course/courseSets?courseId='+data.courseId,
- data
+ url: 'course/courseSets',
+ data: data
})
}
+
+
+
+
+
+
+
//追剧
export function zhuiju(data) {
return http.request({
url: 'courseCollect/insertCourseCollect',
- method:'POST',
- data:{
- classify:1,
+ method: 'POST',
+ data: {
+ classify: 1,
...data
}
})
@@ -23,9 +30,9 @@ export function zhuiju(data) {
export function dianzan(data) {
return http.request({
url: 'courseCollect/insertCourseCollect',
- method:'POST',
- data:{
- classify:2,
+ method: 'POST',
+ data: {
+ classify: 2,
...data
}
})
@@ -33,13 +40,13 @@ export function dianzan(data) {
//插入播放历史记录
-export function insertHistory(data){
+export function insertHistory(data) {
return http.request({
url: 'courseCollect/insertCourseCollect',
- method:'POST',
- data:{
- classify:3,
- type:1,
+ method: 'POST',
+ data: {
+ classify: 3,
+ type: 1,
...data
}
})
@@ -54,12 +61,12 @@ export function getJinbiBili(data) {
}
//获取推荐视频
-export function tuijianVideo(data){
- const randomNum=10+ Math.ceil(Math.random()*20)
+export function tuijianVideo(data) {
+ const randomNum = 10 + Math.ceil(Math.random() * 20)
return http.request({
url: 'course/selectCourseDetailsList',
- method:'GET',
- data:{
+ method: 'GET',
+ data: {
page: 1,
limit: 10,
randomNum: randomNum
@@ -67,64 +74,67 @@ export function tuijianVideo(data){
})
}
//解锁10集视频
-export function buyTenVideo(data){
+export function buyTenVideo(data) {
return http.request({
url: 'order/insertCourseOrders/limit10',
- method:'GET',
- data:data
+ method: 'GET',
+ data: data
})
}
//解锁单集或者全部视频
-export function buyVideo(data){
+export function buyVideo(data) {
return http.request({
url: 'order/insertCourseOrders',
- method:'GET',
- data:data
+ method: 'GET',
+ data: data
})
}
//订单支付
-export function payOrder(data){
- let payType='h5'
+export function payOrder(data) {
+ let payType = 'h5'
// #ifdef APP
- payType='app'
+ payType = 'app'
// #endif
return http.request({
- url: 'wuyou/payOrder/'+data.orderId+'?payType='+payType,
- method:'GET'
+ url: 'wuyou/payOrder/' + data.orderId + '?payType=' + payType,
+ method: 'GET'
})
}
//获取订单支付状态
-export function getOrderInfo(data){
+export function getOrderInfo(data) {
return http.request({
- url: 'wuyou/queryOrder/'+data.orderId,
- method:'GET'
+ url: 'wuyou/queryOrder/' + data.orderId,
+ method: 'GET'
})
}
//金币解锁
-export function goldPay(data){
+export function goldPay(data) {
return http.request({
url: 'order/payOrders',
- method:'POST',
- data:{...data,header:{
- 'content-type':'application/x-www-form-urlencoded'
- }}
+ method: 'POST',
+ data: {
+ ...data,
+ header: {
+ 'content-type': 'application/x-www-form-urlencoded'
+ }
+ }
})
}
//获取转盘抽奖次数
-export function getDrawCount(data){
+export function getDrawCount(data) {
return http.request({
url: 'discSpinning/drawCount',
- method:'GET',
+ method: 'GET',
data
})
}
//播放开始或者结束
-export function playStatus(data){
+export function playStatus(data) {
return http.request({
url: 'course/viewCourse',
- method:'GET',
+ method: 'GET',
data
})
}
\ No newline at end of file
diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue
index 03d5354..c1a2423 100644
--- a/components/my-video-list/my-video-list.vue
+++ b/components/my-video-list/my-video-list.vue
@@ -5,13 +5,12 @@
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
-
+
@@ -23,13 +22,12 @@
|
+ @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(item,index)"
+ @dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
+ @popupShow="popupShow($event,item,index)">
|
@@ -102,6 +100,8 @@
+
+
@@ -166,7 +166,6 @@
getElRect
} from '@/utils/util.js'
const $common = useCommonStore()
-
// #ifdef APP
const domModule = uni.requireNativePlugin('dom')
// #endif
@@ -190,6 +189,9 @@
onMounted,
getCurrentInstance
} from 'vue';
+ import {
+ onShow
+ } from '@dcloudio/uni-app'
let initing = true
const refPoster = ref(null)
@@ -237,7 +239,10 @@
// #ifdef APP
control.showControls = false
// #endif
-
+ let isExamine = ref()
+ onShow(() => {
+ $common.init()
+ })
const customStyle = computed(() => {
// #ifdef H5
return {
@@ -543,7 +548,7 @@
}
function popupShow(key = 'show', item, index) {
- console.log(item);
+ console.log(key, item, 'debug');
if (key == 'show') {
// #ifdef H5
nextTick(() => {
@@ -560,6 +565,8 @@
popup.data = item
popup.index = index
}
+
+
}
@@ -707,11 +714,13 @@
const insertHistory = debounce(() => {
- const item = videoList.value[current.value]
- Api.insertHistory({
- courseId: item.courseId,
- courseDetailsId: item.courseDetailsId
- })
+ if (uni.getStorageSync("token")) {
+ const item = videoList.value[current.value]
+ Api.insertHistory({
+ courseId: item.courseId,
+ courseDetailsId: item.courseDetailsId
+ })
+ }
}, 1000)
function swiperChange(e) {
@@ -723,8 +732,10 @@
setVideoList(item)
}
-
+ const refPopup=ref(null)
function setVideoList(item) {
+
+
const listLen = props.list.length
const lastIndex = listLen - 1
const index = props.list.findIndex(v => v.courseDetailsId == item.courseDetailsId)
@@ -764,9 +775,10 @@
videoList.value = [props.list[index + 1], props.list[index - 1], item]
}
}
- console.log(videoList.value);
+ console.log(videoList.value, 'debug');
if (!item.videoUrl) {
- popupShow('pay', item, index)
+ popupShow('pay', item, index)
+
}
}
@@ -822,10 +834,10 @@
* @param {type} = [start,end]
*/
const playStatusChange = debounce((data) => {
- Api.playStatus(data)
+ Api.playStatus(data)
}, 2000)
-
-
+
+
defineExpose({
videoListUpdata
diff --git a/manifest.json b/manifest.json
index c19901b..f37f9f7 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "duanju-app-v3",
"appid" : "__UNI__E0B05B1",
"description" : "",
- "versionName" : "1.0.0",
- "versionCode" : 100,
+ "versionName" : "2.3.4",
+ "versionCode" : 234,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
diff --git a/pages.json b/pages.json
index f0e3d7f..24fca79 100644
--- a/pages.json
+++ b/pages.json
@@ -254,5 +254,15 @@
}
]
},
- "uniIdRouter": {}
+ "uniIdRouter": {},
+ "condition" : { //模式配置,仅开发期间生效
+ "current": 0, //当前激活的模式(list 的索引项)
+ "list": [
+ {
+ "name": "", //模式名称
+ "path": "", //启动页面,必选
+ "query": "" //启动参数,在页面的onLoad函数里面得到
+ }
+ ]
+ }
}
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a344540..8f62358 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -10,7 +10,7 @@
-->
-
+
公告
@@ -42,7 +42,7 @@
-
-
@@ -94,8 +94,10 @@
} from '@/store/common.js'
const $common = useCommonStore()
onShow(()=>{
+ console.log('cash:'+uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),'debug')
// 判断ios是否审核
$common.init()
+ $common.setversion()
})
let datas = reactive({
noticeList: [], //公告列表
@@ -123,7 +125,7 @@
versionUpdate()
getMsg()
getrecomVideo()
- datas.isExamine = $common.isExamine || 0
+ datas.isExamine = $common.isIosExamine || 0
})
onReady(() => {
if(!uni.getStorageSync('ruleShow')){
@@ -158,8 +160,8 @@
}
if (uni.getSystemInfoSync().platform == 'ios') {
version = res.iosVersion
+ $common.setversion(widgetInfo.version,version)
}
- console.log(widgetInfo.version + '---' + version)
version = res.version
// && uni.getSystemInfoSync().platform == 'android'
if (widgetInfo.version < version) {
diff --git a/pages/me/index.vue b/pages/me/index.vue
index 952d302..85a3673 100644
--- a/pages/me/index.vue
+++ b/pages/me/index.vue
@@ -31,7 +31,7 @@
我的追剧
{{ likeData.collectCount }}
-
+
我的红包
{{ amount || 0 }}
diff --git a/pages/task/index.vue b/pages/task/index.vue
index aae4fb2..c5726e5 100644
--- a/pages/task/index.vue
+++ b/pages/task/index.vue
@@ -42,19 +42,17 @@
{{ item.detail }}
-
- {{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : (
- item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}
+
+ {{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}
-
- {{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}`
- : (item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}
-
- {{ item.buttonUnderContent }}
-
+
+ {{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}
+
+
+ {{ item.buttonUnderContent}}
@@ -414,7 +412,7 @@
async function getTaskdata() {
let res = await selectTaskCenter()
let arrData = []
- if (!$common.isIosExamine()) {
+ if (!$common.isIosExamine) {
res.forEach(ele => {
if (ele.title.indexOf('分享奖励') == -1 && ele.title.indexOf('新人福利') == -1 &&
ele.title.indexOf('观看视频奖励') == -1) {
diff --git a/pages/video/detail.nvue b/pages/video/detail.nvue
index 8e55400..3f2a29b 100644
--- a/pages/video/detail.nvue
+++ b/pages/video/detail.nvue
@@ -1,17 +1,24 @@
+ :options="options" @update="update" :info="state">
diff --git a/store/common.js b/store/common.js
index 4287913..4526240 100644
--- a/store/common.js
+++ b/store/common.js
@@ -38,7 +38,6 @@ const $map = {
922: 'withdrawNum',
500: 'payTips',
914: 'goldBili', // 金币比例
- 919: 'isExamine' //是否ios审核中
}
export const useCommonStore = defineStore("common", {
@@ -46,15 +45,15 @@ export const useCommonStore = defineStore("common", {
return {
payTips: '付款完成后不要忘记抽红包哦',
goldBili: 0,
- sysInfo:{},
- isIos:false,
- isExamine:1
+ sysInfo: {},
+ isIos: false,
+ isExamines: 0
};
},
actions: {
async init() {
- this.sysInfo=uni.getSystemInfoSync()
- this.isIos=this.sysInfo.platform == 'ios'
+ this.sysInfo = uni.getSystemInfoSync()
+ this.isIos = this.sysInfo.platform == 'ios'
const res = await getCommonConfig()
if (res) {
for (let i in $map) {
@@ -63,19 +62,31 @@ export const useCommonStore = defineStore("common", {
this[key] = res[i]
uni.setStorageSync(key, res[i])
}
- }
+ }
}
},
- isIosExamine() {
+ setversion(a, b) {
+ // a是當前應用的版本號 b是接口拿的
+ let appversion = (a.split('.').join('')) * 1
+ let resversion = (b.split('.').join('')) * 1
+ console.log('當前版本-' + appversion, '接口版本-' + resversion, '返回-' + this.isIosExamine,'判斷值-'+this.isExamines)
+ if (appversion > resversion) {
+ // 再審核
+ this.isExamines = 1
+ }
+ }
+
+ },
+ getters: {
+ isIosExamine: function() {
if (!this.isIos) {
return true
- }
- if (this.isExamine == 1) {
+ }
+ if (this.isExamines == 1) {
return false
}
return true
}
},
-
unistorage: true, // 开启后对 state 的数据读写都将持久化
});
\ No newline at end of file