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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
408 additions
and
428 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
...
@@ -2,34 +2,43 @@ import api from "~/utils/request/request";
...
@@ -2,34 +2,43 @@ import api from "~/utils/request/request";
const
path
=
"scrm.api.stoassistant"
;
const
path
=
"scrm.api.stoassistant"
;
class
BusassistantApi
{
class
BusassistantApi
{
// 获取小程序首页数据列表
// 获取小程序首页数据列表
getDiscoverList
(
data
)
{
getDiscoverList
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
'scrm.api.busassistant.discover.weapp.list'
,
method
:
'scrm.api.busassistant.discover.weapp.list'
,
...
data
...
data
},
},
true
true
)
)
}
}
// 获取特色产品内容详情
// 获取特色产品内容详情
getDiscoverDetail
(
data
)
{
getDiscoverDetail
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
'scrm.api.busassistant.discover.content.detail'
,
method
:
'scrm.api.busassistant.discover.content.detail'
,
...
data
...
data
},
},
true
true
)
)
}
}
// 获取案例视频、操作指引详情
// 获取案例视频、操作指引详情
getDetailWithLike
(
data
)
{
getDetailWithLike
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
'scrm.api.busassistant.discover.content.detailWithLike'
,
method
:
'scrm.api.busassistant.discover.content.detailWithLike'
,
...
data
...
data
},
},
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
import
{
// packagesList/pages/videoDetal/videoDetal.js
IMG_URL
}
from
"~/utils/constantData.js"
;
// import { senceData, productData } from "../constant/senceData";
import
{
senceData
,
productData
}
from
"~/pages/tab/discovery/constant/senceData"
;
// 导入方法
import
{
import
{
behavior
as
computedBehavior
IMG_URL
}
from
"~/utils/lib/miniprogram-computed"
;
}
from
"~/utils/constantData.js"
;
import
utils
from
'~/utils/util.js'
// import { senceData, productData } from "../constant/senceData";
import
BusassistantApi
from
"~/api/busassistantApi/index"
;
import
{
senceData
,
productData
}
from
"~/pages/tab/discovery/constant/senceData"
;
// 导入方法
import
{
behavior
as
computedBehavior
}
from
"~/utils/lib/miniprogram-computed"
;
import
utils
from
'~/utils/util.js'
import
busassistantApi
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
this
.
setData
({
isLoadding
:
false
,
if
(
isDigitalCase
==
'true'
)
{
hasProduct
:
false
// 调接口获取当前一级菜单下所有视频
})
videoLikeList
=
await
this
.
getVideoLikeList
(
typeId
,
tabsActive
);
return
this
.
setData
({
isDigitalCase
:
true
})
}
if
(
!
videoData
||
videoData
?.
status
==
2
)
{
this
.
setData
({
isLoadding
:
false
,
hasVideo
:
false
})
return
}
}
this
.
setData
({
this
.
setData
({
videoData
,
videoData
,
videoId
:
id
,
videoLikeList
,
isShare
videoId
:
id
,
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
this
.
setData
({
isLoadding
:
false
,
// 判断是不是在数字化转型案例菜单下
hasProduct
:
false
if
(
!
sceneCode
)
{
})
// 调接口获取当前一级菜单下所有视频
return
videoLikeList
=
await
this
.
getVideoLikeList
(
typeId
,
tabsActive
);
this
.
setData
({
isDigitalCase
:
true
})
}
if
(
!
videoData
||
videoData
?.
status
==
2
)
{
this
.
setData
({
isLoadding
:
false
,
hasVideo
:
false
})
return
}
}
this
.
setData
({
this
.
setData
({
videoData
,
videoData
,
isLoadding
:
false
,
videoLikeList
,
videoId
:
id
,
isLoadding
:
false
,
sceneCode
videoId
:
id
,
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
)
},
},
/**
/**
...
@@ -298,7 +268,7 @@ Page({
...
@@ -298,7 +268,7 @@ Page({
*/
*/
onShareAppMessage
()
{
onShareAppMessage
()
{
return
{
return
{
...
this
.
shareAppMessage
...
this
.
shareAppMessage
}
}
}
}
})
})
\ No newline at end of file
\ No newline at end of file
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
...
@@ -4,283 +4,284 @@
...
@@ -4,283 +4,284 @@
// import {scenceList} from "./constant/data"
// import {scenceList} from "./constant/data"
import
ActivityApi
from
"~/api/activityApi/index"
;
import
ActivityApi
from
"~/api/activityApi/index"
;
import
{
import
{
getActivityRecord
getActivityRecord
}
from
'~/api/viewprod'
}
from
'~/api/viewprod'
import
{
import
{
IMG_VERSION
IMG_VERSION
}
from
"~/utils/constantData"
;
}
from
"~/utils/constantData"
;
import
{
import
{
imgUrlMixin
imgUrlMixin
}
from
"~/mixins/index"
;
}
from
"~/mixins/index"
;
const
IMG_URL
=
wx
.
$imgUrl
;
const
IMG_URL
=
wx
.
$imgUrl
;
let
leftMenuIndex
=
0
let
leftMenuIndex
=
0
Component
({
Component
({
properties
:
{
properties
:
{
myTabIdx
:
Number
myTabIdx
:
Number
},
behaviors
:
[
imgUrlMixin
],
data
:
{
navList
:
[
"增值服务"
,
"客户数字化"
],
// myTabIdx: 0,
IMG_URL
,
// subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
// subscriptionSystemData: Object.freeze(subscriptionSystemData),
activityList
:
[],
resScenceList
:
[],
curTabIdx
:
0
,
curTabId
:
0
,
img_version
:
IMG_VERSION
(),
headerHeight
:
0
,
actNum
:
0
,
// navStyle,
sceneCodeList
:
[],
showPage
:
false
,
systemData
:
[],
productData
:
[],
},
methods
:
{
// 产品点击事件
proClick
(
e
)
{
//登录的用户手机号
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
const
{
info
,
sceneCode
}
=
e
.
detail
let
obj
=
{
phone
:
userInfo
.
phone
,
id
:
info
.
id
,
sceneCode
}
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/productDetail/productDetail'
,
obj
)
},
},
behaviors
:
[
imgUrlMixin
],
sysMenuClick
(
e
)
{
data
:
{
const
{
navList
:
[
"增值服务"
,
"客户数字化"
],
id
// myTabIdx: 0,
}
=
e
.
detail
;
IMG_URL
,
leftMenuIndex
=
id
;
// subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
},
// subscriptionSystemData: Object.freeze(subscriptionSystemData),
// 视频点击事件
activityList
:
[],
videoClick
(
e
)
{
resScenceList
:
[],
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
)
curTabIdx
:
0
,
const
{
curTabId
:
0
,
info
,
img_version
:
IMG_VERSION
(),
sceneCode
headerHeight
:
0
,
}
=
e
.
detail
actNum
:
0
,
const
obj
=
{
// navStyle,
phone
:
userInfo
.
phone
,
sceneCodeList
:
[],
id
:
info
.
id
,
showPage
:
false
,
}
systemData
:
[],
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/videoDetail/videoDetail'
,
obj
)
productData
:
[],
},
leftClick
(
e
)
{
const
{
sceneid
}
=
e
.
detail
const
idx
=
this
.
data
.
resScenceList
?.
findIndex
(
item
=>
item
.
sceneid
==
sceneid
)
||
0
this
.
setData
({
curTabId
:
sceneid
,
curTabIdx
:
idx
})
},
senceClick
(
e
)
{
// const { scenIndex } = e.detail
// wx.$router.go('/packageStoreAssistant/packageDiscovery/pages/scenarioDetail/scenarioDetail', {
// actNum: scenIndex
// })
// 如果没有sceneCode,或者没有配置banner跳转 isBannerLink 2-没有配置 1-有配置
if
(
!
e
.
detail
.
sceneCode
||
e
.
detail
.
isBannerLink
!=
1
)
return
const
{
hasPhoneNumber
}
=
this
.
data
// 获取场景
let
systemItem
=
this
.
data
.
systemData
.
find
(
item
=>
item
.
sceneCode
==
e
.
detail
.
sceneCode
)
let
productItem
=
this
.
data
.
productData
.
find
(
item
=>
item
.
sceneCode
==
e
.
detail
.
sceneCode
)
const
id
=
systemItem
?.
productList
[
0
].
id
||
productItem
?.
productList
[
0
].
id
if
(
!
id
)
return
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/productDetail/productDetail'
,
{
hasPhoneNumber
,
id
,
sceneCode
:
e
.
detail
.
sceneCode
})
},
},
methods
:
{
// 产品点击事件
proClick
(
e
)
{
//登录的用户手机号
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
const
{
info
,
sceneCode
}
=
e
.
detail
let
obj
=
{
phone
:
userInfo
.
phone
,
id
:
info
.
id
,
sceneCode
}
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/productDetail/productDetail'
,
obj
)
},
activityClick
(
e
)
{
sysMenuClick
(
e
)
{
const
id
=
e
.
detail
const
{
wx
.
$router
.
go
(
id
"/packagesList/packageDiscovery/pages/activityDetail/activityDetail"
,
{
}
=
e
.
detail
;
id
leftMenuIndex
=
id
;
}
},
);
// 视频点击事件
},
videoClick
(
e
)
{
const
{
info
,
sceneCode
}
=
e
.
detail
// 一级菜单ID
const
typeId
=
this
.
data
.
myTabIdx
==
0
?
this
.
data
.
productDataId
:
this
.
data
.
systemDataId
const
obj
=
{
hasPhoneNumber
:
this
.
data
.
hasPhoneNumber
,
id
:
info
.
info
.
id
,
tabsActive
:
info
.
tabsActive
,
sceneCode
,
typeId
}
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/videoDetail/videoDetail'
,
obj
)
},
leftClick
(
e
)
{
const
{
sceneid
}
=
e
.
detail
const
idx
=
this
.
data
.
resScenceList
?.
findIndex
(
item
=>
item
.
sceneid
==
sceneid
)
||
0
this
.
setData
({
curTabId
:
sceneid
,
curTabIdx
:
idx
})
},
senceClick
(
e
)
{
// const { scenIndex } = e.detail
// wx.$router.go('/packageStoreAssistant/packageDiscovery/pages/scenarioDetail/scenarioDetail', {
// actNum: scenIndex
// })
// 如果没有sceneCode,或者没有配置banner跳转 isBannerLink 2-没有配置 1-有配置
if
(
!
e
.
detail
.
sceneCode
||
e
.
detail
.
isBannerLink
!=
1
)
return
const
{
hasPhoneNumber
}
=
this
.
data
// 获取场景
let
systemItem
=
this
.
data
.
systemData
.
find
(
item
=>
item
.
sceneCode
==
e
.
detail
.
sceneCode
)
let
productItem
=
this
.
data
.
productData
.
find
(
item
=>
item
.
sceneCode
==
e
.
detail
.
sceneCode
)
const
id
=
systemItem
?.
productList
[
0
].
id
||
productItem
?.
productList
[
0
].
id
if
(
!
id
)
return
wx
.
$router
.
go
(
'/packagesList/packageDiscovery/pages/productDetail/productDetail'
,
{
hasPhoneNumber
,
id
,
sceneCode
:
e
.
detail
.
sceneCode
})
},
// 获取全部活动列表
activityClick
(
e
)
{
getActivityRecord
()
{
const
id
=
e
.
detail
getActivityRecord
({}).
then
(({
wx
.
$router
.
go
(
data
,
"/packagesList/packageDiscovery/pages/activityDetail/activityDetail"
,
{
code
,
id
message
}
})
=>
{
);
if
(
code
==
-
1
)
{
},
wx
.
showToast
({
title
:
message
,
icon
:
'none'
,
duration
:
2000
})
}
this
.
setData
({
activityList
:
data
})
})
},
changeMyTab
(
e
)
{
// 获取全部活动列表
const
{
getActivityRecord
()
{
id
getActivityRecord
({}).
then
(({
}
=
e
.
currentTarget
.
dataset
data
,
this
.
setData
({
code
,
myTabIdx
:
id
message
});
})
=>
{
},
if
(
code
==
-
1
)
{
onLoad
(
option
)
{
wx
.
showToast
({
// this.setData({
title
:
message
,
// tabIndex: option?.tabIndex || 0
icon
:
'none'
,
// })
duration
:
2000
this
.
getActivityRecord
()
})
},
}
emitUserInfo
(
options
)
{
this
.
setData
({
activityList
:
data
})
})
},
},
changeMyTab
(
e
)
{
getSceneData
(
list
)
{
const
{
const
{
id
merchantId
}
=
e
.
currentTarget
.
dataset
}
=
wx
.
$storage
.
get
(
"userInfo"
);
this
.
setData
({
wx
.
showLoading
({
myTabIdx
:
id
title
:
"加载中..."
,
});
});
},
ActivityApi
.
getOpenSceneList
({
onLoad
(
option
)
{
merchantId
,
// this.setData({
})
// tabIndex: option?.tabIndex || 0
.
then
((
res
)
=>
{
// })
wx
.
hideLoading
();
this
.
getActivityRecord
()
let
productData
=
[]
},
if
(
res
.
code
==
21
)
{
emitUserInfo
(
options
)
{
wx
.
$router
.
reLaunch
(
'/packageStoreAssistant/packageAuth/pages/authentication/login/login'
)
return
;
},
}
getSceneData
(
list
)
{
if
(
res
?.
data
?.
length
>
0
)
{
const
{
// let res ={
merchantId
// data: [
}
=
wx
.
$storage
.
get
(
"userInfo"
);
// {
wx
.
showLoading
({
// sceneCode: "SC001",
title
:
"加载中..."
,
// status: 1,
});
// },
ActivityApi
.
getOpenSceneList
({
// {
merchantId
,
// sceneCode: "SC002",
// status: 1,
// },
// {
// sceneCode: "SC003",
// status: 1,
// },
// {
// sceneCode: "SC004",
// status: 1,
// },
// {
// sceneCode: "SC005",
// status: 1,
// },
// ]
// }
let
openList
=
[]
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
status
==
1
)
{
openList
.
push
(
item
.
sceneCode
)
}
})
})
productData
=
list
.
filter
(
item
=>
openList
.
includes
(
item
.
sceneCode
))
.
then
((
res
)
=>
{
}
wx
.
hideLoading
();
let
productData
=
[]
})
if
(
res
.
code
==
21
)
{
.
catch
((
err
)
=>
{
wx
.
$router
.
reLaunch
(
'/packageStoreAssistant/packageAuth/pages/authentication/login/login'
)
this
.
setData
({
return
;
showPage
:
true
,
}
});
if
(
res
?.
data
?.
length
>
0
)
{
});
// let res ={
},
// data: [
navbarReady
(
e
)
{
// {
let
{
// sceneCode: "SC001",
height
// status: 1,
}
=
e
.
detail
;
// },
this
.
setData
({
// {
headerHeight
:
height
,
// sceneCode: "SC002",
});
// status: 1,
},
// },
onPageScroll
(
scrollTop
)
{
// {
let
opacity
=
scrollTop
/
100
;
// sceneCode: "SC003",
let
color
=
`rgba(255,255,255
${
opacity
>
1
?
1
:
opacity
}
)`
;
// status: 1,
// this.setData({
// },
// navStyle: scrollTop == 0 ? navStyle : `background-color:${color};`
// {
// })
// sceneCode: "SC004",
wx
.
$eventbus
.
emit
(
"evt_page_scroll"
,
{
// status: 1,
scrollTop
// },
});
// {
},
// sceneCode: "SC005",
// status: 1,
// },
// ]
// }
let
openList
=
[]
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
status
==
1
)
{
openList
.
push
(
item
.
sceneCode
)
}
})
productData
=
list
.
filter
(
item
=>
openList
.
includes
(
item
.
sceneCode
))
}
changeSwiper
(
e
)
{
})
this
.
setData
({
.
catch
((
err
)
=>
{
actNum
:
e
.
detail
.
currentItemId
,
this
.
setData
({
});
showPage
:
true
,
},
});
});
},
navbarReady
(
e
)
{
let
{
height
}
=
e
.
detail
;
this
.
setData
({
headerHeight
:
height
,
});
},
onPageScroll
(
scrollTop
)
{
let
opacity
=
scrollTop
/
100
;
let
color
=
`rgba(255,255,255
${
opacity
>
1
?
1
:
opacity
}
)`
;
// this.setData({
// navStyle: scrollTop == 0 ? navStyle : `background-color:${color};`
// })
wx
.
$eventbus
.
emit
(
"evt_page_scroll"
,
{
scrollTop
});
},
// 跳转咨询页面
changeSwiper
(
e
)
{
goConsult
()
{
this
.
setData
({
wx
.
openCustomerServiceChat
({
actNum
:
e
.
detail
.
currentItemId
,
extInfo
:
{
});
url
:
"https://work.weixin.qq.com/kfid/kfcf7b721472201345e"
},
},
corpId
:
"ww047bdc0f1e76cc13"
,
complete
:
(
r
)
=>
{},
});
},
applyActivity
()
{
// 跳转咨询页面
wx
.
$router
.
go
(
goConsult
()
{
"/packagesList/packageActivity/pages/applyActivity/applyActivity"
wx
.
openCustomerServiceChat
({
);
extInfo
:
{
},
url
:
"https://work.weixin.qq.com/kfid/kfcf7b721472201345e"
},
corpId
:
"ww047bdc0f1e76cc13"
,
complete
:
(
r
)
=>
{
},
});
},
applyActivity
()
{
wx
.
$router
.
go
(
"/packagesList/packageActivity/pages/applyActivity/applyActivity"
);
},
// 显示测算弹窗
// 显示测算弹窗
showCalculate
()
{
showCalculate
()
{
wx
.
$router
.
go
(
wx
.
$router
.
go
(
"/packagesList/packageDiscovery/pages/measure/measure/measure"
"/packagesList/packageDiscovery/pages/measure/measure/measure"
);
);
},
},
},
},
attached
()
{
attached
()
{
this
.
setData
({
isFullSucreen
:
wx
.
$api
.
isFullSucreen
(),
});
},
pageLifetimes
:
{
show
()
{
const
app
=
getApp
()
app
.
getBaseData
().
then
(
res
=>
{
const
productData
=
res
[
0
].
list
const
systemData
=
res
[
1
].
list
// this.getSceneData(productData)
this
.
setData
({
this
.
setData
({
[
'navList[0]'
]:
res
[
0
].
name
,
isFullSucreen
:
wx
.
$api
.
isFullSucreen
(),
[
'navList[1]'
]:
res
[
1
].
name
,
});
systemData
,
},
showPage
:
true
,
pageLifetimes
:
{
productData
,
show
()
{
curTabId
:
productData
?.[
this
.
data
.
curTabIdx
]?.
sceneid
||
0
const
app
=
getApp
()
})
app
.
getBaseData
().
then
(
res
=>
{
})
const
productData
=
res
[
0
].
list
const
systemData
=
res
[
1
].
list
// this.getSceneData(productData)
this
.
setData
({
[
`tabList[0].name`
]:
res
[
0
].
name
,
[
`tabList[1]name`
]:
res
[
1
].
name
,
systemData
,
systemDataId
:
res
[
1
].
id
,
productData
,
productDataId
:
res
[
0
].
id
,
})
})
}
}
}
}
});
});
\ No newline at end of file
\ No newline at end of file
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