Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant-assemble
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ec14b4a9
authored
Jun 12, 2023
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
发现
1 parent
633346a7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
147 deletions
api/busassistantApi/BusassistantApi.js
package-lock.json
package.json
packagesList/packageDiscovery/pages/videoDetail/videoDetail.js
packagesList/packageDiscovery/pages/videoDetail/videoDetail.wxml
pages/tab/discovery/discovery.js
project.config.json
api/busassistantApi/BusassistantApi.js
View file @
ec14b4a
...
@@ -31,6 +31,15 @@ class BusassistantApi {
...
@@ -31,6 +31,15 @@ class BusassistantApi {
true
true
)
)
}
}
// 获取一级菜单下所在类别所有数据
getContentList
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.busassistant.discover.weapp.contentList'
,
...
data
},
true
)
}
}
}
...
...
package-lock.json
View file @
ec14b4a
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
"integrity"
:
"sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA=="
"integrity"
:
"sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA=="
},
},
"glsx-applet-component"
:
{
"glsx-applet-component"
:
{
"version"
:
"1.1.1
1
"
,
"version"
:
"1.1.1
3
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.1
1
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.1
3
.tgz"
,
"integrity"
:
"sha512-
Gu70TYByO1q+4ZiOR/aRJOdajgSJSnJTgeggjKDb1GUNVgPgb/iS9sGwyeAImBqGe++76Ws5LxLoegiixTzl4w
=="
"integrity"
:
"sha512-
erZj/7TIXcckvf2h+Mlr5rMt6YHQLUq9LysgkgbbYA/u6OCVY6pQcT70HBl0WwsoFT4CMbPZ+4gqUKWOP2RocA
=="
}
}
}
}
}
}
package.json
View file @
ec14b4a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"main"
:
"app.js"
,
"main"
:
"app.js"
,
"dependencies"
:
{
"dependencies"
:
{
"@vant/weapp"
:
"^1.10.7"
,
"@vant/weapp"
:
"^1.10.7"
,
"glsx-applet-component"
:
"^1.1.1
1
"
"glsx-applet-component"
:
"^1.1.1
3
"
},
},
"devDependencies"
:
{},
"devDependencies"
:
{},
"scripts"
:
{
"scripts"
:
{
...
...
packagesList/packageDiscovery/pages/videoDetail/videoDetail.js
View file @
ec14b4a
// packagesList/pages/videoDetal/videoDetal.js
// packagesList/pages/videoDetal/videoDetal.js
import
{
import
{
IMG_URL
IMG_URL
}
from
"~/utils/constantData.js"
;
}
from
"~/utils/constantData.js"
;
// import { senceData, productData } from "../constant/senceData";
// import { senceData, productData } from "../constant/senceData";
import
{
import
{
senceData
,
senceData
,
productData
productData
}
from
"~/pages/tab/discovery/constant/senceData"
;
}
from
"~/pages/tab/discovery/constant/senceData"
;
// 导入方法
// 导入方法
import
{
import
{
behavior
as
computedBehavior
behavior
as
computedBehavior
}
from
"~/utils/lib/miniprogram-computed"
;
}
from
"~/utils/lib/miniprogram-computed"
;
import
utils
from
'~/utils/util.js'
import
utils
from
'~/utils/util.js'
import
B
usassistantApi
from
"~/api/busassistantApi/index"
;
import
b
usassistantApi
from
"~/api/busassistantApi/index"
;
Page
({
Page
({
noPageAuth
:
true
,
noPageAuth
:
true
,
/**
/**
...
@@ -21,75 +22,54 @@ Page({
...
@@ -21,75 +22,54 @@ Page({
data
:
{
data
:
{
// senceData,
// senceData,
// productData,
// productData,
hasProduct
:
true
,
// videoItem: {
// index: 0,
// videoList: [],
// videoUrl: '',
// isShare: false,//是否是被分享出去
// tabsActive: 1
// },
isShare
:
false
,
hasVideo
:
true
,
videoObj
:
{},
videoData
:
{},
videoData
:
{},
videoId
:
''
,
videoId
:
''
,
videoItem
:
{
showAuth
:
false
,
index
:
0
,
sceneCode
:
''
videoList
:
[],
videoUrl
:
''
,
isShare
:
false
,
//是否是被分享出去
tabsActive
:
1
},
videoObj
:
{},
showAuth
:
false
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
async
onLoad
(
options
)
{
async
onLoad
(
options
)
{
// wx.$router.getData(res => {
// this.setData({
// videoItem: res
// })
// })
// if (!utils.isEmptyObj(options)) {
// let { isShare, videoIndex, tabActive, sceneCode, leftMenuIndex = 0, tabsActive } = options;
// let item = this.data.productData[tabActive].find(item => item.sceneCode == sceneCode)
// let videoList = []
// let videoUrl = ''
// let videoObj = {}
// if (tabsActive == '3') {
// videoList = item?.operationVideoList
// videoUrl = item?.operationVideoList[videoIndex]?.videoUrl
// videoObj = item?.operationVideoList[videoIndex]
// }else{
// videoList = item?.videoList,
// videoUrl = item.videoList[videoIndex]?.videoUrl
// videoObj = item?.videoList[videoIndex]
// }
// let videoItem = {
// index: videoIndex,
// videoList: videoList,
// videoUrl: videoUrl,
// tabsActive: tabsActive
// }
// this.setData({
// videoItem: videoItem,
// isShare: isShare,
// videoObj: videoObj,
// leftMenuIndex: leftMenuIndex
// })
// this.shareDataFn(options)
// }
if
(
utils
.
isEmptyObj
(
options
))
return
if
(
utils
.
isEmptyObj
(
options
))
return
const
{
const
{
id
,
typeId
,
isDigitalCase
,
tabsActive
,
isShare
}
=
options
;
id
,
let
videoLikeList
=
[];
isShare
}
=
options
;
let
videoData
=
await
this
.
getDetailWithLike
(
id
);
let
videoData
=
await
this
.
getDetailWithLike
(
id
);
if
(
!
videoData
||
videoData
?.
status
==
2
)
{
videoLikeList
=
videoData
.
likeList
if
(
isDigitalCase
==
'true'
)
{
// 调接口获取当前一级菜单下所有视频
videoLikeList
=
await
this
.
getVideoLikeList
(
typeId
,
tabsActive
);
this
.
setData
({
isDigitalCase
:
true
})
}
if
(
!
videoData
||
videoData
?.
status
==
2
)
{
this
.
setData
({
this
.
setData
({
isLoadding
:
false
,
isLoadding
:
false
,
hasProduct
:
false
hasVideo
:
false
})
})
return
return
}
}
this
.
setData
({
this
.
setData
({
videoData
,
videoData
,
videoLikeList
,
videoId
:
id
,
videoId
:
id
,
isShare
isLoadding
:
false
,
typeId
,
isShare
,
tabsActive
});
});
this
.
setpagesTitle
(
videoData
.
proName
)
this
.
setpagesTitle
(
videoData
.
proName
)
this
.
changeShareData
()
this
.
changeShareData
()
...
@@ -97,118 +77,111 @@ Page({
...
@@ -97,118 +77,111 @@ Page({
//接受跳转的路由参数(小程序页面跳转)
//接受跳转的路由参数(小程序页面跳转)
async
onRoute
(
options
)
{
async
onRoute
(
options
)
{
if
(
!
options
||
utils
.
isEmptyObj
(
options
)
||
options
.
isShare
)
return
if
(
!
options
||
utils
.
isEmptyObj
(
options
)
||
options
.
isShare
)
return
// let { scenIndex, videoList, index, leftMenuIndex = 0 } = options
let
{
id
,
typeId
,
sceneCode
,
tabsActive
}
=
options
;
// options.videoIndex = index
let
videoLikeList
=
[];
// options.tabActive = scenIndex
// this.setData({
// videoObj: videoList[index],
// leftMenuIndex: leftMenuIndex
// })
let
{
id
,
sceneCode
}
=
options
;
let
videoData
=
await
this
.
getDetailWithLike
(
id
);
let
videoData
=
await
this
.
getDetailWithLike
(
id
);
if
(
!
videoData
||
videoData
?.
status
==
2
)
{
videoLikeList
=
videoData
.
likeList
// 判断是不是在数字化转型案例菜单下
if
(
!
sceneCode
)
{
// 调接口获取当前一级菜单下所有视频
videoLikeList
=
await
this
.
getVideoLikeList
(
typeId
,
tabsActive
);
this
.
setData
({
isDigitalCase
:
true
})
}
if
(
!
videoData
||
videoData
?.
status
==
2
)
{
this
.
setData
({
this
.
setData
({
isLoadding
:
false
,
isLoadding
:
false
,
hasProduct
:
false
hasVideo
:
false
})
})
return
return
}
}
this
.
setData
({
this
.
setData
({
videoData
,
videoData
,
videoLikeList
,
isLoadding
:
false
,
isLoadding
:
false
,
videoId
:
id
,
videoId
:
id
,
sceneCode
typeId
,
tabsActive
});
});
this
.
setpagesTitle
(
videoData
.
proName
)
this
.
setpagesTitle
(
videoData
.
proName
)
this
.
changeShareData
()
this
.
changeShareData
()
},
},
// 分享数据函数
// 获取视频详情
// 获取视频详情
getDetailWithLike
(
id
)
{
getDetailWithLike
(
id
)
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
_data
;
let
_data
;
BusassistantApi
.
getDetailWithLike
({
busassistantApi
.
getDetailWithLike
({
id
}).
then
((
res
)
=>
{
id
console
.
log
(
res
);
}).
then
((
res
)
=>
{
_data
=
res
.
data
;
_data
=
res
.
data
;
resolve
(
_data
);
resolve
(
_data
);
});
});
});
});
},
},
shareDataFn
(
options
)
{
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
tabActive
,
videoIndex
,
tabsActive
}
=
options
this
.
setData
({
tabsActive
,
tabActive
:
tabActive
,
videoIndex
:
videoIndex
,
},
()
=>
{
this
.
changeShareData
(
options
)
});
},
changeShareData
()
{
changeShareData
()
{
let
{
let
{
title
}
=
this
.
data
.
videoData
title
let
{
sceneCode
,
videoId
,
isDigitalCase
,
typeId
,
tabsActive
}
=
this
.
data
}
=
this
.
data
.
videoData
let
{
sceneCode
,
videoId
}
=
this
.
data
// // 设置转发标题
// // 设置转发标题
// let userInfoObj = wx.$storage.get("userInfo");
// let userInfoObj = wx.$storage.get("userInfo");
// // #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
// // #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
// let name = userInfoObj.merchantName;
// let name = userInfoObj.merchantName;
this
.
shareTitle
=
`给您分享一个
${
title
}
视频`
;
let
{
proName
}
=
this
.
data
.
videoData
this
.
shareTitle
=
`给您分享一个
${
proName
}
视频`
;
//分享的数据
//分享的数据
// let senceItem = productData[tabActive][leftMenuIndex]
// let senceItem = productData[tabActive][leftMenuIndex]
this
.
shareQuery
=
`sceneCode=
${
sceneCode
}
&isShare=
${
true
}
&id=
${
videoId
}
`
this
.
shareQuery
=
`sceneCode=
${
sceneCode
}
&isShare=
${
true
}
&id=
${
videoId
}
&isDigitalCase=
${
isDigitalCase
}
&typeId=
${
typeId
}
&tabsActive=
${
tabsActive
}
`
this
.
shareAppMessage
=
{
this
.
shareAppMessage
=
{
title
:
t
itle
,
title
:
this
.
shareT
itle
,
path
:
`/
${
this
.
route
}
?
${
this
.
shareQuery
}
`
,
path
:
`/
${
this
.
route
}
?
${
this
.
shareQuery
}
`
,
query
:
this
.
shareQuery
query
:
this
.
shareQuery
}
}
},
},
// 切换视频
// 切换视频
async
chooseVideo
(
e
)
{
async
chooseVideo
(
e
)
{
const
{
const
{
title
,
id
}
=
e
.
detail
proName
,
id
}
=
e
.
detail
let
videoData
=
await
this
.
getDetailWithLike
(
id
);
let
videoData
=
await
this
.
getDetailWithLike
(
id
);
this
.
setData
({
this
.
setData
({
videoId
:
id
,
videoId
:
id
,
videoData
videoData
})
})
this
.
setpagesTitle
(
proName
)
this
.
setpagesTitle
(
videoData
.
proName
)
this
.
changeShareData
()
this
.
changeShareData
()
},
},
// 获取一级菜单下所有视频
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 { videoObj } = this.data
// let { videoObj } = this.data
// let url = videoObj.videoUrl
// let url = videoObj.videoUrl
let
{
let
{
videoId
}
=
this
.
data
videoId
const
{
vedioUrl
}
=
this
.
data
.
videoLikeList
.
find
(
item
=>
item
.
id
==
videoId
)
}
=
this
.
data
const
{
vedioUrl
}
=
this
.
data
.
videoData
.
likeList
.
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
)
{
_this
.
setData
({
_this
.
setData
({
showAuth
:
true
showAuth
:
true
})
})
}
else
{
}
else
{
wx
.
$api
.
showToast
(
'正在下载视频...'
)
wx
.
$api
.
showToast
(
'正在下载视频...'
)
wx
.
downloadFile
({
wx
.
downloadFile
({
url
:
vedioUrl
,
url
:
vedioUrl
,
...
@@ -221,9 +194,7 @@ Page({
...
@@ -221,9 +194,7 @@ Page({
wx
.
$api
.
showToast
(
'下载成功!'
)
wx
.
$api
.
showToast
(
'下载成功!'
)
},
2000
)
},
2000
)
},
},
fail
({
fail
({
errMsg
})
{
errMsg
})
{
_this
.
setData
({
_this
.
setData
({
showAuth
:
errMsg
==
"saveVideoToPhotosAlbum:fail auth deny"
,
showAuth
:
errMsg
==
"saveVideoToPhotosAlbum:fail auth deny"
,
})
})
...
@@ -248,7 +219,7 @@ Page({
...
@@ -248,7 +219,7 @@ Page({
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
*/
onReady
()
{},
onReady
()
{
},
//设置标题
//设置标题
setpagesTitle
(
title
)
{
setpagesTitle
(
title
)
{
//设置标题
//设置标题
...
@@ -257,12 +228,11 @@ Page({
...
@@ -257,12 +228,11 @@ Page({
},
100
)
},
100
)
},
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{
this
.
data
.
videoData
.
proName
&&
this
.
setpagesTitle
(
this
.
data
.
videoData
.
proName
)
},
},
/**
/**
...
...
packagesList/packageDiscovery/pages/videoDetail/videoDetail.wxml
View file @
ec14b4a
<!--packagesList/pages/videoDetal/videoDetal.wxml-->
<!--packagesList/pages/videoDetal/videoDetal.wxml-->
<!-- <gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bindchooseVideo="chooseVideo"></gl-video-detail> -->
<!-- <gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bindchooseVideo="chooseVideo"></gl-video-detail> -->
<block wx:if="{{!has
Product
}}">
<block wx:if="{{!has
Video
}}">
<no-product></no-product>
<no-product></no-product>
</block>
</block>
<block wx:else>
<block wx:else>
<gl-video-detail list="{{videoData
}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<gl-video-detail list="{{videoData}}" likeList="{{videoLikeList
}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<!-- 申请按钮 -->
<!-- 申请按钮 -->
<apply-button wx:if="{{!isShare}}" bindvideodown="downVideo"></apply-button>
<apply-button wx:if="{{!isShare}}" bindvideodown="downVideo"></apply-button>
...
...
pages/tab/discovery/discovery.js
View file @
ec14b4a
...
@@ -63,14 +63,15 @@ Component({
...
@@ -63,14 +63,15 @@ Component({
},
},
// 视频点击事件
// 视频点击事件
videoClick
(
e
)
{
videoClick
(
e
)
{
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
)
const
{
info
,
sceneCode
}
=
e
.
detail
const
{
// 一级菜单ID
info
,
const
typeId
=
this
.
data
.
myTabIdx
==
0
?
this
.
data
.
productDataId
:
this
.
data
.
systemDataId
sceneCode
}
=
e
.
detail
const
obj
=
{
const
obj
=
{
phone
:
userInfo
.
phone
,
hasPhoneNumber
:
this
.
data
.
hasPhoneNumber
,
id
:
info
.
id
,
id
:
info
.
info
.
id
,
tabsActive
:
info
.
tabsActive
,
sceneCode
,
typeId
}
}
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/videoDetail/videoDetail'
,
obj
)
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/videoDetail/videoDetail'
,
obj
)
},
},
...
@@ -242,7 +243,7 @@ Component({
...
@@ -242,7 +243,7 @@ Component({
url
:
"https://work.weixin.qq.com/kfid/kfcf7b721472201345e"
url
:
"https://work.weixin.qq.com/kfid/kfcf7b721472201345e"
},
},
corpId
:
"ww047bdc0f1e76cc13"
,
corpId
:
"ww047bdc0f1e76cc13"
,
complete
:
(
r
)
=>
{
},
complete
:
(
r
)
=>
{
},
});
});
},
},
...
@@ -272,12 +273,12 @@ Component({
...
@@ -272,12 +273,12 @@ Component({
const
systemData
=
res
[
1
].
list
const
systemData
=
res
[
1
].
list
// this.getSceneData(productData)
// this.getSceneData(productData)
this
.
setData
({
this
.
setData
({
[
'navList[0]'
]:
res
[
0
].
name
,
[
`tabList[0].name`
]:
res
[
0
].
name
,
[
'navList[1]'
]:
res
[
1
].
name
,
[
`tabList[1]name`
]:
res
[
1
].
name
,
systemData
,
systemData
,
showPage
:
true
,
systemDataId
:
res
[
1
].
id
,
productData
,
productData
,
curTabId
:
productData
?.[
this
.
data
.
curTabIdx
]?.
sceneid
||
0
productDataId
:
res
[
0
].
id
,
})
})
})
})
}
}
...
...
project.config.json
View file @
ec14b4a
{
{
"appid"
:
"wx
c50d04ae5aa9984a
"
,
"appid"
:
"wx
96c8f2a3e76907cb
"
,
"projectname"
:
"business-assistant"
,
"projectname"
:
"business-assistant"
,
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"packOptions"
:
{
"packOptions"
:
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment