diff --git a/components/charge/charge.js b/components/charge/charge.js
new file mode 100644
index 0000000..dc2ed3b
--- /dev/null
+++ b/components/charge/charge.js
@@ -0,0 +1,427 @@
+// import {
+// getVideoList
+// } from "../../api/common"
+
+import {httpRequest} from "../../utils/httpReques";
+
+const {
+ getPlayletManager
+} = tt;
+
+Component({
+ pm: undefined,
+ data: {
+ videoResult: {},
+ adType: '',
+ platform: '',
+ unlockAllFlag: false,
+ unlockAllKb: 0,
+ emitTimesCharge: 0,
+ egold: 0,
+ payList: [],
+ time: "",
+ action:0,
+ iosStatus: 0,
+ iosIm: '',
+ payLiClass: {
+ 1: "pay_li_class_1",
+ 2: "pay_li_class_2",
+ 4: "pay_li_class_4",
+ },
+ useBytePayment: true,//是否使用抖音支付组件
+ canIUsePaymentChannel: tt.canIUse('payment-channel-select'),
+ showPaymentChannelSelect: false,
+ dySkuList:[], //从接口获取的skulist
+ skuList:[],//传给支付组件的skulist
+ },
+ inject: ["chargeTap"],
+ observers: {
+ // 点击组件 A 的 button 后,触发该监听器的执行
+ chargeTap(val) {
+ this.setData({
+ emitTimesCharge: val
+ })
+ },
+ },
+ async ready() {
+ tt.getSystemInfo({
+ success: (res) => {
+ // console.log(res)
+ this.setData({
+ platform: res.platform,
+ })
+ }
+ })
+ console.log('payment-channel-select',this.data.canIUsePaymentChannel)
+ const pm = getPlayletManager(this);
+ this.pm = pm;
+ pm.onPlay(() => {
+ console.error('在charge中监听onPlay')
+ })
+
+ // //记录解锁信息
+ // const {
+ // playletPluginList
+ // } = await getVideoList();
+ // // console.log("playletPluginList",playletPluginList)
+ // for (let i = 0; i < playletPluginList.length; i++) {
+ // console.log(playletPluginList[i].ablum_id)
+ // console.log(this.data.tt_album_id)
+ // if (playletPluginList[i].ablum_id === this.properties.albumId) {
+ //
+ // this.setData({
+ // allUnlock: playletPluginList[i].allUnlock
+ // })
+ // }
+ // }
+ },
+ detached() {
+ console.log('charge关闭')
+ },
+ attached() {
+ this.getPayList()
+ const watchInfo = tt.getStorageSync('watchInfo')
+ this.setData({
+ videoResult: watchInfo
+ })
+ // console.log(this.data.videoResult)
+ },
+ methods: {
+ getPayList() {
+ httpRequest('/paysetting', 'post', {new_pay:1,is_unit:1}).then((res) => {
+ if (res.status == 1) {
+ this.setData({
+ egold: res?.data?.egold,
+ payList: res?.data?.list,
+ dySkuList: [...res?.data?.dy_config?.sku_list]
+ })
+ }
+ this.setCurrentItem()
+ // //支持且需要官方支付组件时
+ if(tt.canIUse('payment-channel-select')&&this.data.useBytePayment){
+ //设置面板
+ this.setSkuList(this.setCurrentItem());
+ //显示面板
+ this.setData({
+ showPaymentChannelSelect: true
+ })
+ // this.data.showPaymentChannelSelect = true;
+ }
+ // this.data.time = res?.data?.time;
+ this.setData({
+ time: res?.data?.time
+ })
+ const videoResult = this.data.videoResult;
+ if (videoResult.chackpay === 2 || videoResult.chackpay == 3) {
+ const unlockAllFlag = res.data.list.some((m) => {
+ if (m.type == 4) {
+ let unlockAllKb = (videoResult.unlock_data.total_price / parseFloat(m.price)).toFixed(2);
+ // this.data.unlockAllKb = unlockAllKb;
+ this.setData({
+ unlockAllKb: unlockAllKb
+ })
+ }
+ return m.type == 4;
+ });
+ this.setData({
+ unlockAllFlag: unlockAllFlag
+ })
+
+ }
+ //ios支付
+ httpRequest('/bs', 'post', {new_pay:1}).then((res) => {
+ if (res.status == 1) {
+ this.setData({
+ iosStatus: res?.data?.status,
+ })
+ }
+ });
+ //用户数据
+ httpRequest('/user', 'post', ).then((res) => {
+ if (res.status == 1) {
+ this.setData({
+ iosIm: res?.data?.info.im,
+ })
+ }
+ });
+ });
+ },
+ //选中商品
+ setCurrentItem(inx){
+ let cacheInx
+ //有下标时,直接设置
+ if(inx){
+ cacheInx = inx
+ }else {
+ //没有下标时,从数据def_select设置页面
+ for (let i = 0; i < this.data.payList.length; i++) {
+ if (this.data.payList[i].def_select) {
+ cacheInx = i
+ }
+ }
+ }
+ this.setData({
+ action: cacheInx ? cacheInx : 0
+ })
+ // this.data.action = cacheInx ? cacheInx : 0;
+ return this.data.action;
+ },
+ //点击商品
+ payItem(item,index) {
+ // this.data.action = index
+ this.setData({
+ action: index
+ })
+ //调用抖音支付组件
+ if(tt.canIUse('payment-channel-select')&&this.data.useBytePayment&&this.data.showPaymentChannelSelect){
+ // console.log('item',item)
+ this.setSkuList(index)
+ }else{
+ //打开原tt支付
+ this.openTtPay(index)
+ }
+ },
+ //设置抖音支付面板数据
+ setSkuList(inx){
+ const item = this.data.dySkuList[inx];
+ let skuList = [];
+ skuList.push(item);
+ this.setData({
+ skuList: skuList
+ })
+ console.log('skuList',this.data.skuList)
+ },
+ //组件支付下单
+ async handleRequestOrderByte(event) {
+ // 下单
+ // 返回一个 promise
+ return new Promise(resolve => {
+ const launchsite = tt.getStorageSync('launchsite') || 1;
+ const payCurrent = this.data.payList[this.data.action]
+ const params = {
+ id: payCurrent.id,
+ isback: payCurrent.isback === 1 ? 1 : 0,
+ launchsite,
+ sid: this.data.videoResult.sid || "",
+ jid: this.data.videoResult.id || "",
+ new_pay: 1
+ }
+ httpRequest('/Newplaceanorder', 'post', params).then((res) => {
+ if (res.status == 1) {
+ const orderData = {
+ data: res.data.data,
+ byteAuthorization: res.data.byteAuthorization,
+ }
+ resolve(orderData);
+ }
+ });
+ });
+ },
+ //组件支付状态
+ handleGetPaymentResult(event) {
+ const { status, result } = event.detail;
+ console.log('handleGetPaymentResult',event.detail)
+ if (status === 'success') {
+ const { code } = result;
+ if (code === 0) {
+ tt.showToast({
+ icon: 'none',
+ title: '支付成功',
+ });
+ this.emitChargeInfoToParent('charge','success')
+ // uni.$emit('chargePaySuccess')
+ } else if( code === 9) {
+ // code 为 9,开发者自行查询订单状态
+ } else {
+ // 支付失败、超时、取消、关闭
+ tt.showToast({
+ icon: 'none',
+ title: '支付失败',
+ });
+ }
+ } else {
+ // 支付失败
+ tt.showToast({
+ icon: 'none',
+ title: '支付失败',
+ });
+ }
+ },
+ //组件支付报错
+ handleGetPaymentError(event){
+ // errNo(错误码,对应某种具体报错原因)
+ // errMsg(报错信息)
+ const { errNo, errMsg } = event.detail
+ console.log('errMsg',errMsg)
+ console.log('errNo',errNo)
+ const componentInitError = [169007, 20000]
+ const payError = [169015, 169016, 169017, 169018, 169019, 169020, 20]
+ if (componentInitError.includes(errNo)) {
+ //组件初始化错误
+ this.setData({
+ showPaymentChannelSelect: false
+ })
+ // this.data.showPaymentChannelSelect = false;
+ } else if(payError.includes(errNo)) {
+ // 支付流程错误
+ // 使用 tt.requestOrder + tt.getOrderPayment
+ // this.showPaymentChannelSelect = false;
+ this.openTtPay(this.data.action);
+ }
+ },
+ //打开原tt支付
+ openTtPay(index){
+ const that = this;
+ const item = this.data.payList[index];
+ tt.showLoading({
+ title: "正在拉起支付",
+ });
+ const launchsite = tt.getStorageSync('launchsite') || 1;
+ if (this.data.platform === "ios" && this.data.iosStatus === 1) {
+ tt.hideLoading({});
+ tt.showToast({
+ title: "暂不支持ios支付",
+ duration: 2000,
+ icon: "none",
+ });
+ return;
+ } else {
+ if (tt.canIUse("getOrderPayment") && tt.canIUse("requestOrder")) {
+ const params = {
+ id: item.id,
+ isback: item.isback === 1 ? 1 : 0,
+ launchsite,
+ sid: this.data.videoResult.sid || "",
+ jid: this.data.videoResult.id || "",
+ }
+ httpRequest('/Newplaceanorder', 'post', params).then((res) => {
+ if (res.status == 1) {
+ tt.hideLoading({});
+ tt.requestOrder({
+ data: res.data.data,
+ byteAuthorization: res.data.byteAuthorization,
+ payScene: this.data.platform === "ios" ? "IM" : "",
+ success: (e) => {
+ tt.showLoading({
+ title: "拉起支付中...",
+ });
+ tt.getOrderPayment({
+ orderId: e.orderId,
+ imId: this.data.platform === "ios" ? this.data.iosIm : "",
+ success: (payRes) => {
+ tt.hideLoading({});
+ tt.showToast({
+ title: "支付成功",
+ duration: 2000,
+ });
+ that.emitChargeInfoToParent('charge','success')
+ },
+ fail: (payError) => {
+ tt.hideLoading({});
+ // console.log(payError);
+ },
+ });
+ },
+ fail: (e) => {
+ console.log(e);
+ },
+ });
+ }
+ });
+ } else {
+ const params = {
+ id: item.id,
+ isback: item.isback === 1 ? 1 : 0,
+ launchsite,
+ sid: this.data.videoResult.sid || "",
+ jid: this.data.videoResult.id || "",
+ }
+ httpRequest('/getTiktokpay', 'post', params).then((res) => {
+ if (res.status == 1) {
+ tt.hideLoading({});
+ const orderInfo = {
+ outOrderNo: res.data.outOrderNo,
+ totalAmount: res.data.totalAmount,
+ };
+ tt.pay({
+ orderInfo,
+ service: 5,
+ success: (res) => {
+ if (res.code == 0) {
+ tt.showToast({
+ title: "支付成功",
+ duration: 2000,
+ });
+ that.emitChargeInfoToParent('charge','success')
+ // paysetting().then((res) => {
+ // this.egold = res.egold;
+ // uni.setStorageSync("isPopup", false);
+ // this.show = false;
+ // // this.$emit("paySuccess", "paySuccess");
+ // uni.$emit('chargePaySuccess')
+ // });
+
+ // 支付成功处理逻辑,只有res.code=0时,才表示支付成功
+ // 但是最终状态要以商户后端结果为准
+ }
+ },
+ fail: () => {
+ tt.showToast({
+ title: "支付失败,请重新支付",
+ duration: 2000,
+ });
+ },
+ });
+ }
+ });
+ }
+ }
+ },
+ //接收页面点击
+ handlePayItem(e){
+ const item = e.currentTarget.dataset.item
+ const index = e.currentTarget.dataset.index
+ // this.emitChargeInfoToParent('charge','success')
+ this.payItem(item,index)
+ },
+ //向父组件传值
+ emitChargeInfoToParent(val,data) {
+ const instance = this.selectOwnerComponent();
+ instance.emitChargeInfoFromChildren(val,data);
+ this.close()
+ },
+
+
+ close(){
+ this.pm.toggleCustomDialog()
+ },
+
+ //支付区域
+ payThis(e) {
+ this.pm.toggleCustomDialog('close');
+ this.pm.setCurrentUnlock();
+ },
+
+ payAll(e) {
+ this.pm.toggleCustomDialog('close');
+ this.pm.setCatalog(this.data.allUnlock);
+ },
+
+ adThis(e) {
+ console.log('广告解锁当前集', e);
+ this.setData({
+ adType: 'this',
+ })
+ this.ad.show();
+ // 监听视频播放完成
+ },
+
+ adAll(e) {
+ console.log('广告解锁全集', e);
+ this.setData({
+ adType: 'all',
+ })
+ this.ad.show();
+ },
+ }
+})
\ No newline at end of file
diff --git a/components/charge/charge.json b/components/charge/charge.json
new file mode 100644
index 0000000..13d8326
--- /dev/null
+++ b/components/charge/charge.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "payment-channel-select": "ext://industry/payment-channel-select"
+ }
+ }
\ No newline at end of file
diff --git a/components/charge/charge.ttml b/components/charge/charge.ttml
new file mode 100644
index 0000000..f8ce629
--- /dev/null
+++ b/components/charge/charge.ttml
@@ -0,0 +1,167 @@
+
\ No newline at end of file
diff --git a/components/charge/charge.ttss b/components/charge/charge.ttss
new file mode 100644
index 0000000..741d1b5
--- /dev/null
+++ b/components/charge/charge.ttss
@@ -0,0 +1,292 @@
+.video-footer {
+ background-color: rgb(255, 255, 255);
+ height: 1100rpx;
+ width: 100%;
+}
+.content {
+ width: 750rpx;
+ /*height: 400rpx;*/
+ box-sizing: border-box;
+}
+
+.pay-btn {
+ width: 558rpx;
+ height: 104rpx;
+ line-height: 104rpx;
+ background: #fa6435;
+ border-radius: 72rpx;
+ color: #ffffff;
+}
+
+button {
+ margin: 0 !important;
+}
+
+.dykefu_btn {
+ display: flex !important;
+ flex-direction: row !important;
+ align-items: center;
+ background-color: transparent !important;
+ padding: 0;
+ color: transparent;
+}
+
+.dykefu_btn::after {
+ border: none;
+}
+
+.dykefu_warp {
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.pay_ul {
+ width: 50%;
+}
+
+.pay_li_class_default {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 180rpx;
+ background: #f1f1f2;
+ border-radius: 12rpx;
+ padding: 50rpx 20rpx 30rpx;
+ margin-bottom: 40rpx;
+}
+
+.pay_li_class_1 {
+ .money__it_wa_ti_pr_text {
+ color: #333;
+ }
+
+ .money__it_wa_ti_pr_te_icon {
+ color: #333;
+ }
+}
+
+.pay_li_class_2 {
+ .money__it_wa_ti_pr_text {
+ color: #fff;
+ }
+
+ .money__it_wa_ti_pr_te_icon {
+ color: #fff;
+ }
+
+ .pay_li_cl_poster {
+ background: linear-gradient(90deg, #705648, #534435);
+ }
+
+ .pay_li_cl_pos_text {
+ color: #f1cda3;
+ }
+
+ background: url("https://dyjyjcweb.hunanjj.cn/dy_images/images/template_vip.png");
+ background-size: 100% 100%;
+}
+
+.pay_li_class_4 {
+ .money__it_wa_ti_pr_text {
+ color: #333;
+ }
+
+ .money__it_wa_ti_pr_te_icon {
+ color: #333;
+ }
+
+ background: url("https://dyjyjcweb.hunanjj.cn/dy_images/images/template_coins.png");
+ background-size: 100% 100%;
+}
+
+.pay_li_cl_one {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+
+ .pay_li_cl_de_i_text {
+ font-size: 16rpx;
+ }
+}
+
+.money__it_wa_ti_price {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+.money__it_wa_ti_pr_text {
+ line-height: 1;
+ font-weight: 600;
+ font-size: 38rpx;
+ color: #333;
+}
+
+.money__it_wa_ti_pr_te_icon {
+ line-height: 1;
+ font-weight: 600;
+ font-size: 28rpx;
+ color: #333;
+}
+
+.pay_li_cl_description {
+ display: flex;
+ flex-direction: row;
+}
+
+.pay_li_cl_desc_i {
+ display: flex;
+ padding: 8rpx 8rpx;
+ background-color: #f8dfac;
+ border-radius: 6rpx;
+}
+
+.pay_li_cl_de_i_text {
+ line-height: 1;
+ font-size: 20rpx;
+ color: #ff562a;
+}
+
+.pay_li_cl_poster {
+ position: absolute;
+ left: 20rpx;
+ top: 0;
+ display: flex;
+ transform: translateY(-50%);
+ padding: 6rpx 12rpx;
+ border-radius: 16rpx 0 16rpx 0;
+ background: linear-gradient(135deg, #ff9d37, #ff6c00);
+}
+
+.pay_li_cl_pos_text {
+ line-height: 1;
+ font-size: 22rpx;
+ color: #fff;
+}
+
+.pay_li_cl_desc_kb {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin-top: 20rpx;
+}
+
+.pay_li_cl_desc_k_icon {
+ width: 32rpx;
+ height: 32rpx;
+ margin-right: 6rpx;
+
+ .k_icon {
+ display: block;
+ width: 100%;
+ height: 100%;
+ }
+}
+
+.pay_li_cl_desc_k_num {
+ line-height: 1;
+ font-size: 26rpx;
+ color: #ff562a;
+}
+
+.pay_li_cl_hand {
+ position: absolute;
+ top: 66px;
+ right: -6px;
+ width: 40px;
+ height: 42px;
+
+ .hand_icon {
+ display: block;
+ width: 100%;
+ height: 100%;
+ }
+}
+
+.pay_rule_li_item {
+ margin-bottom: 10rpx;
+}
+
+
+.pay_rule_li_it_text {
+ line-height: 1.5;
+ font-size: 24rpx;
+ color: #999;
+}
+
+.py-30 {
+ padding-top: 15px;
+ padding-bottom: 15px;
+}
+.px-30 {
+ padding-left: 15px;
+ padding-right: 15px;
+}
+.d-flex {
+ display: flex !important;
+}
+.fs-36 {
+ font-size: 18px !important;
+}
+.ml-20 {
+ margin-left: 10px !important;
+}
+.fs-26 {
+ font-size: 13px !important;
+}
+.mt-18 {
+ margin-top: 9px !important;
+}
+.mt-22 {
+ margin-top: 11px !important;
+}
+.fs-26 {
+ font-size: 13px !important;
+}
+.fs-24 {
+ font-size: 12px !important;
+}
+.mt-24 {
+ margin-top: 12px !important;
+}
+.pl-10{
+ padding-left: 10px !important;
+}
+.pr-10{
+ padding-right: 10px !important;
+}
+.pt-40{
+ padding-top: 40px !important;
+}
+.pt-20{
+ padding-top: 20px !important;
+}
+.pb-60{
+ padding-bottom: 60px !important;
+}
+.pb-20{
+ padding-bottom: 20px !important;
+}
+
+.contact_customer_service {
+ padding: 0;
+ background: none;
+ /*background: #ff562a;*/
+}
+
+.contact_customer_service::after {
+ content: none;
+}
+
+.contact_custo_ser_icon {
+ width: 50rpx;
+ height: 50rpx;
+}
+.contact_custo_ser_txt {
+ color: #ff562a;
+ font-size: 26rpx !important;
+}
\ No newline at end of file
diff --git a/components/player/player.ts b/components/player/player.ts
index 8d5304b..0ff0c88 100644
--- a/components/player/player.ts
+++ b/components/player/player.ts
@@ -16,6 +16,9 @@ Component({
pm.onPlay((e) => {
console.log("触发开始播放onPlay回调,时间是:", new Date());
+ this.setData({
+ lockStatus: false
+ })
});
pm.onPause((e) => {
console.log('触发暂停播放onPause回调', e)
@@ -33,7 +36,23 @@ Component({
})
pm.onChangeEpisode((e) => {
+ console.log('切换回调', e)
+ //当前切换到的集
+ tt.setStorageSync('currentvideo', {'album_id': e.albumId,episode_id:e.episodeId, seq:e.seq,status: e.status, scene: e.scene});
+ //当前切换到的解锁集,播放记录用
+ if(e.status=='free'){
+ tt.setStorageSync('lastfreevideo', {'album_id': e.albumId,episode_id:e.episodeId, seq:e.seq,status: e.status, scene: e.scene});
+ }
let lock = false;
+ // let watchInfo = tt.getStorageSync('watchInfo')
+ // if(e.scene =='first_play' && watchInfo?.album_id != e.albumId){
+ // watchInfo = tt.getStorageSync('watchInfo')
+ // console.log('1')
+ // }
+ // const checklock = watchInfo?.isvip != 0 && (watchInfo?.chackpay == 2 || watchInfo?.chackpay == 3)
+ // console.log(watchInfo)
+ // console.log(checklock)
+ // if(e.status =='lock' || (e.scene =='first_play' && checklock)){
if(e.status =='lock'){
lock = true;
}
@@ -43,6 +62,10 @@ Component({
videoAlbumId: e.albumId,
videoEpisodeId: e.episodeId,
})
+ //storage有延时,第一次进入锁定剧集时,需要刷新
+ if(e.status =='lock'){
+ this.emitInfoToParent('change',{album_id: this.data.videoAlbumId,episode_id:this.data.videoEpisodeId})
+ }
})
pm.onShareSuccess((res) => {
@@ -121,5 +144,8 @@ Component({
// res: any console.log("视频广告展示");
});
},
- }
+ openPay() {
+ this.pm.toggleCustomDialog()
+ },
+ },
})
\ No newline at end of file
diff --git a/components/player/player.ttml b/components/player/player.ttml
index c745a78..e26021e 100644
--- a/components/player/player.ttml
+++ b/components/player/player.ttml
@@ -2,10 +2,11 @@
-
-
+
+ 免广告解锁
+
+
+
看广告解锁
@@ -13,7 +14,6 @@
{{lockStatuss}}
-
diff --git a/components/player/player.ttss b/components/player/player.ttss
index c22ee16..1024d42 100644
--- a/components/player/player.ttss
+++ b/components/player/player.ttss
@@ -1,10 +1,10 @@
.unlock_in_con_wa_operate {
- z-index: 9;
+ z-index: 0;
/* background-color: yellow; */
bottom: 5rem;
width: 100%;
position: fixed;
-
+ padding: 0 2rem;
display : flex;
flex-direction : row;
justify-content: space-between;
diff --git a/pages/videoByte/videoByte.json b/pages/videoByte/videoByte.json
index 83391ca..93d90ae 100644
--- a/pages/videoByte/videoByte.json
+++ b/pages/videoByte/videoByte.json
@@ -1,7 +1,9 @@
{
"extends": "ext://industry/playlet-plugin",
"usingComponents": {
- "player": "/components/player/player"
+ "player": "/components/player/player",
+ "charge": "/components/charge/charge",
+ "payment-channel-select": "ext://industry/payment-channel-select"
},
"isPageExtension": true,
"enablePullDownRefresh": false,
diff --git a/pages/videoByte/videoByte.ts b/pages/videoByte/videoByte.ts
index 7ba5fa4..c773834 100644
--- a/pages/videoByte/videoByte.ts
+++ b/pages/videoByte/videoByte.ts
@@ -15,12 +15,26 @@ PlayletExtension({
nextbatchList: [],
},
methods: {
+ //监听player的值
emitInfoFromChildren(val,data) {
console.log('收到消息', val)
console.log('收到消息', data)
if(val=="advunlock"){
this.init('advunlock',data)
}
+ if(val=="change"){
+ this.init('change',data)
+ }
+ },
+ //监听charge的值
+ emitChargeInfoFromChildren(val,data) {
+ console.log('收到消息', val)
+ console.log('收到消息', data)
+ console.log(val=="charge"&& data == "success")
+ if(val=="charge"&& data == "success"){
+ const data = tt.getStorageSync('currentvideo')
+ this.init('charge',data)
+ }
},
onLoad(options) {
const caniuse = !!tt.canIUse('PlayletExtension');
@@ -29,6 +43,8 @@ PlayletExtension({
// console.error('caniuse', caniuse);
const pm = getPlayletManager();
this.pm = pm;
+ // tid=2334
+ // options.tid = 2334
this.options = options;
this.setData({
tt_album_id: options.tt_album_id,
@@ -92,7 +108,6 @@ PlayletExtension({
});
this.init();
- // this.getNext();
},
async init(status?:string,data?:any) {
console.log("data",data)
@@ -106,8 +121,13 @@ PlayletExtension({
tt_episode_id: null,
adunlocking: status == 'advunlock' ? 1 : null
}
+ console.log('params', params)
//初始化目录
const res = await httpRequest('/douyinNewRead', 'post', params);
+ //添加历史记录时,后面不用执行了
+ if(status == 'addhistory') {
+ return
+ }
//设置剧集上锁状态
const _freeList = res.data.freelist != null ? res.data.freelist : []
const _lockList = res.data.locklist != null ? res.data.locklist : []
@@ -124,26 +144,8 @@ PlayletExtension({
this.setData({
watchInfo: _watchinfo
})
+ tt.setStorageSync('watchInfo', _watchinfo);
},
- async getNext(){
- // let params = {
- // ...this.options,
- // album_id: !!data ? data.album_id : this.options.tt_album_id,
- // episode_id: !!data ? data.episode_id : this.options.tt_episode_id,
- // sid: null,
- // id: null,
- // tt_album_id: null,
- // tt_episode_id: null,
- // }
- let nextbatchList = [];
- const nextbatchRes: any = await httpRequest('/nextbatch', 'POST', this.options);
- if (nextbatchRes.status == 1 && Array.isArray(nextbatchRes.data)) {
- nextbatchList = nextbatchRes.data;
- }
- this.setData({
- nextbatchList
- })
- }
},
lifetimes: {
@@ -162,6 +164,10 @@ PlayletExtension({
detached() {
console.log('detached')
+ const lastfreevideo = tt.getStorageSync('lastfreevideo')
+ if(lastfreevideo.status == 'free'){
+ this.init('addhistory',lastfreevideo)
+ }
},
},
diff --git a/project.config.json b/project.config.json
index 4e0c3cf..860d500 100644
--- a/project.config.json
+++ b/project.config.json
@@ -1,18 +1 @@
-{
- "setting": {
- "urlCheck": true,
- "es6": true,
- "postcss": true,
- "minified": true,
- "newFeature": true,
- "autoCompile": true,
- "compileHotReLoad": true,
- "nativeCompile": true,
- "useCompilerPlugins": [
- "typescript"
- ]
- },
- "appid": "tte8719ecc7742e53d01",
- "projectname": "古言剧场",
- "douyinProjectType": "native"
-}
\ No newline at end of file
+{"setting":{"urlCheck":true,"es6":true,"postcss":true,"minified":true,"newFeature":true,"autoCompile":true,"compileHotReLoad":true,"nativeCompile":true,"useCompilerPlugins":["typescript"]},"appid":"tte8719ecc7742e53d01","projectname":"古言剧场","douyinProjectType":"native"}
\ No newline at end of file