Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 730bd6d7
authored
May 19, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改产品详情页面
1 parent
e61ab099
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
153 additions
and
95 deletions
api/api.js
api/request.js
components/proDetail/proDetail.js
components/proDetail/proDetail.wxml
packagesList/pages/productDetail/productDetail.js
packagesList/pages/productDetail/productDetail.wxml
packagesList/pages/videoDetal/videoDetal.js
api/api.js
View file @
730bd6d
...
...
@@ -22,6 +22,9 @@ module.exports = {
},
getBaseDataConfig
()
{
return
api
.
getBaseDataByMock
()
},
getProductDetail
()
{
return
api
.
getProductDetail
()
}
}
}
\ No newline at end of file
api/request.js
View file @
730bd6d
...
...
@@ -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
()
\ No newline at end of file
components/proDetail/proDetail.js
View file @
730bd6d
// 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
=
[
'海报案例'
,
'测算营销'
,
'产品介绍'
,
'项目亮点'
]
import
{
componentsMixin
}
from
"../../mixins/index"
;
Component
({
...
...
@@ -10,34 +10,38 @@ Component({
*/
properties
:
{
// 场景值下标
actNum
:
{
type
:
Number
,
value
:
-
1
,
observer
(
n
)
{
this
.
getInfo
()
if
(
n
==
3
)
{
this
.
setVideoCtx
()
}
this
.
getImgHeight
()
}
},
// 选中的产品
activeNavIdx
:
{
type
:
Number
,
value
:
0
},
cardInfo
:
{
type
:
Object
,
value
:
{}
},
// 配置url
activeUrl
:
{
type
:
String
,
value
:
''
},
//
actNum: {
//
type: Number,
//
value: -1,
//
observer(n) {
//
this.getInfo()
//
if (n == 3) {
//
this.setVideoCtx()
//
}
//
this.getImgHeight()
//
}
//
},
//
//
选中的产品
//
activeNavIdx: {
//
type: Number,
//
value: 0
//
},
//
cardInfo: {
//
type: Object,
//
value: {}
//
},
//
//
配置url
//
activeUrl: {
//
type: String,
//
value: ''
//
},
detailType
:
{
type
:
String
,
value
:
'pro'
},
proDetail
:
{
type
:
Object
,
value
:
{}
}
},
...
...
@@ -47,7 +51,7 @@ Component({
data
:
{
IMG_URL
:
'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
,
videoBaseUrl
:
'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
,
productData
:
productData1
,
//
productData: productData1,
proInfo
:
{},
prodItemVideo
:
''
,
//选中的场景下的video的第一个
tabAct
:
0
,
...
...
@@ -79,26 +83,26 @@ Component({
let
{
attr
}
=
e
.
currentTarget
.
dataset
this
.
data
[
attr
]
&&
this
.
data
[
attr
].
pause
()
},
getInfo
()
{
let
{
activeNavIdx
,
actNum
}
=
this
.
data
const
spcList
=
[
99
]
// 订阅模块需要特殊处理
const
senceList
=
productData1
[
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
let
item
=
senceList
[
i
]
let
proIdList
=
item
?.
productList
.
map
(
k
=>
k
.
id
)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
let
proInfo
=
item
.
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
this
.
setData
({
proInfo
,
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
productImgs
:
spcList
.
includes
(
actNum
)
?
proInfo
.
sceneImgs
:
(
proInfo
.
productImgs
?
proInfo
.
productImgs
:
item
.
productImgs
),
tabList
:
spcList
.
includes
(
actNum
)
?
proInfo
.
tabList
:
norTabList
,
prodItemVideo
:
item
.
videoList
.
length
?
spcList
.
includes
(
actNum
)
?
item
.
videoList
[
proInfo
.
currentIndex
]
:
item
.
videoList
[
activeNavIdx
]
:
item
.
noVideoPicture
[
0
]
})
break
}
}
},
//
getInfo() {
//
let { activeNavIdx, actNum } = this.data
//
const spcList = [99] // 订阅模块需要特殊处理
//
const senceList = productData1[actNum].filter(item => item.name != '全部')
//
for (let i = 0; i < senceList.length; i++) {
//
let item = senceList[i]
//
let proIdList = item?.productList.map(k => k.id)
//
if (proIdList.includes(activeNavIdx)) {
//
let proInfo = item.productList.find(k => k.id == activeNavIdx)
//
this.setData({
//
proInfo,
//
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
//
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
//
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
//
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
//
})
//
break
//
}
//
}
//
},
getImgHeight
()
{
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
heightArr
=
[]
...
...
@@ -122,8 +126,8 @@ Component({
.
exec
()
},
// 1.3查看活动详情按钮
checkActive
()
{
let
{
activeUrl
}
=
this
.
data
checkActive
(
e
)
{
let
{
activeUrl
}
=
e
.
url
wx
.
$router
.
jumpH5
(
activeUrl
);
},
...
...
@@ -162,11 +166,12 @@ Component({
},
// 长按图片
handleLongPress
(
e
)
{
let
{
actnum
,
index
}
=
e
.
target
.
dataset
// 膨胀金活动,合作方式
if
(
actnum
==
99
&&
index
==
4
)
{
console
.
log
(
e
);
let
{
item
}
=
e
.
currentTarget
.
dataset
// 如果图片有长按事件
if
(
item
.
clickEvent
==
1
)
{
wx
.
downloadFile
({
url
:
'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf'
,
url
:
item
.
linkUrl
,
success
:
function
(
res
)
{
const
filePath
=
res
.
tempFilePath
wx
.
openDocument
({
...
...
@@ -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
,
});
},
}
})
components/proDetail/proDetail.wxml
View file @
730bd6d
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class">
<view class="pro-head">
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<!-- 有视频 -->
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<block wx:if="{{!showCard}}">
<!-- <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" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> -->
<!-- 产品详情是视频 -->
<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">{{pro
dItemVideo.nam
e}}</view>
<image class="check" wx:if="{{
actNum != 2
}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{
actNum != 2}}">{{prodItemVideo
.view}}</view>
<view class="title">{{pro
Detail.contentTitl
e}}</view>
<image class="check" wx:if="{{
proDetail.mainType != 'image'
}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{
proDetail.mainType != 'image'}}">{{proDetail
.view}}</view>
</view>
</block>
<user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view>
<!-- tab菜单 -->
<view class="tab-wrap">
<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-tabs>
</view>
<!-- 详情介绍 -->
<view class="prod-detail">
<block wx:for="{{pro
ductImgs
}}" wx:key="index">
<block wx:for="{{pro
Detail.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" 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}}">
<!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
<!-- <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image> -->
<!-- <glsx-image webp src="index/phone.png" class="icon" />
请联系我 -->
<view style="color:#3666fe">{{sharephone}}</view>
<view class="phone" bindtap="phoneCall" data-phone="{{proDetail.telphoneNumber}}">
<image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image>
<glsx-image webp src="index/phone.png" class="icon" />
请联系我
<view style="color:#3666fe">{{proDetail.telphoneNumber}}</view>
</view>
</block>
<!-- 查看活动那个详情 1.3才有 -->
<!--
<block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}">
-->
<
block wx:if="{{ index == 0 && actNum == 3 && activeUrl}}"
>
<view class="check-act" bindtap="checkActive">点击查看活动页面</view
>
<
!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> --
>
<!--
如果有活动跳转
-->
<
!-- 按钮点击事件 buttonClickEvent:0-无,1-有 --
>
<block wx:if="{{ item.buttonClickEvent == 1 }}"
>
<
view class="check-act" bindtap="checkActive" data-url="{{item.buttonLinkUrl}}">{{item.buttonName}}</view
>
</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>
</block> -->
<!-- 如果有视频 -->
<block wx:if="{{ item.detailVideo }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{item.detailVideo}}" />
</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}}" 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 }}">
<!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> -->
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{detailVideo}}" />
</block>
</image>
</image> -->
</block>
<view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
</view>
</view>
</view>
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <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
</view>
\ No newline at end of file
packagesList/pages/productDetail/productDetail.js
View file @
730bd6d
This diff is collapsed.
Click to expand it.
packagesList/pages/productDetail/productDetail.wxml
View file @
730bd6d
<!--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}}" 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>
</view>
\ No newline at end of file
packagesList/pages/videoDetal/videoDetal.js
View file @
730bd6d
// packagesList/pages/videoDetal/videoDetal.js
import
{
trackData
}
from
'../../../utils/data'
import
{
productData
}
from
'../../../pages/tab/index/constant/senceData'
import
{
subscriptionSystemData
}
from
'../../../pages/tab/index/constant/systemData'
//
import {productData} from '../../../pages/tab/index/constant/senceData'
//
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import
utils
from
'~/utils/util'
Page
({
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment