Commit 1e56a612 by zhangxw

优化

1 parent d7df9bce
......@@ -17,24 +17,17 @@ Component({
navHeight: thisPage.data.navHeight
})
if (val.showSharePopup) {
wx.$util.getViewInfo('.user-box', res => {
this.setData({
boxImageHeight: res.height,
})
val.boxImageHeight = res.height
val.boxImageHeight = 66
// 计算弹窗图片区域最大高度
wx.$util.getViewInfo('.layout', res => {
this.setData({
postersBoxHeight: res.height * 0.7,
postersImageHeight: res.height * 0.7 - this.data.boxImageHeight - 20
postersImageHeight: (res.height / res.width ) * 247
})
val.postersBoxHeight = res.height * 0.7,
val.postersImageHeight = res.height * 0.7 - this.data.boxImageHeight - 20
this.init(val)
// this.init(val)
val.postersImageHeight = (res.height / res.width ) * 247
this.init(val)
})
}, this)
}
}
......@@ -57,7 +50,8 @@ Component({
wx.$api.showLoading()
const drawfun = new Draw({
width: 280,
height: 560 + n.boxImageHeight
height: n.postersImageHeight + 80,
borderRadius: 8
}, this),
{
userInfo
......@@ -70,27 +64,22 @@ Component({
height: n.boxImageHeight,
url: `${this.data.IMGURL}taskDetail_bg.png`
},
// {
// x: 12,
// y: 12,
// width: 20,
// height: 20,
// url: `${userInfo.weChatAvatarUrl ? userInfo.weChatAvatarUrl : this.data.IMGURL}order_person_default.png`
// },
{
x: 12,
y: 12,
width: 20,
height: 20,
borderRadius: 40,
// url: `${userInfo.sta_avatarUrl && userInfo.sta_avatarUrl.indexOf('https://thirdwx.qlogo.cn') > -1 ? userInfo.sta_avatarUrl : userInfo.weChatAvatarUrl && userInfo.weChatAvatarUrl.indexOf('https://thirdwx.qlogo.cn') > -1 ? userInfo.weChatAvatarUrl : this.data.IMGURL}default_avatar.png`
url: `${this.data.IMGURL}default_avatar.png`
},
{
x: 16,
y: n.boxImageHeight + 10,
width: 247,
height: 500,
height: n.postersImageHeight,
url: n.posterImg
},
// {
// x: 204,
// y: n.postersImageHeight / 2 + boxImageHeight + 20,
// width: 60,
// height: 60,
// url: n.imagePath
// }
],
textList: [{
x: 44,
......@@ -130,22 +119,6 @@ Component({
padding: [5, 5]
}
},
// {
// x: 16,
// y: (n.postersImageHeight / 2) + boxImageHeight + 30,
// fontSize: 13,
// color: '#1B233D',
// text: userInfo.merchantName
// },
// {
// x: 16,
// y: n.postersImageHeight / 2 + boxImageHeight + 50,
// fontSize: 11,
// color: '#6E6E7A',
// text: n.address,
// lineNum: 3,
// width: 193
// }
],
})
wx.hideLoading()
......@@ -179,7 +152,6 @@ Component({
}
)
},
noScroll() {},
authFail(e) {
this.setData({
showAuth: true
......
......@@ -35,85 +35,15 @@
}
.share-popup-content{
position: relative;
// position: relative;
background: #FFFFFF;
border-radius: 16rpx;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
overflow-y: auto;
overflow: auto;
.bg{
width: 100%;
height: 132rpx;
}
.user-box{
position: absolute;
top: 0;
padding: 24rpx;
display: flex;
image{
width: 40rpx;
height: 40rpx;
margin-right: 24rpx;
flex-shrink: 0;
border-radius: 20rpx;
}
.message{
display: flex;
flex-flow: column;
justify-content: space-between;
font-size: 28rpx;
color: #2D2D33;
.name{
font-size: 28rpx;
text{
font-size: 24rpx;
color: #6E6E7A;
margin-left: 16rpx;
}
}
.activity{
word-break: break-all;
.activity-type-tag{
font-size: 20rpx;
color: #4466F0;
background: rgba(255,255,255,0.32);
border: 1px solid rgba(143,165,255,0.50);
padding: 0 12rpx;
border-radius: 2px;
margin-left: 8rpx;
white-space: nowrap;
}
}
}
}
.content-box{
width: 100%;
padding: 32rpx 32rpx 0 32rpx;
box-sizing: border-box;
.posters_img{
margin: 0 auto;
width: 100%;
}
.merchant_box{
display: flex;
justify-content: space-between;
margin-top: 16rpx;
.name{
font-weight: 500;
font-size: 26rpx;
color: #1B233D;
}
.address{
font-weight: 400;
font-size: 22rpx;
color: #6E6E7A;
}
.qrcode{
flex-shrink: 0;
width: 120rpx;
height: 120rpx;
}
}
}
}
.btn-box{
display: flex;
......
<!--components/sharePopup/sharePopup.wxml-->
<view class="share-popup" wx:if="{{data.showSharePopup}}" catchtouchmove="noScroll">
<view class="share-popup" wx:if="{{data.showSharePopup}}">
<view class="share-popup-bg" />
<view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="close-box">
......@@ -7,34 +7,8 @@
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
</view>
</view>
<view class="share-popup-content" style="height: {{postersBoxHeight}}px;">
<!-- 用户活动信息 -->
<block>
<image class="bg" style="height: {{boxImageHeight}}px;" webp src="{{IMGURL}}taskDetail_bg.png"></image>
<view class="user-box">
<image webp class="user_image" src="{{USERINFO.weChatAvatarUrl ? USERINFO.weChatAvatarUrl : IMGURL + 'order_person_default.png'}}"></image>
<view class="message">
<view class="name">{{USERINFO.weChatNickName || USERINFO.name || ""}}<text>邀请你参加</text></view>
<view class="activity"><text>{{data.activityName || ""}}</text><text class="activity-type-tag">{{activityTypList[0]}}</text></view>
</view>
</view>
</block>
<!-- 海报 -->
<block>
<view class="content-box">
<image class="posters_img" style="height: {{postersImageHeight}}px;" mode="aspectFit" src="{{data.posterImg}}"></image>
<!-- <view class="merchant_box">
<view class="merchant_message">
<view class="name">{{USERINFO.merchantName}}</view>
<view class="address">{{data.address}}</view>
</view>
<view class="qrcode">
<image src="{{data.imagePath}}"></image>
</view>
</view> -->
</view>
</block>
<!-- 保存 -->
<view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<image style="height: {{postersImageHeight + 80}}px;" mode="widthFix" src="{{poster}}"></image>
</view>
<view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view>
......@@ -45,4 +19,3 @@
<canvas style="width:355px;height:370px; margin:0 auto;" canvas-id="mycanvas" />
</view>
</view>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize> -->
......@@ -39,8 +39,7 @@ Page({
ActivityApi.getNotOpenProductsList({merchantId: USERINFO.merchantId, sceneCode: code}).then(res => { // 默认选中第一个业务场景 获取可用产品/活动
res.forEach(item => {
item.isSelect = false
console.log(this.data.currentSceneCode)
if (item.status == 0 && item.sceneCode == this.data.currentSceneCode) arr.push(item)
if (item.sceneCode == this.data.currentSceneCode) arr.push(item)
})
this.setData({
product: arr
......
......@@ -13,7 +13,7 @@
<view class="list-item" style="background-image: {{statusBackgroundColor[item.orderStatus]}};">
<view class="top">
<view class="top-left">
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'order_person_default.png'}}"></image>
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'default_avatar.png'}}"></image>
<view class="name-mobile">
<view class="name">
{{item.customerNickName || ""}}
......
......@@ -8,7 +8,7 @@
<view class="share-box">
<image class="bg" webp src="{{IMGURL}}taskDetail_bg.png"></image>
<view class="user-box">
<image webp src="{{detailInfo.weChatAvatarUrl ? detailInfo.weChatAvatarUrl : IMGURL + 'order_person_default.png'}}"></image>
<image webp src="{{detailInfo.weChatAvatarUrl ? detailInfo.weChatAvatarUrl : IMGURL + 'default_avatar.png'}}"></image>
<view class="message">
<view class="name">{{detailInfo.staffName || ""}}<text>邀请你参加</text></view>
<view class="activity">{{detailInfo.merchantName || ""}}{{detailInfo.activityName || ""}}<text>{{activityTypList[0]}}</text></view>
......
......@@ -25,7 +25,7 @@
<view class="share-box" wx:if="{{detailInfo.missonType == 2}}">
<image class="bg" style="height: {{boxImageHeight}}px;" webp src="{{IMGURL}}taskDetail_bg.png"></image>
<view class="user-box">
<image webp class="user_image" src="{{userStorage.weChatAvatarUrl ? userStorage.weChatAvatarUrl : IMGURL + 'order_person_default.png'}}"></image>
<image webp class="user_image" src="{{userStorage.weChatAvatarUrl ? userStorage.weChatAvatarUrl : IMGURL + 'default_avatar.png'}}"></image>
<view class="message">
<view class="name">{{userStorage.weChatNickName || userStorage.name || ""}}<text>邀请你参加</text></view>
<view class="activity"><text>{{userStorage.merchantName || ""}}{{detailInfo.activityName || ""}}</text><text class="activity-type-tag">{{activityTypList[0]}}</text></view>
......
......@@ -13,7 +13,7 @@
<view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}">
<view class="top">
<view class="top-left">
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'order_person_default.png'}}"></image>
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'default_avatar.png'}}"></image>
<view class="name-mobile">
<view class="name">
{{item.customerNickName || ""}}
......
......@@ -166,7 +166,7 @@ Page({
loginUserInfoList,
sessionId
}) {
if (loginUserInfoList.length > 1) wx.$router.go('/pages/authentication/accountItems/accountItems', {
if (loginUserInfoList.length > 1) wx.$router.reLaunch('/pages/authentication/accountItems/accountItems', {
sessionId,
...this.options
})
......
......@@ -9,7 +9,7 @@
<view class="item-content">
<view class="top">
<view class="top-left">
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'order_person_default.png'}}"></image>
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'default_avatar.png'}}"></image>
<view class="user-message">
<view class="name">{{item.customerNickName || ""}}</view>
<view class="mobile">{{item.customerPhone || ""}}</view>
......
import ActivityApi from "~/api/activityApi/index"
import MineApi from "~/api/mineApi/index"
const navStyle = 'background-color: transparent;'
import {
setUserInfo
} from '~/utils/cache/storageApi'
Page({
// behaviors: [kfMixin],
/**
......@@ -46,6 +50,20 @@ Page({
getData() {
this.getActivityList(1)
this.getActivityList(2)
this.getStaffInfo()
},
getStaffInfo() {
const userStorage = wx.$storage.get('userInfo')
let para = {
id: userStorage.bussinessId
}
MineApi.getStaffDetailApi(para).then(res => {
if(res.merchantFileResponse){
userStorage.sta_avatarUrl = res.merchantFileResponse.fileUrl
}
setUserInfo(userStorage)
})
},
// 计算文本宽度
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!