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 117bc7ae
authored
Apr 07, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改banner分享进入空白问题
1 parent
87e53b7f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
86 deletions
packagesList/pages/scenarioDetail/scenarioDetail.js
packagesList/pages/scenarioDetail/scenarioDetail.wxml
pages/tab/index/index.js
packagesList/pages/scenarioDetail/scenarioDetail.js
View file @
117bc7a
// packagesList/pages/productDetail/productDetail.js
// 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
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
,
productData
}
from
"~/pages/tab/index/constant/senceData"
//
import { senceData, productData } from "~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index'
// import USERAPI from '~/api/usersApi/index'
import
utils
from
'~/utils/util'
import
utils
from
"~/utils/util"
;
import
{
trackData
}
from
'../../../utils/data'
import
{
trackData
}
from
"../../../utils/data"
;
import
{
entmicroApi
}
from
'../../../api/api'
import
{
entmicroApi
}
from
"../../../api/api"
;
import
Draw
from
'../../../utils/Draw'
import
Draw
from
"../../../utils/Draw"
;
// import {getActiveApi} from "~/api/viewprod"
// import {getActiveApi} from "~/api/viewprod"
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
*/
*/
...
@@ -18,82 +17,105 @@ Page({
...
@@ -18,82 +17,105 @@ Page({
behaviors
:
[
computedBehavior
],
behaviors
:
[
computedBehavior
],
data
:
{
data
:
{
IMG_URL
,
IMG_URL
,
senceData
,
//
senceData,
productData
,
productData
:
{}
,
proInfo
:
{},
proInfo
:
{},
isShare
:
false
,
//是否是分享出去的
isShare
:
false
,
//是否是分享出去的
actNum
:
0
,
actNum
:
0
,
tabAct
:
0
,
tabAct
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
scrollTop
:
0
,
img_version
:
'0.1.0'
,
img_version
:
"0.1.0"
,
// 是否授权昵称
// 是否授权昵称
hasUserInfo
:
false
,
hasUserInfo
:
false
,
prodItemVideo
:
''
,
//选中的场景下的video的第一个
prodItemVideo
:
""
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
activeUrl
:
""
,
// 1.3场景才有的活动配置
sharephone
:
''
,
//主要微信用户,服务商
sharephone
:
""
,
//主要微信用户,服务商
trackList
:
[
trackData
.
CARDETAIL
,
trackData
.
FINEDETAIL
,
trackData
.
CUSTOMEDETAIL
,
trackData
.
CROWDDETAIL
,
trackData
.
EXPANDETAIL
],
trackList
:
[
trackData
.
CARDETAIL
,
trackData
.
FINEDETAIL
,
trackData
.
CUSTOMEDETAIL
,
trackData
.
CROWDDETAIL
,
trackData
.
EXPANDETAIL
,
],
cardInfo
:
{},
cardInfo
:
{},
hasPhoneNumber
:
false
,
hasPhoneNumber
:
false
,
scenarList
:
[
'会员权益/升级'
,
'精品升级'
,
'次新车转化'
,
'售后众筹'
,
'续保膨胀金'
]
scenarList
:
[
"会员权益/升级"
,
"精品升级"
,
"次新车转化"
,
"售后众筹"
,
"续保膨胀金"
,
],
isLoadding
:
true
,
},
},
// 计算属性
// 计算属性
computed
:
{
computed
:
{
showLeftFlag
(
data
)
{
showLeftFlag
(
data
)
{
// 1.分享出去
// 1.分享出去
// 2.点击可以改变状态
// 2.点击可以改变状态
return
data
.
isShare
&&
!
data
.
showLeft
return
data
.
isShare
&&
!
data
.
showLeft
;
},
},
prodItemVideo
(
data
)
{
prodItemVideo
(
data
)
{
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
;
// if(actNum == 2){
// if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0]
// return senceData[actNum]?.noVideoPicture[0]
// }
// }
// return senceData[actNum]?.videoList[activeNavIdx]
// return senceData[actNum]?.videoList[activeNavIdx]
},
},
// 授权昵称弹框显示
// 授权昵称弹框显示
authNcknameShow
(
data
){
authNcknameShow
(
data
)
{
return
data
.
isShare
&&
!
data
.
hasUserInfo
return
data
.
isShare
&&
!
data
.
hasUserInfo
;
}
},
},
},
//接受跳转的路由参数(小程序页面跳转)
//接受跳转的路由参数(小程序页面跳转)
onRoute
(
options
)
{
onRoute
(
options
)
{
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
;
let
{
actNum
=
0
,
activeNavIdx
=
0
,
phone
,
hasPhoneNumber
}
=
options
let
{
actNum
=
0
,
activeNavIdx
=
0
,
phone
,
hasPhoneNumber
,
productData
,
}
=
options
;
console
.
log
(
productData
,
"productData"
);
this
.
setData
({
this
.
setData
({
actNum
,
//选中的场景下标
actNum
,
//选中的场景下标
activeNavIdx
,
//选中的产品
activeNavIdx
,
//选中的产品
sharephone
:
phone
,
//联系电话 (登陆的用户)
sharephone
:
phone
,
//联系电话 (登陆的用户)
hasPhoneNumber
:
hasPhoneNumber
hasPhoneNumber
:
hasPhoneNumber
,
})
productData
,
wx
.
$Track
.
sendTrack
(
this
.
data
.
trackList
[
this
.
data
.
actNum
])
isLoadding
:
false
,
const
senceList
=
productData
[
this
.
data
.
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
});
var
proInfo
=
{}
wx
.
$Track
.
sendTrack
(
this
.
data
.
trackList
[
this
.
data
.
actNum
]);
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
const
senceList
=
productData
[
this
.
data
.
actNum
].
filter
(
let
proIdList
=
senceList
[
i
]?.
productList
.
map
(
k
=>
k
.
id
)
(
item
)
=>
item
.
name
!=
"全部"
if
(
proIdList
.
includes
(
activeNavIdx
))
{
);
proInfo
=
senceList
[
i
].
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
var
proInfo
=
{};
break
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
let
proIdList
=
senceList
[
i
]?.
productList
.
map
((
k
)
=>
k
.
id
);
if
(
proIdList
.
includes
(
activeNavIdx
))
{
proInfo
=
senceList
[
i
].
productList
.
find
((
k
)
=>
k
.
id
==
activeNavIdx
);
break
;
}
}
}
}
this
.
setData
({
this
.
setData
({
proInfo
proInfo
,
})
})
;
// 设置转发标题
// 设置转发标题
let
userInfoObj
=
wx
.
$storage
.
get
(
"userInfo"
)
let
userInfoObj
=
wx
.
$storage
.
get
(
"userInfo"
)
;
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let
name
=
userInfoObj
.
merchantName
let
name
=
userInfoObj
.
merchantName
;
this
.
shareTitle
=
`
${
name
}
给你分享一个活动
${
proInfo
.
productName
}
,戳我参与~`
this
.
shareTitle
=
`
${
name
}
给你分享一个活动
${
proInfo
.
productName
}
,戳我参与~`
;
//分享数据
//分享数据
let
item
=
proInfo
let
item
=
proInfo
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
utils
.
setNavigationBarTitle
(
this
.
data
.
scenarList
[
actNum
])
utils
.
setNavigationBarTitle
(
this
.
data
.
scenarList
[
actNum
])
;
},
100
)
},
100
);
},
},
onPageScroll
:
(
function
()
{
onPageScroll
:
(
function
()
{
let
timer
=
null
;
let
timer
=
null
;
...
@@ -101,19 +123,19 @@ Page({
...
@@ -101,19 +123,19 @@ Page({
// 监听页面的滚动开始和结束
// 监听页面的滚动开始和结束
clearTimeout
(
timer
);
clearTimeout
(
timer
);
timer
=
setTimeout
(()
=>
{
timer
=
setTimeout
(()
=>
{
let
proDetail
=
this
.
selectComponent
(
"#pro-detail"
)
let
proDetail
=
this
.
selectComponent
(
"#pro-detail"
)
;
proDetail
.
pageSroll
(
e
)
proDetail
.
pageSroll
(
e
)
;
},
100
);
},
100
);
};
};
})(),
})(),
//获取配置url
//获取配置url
async
getActiveApiFn
(){
async
getActiveApiFn
()
{
let
{
code
,
data
}
=
await
entmicroApi
.
getActiveApi
()
let
{
code
,
data
}
=
await
entmicroApi
.
getActiveApi
();
if
(
code
==
0
)
{
if
(
code
==
0
)
{
this
.
setData
({
this
.
setData
({
activeUrl
:
data
activeUrl
:
data
,
})
})
;
}
}
},
},
...
@@ -121,74 +143,72 @@ Page({
...
@@ -121,74 +143,72 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
getActiveApiFn
()
this
.
getActiveApiFn
()
;
if
(
options
&&
options
.
cardId
)
{
if
(
options
&&
options
.
cardId
)
{
wx
.
$trackData
=
options
wx
.
$trackData
=
options
;
wx
.
$storage
.
set
(
'scene'
,
options
)
wx
.
$storage
.
set
(
"scene"
,
options
);
this
.
setData
({
this
.
setData
({
actNum
:
options
.
actNum
actNum
:
options
.
actNum
,
})
});
wx
.
$Track
.
sendTrack
(
this
.
data
.
trackList
[
options
.
actNum
])
wx
.
$Track
.
sendTrack
(
this
.
data
.
trackList
[
options
.
actNum
]);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
utils
.
setNavigationBarTitle
(
this
.
data
.
scenarList
[
options
.
actNum
])
utils
.
setNavigationBarTitle
(
this
.
data
.
scenarList
[
options
.
actNum
]);
},
100
)
},
100
);
const
app
=
getApp
();
app
.
getBaseData
().
then
((
res
)
=>
{
const
{
productData
}
=
res
;
this
.
setData
({
productData
:
productData
,
isLoadding
:
false
,
});
});
}
}
},
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
*/
onReady
()
{
onReady
()
{},
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{},
},
/**
/**
* 生命周期函数--监听页面隐藏
* 生命周期函数--监听页面隐藏
*/
*/
onHide
()
{
onHide
()
{},
},
/**
/**
* 生命周期函数--监听页面卸载
* 生命周期函数--监听页面卸载
*/
*/
onUnload
()
{
onUnload
()
{},
},
/**
/**
* 页面相关事件处理函数--监听用户下拉动作
* 页面相关事件处理函数--监听用户下拉动作
*/
*/
onPullDownRefresh
()
{
onPullDownRefresh
()
{},
},
/**
/**
* 页面上拉触底事件的处理函数
* 页面上拉触底事件的处理函数
*/
*/
onReachBottom
()
{
onReachBottom
()
{},
},
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage
()
{
onShareAppMessage
()
{
const
cardId
=
wx
.
$storage
.
get
(
'scene'
).
cardId
const
cardId
=
wx
.
$storage
.
get
(
"scene"
).
cardId
;
// merchantId 兼容旧链接
// merchantId 兼容旧链接
const
merchant
=
wx
.
$storage
.
get
(
'scene'
).
merchant
||
wx
.
$storage
.
get
(
'scene'
).
merchantId
const
merchant
=
const
shareType
=
'SHARE_SCEN'
wx
.
$storage
.
get
(
"scene"
).
merchant
||
wx
.
$storage
.
get
(
"scene"
).
merchantId
;
const
{
actNum
}
=
this
.
data
const
shareType
=
"SHARE_SCEN"
;
const
{
actNum
}
=
this
.
data
;
return
{
return
{
title
:
`给你分享一个合作场景介绍,戳我了解~`
,
title
:
`给你分享一个合作场景介绍,戳我了解~`
,
path
:
`packagesList/pages/scenarioDetail/scenarioDetail?cardId=
${
cardId
}
&merchant=
${
merchant
}
&shareType=
${
shareType
}
&actNum=
${
actNum
}
`
}
}
})
\ No newline at end of file
\ No newline at end of file
path
:
`packagesList/pages/scenarioDetail/scenarioDetail?cardId=
${
cardId
}
&merchant=
${
merchant
}
&shareType=
${
shareType
}
&actNum=
${
actNum
}
`
,
};
},
});
packagesList/pages/scenarioDetail/scenarioDetail.wxml
View file @
117bc7a
<!--packagesList/pages/scenarioDetail/scenarioDetail.wxml-->
<!--packagesList/pages/scenarioDetail/scenarioDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<pro-detail id="pro-detail" detailType="{{'scen'}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl}}" cardInfo="{{cardInfo}}" productData="{{productData}}"></pro-detail>
<pro-detail id="pro-detail" detailType="{{'scen'}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl}}" cardInfo="{{cardInfo}}" productData="{{productData}}"></pro-detail>
<phone-number custom-class="pro_phone_number" type="scenario" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
<phone-number custom-class="pro_phone_number" type="scenario" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
pages/tab/index/index.js
View file @
117bc7a
...
@@ -199,7 +199,7 @@ Page({
...
@@ -199,7 +199,7 @@ Page({
const
{
hasPhoneNumber
}
=
this
.
data
const
{
hasPhoneNumber
}
=
this
.
data
const
{
scenIndex
}
=
e
.
detail
const
{
scenIndex
}
=
e
.
detail
const
productData
=
this
.
data
.
productData
const
productData
=
this
.
data
.
productData
wx
.
$router
.
go
(
'/packagesList/pages/scenarioDetail/scenarioDetail'
,
{
hasPhoneNumber
,
actNum
:
scenIndex
})
wx
.
$router
.
go
(
'/packagesList/pages/scenarioDetail/scenarioDetail'
,
{
hasPhoneNumber
,
actNum
:
scenIndex
,
productData
})
},
},
// 获取全部活动列表
// 获取全部活动列表
getActivityRecord
()
{
getActivityRecord
()
{
...
...
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