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 54f0bc13
authored
Dec 15, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
咨询弹框
1 parent
16732c93
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
93 deletions
pages/tab/index/index.js
pages/tab/index/index.json
pages/tab/index/index.wxml
pages/tab/index/index.js
View file @
54f0bc1
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
// pages/tab/index/index.js
// pages/tab/index/index.js
import
Draw
from
"../../../utils/Draw"
;
import
Draw
from
"../../../utils/Draw"
;
import
{
entmicroApi
}
from
"../../../api/api"
;
import
{
entmicroApi
}
from
"../../../api/api"
;
import
{
commonMixin
}
from
'../../../mixins/index'
import
{
commonMixin
}
from
"../../../mixins/index"
;
import
{
trackData
}
from
"../../../utils/data"
;
import
{
trackData
}
from
"../../../utils/data"
;
import
{
senceData
,
productData
}
from
'./constant/senceData'
import
{
senceData
,
productData
}
from
"./constant/senceData"
;
Page
({
Page
({
behaviors
:
[
commonMixin
],
behaviors
:
[
commonMixin
],
/**
/**
...
@@ -21,35 +21,36 @@ Page({
...
@@ -21,35 +21,36 @@ Page({
{
{
name
:
"增值转化"
,
name
:
"增值转化"
,
icon
:
"icon-product"
,
icon
:
"icon-product"
,
icon1
:
"icon-product1"
icon1
:
"icon-product1"
,
},
},
{
{
name
:
"系统订阅"
,
name
:
"系统订阅"
,
icon
:
"icon-measure"
,
icon
:
"icon-measure"
,
icon1
:
"icon-measure"
icon1
:
"icon-measure"
,
},
},
{
{
name
:
"公司介绍"
,
name
:
"公司介绍"
,
icon
:
"icon-company"
,
icon
:
"icon-company"
,
icon1
:
"icon-company1"
icon1
:
"icon-company1"
,
},
},
{
{
name
:
"视频直播"
,
name
:
"视频直播"
,
icon
:
"icon-video"
,
icon
:
"icon-video"
,
icon1
:
"icon-video"
icon1
:
"icon-video"
,
},
},
],
],
curTabIndex
:
0
,
curTabIndex
:
0
,
// 员工名片信息
// 员工名片信息
cardInfo
:
null
,
cardInfo
:
null
,
defaultInfo
:
{
defaultInfo
:
{
staffName
:
'虚拟员工'
,
staffName
:
"虚拟员工"
,
operation
:
'虚拟职位'
,
operation
:
"虚拟职位"
,
staffPhone
:
'xxxxxxxx'
,
staffPhone
:
"xxxxxxxx"
,
image
:
'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg'
,
image
:
qrCode
:
'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg'
"https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg"
,
qrCode
:
"https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg"
,
},
},
// 是否授权手机号
// 是否授权手机号
hasPhoneNumber
:
false
,
hasPhoneNumber
:
false
,
...
@@ -58,48 +59,44 @@ Page({
...
@@ -58,48 +59,44 @@ Page({
autoplay
:
true
,
autoplay
:
true
,
// 增值转化模块
// 增值转化模块
senceData
,
senceData
,
productData
productData
,
},
},
// 一级菜单
// 一级菜单
introduce
(
e
)
{
introduce
(
e
)
{
const
curTabIndex
=
e
.
currentTarget
.
dataset
.
index
;
const
curTabIndex
=
e
.
currentTarget
.
dataset
.
index
;
this
.
setData
({
this
.
setData
({
autoplay
:
false
autoplay
:
false
,
})
})
;
// 视频直播是跳转新页面,不需要设置激活样式
// 视频直播是跳转新页面,不需要设置激活样式
// 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播
// 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播
switch
(
curTabIndex
)
{
switch
(
curTabIndex
)
{
case
2
:
case
2
:
this
.
setData
({
this
.
setData
({
curTabIndex
:
curTabIndex
,
curTabIndex
:
curTabIndex
,
autoplay
:
true
autoplay
:
true
,
})
})
;
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
break
break
;
case
3
:
case
3
:
wx
.
openChannelsUserProfile
({
wx
.
openChannelsUserProfile
({
finderUserName
:
'sphPIdcy0NVpuao'
,
finderUserName
:
"sphPIdcy0NVpuao"
,
})
})
;
// wx.$Track.sendTrack(trackData.VIDEO);
// wx.$Track.sendTrack(trackData.VIDEO);
break
;
break
;
default
:
default
:
this
.
setData
({
this
.
setData
({
curTabIndex
:
curTabIndex
,
curTabIndex
:
curTabIndex
,
});
});
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
}
}
},
},
// 咨询
// 咨询
handleOpen
(
e
)
{
handleOpen
(
e
)
{},
},
// 更新手机号
// 更新手机号
updatePhoneNumber
(
e
)
{
updatePhoneNumber
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
;
if
(
e
.
detail
)
{
if
(
e
.
detail
)
{
this
.
setData
({
this
.
setData
({
hasPhoneNumber
:
true
,
hasPhoneNumber
:
true
,
...
@@ -108,9 +105,9 @@ Page({
...
@@ -108,9 +105,9 @@ Page({
},
},
// 合作申请
// 合作申请
toApplication
()
{
toApplication
()
{
console
.
log
(
'合作申请'
)
console
.
log
(
"合作申请"
);
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
...
@@ -127,32 +124,46 @@ Page({
...
@@ -127,32 +124,46 @@ Page({
this
.
getCardDetail
();
this
.
getCardDetail
();
});
});
wx
.
hideShareMenu
({
wx
.
hideShareMenu
({
menus
:
[
'shareAppMessage'
]
menus
:
[
"shareAppMessage"
],
})
})
;
this
.
setData
({
this
.
setData
({
productData
:
this
.
addAll
(
productData
)
productData
:
this
.
addAll
(
productData
)
,
})
})
;
},
},
addAll
(
data
)
{
addAll
(
data
)
{
for
(
let
i
in
data
)
{
for
(
let
i
in
data
)
{
let
arr
=
[],
let
arr
=
[],
m
=
[],
m
=
[],
n
=
[]
n
=
[];
data
[
i
].
map
(
item
=>
{
data
[
i
].
map
(
(
item
)
=>
{
arr
=
arr
.
concat
(
item
.
productList
)
arr
=
arr
.
concat
(
item
.
productList
)
;
m
=
item
.
videoList
m
=
item
.
videoList
;
n
=
item
.
posterList
n
=
item
.
posterList
;
})
})
;
const
allData
=
{
const
allData
=
{
name
:
'全部'
,
name
:
"全部"
,
productList
:
arr
,
productList
:
arr
,
videoList
:
m
,
videoList
:
m
,
posterList
:
n
posterList
:
n
,
}
}
;
data
[
i
].
unshift
(
allData
)
data
[
i
].
unshift
(
allData
)
;
}
}
return
data
return
data
;
},
// 咨询
handleOpen
()
{
this
.
setData
({
showCustomer
:
true
,
});
},
closeQR
()
{
console
.
log
(
1111
);
this
.
setData
({
showCustomer
:
false
,
});
},
},
/**
/**
...
@@ -164,14 +175,14 @@ Page({
...
@@ -164,14 +175,14 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{
const
userInfo
=
wx
.
$util
.
getUserInfo
()
const
userInfo
=
wx
.
$util
.
getUserInfo
()
;
this
.
setData
({
this
.
setData
({
hasPhoneNumber
:
!!
(
userInfo
&&
userInfo
.
phone
)
hasPhoneNumber
:
!!
(
userInfo
&&
userInfo
.
phone
)
,
})
})
;
const
options
=
wx
.
getEnterOptionsSync
()
const
options
=
wx
.
getEnterOptionsSync
()
;
wx
.
$trackData
=
options
.
query
wx
.
$trackData
=
options
.
query
;
if
(
wx
.
$trackData
.
merchant
)
{
if
(
wx
.
$trackData
.
merchant
)
{
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
}
}
},
},
...
@@ -199,15 +210,16 @@ Page({
...
@@ -199,15 +210,16 @@ Page({
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage
()
{
onShareAppMessage
()
{
const
cardId
=
wx
.
$storage
.
get
(
"scene"
).
cardId
const
cardId
=
wx
.
$storage
.
get
(
"scene"
).
cardId
;
// merchantId 兼容旧链接
// merchantId 兼容旧链接
const
merchant
=
wx
.
$storage
.
get
(
"scene"
).
merchant
||
wx
.
$storage
.
get
(
"scene"
).
merchantId
const
merchant
=
const
shareType
=
'SHARE_HOME'
wx
.
$storage
.
get
(
"scene"
).
merchant
||
wx
.
$storage
.
get
(
"scene"
).
merchantId
;
console
.
log
(
'cardId'
,
cardId
,
'merchant'
,
merchant
)
const
shareType
=
"SHARE_HOME"
;
console
.
log
(
"cardId"
,
cardId
,
"merchant"
,
merchant
);
return
{
return
{
title
:
`您好,我向你推荐了广联数科
${
this
.
data
.
cardInfo
.
staffName
}
的智能名片~`
,
title
:
`您好,我向你推荐了广联数科
${
this
.
data
.
cardInfo
.
staffName
}
的智能名片~`
,
imageUrl
:
this
.
data
.
shareImg
,
imageUrl
:
this
.
data
.
shareImg
,
path
:
`pages/tab/index/index?cardId=
${
cardId
}
&merchant=
${
merchant
}
&shareType=
${
shareType
}
`
path
:
`pages/tab/index/index?cardId=
${
cardId
}
&merchant=
${
merchant
}
&shareType=
${
shareType
}
`
,
};
};
},
},
setShareInfo
(
data
=
{})
{
setShareInfo
(
data
=
{})
{
...
@@ -323,16 +335,18 @@ Page({
...
@@ -323,16 +335,18 @@ Page({
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
draw_function
.
toDataURL
(({
path
})
=>
{
draw_function
.
toDataURL
(({
path
})
=>
{
this
.
setData
({
this
.
setData
(
shareImg
:
path
,
{
shareDisabled
:
false
shareImg
:
path
,
},
()
=>
{
shareDisabled
:
false
,
wx
.
showShareMenu
({
},
menus
:
[
'shareAppMessage'
]
()
=>
{
})
wx
.
showShareMenu
({
})
menus
:
[
"shareAppMessage"
],
});
}
);
});
});
}
}
});
});
};
};
...
@@ -341,35 +355,34 @@ Page({
...
@@ -341,35 +355,34 @@ Page({
// 获取员工名片信息
// 获取员工名片信息
getCardDetail
()
{
getCardDetail
()
{
console
.
log
(
wx
.
showMeasure
)
console
.
log
(
wx
.
showMeasure
)
;
this
.
setData
({
this
.
setData
({
'tabList[3].isShow'
:
wx
.
showMeasure
"tabList[3].isShow"
:
wx
.
showMeasure
,
})
})
;
console
.
log
(
wx
.
$storage
.
get
(
'scene'
),
wx
.
$trackData
.
cardId
)
console
.
log
(
wx
.
$storage
.
get
(
"scene"
),
wx
.
$trackData
.
cardId
);
const
scene
=
wx
.
$storage
.
get
(
'scene'
);
const
scene
=
wx
.
$storage
.
get
(
"scene"
);
let
params
=
{
let
params
=
{
cardId
:
wx
.
$trackData
.
cardId
||
scene
.
cardId
cardId
:
wx
.
$trackData
.
cardId
||
scene
.
cardId
,
};
};
entmicroApi
.
getCardDetail
(
params
).
then
(({
data
,
code
,
message
})
=>
{
entmicroApi
.
getCardDetail
(
params
).
then
(({
data
,
code
,
message
})
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
;
if
(
code
==
-
1
)
{
if
(
code
==
-
1
)
{
wx
.
showToast
({
wx
.
showToast
({
title
:
message
,
title
:
message
,
icon
:
'none'
,
icon
:
"none"
,
duration
:
2000
duration
:
2000
,
})
})
;
}
}
const
cardInfo
=
data
||
this
.
data
.
defaultInfo
const
cardInfo
=
data
||
this
.
data
.
defaultInfo
;
console
.
log
(
data
,
cardInfo
)
console
.
log
(
data
,
cardInfo
);
this
.
setData
({
this
.
setData
(
cardInfo
{
},()
=>
{
cardInfo
,
this
.
setShareInfo
(
cardInfo
);
},
})
()
=>
{
this
.
setShareInfo
(
cardInfo
);
}
);
});
});
},
},
});
});
pages/tab/index/index.json
View file @
54f0bc1
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
"company-introduce"
:
"./components/companyIntroduce/companyIntroduce"
,
"company-introduce"
:
"./components/companyIntroduce/companyIntroduce"
,
"activity-info"
:
"./components/activity/activity"
,
"activity-info"
:
"./components/activity/activity"
,
"glsx-discover"
:
"glsx-applet-component/discover/index"
,
"glsx-discover"
:
"glsx-applet-component/discover/index"
,
"scenario"
:
"./components/scenario/scenario"
"scenario"
:
"./components/scenario/scenario"
,
"customer"
:
"../../../components/customer/customer"
},
},
"navigationBarTitleText"
:
"广联数科智能名片"
"navigationBarTitleText"
:
"广联数科智能名片"
}
\ No newline at end of file
\ No newline at end of file
}
pages/tab/index/index.wxml
View file @
54f0bc1
...
@@ -14,13 +14,12 @@
...
@@ -14,13 +14,12 @@
</view>
</view>
<view class="main-content">
<view class="main-content">
<block wx:if="{{curTabIndex == 0}}">
<block wx:if="{{curTabIndex == 0}}">
<!-- 增值转化 -->
<!-- 增值转化 -->
<scenario productData="{{productData}}" senceData="{{senceData}}">
<scenario productData="{{productData}}" senceData="{{senceData}}">
<activity-info slot="swiper"></activity-info>
<activity-info slot="swiper"></activity-info>
</scenario>
</scenario>
</block>
</block>
<block wx:if="{{curTabIndex == 1}}">系统订阅</block>
<block wx:if="{{curTabIndex == 1}}">系统订阅</block>
<block wx-if="{{curTabIndex == 2}}">
<block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}"></company-introduce>
<company-introduce autoplay="{{autoplay}}"></company-introduce>
</block>
</block>
...
@@ -33,4 +32,6 @@
...
@@ -33,4 +32,6 @@
<image class="floating-icon" bindtap="handleOpen" webp src="{{IMGURL}}home/custom.png?v={{img_version}}"></image>
<image class="floating-icon" bindtap="handleOpen" webp src="{{IMGURL}}home/custom.png?v={{img_version}}"></image>
</view>
</view>
</view>
</view>
<phone-number type="{{'home'}}" bindtoApplication="toApplication" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
\ No newline at end of file
\ No newline at end of file
<phone-number type="{{'home'}}" bindtoApplication="toApplication" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<!-- 客服咨询 -->
<customer wx:if="{{showCustomer}}" bindcloseQR="closeQR"></customer>
\ No newline at end of file
\ 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