Commit 004af49b by 匡雅琴

提交

1 parent 15eb735a
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml --> <!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class"> <view class="view-prod custom-class">
<view class="pro-head"> <view class="pro-head">
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard"> <view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image> <glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view> <view>{{showCard ? '视频' : '名片'}}</view>
</view> </view>
<!-- 有视频 --> <!-- 有视频 -->
<block wx:if="{{!showCard}}"> <block wx:if="{{!showCard}}">
<!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> --> <!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> -->
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/> <video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx" />
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" /> <image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap"> <view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view> <view class="title">{{prodItemVideo.name}}</view>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<view class="prod-detail"> <view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index"> <block wx:for="{{productImgs}}" wx:key="index">
<!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> --> <!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> -->
<image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" src="{{item.url?item.url:item}}?v={{img_version}}"> <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" src="{{item.url?item.url:item}}?v={{img_version}}">
<block wx:if="{{ index == 0}}"> <block wx:if="{{ index == 0}}">
<!-- && phone --> <!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}"> <view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</block> </block>
</image> </image>
<!-- <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" /> --> <!-- <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" /> -->
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}"> <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}">
<!-- 众筹-视频 --> <!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}"> <block wx:if="{{ index == 3 && actNum == 3 }}">
<!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> --> <!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> -->
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ==" "integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
}, },
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.1.3", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.3.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.4.tgz",
"integrity": "sha512-Ze+HdtFJImhOsWLfV+ZzB86Kf18pm9M9CZWhctPel/qJNMEn29g9ywC16NXmeac+gTu07MOpURyF+YmO8ojkJA==" "integrity": "sha512-lTELWZDFUd0wyab9/H3U/JVbypG26qCDm3wH7OA2ZJWoXFNv30YFeOB8IpyfNf8XbFoZFgy/qvrGFv1lVZDKrw=="
} }
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.9", "@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.3" "glsx-applet-component": "^1.1.4"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
// packagesList/pages/videoDetal/videoDetal.js // packagesList/pages/videoDetal/videoDetal.js
import {trackData} from '../../../utils/data' import { trackData } from "../../../utils/data";
import {productData} from '../../../pages/tab/index/constant/senceData' // import {productData} from '../../../pages/tab/index/constant/senceData'
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData' // import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from '~/utils/util' import utils from "~/utils/util";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -12,24 +11,41 @@ Page({ ...@@ -12,24 +11,41 @@ Page({
videoItem: { videoItem: {
index: 0, index: 0,
videoList: [], videoList: [],
videoUrl: '', videoUrl: "",
hasPhoneNumber: false, hasPhoneNumber: false,
tabsActive: 1 tabsActive: 1,
}, },
trackList: [ trackList: [
[trackData.EQUITYVIDEO0, trackData.EQUITYVIDEO1, trackData.EQUITYVIDEO2, trackData.EQUITYVIDEO3], [
[trackData.SOLARFILMVIDEO], trackData.EQUITYVIDEO0,
trackData.EQUITYVIDEO1,
trackData.EQUITYVIDEO2,
trackData.EQUITYVIDEO3,
],
[trackData.SOLARFILMVIDEO],
[], [],
[trackData.CROWDVIDEO0, trackData.CROWDVIDEO1, trackData.CROWDVIDEO2, trackData.CROWDVIDEO3, trackData.CROWDVIDEO4, trackData.CROWDVIDEO5], [
[trackData.EXPANGOLDVIDEO1] trackData.CROWDVIDEO0,
trackData.CROWDVIDEO1,
trackData.CROWDVIDEO2,
trackData.CROWDVIDEO3,
trackData.CROWDVIDEO4,
trackData.CROWDVIDEO5,
],
[trackData.EXPANGOLDVIDEO1],
], ],
systemTrackList: [ systemTrackList: [
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2], [trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2],
[trackData.SYSNUMBERVIDEO1], [trackData.SYSNUMBERVIDEO1],
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2, trackData.SYSNUMBERVIDEO1] [
trackData.SYSUSERVIDEO1,
trackData.SYSUSERVIDEO2,
trackData.SYSNUMBERVIDEO1,
],
], ],
isLoadding: true, isLoadding: true,
showAuth: false showAuth: false,
tabActive: 0,
}, },
/** /**
...@@ -38,82 +54,166 @@ Page({ ...@@ -38,82 +54,166 @@ Page({
onLoad(options) { onLoad(options) {
console.log(options); console.log(options);
if (options && options.cardId) { if (options && options.cardId) {
wx.$trackData = options wx.$trackData = options;
wx.$storage.set('scene', options) wx.$storage.set("scene", options);
const spcList = [99] // const spcList = [99]
const {videoIndex, scenIndex, name, leftMenuIndex, videoName, tabsActive } = options const {
let videoList = [] videoIndex,
let videoUrl = '' scenIndex,
// 判断是案例视频还是操作指引视频 name,
if (tabsActive === '3') { leftMenuIndex=0,
videoList= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList : productData[scenIndex][0].operationVideoList,
videoUrl= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList[+operationVideoList].videoUrl : productData[scenIndex][0].operationVideoList[+videoIndex].videoUrl
} else {
videoList = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList : productData[scenIndex][0].videoList,
videoUrl = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList[+videoIndex].videoUrl : productData[scenIndex][0].videoList[+videoIndex].videoUrl
}
const res = {
index: videoIndex,
scenIndex: scenIndex,
name: name,
videoName, videoName,
leftMenuIndex: leftMenuIndex, tabsActive,
videoList: videoList, sceneCode,
videoUrl: videoUrl, tabActive,
tabsActive: tabsActive } = options;
}
this.setData({ // 获取mock数据
videoItem: res const app = getApp();
}) let videoList = [];
if (name == '营销增值服务') { let videoUrl = "";
wx.$Track.sendTrack(this.data.trackList[scenIndex][videoIndex]) let videoObj = {};
} else if (name == '客户数字化') { let baseData = [];
wx.$Track.sendTrack(this.data.systemTrackList[leftMenuIndex][videoIndex]) app.getBaseData().then((data) => {
console.log(data, "======");
const { productData } = data;
baseData = productData;
this.setData({
isLoadding: false,
});
console.log(baseData, tabActive, sceneCode);
let item = baseData[tabActive].find(
(item) => item.sceneCode == sceneCode
);
console.log(item, this.data.isLoadding);
if (tabsActive === "3") {
videoList = item?.operationVideoList;
videoUrl = item?.operationVideoList[videoIndex]?.videoUrl;
videoObj = item?.operationVideoList[videoIndex];
// videoList= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList : productData[scenIndex][0].operationVideoList,
// videoUrl= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList[+operationVideoList].videoUrl : productData[scenIndex][0].operationVideoList[+videoIndex].videoUrl
} else {
console.log(item);
(videoList = item?.videoList),
(videoUrl = item.videoList[videoIndex]?.videoUrl);
videoObj = item?.videoList[videoIndex];
// videoList = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList : productData[scenIndex][0].videoList,
// videoUrl = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList[+videoIndex].videoUrl : productData[scenIndex][0].videoList[+videoIndex].videoUrl
}
const res = {
index: videoIndex,
scenIndex: scenIndex,
name: name,
videoName,
leftMenuIndex: leftMenuIndex,
videoList: videoList,
videoUrl: videoUrl,
tabsActive: tabsActive,
sceneCode: sceneCode
};
this.setData({
videoItem: res,
});
});
// let item = baseData[tabActive].find(
// (item) => item.sceneCode == sceneCode
// );
// console.log(item, this.data.isLoadding);
// let videoList = [];
// let videoUrl = "";
// let videoObj = {};
// 判断是案例视频还是操作指引视频
// if (tabsActive === "3") {
// videoList = item?.operationVideoList;
// videoUrl = item?.operationVideoList[videoIndex]?.videoUrl;
// videoObj = item?.operationVideoList[videoIndex];
// // videoList= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList : productData[scenIndex][0].operationVideoList,
// // videoUrl= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList[+operationVideoList].videoUrl : productData[scenIndex][0].operationVideoList[+videoIndex].videoUrl
// } else {
// console.log(item);
// (videoList = item?.videoList),
// (videoUrl = item.videoList[videoIndex]?.videoUrl);
// videoObj = item?.videoList[videoIndex];
// // videoList = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList : productData[scenIndex][0].videoList,
// // videoUrl = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList[+videoIndex].videoUrl : productData[scenIndex][0].videoList[+videoIndex].videoUrl
// }
// const res = {
// index: videoIndex,
// scenIndex: scenIndex,
// name: name,
// videoName,
// leftMenuIndex: leftMenuIndex,
// videoList: videoList,
// videoUrl: videoUrl,
// tabsActive: tabsActive,
// };
// this.setData({
// videoItem: res,
// });
if (name == "营销增值服务") {
wx.$Track.sendTrack(this.data.trackList[scenIndex][videoIndex]);
} else if (name == "客户数字化") {
wx.$Track.sendTrack(
this.data.systemTrackList[leftMenuIndex][videoIndex]
);
} }
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(videoName) utils.setNavigationBarTitle(videoName);
},100) }, 100);
getApp() getApp()
.login() .login()
.then(({ data }) => { .then(({ data }) => {
if (data && data.phone) { if (data && data.phone) {
this.setData({ this.setData({
hasPhoneNumber: true, hasPhoneNumber: true,
isLoadding: false isLoadding: false,
}) });
} }
}) });
// wx.$Track.sendTrack(this.data.trackList[scenIndex][res.index]) // wx.$Track.sendTrack(this.data.trackList[scenIndex][res.index])
} else { } else {
wx.$router.getData(res => { wx.$router.getData((res) => {
console.log(res, 'res'); console.log(res, "res");
this.setData({ this.setData({
videoItem: res, videoItem: res,
isLoadding: false isLoadding: false,
}) });
if (res.name == '营销增值服务') { if (res.name == "营销增值服务") {
wx.$Track.sendTrack(this.data.trackList[res.scenIndex][res.index]) wx.$Track.sendTrack(this.data.trackList[res.scenIndex][res.index]);
} else if (res.name == '客户数字化') { } else if (res.name == "客户数字化") {
wx.$Track.sendTrack(this.data.systemTrackList[res.leftMenuIndex][res.index]) wx.$Track.sendTrack(
this.data.systemTrackList[res.leftMenuIndex][res.index]
);
} }
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(this.data.videoItem.videoName) utils.setNavigationBarTitle(this.data.videoItem.videoName);
},100) }, 100);
}) });
} }
}, },
onRoute(options) {
console.log(options, "options");
if (!options) return;
let { scenIndex } = options;
this.setData({
tabActive: scenIndex,
});
},
// 下载视频 // 下载视频
downVideo() { downVideo() {
const _this = this const _this = this;
let {videoItem: {videoUrl}} = this.data let {
videoItem: { videoUrl },
} = this.data;
wx.getSetting({ wx.getSetting({
success: (res)=> { success: (res) => {
if(res.authSetting['scope.writePhotosAlbum']===false){ if (res.authSetting["scope.writePhotosAlbum"] === false) {
_this.setData({ _this.setData({
showAuth: true showAuth: true,
}) });
}else{ } else {
wx.$util.showToast('正在下载视频...') wx.$util.showToast("正在下载视频...");
wx.downloadFile({ wx.downloadFile({
url: videoUrl, url: videoUrl,
success(res) { success(res) {
...@@ -122,97 +222,102 @@ Page({ ...@@ -122,97 +222,102 @@ Page({
filePath: res.tempFilePath, filePath: res.tempFilePath,
success(res) { success(res) {
setTimeout(() => { setTimeout(() => {
wx.$util.showToast('下载成功!') wx.$util.showToast("下载成功!");
}, 2000) }, 2000);
}, },
fail({ errMsg }) { fail({ errMsg }) {
_this.setData({ _this.setData({
showAuth: errMsg == "saveVideoToPhotosAlbum:fail auth deny", showAuth:
}) errMsg == "saveVideoToPhotosAlbum:fail auth deny",
} });
}) },
});
} }
} },
}) });
} }
} },
}) });
}, },
chooseVideo(e) { chooseVideo(e) {
const {index, info: {name}} = e.detail const {
const {videoItem} = this.data index,
if (videoItem.name == '客户数字化') { info: { name },
} = e.detail;
const { videoItem } = this.data;
if (videoItem.name == "客户数字化") {
this.setData({ this.setData({
'videoItem.index': index "videoItem.index": index,
}) });
wx.$Track.sendTrack(this.data.systemTrackList[videoItem.leftMenuIndex][index]) wx.$Track.sendTrack(
} else if (videoItem.name == '营销增值服务') { this.data.systemTrackList[videoItem.leftMenuIndex][index]
);
} else if (videoItem.name == "营销增值服务") {
this.setData({ this.setData({
'videoItem.index': index "videoItem.index": index,
}) });
wx.$Track.sendTrack(this.data.trackList[videoItem.scenIndex][index]) wx.$Track.sendTrack(this.data.trackList[videoItem.scenIndex][index]);
} }
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(name) utils.setNavigationBarTitle(name);
},100) }, 100);
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const cardId = wx.$storage.get('scene').cardId const cardId = wx.$storage.get("scene").cardId;
// merchantId 兼容旧链接 // merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId const merchant =
const shareType = 'SHARE_VIDEO' wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId;
console.log(this.data.videoItem, 'this.data.videoItem'); const shareType = "SHARE_VIDEO";
const {index, scenIndex, videoUrl, name, leftMenuIndex, videoName, tabsActive} = this.data.videoItem console.log(this.data.videoItem, "this.data.videoItem");
const {
index,
scenIndex,
videoUrl,
name,
leftMenuIndex,
videoName,
tabsActive,
sceneCode
} = this.data.videoItem;
const tabActive = this.data.tabActive;
return { return {
title: `您好,我向你分享了一个视频`, title: `您好,我向你分享了一个视频`,
path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&scenIndex=${scenIndex}&videoIndex=${index}&name=${name}&leftMenuIndex=${leftMenuIndex}&videoName=${videoName}&tabsActive=${tabsActive}`
}
}
})
\ No newline at end of file \ No newline at end of file
path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&scenIndex=${scenIndex}&videoIndex=${index}&name=${name}&leftMenuIndex=${leftMenuIndex}&videoName=${videoName}&tabsActive=${tabsActive}&tabActive=${tabActive}&sceneCode=${sceneCode}`,
};
},
});
...@@ -171,12 +171,14 @@ Page({ ...@@ -171,12 +171,14 @@ Page({
info: { videoUrl }, info: { videoUrl },
scenIndex, scenIndex,
list, list,
tabsActive tabsActive,
sceneCode
} = e.detail } = e.detail
const videoList = list const videoList = list
const obj = { const obj = {
index, index,
videoList, videoList,
sceneCode,
videoUrl: videoUrl, videoUrl: videoUrl,
videoName: e.detail.info.name, videoName: e.detail.info.name,
hasPhoneNumber: this.data.hasPhoneNumber, hasPhoneNumber: this.data.hasPhoneNumber,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!