Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
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 00f383e8
authored
Jun 15, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
版本提交
1 parent
91cbecf7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
25 deletions
api/busassistantApi.js
api/environment.js
app.js
package-lock.json
package.json
packagesList/pages/videoDetal/videoDetal.js
packagesList/pages/videoDetal/videoDetal.wxml
pages/tab/index/index.js
project.private.config.json
api/busassistantApi.js
View file @
00f383e
...
@@ -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
api/environment.js
View file @
00f383e
...
@@ -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
]];
...
...
app.js
View file @
00f383e
...
@@ -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
()
})
})
...
...
package-lock.json
View file @
00f383e
...
@@ -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.1
0
"
,
"version"
:
"1.1.1
3
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.1
0
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.1
3
.tgz"
,
"integrity"
:
"sha512-
0jJ1RT28em/lU4sak53LlU8hNgVWpgqDtF+2XxFMxlD8lT8jopA2zrEARJArRvjp0SNyxe58UXAdhJ/a8R/Kd
A=="
"integrity"
:
"sha512-
erZj/7TIXcckvf2h+Mlr5rMt6YHQLUq9LysgkgbbYA/u6OCVY6pQcT70HBl0WwsoFT4CMbPZ+4gqUKWOP2Roc
A=="
}
}
}
}
}
}
package.json
View file @
00f383e
...
@@ -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.1
0
"
"glsx-applet-component"
:
"^1.1.1
3
"
},
},
"devDependencies"
:
{},
"devDependencies"
:
{},
"scripts"
:
{
"scripts"
:
{
...
...
packagesList/pages/videoDetal/videoDetal.js
View file @
00f383e
...
@@ -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
.
video
Data
.
l
ikeList
.
find
(
item
=>
item
.
id
==
videoId
)
const
{
vedioUrl
}
=
this
.
data
.
video
L
ikeList
.
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
View file @
00f383e
<!--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>
...
...
pages/tab/index/index.js
View file @
00f383e
...
@@ -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
:
1
5
,
x
:
1
8
,
y
:
1
8
,
y
:
1
3
,
width
:
152
,
width
:
58
,
height
:
1
0
height
:
1
5
},
},
// 头像的
// 头像的
{
{
...
...
project.private.config.json
View file @
00f383e
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
}
}
},
},
"setting"
:
{
"setting"
:
{
"urlCheck"
:
fals
e
,
"urlCheck"
:
tru
e
,
"compileHotReLoad"
:
false
,
"compileHotReLoad"
:
false
,
"autoAudits"
:
true
"autoAudits"
:
true
},
},
...
...
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