Commit 43f17c3b by 前端

修复bug

1 parent af1a02ba
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import { ssoApi } from "../../api/api"; import { ssoApi } from "../../api/api";
import { componentsMixin } from "../../mixins/index"; import { componentsMixin } from "../../mixins/index";
Component({ Component({
externalClasses: ['test-class','class'],
behaviors: [componentsMixin], behaviors: [componentsMixin],
options: { options: {
styleIsolation: 'shared' styleIsolation: 'shared'
......
<view class="fixBottom"> <view class="fixBottom test-class class">
<view wx:if="{{type == 'home'}}" class="isFullSucreen home-btn"> <view wx:if="{{type == 'home'}}" class="isFullSucreen home-btn">
<!-- <view class="isFullSucreen"> --> <!-- <view class="isFullSucreen"> -->
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请1</button> <button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请1</button>
......
// packagesList/pages/productDetail/components/proDetail/proDetail.js // packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData } from "~/pages/tab/index/constant/senceData" import { senceData, productData } from "~/pages/tab/index/constant/senceData"
Component({ Component({
externalClasses: ['custom-class'],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -44,21 +45,21 @@ Component({ ...@@ -44,21 +45,21 @@ Component({
methods: { methods: {
getInfo() { getInfo() {
let { activeNavIdx, actNum } = this.data let { activeNavIdx, actNum } = this.data
console.log(actNum) //console.log(actNum)
console.log(activeNavIdx) //console.log(activeNavIdx)
const senceList = productData[actNum].filter(item => item.name != '全部') const senceList = productData[actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) { for (let i = 0; i < senceList.length; i++) {
let item = senceList[i] let item = senceList[i]
let proIdList = item?.productList.map(k => k.id) let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) { if (proIdList.includes(activeNavIdx)) {
console.log(item, 'item----') //console.log(item, 'item----')
console.log(item.productList.find(k => k.id == activeNavIdx)) //console.log(item.productList.find(k => k.id == activeNavIdx))
this.setData({ this.setData({
proInfo: item.productList.find(k => k.id == activeNavIdx), proInfo: item.productList.find(k => k.id == activeNavIdx),
productImgs: item.productImgs, productImgs: item.productImgs,
prodItemVideo: item.videoList.length ? item.videoList[activeNavIdx] : item.noVideoPicture[0] prodItemVideo: item.videoList.length ? item.videoList[activeNavIdx] : item.noVideoPicture[0]
}) })
console.log(this.data.prodItemVideo, 'prodItemVideo--------') //console.log(this.data.prodItemVideo, 'prodItemVideo--------')
break break
} }
} }
...@@ -121,7 +122,7 @@ Component({ ...@@ -121,7 +122,7 @@ Component({
}); });
}, },
selectCard() { selectCard() {
console.log(this.data.showCard) //console.log(this.data.showCard)
this.setData({ this.setData({
showCard: !this.data.showCard showCard: !this.data.showCard
}) })
......
<!--packagesList/pages/productDetail/components/proDetail/proDetail.wxml--> <!--packagesList/pages/productDetail/components/proDetail/proDetail.wxml-->
<view class="view-prod"> <view class="view-prod custom-class">
<view class="pro-head"> <view class="pro-head">
<view class="select-card" bindtap="selectCard"> <view class="select-card" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image> <glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ==" "integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
}, },
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.0.26", "version": "1.0.32",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.26.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.32.tgz",
"integrity": "sha512-piMTmDIUq4x7fpE3/GgZI1pIFV6SlmsJdtm/TxBqM5VG4i38+7bXZSkjqvu3xdb2TIXw6FuA4lq6I/QfVVX7LQ==" "integrity": "sha512-1YnE+r/tHpQS0FYLN/YV7EHvhOhY3leprkghtSpl3jjNP6KkMzrQoRuTatSIe3AWzVOKeXVP6ZsCIm9cdtB4pQ=="
} }
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.9", "@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.0.26" "glsx-applet-component": "^1.0.32"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
// packagesList/pages/productDetail/productDetail.js // packagesList/pages/productDetail/productDetail.js
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed' import {
import { IMG_URL } from "~/utils/constantData.js"; behavior as computedBehavior
import { senceData, productData } from "~/pages/tab/index/constant/senceData" } 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 USERAPI from '~/api/usersApi/index'
import utils from '~/utils/util' import utils from '~/utils/util'
// import {getActiveApi} from "~/api/viewprod" // import {getActiveApi} from "~/api/viewprod"
...@@ -18,18 +25,19 @@ Page({ ...@@ -18,18 +25,19 @@ Page({
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: '', //主要微信用户,服务商
cardInfo: {} cardInfo: {},
hasPhoneNumber: false, // 是否有授权手机号码
}, },
// 计算属性 // 计算属性
computed: { computed: {
...@@ -39,14 +47,18 @@ Page({ ...@@ -39,14 +47,18 @@ Page({
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
} }
...@@ -55,21 +67,24 @@ Page({ ...@@ -55,21 +67,24 @@ Page({
//接受跳转的路由参数(小程序页面跳转) //接受跳转的路由参数(小程序页面跳转)
onRoute(options) { onRoute(options) {
if (!options || utils.isEmptyObj(options)) return if (!options || utils.isEmptyObj(options)) return
let { actNum = 0, activeNavIdx = 0, phone, cardInfo } = options let {
actNum = 0, activeNavIdx = 0, phone, cardInfo
} = options
console.log(options) console.log(options)
this.setData({ this.setData({
actNum, //选中的场景下标 actNum, //选中的场景下标
activeNavIdx, //选中的产品 activeNavIdx, //选中的产品
sharephone: phone, //联系电话 (登陆的用户) sharephone: phone, //联系电话 (登陆的用户)
cardInfo cardInfo,
hasPhoneNumber:options.hasPhoneNumber
}) })
// console.log(this.data.senceData, 'senceData-----') // console.log(this.data.senceData, 'senceData-----')
const senceList = productData[this.data.actNum].filter(item => item.name != '全部') const senceList = productData[this.data.actNum].filter(item => item.name != '全部')
var proInfo = {} var proInfo = {}
for(let i = 0; i< senceList.length; i++) { for (let i = 0; i < senceList.length; i++) {
let proIdList = senceList[i]?.productList.map(k => k.id) let proIdList = senceList[i]?.productList.map(k => k.id)
if(proIdList.includes(activeNavIdx)) { if (proIdList.includes(activeNavIdx)) {
proInfo = senceList[i].productList.find(k => k.id == activeNavIdx) proInfo = senceList[i].productList.find(k => k.id == activeNavIdx)
break break
} }
...@@ -92,11 +107,11 @@ Page({ ...@@ -92,11 +107,11 @@ Page({
// console.log('title2',item.productName) // console.log('title2',item.productName)
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(item.productName) utils.setNavigationBarTitle(item.productName)
},100) }, 100)
//分享人openId //分享人openId
let wx_user_info = wx.$storage.get('wx_user_info'), let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || '' 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}&sharephone=${phone}`
this.shareTrackData = { this.shareTrackData = {
...@@ -105,7 +120,7 @@ Page({ ...@@ -105,7 +120,7 @@ Page({
productName: item?.productName, productName: item?.productName,
category: item?.category, category: item?.category,
productDesc: item?.productName, productDesc: item?.productName,
shareOpenId:shareOpenId shareOpenId: shareOpenId
} }
}, },
onPageScroll: (function () { onPageScroll: (function () {
...@@ -121,7 +136,7 @@ Page({ ...@@ -121,7 +136,7 @@ Page({
}, 100); }, 100);
}; };
})(), })(),
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -177,5 +192,14 @@ Page({ ...@@ -177,5 +192,14 @@ Page({
*/ */
onShareAppMessage() { onShareAppMessage() {
},
// 更新手机号码
updatePhoneNumber(e) {
console.log(e.detail)
this.setData({
hasPhoneNumber: e.detail ? true : false
})
} }
}) })
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"pro-detail": "../../../components/proDetail/proDetail" "pro-detail": "../../../components/proDetail/proDetail",
"pro-phone-number": "../../../components/PhoneNumber/PhoneNumber"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,4 +4,25 @@ ...@@ -4,4 +4,25 @@
top: 0; top: 0;
z-index: 0; z-index: 0;
width: 100%; width: 100%;
}
.max_page_height {
height: 100vh;
overflow: hidden;
}
.pro_phone_number {
.isFullSucreen {
flex: 1;
display: flex !important;
align-items: center !important;
}
}
.test {
.isFullSucreen {
flex: 1;
display: flex;
align-items: center;
}
} }
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/productDetail/productDetail.wxml--> <!--packagesList/pages/productDetail/productDetail.wxml-->
<pro-detail id="pro-detail" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}"></pro-detail> <pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}"></pro-detail>
<pro-phone-number test-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
\ No newline at end of file \ No newline at end of file
...@@ -61,7 +61,10 @@ Page({ ...@@ -61,7 +61,10 @@ Page({
// 增值转化模块 // 增值转化模块
senceData, senceData,
productData, productData,
activityList: [] activityList: [],
bannerUrl:'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/banner/banner0.png'
}, },
// 一级菜单 // 一级菜单
introduce(e) { introduce(e) {
...@@ -119,6 +122,7 @@ Page({ ...@@ -119,6 +122,7 @@ Page({
}, },
proClick(e) { proClick(e) {
console.log(e)
let { detail } = e let { detail } = e
//登录的用户手机号 //登录的用户手机号
// let userInfo = wx.$storage.get("userInfo") // let userInfo = wx.$storage.get("userInfo")
...@@ -126,16 +130,21 @@ Page({ ...@@ -126,16 +130,21 @@ Page({
let obj = { let obj = {
actNum: detail.scenIndex, //选中的场景 actNum: detail.scenIndex, //选中的场景
activeNavIdx: detail.id, //选中的产品, activeNavIdx: detail.id, //选中的产品,
cardInfo cardInfo,
hasPhoneNumber: this.data.hasPhoneNumber
} }
wx.$router.go("/packagesList/pages/productDetail/productDetail", obj) wx.$router.go("/packagesList/pages/productDetail/productDetail", obj)
}, },
// 跳转视频详情 // 跳转视频详情
videoClick(e) { videoClick(e) {
console.log(e,'000'); console.log(e.detail);
const { index, info: {videoUrl}, scenIndex } = e.detail const { index, info: {videoUrl}, scenIndex, list} = e.detail
const videoList = productData[scenIndex][0].videoList // if(scenIndex && scenIndex != 0){
console.log(videoList) // const videoList = productData[0].
// }
// console.log(productData[0])
//const videoList = productData[scenIndex][0].videoList
const videoList = list
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', { wx.$router.go('/packagesList/pages/videoDetal/videoDetal', {
index, index,
videoList, videoList,
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</scenario> --> </scenario> -->
</block> </block>
<block wx:if="{{curTabIndex == 1}}"> <block wx:if="{{curTabIndex == 1}}">
<gl-subscription list="{{productData[0]}}" menuClick="sysMenuClick" bannerUrl="{{'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/banner/banner0.png'}}"></gl-subscription> <gl-subscription list="{{productData[0]}}" menuClick="sysMenuClick" bannerUrl="{{bannerUrl}}" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen"></gl-subscription>
</block> </block>
<block wx-if="{{curTabIndex == 2}}"> <block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}"></company-introduce> <company-introduce autoplay="{{autoplay}}"></company-introduce>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!