This commit is contained in:
lipenggao 2024-06-11 14:08:58 +08:00
parent a782d021d4
commit 891aca7cc8
17 changed files with 299 additions and 80 deletions

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,22 @@
// e:\project\dy_video_all\dy_iaa_new_project\components\customerService\customerService.ts
import { httpRequest } from "../../utils/httpReques"
Component({
data: {
userInfo: {}
},
properties: {
},
attached() {
httpRequest('/user', 'POST').then((res: any) => {
if (res.status == 1) {
this.setData({
userInfo: res.data.info,
})
}
})
},
methods: {
}
})

View File

@ -0,0 +1,5 @@
<button open-type="im" data-im-id="{{userInfo.im}}" class="contact_customer_service">
<view class="contact_custo_ser_icon">
<image src="/static/customer_service.png" class="__wa_img_no_radius"></image>
</view>
</button>

View File

@ -0,0 +1,18 @@
/* e:\project\dy_video_all\dy_iaa_new_project\components\customerService\customerService.ttss */
.contact_customer_service {
position: fixed;
bottom: 100rpx;
right: 20rpx;
background: transparent;
padding: 0;
z-index: 99;
}
.contact_customer_service::after {
content: none;
}
.contact_custo_ser_icon {
width: 50rpx;
height: 50rpx;
}

View File

@ -1,7 +1,8 @@
{
"usingComponents": {
"my-modal": "/components/myModal/myModal",
"comm-tabs": "/components/commTabs/commTabs"
"comm-tabs": "/components/commTabs/commTabs",
"customer-service": "/components/customerService/customerService"
},
"navigationBarTitleText": "首页"
}

View File

