Commit f33a0691 by 张晓玮

Merge branch 'zhangxw_dev_3.0' into 'v3.0'

Zhangxw dev 3.0

See merge request !101
2 parents 6f3b82c1 1e56a612
...@@ -17,24 +17,17 @@ Component({ ...@@ -17,24 +17,17 @@ Component({
navHeight: thisPage.data.navHeight navHeight: thisPage.data.navHeight
}) })
if (val.showSharePopup) { if (val.showSharePopup) {
wx.$util.getViewInfo('.user-box', res => { val.boxImageHeight = 66
this.setData({
boxImageHeight: res.height,
})
val.boxImageHeight = res.height
// 计算弹窗图片区域最大高度 // 计算弹窗图片区域最大高度
wx.$util.getViewInfo('.layout', res => { wx.$util.getViewInfo('.layout', res => {
this.setData({ this.setData({
postersBoxHeight: res.height * 0.7, 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.postersBoxHeight = res.height * 0.7,
val.postersImageHeight = res.height * 0.7 - this.data.boxImageHeight - 20 val.postersImageHeight = (res.height / res.width ) * 247
this.init(val) this.init(val)
// this.init(val)
}) })
}, this)
} }
} }
...@@ -57,7 +50,8 @@ Component({ ...@@ -57,7 +50,8 @@ Component({
wx.$api.showLoading() wx.$api.showLoading()
const drawfun = new Draw({ const drawfun = new Draw({
width: 280, width: 280,
height: 560 + n.boxImageHeight height: n.postersImageHeight + 80,
borderRadius: 8
}, this), }, this),
{ {
userInfo userInfo
...@@ -70,27 +64,22 @@ Component({ ...@@ -70,27 +64,22 @@ Component({
height: n.boxImageHeight, height: n.boxImageHeight,
url: `${this.data.IMGURL}taskDetail_bg.png` url: `${this.data.IMGURL}taskDetail_bg.png`
}, },
// { {
// x: 12, x: 12,
// y: 12, y: 12,
// width: 20, width: 20,
// height: 20, height: 20,
// url: `${userInfo.weChatAvatarUrl ? userInfo.weChatAvatarUrl : this.data.IMGURL}order_person_default.png` 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, x: 16,
y: n.boxImageHeight + 10, y: n.boxImageHeight + 10,
width: 247, width: 247,
height: 500, height: n.postersImageHeight,
url: n.posterImg url: n.posterImg
}, },
// {
// x: 204,
// y: n.postersImageHeight / 2 + boxImageHeight + 20,
// width: 60,
// height: 60,
// url: n.imagePath
// }
], ],
textList: [{ textList: [{
x: 44, x: 44,
...@@ -130,22 +119,6 @@ Component({ ...@@ -130,22 +119,6 @@ Component({
padding: [5, 5] 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() wx.hideLoading()
...@@ -179,7 +152,6 @@ Component({ ...@@ -179,7 +152,6 @@ Component({
} }
) )
}, },
noScroll() {},
authFail(e) { authFail(e) {
this.setData({ this.setData({
showAuth: true showAuth: true
......
...@@ -35,85 +35,15 @@ ...@@ -35,85 +35,15 @@
} }
.share-popup-content{ .share-popup-content{
position: relative; // position: relative;
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10); box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
overflow-y: auto; overflow: auto;
.bg{ .bg{
width: 100%; width: 100%;
height: 132rpx; 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{ .btn-box{
display: flex; display: flex;
......
<!--components/sharePopup/sharePopup.wxml--> <!--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-popup-bg" />
<view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));"> <view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="close-box"> <view class="close-box">
...@@ -7,34 +7,8 @@ ...@@ -7,34 +7,8 @@
<image webp src="{{IMGURL}}popup_close_btn.png"></image> <image webp src="{{IMGURL}}popup_close_btn.png"></image>
</view> </view>
</view> </view>
<view class="share-popup-content" style="height: {{postersBoxHeight}}px;"> <view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<!-- 用户活动信息 --> <image style="height: {{postersImageHeight + 80}}px;" mode="widthFix" src="{{poster}}"></image>
<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> </view>
<view class="btn-box"> <view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view> <view class="btn" bind:tap="saveImage">保存至相册</view>
...@@ -45,4 +19,3 @@ ...@@ -45,4 +19,3 @@
<canvas style="width:355px;height:370px; margin:0 auto;" canvas-id="mycanvas" /> <canvas style="width:355px;height:370px; margin:0 auto;" canvas-id="mycanvas" />
</view> </view>
</view> </view>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize> -->
...@@ -39,8 +39,7 @@ Page({ ...@@ -39,8 +39,7 @@ Page({
ActivityApi.getNotOpenProductsList({merchantId: USERINFO.merchantId, sceneCode: code}).then(res => { // 默认选中第一个业务场景 获取可用产品/活动 ActivityApi.getNotOpenProductsList({merchantId: USERINFO.merchantId, sceneCode: code}).then(res => { // 默认选中第一个业务场景 获取可用产品/活动
res.forEach(item => { res.forEach(item => {
item.isSelect = false item.isSelect = false
console.log(this.data.currentSceneCode) if (item.sceneCode == this.data.currentSceneCode) arr.push(item)
if (item.status == 0 && item.sceneCode == this.data.currentSceneCode) arr.push(item)
}) })
this.setData({ this.setData({
product: arr product: arr
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="list-item" style="background-image: {{statusBackgroundColor[item.orderStatus]}};"> <view class="list-item" style="background-image: {{statusBackgroundColor[item.orderStatus]}};">
<view class="top"> <view class="top">
<view class="top-left"> <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-mobile">
<view class="name"> <view class="name">
{{item.customerNickName || ""}} {{item.customerNickName || ""}}
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="share-box"> <view class="share-box">
<image class="bg" webp src="{{IMGURL}}taskDetail_bg.png"></image> <image class="bg" webp src="{{IMGURL}}taskDetail_bg.png"></image>
<view class="user-box"> <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="message">
<view class="name">{{detailInfo.staffName || ""}}<text>邀请你参加</text></view> <view class="name">{{detailInfo.staffName || ""}}<text>邀请你参加</text></view>
<view class="activity">{{detailInfo.merchantName || ""}}{{detailInfo.activityName || ""}}<text>{{activityTypList[0]}}</text></view> <view class="activity">{{detailInfo.merchantName || ""}}{{detailInfo.activityName || ""}}<text>{{activityTypList[0]}}</text></view>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<view class="share-box" wx:if="{{detailInfo.missonType == 2}}"> <view class="share-box" wx:if="{{detailInfo.missonType == 2}}">
<image class="bg" style="height: {{boxImageHeight}}px;" webp src="{{IMGURL}}taskDetail_bg.png"></image> <image class="bg" style="height: {{boxImageHeight}}px;" webp src="{{IMGURL}}taskDetail_bg.png"></image>
<view class="user-box"> <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="message">
<view class="name">{{userStorage.weChatNickName || userStorage.name || ""}}<text>邀请你参加</text></view> <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> <view class="activity"><text>{{userStorage.merchantName || ""}}{{detailInfo.activityName || ""}}</text><text class="activity-type-tag">{{activityTypList[0]}}</text></view>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}"> <view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}">
<view class="top"> <view class="top">
<view class="top-left"> <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-mobile">
<view class="name"> <view class="name">
{{item.customerNickName || ""}} {{item.customerNickName || ""}}
......
...@@ -166,7 +166,7 @@ Page({ ...@@ -166,7 +166,7 @@ Page({
loginUserInfoList, loginUserInfoList,
sessionId sessionId
}) { }) {
if (loginUserInfoList.length > 1) wx.$router.go('/pages/authentication/accountItems/accountItems', { if (loginUserInfoList.length > 1) wx.$router.reLaunch('/pages/authentication/accountItems/accountItems', {
sessionId, sessionId,
...this.options ...this.options
}) })
......
...@@ -95,11 +95,23 @@ Component({ ...@@ -95,11 +95,23 @@ Component({
v.forEach(k => { v.forEach(k => {
k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, "0") + "月" + new Date(k.activityTime).getDate().toString().padStart(2, "0") + "日" k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, "0") + "月" + new Date(k.activityTime).getDate().toString().padStart(2, "0") + "日"
k.ind = ind k.ind = ind
let completeStatusNum = 0
k.platformMerchantMissionResponseList.forEach(val => {
if (val.completeStatus == 2) completeStatusNum++
})
if (d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) k.status = 2 if (d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) k.status = 2
if (nowDate == k.time) { if (nowDate == k.time) {
val.calenderActiveIndex = index val.calenderActiveIndex = index
this.setData({activeDateIndex : ind}) this.setData({activeDateIndex : ind})
} }
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) {
k.status = 1
} else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) {
k.status = 2
} else {
k.status = 3
}
ind++ ind++
}) })
}) })
...@@ -176,8 +188,6 @@ Component({ ...@@ -176,8 +188,6 @@ Component({
}, },
}) })
}) })
}, },
// 活动详情 // 活动详情
goToDetail(e) { goToDetail(e) {
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<block wx:for="{{data.newtaskCalenderList}}" wx:for-item="val" wx:for-index="k" wx:key="k"> <block wx:for="{{data.newtaskCalenderList}}" wx:for-item="val" wx:for-index="k" wx:key="k">
<swiper-item class='swiper_item'> <swiper-item class='swiper_item'>
<block wx:for="{{val}}" wx:for-item="v" wx:for-index="j" wx:key="j"> <block wx:for="{{val}}" wx:for-item="v" wx:for-index="j" wx:key="j">
<view class="time-box {{v.status == 2 ? 'completed' : ''}} {{activeDateIndex == v.ind ? 'active' : ''}}" bind:tap="changeDate" data-dateindex="{{v.ind}}"> <view class="time-box {{v.status == 1 ? 'completed' : v.status == 2 ? 'past' : ''}} {{activeDateIndex == v.ind ? 'active' : ''}}" bind:tap="changeDate" data-dateindex="{{v.ind}}">
<image webp src="{{IMGURL}}{{v.status == 2 ? 'task_completed.png' : 'calender_integral_icon.png'}}"></image> <image webp src="{{IMGURL}}{{v.status == 1 ? 'task_completed.png' : v.status == 2 ? 'calender_past_integral_icon.png' : 'calender_integral_icon.png'}}"></image>
<view class="task-time">{{v.status == 2 ? '已完成' : v.time}}</view> <view class="task-time">{{v.time}}</view>
</view> </view>
</block> </block>
</swiper-item> </swiper-item>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="item-content"> <view class="item-content">
<view class="top"> <view class="top">
<view class="top-left"> <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="user-message">
<view class="name">{{item.customerNickName || ""}}</view> <view class="name">{{item.customerNickName || ""}}</view>
<view class="mobile">{{item.customerPhone || ""}}</view> <view class="mobile">{{item.customerPhone || ""}}</view>
......
import ActivityApi from "~/api/activityApi/index" import ActivityApi from "~/api/activityApi/index"
import MineApi from "~/api/mineApi/index"
const navStyle = 'background-color: transparent;' const navStyle = 'background-color: transparent;'
import {
setUserInfo
} from '~/utils/cache/storageApi'
Page({ Page({
// behaviors: [kfMixin], // behaviors: [kfMixin],
/** /**
...@@ -46,6 +50,20 @@ Page({ ...@@ -46,6 +50,20 @@ Page({
getData() { getData() {
this.getActivityList(1) this.getActivityList(1)
this.getActivityList(2) 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)
})
}, },
// 计算文本宽度 // 计算文本宽度
...@@ -85,11 +103,22 @@ Page({ ...@@ -85,11 +103,22 @@ Page({
v.forEach(k => { v.forEach(k => {
k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, "0") + "月" + new Date(k.activityTime).getDate().toString().padStart(2, "0") + "日" k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, "0") + "月" + new Date(k.activityTime).getDate().toString().padStart(2, "0") + "日"
k.ind = ind k.ind = ind
if (d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) k.status = 2 let completeStatusNum = 0
k.platformMerchantMissionResponseList.forEach(val => {
if (val.completeStatus == 2) completeStatusNum++
})
if (nowDate == k.time) { if (nowDate == k.time) {
val.calenderActiveIndex = index val.calenderActiveIndex = index
this.setData({activeDateIndex: ind}) this.setData({activeDateIndex: ind})
} }
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) {
k.status = 1
} else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g,'/')} 23:59:59`).getTime()) {
k.status = 2
} else {
k.status = 3
}
ind++ ind++
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!