Commit 8caec6ba by 前端

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
...@@ -31,13 +31,13 @@ ...@@ -31,13 +31,13 @@
</view> </view>
<view wx:if="{{type == 'video'}}" class="isFullSucreen video-btn"> <view wx:if="{{type == 'video'}}" class="isFullSucreen video-btn">
<view class="video-box"> <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> <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> </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> <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> </button>
</view> </view>
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button> <button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button>
......
...@@ -8,7 +8,8 @@ Page({ ...@@ -8,7 +8,8 @@ Page({
*/ */
data: { data: {
activityInfo: {}, activityInfo: {},
hasPhoneNumber: false hasPhoneNumber: false,
autoplay: true
}, },
toActivity(){ toActivity(){
...@@ -64,6 +65,17 @@ Page({ ...@@ -64,6 +65,17 @@ Page({
}) })
}, },
handleplay() {
this.setData({
autoplay: false
})
},
handlepause() {
this.setData({
autoplay: true
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
...@@ -9,7 +9,12 @@ ...@@ -9,7 +9,12 @@
height: 422rpx; height: 422rpx;
} }
} }
.activity-name {
font-size: 32rpx;
font-weight: 600;
background-color: #fff;
padding: 16rpx 32rpx 32rpx;
}
.activity-introduction { .activity-introduction {
margin-top: 20rpx; margin-top: 20rpx;
background-color: #fff; background-color: #fff;
...@@ -26,6 +31,7 @@ ...@@ -26,6 +31,7 @@
color: #444444; color: #444444;
line-height: 52rpx; line-height: 52rpx;
} }
.activity-info { .activity-info {
margin-top: 16rpx; margin-top: 16rpx;
.activity-item { .activity-item {
......
<!--packagesList/pages/activityDetail/activityDetail.wxml--> <!--packagesList/pages/activityDetail/activityDetail.wxml-->
<view class="activity-detail"> <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}}"> <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>
<swiper-item class="swiper-item" wx:for="{{activityInfo.imageUrlArr}}" wx:key="index"> <swiper-item class="swiper-item" wx:for="{{activityInfo.imageUrlArr}}" wx:key="index">
<image class="swiper-img" webp src="{{item}}"></image> <image class="swiper-img" webp src="{{item}}"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="activity-name">{{activityInfo.activityName}}</view>
<view class="activity-introduction"> <view class="activity-introduction">
<view class="activity-title">活动介绍</view> <view class="activity-title">活动介绍</view>
<view class="activity-content"> <view class="activity-content">
......
...@@ -154,6 +154,7 @@ Page({ ...@@ -154,6 +154,7 @@ Page({
console.log(options) console.log(options)
this.getActiveApiFn() this.getActiveApiFn()
if (options && options.cardId) { if (options && options.cardId) {
wx.$util.showLoading('加载中...')
wx.$trackData = options wx.$trackData = options
// wx.$trackData.cardId = options.cardId // wx.$trackData.cardId = options.cardId
wx.$storage.set('scene', options) wx.$storage.set('scene', options)
...@@ -164,11 +165,13 @@ Page({ ...@@ -164,11 +165,13 @@ Page({
getApp() getApp()
.login() .login()
.then(({ data }) => { .then(({ data }) => {
console.log(data)
if (data && data.phone) { if (data && data.phone) {
this.setData({ this.setData({
hasPhoneNumber: true hasPhoneNumber: true
}) })
} }
wx.$util.hideLoading()
}) })
const {name, actNum, activeNavIdx, leftMenuIndex, proName} = options const {name, actNum, activeNavIdx, leftMenuIndex, proName} = options
this.getCardDetail() this.getCardDetail()
...@@ -238,8 +241,7 @@ Page({ ...@@ -238,8 +241,7 @@ Page({
console.log('cardId', cardId, 'merchant', merchant) console.log('cardId', cardId, 'merchant', merchant)
const {actNum, activeNavIdx, pageName, leftMenuIndex, proName} = this.data const {actNum, activeNavIdx, pageName, leftMenuIndex, proName} = this.data
return { return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`, title: `给你分享一个活动,戳我参与~`,
imageUrl: this.data.shareImg,
path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&leftMenuIndex=${leftMenuIndex}&proName=${proName}` 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({ ...@@ -251,137 +253,6 @@ Page({
hasPhoneNumber: e.detail ? true : false 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() { getCardDetail() {
const scene = wx.$storage.get('scene') const scene = wx.$storage.get('scene')
...@@ -390,7 +261,6 @@ Page({ ...@@ -390,7 +261,6 @@ Page({
} }
console.log(params) console.log(params)
entmicroApi.getCardDetail(params).then(({ data, code, message }) => { entmicroApi.getCardDetail(params).then(({ data, code, message }) => {
wx.hideLoading()
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
title: message, title: message,
...@@ -403,9 +273,6 @@ Page({ ...@@ -403,9 +273,6 @@ Page({
this.setData( this.setData(
{ {
cardInfo cardInfo
},
() => {
this.setShareInfo(cardInfo)
} }
) )
}) })
......
...@@ -114,13 +114,23 @@ Page({ ...@@ -114,13 +114,23 @@ Page({
}, 100); }, 100);
}; };
})(), })(),
//获取配置url
async getActiveApiFn(){
let {code,data} = await entmicroApi.getActiveApi()
if(code == 0){
this.setData({
activeUrl: data
})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options) console.log(options)
this.getActiveApiFn()
if (options && options.cardId) { if (options && options.cardId) {
wx.$trackData = options wx.$trackData = options
wx.$storage.set('scene', options) wx.$storage.set('scene', options)
......
<!--packagesList/pages/scenarioDetail/scenarioDetail.wxml--> <!--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> <phone-number custom-class="pro_phone_number" type="scenario" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!