@ -12,7 +12,7 @@ Page({
page: 1,
newModule: [],
bookcase: [],
bookId: ''
bookId: '',
},
onLoad: function () {

View File

@ -5,13 +5,13 @@
</view>
</view>
<view class="_heome_swiper">
<swiper previous-margin="70rpx" next-margin="70rpx" class="_heome_swi_warp" circular="{{true}}"
bindchange="handelSwiperChange" autoplay="{{false}}" interval="{{2000}}">
<swiper previous-margin="86rpx" next-margin="86rpx" class="_heome_swi_warp" circular="{{true}}"
bindchange="handelSwiperChange" autoplay="{{true}}" interval="{{2000}}">
<block tt:for="{{carouselChart}}">
<swiper-item class="_home_swi_item" tt:key="{{item.bookid}}" data-sid="{{item.bookid}}" bindtap="toPathVideo">
<view class="_home_swi_it_ppp">
<view class="_home_swi_it_warp {{swiperCurrent == index ? 'active' :''}}" bindtap="toPathVideo"
data-sid="{{item.bookid}}">
<swiper-item class="_home_swi_item" tt:key="{{item.bookid}}" data-sid="{{item.bookid}}"
catchtap="toPathVideo">
<view class="_home_swi_it_ppp {{swiperCurrent == index ? '_wk_it_op_ac' :''}}">
<view class="_home_swi_it_warp " catchtap="toPathVideo" data-sid="{{item.bookid}}">
<image src="{{item.cover}}" class="_home_swi_it_wa_img" mode="aspectFill"></image>
</view>
<view class="_home_swi_it__play">
@ -156,7 +156,7 @@
<view class="_mo_5_con_list">
<block tt:for="{{newModule}}">
<view class="_mo_5_con_li_item" tt:key="{{item.id}}" data-sid="{{item.id}}" catchtap="toPathVideo">
<view class="_mo_5_con_li_it_left" >
<view class="_mo_5_con_li_it_left">
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
<view class="_mo_5_con_li_it_le_tag">
<view class="_mo_5_con_li_it_le_ta_icon">
@ -215,4 +215,6 @@
<!-- <comm-tabs selectedIndex="{{0}}" /> -->
<customer-service />
</view>

View File

@ -32,7 +32,10 @@ page {
._home_swi_item {
position: relative;
padding: 76rpx 20rpx;
display: flex;
align-items: center;
/* padding: 76rpx 20rpx; */
padding: 0 20rpx;
box-sizing: border-box;
border-radius: 12rpx;
overflow: hidden;
@ -41,20 +44,23 @@ page {
._home_swi_it_ppp {
position: relative;
width: 100%;
height: 100%;
/* height: 100%; */
}
._home_swi_it_warp {
position: relative;
width: 100%;
height: 100%;
transform: scaleY(1);
transition: transform 0.5s;
height: 561rpx;
/* transform: scaleY(1); */
/* transition: transform 0.5s; */
transition: height 0.5s;
}
._home_swi_it_warp.active {
transform: scaleY(1.2);
transition: transform 0.5s;
._wk_it_op_ac ._home_swi_it_warp {
/* transform: scaleY(1.2); */
height: 712rpx;
/* transition: transform 0.5s; */
transition: height 0.5s;
}
._home_swi_it_wa_img {
@ -76,6 +82,13 @@ page {
transform: translateX(-50%);
border-radius: 8rpx;
background-color: #fff;
opacity: 0;
transition: opacity 1s;
}
._wk_it_op_ac ._home_swi_it__play {
opacity: 1;
transition: opacity 1s;
}
._home_swi_it__pl_text {
@ -87,7 +100,7 @@ page {
._heome_swi_indicator {
display: flex;
justify-content: center;
padding-top: 10rpx;
padding-top: 20rpx;
}
._heome_swi_ind_item {
@ -96,7 +109,7 @@ page {
border-radius: 16rpx;
background-color: rgba(255, 255, 255, 0.10);
margin-right: 16rpx;
transition: width 0.5s;
transition: width 0.8s;
}
._heome_swi_ind_item:last-child {
@ -107,7 +120,7 @@ page {
width: 32rpx;
/* transform: scaleX(2); */
background-color: #5BBE04;
transition: width 0.5s;
transition: width 0.8s;
}
._home_modul_1 {
@ -660,4 +673,5 @@ page {
._mo_5_load_na_test {
font-size: 32rpx;
color: rgba(255, 255, 255, 0.3);
}
}

View File

@ -1,4 +1,6 @@
{
"usingComponents": {},
"usingComponents": {
"customer-service": "/components/customerService/customerService"
},
"navigationBarTitleText": "购买记录"
}

View File

@ -59,4 +59,7 @@
</view>
</block>
</view>
<customer-service />
</view>

View File

@ -1,5 +1,6 @@
{
"usingComponents": {
"comm-tabs": "/components/commTabs/commTabs"
"comm-tabs": "/components/commTabs/commTabs",
"customer-service": "/components/customerService/customerService"
}
}

View File

@ -71,7 +71,9 @@
<block tt:for="{{categoryList}}">
<view id="demo1" class="_mo_so_he_scr_warp {{categoryid == item.id ? '_bg_active' : ''}}"
bindtap="handelSortTap" data-categoryid="{{item.id}}" tt:key="{{item.id}}">
<text class="_mo_so_he_scr_wa_text">{{item.title}}</text>
<view class="_mo_so_he_scr_warp_flex">
<text class="_mo_so_he_scr_wa_text">{{item.title}}</text>
</view>
</view>
</block>
</scroll-view>
@ -117,4 +119,7 @@
</view>
</view>
<!-- <comm-tabs selectedIndex="{{2}}" /> -->
<customer-service />
</view>

View File

@ -254,10 +254,17 @@ page {
display: inline-block;
height: 56rpx;
padding: 0 28rpx;
border-radius: 8rpx;
background-color: #272A30;
margin-right: 32rpx;
cursor: pointer;
border-radius: 10rpx;
}
._mo_so_he_scr_warp_flex {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
._mo_so_he_scr_warp:last-child {

View File

@ -19,7 +19,9 @@ Page({
selectionConList: [],
roderCurrent: 0,
collectionItem: {},
nextbatchList: []
nextbatchList: [],
selectedId: '',
adBanner: null
},
onLoad(options: any) {
const videoCanIUse = tt.canIUse('video-player');
@ -30,15 +32,19 @@ Page({
this.setData({
platform: res.platform,
videoCanIUse,
toOptions: options,
sid: options?.sid || ''
})
}
})
this.setData({
toOptions: options,
sid: options?.sid || ''
})
this.initFn();
},
onShow() {
this.initFn();
},
async initFn() {
@ -94,10 +100,11 @@ Page({
const nextId = batchList[current]?.id;
const context: any = tt.createVideoContext(`${id}`);
const nextContext: any = tt.createVideoContext(`${nextId}`);
const selectionConList = this.data.selectionConList;
// const collectionItem: any = this.data.collectionItem;
const sid = this.data.sid;
const videoInfo = this.data.videoInfo;
const videoInfo: any = this.data.videoInfo;
const collectionItem = batchList[current]
const params = {
sid: sid,
@ -117,6 +124,24 @@ Page({
// this.selectComponent(`#${nextId}`, (res: any) => {
// res?.hidePauseIcon()
// });
const lk: any = [];
selectionConList.forEach((m: any) => {
const bm = {
...m,
temp: []
}
m.temp.forEach((k: any) => {
if (k.id == videoInfo.id) {
bm.temp.push({
...k,
isvip: 0
})
} else {
bm.temp.push(k)
}
})
lk.push(bm)
})
this.setData({
videoInfo: {
@ -126,7 +151,8 @@ Page({
videoPlayerCurrent: current,
anthologyFlag: false,
collectionItem: collectionItem,
videoErrorText: ''
videoErrorText: '',
selectionConList: lk
})
@ -183,13 +209,20 @@ Page({
// });
// },
anthologyTap() {
anthologyTap(ev: any) {
const id = ev.currentTarget.dataset.id;
const context: any = tt.createVideoContext(`${id}`);
context?.pause?.();
this.setData({
anthologyFlag: true
anthologyFlag: true,
selectedId: id
})
},
handelAnthologyClose() {
const selectedId = this.data.selectedId;
const context: any = tt.createVideoContext(`${selectedId}`);
context?.play?.();
this.setData({
anthologyFlag: false
})
@ -319,7 +352,84 @@ Page({
});
},
watchAdvertisement() {
let adBanner: any = this.data.adBanner;
const videoInfo: any = this.data.videoInfo;
const batchList: any = this.data.batchList;
const selectionConList = this.data.selectionConList;
const context: any = tt.createVideoContext(`${videoInfo.id}`);
// this.watchInfo.isvip = 0;
if (!adBanner) {
tt.showToast({
title: `广告加载中...`,
});
adBanner = tt.createRewardedVideoAd({
adUnitId: "82jc4t11786rd3thuq",
});
adBanner.show().then((res: any) => {
console.log("视频广告展示");
console.log(res, "pppppppp")
});
// 监听错误
adBanner.onError((err: any) => {
tt.hideLoading({});
switch (err.errCode) {
case 1004:
// 无合适的广告
break;
default:
// 更多请参考错误码文档
}
});
// 监听视频播放完成
adBanner.onClose(async (res: any) => {
console.log(res, "resres")
// const videoIndex = batchList.findIndex(
// (r: any) => r.id === videoInfo.id
// );
// batchList[videoIndex].isvip = 0; // 购买成功 或者本来就是免费
// batchList[videoIndex].state = "play";
// batchList[videoIndex].playIng = true;
// batchList[videoIndex].isplay = true;
// context?.play?.();
const lk: any = [];
selectionConList.forEach((m: any) => {
const bm = {
...m,
temp: []
}
m.temp.forEach((k: any) => {
if (k.id == videoInfo.id) {
bm.temp.push({
...k,
isvip: 0
})
} else {
bm.temp.push(k)
}
})
lk.push(bm)
})
const params = {
sid: videoInfo.sid,
id: videoInfo.id,
};
const transferadRes: any = await httpRequest('/transferad', 'POST', params);
this.setData({
batchList: batchList,
videoInfo: {
...videoInfo,
chackpay: 1
},
selectionConList: lk
})
});
// 预加载资源
adBanner.load();
}
},
toPathVideoitself(ev: any) {
const sid = ev.currentTarget.dataset.sid;
@ -341,5 +451,11 @@ Page({
this.setData({
nextbatchList
})
},
handelEpisode(ev: any) {
const current = ev.detail.current;
this.setData({
roderCurrent: current
})
}
})

View File

@ -16,7 +16,7 @@
three-party-cloud="{{item.video_url}}" version="1"
enable-progress-gesture="{{true}}" autoplay="{{videoPlayerCurrent == index}}"
id="{{item.id}}" enable-dark-water-mark="{{true}}" bindended="videoPlayerEnded"
binderror="videPlayerError">
binderror="videPlayerError" show-fullscreen-btn="{{false}}" object-fit="cover">
<block tt:if="{{videoPlayerCurrent == index}}">
<block tt:if="{{videoErrorText}}">
<view class="_iii_video_content">
@ -42,7 +42,7 @@
src="{{videoInfo.video_url}}" version="1" enable-progress-gesture="{{true}}"
autoplay="{{ videoPlayerCurrent == index}}" id="{{item.id}}"
enable-dark-water-mark="{{true}}" bindended="videoPlayerEnded"
binderror="videError">
binderror="videError" show-fullscreen-btn="{{false}}">
<block tt:if="{{videoPlayerCurrent == index}}">
<block tt:if="{{videoErrorText}}">
<view class="_iii_video_content">
@ -108,7 +108,7 @@
<text class="_m_vv_oper_l_col_s_text">{{videoInfo.isCount}}</text>
</view>
</view>
<view class="_m_vv_oper_l_col_w mt_36" catchtap="anthologyTap">
<view class="_m_vv_oper_l_col_w mt_36" catchtap="anthologyTap" data-id="{{item.id}}">
<view class="_m_vv_oper_l_collect">
<image src="/static/drama_series_icon.png" class="__wa_img_no_radius"></image>
</view>
@ -183,52 +183,57 @@
</swiper>
<view class="_vv_det_anthology_dialog {{anthologyFlag ? 'ac_dis_blo' : ''}}">
<view class="_vv_det_ant_dia_header">
<view class="_vv_det_ant_dia_hea_name">
<text class="_vv_det_ant_dia_hea_na_text">{{videoInfo.title}}</text>
</view>
<view class="_vv_det_ant_dia_hea_close" catchtap="handelAnthologyClose">
<image src="/static/close_icon.png" class="__wa_img_no_radius"></image>
</view>
<view class="" >
<view class="_vv_det_anthology_mask" tt:if="{{anthologyFlag}}">
</view>
<view class="_vv_det_ant_dia_sort">
<scroll-view scroll-x="{{true}}" class="_vv_det_ant_dia_so_scr">
<block tt:for="{{selectionTabs}}">
<view class="_vv_det_ant_dia_so_sc_item" tt:key="{{item.name}}" data-name="{{item.name}}"
data-idx="{{index}}" catchtap="handelOrderTabs">
<text
class="_vv_det_ant_dia_so_sc_it_text {{roderCurrent == index ? 'ac_color':''}} ">{{item.name}}</text>
</view>
</block>
</scroll-view>
</view>
<view class="_vv_det_ant_dia_list">
<swiper class="_vv_det_ant_dia_li_warp" current="{{roderCurrent}}">
<block tt:for="{{selectionConList}}">
<swiper-item tt:key="{{index}}">
<view class="_vv_det_ant_dia_li_wa_ppp_li">
<view class="_vv_det_ant_dia_li_wa_p_hhhh">
<block tt:for="{{item.temp}}" tt:for-index="idx" tt:for-item="m">
<view class="_vv_det_ant_dia_li_wa_p_h_yyyy" tt:key="index_{{m.id}}">
<view
class="_vv_det_ant_dia_li_wa_p_h_y_ggg {{videoInfo.order == m.order ? 'acv_class_color' :''}} "
catchtap="handelSelection" data-item="{{m}}">
<text class="_vv_det_ant_dia_li_wa_p_h_y_g_t">{{m.order}}</text>
<block tt:if="{{m.isvip}}">
<view class="_vv_det_ant_dia_li_wa_p_h_y_g_lock">
<image src="/static/ant_lock_icon.png" class="__wa_img_no_radius">
</image>
</view>
</block>
</view>
</view>
</block>
</view>
<view class="_vv_det_anthology_dialog {{anthologyFlag ? 'ac_dis_blo' : ''}}">
<view class="_vv_det_ant_dia_header">
<view class="_vv_det_ant_dia_hea_name">
<text class="_vv_det_ant_dia_hea_na_text">{{videoInfo.title}}</text>
</view>
<view class="_vv_det_ant_dia_hea_close" catchtap="handelAnthologyClose">
<image src="/static/close_icon.png" class="__wa_img_no_radius"></image>
</view>
</view>
<view class="_vv_det_ant_dia_sort">
<scroll-view scroll-x="{{true}}" class="_vv_det_ant_dia_so_scr">
<block tt:for="{{selectionTabs}}">
<view class="_vv_det_ant_dia_so_sc_item" tt:key="{{item.name}}" data-name="{{item.name}}"
data-idx="{{index}}" catchtap="handelOrderTabs">
<text
class="_vv_det_ant_dia_so_sc_it_text {{roderCurrent == index ? 'ac_color':''}} ">{{item.name}}</text>
</view>
</swiper-item>
</block>
</swiper>
</block>
</scroll-view>
</view>
<view class="_vv_det_ant_dia_list">
<swiper class="_vv_det_ant_dia_li_warp" current="{{roderCurrent}}" bindchange="handelEpisode">
<block tt:for="{{selectionConList}}">
<swiper-item tt:key="{{index}}">
<view class="_vv_det_ant_dia_li_wa_ppp_li">
<view class="_vv_det_ant_dia_li_wa_p_hhhh">
<block tt:for="{{item.temp}}" tt:for-index="idx" tt:for-item="m">
<view class="_vv_det_ant_dia_li_wa_p_h_yyyy" tt:key="index_{{m.id}}">
<view
class="_vv_det_ant_dia_li_wa_p_h_y_ggg {{videoInfo.order == m.order ? 'acv_class_color' :''}} "
catchtap="handelSelection" data-item="{{m}}">
<text class="_vv_det_ant_dia_li_wa_p_h_y_g_t">{{m.order}}</text>
<block tt:if="{{m.isvip}}">
<view class="_vv_det_ant_dia_li_wa_p_h_y_g_lock">
<image src="/static/ant_lock_icon.png"
class="__wa_img_no_radius">
</image>
</view>
</block>
</view>
</view>
</block>
</view>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
</view>

View File

@ -1,5 +1,9 @@
/* e:\project\dy_video_all\初晴剧场\pages\videoDetail\videoDetail.ttss */
page {
overflow: hidden;
}
._vv_detail_html {
width: 100%;
height: 100vh;
@ -232,6 +236,16 @@
transition: transform 0.5s;
}
._vv_det_anthology_mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.45);
z-index: 9998;
}
._vv_det_anthology_dialog.ac_dis_blo {
transform: translateY(0);
transition: transform 0.5s;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB