Commit 1ef0d17d by 胡悦

修复bug

1 parent e307ba56
......@@ -23,6 +23,10 @@ Component({
type: Number,
value: 0
},
currentIndex: {
type: Number,
value: 0
},
cardInfo: {
type: Object,
value: {}
......@@ -57,9 +61,9 @@ Component({
*/
methods: {
getInfo() {
let { activeNavIdx, actNum } = this.data
//console.log(actNum)
//console.log(activeNavIdx)
let { activeNavIdx, actNum, currentIndex } = this.data
console.log(actNum)
console.log(activeNavIdx)
const spcList = [99, 4] // 订阅模块需要特殊处理
console.log(productData1, 'productData')
const senceList = productData1[actNum].filter(item => item.name != '全部')
......@@ -68,15 +72,16 @@ Component({
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
//console.log(item, 'item----')
console.log(item, 'item----')
//console.log(item.productList.find(k => k.id == activeNavIdx))
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? item.videoList[activeNavIdx] : item.noVideoPicture[0]
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
})
console.log(this.data.productImgs, proInfo)
// console.log(this.data.prodItemVideo, 'prodItemVideo--------')
break
}
......@@ -150,6 +155,14 @@ Component({
this.setData({
showCard: !this.data.showCard
})
},
// 长按图片
handleLongPress(e) {
let { actnum, index } = e.target.dataset
// 膨胀金活动,合作方式
if (actnum == 4 && index == 4) {
wx.$router.jumpH5('https://1064147.ma3you.cn/articles/OdEQmwb/');
}
}
}
})
......@@ -269,7 +269,7 @@ page {
.img-item52 {
width: 100%;
height: 3534rpx;
height: 4360rpx;
}
.img-item53 {
......
......@@ -49,7 +49,7 @@
</button>
</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}}" />
<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}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" />
</block>
<view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
......
......@@ -13,8 +13,6 @@ import {
import utils from '~/utils/util'
import {entmicroApi} from "~/api/api"
import {trackData} from '../../../utils/data'
import Draw from '../../../utils/Draw'
Page({
/**
......@@ -82,16 +80,16 @@ Page({
console.log( options);
if (!options || utils.isEmptyObj(options)) return
let {
actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName
actNum = 0, activeNavIdx = 0, currentIndex = 0, phone, hasPhoneNumber, name, proName
} = options
console.log(options)
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
sharephone: phone, //联系电话 (登陆的用户)
hasPhoneNumber:hasPhoneNumber,
pageName: name,
proName
proName,
currentIndex
})
if (name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
......@@ -160,17 +158,20 @@ Page({
this.setData({
actNum: options.actNum,
activeNavIdx: options.activeNavIdx,
pageName: name,
proName
})
getApp()
.login()
.then(({ data }) => {
console.log(data)
console.log(data, '------')
this.setData({
isLoadding: false
})
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
isLoadding: false
hasPhoneNumber: true
})
}
})
......
<!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<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="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view>
\ No newline at end of file
......@@ -42,6 +42,7 @@ const subscriptionSystemData = [
productList: [
{
id: 0,
currentIndex: 0,
img: 'product-img1',
proName: '私域用户活跃代运营',
price: '100',
......@@ -74,6 +75,7 @@ const subscriptionSystemData = [
},
{
id: 1,
currentIndex: 1,
img: 'product-img1',
proName: '定保/续保数字化招揽',
price: '100',
......@@ -117,6 +119,7 @@ const subscriptionSystemData = [
productList: [
{
id: 2,
currentIndex: 0,
img: 'product-img1',
proName: '事故车救援服务',
price: '100',
......
......@@ -144,6 +144,9 @@ Page({
hasPhoneNumber: this.data.hasPhoneNumber,
proName: detail.proName
}
if (name == '系统订阅') {
obj.currentIndex = detail.currentIndex // 选中的产品再当前分类下的下标
}
wx.$router.go('/packagesList/pages/productDetail/productDetail', obj)
},
// 跳转视频详情
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!