名片测试版

This commit is contained in:
高健 2021-08-05 11:18:59 +08:00
parent 13b3015742
commit c44f3779d2
7 changed files with 72 additions and 71 deletions

View File

@ -15,10 +15,10 @@ Page({
personIntro: {}, personIntro: {},
companyIntro: {}, companyIntro: {},
shareImg: '', shareImg: '',
phoneTxt: '', phoneTxt: '未录入',
emailTxt: '', emailTxt: '未录入',
wechateTxt: '', wechateTxt: '未录入',
addressTxt: '', addressTxt: '未录入',
viewInfo: {}, viewInfo: {},
forwardCount: '', forwardCount: '',
imgUrl: app.urls.baseImgUrl, imgUrl: app.urls.baseImgUrl,
@ -134,6 +134,52 @@ Page({
wx.stopPullDownRefresh({}) wx.stopPullDownRefresh({})
}) })
}, },
//获取首页基础数据 电话 微信号 地址 邮箱
getMainBaseUserInfo(userid) {
var _self = this
app.http.get(app.urls.getMainMoment.format({
configColumnId: 'de7b5e22-64f9-4c60-a1f9-6ac004dfb9a8'
}), {
header: {
token: app.globalData.token
},
data: {
userId: userid
}
})
.then(res => {
if (res.data.length > 0) {
res.data[0].list.forEach(it => {
switch (it.name) {
case 'phone':
_self.setData({
phoneTxt: it.value
})
break
case 'wechat':
_self.setData({
wechateTxt: it.value
})
break
case 'email':
_self.setData({
emailTxt: it.value
})
break
case 'address':
_self.setData({
addressTxt: it.value
})
break
}
})
}
})
.catch(err => {
console.log(err)
})
},
//获取首页栏目数据
getMainMoment(datas, userid, index) { getMainMoment(datas, userid, index) {
var _self = this var _self = this
var count = datas.length var count = datas.length
@ -475,23 +521,7 @@ Page({
} else { } else {
area[i]['templateAreaFontStyle'] = 'italic' area[i]['templateAreaFontStyle'] = 'italic'
} }
if (area[i].templateAreaSource == 'phone') { if (area[i].templateAreaSource == 'name') {
self.setData({
phoneTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'wechat') {
self.setData({
wechatTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'email') {
self.setData({
emailTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'address') {
self.setData({
addressTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'name') {
self.setData({ self.setData({
nameTxt: area[i].templateAreaFontValue nameTxt: area[i].templateAreaFontValue
}) })
@ -512,6 +542,7 @@ Page({
}) })
app.globalData.userId = res.data.creator app.globalData.userId = res.data.creator
self.getMainColumn(res.data.creator) self.getMainColumn(res.data.creator)
self.getMainBaseUserInfo(res.data.creator)
} }
}).catch(res => { }).catch(res => {
@ -863,23 +894,7 @@ Page({
} else { } else {
area[i]['templateAreaFontStyle'] = 'italic' area[i]['templateAreaFontStyle'] = 'italic'
} }
if (area[i].templateAreaSource == 'phone') { if (area[i].templateAreaSource == 'name') {
self.setData({
phoneTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'wechat') {
self.setData({
wechatTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'email') {
self.setData({
emailTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'address') {
self.setData({
addressTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'name') {
self.setData({ self.setData({
nameTxt: area[i].templateAreaFontValue nameTxt: area[i].templateAreaFontValue
}) })
@ -899,6 +914,7 @@ Page({
tempUserId: res.data.creator tempUserId: res.data.creator
}) })
self.getMainColumn(res.data.creator) //获取当前用户的栏目 self.getMainColumn(res.data.creator) //获取当前用户的栏目
self.getMainBaseUserInfo(res.data.creator)
} }
}) })
}, },
@ -1029,23 +1045,7 @@ Page({
} else { } else {
area[i]['templateAreaFontStyle'] = 'italic' area[i]['templateAreaFontStyle'] = 'italic'
} }
if (area[i].templateAreaSource == 'phone') { if (area[i].templateAreaSource == 'name') {
self.setData({
phoneTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'wechat') {
self.setData({
wechatTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'email') {
self.setData({
emailTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'address') {
self.setData({
addressTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'name') {
self.setData({ self.setData({
nameTxt: area[i].templateAreaFontValue nameTxt: area[i].templateAreaFontValue
}) })

View File

@ -60,28 +60,28 @@
<image class="image" src="/images/ic_call_phone_icon.png"></image> <image class="image" src="/images/ic_call_phone_icon.png"></image>
<text>拨打电话</text> <text>拨打电话</text>
</view> </view>
<view>{{phoneTxt}}</view> <view style="flex:7;text-align: right;">{{phoneTxt}}</view>
</view> </view>
<view class="mid-btn-box" bindtap="copyText" data-text="{{wechateTxt}}"> <view class="mid-btn-box" bindtap="copyText" data-text="{{wechateTxt}}">
<view class="mid-btn-title"> <view class="mid-btn-title">
<image class="image" src="/images/ic_wechart_icon.png"></image> <image class="image" src="/images/ic_wechart_icon.png"></image>
<text>添加微信</text> <text>添加微信</text>
</view> </view>
<view>{{wechateTxt}}</view> <view style="flex:7;text-align: right;">{{wechateTxt}}</view>
</view> </view>
<view class="mid-btn-box" bindtap="copyText" data-text="{{emailTxt}}"> <view class="mid-btn-box" bindtap="copyText" data-text="{{emailTxt}}">
<view class="mid-btn-title"> <view class="mid-btn-title">
<image class="image" src="/images/ic_email_icon.png"></image> <image class="image" src="/images/ic_email_icon.png"></image>
<text>邮箱</text> <text>邮箱</text>
</view> </view>
<view>{{emailTxt}}</view> <view style="flex:7;text-align: right;">{{emailTxt}}</view>
</view> </view>
<view class="mid-btn-box" bindtap="copyText" data-text="{{addressTxt}}"> <view class="mid-btn-box" bindtap="copyText" data-text="{{addressTxt}}">
<view class="mid-btn-title"> <view class="mid-btn-title">
<image class="image" src="/images/ic_address_icon.png"></image> <image class="image" src="/images/ic_address_icon.png"></image>
<text>地址</text> <text>地址</text>
</view> </view>
<view>{{addressTxt}}</view> <view style="flex:7;text-align: right;">{{addressTxt}}</view>
</view> </view>
</view> </view>
<view class="good"> <view class="good">

View File

@ -474,14 +474,17 @@ page {
width: 100%; width: 100%;
padding-bottom: 0px; padding-bottom: 0px;
} }
.image-32{
.image-32 {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
} }
.image-64{
.image-64 {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
} }
.avatar-list { .avatar-list {
width: 45rpx; width: 45rpx;
height: 45rpx; height: 45rpx;
@ -572,7 +575,8 @@ page {
.mid-btn-title { .mid-btn-title {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: flex-start;
flex: 3;
align-items: center; align-items: center;
} }

View File

@ -9,7 +9,7 @@
<!-- 纵向 --> <!-- 纵向 -->
<view class="cu-list menu card-menu shadow-lg radius" bindtap="choosePage" data-item="{{group}}" <view class="cu-list menu card-menu shadow-lg radius" bindtap="choosePage" data-item="{{group}}"
data-path="{{group.configColumnRowTargetUrl}}" data-type="{{group.configColumnRowTargetMode}}"> data-path="{{group.configColumnRowTargetUrl}}" data-type="{{group.configColumnRowTargetMode}}">
<view class="cu-item arrow border-bottom-sm margin-top-sm" style="padding-bottom:10rpx;"> <view class="cu-item arrow border-bottom-sm" style="padding-bottom:10rpx;padding-top:10rpx;">
<image wx:if="{{group.configColumnPhoto.length>0}}" class="cu-avatar radius lg" <image wx:if="{{group.configColumnPhoto.length>0}}" class="cu-avatar radius lg"
src="{{imgUrl + group.configColumnPhoto}}" mode="scaleToFill"></image> src="{{imgUrl + group.configColumnPhoto}}" mode="scaleToFill"></image>
<view class="content padding-left-xs" style="width:80%;"> <view class="content padding-left-xs" style="width:80%;">

View File

@ -173,11 +173,8 @@ Page({
//跳转设置页面 //跳转设置页面
showSetting() { showSetting() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/mine/shop/addshop', url: '../../mine/setting/columnsetting'
}) })
// wx.navigateTo({
// url: '../../mine/setting/columnsetting'
// })
}, },
imgHeight(e) { imgHeight(e) {
var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度 var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度

View File

@ -130,7 +130,7 @@ map,
right: 20rpx; right: 20rpx;
bottom: 20rpx; bottom: 20rpx;
padding: 20rpx; padding: 20rpx;
background: #0054bd; background: #E6B980;
border-radius: 50%; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
align-items: center; align-items: center;

View File

@ -1,7 +1,7 @@
var apis = { var apis = {
url: 'http://192.168.0.111:8091/systemcard/', url: 'http://192.168.0.115:8091/systemcard/',
userCenter: 'http://192.168.0.111:8091/systemcard/', userCenter: 'http://192.168.0.115:8091/systemcard/',
baseImgUrl: 'http://192.168.0.111:8091/systemcard/route/file/download/true/', baseImgUrl: 'http://192.168.0.115:8091/systemcard/route/file/download/true/',
doSaveUserInfo: `app/miniapp/user/update-info`, //保存微信头像与名称 doSaveUserInfo: `app/miniapp/user/update-info`, //保存微信头像与名称
doUpdatePhone: `app/miniapp/update-phone`, //绑定手机号 token, {phone:''} put doUpdatePhone: `app/miniapp/update-phone`, //绑定手机号 token, {phone:''} put
doUploadImg: `app/file/uploadimage`, //上传图片 doUploadImg: `app/file/uploadimage`, //上传图片