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 6af28b82
authored
Dec 21, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
详情
1 parent
bc9c2442
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
40 deletions
components/proDetail/proDetail.js
components/proDetail/proDetail.wxml
packagesList/pages/productDetail/productDetail.js
packagesList/pages/productDetail/productDetail.wxml
components/proDetail/proDetail.js
View file @
6af28b8
...
...
@@ -20,9 +20,19 @@ Component({
type
:
Number
,
value
:
0
},
// tab
tabList
:
{
type
:
Array
,
value
:
[{
title
:
'项目亮点'
},
{
title
:
'合作案例'
},
{
title
:
'合作方式'
},
{
title
:
'适配产品'
}]
},
cardInfo
:
{
type
:
Object
,
value
:
{}
},
// 配置url
activeUrl
:
{
type
:
String
,
value
:
''
}
},
...
...
@@ -35,8 +45,7 @@ Component({
proInfo
:
{},
prodItemVideo
:
''
,
//选中的场景下的video的第一个
tabAct
:
0
,
scrollTop
:
0
,
showCard
:
false
scrollTop
:
0
},
/**
...
...
@@ -52,14 +61,14 @@ Component({
let
item
=
senceList
[
i
]
let
proIdList
=
item
?.
productList
.
map
(
k
=>
k
.
id
)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
//console.log(item, 'item----')
//console.log(item.productList.find(k => k.id == activeNavIdx))
//
console.log(item, 'item----')
//
console.log(item.productList.find(k => k.id == activeNavIdx))
this
.
setData
({
proInfo
:
item
.
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
),
productImgs
:
item
.
productImgs
,
prodItemVideo
:
item
.
videoList
.
length
?
item
.
videoList
[
activeNavIdx
]
:
item
.
noVideoPicture
[
0
]
})
//console.log(this.data.prodItemVideo, 'prodItemVideo--------')
//
console.log(this.data.prodItemVideo, 'prodItemVideo--------')
break
}
}
...
...
@@ -78,7 +87,6 @@ Component({
.
boundingClientRect
((
react
)
=>
{
react
.
forEach
((
item
,
index
)
=>
{
//44 tab的高度
// console.log('item',item)
s
=
item
.
top
-
44
+
scrollTop
;
imgTopArr
.
push
(
s
);
});
...
...
@@ -93,9 +101,7 @@ Component({
},
onClickTab
(
event
)
{
// console.log('event: ', event);
let
{
index
}
=
event
.
detail
;
// console.log('index: ', index);
this
.
setData
({
tabAct
:
index
,
});
...
...
@@ -120,12 +126,6 @@ Component({
scrollTop
:
e
.
scrollTop
});
});
},
selectCard
()
{
//console.log(this.data.showCard)
this
.
setData
({
showCard
:
!
this
.
data
.
showCard
})
}
}
})
components/proDetail/proDetail.wxml
View file @
6af28b8
<!--packagesList/pages/productDetail/components/proDetail/proDetail.wxml-->
<view class="view-prod custom-class">
<view class="pro-head">
<view class="select-card" 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>
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
<!-- <glsx-image class="check" src="index/poster/check.png" /> -->
<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>
</block>
<video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}"></video>
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</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>
<!-- 无视频 -->
<user-info wx:if="{{showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view>
<!-- <image class="no-video" wx:if="{{actNum == 2}}" src="{{IMG_URL}}index/poster/no-video.png?v={{img_version}}" /> -->
<view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab title="项目亮点"></van-tab>
<van-tab title="合作案例"></van-tab>
<van-tab title="合作方式"></van-tab>
<van-tab title="适配产品"></van-tab>
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.title}}"></van-tab>
</van-tabs>
</view>
<view class="prod-detail">
...
...
@@ -35,7 +22,6 @@
<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"></glsx-image>
请联系我
<view style="color:#3666fe">
...
...
@@ -48,7 +34,6 @@
<view class="check-act" bindtap="checkActive">
点击查看活动页面
</view>
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
</block>
<!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}">
...
...
@@ -68,4 +53,4 @@
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> -->
<!-- 授权昵称 -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file
packagesList/pages/productDetail/productDetail.js
View file @
6af28b8
...
...
@@ -138,12 +138,81 @@ Page({
};
})(),
//获取配置url
async getActiveApiFn(){
let {code,data} = await getActiveApi()
if(code == 0){
this.setData({
activeUrl: data
})
}
},
// 是否已经查看详情
isgetAuthphone(){
let authphone = wx.$storage.get("authphone");
if(authphone){
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
},300)
this.setData({
showLeft: true
})
//触发浏览埋点
// this.onLoad(null)
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad(options) {
this.getActiveApiFn()
// 是否已经查看详情
this.isgetAuthphone()
if (!options || utils.isEmptyObj(options)) return
let { actNum, activeNavIdx, isShare,sharephone } = options
if(isShare){
wx.hideHomeButton()
}
this.setData({
actNum,
activeNavIdx,
isShare,
sharephone
});
//分享数据
let senceItem = senceData[actNum]
let item = senceData[actNum]?.productList[activeNavIdx]
console.log('title',item.productName)
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: " "+item.productName,
// });
utils.setNavigationBarTitle(item.productName)
},100)
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
// console.log('shareOpenId: ', shareOpenId);
// &shareOpenId=
${
shareOpenId
}
this.shareQuery = `
sceneCode
=
$
{
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
sharephone
}
`
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
// actNum,
// activeNavIdx,
}
},
/**
...
...
packagesList/pages/productDetail/productDetail.wxml
View file @
6af28b8
<!--packagesList/pages/productDetail/productDetail.wxml-->
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}"></pro-detail>
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" act
iveUrl="{{activeUrl}}" act
Num="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
\ No newline at end of file
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