Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
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 7d086788
authored
Dec 24, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
膨胀金活动
1 parent
c260c5ea
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
856 additions
and
319 deletions
components/proDetail/proDetail.js
components/proDetail/proDetail.wxml
package-lock.json
package.json
packagesList/pages/productDetail/productDetail.js
packagesList/pages/productDetail/productDetail.json
packagesList/pages/productDetail/productDetail.scss
packagesList/pages/productDetail/productDetail.wxml
packagesList/pages/scenarioDetail/scenarioDetail.js
packagesList/pages/videoDetal/videoDetal.js
packagesList/pages/videoDetal/videoDetal.json
packagesList/pages/videoDetal/videoDetal.wxml
pages/tab/index/components/indexProduct/indexProduct.scss
pages/tab/index/constant/data.js
pages/tab/index/constant/senceData.js
pages/tab/index/constant/systemData.js
pages/tab/index/index.js
pages/viewProd/index.js
pages/viewProd/index.scss
pages/viewProd/index.wxml
components/proDetail/proDetail.js
View file @
7d08678
...
...
@@ -29,6 +29,10 @@ Component({
activeUrl
:
{
type
:
String
,
value
:
''
},
sharephone
:
{
type
:
String
,
value
:
''
}
},
...
...
components/proDetail/proDetail.wxml
View file @
7d08678
...
...
@@ -36,11 +36,11 @@
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
</block>
<!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}">
<
!-- <
block wx:if="{{ index == 2 && showLeftFlag}}">
<button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情
</button>
</block>
</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}}" />
</block>
...
...
package-lock.json
View file @
7d08678
...
...
@@ -10,9 +10,9 @@
"integrity"
:
"sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
},
"glsx-applet-component"
:
{
"version"
:
"1.0.3
0
"
,
"resolved"
:
"https://registry.npm
mirror.com/glsx-applet-component/-/glsx-applet-component-1.0.30
.tgz"
,
"integrity"
:
"sha512-
knFullgv2HGJtYZZl809dBIgehzaftLCovDj2SQ+VOsASMNPa22LMzOPLL2n8y4oy5bgS7zMgLEwgUailTAbhw
=="
"version"
:
"1.0.3
2
"
,
"resolved"
:
"https://registry.npm
js.org/glsx-applet-component/-/glsx-applet-component-1.0.32
.tgz"
,
"integrity"
:
"sha512-
1YnE+r/tHpQS0FYLN/YV7EHvhOhY3leprkghtSpl3jjNP6KkMzrQoRuTatSIe3AWzVOKeXVP6ZsCIm9cdtB4pQ
=="
}
}
}
package.json
View file @
7d08678
...
...
@@ -5,7 +5,7 @@
"main"
:
"app.js"
,
"dependencies"
:
{
"@vant/weapp"
:
"^1.10.7"
,
"glsx-applet-component"
:
"^1.0.3
0
"
"glsx-applet-component"
:
"^1.0.3
2
"
},
"devDependencies"
:
{},
"scripts"
:
{
...
...
packagesList/pages/productDetail/productDetail.js
View file @
7d08678
// pa
ckagesList/pages/productDetail/productDetail
.js
// pa
ges/viewProd/index
.js
import
{
behavior
as
computedBehavior
}
from
'~/utils/lib/miniprogram-computed'
import
{
IMG_URL
}
from
'~/utils/constantData.js'
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
,
productData
}
from
'~/pages/tab/index/constant/senceData'
//
import USERAPI from '~/api/usersApi/index'
import
utils
from
'~/utils/util'
import
{
getActiveApi
}
from
'~/api/viewprod'
import
USERAPI
from
'~/api/usersApi/index'
import
utils
from
'~/utils/util
.js
'
import
{
getActiveApi
}
from
"~/api/viewprod"
Page
({
/**
...
...
@@ -17,19 +17,18 @@ Page({
senceData
,
productData
,
proInfo
:
{},
isShare
:
false
,
//是否是分享出去的
isShare
:
false
,
//是否是分享出去的
actNum
:
0
,
tabAct
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
img_version
:
'0.1.0'
,
// 是否授权昵称
hasUserInfo
:
false
,
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
,
//主要微信用户,服务商
cardInfo
:
{},
hasPhoneNumber
:
false
// 是否有授权手机号码
// phone: '', //授权手机号
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
//主要微信用户,服务商
},
// 计算属性
computed
:
{
...
...
@@ -38,172 +37,317 @@ Page({
// 2.点击可以改变状态
return
data
.
isShare
&&
!
data
.
showLeft
},
prodItemVideo
(
data
)
{
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
prodItemVideo
(
data
){
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
// return senceData[actNum]?.productList[activeNavIdx]
// if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0]
// }
// return senceData[actNum]?.videoList[activeNavIdx]
},
// 授权昵称弹框显示
authNcknameShow
(
data
)
{
authNcknameShow
(
data
){
return
data
.
isShare
&&
!
data
.
hasUserInfo
}
},
/**
* 生命周期函数--监听页面加载
* 分享出去,或扫码进来
*/
onLoad
(
options
)
{
this
.
getActiveApiFn
()
// 是否已经查看详情
this
.
isgetAuthphone
()
//接受跳转的路由参数(小程序页面跳转)
onRoute
(
options
)
{
// console.log( options);
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
actNum
=
0
,
activeNavIdx
=
0
,
phone
,
cardInfo
}
=
options
console
.
log
(
options
)
let
{
actNum
,
activeNavIdx
,
isShare
,
sharephone
}
=
options
if
(
isShare
){
wx
.
hideHomeButton
()
}
this
.
setData
({
actNum
,
//选中的场景下标
activeNavIdx
,
//选中的产品
sharephone
:
phone
,
//联系电话 (登陆的用户)
cardInfo
,
hasPhoneNumber
:
options
.
hasPhoneNumber
})
actNum
,
activeNavIdx
,
isShare
,
sharephone
});
let
wx_user_info
=
wx
.
$storage
.
get
(
'wx_user_info'
),
shareOpenId
=
wx_user_info
.
openId
||
''
// console.log('shareOpenId: ', shareOpenId);
// &shareOpenId=${shareOpenId}
// console.log(this.data.senceData, 'senceData-----')
const
senceList
=
productData
[
this
.
data
.
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
var
proInfo
=
{}
//分享数据
const
senceList
=
this
.
data
.
productData
[
this
.
data
.
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
let
item
=
senceList
[
i
]
let
proIdList
=
senceList
[
i
]?.
productList
.
map
(
k
=>
k
.
id
)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
proInfo
=
senceList
[
i
].
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
let
proInfo
=
item
.
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
this
.
setData
({
proInfo
,
sceneCode
:
item
.
sceneCode
||
''
})
break
}
}
// let senceItem = senceData[actNum]
// let item = senceData[actNum]?.productList[activeNavIdx]
let
item
=
this
.
data
.
proInfo
||
{}
setTimeout
(()
=>
{
utils
.
setNavigationBarTitle
(
item
?.
productName
)
},
100
)
this
.
shareQuery
=
`sceneCode=
${
this
.
data
.
sceneCode
}
&productCode=
${
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
sharephone
}
`
this.shareTrackData = {
sceneCode: this.data.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
// actNum,
// activeNavIdx,
}
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
if (!options || utils.isEmptyObj(options)) return
let { actNum = 0, activeNavIdx = 0,phone=123 } = options;
this.setData({
proInfo
})
actNum, //选中的场景下标
activeNavIdx, //选中的产品
sharephone:phone //联系电话 (登陆的用户)
});
// console.log(this.data.proInfo, '---------proInfo')
console.log(this.data.productData, 'this.data.productDat')
const senceList = this.data.productData[this.data.actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = senceList[i]?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
sceneCode: item.sceneCode || ''
})
break
}
}
// 设置转发标题
let
userInfoObj
=
wx
.
$storage
.
get
(
'userInfo'
)
let userInfoObj = wx.$storage.get(
"userInfo");
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let
name
=
userInfoObj
.
merchantName
this
.
shareTitle
=
`
${
name
}
给你分享一个活动
${
proInfo
.
productName
}
,戳我参与~`
let name = userInfoObj.merchantName
;
this.shareTitle = `
$
{
name
}
给你分享一个活动
$
{
this
.
data
.
proInfo
?.
productName
}
,戳我参与
~
`;
//分享数据
let
item
=
proInfo
//
console.log('title2',item.productName)
let item =
this.data.proInfo || {}
console.log('title2',item.productName)
setTimeout(() => {
utils.setNavigationBarTitle(item.productName)
},
100
)
},100)
//分享人openId
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId
=
wx_user_info
.
openId
||
''
shareOpenId = wx_user_info.openId || ''
// &shareOpenId=
${
shareOpenId
}
this
.
shareQuery
=
`sceneCode=
${
senceData
[
actNum
]
.
sceneCode
}
&productCode=
${
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
phone
}
`
this.shareQuery = `
sceneCode
=
$
{
this
.
data
.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
phone
}
`
this.shareTrackData = {
sceneCode:
senceData[actNum]?
.sceneCode,
sceneCode:
this.data
.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId: shareOpenId
shareOpenId:shareOpenId
// actNum,
// activeNavIdx,
// apiData,
}
},
onPageScroll: (function () {
let timer = null
return function (e) {
// console.log(e)
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer)
timer = setTimeout(() => {
let proDetail = this.selectComponent('#pro-detail')
proDetail.pageSroll(e)
}, 100)
}
})(),
//获取配置url
async getActiveApiFn()
{
let {
code, data
} = await getActiveApi()
if
(code == 0)
{
async getActiveApiFn(){
let {
code,data
} = await getActiveApi()
if
(code == 0)
{
this.setData({
activeUrl: data
})
}
},
// 是否已经查看详情
isgetAuthphone()
{
let authphone = wx.$storage.get(
'authphone')
if
(authphone)
{
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
},
300)
this.setData({
showLeft: true
})
//触发浏览埋点
// this.onLoad(null)
isgetAuthphone(){
let authphone = wx.$storage.get(
"authphone");
if
(authphone)
{
// 显示后面的内容
setTimeout(() => {
//
this.getImgHeight()
},
300)
this.setData({
showLeft: true
})
//触发浏览埋点
// this.onLoad(null)
}
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log(e)
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
let proDetail = this.selectComponent("#pro-detail")
proDetail.pageSroll(e)
}, 100);
};
})(),
/**
* 生命周期函数--监听页面
加载
* 生命周期函数--监听页面
初次渲染完成
*/
onLoad(options) {
this.getActiveApiFn()
// 是否已经查看详情
this.isgetAuthphone()
if (!options || utils.isEmptyObj(options)) return
let { actNum, activeNavIdx, isShare, sharephone } = options
if (isShare) {
wx.hideHomeButton()
}
onReady() {
this.init()
// this.getImgHeight();
},
// getImgHeight() {
// let query = wx.createSelectorQuery().in(this);
// let heightArr = [];
// let imgTopArr = [];
// let s = 0;
// let top;
// let {scrollTop} = this.data
// let _this = this;
this.setData({
actNum,
activeNavIdx,
isShare,
sharephone
// query
// .selectAll(".img-item")
// .boundingClientRect((react) => {
// react.forEach((item, index) => {
// //44 tab的高度
// // console.log('item',item)
// s = item.top - 44 + scrollTop;
// imgTopArr.push(s);
// });
// _this.setData({
// imgTopArr,
// });
// })
// .exec();
// // setTimeout(() => {
// // console.log('imgTopArr',this.data.imgTopArr)
// // },500)
// },
phoneCall(e) {
let { phone } = e.currentTarget.dataset;
wx.$api.phoneCall(phone);
},
async init() {
try {
const { data, code, message } = await USERAPI.wxCodeLogin()
if (code == '0') {
this.loginToken = data
} else this.reLogin(message)
wx.hideLoading()
} catch ({ errMsg }) {
console.error(errMsg)
this.reLogin()
}
},
/**获取loginToken */
reLogin(message) {
wx.showModal({
content: message || '获取loginToken失败',
confirmText: '重试',
confirmColor: '#3666FE'
}).then(({ confirm }) => {
if (confirm) this.init()
})
},
// 获取用户信息(手机号)
getUserInfo({ detail }) {
// console.log(detail);
//分享数据
let senceItem = senceData[actNum]
let item = senceData[actNum]?.productList[activeNavIdx]
console.log('title', item.productName)
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: " "+item.productName,
// });
utils.setNavigationBarTitle(item.productName)
}, 100)
if (!detail.code) return;
// this.setBtnLoading()
USERAPI.getUserProfile(this.loginToken, detail)
.then((result) => {
// console.log(result)
let userInfo = wx.$storage.get("wx_user_info");
// console.log('userInfo: ', userInfo);
let { phone } = result;
wx.$storage.set('authphone', phone)
// console.log('phone: ', phone);
wx.$storage.set("wx_user_info", {
...userInfo,
phone,
});
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
// console.log('shareOpenId: ', shareOpenId);
// &shareOpenId=
${
shareOpenId
}
// 显示后面的内容
setTimeout(() => {
// this.getImgHeight()
},300)
this.setData({
showLeft: true
})
//触发浏览埋点
this.onLoad(null)
this.shareQuery = `
sceneCode
=
$
{
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
sharephone
}
`
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId: shareOpenId
// actNum,
// activeNavIdx,
}
})
.catch(({ errMsg }) => {
wx.$api.showToast(errMsg || "系统异常");
// this.setBtnLoading(false)
});
},
// 获取用户昵称(昵称头像)
getUserProfile(e) {
//关闭授权框
this.setData({
hasUserInfo: true
})
let _this = this
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: '用于完善资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: res => {
// console.log('res: ', res.userInfo.nickName);
// userInfo.nickName
this.setData({
userInfo: res.userInfo
})
let wx_user_info = wx.$storage.get('wx_user_info')
// console.log('wx_user_info: ', wx_user_info);
let obj = {
...wx_user_info,
nickName: res.userInfo.nickName,
avatarUrl: res.userInfo.avatarUrl
}
// console.log('obj',obj)
wx.$storage.set('wx_user_info', obj)
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
_this.onLoad(null)
}
})
},
// 1.3查看活动详情按钮
// checkActive(){
// // 跳转
// // console.log('跳转')
// let {activeUrl} = this.data
// wx.$router.jumpH5(activeUrl);
// },
/**
* 生命周期函数--监听页面显示
*/
...
...
@@ -233,12 +377,9 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {},
// 更新手机号码
updatePhoneNumber(e) {
console.log(e.detail)
this.setData({
hasPhoneNumber: e.detail ? true : false
})
}
})
/**
* 浏览埋点
*/
onShareTimeline() {},
onViewTrack: true
});
packagesList/pages/productDetail/productDetail.json
View file @
7d08678
{
"usingComponents"
:
{
"pro-detail"
:
"../../../components/proDetail/proDetail"
,
"
pro-phone-number"
:
"../../../components/PhoneNumber/PhoneNumber
"
"
apply-button"
:
"../../../pages/viewVideo/components/apply-button/index
"
}
}
\ No newline at end of file
packagesList/pages/productDetail/productDetail.scss
View file @
7d08678
...
...
@@ -10,3 +10,19 @@
height
:
100vh
;
overflow
:
hidden
;
}
.more-btn
{
position
:
absolute
;
left
:
50%
;
bottom
:
50px
;
transform
:
translateX
(
-50%
);
width
:
622rpx
;
height
:
96rpx
;
background-image
:
url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/btn.png")
;
background-size
:
100%
100%
;
font-weight
:
500
;
font-size
:
16px
;
color
:
#ffffff
;
text-align
:
center
;
line-height
:
96rpx
;
}
packagesList/pages/productDetail/productDetail.wxml
View file @
7d08678
<!--packagesList/pages/productDetail/productDetail.wxml-->
<pro-detail id="pro-detail" custom-class="{{
!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx
}}"></pro-detail>
<pro-detail id="pro-detail" custom-class="{{
showLeftFlag?'max_page_height':''}}" sharephone="{{sharephone}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl
}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
\ No newline at end of file
<block wx:if="{{showLeftFlag}}">
<button class="more-btn" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情
</button>
</block>
<!-- 申请按钮 不是分享出去的显示按钮 -->
<apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button>
<!-- 授权昵称 -->
<view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view>
\ No newline at end of file
packagesList/pages/scenarioDetail/scenarioDetail.js
View file @
7d08678
//
packagesList/pages/productDetail/productDetail.js
import
{
behavior
as
computedBehavior
}
from
'~/utils/lib/miniprogram-computed'
//
场景详情
import
{
behavior
as
computedBehavior
}
from
"~/utils/lib/miniprogram-computed"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
,
productData
}
from
"~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index'
import
utils
from
'~/utils/util'
// import {getActiveApi} from "~/api/viewprod"
import
{
senceData
,
productData
}
from
'~/pages/tab/index/constant/senceData'
import
USERAPI
from
"~/api/usersApi/index"
;
import
utils
from
"~/utils/util.js"
;
import
{
getActiveApi
}
from
"~/api/viewprod"
;
Page
({
/**
* 页面的初始数据
*/
...
...
@@ -18,162 +17,365 @@ Page({
senceData
,
productData
,
proInfo
:
{},
isShare
:
false
,
//是否是分享出去的
isShare
:
false
,
//是否是分享出去的
actNum
:
0
,
tabAct
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
img_version
:
'0.1.0'
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
img_version
:
"0.1.0"
,
// 是否授权昵称
hasUserInfo
:
false
,
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
//主要微信用户,服务商
phone
:
""
,
//授权手机号
prodItemVideo
:
""
,
//选中的场景下的video的第一个
},
// 计算属性
computed
:
{
showLeftFlag
(
data
)
{
// 1.分享出去
// 2.点击可以改变状态
return
data
.
isShare
&&
!
data
.
showLeft
return
data
.
isShare
&&
!
data
.
showLeft
;
},
prodItemVideo
(
data
)
{
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
// if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0]
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
;
// return senceData[actNum]?.productList[activeNavIdx]
// console.log("senceData[actNum]", senceData[actNum]);
// if (actNum == 2) {
// return senceData[actNum]?.noVideoPicture[0];
// }
// return senceData[actNum]?.videoList[
activeNavIdx]
// return senceData[actNum]?.videoList[
0];
},
// 授权昵称弹框显示
authNcknameShow
(
data
){
return
data
.
isShare
&&
!
data
.
hasUserInfo
}
authNcknameShow
(
data
)
{
return
data
.
isShare
&&
!
data
.
hasUserInfo
;
},
},
/**
* 生命周期函数--监听页面加载
* 分享出去,或扫码进来
*/
onLoad
(
options
)
{
this
.
getActiveApiFn
();
this
.
noNeedPhone
();
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
;
let
{
actNum
,
activeNavIdx
,
isShare
,
phone
}
=
options
;
if
(
isShare
)
{
wx
.
hideHomeButton
();
}
//接受跳转的路由参数(小程序页面跳转)
onRoute
(
options
)
{
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
actNum
=
0
,
activeNavIdx
=
0
,
phone
}
=
options
// wx.$Track.sendTrack()
this
.
setData
({
actNum
,
//选中的场景下标
activeNavIdx
,
//选中的产品
sharephone
:
phone
//联系电话 (登陆的用户)
})
actNum
,
activeNavIdx
,
isShare
,
phone
,
});
//
console.log(this.data.senceData, 'senceData-----')
const
senceList
=
productData
[
this
.
data
.
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
var
proInfo
=
{}
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
//
分享数据
const
senceList
=
this
.
data
.
productData
[
this
.
data
.
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
let
item
=
senceList
[
i
]
let
proIdList
=
senceList
[
i
]?.
productList
.
map
(
k
=>
k
.
id
)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
proInfo
=
senceList
[
i
].
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
let
proInfo
=
item
.
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
this
.
setData
({
proInfo
,
sceneCode
:
item
.
sceneCode
||
''
})
break
}
}
this
.
setData
({
proInfo
})
// 分享描述
this
.
shareTitle
=
`给你分享一个
${
senceData
[
actNum
]?.
tabname
}
,戳我参与
~
`;
//分享数据
let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx];
console.log("title", item.productName);
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: item.productName,
// });
utils.setNavigationBarTitle(senceData[actNum].tabname);
}, 100);
// console.log(this.data.proInfo, '---------proInfo')
this.shareQuery = `
sceneCode
=
$
{
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
phone
=
$
{
phone
}
`;
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
// actNum,
// activeNavIdx,
};
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
if (!options || utils.isEmptyObj(options)) return;
let { actNum = 0, activeNavIdx = 0, phone = 123 } = options;
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
phone, //联系电话
});
// 设置转发标题
let
userInfoObj
=
wx
.
$storage
.
get
(
"userInfo"
)
let userInfoObj = wx.$storage.get("userInfo")
;
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let
name
=
userInfoObj
.
merchantName
this
.
shareTitle
=
`
${
name
}
给你分享一个
活动
${
proInfo
.
productName
}
,戳我参与~`
let name = userInfoObj.merchantName
;
this.shareTitle = `
$
{
name
}
给你分享一个
$
{
senceData
[
actNum
]?.
tabname
}
,戳我参与
~
`;
//分享数据
let
item
=
proInfo
// console.log('title2',item.productName)
let item =
senceData[actNum]?.productList[activeNavIdx];
console.log("title2", item.productName);
setTimeout(() => {
utils
.
setNavigationBarTitle
(
item
.
productName
)
},
100
)
// wx.setNavigationBarTitle({
// title: item.productName,
// });
utils.setNavigationBarTitle(senceData[actNum].tabname);
}, 100);
//分享人openId
let
wx_user_info
=
wx
.
$storage
.
get
(
'wx_user_info'
),
shareOpenId
=
wx_user_info
.
openId
||
''
this
.
shareQuery
=
`sceneCode=
${
senceData
[
actNum
].
sceneCode
}
&productCode=
${
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
phone
}
`
this.shareQuery = `
sceneCode
=
$
{
senceData
[
actNum
].
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
phone
=
$
{
phone
}
`;
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
// actNum,
// activeNavIdx,
// apiData,
};
},
onClickTab(event) {
// console.log('event: ', event);s
let { index } = event.detail;
// console.log('index: ', index);
this.setData({
tabAct: index,
});
let { imgTopArr } = this.data;
wx.pageScrollTo({
scrollTop: imgTopArr[index] + 5,
});
},
//获取配置url
async getActiveApiFn() {
let { code, data } = await getActiveApi();
if (code == 0) {
this.setData({
activeUrl: data,
});
}
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log(e)
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
let proDetail = this.selectComponent("#pro-detail")
proDetail.pageSroll(e)
let { imgTopArr } = this.data;
// console.log("滚动结束",imgTopArr,e.scrollTop);
// wx.$eventbus.emit('evt_page_scroll', { scrollTop: e.scrollTop })
wx.nextTick(() => {
let idx;
if (imgTopArr[0] > e.scrollTop) {
idx = 0;
} else if (
imgTopArr[imgTopArr.length - 1] > e.scrollTop &&
imgTopArr[0] < e.scrollTop
) {
idx = imgTopArr.findIndex((item) => item > e.scrollTop) - 1;
} else {
idx = imgTopArr.length - 1;
}
this.setData({
tabAct: idx,
scrollTop: e.scrollTop,
});
});
}, 100);
};
})(),
/**
* 生命周期函数--监听页面
加载
* 生命周期函数--监听页面
初次渲染完成
*/
onLoad(options) {
onReady() {
this.init();
// this.getImgHeight();
},
// getImgHeight() {
// let query = wx.createSelectorQuery().in(this);
// let heightArr = [];
// let imgTopArr = [];
// let s = 0;
// let top;
// let { scrollTop } = this.data;
// let _this = this;
// query
// .selectAll(".img-item")
// .boundingClientRect((react) => {
// react.forEach((item, index) => {
// //44 tab的高度
// // console.log('item',item)
// s = item.top - 44 + scrollTop;
// imgTopArr.push(s);
// });
// _this.setData({
// imgTopArr,
// });
// })
// .exec();
// // setTimeout(() => {
// // console.log('imgTopArr',this.data.imgTopArr)
// // },500)
// },
phoneCall(e) {
let { phone } = e.currentTarget.dataset;
wx.$api.phoneCall(phone);
},
async init() {
try {
const { data, code, message } = await USERAPI.wxCodeLogin();
if (code == "0") {
this.loginToken = data;
} else this.reLogin(message);
wx.hideLoading();
} catch ({ errMsg }) {
console.error(errMsg);
this.reLogin();
}
},
/**获取loginToken */
reLogin(message) {
wx.showModal({
content: message || "获取loginToken失败",
confirmText: "重试",
confirmColor: "#3666FE",
}).then(({ confirm }) => {
if (confirm) this.init();
});
},
// 不需要详情按钮
noNeedPhone() {
// 显示后面的内容
setTimeout(() => {
// this.getImgHeight();
}, 300);
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.setData({
showLeft: true,
});
},
// 获取用户信息(手机号)
getUserInfo({ detail }) {
// console.log(detail);
if (!detail.code) return;
// this.setBtnLoading()
USERAPI.getUserProfile(this.loginToken, detail)
.then((result) => {
// console.log(result)
let userInfo = wx.$storage.get("wx_user_info");
// console.log('userInfo: ', userInfo);
let { phone } = result;
// console.log('phone: ', phone);
wx.$storage.set("wx_user_info", {
...userInfo,
phone,
});
// 显示后面的内容
setTimeout(() => {
// this.getImgHeight();
}, 300);
this.setData({
showLeft: true,
});
})
.catch(({ errMsg }) => {
wx.$api.showToast(errMsg || "系统异常");
// this.setBtnLoading(false)
});
},
// 获取用户昵称(昵称头像)
getUserProfile(e) {
//关闭授权框
this.setData({
hasUserInfo: true,
});
let _this = this;
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
// console.log('res: ', res.userInfo.nickName);
// userInfo.nickName
this.setData({
userInfo: res.userInfo,
});
let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info);
let obj = {
...wx_user_info,
nickName: res.userInfo.nickName,
avatarUrl: res.userInfo.avatarUrl,
};
// console.log('obj',obj)
wx.$storage.set("wx_user_info", obj);
_this.onLoad(null);
},
});
},
// 1.3查看活动详情按钮
checkActive() {
// 跳转
// console.log('跳转')
let { activeUrl } = this.data;
wx.$router.jumpH5(activeUrl);
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
onShareAppMessage() {},
});
packagesList/pages/videoDetal/videoDetal.js
View file @
7d08678
// packagesList/pages/videoDetal/videoDetal.js
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
,
productData
}
from
"~/pages/tab/index/constant/senceData"
;
// 导入方法
import
{
behavior
as
computedBehavior
}
from
"~/utils/lib/miniprogram-computed"
;
import
utils
from
'~/utils/util.js'
Page
({
noPageAuth
:
true
,
/**
* 页面的初始数据
*/
data
:
{
senceData
,
productData
,
videoItem
:
{
index
:
0
,
videoList
:
[],
videoUrl
:
''
,
hasPhoneNumber
:
false
}
isShare
:
false
,
//是否是被分享出去
}
,
videoObj
:
{}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
console
.
log
(
options
)
wx
.
$router
.
getData
(
res
=>
{
console
.
log
(
res
)
this
.
setData
({
videoItem
:
res
})
})
if
(
!
utils
.
isEmptyObj
(
options
))
{
let
{
isShare
,
videoIndex
,
tabActive
,
sceneCode
}
=
options
;
let
item
=
this
.
data
.
productData
[
tabActive
].
find
(
item
=>
item
.
sceneCode
==
sceneCode
)
let
videoItem
=
{
index
:
videoIndex
,
videoList
:
item
?.
videoList
,
videoUrl
:
item
?.
videoList
[
videoIndex
]
}
this
.
setData
({
videoItem
:
videoItem
,
isShare
:
isShare
,
//
})
this
.
shareDataFn
(
options
)
}
},
//接受跳转的路由参数(小程序页面跳转)
onRoute
(
options
)
{
console
.
log
(
options
,
'onroute'
)
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
videoList
,
index
}
=
options
options
.
videoIndex
=
index
this
.
setData
({
videoObj
:
videoList
[
index
]
})
this
.
setpagesTitle
()
this
.
shareDataFn
(
options
)
},
// 分享数据函数
shareDataFn
(
options
)
{
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
tabActive
,
videoIndex
}
=
options
// console.log("options: ", options, !!options);
// console.log('tabActive,videoIndex: ', tabActive,videoIndex);
this
.
setData
({
tabActive
:
tabActive
,
videoIndex
:
videoIndex
,
});
//
//分享的数据
this
.
changeShareData
()
},
changeShareData
()
{
let
{
senceData
,
tabActive
,
videoIndex
,
videoObj
}
=
this
.
data
// // 设置转发标题
// let userInfoObj = wx.$storage.get("userInfo");
// // #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
// let name = userInfoObj.merchantName;
tabActive
=
99
this
.
shareTitle
=
`给您分享一个
${
videoObj
.
name
}
视频`
;
//分享的数据
let
senceItem
=
productData
[
tabActive
][
videoIndex
]
this
.
shareQuery
=
`sceneCode=
${
senceItem
?.
sceneCode
}
&
isShare
=
$
{
true
}
&
tabActive
=
$
{
tabActive
}
&
videoIndex
=
$
{
videoIndex
}
`
},
// 下载视频
downVideo() {
let
{
videoItem
:
{
url
}
}
=
this
.
data
let {
videoItem: { url }
} = this.data
console.log(url)
},
// 申请合作
...
...
@@ -43,8 +101,12 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
onReady() { },
//设置标题
setpagesTitle() {
//设置标题
let { videoObj } = this.data
utils.setNavigationBarTitle(videoObj.name)
},
/**
...
...
packagesList/pages/videoDetal/videoDetal.json
View file @
7d08678
{
"usingComponents"
:
{
"gl-video-detail"
:
"glsx-applet-component/video-detail/index"
"gl-video-detail"
:
"glsx-applet-component/video-detail/index"
,
"apply-button"
:
"../../../pages/viewVideo/components/apply-button/index"
}
}
\ No newline at end of file
packagesList/pages/videoDetal/videoDetal.wxml
View file @
7d08678
<!--packagesList/pages/videoDetal/videoDetal.wxml-->
<!-- aaa -->
<gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}"></gl-video-detail>
<phone-number type="{{'video'}}" bindvideodown="downVideo" bindtoForward="toForward" bindtoApplication="toApplication" hasPhoneNumber="{{videoItem.hasPhoneNumber}}"></phone-number>
\ No newline at end of file
<!-- 申请按钮 -->
<apply-button wx:if="{{!isShare}}" bindvideodown="downVideo"></apply-button>
\ No newline at end of file
pages/tab/index/components/indexProduct/indexProduct.scss
View file @
7d08678
...
...
@@ -120,7 +120,7 @@
.van-tab--active
{
.van-ellipsis
{
font-weight
:
600
;
font-size
:
40
rpx
;
font-size
:
36
rpx
;
color
:
#323436
;
overflow
:
visible
;
text-overflow
:
auto
;
...
...
pages/tab/index/constant/data.js
View file @
7d08678
...
...
@@ -188,7 +188,7 @@ var senceData = [
// name: "0-12个月",
msg
:
"1.2次新车膨胀金活动"
,
"sceneCode"
:
"SC003"
,
tabname
:
'
膨胀金活动
'
,
tabname
:
'
客户线上化
'
,
banner
:
`
${
IMG_URL
}
index/banner/banner3.png`
,
scrollText
:
'已发布种草软文100+篇,促进门店二次转化客户到店,欢迎各经销商咨询'
,
sceneImgs
:[
...
...
@@ -459,6 +459,63 @@ var senceData = [
]
},
{
name
:
''
,
img
:
'scene_within_12mth.png'
,
active
:
'icon-car21'
,
playImg
:
'img2'
,
src
:
`
${
IMG_URL
}
index/car3.png`
,
msg
:
"1.2次新车膨胀金活动"
,
"sceneCode"
:
"SC005"
,
tabname
:
'膨胀金活动'
,
banner
:
`
${
IMG_URL
}
index/banner/banner5.png`
,
scrollText
:
'已发布种草软文100+篇,促进门店二次转化客户到店,欢迎各经销商咨询'
,
sceneImgs
:[
`
${
IMG_URL
}
index/scene/scene20.png`
,
`
${
IMG_URL
}
index/scene/scene21.png`
,
`
${
IMG_URL
}
index/scene/scene22.png`
,
`
${
IMG_URL
}
index/scene/scene23.png`
,
],
productImgs
:[
`
${
IMG_URL
}
index/productImgs/product60.webp`
,
`
${
IMG_URL
}
index/productImgs/product61.webp`
,
`
${
IMG_URL
}
index/productImgs/product62.webp`
,
`
${
IMG_URL
}
index/productImgs/product63.webp`
,
`
${
IMG_URL
}
index/productImgs/product64.webp`
,
`
${
IMG_URL
}
index/productImgs/product65.webp`
,
],
productList
:
[
{
img
:
'product-img3'
,
proName
:
'膨胀金'
,
price
:
'100'
,
profit
:
'180000'
,
type
:
'service'
,
productType
:
'protectMembrane'
,
path
:
'paintProtect'
,
sale
:
100
,
//销量
varType
:
0
,
flow
:
10000
,
"productCode"
:
"PC010"
,
"productName"
:
"膨胀金"
,
"category"
:
"服务类"
,
prodImg
:
`
${
IMG_URL
}
index/prod2/prod5-0.png`
,
tabList
:
[
'项目介绍'
,
'活动方案'
,
'销售场景'
,
'合作案例'
,
'合作方式'
,
'FAQ'
]
}
],
//无视频时显示的图片
noVideoPicture
:
[],
videoList
:[
{
videoUrl
:
`
${
videoBaseUrl
}
video/fragrance.mp4`
,
posterUrl
:
`
${
IMG_URL
}
index/poster/fragrance.png`
,
name
:
'售后膨胀金活动'
,
manufacturer
:
'嘀加智慧'
,
view
:
3298
}
],
posterList
:[]
},
// {
// name: '3年以上',
// img: 'scene_talk.png',
...
...
pages/tab/index/constant/senceData.js
View file @
7d08678
...
...
@@ -75,6 +75,7 @@ const scenario_0 = [
sceneImgs
:
sceneImgs0
,
// 产品详情图片
productImgs
:
productImgs0
,
"sceneCode"
:
"SC001"
,
productList
:
[
{
id
:
0
,
...
...
@@ -134,6 +135,7 @@ const scenario_1 = [
name
:
'膜类'
,
sceneImgs
:
sceneImgs1
,
productImgs
:
productImgs1
,
"sceneCode"
:
"SC002"
,
productList
:
[
{
id
:
0
,
...
...
@@ -185,6 +187,7 @@ const scenario_2 = [
name
:
'膜类'
,
sceneImgs
:
sceneImgs2
,
productImgs
:
productImgs2
,
"sceneCode"
:
"SC003"
,
productList
:
[
{
id
:
0
,
...
...
@@ -301,6 +304,7 @@ const posterList3 = [
const
scenario_3
=
[
{
name
:
'美容类'
,
"sceneCode"
:
"SC004"
,
productList
:
[
{
id
:
0
,
...
...
pages/tab/index/constant/systemData.js
View file @
7d08678
...
...
@@ -44,6 +44,7 @@ const subscriptionSystemData = [
// sceneImgs: sceneImgs5,
// 产品详情图片
productImgs
:
productImgs0
,
"sceneCode"
:
"SC005"
,
productList
:
[
{
id
:
0
,
...
...
@@ -117,6 +118,7 @@ const subscriptionSystemData = [
name
:
'客户活跃'
,
//场景详情图片
sceneImgs
:
sceneImgs5
,
"sceneCode"
:
"SC006"
,
// 产品详情图片
productImgs
:
productImgs0
,
productList
:
[
...
...
pages/tab/index/index.js
View file @
7d08678
...
...
@@ -61,21 +61,17 @@ Page({
proClick
(
e
)
{
let
{
detail
}
=
e
//登录的用户手机号
console
.
log
(
detail
)
// let userInfo = wx.$storage.get("userInfo")
const
{
cardInfo
}
=
this
.
data
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
let
obj
=
{
// || 99
actNum
:
isNaN
(
detail
.
scenIndex
)
?
99
:
detail
.
scenIndex
,
//选中的场景 没有就是订阅系统的
activeNavIdx
:
detail
.
id
,
//选中的产品,
cardInfo
,
hasPhoneNumber
:
this
.
data
.
hasPhoneNumber
phone
:
userInfo
.
phone
}
wx
.
$router
.
go
(
'/packagesList/pages/productDetail/productDetail'
,
obj
)
},
// 跳转视频详情
videoClick
(
e
)
{
console
.
log
(
e
.
detail
)
const
{
index
,
info
:
{
videoUrl
},
...
...
@@ -88,28 +84,30 @@ Page({
// console.log(productData[0])
//const videoList = productData[scenIndex][0].videoList
const
videoList
=
list
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
wx
.
$router
.
go
(
'/packagesList/pages/videoDetal/videoDetal'
,
{
index
,
videoList
,
scenIndex
:
scenIndex
,
videoUrl
:
videoUrl
,
hasPhoneNumber
:
this
.
data
.
hasPhoneNumber
phone
:
userInfo
.
phone
})
},
// 跳转活动页
activityClick
(
e
)
{
const
{
hasPhoneNumber
}
=
this
.
data
const
id
=
e
.
detail
console
.
log
(
e
)
wx
.
$router
.
go
(
'/packagesList/pages/activityDetail/activityDetail'
,
{
hasPhoneNumber
,
id
})
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
wx
.
$router
.
go
(
'/packagesList/pages/activityDetail/activityDetail'
,
{
phone
:
userInfo
.
phone
,
id
})
},
// 场景跳转
senceClick
(
e
)
{
const
{
hasPhoneNumber
}
=
this
.
data
console
.
log
(
e
)
const
{
scenIndex
}
=
e
.
detail
wx
.
$router
.
go
(
'/packagesList/pages/scenarioDetail/scenarioDetail'
,
{
hasPhoneNumber
,
actNum
:
scenIndex
})
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
wx
.
$router
.
go
(
'/packagesList/pages/scenarioDetail/scenarioDetail'
,
{
actNum
:
scenIndex
,
phone
:
userInfo
.
phone
})
},
//引导图
guideFn
()
{
...
...
@@ -129,13 +127,10 @@ Page({
// navbar高度设置
navbarReady
(
e
)
{
let
{
height
,
statusBarHeight
}
=
e
.
detail
// console.log('height, statusBarHeight: ', height, statusBarHeight);
this
.
setData
({
headerHeight
:
height
/
2
+
statusBarHeight
,
// headerHeight: height / 2 + statusBarHeight + 88 * 2
})
// console.log(e)
// console.log(this.data.headerHeight)
},
selectCar
(
e
)
{
let
actNum
=
e
.
detail
...
...
@@ -145,7 +140,7 @@ Page({
},
// 头部看线索,产品切换
changeTabIndx
(
e
)
{
console
.
log
(
'e.detail: '
,
e
.
detail
)
//
console.log('e.detail: ', e.detail)
let
{
sessionId
}
=
wx
.
$storage
.
get
()
// console.log("sessionId: ", sessionId);
let
param
=
{
...
...
@@ -174,12 +169,12 @@ Page({
},
// 跳转咨询页面
goConsult
()
{
console
.
log
(
'跳转到咨询页面'
)
//
console.log('跳转到咨询页面')
wx
.
pro
.
openCustomerServiceChat
({
extInfo
:
{
url
:
'https://work.weixin.qq.com/kfid/kfcf7b721472201345e'
},
corpId
:
'ww047bdc0f1e76cc13'
,
complete
:
r
=>
{
console
.
log
(
r
)
//
console.log(r)
}
})
},
...
...
pages/viewProd/index.js
View file @
7d08678
...
...
@@ -4,7 +4,8 @@ import { IMG_URL } from "~/utils/constantData.js";
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
USERAPI
from
'~/api/usersApi/index'
import
utils
from
'~/utils/util.js'
import
{
getActiveApi
}
from
"~/api/viewprod"
import
{
getActiveApi
}
from
"~/api/viewprod"
const
norTabList
=
[
'项目亮点'
,
'合作案例'
,
'合作方式'
,
'适配产品'
]
Page
({
/**
...
...
@@ -15,18 +16,19 @@ Page({
data
:
{
IMG_URL
,
senceData
,
isShare
:
false
,
//是否是分享出去的
isShare
:
false
,
//是否是分享出去的
actNum
:
0
,
tabAct
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
img_version
:
'0.1.0'
,
// 是否授权昵称
hasUserInfo
:
false
,
// phone: '', //授权手机号
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
//主要微信用户,服务商
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
,
//主要微信用户,服务商,
tabList
:
[]
},
// 计算属性
computed
:
{
...
...
@@ -35,16 +37,16 @@ Page({
// 2.点击可以改变状态
return
data
.
isShare
&&
!
data
.
showLeft
},
prodItemVideo
(
data
){
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
prodItemVideo
(
data
)
{
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
// return senceData[actNum]?.productList[activeNavIdx]
if
(
actNum
==
2
)
{
if
(
actNum
==
2
)
{
return
senceData
[
actNum
]?.
noVideoPicture
[
0
]
}
return
senceData
[
actNum
]?.
videoList
[
activeNavIdx
]
},
// 授权昵称弹框显示
authNcknameShow
(
data
){
authNcknameShow
(
data
)
{
return
data
.
isShare
&&
!
data
.
hasUserInfo
}
...
...
@@ -59,8 +61,8 @@ Page({
this
.
isgetAuthphone
()
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
actNum
,
activeNavIdx
,
isShare
,
sharephone
}
=
options
if
(
isShare
)
{
let
{
actNum
,
activeNavIdx
,
isShare
,
sharephone
}
=
options
if
(
isShare
)
{
wx
.
hideHomeButton
()
}
...
...
@@ -74,17 +76,17 @@ Page({
//分享数据
let
senceItem
=
senceData
[
actNum
]
let
item
=
senceData
[
actNum
]?.
productList
[
activeNavIdx
]
console
.
log
(
'title'
,
item
.
productName
)
console
.
log
(
'title'
,
item
.
productName
)
setTimeout
(()
=>
{
// wx.setNavigationBarTitle({
// title: " "+item.productName,
// });
utils
.
setNavigationBarTitle
(
item
.
productName
)
},
100
)
},
100
)
let
wx_user_info
=
wx
.
$storage
.
get
(
'wx_user_info'
),
shareOpenId
=
wx_user_info
.
openId
||
''
shareOpenId
=
wx_user_info
.
openId
||
''
// console.log('shareOpenId: ', shareOpenId);
// &shareOpenId=${shareOpenId}
...
...
@@ -95,7 +97,7 @@ Page({
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
shareOpenId:
shareOpenId
// actNum,
// activeNavIdx,
}
...
...
@@ -104,12 +106,13 @@ Page({
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
if (!options || utils.isEmptyObj(options)) return
let { actNum = 0, activeNavIdx = 0,
phone=
123 } = options;
let { actNum = 0, activeNavIdx = 0,
phone =
123 } = options;
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
sharephone:phone //联系电话 (登陆的用户)
sharephone: phone, //联系电话 (登陆的用户)
tabList: senceData[actNum]?.productList[activeNavIdx].tabList || norTabList
});
// 设置转发标题
...
...
@@ -118,22 +121,22 @@ Page({
let name = userInfoObj.merchantName;
this.shareTitle = `
$
{
name
}
给你分享一个活动
$
{
senceData
[
actNum
]?.
productList
[
activeNavIdx
].
proName
}
,戳我参与
~
`;
//分享数据
let item = senceData[actNum]?.productList[activeNavIdx]
console.log('title2',item.productName)
console.log('title2',
item.productName)
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: " "+item.productName,
// });
utils.setNavigationBarTitle(item.productName)
},100)
},
100)
//分享人openId
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
shareOpenId = wx_user_info.openId || ''
// &shareOpenId=
${
shareOpenId
}
this.shareQuery = `
sceneCode
=
$
{
senceData
[
actNum
].
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
phone
}
`
...
...
@@ -143,7 +146,7 @@ Page({
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
shareOpenId:
shareOpenId
// actNum,
// activeNavIdx,
// apiData,
...
...
@@ -151,28 +154,28 @@ Page({
},
//获取配置url
async getActiveApiFn(){
let {
code,data
} = await getActiveApi()
if
(code == 0)
{
async getActiveApiFn()
{
let {
code, data
} = await getActiveApi()
if
(code == 0)
{
this.setData({
activeUrl: data
})
}
},
// 是否已经查看详情
isgetAuthphone(){
isgetAuthphone()
{
let authphone = wx.$storage.get("authphone");
if
(authphone)
{
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
},
300)
this.setData({
showLeft: true
})
//触发浏览埋点
// this.onLoad(null)
if
(authphone)
{
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
},
300)
this.setData({
showLeft: true
})
//触发浏览埋点
// this.onLoad(null)
}
},
...
...
@@ -200,17 +203,17 @@ Page({
// console.log("滚动结束",imgTopArr,e.scrollTop);
// wx.$eventbus.emit('evt_page_scroll', { scrollTop: e.scrollTop })
wx.nextTick(() => {
let idx
if
(imgTopArr[0]>e.scrollTop)
{
let idx
if
(imgTopArr[0] > e.scrollTop)
{
idx = 0
}
else if(imgTopArr[imgTopArr.length-1]>e.scrollTop && imgTopArr[0]<e.scrollTop)
{
idx = imgTopArr.findIndex((item) => item >e.scrollTop) - 1;
} else{
idx = imgTopArr.length
-
1
}
else if (imgTopArr[imgTopArr.length - 1] > e.scrollTop && imgTopArr[0] < e.scrollTop)
{
idx = imgTopArr.findIndex((item) => item >
e.scrollTop) - 1;
} else
{
idx = imgTopArr.length
-
1
}
this.setData({
tabAct: idx,
scrollTop:e.scrollTop
scrollTop:
e.scrollTop
});
});
}, 100);
...
...
@@ -229,7 +232,7 @@ Page({
let imgTopArr = [];
let s = 0;
let top;
let {
scrollTop
} = this.data
let {
scrollTop
} = this.data
let _this = this;
query
...
...
@@ -246,10 +249,10 @@ Page({
});
})
.exec();
// setTimeout(() => {
// console.log('imgTopArr',this.data.imgTopArr)
// },500)
// setTimeout(() => {
// console.log('imgTopArr',this.data.imgTopArr)
// },500)
},
phoneCall(e) {
let { phone } = e.currentTarget.dataset;
...
...
@@ -299,14 +302,14 @@ Page({
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
},300)
},
300)
this.setData({
showLeft: true
})
//触发浏览埋点
this.onLoad(null)
})
.catch(({ errMsg }) => {
...
...
@@ -346,45 +349,54 @@ Page({
})
},
// 1.3查看活动详情按钮
checkActive(){
checkActive()
{
// 跳转
// console.log('跳转')
let {
activeUrl
} = this.data
let {
activeUrl
} = this.data
wx.$router.jumpH5(activeUrl);
},
// 长按图片
handleLongPress(e) {
let { actnum, index } = e.target.dataset
// 膨胀金活动,合作方式
if (actnum == 4 && index == 4) {
wx.$router.jumpH5('https://1064147.ma3you.cn/articles/OdEQmwb/');
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
onShareAppMessage() {
},
/**
* 浏览埋点
*/
onShareTimeline() {},
onShareTimeline() {
},
onViewTrack: true
});
pages/viewProd/index.scss
View file @
7d08678
...
...
@@ -212,6 +212,36 @@ page {
width
:
100%
;
height
:
2002rpx
;
}
// // 流程图五
.img-item40
{
width
:
100%
;
height
:
1564rpx
;
}
.img-item41
{
width
:
100%
;
height
:
1224rpx
;
}
.img-item42
{
width
:
100%
;
height
:
1148rpx
;
}
.img-item43
{
width
:
100%
;
height
:
3504rpx
;
}
.img-item44
{
width
:
100%
;
height
:
2220rpx
;
}
.img-item45
{
width
:
100%
;
height
:
1092rpx
;
}
}
}
/* 用户授权 */
...
...
pages/viewProd/index.wxml
View file @
7d08678
...
...
@@ -15,10 +15,11 @@
<!-- <image class="no-video" wx:if="{{actNum == 2}}" src="{{IMG_URL}}index/poster/no-video.png?v={{img_version}}" /> -->
<view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab title="项目亮点"></van-tab>
<van-tab wx:for="{{tabList}}" title="{{item}}" wx:key="idnex" />
<!-- <van-tab title="项目亮点"></van-tab>
<van-tab title="合作案例"></van-tab>
<van-tab title="合作方式"></van-tab>
<van-tab title="适配产品"></van-tab>
<van-tab title="适配产品"></van-tab>
-->
</van-tabs>
</view>
<view class="prod-detail">
...
...
@@ -49,7 +50,7 @@
</button>
</block>
</image>
<image wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item img-item{{index}} img-item{{actNum}}{{index}}" src="{{item}}?v={{img_version}}">
<image wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item img-item{{index}} img-item{{actNum}}{{index}}" src="{{item}}?v={{img_version}}"
bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}"
>
</image>
</block>
<view class="occupancy" wx:if="{{!isShare}}">
...
...
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