Commit 730bd6d7 by 匡雅琴

修改产品详情页面

1 parent e61ab099
...@@ -22,6 +22,9 @@ module.exports = { ...@@ -22,6 +22,9 @@ module.exports = {
}, },
getBaseDataConfig() { getBaseDataConfig() {
return api.getBaseDataByMock() return api.getBaseDataByMock()
},
getProductDetail() {
return api.getProductDetail()
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -155,5 +155,21 @@ class Request { ...@@ -155,5 +155,21 @@ class Request {
}) })
}) })
} }
getProductDetail() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/test-detail'
return new Promise((resolve) => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
} }
export default new Request() export default new Request()
\ No newline at end of file \ No newline at end of file
// packagesList/pages/productDetail/components/proDetail/proDetail.js // packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData1 } from '~/pages/tab/index/constant/senceData' // import { senceData, productData1 } from '~/pages/tab/index/constant/senceData'
const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点'] const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点']
import { componentsMixin } from "../../mixins/index"; import { componentsMixin } from "../../mixins/index";
Component({ Component({
...@@ -10,34 +10,38 @@ Component({ ...@@ -10,34 +10,38 @@ Component({
*/ */
properties: { properties: {
// 场景值下标 // 场景值下标
actNum: { // actNum: {
type: Number, // type: Number,
value: -1, // value: -1,
observer(n) { // observer(n) {
this.getInfo() // this.getInfo()
if (n == 3) { // if (n == 3) {
this.setVideoCtx() // this.setVideoCtx()
} // }
this.getImgHeight() // this.getImgHeight()
} // }
}, // },
// 选中的产品 // // 选中的产品
activeNavIdx: { // activeNavIdx: {
type: Number, // type: Number,
value: 0 // value: 0
}, // },
cardInfo: { // cardInfo: {
type: Object, // type: Object,
value: {} // value: {}
}, // },
// 配置url // // 配置url
activeUrl: { // activeUrl: {
type: String, // type: String,
value: '' // value: ''
}, // },
detailType: { detailType: {
type: String, type: String,
value: 'pro' value: 'pro'
},
proDetail: {
type: Object,
value: {}
} }
}, },
...@@ -47,7 +51,7 @@ Component({ ...@@ -47,7 +51,7 @@ Component({
data: { data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/', IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/', videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/',
productData: productData1, // productData: productData1,
proInfo: {}, proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个 prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0, tabAct: 0,
...@@ -79,26 +83,26 @@ Component({ ...@@ -79,26 +83,26 @@ Component({
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
this.data[attr] && this.data[attr].pause() this.data[attr] && this.data[attr].pause()
}, },
getInfo() { // getInfo() {
let { activeNavIdx, actNum } = this.data // let { activeNavIdx, actNum } = this.data
const spcList = [99] // 订阅模块需要特殊处理 // const spcList = [99] // 订阅模块需要特殊处理
const senceList = productData1[actNum].filter(item => item.name != '全部') // const senceList = productData1[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)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx) // let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({ // this.setData({
proInfo, // proInfo,
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs, // // productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs), // productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList, // tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0] // prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
}) // })
break // break
} // }
} // }
}, // },
getImgHeight() { getImgHeight() {
let query = wx.createSelectorQuery().in(this) let query = wx.createSelectorQuery().in(this)
let heightArr = [] let heightArr = []
...@@ -122,8 +126,8 @@ Component({ ...@@ -122,8 +126,8 @@ Component({
.exec() .exec()
}, },
// 1.3查看活动详情按钮 // 1.3查看活动详情按钮
checkActive() { checkActive(e) {
let { activeUrl } = this.data let { activeUrl } = e.url
wx.$router.jumpH5(activeUrl); wx.$router.jumpH5(activeUrl);
}, },
...@@ -162,11 +166,12 @@ Component({ ...@@ -162,11 +166,12 @@ Component({
}, },
// 长按图片 // 长按图片
handleLongPress(e) { handleLongPress(e) {
let { actnum, index } = e.target.dataset console.log(e);
// 膨胀金活动,合作方式 let {item} = e.currentTarget.dataset
if (actnum == 99 && index == 4) { // 如果图片有长按事件
if (item.clickEvent == 1) {
wx.downloadFile({ wx.downloadFile({
url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf', url: item.linkUrl,
success: function (res) { success: function (res) {
const filePath = res.tempFilePath const filePath = res.tempFilePath
wx.openDocument({ wx.openDocument({
...@@ -177,6 +182,29 @@ Component({ ...@@ -177,6 +182,29 @@ Component({
} }
}) })
} }
} // 膨胀金活动,合作方式
// if (actnum == 99 && index == 4) {
// wx.downloadFile({
// url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf',
// success: function (res) {
// const filePath = res.tempFilePath
// wx.openDocument({
// filePath: filePath,
// success: function (res) {
// }
// })
// }
// })
// }
},
// 点击拨打电话
phoneCall(e) {
console.log(e);
let { phone } = e.currentTarget.dataset;
// wx.$api.phoneCall(phone);
wx.makePhoneCall({
phoneNumber: phone,
});
},
} }
}) })
...@@ -5,68 +5,78 @@ ...@@ -5,68 +5,78 @@
<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>
<view>{{showCard ? '视频' : '名片'}}</view> <view>{{showCard ? '视频' : '名片'}}</view>
</view> </view>
<!-- 有视频 -->
<block wx:if="{{!showCard}}"> <block wx:if="{{!showCard}}">
<!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> --> <!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> -->
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/> <!-- 产品详情是视频 -->
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" /> <video class="frame" id="video" wx:if="{{proDetail.mainType == 'video'}}" src="{{proDetail.mainImg}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx" />
<!-- 产品详情是图片 -->
<image class="no-video" wx:if="{{proDetail.mainType == 'image'}}" src="{{proDetail.mainImg}}?v={{img_version}}" />
<!-- 标题+视频时展示观看人数 -->
<view class="title-wrap"> <view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view> <view class="title">{{proDetail.contentTitle}}</view>
<image class="check" wx:if="{{actNum != 2}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" /> <image class="check" wx:if="{{proDetail.mainType != 'image'}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view> <view class="num" wx:if="{{proDetail.mainType != 'image'}}">{{proDetail.view}}</view>
</view> </view>
</block> </block>
<user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info> <user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view> </view>
<!-- tab菜单 -->
<view class="tab-wrap"> <view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}"> <van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab wx:for="{{tabList}}" title="{{item}}" wx:key="idnex" /> <van-tab wx:for="{{proDetail.contentDetail}}" title="{{item.detailTypeName}}" wx:key="idnex" />
<!-- <van-tab title="合作案例" /> <!-- <van-tab title="合作案例" />
<van-tab title="合作方式" /> <van-tab title="合作方式" />
<van-tab title="适配产品" /> --> <van-tab title="适配产品" /> -->
</van-tabs> </van-tabs>
</view> </view>
<!-- 详情介绍 -->
<view class="prod-detail"> <view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index"> <block wx:for="{{proDetail.contentDetail}}" wx:key="index">
<!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> --> <!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> -->
<image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" src="{{item.url?item.url:item}}?v={{img_version}}"> <image webp mode="widthFix" class="img-items" src="{{item.detailImg?item.detailImg:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-item="{{item}}">
<!-- 第一张图的点击拨打电话事件 -->
<block wx:if="{{ index == 0}}"> <block wx:if="{{ index == 0}}">
<!-- && phone --> <view class="phone" bindtap="phoneCall" data-phone="{{proDetail.telphoneNumber}}">
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}"> <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image>
<!-- <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image> --> <glsx-image webp src="index/phone.png" class="icon" />
<!-- <glsx-image webp src="index/phone.png" class="icon" /> 请联系我
请联系我 --> <view style="color:#3666fe">{{proDetail.telphoneNumber}}</view>
<view style="color:#3666fe">{{sharephone}}</view>
</view> </view>
</block> </block>
<!-- 查看活动那个详情 1.3才有 -->
<!-- <block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}"> --> <!-- 如果有活动跳转 -->
<block wx:if="{{ index == 0 && actNum == 3 && activeUrl}}"> <!-- 按钮点击事件 buttonClickEvent:0-无,1-有 -->
<view class="check-act" bindtap="checkActive">点击查看活动页面</view> <block wx:if="{{ item.buttonClickEvent == 1 }}">
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> --> <view class="check-act" bindtap="checkActive" data-url="{{item.buttonLinkUrl}}">{{item.buttonName}}</view>
</block> </block>
<!-- 获取更多详情 --> <!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}"> <!-- <block wx:if="{{ index == 2 && showLeftFlag}}">
<button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber"> <button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情 点击查看更多详情
</button> </button>
</block> -->
<!-- 如果有视频 -->
<block wx:if="{{ item.detailVideo }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{item.detailVideo}}" />
</block> </block>
</image> </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}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" /> -->
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}"> <!-- <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.detailImg?item.detailImg:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}">
<!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}"> <block wx:if="{{ index == 3 && actNum == 3 }}">
<!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> --> <video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{detailVideo}}" />
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
</block> </block>
</image> </image> -->
</block> </block>
<view class="occupancy" wx:if="{{!isShare}}"> <view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> -->
<!-- 授权昵称 -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/productDetail/productDetail.wxml--> <!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding> <loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}"> <view wx:if="{{!isLoadding}}">
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></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-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" cardInfo="{{cardInfo}}" proDetail="{{productData}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number> <pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view> </view>
\ No newline at end of file \ No newline at end of file
// packagesList/pages/videoDetal/videoDetal.js // packagesList/pages/videoDetal/videoDetal.js
import {trackData} from '../../../utils/data' import {trackData} from '../../../utils/data'
import {productData} from '../../../pages/tab/index/constant/senceData' // import {productData} from '../../../pages/tab/index/constant/senceData'
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData' // import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from '~/utils/util' import utils from '~/utils/util'
Page({ Page({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!