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 08402b28
authored
Dec 21, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
拉取代码
2 parents
29d5d981
43f17c3b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
100 additions
and
42 deletions
components/PhoneNumber/PhoneNumber.js
components/PhoneNumber/PhoneNumber.wxml
components/proDetail/proDetail.js
components/proDetail/proDetail.wxml
package-lock.json
packagesList/pages/productDetail/productDetail.js
packagesList/pages/productDetail/productDetail.json
packagesList/pages/productDetail/productDetail.scss
packagesList/pages/productDetail/productDetail.wxml
pages/tab/index/constant/senceData.js
pages/tab/index/index.js
pages/tab/index/index.wxml
components/PhoneNumber/PhoneNumber.js
View file @
08402b2
...
...
@@ -9,6 +9,7 @@
import
{
ssoApi
}
from
"../../api/api"
;
import
{
componentsMixin
}
from
"../../mixins/index"
;
Component
({
externalClasses
:
[
'test-class'
,
'class'
],
behaviors
:
[
componentsMixin
],
options
:
{
styleIsolation
:
'shared'
...
...
components/PhoneNumber/PhoneNumber.wxml
View file @
08402b2
<view class="fixBottom">
<view class="fixBottom
test-class class
">
<view wx:if="{{type == 'home'}}" class="isFullSucreen home-btn">
<!-- <view class="isFullSucreen"> -->
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请1</button>
...
...
components/proDetail/proDetail.js
View file @
08402b2
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import
{
senceData
,
productData
}
from
"~/pages/tab/index/constant/senceData"
Component
({
externalClasses
:
[
'custom-class'
],
/**
* 组件的属性列表
*/
...
...
@@ -44,21 +45,21 @@ Component({
methods
:
{
getInfo
()
{
let
{
activeNavIdx
,
actNum
}
=
this
.
data
console
.
log
(
actNum
)
console
.
log
(
activeNavIdx
)
//
console.log(actNum)
//
console.log(activeNavIdx)
const
senceList
=
productData
[
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
))
{
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
}
}
...
...
@@ -121,7 +122,7 @@ Component({
});
},
selectCard
()
{
console
.
log
(
this
.
data
.
showCard
)
//
console.log(this.data.showCard)
this
.
setData
({
showCard
:
!
this
.
data
.
showCard
})
...
...
components/proDetail/proDetail.wxml
View file @
08402b2
<!--packagesList/pages/productDetail/components/proDetail/proDetail.wxml-->
<view class="view-prod">
<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>
...
...
package-lock.json
View file @
08402b2
...
...
@@ -11,7 +11,7 @@
},
"glsx-applet-component"
:
{
"version"
:
"1.0.32"
,
"resolved"
:
"https://registry.npm
mirror.com
/glsx-applet-component/-/glsx-applet-component-1.0.32.tgz"
,
"resolved"
:
"https://registry.npm
js.org
/glsx-applet-component/-/glsx-applet-component-1.0.32.tgz"
,
"integrity"
:
"sha512-1YnE+r/tHpQS0FYLN/YV7EHvhOhY3leprkghtSpl3jjNP6KkMzrQoRuTatSIe3AWzVOKeXVP6ZsCIm9cdtB4pQ=="
}
}
...
...
packagesList/pages/productDetail/productDetail.js
View file @
08402b2
// packagesList/pages/productDetail/productDetail.js
import
{
behavior
as
computedBehavior
}
from
'~/utils/lib/miniprogram-computed'
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
,
productData
}
from
"~/pages/tab/index/constant/senceData"
import
{
behavior
as
computedBehavior
}
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
utils
from
'~/utils/util'
// import {getActiveApi} from "~/api/viewprod"
...
...
@@ -18,18 +25,19 @@ Page({
senceData
,
productData
,
proInfo
:
{},
isShare
:
false
,
//是否是分享出去的
isShare
:
false
,
//是否是分享出去的
actNum
:
0
,
tabAct
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
showLeft
:
false
,
//更多按钮显示的内容
scrollTop
:
0
,
img_version
:
'0.1.0'
,
// 是否授权昵称
hasUserInfo
:
false
,
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
,
//主要微信用户,服务商
cardInfo
:
{}
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
,
//主要微信用户,服务商
cardInfo
:
{},
hasPhoneNumber
:
false
,
// 是否有授权手机号码
},
// 计算属性
computed
:
{
...
...
@@ -39,14 +47,18 @@ Page({
return
data
.
isShare
&&
!
data
.
showLeft
},
prodItemVideo
(
data
)
{
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
let
{
senceData
,
actNum
,
activeNavIdx
}
=
data
// if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0]
// }
// return senceData[actNum]?.videoList[activeNavIdx]
},
// 授权昵称弹框显示
authNcknameShow
(
data
){
authNcknameShow
(
data
)
{
return
data
.
isShare
&&
!
data
.
hasUserInfo
}
...
...
@@ -56,21 +68,24 @@ Page({
onRoute
(
options
)
{
// console.log( options);
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
)
this
.
setData
({
actNum
,
//选中的场景下标
actNum
,
//选中的场景下标
activeNavIdx
,
//选中的产品
sharephone
:
phone
,
//联系电话 (登陆的用户)
cardInfo
sharephone
:
phone
,
//联系电话 (登陆的用户)
cardInfo
,
hasPhoneNumber
:
options
.
hasPhoneNumber
})
// console.log(this.data.senceData, 'senceData-----')
const
senceList
=
productData
[
this
.
data
.
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
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
)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
if
(
proIdList
.
includes
(
activeNavIdx
))
{
proInfo
=
senceList
[
i
].
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
break
}
...
...
@@ -93,11 +108,11 @@ Page({
// console.log('title2',item.productName)
setTimeout
(()
=>
{
utils
.
setNavigationBarTitle
(
item
.
productName
)
},
100
)
},
100
)
//分享人openId
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.shareTrackData = {
...
...
@@ -106,7 +121,7 @@ Page({
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
shareOpenId:
shareOpenId
}
},
onPageScroll: (function () {
...
...
@@ -122,7 +137,7 @@ Page({
}, 100);
};
})(),
/**
* 生命周期函数--监听页面加载
...
...
@@ -178,5 +193,14 @@ Page({
*/
onShareAppMessage() {
},
// 更新手机号码
updatePhoneNumber(e) {
console.log(e.detail)
this.setData({
hasPhoneNumber: e.detail ? true : false
})
}
})
\ No newline at end of file
packagesList/pages/productDetail/productDetail.json
View file @
08402b2
{
"usingComponents"
:
{
"pro-detail"
:
"../../../components/proDetail/proDetail"
"pro-detail"
:
"../../../components/proDetail/proDetail"
,
"pro-phone-number"
:
"../../../components/PhoneNumber/PhoneNumber"
}
}
\ No newline at end of file
packagesList/pages/productDetail/productDetail.scss
View file @
08402b2
...
...
@@ -4,4 +4,25 @@
top
:
0
;
z-index
:
0
;
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
packagesList/pages/productDetail/productDetail.wxml
View file @
08402b2
<!--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
pages/tab/index/constant/senceData.js
View file @
08402b2
This diff is collapsed.
Click to expand it.
pages/tab/index/index.js
View file @
08402b2
...
...
@@ -63,6 +63,8 @@ Page({
activityList
:
[],
subscriptionBannerUrl
:
Object
.
freeze
(
subscriptionBannerUrl
),
subscriptionSystemData
:
Object
.
freeze
(
subscriptionSystemData
)
// bannerUrl:'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/banner/banner0.png'
},
// 一级菜单
introduce
(
e
)
{
...
...
@@ -120,28 +122,35 @@ Page({
},
proClick
(
e
)
{
console
.
log
(
e
,
'proClick'
)
let
{
detail
}
=
e
//登录的用户手机号
console
.
log
(
detail
)
// let userInfo = wx.$storage.get("userInfo")
const
{
cardInfo
}
=
this
.
data
let
obj
=
{
actNum
:
detail
.
scenIndex
,
//选中的场景
// || 99
actNum
:
detail
.
scenIndex
,
//选中的场景 没有就是订阅系统的
activeNavIdx
:
detail
.
id
,
//选中的产品,
cardInfo
cardInfo
,
hasPhoneNumber
:
this
.
data
.
hasPhoneNumber
}
wx
.
$router
.
go
(
'/packagesList/pages/productDetail/productDetail'
,
obj
)
},
// 跳转视频详情
videoClick
(
e
)
{
console
.
log
(
e
,
'000'
)
console
.
log
(
e
.
detail
)
const
{
index
,
info
:
{
videoUrl
},
scenIndex
scenIndex
,
list
}
=
e
.
detail
const
videoList
=
productData
[
scenIndex
][
0
].
videoList
console
.
log
(
videoList
)
// if(scenIndex && scenIndex != 0){
// const videoList = productData[0].
// }
// console.log(productData[0])
//const videoList = productData[scenIndex][0].videoList
const
videoList
=
list
wx
.
$router
.
go
(
'/packagesList/pages/videoDetal/videoDetal'
,
{
index
,
videoList
,
...
...
pages/tab/index/index.wxml
View file @
08402b2
...
...
@@ -26,8 +26,7 @@
</scenario> -->
</block>
<block wx:if="{{curTabIndex == 1}}">
<!-- menuClick="sysMenuClick" -->
<gl-subscription list="{{subscriptionSystemData}}" bannerUrl="{{subscriptionBannerUrl}}" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen" />
<gl-subscription list="{{subscriptionSystemData}}" menuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen" />
</block>
<block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}" />
...
...
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