Commit 00f383e8 by 匡雅琴

版本提交

1 parent 91cbecf7
...@@ -29,5 +29,15 @@ module.exports = { ...@@ -29,5 +29,15 @@ module.exports = {
}, },
true true
) )
} },
// 获取一级菜单下所在类别所有数据
getContentList(data) {
return api.post({
method: 'scrm.api.busassistant.discover.weapp.contentList',
...data
},
true
)
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -47,6 +47,7 @@ const domain = { ...@@ -47,6 +47,7 @@ const domain = {
ip: "http://192.168.3.181:8394", ip: "http://192.168.3.181:8394",
dev: "https://scrm.dev.glsx.com.cn", dev: "https://scrm.dev.glsx.com.cn",
uat: "https://scrm.test.glsx.com.cn", uat: "https://scrm.test.glsx.com.cn",
// uat: "https://scrm.glsx.com.cn",
beta: "https://scrm.beta.glsx.com.cn", beta: "https://scrm.beta.glsx.com.cn",
prod: "https://scrm.glsx.com.cn", prod: "https://scrm.glsx.com.cn",
}[target[index]]; }[target[index]];
......
...@@ -44,6 +44,7 @@ App({ ...@@ -44,6 +44,7 @@ App({
}) })
}, },
login(returnResponse) { login(returnResponse) {
console.log(222);
let _this = this let _this = this
let openId = null let openId = null
let wechatInfo = null let wechatInfo = null
...@@ -103,7 +104,8 @@ App({ ...@@ -103,7 +104,8 @@ App({
}) })
} }
}) })
.catch(() => { .catch((err) => {
console.log(err)
wx.$authStatus = true wx.$authStatus = true
reject() reject()
}) })
......
...@@ -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.10", "version": "1.1.13",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.10.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.13.tgz",
"integrity": "sha512-0jJ1RT28em/lU4sak53LlU8hNgVWpgqDtF+2XxFMxlD8lT8jopA2zrEARJArRvjp0SNyxe58UXAdhJ/a8R/KdA==" "integrity": "sha512-erZj/7TIXcckvf2h+Mlr5rMt6YHQLUq9LysgkgbbYA/u6OCVY6pQcT70HBl0WwsoFT4CMbPZ+4gqUKWOP2RocA=="
} }
} }
} }
...@@ -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.10" "glsx-applet-component": "^1.1.13"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
...@@ -11,10 +11,12 @@ Page({ ...@@ -11,10 +11,12 @@ Page({
*/ */
data: { data: {
videoData: {}, videoData: {},
videoLikeList: [],
videoId: '', videoId: '',
isLoadding: true, isLoadding: true,
showAuth: false, showAuth: false,
hasProduct: true hasProduct: true,
isDigitalCase: false
}, },
/** /**
...@@ -22,8 +24,23 @@ Page({ ...@@ -22,8 +24,23 @@ Page({
*/ */
async onLoad(options) { async onLoad(options) {
if (!options?.cardId && !options?.shareType) return if (!options?.cardId && !options?.shareType) return
const { id } = options; wx.$trackData = options
wx.$storage.set('scene', options)
const { id,typeId,isDigitalCase,tabsActive } = options;
let videoLikeList = [];
let videoData = await this.getDetailWithLike(id); let videoData = await this.getDetailWithLike(id);
videoLikeList = videoData.likeList
// 判断是不是在数字化转型案例菜单下
if (JSON.parse(isDigitalCase)) {
console.log(isDigitalCase);
// 调接口获取当前一级菜单下所有视频
videoLikeList = await this.getVideoLikeList(typeId,tabsActive);
this.setData({
isDigitalCase: true
})
}
// videoData?.status 1-上架 2-下架 // videoData?.status 1-上架 2-下架
if (!videoData || videoData?.status == 2) { if (!videoData || videoData?.status == 2) {
this.setData({ this.setData({
...@@ -34,18 +51,24 @@ Page({ ...@@ -34,18 +51,24 @@ Page({
} }
this.setData({ this.setData({
videoData, videoData,
videoLikeList,
videoId: id, videoId: id,
isLoadding: false isLoadding: false,
typeId,
tabsActive
}); });
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(videoData.proName) utils.setNavigationBarTitle(videoData.proName)
},100) },100)
getApp()
.login() getApp().login()
.then(({ data }) => { .then(({ data }) => {
console.log(data);
if (data && data.phone) { if (data && data.phone) {
this.setData({ this.setData({
hasPhoneNumber: true hasPhoneNumber: true,
isLoadding: false,
}) })
} }
}) })
...@@ -53,8 +76,20 @@ Page({ ...@@ -53,8 +76,20 @@ Page({
async onRoute(options) { async onRoute(options) {
if (!options || utils.isEmptyObj(options)) return; if (!options || utils.isEmptyObj(options)) return;
let { id } = options; console.log(options, '000');
let { id,typeId,sceneCode,tabsActive,hasPhoneNumber } = options;
let videoLikeList = [];
let videoData = await this.getDetailWithLike(id); let videoData = await this.getDetailWithLike(id);
videoLikeList = videoData.likeList
// 判断是不是在数字化转型案例菜单下
if (!sceneCode) {
// 调接口获取当前一级菜单下所有视频
videoLikeList = await this.getVideoLikeList(typeId,tabsActive);
this.setData({
isDigitalCase: true
})
}
// videoData?.status 1-上架 2-下架 // videoData?.status 1-上架 2-下架
if (!videoData || videoData?.status == 2) { if (!videoData || videoData?.status == 2) {
this.setData({ this.setData({
...@@ -65,8 +100,12 @@ Page({ ...@@ -65,8 +100,12 @@ Page({
} }
this.setData({ this.setData({
videoData, videoData,
videoLikeList,
isLoadding: false, isLoadding: false,
videoId: id videoId: id,
typeId,
tabsActive,
hasPhoneNumber
}); });
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(videoData.proName) utils.setNavigationBarTitle(videoData.proName)
...@@ -85,11 +124,29 @@ Page({ ...@@ -85,11 +124,29 @@ Page({
}); });
}, },
// 获取一级菜单下所有视频
getVideoLikeList(id,type) {
return new Promise((resolve) => {
let _data;
let params = {
menuId: id,
// 内容专区(1:特色产品,2:案例视频,3:营销海报,4:操作指引,5:banner)
type: type == 1 ? 2 : 4
}
console.log(params);
busassistantApi.getContentList(params).then((res) => {
console.log(res);
_data = res.data;
resolve(_data);
});
});
},
// 下载视频 // 下载视频
downVideo() { downVideo() {
const _this = this const _this = this
let {videoId} = this.data let {videoId} = this.data
const {vedioUrl} = this.data.videoData.likeList.find(item => item.id == videoId) const {vedioUrl} = this.data.videoLikeList.find(item => item.id == videoId)
wx.getSetting({ wx.getSetting({
success: (res)=> { success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){ if(res.authSetting['scope.writePhotosAlbum']===false){
...@@ -185,9 +242,10 @@ Page({ ...@@ -185,9 +242,10 @@ Page({
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_VIDEO' const shareType = 'SHARE_VIDEO'
const id = this.data.videoId const id = this.data.videoId
const {isDigitalCase,typeId,tabsActive} = this.data
return { return {
title: `您好,我向你分享了一个视频`, title: `您好,我向你分享了一个视频`,
path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&id=${id}` path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&id=${id}&isDigitalCase=${isDigitalCase}&typeId=${typeId}&tabsActive=${tabsActive}`
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/videoDetal/videoDetal.wxml--> <!--packagesList/pages/videoDetal/videoDetal.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding> <loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding && hasProduct }}"> <view wx:if="{{!isLoadding && hasProduct }}">
<gl-video-detail list="{{videoData}}" bind:chooseVideo="chooseVideo"></gl-video-detail> <gl-video-detail list="{{videoData}}" likeList="{{videoLikeList}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number> <phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<block wx:if="{{showAuth}}"> <block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize> <authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
......
...@@ -156,11 +156,15 @@ Page({ ...@@ -156,11 +156,15 @@ Page({
}, },
// 跳转视频详情 // 跳转视频详情
videoClick(e) { videoClick(e) {
console.log(e.detail);
const { info, sceneCode } = e.detail const { info, sceneCode } = e.detail
// 一级菜单ID
const typeId = this.data.curTabIndex == 0 ? this.data.productDataId : this.data.systemDataId
const obj = { const obj = {
hasPhoneNumber: this.data.hasPhoneNumber, hasPhoneNumber: this.data.hasPhoneNumber,
id:info.id, id:info.info.id,
tabsActive: info.tabsActive,
sceneCode,
typeId
} }
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj) wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj)
}, },
...@@ -284,7 +288,9 @@ Page({ ...@@ -284,7 +288,9 @@ Page({
[`tabList[0].name`]: res[0].name, [`tabList[0].name`]: res[0].name,
[`tabList[1]name`]: res[1].name, [`tabList[1]name`]: res[1].name,
systemData, systemData,
productData systemDataId: res[1].id,
productData,
productDataId: res[0].id,
}) })
}) })
const userInfo = wx.$util.getUserInfo() const userInfo = wx.$util.getUserInfo()
...@@ -370,10 +376,10 @@ Page({ ...@@ -370,10 +376,10 @@ Page({
}, },
{ {
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png', url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png',
x: 15, x: 18,
y: 18, y: 13,
width: 152, width: 58,
height: 10 height: 15
}, },
// 头像的 // 头像的
{ {
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
} }
}, },
"setting": { "setting": {
"urlCheck": false, "urlCheck": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"autoAudits": true "autoAudits": true
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!