Commit 2c35405d by 匡雅琴

处理产品详情分享数据不显示问题

1 parent 44452f99
...@@ -82,6 +82,7 @@ Page({ ...@@ -82,6 +82,7 @@ Page({
let { let {
actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName, productData actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName, productData
} = options } = options
console.log(productData, 'productData');
this.setData({ this.setData({
actNum, //选中的场景下标 actNum, //选中的场景下标
activeNavIdx, //选中的产品 activeNavIdx, //选中的产品
...@@ -146,12 +147,20 @@ Page({ ...@@ -146,12 +147,20 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options, 'options');
this.getActiveApiFn() this.getActiveApiFn()
if (options && options.cardId) { if (options && options.cardId) {
wx.$trackData = options wx.$trackData = options
// wx.$trackData.cardId = options.cardId // wx.$trackData.cardId = options.cardId
wx.$storage.set('scene', options) wx.$storage.set('scene', options)
const {name, actNum, activeNavIdx, proName} = options const {name, actNum, activeNavIdx, proName} = options
const app = getApp()
app.getBaseData().then(res => {
const { productData } = res
this.setData({
productData: productData
})
})
this.setData({ this.setData({
actNum: options.actNum, actNum: options.actNum,
activeNavIdx: options.activeNavIdx, activeNavIdx: options.activeNavIdx,
......
...@@ -198,6 +198,7 @@ Page({ ...@@ -198,6 +198,7 @@ Page({
senceClick(e) { senceClick(e) {
const { hasPhoneNumber } = this.data const { hasPhoneNumber } = this.data
const { scenIndex } = e.detail const { scenIndex } = e.detail
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 })
}, },
// 获取全部活动列表 // 获取全部活动列表
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!