diff --git a/app.json b/app.json
index f7fcbde..4a9a9c6 100644
--- a/app.json
+++ b/app.json
@@ -22,8 +22,8 @@
"color": "#999999",
"selectedColor": "#5BBE04",
"backgroundColor": "#000000",
- "list": [
- {
+ "custom": false,
+ "list": [{
"pagePath": "pages/home/home",
"iconPath": "/static/tab/home.png",
"selectedIconPath": "/static/tab/home_selected.png",
diff --git a/app.ts b/app.ts
index 88b8ad8..bfb8fac 100644
--- a/app.ts
+++ b/app.ts
@@ -6,7 +6,8 @@ App({
equipmentInfo: {}
},
globalData: {
- loginPromise: null
+ loginPromise: null,
+ statusBarHeight: 0
},
onLaunch() {
const loginPromise: any = new Promise((resolve: any) => {
@@ -27,5 +28,7 @@ App({
});
})
this.globalData.loginPromise = loginPromise;
+ const { screenHeight, safeArea } = tt.getSystemInfoSync();
+ this.globalData.statusBarHeight = screenHeight - safeArea.bottom;
}
})
diff --git a/components/commTabs/commTabs.json b/components/commTabs/commTabs.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/commTabs/commTabs.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/commTabs/commTabs.ts b/components/commTabs/commTabs.ts
new file mode 100644
index 0000000..dee6d80
--- /dev/null
+++ b/components/commTabs/commTabs.ts
@@ -0,0 +1,49 @@
+// e:\project\dy_video_all\dy_iaa_new_project\components\commTabs\commTabs.ts
+Component({
+ data: {
+ list: [{
+ "pagePath": "/pages/home/home",
+ "iconPath": "/static/tab2/home.png",
+ "selectedIconPath": "/static/tab2/home_selected.png",
+ "text": "首页"
+ },
+ {
+ "pagePath": "/pages/recommend/recommend",
+ "iconPath": "/static/tab2/recommend.png",
+ "selectedIconPath": "/static/tab2/recommend_selected.png",
+ "text": "推荐"
+ },
+ {
+ "pagePath": "/pages/theater/theater",
+ "iconPath": "/static/tab2/theater.png",
+ "selectedIconPath": "/static/tab2/theater_selected.png",
+ "text": "剧场"
+ },
+ {
+ "pagePath": "/pages/my/my",
+ "iconPath": "/static/tab2/my.png",
+ "selectedIconPath": "/static/tab2/my_selected.png",
+ "text": "我的"
+ }
+ ],
+ statusBarHeight: getApp().globalData.statusBarHeight
+ },
+ properties: {
+ selectedIndex: {
+ type: Number,
+ value: 0
+ }
+ },
+ methods: {
+ toPathTabs(ev: any) {
+ const item = ev.currentTarget.dataset.item;
+ console.log(item, "itemitem")
+ tt.switchTab({
+ url: item.pagePath,
+ fail: (faa) => {
+ console.log(faa, "faafaafaa")
+ }
+ });
+ }
+ }
+})
\ No newline at end of file
diff --git a/components/commTabs/commTabs.ttml b/components/commTabs/commTabs.ttml
new file mode 100644
index 0000000..8e038d5
--- /dev/null
+++ b/components/commTabs/commTabs.ttml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/commTabs/commTabs.ttss b/components/commTabs/commTabs.ttss
new file mode 100644
index 0000000..b8013f3
--- /dev/null
+++ b/components/commTabs/commTabs.ttss
@@ -0,0 +1,54 @@
+/* e:\project\dy_video_all\dy_iaa_new_project\components\commTabs\commTabs.ttss */
+
+._com_tabs_html {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ background-color: #000000;
+ z-index: 99999;
+}
+
+._com_tabs_con {
+ width: 100%;
+ height: 98rpx;
+ background-color: #000000;
+}
+
+._com_tabs_list {
+ display: flex;
+ justify-content: space-around;
+}
+
+._com_tabs_li_item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding-top: 14rpx;
+ cursor: pointer;
+}
+
+._com_tabs_li_i_icon {
+ width: 40rpx;
+ height: 40rpx;
+}
+
+._com_tabs_li_i_icon ._ooo_img {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+
+._com_tabs_li_i_name {
+ display: flex;
+ margin-top: 4rpx;
+}
+
+._com_tabs_li_i_na_text {
+ color: #999999;
+ font-size: 16rpx;
+}
+
+._com_tabs_selected ._com_tabs_li_i_na_text{
+ color: #5BBE04;
+}
\ No newline at end of file
diff --git a/pages/consumption/consumption.ts b/pages/consumption/consumption.ts
index c76dad5..dbe944c 100644
--- a/pages/consumption/consumption.ts
+++ b/pages/consumption/consumption.ts
@@ -25,8 +25,9 @@ Page({
},
toPathVideo(ev: any) {
const sid = ev.currentTarget.dataset.sid;
+ const id = ev.currentTarget.dataset.id;
tt.navigateTo({
- url: `/pages/videoDetail/videoDetail?sid=${sid}`,
+ url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${id}`,
});
},
})
\ No newline at end of file
diff --git a/pages/consumption/consumption.ttml b/pages/consumption/consumption.ttml
index c895e85..d4ae996 100644
--- a/pages/consumption/consumption.ttml
+++ b/pages/consumption/consumption.ttml
@@ -3,28 +3,29 @@
-
+
-
+
- 这是么么么么么么么么这是么么么么么么么么
+ {{item.name}}
- 2024-05-17 16:34:36
+ {{item.create_time}}
- 这是么么么么么么么么这是么么么么么么么么
+ 话费{{item.price}}K币购买{{item.chaptername}}
-
+
继续观看
diff --git a/pages/home/home.json b/pages/home/home.json
index d2c59f1..c2b07b4 100644
--- a/pages/home/home.json
+++ b/pages/home/home.json
@@ -1,6 +1,7 @@
{
"usingComponents": {
- "my-modal": "/components/myModal/myModal"
+ "my-modal": "/components/myModal/myModal",
+ "comm-tabs": "/components/commTabs/commTabs"
},
"navigationBarTitleText": "首页"
}
\ No newline at end of file
diff --git a/pages/home/home.ttml b/pages/home/home.ttml
index a3cb158..0c009a9 100644
--- a/pages/home/home.ttml
+++ b/pages/home/home.ttml
@@ -6,12 +6,14 @@
+ bindchange="handelSwiperChange" autoplay="{{false}}" interval="{{2000}}">
-
-
-
+
+
+
+
+
播放
@@ -27,7 +29,7 @@
@@ -36,6 +38,9 @@
+
+ {{item.name}}
+
@@ -43,7 +48,7 @@
@@ -76,7 +81,7 @@
@@ -108,7 +113,7 @@
@@ -145,13 +150,13 @@
-
-
+
+
@@ -208,4 +213,6 @@
+
+
\ No newline at end of file
diff --git a/pages/home/home.ttss b/pages/home/home.ttss
index 25e1c52..537e5ab 100644
--- a/pages/home/home.ttss
+++ b/pages/home/home.ttss
@@ -5,6 +5,7 @@ page {
}
._home_html {
+ /* padding-bottom: 166rpx; */
padding-bottom: 80rpx;
}
@@ -30,12 +31,19 @@ page {
}
._home_swi_item {
+ position: relative;
padding: 76rpx 20rpx;
box-sizing: border-box;
border-radius: 12rpx;
overflow: hidden;
}
+._home_swi_it_ppp {
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+
._home_swi_it_warp {
position: relative;
width: 100%;
@@ -132,7 +140,6 @@ page {
._mo_1__li_warp {
width: 33.333%;
- height: 304rpx;
padding-right: 16rpx;
box-sizing: border-box;
margin-bottom: 32rpx;
@@ -140,7 +147,7 @@ page {
._mo_1__li_wa_item {
width: 100%;
- height: 100%;
+ height: 304rpx;
}
._mo_1__li_wa_item .__wa_img {
diff --git a/pages/leaderboard/leaderboard.ts b/pages/leaderboard/leaderboard.ts
index 571f328..59904ab 100644
--- a/pages/leaderboard/leaderboard.ts
+++ b/pages/leaderboard/leaderboard.ts
@@ -2,7 +2,10 @@
import { httpRequest } from "../../utils/httpReques";
Page({
data: {
- module2: []
+ module2: [],
+ searchList: [],
+ searchFlag: false,
+ searchValue: ''
},
onLoad: function (options) {
@@ -23,4 +26,29 @@ Page({
url: `/pages/videoDetail/videoDetail?sid=${sid}`,
});
},
+ handelSearchInput(ev: any) {
+ const val = ev.detail.value;
+ this.setData({
+ searchValue: val,
+ })
+ },
+ searchVideo() {
+ const searchValue = this.data.searchValue;
+ if (!searchValue) {
+ tt.showToast({
+ title: '搜索内容不能为空',
+ icon: 'none',
+ });
+ return;
+ }
+ httpRequest('/find', 'POST', { keyword: searchValue }).then((reults: any) => {
+ tt.hideLoading({});
+ if (reults.status == 1 && Array.isArray(reults.data)) {
+ this.setData({
+ searchList: reults.data,
+ searchFlag: true
+ })
+ }
+ })
+ }
})
\ No newline at end of file
diff --git a/pages/leaderboard/leaderboard.ttml b/pages/leaderboard/leaderboard.ttml
index 30d9c8c..bcf4a31 100644
--- a/pages/leaderboard/leaderboard.ttml
+++ b/pages/leaderboard/leaderboard.ttml
@@ -7,7 +7,7 @@
-
+
搜索
@@ -19,12 +19,12 @@
-
+
diff --git a/pages/my/my.json b/pages/my/my.json
index 6a6d9c3..82d3c9c 100644
--- a/pages/my/my.json
+++ b/pages/my/my.json
@@ -1,6 +1,10 @@
{
"usingComponents": {
- "my-modal": "/components/myModal/myModal"
+ "my-modal": "/components/myModal/myModal",
+ "comm-tabs": "/components/commTabs/commTabs"
+ },
+ "componentPlaceholder": {
+ "comm-tabs-view": "comm-tabs"
},
"navigationBarTitleText": "我的"
}
\ No newline at end of file
diff --git a/pages/my/my.ttml b/pages/my/my.ttml
index 9de93fa..fee92e8 100644
--- a/pages/my/my.ttml
+++ b/pages/my/my.ttml
@@ -8,9 +8,9 @@
-
+
@@ -109,7 +109,7 @@
-
@@ -155,6 +155,21 @@
+
+
+
+
+
+
+ 购买记录
+
+
+
+
+
+
+
+
-
+
diff --git a/pages/pay/pay.ttss b/pages/pay/pay.ttss
index 9e5a9df..5c8763b 100644
--- a/pages/pay/pay.ttss
+++ b/pages/pay/pay.ttss
@@ -24,7 +24,7 @@
._pay_b_buy {
display: flex;
justify-content: flex-end;
- padding: 42rpx 32rpx;
+ padding: 66rpx 32rpx;
}
._pay_b_bu_btn {
diff --git a/pages/rechargeRecord/rechargeRecord.ts b/pages/rechargeRecord/rechargeRecord.ts
index 3dbeb3b..b0a6f67 100644
--- a/pages/rechargeRecord/rechargeRecord.ts
+++ b/pages/rechargeRecord/rechargeRecord.ts
@@ -10,10 +10,11 @@ Page({
},
onShow() {
- this.getRechargerecord()
+ this.getRechargerecord(2)
},
- getRechargerecord() {
- httpRequest('/rechargerecord', 'POST').then((res: any) => {
+ getRechargerecord(type: any) {
+ // 1 书币 2vip
+ httpRequest('/rechargerecord', 'POST', { type: type }).then((res: any) => {
if (res.status == 1 && Array.isArray(res.data)) {
this.setData({
recordList: res.data,
@@ -24,9 +25,7 @@ Page({
},
handelTabCh(ev: any) {
const idx = ev.currentTarget.dataset.idx;
- if (idx == 1) {
- this.getRechargerecord();
- }
+ this.getRechargerecord(idx == 1 ? 2 : 1);
this.setData({
tabIndex: idx
})
diff --git a/pages/rechargeRecord/rechargeRecord.ttml b/pages/rechargeRecord/rechargeRecord.ttml
index a061dec..ebfe5d5 100644
--- a/pages/rechargeRecord/rechargeRecord.ttml
+++ b/pages/rechargeRecord/rechargeRecord.ttml
@@ -16,34 +16,36 @@
-
-
-
-
-
-
- 购买购买
-
-
- 2024-05-17 55555555
-
+
+
+
diff --git a/pages/recommend/recommend.json b/pages/recommend/recommend.json
index b629a88..2700a5a 100644
--- a/pages/recommend/recommend.json
+++ b/pages/recommend/recommend.json
@@ -1,6 +1,7 @@
{
"usingComponents": {
- "video-player": "ext://industry/video-player"
+ "video-player": "ext://industry/video-player",
+ "comm-tabs": "/components/commTabs/commTabs"
},
"navigationBarTitleText": "剧场"
}
\ No newline at end of file
diff --git a/pages/recommend/recommend.ts b/pages/recommend/recommend.ts
index 71c0fc0..baaeac4 100644
--- a/pages/recommend/recommend.ts
+++ b/pages/recommend/recommend.ts
@@ -10,7 +10,8 @@ Page({
videoPlayerCurrent: 0,
videoPlayernum: 4,
videoErrorText: '',
- page: 1
+ page: 1,
+ statusBarHeight: getApp().globalData.statusBarHeight
},
onLoad() {
const videoCanIUse = tt.canIUse('video-player');
@@ -144,18 +145,18 @@ Page({
})
},
- toPathVideoDetail() {
- console.log("toPathVideoDetail")
+ toPathVideo(ev: any) {
+ const sid = ev.currentTarget.dataset.sid;
tt.navigateTo({
- url: `/pages/videoDetail/videoDetail`,
+ url: `/pages/videoDetail/videoDetail?sid=${sid}`,
});
},
handelCollection(ev: any) {
- console.log(ev, "kkkkkkkkkkkk")
const id = ev.currentTarget.dataset.id;
let batchList: any = this.data.batchList;
const idx = batchList.findIndex((m: any) => m.id == id);
const bookcase = batchList[idx].bookcase;
+ const count = batchList[idx].bookcase;
batchList[idx].bookcase = bookcase == 1 ? 0 : 1;
if (bookcase) {
const params = {
@@ -163,6 +164,7 @@ Page({
}
httpRequest('/chasingdramadel', 'POST', params).then((res: any) => {
if (res.status == 1) {
+ batchList[idx].count = this.handelCount(count - 1)
this.setData({
batchList: batchList
})
@@ -178,6 +180,7 @@ Page({
}
httpRequest('/addkeep', 'POST', params).then((res: any) => {
if (res.status == 1) {
+ batchList[idx].count = this.handelCount(count + 1)
this.setData({
batchList: batchList
})
diff --git a/pages/recommend/recommend.ttml b/pages/recommend/recommend.ttml
index 8da48be..e235fa6 100644
--- a/pages/recommend/recommend.ttml
+++ b/pages/recommend/recommend.ttml
@@ -1,4 +1,5 @@
-
+
+
@@ -68,7 +69,7 @@
-->
-
+
进入观看
@@ -90,9 +91,9 @@
-
+
+ 分享
+
@@ -115,4 +116,5 @@
+
\ No newline at end of file
diff --git a/pages/recommend/recommend.ttss b/pages/recommend/recommend.ttss
index 09190be..a549283 100644
--- a/pages/recommend/recommend.ttss
+++ b/pages/recommend/recommend.ttss
@@ -179,4 +179,4 @@
._m_vv_oper_l_share::after {
content: none;
-}
\ No newline at end of file
+}
diff --git a/pages/search/search.ts b/pages/search/search.ts
index cdedabe..f08117a 100644
--- a/pages/search/search.ts
+++ b/pages/search/search.ts
@@ -29,6 +29,7 @@ Page({
if (!searchValue) {
tt.showToast({
title: '搜索剧名不能为空',
+ icon: 'none',
});
return;
}
@@ -80,5 +81,11 @@ Page({
tt.showToast({
title: '清空搜索历史成功',
});
- }
+ },
+ toPathVideo(ev: any) {
+ const sid = ev.currentTarget.dataset.sid;
+ tt.navigateTo({
+ url: `/pages/videoDetail/videoDetail?sid=${sid}`,
+ });
+ },
})
\ No newline at end of file
diff --git a/pages/search/search.ttml b/pages/search/search.ttml
index ca9fa87..0647c84 100644
--- a/pages/search/search.ttml
+++ b/pages/search/search.ttml
@@ -35,7 +35,7 @@
-
+
diff --git a/pages/theater/theater.json b/pages/theater/theater.json
index 3928faa..bf6acf2 100644
--- a/pages/theater/theater.json
+++ b/pages/theater/theater.json
@@ -1,3 +1,5 @@
{
- "usingComponents": {}
+ "usingComponents": {
+ "comm-tabs": "/components/commTabs/commTabs"
+ }
}
\ No newline at end of file
diff --git a/pages/theater/theater.ttml b/pages/theater/theater.ttml
index 2f433f3..a4d0bc2 100644
--- a/pages/theater/theater.ttml
+++ b/pages/theater/theater.ttml
@@ -116,5 +116,5 @@
-
+
\ No newline at end of file
diff --git a/pages/theater/theater.ttss b/pages/theater/theater.ttss
index 68d76f3..f71a95d 100644
--- a/pages/theater/theater.ttss
+++ b/pages/theater/theater.ttss
@@ -3,6 +3,7 @@ page {
}
._theater_html {
+ /* padding-bottom: 186rpx; */
padding-bottom: 80rpx;
}
diff --git a/pages/videoDetail/videoDetail.ts b/pages/videoDetail/videoDetail.ts
index 0afebcb..c29eafd 100644
--- a/pages/videoDetail/videoDetail.ts
+++ b/pages/videoDetail/videoDetail.ts
@@ -12,38 +12,42 @@ Page({
videoErrorText: '',
safeAreaBottom: 0,
platform: '',
- anthologyFlag: false
+ anthologyFlag: false,
+ toOptions: {},
+ sid: "",
+ selectionTabs: [],
+ selectionConList: [],
+ roderCurrent: 0,
+ collectionItem: {},
+ nextbatchList: []
},
- onLoad: function (options: any) {
+ onLoad(options: any) {
const videoCanIUse = tt.canIUse('video-player');
- this.setData({
- videoCanIUse,
- })
- this.initFn();
+ console.log(options, "options")
tt.getSystemInfo({
success: (res: any) => {
- console.log(res, "------------")
- const screenHeight = res.screenHeight;
- const statusBarHeight = res.statusBarHeight;
- const safeAreaHeight = res.safeArea.height;
- const safeAreaBottom = screenHeight - statusBarHeight - safeAreaHeight;
- console.log(safeAreaBottom, "safeAreaBottom")
this.setData({
- safeAreaBottom,
- platform: res.platform
+ platform: res.platform,
+ videoCanIUse,
+ toOptions: options,
+ sid: options?.sid || ''
})
}
})
},
- onShow() { },
+ onShow() {
+ this.initFn();
+ },
async initFn() {
+
+ const sid = this.data.sid;
+ const options = this.data.toOptions;
+ console.log(options, "initFninitFninitFn")
const params = {
- "uid": 127457025,
- "platform": "devtools",
- "is_b": 2,
- "sid": "2"
+ ...options,
+ sid: sid
}
const videoreadRes: any = await httpRequest('/videoread', 'POST', params);
@@ -57,14 +61,32 @@ Page({
if (batchlistRes.status == 1 && Array.isArray(batchlistRes.data)) {
batchList = batchlistRes.data;
}
+ const ol = this.getAnthology(batchList);
+
+ let nextbatchList = [];
+ const nextbatchRes: any = await httpRequest('/nextbatch', 'POST', params);
+ if (nextbatchRes.status == 1 && Array.isArray(nextbatchRes.data)) {
+ nextbatchList = nextbatchRes.data;
+ }
this.setData({
batchList,
- videoInfo
+ videoInfo: {
+ ...videoInfo,
+ isCount: this.handelCount(videoInfo.count)
+ },
+ videoPlayerCurrent: videoInfo?.order - 1,
+ selectionTabs: ol.tabList,
+ selectionConList: ol.orderDataList,
+ nextbatchList,
})
+ // 第${videoInfo?.order}集
+ tt.setNavigationBarTitle({
+ title: `${videoInfo.title}`,
+ });
},
- handelSeiperChange(ev: any) {
+ async handelSeiperChange(ev: any) {
const current = ev.detail.current;
const videoPlayerCurrent = this.data.videoPlayerCurrent;
const batchList: any = this.data.batchList;
@@ -73,40 +95,70 @@ Page({
const context: any = tt.createVideoContext(`${id}`);
const nextContext: any = tt.createVideoContext(`${nextId}`);
- context?.pause?.();
- nextContext?.play?.();
+ // const collectionItem: any = this.data.collectionItem;
+ const sid = this.data.sid;
+ const videoInfo = this.data.videoInfo;
+ const collectionItem = batchList[current]
+ const params = {
+ sid: sid,
+ id: collectionItem?.id
+ }
+ const videoreadRes: any = await httpRequest('/videoread', 'POST', params);
+ let newVideoInfo: any = {}
+ if (videoreadRes.status == 1 && Array.isArray(videoreadRes.data)) {
+ newVideoInfo = videoreadRes.data[0];
+ }
- this.selectComponent(`#${nextId}`, (res: any) => {
- console.log(res, "resres")
- res?.hidePauseIcon()
- });
+ context?.pause?.();
+ if (newVideoInfo.chackpay == 1) {
+ nextContext?.play?.();
+ }
+
+ // this.selectComponent(`#${nextId}`, (res: any) => {
+ // res?.hidePauseIcon()
+ // });
this.setData({
+ videoInfo: {
+ ...videoInfo,
+ ...newVideoInfo,
+ },
videoPlayerCurrent: current,
+ anthologyFlag: false,
+ collectionItem: collectionItem,
+ videoErrorText: ''
})
},
videoPlayerEnded() {
- console.log('videoPlayerEnded')
const videoPlayerCurrent = this.data.videoPlayerCurrent;
+ const batchList = this.data.batchList;
+ console.log(videoPlayerCurrent + 2, batchList.length)
+ // if (videoPlayerCurrent + 1 <= batchList.length) {
+ // const videoreadRes: any = await httpRequest('/videoread', 'POST', params);
this.setData({
videoPlayerCurrent: videoPlayerCurrent + 1,
- videoErrorText: ''
+ videoErrorText: '',
+ // collectionItem
})
+ // }
+
},
videError(ev: any) {
const errMsg = ev.detail.errMsg;
let errMsgText = '';
if (errMsg == 'Video is forbidden in playlet,please use video-player instead') {
- errMsgText = '抱歉,当前抖音版本过低,请升级抖音'
- } else {
- errMsgText = errMsg;
+ errMsgText = '抱歉,当前抖音版本过低,请升级抖音';
+ this.setData({
+ videoErrorText: errMsgText
+ })
}
- this.setData({
- videoErrorText: errMsgText
- })
+ // else {
+ // errMsgText = errMsg;
+ // }
+
},
videPlayerError(ev: any) {
@@ -114,24 +166,24 @@ Page({
const errMsg = ev.detail.errMsg;
let errMsgText = '';
if (errMsg == 'Video is forbidden in playlet,please use video-player instead') {
- errMsgText = '抱歉,当前抖音版本过低,请升级抖音'
- } else {
- errMsgText = errMsg;
+ errMsgText = '抱歉,当前抖音版本过低,请升级抖音';
+ this.setData({
+ videoErrorText: errMsgText
+ })
}
- this.setData({
- videoErrorText: errMsgText
- })
+ // else {
+ // errMsgText = errMsg;
+ // }
+
},
- toPathVideoDetail() {
- tt.navigateTo({
- url: `pages/videoDetail/videoDetail`,
- });
- },
+ // toPathVideoDetail() {
+ // tt.navigateTo({
+ // url: `pages/videoDetail/videoDetail`,
+ // });
+ // },
anthologyTap() {
- console.log('anthologyTap')
-
this.setData({
anthologyFlag: true
})
@@ -141,5 +193,153 @@ Page({
this.setData({
anthologyFlag: false
})
+ },
+ handelCollection(ev: any) {
+ const id = ev.currentTarget.dataset.id;
+ const videoInfo: any = this.data.videoInfo
+ const bookcase = videoInfo.bookcase;
+ const count = videoInfo.count;
+ console.log(bookcase, "bookcasebookcase")
+ if (bookcase) {
+ const params = {
+ ids: id
+ }
+ httpRequest('/chasingdramadel', 'POST', params).then((res: any) => {
+ if (res.status == 1) {
+ this.setData({
+ videoInfo: {
+ ...videoInfo,
+ bookcase: bookcase == 1 ? 0 : 1,
+ count: count - 1,
+ isCount: this.handelCount(count - 1)
+ }
+ })
+ tt.showToast({
+ title: '取消成功',
+ icon: 'none'
+ });
+ }
+ })
+ } else {
+ const params = {
+ sid: id
+ }
+ httpRequest('/addkeep', 'POST', params).then((res: any) => {
+ if (res.status == 1) {
+ this.setData({
+ videoInfo: {
+ ...videoInfo,
+ bookcase: bookcase == 1 ? 0 : 1,
+ count: count + 1,
+ isCount: this.handelCount(count + 1)
+ },
+ })
+ tt.showToast({
+ title: '收藏成功',
+ icon: 'none'
+ });
+ }
+ })
+
+ }
+
+ },
+ handelCount(count: any) {
+ if (count > 999) {
+ const isCount: any = (count / 100000).toFixed(2);
+ const ik = parseFloat(isCount) * 100
+ return `${ik}k`;
+ }
+ return count;
+ },
+ getAnthology(ls: any) {
+ const num = 30;
+ let remain = 0;
+ let temp: any = [];
+ const mlist: any = [];
+ const tabList: any = [];
+ if (Array.isArray(ls)) {
+ ls.forEach((m, idx) => {
+ if (num * remain + num < idx + 1) {
+ remain += 1;
+ temp = [];
+ }
+ m.idx = idx;
+ temp.push(m);
+ let obj = {
+ firstNum: num * remain + 1,
+ lastNum: idx + 1,
+ temp: [...temp],
+ };
+ let tObj = {
+ name: `${num * remain + 1}-${idx + 1}`,
+ };
+ mlist[remain] = obj;
+ tabList[remain] = tObj;
+ });
+ }
+ return {
+ orderDataList: mlist,
+ tabList: tabList
+ }
+ },
+ handelOrderTabs(ev: any) {
+ const idx = ev.currentTarget.dataset.idx;
+ this.setData({
+ roderCurrent: idx
+ })
+ },
+ handelSelection(ev: any) {
+ const collectionItem = ev.currentTarget.dataset.item;
+ const batchList: any = this.data.batchList;
+ if (collectionItem.idx != 0) {
+ const isvip = batchList[collectionItem.idx - 1]?.isvip
+ if (isvip) {
+ tt.showToast({
+ title: `为了保证剧情连贯,请按顺序观看`,
+ icon: 'none'
+ });
+ this.setData({
+ collectionItem
+ })
+ return;
+ }
+ }
+ this.setData({
+ videoPlayerCurrent: collectionItem.idx,
+ // collectionItem
+ })
+ },
+ toPathPay() {
+ const collectionItem: any = this.data.collectionItem;
+ const sid = this.data.sid;
+ console.log(collectionItem, "collectionItem")
+ tt.navigateTo({
+ url: `/pages/pay/pay?sid=${sid}&id=${collectionItem.id}&toStatus=1`,
+ });
+ },
+ watchAdvertisement() {
+
+ },
+ toPathVideoitself(ev: any) {
+ const sid = ev.currentTarget.dataset.sid;
+ this.setData({
+ sid: sid,
+ options: {
+ sid
+ }
+ })
+ this.initFn();
+ },
+ async handelReplace() {
+ let nextbatchList = [];
+ const nextbatchRes: any = await httpRequest('/nextbatch', 'POST');
+ if (nextbatchRes.status == 1 && Array.isArray(nextbatchRes.data)) {
+ nextbatchList = nextbatchRes.data;
+ }
+
+ this.setData({
+ nextbatchList
+ })
}
})
\ No newline at end of file
diff --git a/pages/videoDetail/videoDetail.ttml b/pages/videoDetail/videoDetail.ttml
index e881420..79807dc 100644
--- a/pages/videoDetail/videoDetail.ttml
+++ b/pages/videoDetail/videoDetail.ttml
@@ -2,19 +2,20 @@
+
-
+
+
-
+
@@ -70,16 +71,18 @@
-
-
-
-
+
+
+
+
+
+
+
+ 充值解锁
+
-
- 充值解锁
-
-
-
+
+
@@ -92,15 +95,20 @@
-
+
-
+
+
+
+
+
+
- 66K
+ {{videoInfo.isCount}}
-
+
@@ -108,67 +116,111 @@
选集
-
-
-
+
+
- {{videoInfo.title}}{{videoPlayerCurrent}}{{index}}--{{item.id}}
+
+ {{videoInfo.title}}
第{{videoInfo.order}}集
全剧{{100}}集
- 描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述
+ {{videoInfo.description}}
+
+
+
+
+
+
+
+
+ 本剧已结束
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+