Commit f8757c28 by 谢中龙

导购对外名片修改

parent a0bef573
...@@ -63,6 +63,30 @@ wxService.page({ ...@@ -63,6 +63,30 @@ wxService.page({
onShow: function () { onShow: function () {
this.getRecruitRanking() // 招募榜 this.getRecruitRanking() // 招募榜
}, },
//打开我的名片
onTapOpenMyFile(){
// let uInfo = wx.getStorageSync('_baseUserInfo');
// if (uInfo){
// let myUserId = uInfo.member.qiyeInfo.userid;
// console.log(myUserId)
// wx.qy.openUserProfile({
// type : 1,
// userid: myUserId,
// success : res => {
// console.log('ok',res)
// },
// fail : err => {
// console.log('error')
// },
// })
// }
wx.navigateTo({
url: '/shoppingGuid/page/pages/qrcode/qrcode',
});
// console.log(uInfo)
},
//获取排行榜 //获取排行榜
getRecruitRanking() { getRecruitRanking() {
wx.showLoading({ wx.showLoading({
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_member_center.png' mode='aspectFit'></image> <image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_member_center.png' mode='aspectFit'></image>
<view class='tool-name'>会员中心</view> <view class='tool-name'>会员中心</view>
</view> </view>
<view class='tools-item' bindtap='onTapOpenMyFile'>
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_my_card.jpg' mode='aspectFit'></image>
<view class='tool-name'>我的名片</view>
</view>
</view> </view>
</view> </view>
<!-- 整体布局 --> <!-- 整体布局 -->
......
...@@ -44,8 +44,8 @@ view{ ...@@ -44,8 +44,8 @@ view{
.top-items .tools-item{ .top-items .tools-item{
flex: 0; flex: 0;
min-width: 30%; min-width: 25%;
max-width: 30%; max-width: 25%;
height: auto; height: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -13,7 +13,29 @@ wxService.page({ ...@@ -13,7 +13,29 @@ wxService.page({
avator: '', avator: '',
name :'', name :'',
template : {}, template : {},
cardImg : '' cardImg : '',
companyName: '',
bottomTypeArr : [
{
name: "关注公众号",
url: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_focus_wx_no_bg.png',
active: false,
type:1
},
{
name: "企业微信",
url: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_qiye_wx_no_bg.png',
active: true ,
type: 2
},
{
name: "开卡页",
url: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_open_card_no_bg.png',
active: false ,
type: 3
},
],
currentBottomType : '2'
}, },
/** /**
...@@ -63,7 +85,6 @@ wxService.page({ ...@@ -63,7 +85,6 @@ wxService.page({
//获取企业二维码 //获取企业二维码
getEnterpriseQrcode(){ getEnterpriseQrcode(){
let guideCodeImg = wx.getStorageSync('guideCodeImg'); let guideCodeImg = wx.getStorageSync('guideCodeImg');
console.log('guideCodeImg---', guideCodeImg)
if (!guideCodeImg){ if (!guideCodeImg){
wx.qy.getQrCode({ wx.qy.getQrCode({
success: res => { success: res => {
...@@ -99,58 +120,36 @@ wxService.page({ ...@@ -99,58 +120,36 @@ wxService.page({
}); });
}, },
//保存名片按钮 //改变二位方式
onTapSaveCardToColumn(){ onTapChangeType(e){
if (!this.data.codeImg){ let index = e.currentTarget.dataset.index;
wx.showToast({ this.data.bottomTypeArr.map(item => {
title: '导购二维码不存在', item.active = false;
icon : 'none'
}); });
return ;
}
wx.showLoading({ this.data.bottomTypeArr[index].active = true;
title: '图片生成中...', this.data.currentBottomType = this.data.bottomTypeArr[index].type;
});
let avatar = this.data.avator ? this.data.avator : 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png'; this.setData({
let self = this; bottomTypeArr: this.data.bottomTypeArr,
wx.downloadFile({ currentBottomType: this.data.currentBottomType
url: this.data.codeImg,
success(res){
if (res.statusCode === 200) {
let codeImg = res.tempFilePath;
wx.downloadFile({
url: avatar,
success(res) {
if (res.statusCode === 200) {
let avatarImg = res.tempFilePath;
console.log('头像---', avatarImg)
console.log('图片---', codeImg)
self.setData({
template: new GuiderCard().palette(codeImg, avatarImg, self.data.name)
}); });
}
this.changeQrcode();
}, },
fail(res) {
wx.showToast({ //根据类型切换qrcode
title: '头像下载失败', changeQrcode(){
icon: 'none' console.log(this.data.currentBottomType)
}); if(this.data.currentBottomType == 2){ //企业二维码
} this.getEnterpriseQrcode();
});
} }
}, else if (this.data.currentBottomType == 1){ //带门店参数的关注公众号二维码
fail(res){
wx.showToast({
title: '二维码下载失败',
icon : 'none'
})
} }
}); else if (this.data.currentBottomType == 3){ //开卡页
}
}, },
/** /**
...@@ -160,40 +159,6 @@ wxService.page({ ...@@ -160,40 +159,6 @@ wxService.page({
}, },
//生成二维码后
onImgOK(e) {
console.log('生成成功!',e);
let imgUrl = e.detail.path;
wx.saveImageToPhotosAlbum({
filePath: imgUrl,
success(res) {
wx.hideLoading();
setTimeout(() => {
wx.showToast({
title: '保存成功,请前往相册查看~',
icon: 'none'
}, 2000)
})
},
fail(err) {
console.log(err)
let txt = '保存失敗';
if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
txt = '获取相册授权失败'
}
wx.hideLoading();
setTimeout(() => {
wx.showToast({
title: txt,
icon: 'none'
}, 2000)
})
}
});
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
......
<!--shoppingGuid/page/pages/qrcode/qrcode.wxml--> <!--shoppingGuid/page/pages/qrcode/qrcode.wxml-->
<view class='qrcode'> <view class='qrcode'>
<view class='taps'>
<text>添加为企微好友</text>
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_right_three.png' mode='aspectFit'></image>
<text>发送欢迎语卡片</text>
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_right_three.png' mode='aspectFit'></image>
<text>引导注册成为会员</text>
</view>
<view class='card'> <view class='card'>
<image class='g-qrcode' mode='aspectFit' src='{{codeImg}}'></image> <image class='g-qrcode' mode='aspectFit' src='{{codeImg}}'></image>
<image class='g-logo' mode='aspectFit' src='{{avator}}'></image> <image class='g-logo' mode='aspectFit' src='{{avator}}'></image>
<text class='name'>{{name}}</text> <text class='name'>{{name}}</text>
<text class='company'>{{companyName}}</text>
</view> </view>
</view> </view>
<!-- 底部操作按钮 --> <!-- 底部操作按钮 -->
<view class='bottom-operator' bindtap='onTapSaveCardToColumn'> <view class='bottom-operator'>
<icon type='download' size='16' color="rgb(0, 145, 255)"></icon>保存名片到相册 <view class='items {{item.active ? "active" : ""}}'
</view> wx:for="{{bottomTypeArr}}"
wx:for-item="item"
<!-- 预览 --> wx:for-index="idx"
<view class='preview'> wx:key="{{idx}}"
<painter palette="{{template}}" bind:imgOK="onImgOK" /> data-index="{{idx}}"
bindtap='onTapChangeType'>
<image src='{{item.url}}' mode='aspectFit'></image>
<view>{{item.name}}</view>
</view>
</view> </view>
...@@ -15,16 +15,39 @@ view{ ...@@ -15,16 +15,39 @@ view{
.qrcode{ .qrcode{
padding: 50rpx; padding: 50rpx;
padding-top: 130rpx;
width: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-image: url(https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_shoudi_mingp.png);
margin-top: 30rpx;
position: relative;
}
.qrcode .taps{
position: absolute;
display: flex;
color: #0091FF;
top: 30rpx;
left: 0;
align-items: center;
justify-content: center;
width: 100%;
font-size: 24rpx;
}
.qrcode .taps image{
width: 40rpx;
height: 24rpx;
} }
.qrcode .card{ .qrcode .card{
width: 100%; width: 100%;
height: auto; height: auto;
padding: 100rpx 30rpx; padding: 100rpx 30rpx;
background: #ffffff; background: transparent;
border-radius: 10rpx; border-radius: 10rpx;
/* border: 12rpx solid rgba(0, 145, 255, 0.46); */
box-shadow: 0 0 20rpx 8rpx rgba(0, 145, 255, 0.46);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -49,6 +72,12 @@ view{ ...@@ -49,6 +72,12 @@ view{
font-size: 36rpx; font-size: 36rpx;
color: #333333; color: #333333;
font-weight: bold; font-weight: bold;
margin-bottom: 20rpx;
}
.qrcode .card .company{
font-size: 24rpx;
color: #999999;
} }
/* 底部操作按钮 */ /* 底部操作按钮 */
...@@ -57,7 +86,7 @@ view{ ...@@ -57,7 +86,7 @@ view{
bottom: 20rpx; bottom: 20rpx;
left: 0; left: 0;
width: 100%; width: 100%;
height: 80rpx; height: 140rpx;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 30rpx; padding: 0 30rpx;
...@@ -66,18 +95,29 @@ view{ ...@@ -66,18 +95,29 @@ view{
font-size: 28rpx; font-size: 28rpx;
} }
.bottom-operator icon{ .bottom-operator .items{
margin-right: 10rpx; width: 140rpx;
height: 140rpx;
margin-right: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #999999;
border-radius: 8rpx;
}
.bottom-operator .items image{
width: 80rpx;
height: 80rpx;
margin-bottom: 5rpx;
} }
.bottom-operator:active{ .bottom-operator .items:active{
opacity: 0.7; opacity: 0.7;
} }
.preview{ .bottom-operator .items.active{
width: 100%;
height: 100vh;
background: #ffffff; background: #ffffff;
position: absolute;
transform: translateX(-100%);
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment