Commit 33f943dd by chenwq

系统订阅-产品跳转详情页,数据对应不上。

1 parent 013237c3
...@@ -84,8 +84,6 @@ Component({ ...@@ -84,8 +84,6 @@ Component({
}, },
getInfo() { getInfo() {
let { activeNavIdx, actNum } = this.data let { activeNavIdx, actNum } = this.data
// console.log(actNum, 'actNum---')
// console.log(activeNavIdx, 'activeNavIdx---')
const spcList = [99] // 订阅模块需要特殊处理 const spcList = [99] // 订阅模块需要特殊处理
const senceList = this.data.productData[actNum].filter(item => item.name != '全部') const senceList = this.data.productData[actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) { for (let i = 0; i < senceList.length; i++) {
...@@ -123,7 +121,6 @@ Component({ ...@@ -123,7 +121,6 @@ Component({
_this.setData({ _this.setData({
imgTopArr imgTopArr
}) })
console.log(imgTopArr, 'imgTopArr---')
}) })
.exec() .exec()
// setTimeout(() => { // setTimeout(() => {
......
...@@ -17,7 +17,8 @@ Page({ ...@@ -17,7 +17,8 @@ Page({
IMG_URL, IMG_URL,
proInfo: {}, proInfo: {},
isShare:false, //是否是分享出去的 isShare:false, //是否是分享出去的
actNum: 0, actNum: -1,
activeNavIdx: 0,
tabAct: 0, tabAct: 0,
showLeft:false, //更多按钮显示的内容 showLeft:false, //更多按钮显示的内容
scrollTop:0, scrollTop:0,
...@@ -71,7 +72,7 @@ Page({ ...@@ -71,7 +72,7 @@ Page({
} else { } else {
sceneObj = productData[99].find(item => item.sceneCode == sceneCode) sceneObj = productData[99].find(item => item.sceneCode == sceneCode)
} }
let proInfo = sceneObj?.productList[activeNavIdx] let proInfo = sceneObj?.productList.find(item => item.id == activeNavIdx)
this.setData({ this.setData({
actNum, //选中的场景下标/sceneid actNum, //选中的场景下标/sceneid
...@@ -110,7 +111,7 @@ Page({ ...@@ -110,7 +111,7 @@ Page({
let data = actNum != 99 ? scenceList : productData[actNum] let data = actNum != 99 ? scenceList : productData[actNum]
let value = actNum != 99 ? actNum : sceneid99 let value = actNum != 99 ? actNum : sceneid99
let sceneObj = data.find(item => item.sceneid == value) let sceneObj = data.find(item => item.sceneid == value)
let proInfo = sceneObj?.productList[activeNavIdx] let proInfo = sceneObj?.productList.find(item => item.id == activeNavIdx)
this.setData({ this.setData({
actNum, //选中的场景下标 actNum, //选中的场景下标
......
...@@ -136,6 +136,7 @@ const scenario_1 = [ ...@@ -136,6 +136,7 @@ const scenario_1 = [
sceneImgs: sceneImgs1, sceneImgs: sceneImgs1,
productImgs: productImgs1, productImgs: productImgs1,
"sceneCode":"SC002", "sceneCode":"SC002",
sceneid: 1,
productList: [ productList: [
{ {
id: 0, id: 0,
...@@ -188,6 +189,7 @@ const scenario_2 = [ ...@@ -188,6 +189,7 @@ const scenario_2 = [
sceneImgs: sceneImgs2, sceneImgs: sceneImgs2,
productImgs: productImgs2, productImgs: productImgs2,
"sceneCode":"SC003", "sceneCode":"SC003",
sceneid: 2,
productList: [ productList: [
{ {
id: 0, id: 0,
...@@ -305,6 +307,7 @@ const scenario_3 = [ ...@@ -305,6 +307,7 @@ const scenario_3 = [
{ {
name: '美容类', name: '美容类',
"sceneCode":"SC004", "sceneCode":"SC004",
sceneid: 3,
productList: [ productList: [
{ {
id: 0, id: 0,
...@@ -332,6 +335,7 @@ const scenario_3 = [ ...@@ -332,6 +335,7 @@ const scenario_3 = [
{ {
name: '轻改类', name: '轻改类',
"sceneCode":"SC004", "sceneCode":"SC004",
sceneid: 0,
productList: [ productList: [
{ {
id: 1, id: 1,
......
...@@ -138,7 +138,7 @@ const subscriptionSystemData = [ ...@@ -138,7 +138,7 @@ const subscriptionSystemData = [
productImgs: productImgs0, productImgs: productImgs0,
productList: [ productList: [
{ {
id: 0, id: 2,
sceneid: 1, sceneid: 1,
currentIndex: 0, currentIndex: 0,
img: 'product-img1', img: 'product-img1',
...@@ -185,7 +185,7 @@ const subscriptionSystemData = [ ...@@ -185,7 +185,7 @@ const subscriptionSystemData = [
productImgs: productImgs4, productImgs: productImgs4,
productList: [ productList: [
{ {
id: 0, id: 3,
sceneid: 2, sceneid: 2,
currentIndex: 0, currentIndex: 0,
proName: '膨胀金', proName: '膨胀金',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!