Commit 004af49b by 匡雅琴

提交

1 parent 15eb735a
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class">
<view class="pro-head">
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<!-- 有视频 -->
<block wx:if="{{!showCard}}">
<!-- <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" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> -->
<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}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
......@@ -29,7 +29,7 @@
<view class="prod-detail">
<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" 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}}">
<!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
......@@ -53,7 +53,7 @@
</block>
</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}}" 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 }}">
<!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> -->
......
......@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.3.tgz",
"integrity": "sha512-Ze+HdtFJImhOsWLfV+ZzB86Kf18pm9M9CZWhctPel/qJNMEn29g9ywC16NXmeac+gTu07MOpURyF+YmO8ojkJA=="
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.4.tgz",
"integrity": "sha512-lTELWZDFUd0wyab9/H3U/JVbypG26qCDm3wH7OA2ZJWoXFNv30YFeOB8IpyfNf8XbFoZFgy/qvrGFv1lVZDKrw=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.3"
"glsx-applet-component": "^1.1.4"
},
"devDependencies": {},
"scripts": {
......
// packagesList/pages/videoDetal/videoDetal.js
import {trackData} from '../../../utils/data'
import {productData} from '../../../pages/tab/index/constant/senceData'
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from '~/utils/util'
import { trackData } from "../../../utils/data";
// import {productData} from '../../../pages/tab/index/constant/senceData'
// import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from "~/utils/util";
Page({
/**
* 页面的初始数据
*/
......@@ -12,24 +11,41 @@ Page({
videoItem: {
index: 0,
videoList: [],
videoUrl: '',
videoUrl: "",
hasPhoneNumber: false,
tabsActive: 1
tabsActive: 1,
},
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: [
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2],
[trackData.SYSNUMBERVIDEO1],
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2, trackData.SYSNUMBERVIDEO1]
[
trackData.SYSUSERVIDEO1,
trackData.SYSUSERVIDEO2,
trackData.SYSNUMBERVIDEO1,
],
],
isLoadding: true,
showAuth: false
showAuth: false,
tabActive: 0,
},
/**
......@@ -38,82 +54,166 @@ Page({
onLoad(options) {
console.log(options);
if (options && options.cardId) {
wx.$trackData = options
wx.$storage.set('scene', options)
const spcList = [99]
const {videoIndex, scenIndex, name, leftMenuIndex, videoName, tabsActive } = options
let videoList = []
let videoUrl = ''
// 判断是案例视频还是操作指引视频
if (tabsActive === '3') {
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,
wx.$trackData = options;
wx.$storage.set("scene", options);
// const spcList = [99]
const {
videoIndex,
scenIndex,
name,
leftMenuIndex=0,
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])
tabsActive,
sceneCode,
tabActive,
} = options;
// 获取mock数据
const app = getApp();
let videoList = [];
let videoUrl = "";
let videoObj = {};
let baseData = [];
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(() => {
utils.setNavigationBarTitle(videoName)
},100)
utils.setNavigationBarTitle(videoName);
}, 100);
getApp()
.login()
.then(({ data }) => {
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
isLoadding: false
})
}
})
.login()
.then(({ data }) => {
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
isLoadding: false,
});
}
});
// wx.$Track.sendTrack(this.data.trackList[scenIndex][res.index])
} else {
wx.$router.getData(res => {
console.log(res, 'res');
wx.$router.getData((res) => {
console.log(res, "res");
this.setData({
videoItem: res,
isLoadding: false
})
if (res.name == '营销增值服务') {
wx.$Track.sendTrack(this.data.trackList[res.scenIndex][res.index])
} else if (res.name == '客户数字化') {
wx.$Track.sendTrack(this.data.systemTrackList[res.leftMenuIndex][res.index])
isLoadding: false,
});
if (res.name == "营销增值服务") {
wx.$Track.sendTrack(this.data.trackList[res.scenIndex][res.index]);
} else if (res.name == "客户数字化") {
wx.$Track.sendTrack(
this.data.systemTrackList[res.leftMenuIndex][res.index]
);
}
setTimeout(() => {
utils.setNavigationBarTitle(this.data.videoItem.videoName)
},100)
})
utils.setNavigationBarTitle(this.data.videoItem.videoName);
}, 100);
});
}
},
onRoute(options) {
console.log(options, "options");
if (!options) return;
let { scenIndex } = options;
this.setData({
tabActive: scenIndex,
});
},
// 下载视频
downVideo() {
const _this = this
let {videoItem: {videoUrl}} = this.data
const _this = this;
let {
videoItem: { videoUrl },
} = this.data;
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
success: (res) => {
if (res.authSetting["scope.writePhotosAlbum"] === false) {
_this.setData({
showAuth: true
})
}else{
wx.$util.showToast('正在下载视频...')
showAuth: true,
});
} else {
wx.$util.showToast("正在下载视频...");
wx.downloadFile({
url: videoUrl,
success(res) {
......@@ -122,97 +222,102 @@ Page({
filePath: res.tempFilePath,
success(res) {
setTimeout(() => {
wx.$util.showToast('下载成功!')
}, 2000)
wx.$util.showToast("下载成功!");
}, 2000);
},
fail({ errMsg }) {
_this.setData({
showAuth: errMsg == "saveVideoToPhotosAlbum:fail auth deny",
})
}
})
showAuth:
errMsg == "saveVideoToPhotosAlbum:fail auth deny",
});
},
});
}
}
})
},
});
}
}
})
},
});
},
chooseVideo(e) {
const {index, info: {name}} = e.detail
const {videoItem} = this.data
if (videoItem.name == '客户数字化') {
const {
index,
info: { name },
} = e.detail;
const { videoItem } = this.data;
if (videoItem.name == "客户数字化") {
this.setData({
'videoItem.index': index
})
wx.$Track.sendTrack(this.data.systemTrackList[videoItem.leftMenuIndex][index])
} else if (videoItem.name == '营销增值服务') {
"videoItem.index": index,
});
wx.$Track.sendTrack(
this.data.systemTrackList[videoItem.leftMenuIndex][index]
);
} else if (videoItem.name == "营销增值服务") {
this.setData({
'videoItem.index': index
})
wx.$Track.sendTrack(this.data.trackList[videoItem.scenIndex][index])
"videoItem.index": index,
});
wx.$Track.sendTrack(this.data.trackList[videoItem.scenIndex][index]);
}
setTimeout(() => {
utils.setNavigationBarTitle(name)
},100)
utils.setNavigationBarTitle(name);
}, 100);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
const cardId = wx.$storage.get('scene').cardId
const cardId = wx.$storage.get("scene").cardId;
// merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_VIDEO'
console.log(this.data.videoItem, 'this.data.videoItem');
const {index, scenIndex, videoUrl, name, leftMenuIndex, videoName, tabsActive} = this.data.videoItem
const merchant =
wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId;
const shareType = "SHARE_VIDEO";
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 {
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
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({
info: { videoUrl },
scenIndex,
list,
tabsActive
tabsActive,
sceneCode
} = e.detail
const videoList = list
const obj = {
index,
videoList,
sceneCode,
videoUrl: videoUrl,
videoName: e.detail.info.name,
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!