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 8caec6ba
authored
Dec 28, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'huyue_v3.3.0' of
http://192.168.3.233:8090/saas/mini-program/ai-card
into huyue_v3.3.0
2 parents
0132d145
10cf3b56
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
147 deletions
components/PhoneNumber/PhoneNumber.wxml
packagesList/pages/activityDetail/activityDetail.js
packagesList/pages/activityDetail/activityDetail.scss
packagesList/pages/activityDetail/activityDetail.wxml
packagesList/pages/productDetail/productDetail.js
packagesList/pages/scenarioDetail/scenarioDetail.js
packagesList/pages/scenarioDetail/scenarioDetail.wxml
components/PhoneNumber/PhoneNumber.wxml
View file @
8caec6b
...
...
@@ -31,13 +31,13 @@
</view>
<view wx:if="{{type == 'video'}}" class="isFullSucreen video-btn">
<view class="video-box">
<view class="btn-item">
<view class="btn-item"
bindtap="downVideo"
>
<image class="icon-forward" webp src="{{IMGURL}}home/icon-download.png"></image>
<view class="btn-text"
bindtap="downVideo"
>下载</view>
<view class="btn-text" >下载</view>
</view>
<button class="btn-item forward_box share_btn_item" open-type="share">
<button class="btn-item forward_box share_btn_item"
bindtap="forward"
open-type="share">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="btn-text"
bindtap="forward"
>转发</view>
<view class="btn-text">转发</view>
</button>
</view>
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button>
...
...
packagesList/pages/activityDetail/activityDetail.js
View file @
8caec6b
...
...
@@ -8,7 +8,8 @@ Page({
*/
data
:
{
activityInfo
:
{},
hasPhoneNumber
:
false
hasPhoneNumber
:
false
,
autoplay
:
true
},
toActivity
(){
...
...
@@ -64,6 +65,17 @@ Page({
})
},
handleplay
()
{
this
.
setData
({
autoplay
:
false
})
},
handlepause
()
{
this
.
setData
({
autoplay
:
true
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
...
...
packagesList/pages/activityDetail/activityDetail.scss
View file @
8caec6b
...
...
@@ -9,7 +9,12 @@
height
:
422rpx
;
}
}
.activity-name
{
font-size
:
32rpx
;
font-weight
:
600
;
background-color
:
#fff
;
padding
:
16rpx
32rpx
32rpx
;
}
.activity-introduction
{
margin-top
:
20rpx
;
background-color
:
#fff
;
...
...
@@ -26,6 +31,7 @@
color
:
#444444
;
line-height
:
52rpx
;
}
.activity-info
{
margin-top
:
16rpx
;
.activity-item
{
...
...
packagesList/pages/activityDetail/activityDetail.wxml
View file @
8caec6b
<!--packagesList/pages/activityDetail/activityDetail.wxml-->
<view class="activity-detail">
<swiper class="swiper" autoplay circular="true" current="{{current}}" interval="5000">
<swiper class="swiper" autoplay
="{{autoplay}}"
circular="true" current="{{current}}" interval="5000">
<swiper-item class="swiper-item" wx:if="{{activityInfo.videoUrl}}">
<video class="swiper-img" src="{{activityInfo.videoUrl}}" poster="{{activityInfo.videoImage}}"></video>
<video class="swiper-img" src="{{activityInfo.videoUrl}}" poster="{{activityInfo.videoImage}}"
bindplay="handleplay" bindpause="handlepause"
></video>
</swiper-item>
<swiper-item class="swiper-item" wx:for="{{activityInfo.imageUrlArr}}" wx:key="index">
<image class="swiper-img" webp src="{{item}}"></image>
</swiper-item>
</swiper>
<view class="activity-name">{{activityInfo.activityName}}</view>
<view class="activity-introduction">
<view class="activity-title">活动介绍</view>
<view class="activity-content">
...
...
packagesList/pages/productDetail/productDetail.js
View file @
8caec6b
...
...
@@ -154,6 +154,7 @@ Page({
console
.
log
(
options
)
this
.
getActiveApiFn
()
if
(
options
&&
options
.
cardId
)
{
wx
.
$util
.
showLoading
(
'加载中...'
)
wx
.
$trackData
=
options
// wx.$trackData.cardId = options.cardId
wx
.
$storage
.
set
(
'scene'
,
options
)
...
...
@@ -164,11 +165,13 @@ Page({
getApp
()
.
login
()
.
then
(({
data
})
=>
{
console
.
log
(
data
)
if
(
data
&&
data
.
phone
)
{
this
.
setData
({
hasPhoneNumber
:
true
})
}
wx
.
$util
.
hideLoading
()
})
const
{
name
,
actNum
,
activeNavIdx
,
leftMenuIndex
,
proName
}
=
options
this
.
getCardDetail
()
...
...
@@ -238,8 +241,7 @@ Page({
console
.
log
(
'cardId'
,
cardId
,
'merchant'
,
merchant
)
const
{
actNum
,
activeNavIdx
,
pageName
,
leftMenuIndex
,
proName
}
=
this
.
data
return
{
title
:
`您好,我向你推荐了广联数科
${
this
.
data
.
cardInfo
.
staffName
}
的智能名片~`
,
imageUrl
:
this
.
data
.
shareImg
,
title
:
`给你分享一个活动,戳我参与~`
,
path
:
`packagesList/pages/productDetail/productDetail?cardId=
${
cardId
}
&merchant=
${
merchant
}
&shareType=
${
shareType
}
&actNum=
${
actNum
}
&activeNavIdx=
${
activeNavIdx
}
&name=
${
pageName
}
&leftMenuIndex=
${
leftMenuIndex
}
&proName=
${
proName
}
`
}
},
...
...
@@ -251,137 +253,6 @@ Page({
hasPhoneNumber
:
e
.
detail
?
true
:
false
})
},
setShareInfo
(
data
=
{})
{
const
canvasWidth
=
208
,
canvasHeight
=
166
,
textBaseline
=
'top'
const
draw_function
=
new
Draw
(
this
,
{
width
:
canvasWidth
,
height
:
canvasHeight
// pixelRatio: 2,
// backgroundColor: '#096'
})
const
drawCard
=
callBack
=>
{
let
index
=
0
const
iconWidth
=
9
,
iconHeight
=
9
,
iconX
=
18
,
iconY
=
79
,
imgList
=
[
{
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png'
,
x
:
0
,
y
:
0
,
width
:
canvasWidth
,
height
:
124
},
{
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png'
,
x
:
15
,
y
:
18
,
width
:
152
,
height
:
10
},
// 头像的
{
// url: "https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg",
url
:
data
.
image
,
x
:
154
,
y
:
36
,
width
:
36
,
height
:
36
},
{
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png'
,
x
:
iconX
,
y
:
iconY
,
width
:
iconWidth
,
height
:
iconHeight
},
{
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png'
,
x
:
iconX
,
y
:
iconY
+
13
,
width
:
iconWidth
,
height
:
iconHeight
},
{
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png'
,
x
:
64
,
y
:
138
,
width
:
80
,
height
:
24
}
],
textList
=
[
{
text
:
data
.
staffName
,
x
:
18
,
y
:
40
,
color
:
'#2D2D33'
,
fontWeight
:
600
,
fontSize
:
14
},
{
text
:
data
.
operation
,
x
:
22
+
draw_function
.
getTextWidth
(
data
.
staffName
,
14
),
y
:
44
,
color
:
'#6E6E7A'
,
fontWeight
:
400
,
fontSize
:
8
},
{
text
:
data
.
staffPhone
,
x
:
30
,
y
:
80
,
color
:
'#6E6E7A'
,
fontSize
:
7
},
{
text
:
'深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层'
,
x
:
30
,
y
:
94
,
color
:
'#6E6E7A'
,
fontSize
:
7
,
lineNum
:
2
,
width
:
185
,
lineHeight
:
9
}
]
const
drawImages
=
callBack
=>
{
draw_function
.
drawImages
(
imgList
[
index
],
()
=>
{
index
+=
1
if
(
index
!=
imgList
.
length
)
drawImages
(
callBack
)
else
callBack
()
})
}
drawImages
(()
=>
{
try
{
textList
.
map
((
e
,
ind
)
=>
{
e
.
textBaseline
=
textBaseline
draw_function
.
drawText
(
e
)
if
(
ind
==
textList
.
length
-
1
)
throw
true
})
}
catch
(
error
)
{
draw_function
.
toDataURL
(({
path
})
=>
{
this
.
setData
(
{
shareImg
:
path
,
shareDisabled
:
false
},
()
=>
{
wx
.
showShareMenu
({
menus
:
[
'shareAppMessage'
]
})
}
)
})
}
})
}
drawCard
()
},
// 获取员工名片信息
getCardDetail
()
{
const
scene
=
wx
.
$storage
.
get
(
'scene'
)
...
...
@@ -390,7 +261,6 @@ Page({
}
console
.
log
(
params
)
entmicroApi
.
getCardDetail
(
params
).
then
(({
data
,
code
,
message
})
=>
{
wx
.
hideLoading
()
if
(
code
==
-
1
)
{
wx
.
showToast
({
title
:
message
,
...
...
@@ -403,9 +273,6 @@ Page({
this
.
setData
(
{
cardInfo
},
()
=>
{
this
.
setShareInfo
(
cardInfo
)
}
)
})
...
...
packagesList/pages/scenarioDetail/scenarioDetail.js
View file @
8caec6b
...
...
@@ -114,13 +114,23 @@ Page({
},
100
);
};
})(),
//获取配置url
async
getActiveApiFn
(){
let
{
code
,
data
}
=
await
entmicroApi
.
getActiveApi
()
if
(
code
==
0
){
this
.
setData
({
activeUrl
:
data
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
console
.
log
(
options
)
this
.
getActiveApiFn
()
if
(
options
&&
options
.
cardId
)
{
wx
.
$trackData
=
options
wx
.
$storage
.
set
(
'scene'
,
options
)
...
...
packagesList/pages/scenarioDetail/scenarioDetail.wxml
View file @
8caec6b
<!--packagesList/pages/scenarioDetail/scenarioDetail.wxml-->
<pro-detail id="pro-detail" detailType="{{'scen'}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" cardInfo="{{cardInfo}}"></pro-detail>
<pro-detail id="pro-detail" detailType="{{'scen'}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}"
activeUrl="{{activeUrl}}"
cardInfo="{{cardInfo}}"></pro-detail>
<phone-number custom-class="pro_phone_number" type="scenario" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
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