Commit 96813cfa by 杨北旺

合并v3.0

2 parents 3a9d87dc 8da0387d
Showing 46 changed files with 1057 additions and 192 deletions
...@@ -22,6 +22,14 @@ class ActivityApi { ...@@ -22,6 +22,14 @@ class ActivityApi {
...data ...data
}) })
} }
// 获取被分享者打开分享内容数据
getTaskShareDetail(data) {
return api.post({
method: 'stoassistant.api.mission.getMissionByIdAndNoSession',
...data
})
}
// 获取活动诊断订单数据 // 获取活动诊断订单数据
getActivityEndOrderList(data) { getActivityEndOrderList(data) {
return api.post({ return api.post({
......
...@@ -22,5 +22,17 @@ module.exports = { ...@@ -22,5 +22,17 @@ module.exports = {
noSignAttr: ['file'] noSignAttr: ['file']
}) })
}, },
},
/** 线索埋点数据上报
* operationType 操作类型(0:分享 1:浏览 2:申请活动)
*/
reportData(data = {}, operationType = 0) {
return api.post({
method: 'scrm.api.busassistant.clue.report',
...data,
operationType,
operationDate: new Date().format('yyyy-MM-dd hh:mm:ss'),
})
} }
} }
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"pages/authentication/registerSuccess/registerSuccess", "pages/authentication/registerSuccess/registerSuccess",
"pages/authentication/registerInfo/registerInfo", "pages/authentication/registerInfo/registerInfo",
"pages/authentication/accountItems/accountItems", "pages/authentication/accountItems/accountItems",
"pages/authentication/customerService/customerService" "pages/authentication/customerService/customerService",
"pages/checkProduct/checkProduct"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
...@@ -56,7 +57,8 @@ ...@@ -56,7 +57,8 @@
"pages/taskDetail/taskDetail", "pages/taskDetail/taskDetail",
"pages/warReport/warReport", "pages/warReport/warReport",
"pages/applyActivity/applyActivity", "pages/applyActivity/applyActivity",
"pages/applySuccess/applySuccess" "pages/applySuccess/applySuccess",
"pages/shareTaskDetail/shareTaskDetail"
] ]
}, },
{ {
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<view class="middle"> <view class="middle">
<view class="name"> <view class="name">
<text class="label">联系人</text> <text class="label">联系人</text>
<text>{{data.name}}</text> <text>{{data.reInstallContactsName}}</text>
</view> </view>
<view class="mobile"> <view class="mobile">
<text class="label">联系方式</text> <text class="label">联系方式</text>
<text>{{data.mobile}}</text> <text>{{data.reInstallContactsPhone}}</text>
<image wx:if="{{data.mobile}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{data.mobile}}"></image> <image wx:if="{{data.reInstallContactsPhone}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{data.reInstallContactsPhone}}"></image>
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
......
import activityApi from "~/api/activityApi/index" import activityApi from "~/api/activityApi/index"
import {
reportData
} from '~/api/api.js'
Page({ Page({
data: { data: {
...@@ -70,6 +73,23 @@ Page({ ...@@ -70,6 +73,23 @@ Page({
product.forEach(val => { product.forEach(val => {
if (val.isSelect) arr.push(val.id) if (val.isSelect) arr.push(val.id)
}) })
console.log(reportData)
const {
USERINFO
} = this.getCommonData()
reportData({
openId: USERINFO.weChatOpenId || '',
unionId: USERINFO.uuid || '',
nickName: USERINFO.weChatNickName || '',
avatar: USERINFO.weChatAvatarUrl || '',
phone: USERINFO.weChatPhone || '',
shopId: USERINFO.merchantId || '',
shopName: USERINFO.merchantName || '',
shareOpenId: USERINFO.weChatOpenId || '',
}, 2).then(res => {
console.log(res)
})
if (!arr.length) return wx.showToast({ if (!arr.length) return wx.showToast({
title: '请选择产品/活动', title: '请选择产品/活动',
icon: "none" icon: "none"
...@@ -81,9 +101,28 @@ Page({ ...@@ -81,9 +101,28 @@ Page({
productCodes: arr productCodes: arr
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
const {
USERINFO
} = this.getCommonData()
reportData({
openId: USERINFO.weChatOpenId || '',
unionId: USERINFO.uuid || '',
nickName: USERINFO.weChatNickName || '',
avatar: USERINFO.weChatAvatarUrl || '',
phone: USERINFO.weChatPhone || '',
merchantId: USERINFO.merchantId || ''
}).then(res => {
console.log(res)
})
wx.$router.go('packageActivity.applySuccess') wx.$router.go('packageActivity.applySuccess')
} }
}) })
},
getCommonData() {
const USERINFO = wx.$storage.get('userInfo')
return {
USERINFO
}
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -32,11 +32,13 @@ Page({ ...@@ -32,11 +32,13 @@ Page({
ActivityApi.getActivityOrderList({ ActivityApi.getActivityOrderList({
activityId activityId
}).then(res => { }).then(res => {
res.orderList && res.orderList.forEach(val => {
val.time = val.payDate ? new Date(val.payDate).format('yyyy-MM-dd hh:mm:ss') : ''
})
console.log(res.orderTotal)
this.setData({ this.setData({
titleData: { allNum: res.orderTotal,
allNum: res.orderTotal, todayNum: res.todayTotal,
todayNum: res.todayTotal
},
list: res.orderList list: res.orderList
}) })
}) })
...@@ -66,9 +68,7 @@ Page({ ...@@ -66,9 +68,7 @@ Page({
// 查看预约安装信息 // 查看预约安装信息
showPopup(e) { showPopup(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
item.name = item.reInstallContactsName if (!item.reInstallContactsName && !item.reInstallContactsName) {
item.mobile = item.reInstallContactsPhone
if (!item.name || item.mobile) {
return wx.showToast({ return wx.showToast({
title: '暂无安装联系人信息', title: '暂无安装联系人信息',
icon: 'none' icon: 'none'
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<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+'order_person_default.png'}}"></image>
<view class="name-mobile"> <view class="name-mobile">
<view class="name" wx:if="{{item.customerNickName}}"> <view class="name">
{{item.customerNickName}} {{item.customerNickName || ""}}
<text class="order-statue {{item.orderStatus == 1 ? '' : 'green'}}">{{item.orderStatus == 1 ? '未下单' : '已下单'}}</text> <text class="order-statue {{item.orderStatus == 1 ? '' : 'green'}}">{{item.orderStatus == 1 ? '未下单' : '已下单'}}</text>
</view> </view>
<view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view> <view class="mobile">{{item.customerPhone || ""}}</view>
</view> </view>
</view> </view>
<view class="top-right"> <view class="top-right">
......
// packageActivity/pages/shareTaskDetail/shareTaskDetail.js
import index_const from "~/pages/tab/index/index_const"
import ActivityApi from '~/api/activityApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
activityTypList: index_const.data.activityTypList,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.hideHomeButton({
success: (res) => {},
})
let missionId = options.missionId
// 获取分享内容
ActivityApi.getTaskShareDetail({missionId: missionId}).then(res => {
res.imgUrlList = []
let typeArr = []
res.platformMerchantMissionMaterialResponseList && res.platformMerchantMissionMaterialResponseList.forEach(val => {
typeArr.push(val.materialType)
if (val.materialType == 1) { // 文案
res.textContent = val.materialContent
}
if (val.materialType == 2 || val.materialType == 3) { // 图片视频
res.imgUrlList.push({
url: val.materialContent,
type: val.materialType == 2 ? 'image' : 'video'
})
}
if (val.materialType == 4) { // 链接
res.linkUrl = val.materialContent
}
})
res.imgUrlList.push({
url: 'http://scrm.test.glsx.com.cn/group1/M00/00/59/wKgD3mGvIc2AHq2FAAtkYkTMHOI111.mp4',
type: 'video'
})
this.setData({
detailInfo: res,
materialTypeArr: typeArr
})
})
},
// 预览图片/视频
previewMedia(e) {
let { imgUrlList } = this.data.detailInfo
let { current } = e.currentTarget.dataset
wx.previewMedia({
sources: imgUrlList,
current: current
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageActivity/pages/shareTaskDetail/shareTaskDetail.wxss */
.share-box{
background: #FFFFFF;
box-shadow: 0 8rpx 24rpx 0 rgba(106,126,204,0.12);
position: relative;
.bg{
width: 100%;
height: 176rpx;
}
.user-box{
position: absolute;
top: 0;
padding: 40rpx;
display: flex;
image{
width: 96rpx;
height: 96rpx;
margin-right: 24rpx;
flex-shrink: 0;
}
.message{
display: flex;
flex-flow: column;
justify-content: space-between;
font-size: 28rpx;
color: #2D2D33;
.name{
font-size: 32rpx;
text{
font-size: 24rpx;
color: #6E6E7A;
margin-left: 16rpx;
}
}
.activity{
text{
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;
}
}
}
}
.content{
padding: 40rpx 48rpx;
.img_video{
margin-top: 32rpx;
display: flex;
flex-wrap: wrap;
.image-box{
flex: 0 0 33.3%;
width: 176rpx;
height: 176rpx;
margin-bottom: 16rpx;
text-align: center;
image{
display: inline-block;
}
}
.video-box{
flex: 0 0 33.3%;
position: relative;
text-align: center;
video{
width: 176rpx;
height: 176rpx;
display: inline-block;
}
.paly-icon{
width: 60rpx;
height: 60rpx;
position: absolute;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
}
}
.link-share{
background: #FFFFFF;
box-shadow: 0 4px 12px 0 rgba(106,126,204,0.12);
border-radius: 12px;
padding: 24rpx 32rpx;
margin: 20rpx;
height: 128rpx;
image{
width: 128rpx;
height: 128rpx;
margin-right: 22rpx;
}
.right{
display: inline-block;
view{
font-size: 32rpx;
color: #282829;
}
.type-text{
font-size: 24rpx;
color: #9299AD;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageActivity/pages/shareTaskDetail/shareTaskDetail.wxml-->
<view wx:if="{{fn.indexOf(materialTypeArr, 4)}}">
<view class="link-share" bind:tap="goShareLink" data-url="{{detailInfo.linkUrl}}">
<image src="{{detailInfo.activityImg ? detailInfo.activityImg : IMGURL+'share_task_default_img.png'}}"></image>
<view class="right">
<view>{{detailInfo.activityName}}</view>
<view class="type-text">{{activityTypList[0]}}活动</view>
</view>
</view>
</view>
<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>
<view class="message">
<view class="name">{{detailInfo.staffName || ""}}<text>邀请你参加</text></view>
<view class="activity">{{detailInfo.merchantName || ""}}{{detailInfo.activityName || ""}}<text>{{activityTypList[0]}}</text></view>
</view>
</view>
<view class="content">
<view class="text-box">
<text>{{detailInfo.textContent}}</text>
</view>
<view class="img_video">
<block wx:for="{{detailInfo.imgUrlList}}" wx:key="index">
<view wx:if="{{item.type == 'image'}}" class="image-box">
<image class="image-box" bind:tap="previewMedia" data-current="{{index}}" src="{{item.url}}"></image>
</view>
<view wx:else class="video-box" bind:tap="previewMedia" data-current="{{index}}">
<image class="paly-icon" webp src="{{IMGURL}}video_paly_icon.png"></image>
<video controls="{{false}}" show-center-play-btn="{{false}}" show-fullscreen-btn="{{false}}" src="{{item.url}}"></video>
</view>
</block>
</view>
</view>
</view>
// packageActivity/pages/taskDetail/taskDetail.js // packageActivity/pages/taskDetail/taskDetail.js
import index_const from "~/pages/tab/index/index_const" import index_const from "~/pages/tab/index/index_const"
import ActivityApi from '~/api/activityApi/index' import ActivityApi from '~/api/activityApi/index'
import { IMG_URL } from "~/utils/constantData"
Page({ Page({
/** /**
...@@ -8,28 +9,10 @@ Page({ ...@@ -8,28 +9,10 @@ Page({
*/ */
data: { data: {
activityTypList: index_const.data.activityTypList, activityTypList: index_const.data.activityTypList,
detailInfo: { detailInfo: {},
title: '今日完成首次分享', isloading: false,
content: '指定分享内容在今日完成首次分享', materialTypeArr: [], // 素材类型
integralAccount: 20, userStorage: {}
activityName: '360全景活动',
merchantName: '广汽丰田鹏峰4S店360全景活动360全景活动',
activityUrl: 'https://baidu.com',
userName: '余皖平123',
activityType: 1,
activityImg: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
taskType: 1,
textContent: '💫广汽丰田鹏峰4S店💫\n#360全景影像系统大酬宾\n任意角度查看 行车无忧\n多角度高清采集,拒绝盲区\n活动时间:9月20日-26日\n联系我获取专属报名通道!',
imgUrlList: [
{url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png', type: 'image'},
{url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png', type: 'image'},
{url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png', type: 'image'},
{url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png', type: 'image'},
// {url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/share_task_icon.png', type: 'image'},
{url: 'http://scrm.test.glsx.com.cn/group1/M00/00/59/wKgD3mGvIc2AHq2FAAtkYkTMHOI111.mp4', type: 'video', poster: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png'}
]
},
isloading: false
}, },
shareTitle: '', shareTitle: '',
shareImage: '', shareImage: '',
...@@ -38,21 +21,51 @@ Page({ ...@@ -38,21 +21,51 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.shareTitle = this.data.detailInfo.activityName let id = null
this.shareImage = this.data.detailInfo.activityImg const userStorage = wx.$storage.get('userInfo')
this.sharePath = `pages/webView/webView?url=${this.data.detailInfo.activityUrl}` this.setData({
userStorage
})
if (Object.keys(options).length && options.missionId) {
id = options.missionId
this.getActiveTaskDetail(id)
}
wx.$router.getData(missionId => {
id = missionId
this.getActiveTaskDetail(id)
})
this.sharePath = `packageActivity/pages/shareTaskDetail/shareTaskDetail?missionId=${id}`
}, },
onRoute(options) { // 获取任务详情
let missionId = options.id getActiveTaskDetail(missionId) {
// 获取任务详情
ActivityApi.getActiveTaskDetail({missionId: missionId}).then(res => { ActivityApi.getActiveTaskDetail({missionId: missionId}).then(res => {
res.imgUrlList = []
let typeArr = []
res.platformMerchantMissionMaterialResponseList && res.platformMerchantMissionMaterialResponseList.forEach(val => {
typeArr.push(val.materialType)
if (val.materialType == 1) { // 文案
res.textContent = val.materialContent
}
if (val.materialType == 2 || val.materialType == 3) { // 图片视频
res.imgUrlList.push({
url: val.materialContent,
type: val.materialType == 2 ? 'image' : 'video'
})
}
if (val.materialType == 4) { // 链接
res.linkUrl = val.materialContent
}
})
this.setData({ this.setData({
detailInfo: res detailInfo: res,
materialTypeArr: typeArr
}) })
this.shareImage = res.imgUrlList[0] ? res.imgUrlList[0].url : `${IMGURL}share_task_default_img.png`
this.shareTitle = res.activityName || '门店助手'
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -60,6 +73,12 @@ Page({ ...@@ -60,6 +73,12 @@ Page({
}, },
// 跳转链接
goShareLink(e) {
let linkUrl = e.currentTarget.dataset
wx.$router.jumpH5(linkUrl)
},
// 预览图片/视频 // 预览图片/视频
previewMedia(e) { previewMedia(e) {
let { imgUrlList } = this.data.detailInfo let { imgUrlList } = this.data.detailInfo
...@@ -77,7 +96,21 @@ Page({ ...@@ -77,7 +96,21 @@ Page({
data: textContent, data: textContent,
success (res) { success (res) {
wx.showToast({ wx.showToast({
title: '内容已复制', title: '文案已复制,请黏贴到微信或企微进行转发',
icon: "none"
})
}
})
},
// 复制链接
copyUrl(e) {
let { linkUrl } = this.data.detailInfo
wx.setClipboardData({
data: linkUrl,
success (res) {
wx.showToast({
title: '活动链接已复制,请打开企微进行转发',
icon: "none" icon: "none"
}) })
} }
......
...@@ -8,6 +8,36 @@ ...@@ -8,6 +8,36 @@
font-size: 32rpx; font-size: 32rpx;
color: #1B233D; color: #1B233D;
} }
.copyWriting{
font-weight: 400;
font-size: 24rpx;
color: #7A8299;
line-height: 40rpx;
margin-bottom: 24rpx;
}
.link-share{
background: #FFFFFF;
box-shadow: 0 4px 12px 0 rgba(106,126,204,0.12);
border-radius: 12px;
padding: 24rpx 32rpx;
height: 128rpx;
image{
width: 128rpx;
height: 128rpx;
margin-right: 22rpx;
}
.right{
display: inline-block;
view{
font-size: 32rpx;
color: #282829;
}
.type-text{
font-size: 24rpx;
color: #9299AD;
}
}
}
.task-box{ .task-box{
width: 100%; width: 100%;
height: 72px; height: 72px;
...@@ -119,7 +149,7 @@ ...@@ -119,7 +149,7 @@
flex: 0 0 33.3%; flex: 0 0 33.3%;
position: relative; position: relative;
text-align: center; text-align: center;
image{ video{
width: 176rpx; width: 176rpx;
height: 176rpx; height: 176rpx;
display: inline-block; display: inline-block;
......
<!--packageActivity/pages/taskDetail/taskDetail.wxml--> <!--packageActivity/pages/taskDetail/taskDetail.wxml-->
<wxs module="fn">
var indexOf = function(e, num) {
return e.indexOf(num) > -1
}
module.exports.indexOf = indexOf
</wxs>
<view class="task-detail-box"> <view class="task-detail-box">
<view class="title">任务</view> <view class="title">任务</view>
<view class="task-box"> <view class="task-box">
...@@ -15,13 +21,23 @@ ...@@ -15,13 +21,23 @@
</view> </view>
</view> </view>
<view class="title">分享内容</view> <view class="title">分享内容</view>
<view wx:if="{{fn.indexOf(materialTypeArr, 4)}}">
<view class="copyWriting" >将链接转发给好友或发送朋友圈可提高活动曝光度</view>
<view class="link-share" bind:tap="goShareLink" data-url="{{detailInfo.linkUrl}}">
<image src="{{detailInfo.activityImage ? detailInfo.activityImage : IMGURL+'share_task_default_img.png'}}"></image>
<view class="right">
<view>{{detailInfo.activityName}}</view>
<view class="type-text">{{activityTypList[0]}}活动</view>
</view>
</view>
</view>
<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.userImgUrl ? detailInfo.userImgUrl : IMGURL + 'order_person_default.png'}}"></image> <image webp src="{{userStorage.weChatAvatarUrl ? userStorage.weChatAvatarUrl : IMGURL + 'order_person_default.png'}}"></image>
<view class="message"> <view class="message">
<view class="name">{{detailInfo.userName}}<text>邀请你参加</text></view> <view class="name">{{userStorage.name || ""}}<text>邀请你参加</text></view>
<view class="activity">{{detailInfo.merchantName}}{{detailInfo.activityName}}<text>{{activityTypList[0]}}</text></view> <view class="activity">{{userStorage.merchantName || ""}}{{detailInfo.activityName || ""}}<text>{{activityTypList[0]}}</text></view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
...@@ -34,18 +50,17 @@ ...@@ -34,18 +50,17 @@
<image class="image-box" bind:tap="previewMedia" data-current="{{index}}" src="{{item.url}}"></image> <image class="image-box" bind:tap="previewMedia" data-current="{{index}}" src="{{item.url}}"></image>
</view> </view>
<view wx:else class="video-box" bind:tap="previewMedia" data-current="{{index}}"> <view wx:else class="video-box" bind:tap="previewMedia" data-current="{{index}}">
<image src="{{item.poster}}"></image>
<image class="paly-icon" webp src="{{IMGURL}}video_paly_icon.png"></image> <image class="paly-icon" webp src="{{IMGURL}}video_paly_icon.png"></image>
<video controls="{{false}}" show-center-play-btn="{{false}}" show-fullscreen-btn="{{false}}" src="{{item.url}}"></video>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<view class="btn" bind:tap="copyText" data-text="{{detailInfo.textContent}}">复制文案</view> <view class="btn" wx:if="{{fn.indexOf(materialTypeArr, 1)}}" bind:tap="copyText">复制文案</view>
<view class="btn">复制链接</view> <view class="btn" wx:if="{{fn.indexOf(materialTypeArr, 4)}}" bind:tap="copyUrl">复制链接</view>
<view class="btn" bind:tap="saveWith"> <view class="btn" bind:tap="saveWith" wx:if="{{fn.indexOf(materialTypeArr, 2) || fn.indexOf(materialTypeArr, 3)}}">
<text>一键保存图片</text> <text>一键保存图片</text>
<van-loading wx:if="{{isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" /> <van-loading wx:if="{{isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" />
</view> </view>
......
...@@ -16,8 +16,9 @@ Page({ ...@@ -16,8 +16,9 @@ Page({
}, },
onRoute(e) { onRoute(e) {
console.log(e)
this.setData({ this.setData({
infoData: e || {} infoData: e
}) })
}, },
......
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
.content{ .content{
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
background: #000;
display: flex; display: flex;
flex-flow: column;
background: #fff;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} .time-box{
.content video{ width: 100%;
width: 100%; height: 80rpx;
height: 100%; line-height: 80rpx;
font-size: 28rpx;
text-align: center;
color: #1B233D;
}
} }
\ No newline at end of file \ No newline at end of file
<!--packageActivity/pages/warReport/warReport.wxml--> <!--packageActivity/pages/warReport/warReport.wxml-->
<view class="content"> <view class="content">
<image src="{{infoData.linkUrl}}" mode="widthFix"></image> <view class="time-box">{{infoData.reportCreatedDate}}</view>
<image src="{{infoData.reportUrl}}" mode="widthFix"></image>
</view> </view>
// pages/checkProduct/checkProduct.js
// const navStyle = "background-color: transparent;";
import { IMG_URL } from "~/utils/constantData.js";
const navStyle = "background-color: #fff";
import { senceData } from "~/pages/tab/discovery/constant/data";
Page({
/**
* 页面的初始数据
*/
data: {
navStyle,
headerHeight: 0,
senceData,
// 模态框
isShow: true,
},
navbarReady(e) {
let {
height
} = e.detail;
this.setData({
headerHeight: height,
});
},
onPageScroll({
scrollTop
}) {
let opacity = scrollTop / 100
let color = `rgba(255,255,255${opacity > 1 ? 1 : opacity})`
this.setData({
navStyle: scrollTop == 0 ? navStyle : `background-color:${color};`
})
},
modelcloseFn(e) {
this.setData({
isShow: e.detail,
});
},
// 分享按钮
sharehandle() {
this.setData({
isShow: true,
});
},
onRouter(options) {
console.log("options: ", options);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// actNum,activeNavIdx
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow(options) {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});
{
"usingComponents": {
"product": "../tab/discovery/components/product/product",
"shareModel":"../tab/discovery/components/shareModel/shareModel"
},
"navigationBarTitleText": "特色产品",
"onReachBottomDistance": 10,
"backgroundColor": "#FC5B32",
"enablePullDownRefresh": true
}
/* pages/checkProduct/checkProduct.wxss */
page{
background-color: #fff;
}
\ No newline at end of file \ No newline at end of file
<!--pages/checkProduct/checkProduct.wxml-->
<!-- <navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">特色产品</navigation-bar>
<view style="height:{{headerHeight}}px">
</view> -->
<product actNum="{{actNum}}" senceData="{{senceData}}" isShare="{{true}}"/>
<!-- 分享弹框 -->
<shareModel actNum="{{actNum}}" isShow="{{isShow}}" bindmodelclose="modelcloseFn" />
// pages/tab/discovery/components/product/product.js
import {imgUrlMixin} from '~/mixins/index' import {imgUrlMixin} from '~/mixins/index'
const videoBaseUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/' const videoBaseUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
Component({ Component({
behaviors: [imgUrlMixin], behaviors: [imgUrlMixin],
/**
* 组件的属性列表
*/
properties: { properties: {
headerHeight: Number, headerHeight: Number,
senceData:Object, senceData:Object,
actNum: Number,
isShare:{
type: Boolean,
value: false
}
}, },
/**
* 组件的初始数据
*/
data: { data: {
videoBaseUrl, videoBaseUrl,
// senceData:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'],
navList:['数字无忧权益卡'], navList:['数字无忧权益卡'],
activeNavIdx: 0, //特色产品 activeNavIdx: 0, //特色产品
tab:['适用场景','营销链路','项目亮点','转化漏斗','合作流程','合作案例'], tab:['适用场景','营销链路','项目亮点','转化漏斗','合作流程','合作案例'],
...@@ -31,16 +29,12 @@ Component({ ...@@ -31,16 +29,12 @@ Component({
}, },
}, },
/** observers: {
* 组件的方法列表 actNum: function () {
*/ let num = this.data.actNum;
methods: {
changeSwiper(e){
console.log(e)
let actNum = e.detail.current
let navList = [] let navList = []
let tab = ['适用场景','营销链路','项目亮点','转化漏斗','合作流程'] let tab = ['适用场景','营销链路','项目亮点','转化漏斗','合作流程']
switch (actNum) { switch (num) {
case 0: case 0:
navList = ["数字无忧权益卡"]; navList = ["数字无忧权益卡"];
tab.push("合作案例"); tab.push("合作案例");
...@@ -65,13 +59,15 @@ Component({ ...@@ -65,13 +59,15 @@ Component({
} }
this.setData({ this.setData({
navList, navList,
actNum,
intoViewId: `to-0`, intoViewId: `to-0`,
activeNavIdx: 0, activeNavIdx: 0,
tab tab
}) })
this.getImgHeight(); this.getImgHeight();
}, },
},
methods: {
changeTab(e){ changeTab(e){
let idx = e.detail let idx = e.detail
this.setData({ this.setData({
...@@ -88,7 +84,6 @@ Component({ ...@@ -88,7 +84,6 @@ Component({
this.setData({ this.setData({
curTabIdx: idx curTabIdx: idx
}) })
console.log(this.data.curTabIdx1)
}, },
getImgHeight(){ getImgHeight(){
let query = wx.createSelectorQuery().in(this) let query = wx.createSelectorQuery().in(this)
...@@ -115,10 +110,13 @@ Component({ ...@@ -115,10 +110,13 @@ Component({
heightArr.push(s); heightArr.push(s);
}); });
this.data.heightArr = heightArr; this.data.heightArr = heightArr;
// console.log(heightArr[heightArr.length-1])
this.data.allHeight = heightArr[heightArr.length - 1]; this.data.allHeight = heightArr[heightArr.length - 1];
}) })
.exec(); .exec();
} },
onShareFn() {
let { actNum, activeNavIdx ,senceData} = this.data;
wx.$router.go("checkProduct", { actNum, activeNavIdx ,senceData});
},
} }
}) })
.scene-wrap {
white-space: nowrap;
height: 180rpx;
margin-bottom: 16rpx;
.scene-img {
width: 100%;
}
}
// 特色产品 // 特色产品
.prod-wrap .big-title { .prod-wrap .big-title {
......
<view class="header">
<swiper bindchange="changeSwiper" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<block wx:for="{{senceData}}" wx:key="index">
<swiper-item>
<image class="scene-img" src="{{IMGURL}}{{item.img}}"></image>
</swiper-item>
</block>
</swiper>
</view>
<view class="prod-wrap"> <view class="prod-wrap">
<text class="big-title">特色产品</text> <text class="big-title">特色产品</text>
<scroll-view enhanced="{{true}}" show-scrollbar="{{false}}" class="nav-wrap" scroll-x="{{true}}"> <scroll-view enhanced="{{true}}" show-scrollbar="{{false}}" class="nav-wrap" scroll-x="{{true}}">
...@@ -29,7 +20,7 @@ ...@@ -29,7 +20,7 @@
</text> </text>
</view> </view>
<view class="share-btn"> <view class="share-btn" wx:if="{{!isShare}}" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png"></image> <image class="icon" src="{{IMGURL}}share.png"></image>
<text>分享</text> <text>分享</text>
</view> </view>
...@@ -37,7 +28,7 @@ ...@@ -37,7 +28,7 @@
</view> </view>
</view> </view>
<view class="project-wrap"> <view class="project-wrap">
<view style="position: sticky;top: {{headerHeight}}px ;z-index: 1;"> <view style="position: sticky;top: {{headerHeight}}px ;z-index: 1;background-color: #F5F7FB;">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab> <tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
</view> </view>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}"> <scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
...@@ -52,7 +43,6 @@ ...@@ -52,7 +43,6 @@
<view class="video-text">{{item.name}}</view> <view class="video-text">{{item.name}}</view>
</view> </view>
</block> </block>
<!-- <view class="video-tips">- 如需开通请咨询客服 -</view> -->
</view> </view>
</view> </view>
</view> </view>
......
// pages/tab/index/components/shareModel/shareModel.js
import { IMG_URL } from "~/utils/constantData.js";
const IMGURL = IMG_URL
import Draw from "~/utils/Draw.js";
import {imgUrlMixin} from '~/mixins/index'
Component({
behaviors: [imgUrlMixin],
/**
* 组件的属性列表
*/
properties: {
actNum: Number, //场景选择
isShow: Boolean,
// //分享方法
// onShareAppMessage:Function,
// onShareTimeline:Function,
},
/**
* 组件的初始数据
*/
data: {
btnList: [
{
src: `${IMGURL}wechat.png`,
name: "微信转发",
},
// {
// src: `${IMGURL}index/moments.png`,
// name: "朋友圈分享",
// },
{
src: `${IMGURL}down.png`,
name: "下载为海报",
},
],
// 4种场景下图片所有的高 (单位 rpx)
imgHeightArr: [
[1110, 1290, 596, 744, 490, 1532],
[2168, 1290, 596, 830, 490, 752],
[1110, 1290, 596, 984, 490],
[678, 1266, 1398, 830, 490, 1666],
],
posterUrl: "", //海报url
// imgList
// imgList:[
// {
// src:`${IMGURL}index/scene${actNum}1.png`,
// },
// ]
},
observers: {
actNum: function (actNum) {
let imgList = [
`${IMGURL}index/scene${actNum + 1}1.png`,
`${IMGURL}index/scene${actNum + 1}2.png`,
`${IMGURL}index/scene${actNum + 1}3.png`,
`${IMGURL}index/scene${actNum + 1}4.png`,
`${IMGURL}index/scene${actNum + 1}5.png`,
];
if (actNum != 2) {
imgList.push(`${IMGURL}index/scene${actNum + 1}6.png`);
}
this.setData({
imgList,
});
},
},
/**
* 组件的方法列表
*/
methods: {
// 分享按钮
handleClick(e) {
let { index } = e.currentTarget.dataset;
switch (index) {
case 0:
this.wechatFn();
break;
case 1:
this.download();
break;
}
},
// 微信转发
wechatFn() {
// this.data.onShareAppMessage()
this.modelClose();
},
// 下载海报
async download() {
let { actNum, imgHeightArr } = this.data;
//所有的长度
let imgAllHeight = imgHeightArr[actNum].reduce((total, current) => {
return total + current;
});
// 缺少视频的长度(前4张)+二维码的长度 (单位rpx)
let erCodeHeight =
imgHeightArr[actNum].slice(0, 4).reduce((total, current) => {
return total + current;
}) +
98 * 2;
// console.log("imgAllHeight: ", imgAllHeight);
let drawFun = new Draw({
width: 750,
height: imgAllHeight,
});
let imgList = [
{
x: 0,
y: 0,
width: 750,
height: imgAllHeight,
url: `${IMGURL}scene/longpic${
actNum + 1
}.png`,
},
{
x: 245*2,
y: erCodeHeight-11,
width: 120*2,
height: 120*2,
url: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/discovery_prod1.png`, //二维码
},
];
let posterUrl = await drawFun.begin({
imageList: imgList,
});
this.setData({
posterUrl: posterUrl.path,
});
console.log('posterUrl.path',posterUrl.path,wx.pro)
if(this.data.posterUrl){
wx.downloadFile({
url: this.data.posterUrl, //仅为示例,并非真实的资源
success (res) {
console.log('res: ', res);
}
})
}
this.modelClose();
},
//模态框关闭
modelClose() {
this.triggerEvent("modelclose", false);
},
// 图片加载事件
onloadFn(event) {
// console.log('event.detail',event.detail)
this.setData({
imgHeight: (event.detail.height * 0.2).toFixed(0),
});
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/shareModel/shareModel.wxss */
.share-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1;
.img-wrap {
position: absolute;
top: 20%;
left: 50%;
transform: translateX(-50%);
width: 225px;
height: 311px;
// background-color: red;
overflow: auto;
.img {
width: 100%;
// height: auto;
height: 60%;
background-color: #fff;
}
}
.btns {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 154px;
background: #ffffff;
border-radius: 8px 8px 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 16px;
}
.img {
display: block;
margin: 0 auto 8px;
width: 40px;
height: 40px;
}
.name {
font-size: 12px;
color: #323436;
text-align: center;
line-height: 32rpx;
}
.btn-wechat{
width: auto;
margin: 0;
padding: 0;
background-color: #fff;
&::after{
border:none;
}
}
}
.btom {
margin: 18px auto 0;
width: 343px;
height: 44px;
line-height: 44px;
border: 1px solid #eeeeee;
border-radius: 4px;
text-align: center;
}
}
}
<!-- pages/tab/index/components/shareModel/shareModel.wxml -->
<view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<image class="img" style="height:{{imgHeight}}px" src="{{IMGURL}}scene/longpic{{actNum+1}}.png" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this">
<image class="img" src="{{item}}"/>
</block> -->
</view>
<button></button>
<view class="btns">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 0}}">
<button open-type="share" class="btn-wechat">
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</button>
</block>
<block wx:else>
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</block>
</view>
</view>
<view class="btom" bindtap="modelClose">取消</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,7 @@ Page({ ...@@ -9,6 +9,7 @@ Page({
data: { data: {
senceData, senceData,
headerHeight: 0, headerHeight: 0,
actNum: 0,
navStyle, navStyle,
// 预估弹框 // 预估弹框
visible: false, visible: false,
...@@ -22,8 +23,7 @@ Page({ ...@@ -22,8 +23,7 @@ Page({
flow: 10000, flow: 10000,
}, },
isFirst: true, isFirst: true,
// tabList: pageData.tabList, changeSale: 0,
changeSale: 0, //每次改变的销量
}, },
navbarReady(e) { navbarReady(e) {
let { let {
...@@ -43,6 +43,12 @@ Page({ ...@@ -43,6 +43,12 @@ Page({
}) })
}, },
changeSwiper(e){
this.setData({
actNum:e.detail.current,
});
},
// 跳转咨询页面 // 跳转咨询页面
goConsult() { goConsult() {
wx.pro.openCustomerServiceChat({ wx.pro.openCustomerServiceChat({
......
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
.container{ .container{
position: relative; position: relative;
.scene-wrap {
white-space: nowrap;
height: 180rpx;
margin-bottom: 16rpx;
.scene-img {
width: 100%;
}
}
.bg-img{ .bg-img{
position: absolute; position: absolute;
top: 0; top: 0;
......
...@@ -5,7 +5,16 @@ ...@@ -5,7 +5,16 @@
</navigation-bar> </navigation-bar>
<view style="padding-top: {{headerHeight}}px;"> <view style="padding-top: {{headerHeight}}px;">
<product senceData="{{senceData}}" headerHeight="{{headerHeight}}"></product> <view class="header">
<swiper bindchange="changeSwiper" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<block wx:for="{{senceData}}" wx:key="index">
<swiper-item>
<image class="scene-img" src="{{IMGURL}}{{item.img}}"></image>
</swiper-item>
</block>
</swiper>
</view>
<product senceData="{{senceData}}" actNum="{{actNum}}" headerHeight="{{headerHeight}}"></product>
</view> </view>
</view> </view>
......
...@@ -13,11 +13,6 @@ Component({ ...@@ -13,11 +13,6 @@ Component({
activeList: { activeList: {
type: Array, type: Array,
observer(newVal) { observer(newVal) {
if (newVal) {
this.setData({
activeList: newVal
})
}
} }
} }
}, },
...@@ -78,12 +73,12 @@ Component({ ...@@ -78,12 +73,12 @@ Component({
this.setData({ this.setData({
[itemVal]: val [itemVal]: val
}) })
console.log(itemVal)
}) })
} else { } else {
val.isCollapse = !flag val.isCollapse = !flag
} }
} else { } else {
console.log(ind)
val.isCollapse = true val.isCollapse = true
} }
}) })
...@@ -121,7 +116,7 @@ Component({ ...@@ -121,7 +116,7 @@ Component({
data: this.filterJumpUrl(id), data: this.filterJumpUrl(id),
success (res) { success (res) {
wx.showToast({ wx.showToast({
title: '活动链接已复制', title: '复制成功',
icon: "none" icon: "none"
}) })
} }
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
</view> </view>
<view class="item-box" wx:if="{{imageLoaded}}"> <view class="item-box" wx:if="{{imageLoaded}}">
<!-- 活动top信息 --> <!-- 活动top信息 -->
<activity-top data="{{item}}"> <activity-top data="{{item}}" widthStyle="flex: 0 0 62%;">
<image webp src="{{IMGURL}}hot-icon.png?v={{img_version}}"></image> <image webp src="{{IMGURL}}hot-icon.png?v={{img_version}}"></image>
<view class="hot">火爆进行中</view> <view class="hot">火爆进行中</view>
</activity-top> </activity-top>
<!-- 活动操作按钮 --> <!-- 活动操作按钮 -->
<view class="active-btn"> <view class="active-btn">
<view class="btn" bind:tap="jump" data-id="{{item.id}}">活动战报</view> <view class="btn" bind:tap="jump" data-item="{{item}}">活动战报</view>
<view class="btn" bind:tap="copyActivityUrl" data-id="{{item.id}}">分享活动</view> <view class="btn" bind:tap="copyActivityUrl" data-id="{{item.id}}">分享活动</view>
<view class="btn primary" bind:tap="goToDetail" data-id="{{item.id}}">查看详情</view> <view class="btn primary" bind:tap="goToDetail" data-id="{{item.id}}">查看详情</view>
</view> </view>
......
...@@ -45,10 +45,9 @@ Component({ ...@@ -45,10 +45,9 @@ Component({
}, },
// 任务详情 // 任务详情
jump(e) { jump(e) {
let { status, item } = e.currentTarget.dataset let { status, item, activityimg } = e.currentTarget.dataset
console.log(item)
if (status == 2) return // 已完成 if (status == 2) return // 已完成
wx.$router.go('packageActivity.taskDetail', item) wx.$router.go('packageActivity.taskDetail', {...item, activityImg: activityimg})
}, },
// 切换日期查看任务 // 切换日期查看任务
changeDate(e) { changeDate(e) {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<wxs src="../index.wxs" module="fn"></wxs> <wxs src="../index.wxs" module="fn"></wxs>
<block wx:if="{{!isCollapse}}"> <block wx:if="{{!isCollapse}}">
<view class="title">任务日历<text> · {{data.missionList.length}}</text></view> <view class="title">任务日历<text> · {{data.missionList.length}}</text></view>
<view class="calender-box {{data.newtaskCalenderList.length > 1 ? 'p-b-54' : ''}}"> <view wx:if="{{data.newtaskCalenderList.length}}" class="calender-box {{data.newtaskCalenderList.length > 1 ? 'p-b-54' : ''}}">
<swiper class="swiper" current="{{data.calenderActiveIndex}}" bindchange="changeTaskCalender" data-index="{{index}}"> <swiper class="swiper" current="{{data.calenderActiveIndex}}" bindchange="changeTaskCalender" data-index="{{index}}">
<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">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<view class="task-btn"> <view class="task-btn">
<view class="btn {{val.completeStatus == 1 ? 'primary' : ''}}" bind:tap="jump" data-status="{{val.completeStatus}}" data-item="{{val}}">{{val.completeStatus == 1 ? '去完成' : '已完成'}}</view> <view class="btn {{val.completeStatus == 1 ? 'primary' : ''}}" bind:tap="jump" data-status="{{val.completeStatus}}" data-item="{{val}}" data-activityimg="{{data.activityImg}}">{{val.completeStatus == 1 ? '去完成' : '已完成'}}</view>
<view class="btn_title" wx:if="{{val.completeStatus == 2}}">奖励已发放</view> <view class="btn_title" wx:if="{{val.completeStatus == 2}}">奖励已发放</view>
</view> </view>
</view> </view>
......
// pages/tab/index/components/activityDiagnosis/activityDiagnosis.js // pages/tab/index/components/activityDiagnosis/activityDiagnosis.js
import {imgUrlMixin} from '~/mixins/index' import {imgUrlMixin} from '~/mixins/index'
import ActivityApi from "~/api/activityApi/index" import ActivityApi from "~/api/activityApi/index"
import {
domain
} from '~/utils/request/http'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -41,11 +44,16 @@ Component({ ...@@ -41,11 +44,16 @@ Component({
if (key == ind) { if (key == ind) {
if (flag && !val.orderList) { if (flag && !val.orderList) {
val.isloading = true val.isloading = true
ActivityApi.getActivityEndInstallOrderList({activityId: val.id}).then(res => { ActivityApi.getActivityEndInstallOrderList({activityId: 495}).then(res => {
res.orderList && res.orderList.forEach(it => {
it.time = new Date(it.payDate).format('yyyy-MM-dd hh:mm:ss')
})
val.isloading = false val.isloading = false
val.isCollapse = false val.isCollapse = false
val.orderList = res.orderList val.orderList = res.orderList
val.orderTotal = res.orderTotal val.orderTotal = res.orderTotal
val.reInstallContactsName = res.reInstallContactsName
val.reInstallContactsPhone = res.reInstallContactsPhone
let itemVal = 'activityList['+ind+']' let itemVal = 'activityList['+ind+']'
this.setData({ this.setData({
[itemVal]: val [itemVal]: val
...@@ -63,6 +71,14 @@ Component({ ...@@ -63,6 +71,14 @@ Component({
}) })
}, },
toUnicode (chineseStr = '') {
let unicodeStr = ''
for (let i = 0, iLength = chineseStr.length; i < iLength; i++) {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
}
return unicodeStr
},
filterJumpUrl(id) { filterJumpUrl(id) {
const userStorage = wx.$storage.get('userInfo') const userStorage = wx.$storage.get('userInfo')
return `${domain}/scrm-wx-merchant-activity/#/?id=${id}&merchantId=${userStorage.merchantId}&shareStaffUuid=${userStorage.uuid}&shareStaffName=${this.toUnicode(userStorage.name)}&shareStaffType=2&sharedTime=${Date.now()}` return `${domain}/scrm-wx-merchant-activity/#/?id=${id}&merchantId=${userStorage.merchantId}&shareStaffUuid=${userStorage.uuid}&shareStaffName=${this.toUnicode(userStorage.name)}&shareStaffType=2&sharedTime=${Date.now()}`
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
</view> </view>
<view class="item-box" wx:if="{{imageLoaded}}"> <view class="item-box" wx:if="{{imageLoaded}}">
<!-- 活动top信息 --> <!-- 活动top信息 -->
<activity-top data="{{item}}"> <activity-top data="{{item}}" widthStyle="flex: 0 0 72%;">
<image webp src="{{IMGURL}}activity_end_icon.png?v={{img_version}}"></image> <image webp src="{{IMGURL}}activity_end_icon.png?v={{img_version}}"></image>
<view class="end">已结束</view> <view class="end">已结束</view>
</activity-top> </activity-top>
<!-- 活动操作按钮 --> <!-- 活动操作按钮 -->
<view class="active-btn"> <view class="active-btn">
<view class="btn" bind:tap="jump" data-id="{{item.id}}">活动战报</view> <view class="btn" bind:tap="jump" data-item="{{item}}">活动战报</view>
<view class="btn primary" bind:tap="goToDetail" data-id="{{item.id}}">查看详情</view> <view class="btn primary" bind:tap="goToDetail" data-id="{{item.id}}">查看详情</view>
</view> </view>
<!-- 活动概览 --> <!-- 活动概览 -->
......
...@@ -8,6 +8,9 @@ Component({ ...@@ -8,6 +8,9 @@ Component({
data: { data: {
type: Object, type: Object,
value: {} value: {}
},
widthStyle: {
type: String
} }
}, },
...@@ -15,7 +18,7 @@ Component({ ...@@ -15,7 +18,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
activityTypList: index_const.data.activityTypList activityTypList: index_const.data.activityTypList,
}, },
/** /**
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
border-radius: 16rpx;
overflow: hidden;
top: 0; top: 0;
left: 0; left: 0;
} }
...@@ -36,7 +38,6 @@ ...@@ -36,7 +38,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
.left{ .left{
flex: 0 0 60%;
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 36rpx;
color: #1B233D; color: #1B233D;
...@@ -47,7 +48,6 @@ ...@@ -47,7 +48,6 @@
word-break: break-all; word-break: break-all;
} }
.right{ .right{
flex: 0 0 40%;
display: flex; display: flex;
flex-flow: 1; flex-flow: 1;
font-size: 28rpx; font-size: 28rpx;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
<view class="active-title"> <view class="active-title">
<view class="name"> <view class="name">
<view class="left">{{data.activityName}}</view> <view class="left" style="{{widthStyle}}">{{data.activityName}}</view>
<view class="right"> <view class="right">
<slot></slot> <slot></slot>
</view> </view>
......
...@@ -10,7 +10,6 @@ Component({ ...@@ -10,7 +10,6 @@ Component({
type: Object, type: Object,
value: {}, value: {},
observer(newVal) { observer(newVal) {
} }
}, },
showPopup: { showPopup: {
...@@ -53,7 +52,12 @@ Component({ ...@@ -53,7 +52,12 @@ Component({
// 查看预约安装信息 // 查看预约安装信息
showPopup(e) { showPopup(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
if (!item.reInstallContactsName && !item.reInstallContactsPhone) if (!item.reInstallContactsName && !item.reInstallContactsPhone) {
return wx.showToast({
title: '暂无安装联系人信息',
icon: 'none'
})
}
this.setData({ this.setData({
installItem: item, installItem: item,
showPopup: true showPopup: true
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
<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+'order_person_default.png'}}"></image>
<view class="user-message"> <view class="user-message">
<view class="name" wx:if="{{item.customerNickName}}">{{item.customerNickName}}</view> <view class="name">{{item.customerNickName || ""}}</view>
<view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view> <view class="mobile">{{item.customerPhone || ""}}</view>
</view> </view>
</view> </view>
<view class="btn-img"> <view class="btn-img">
<image wx:if="{{item.mobile}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.mobile}}"></image> <image wx:if="{{item.customerPhone}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.customerPhone}}"></image>
<image wx:if="{{item.wechartNo}}" webp src="{{IMGURL}}activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.wechartNo}}"></image> <image wx:if="{{item.wechartNo}}" webp src="{{IMGURL}}activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.wechartNo}}"></image>
</view> </view>
</view> </view>
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
.sort-box:last-child{ .sort-box:last-child{
position: absolute; position: absolute;
left: -46rpx; left: -46rpx;
top: 55%; top: 50%;
} }
.sort{ .sort{
font-size: 48rpx; font-size: 48rpx;
......
...@@ -51,12 +51,12 @@ Page({ ...@@ -51,12 +51,12 @@ Page({
this.getData() this.getData()
}, },
getData() { getData(onPullDown) {
this.getActivityList(1) this.getActivityList(1, onPullDown)
this.getActivityList(2) this.getActivityList(2, onPullDown)
}, },
getActivityList(num) { getActivityList(num, onPullDown) {
let {activePageNum, pageSize, pageNum, activeList, activityEndList, tabIndex} = this.data let {activePageNum, pageSize, pageNum, activeList, activityEndList, tabIndex} = this.data
ActivityApi.getActivityList({ ActivityApi.getActivityList({
type: num, type: num,
...@@ -70,7 +70,7 @@ Page({ ...@@ -70,7 +70,7 @@ Page({
val.tabIndex = num - 1 val.tabIndex = num - 1
if (num == 1 && activePageNum == 1 && index == 0) { // 活动中默认展开第一条 if (num == 1 && activePageNum == 1 && index == 0) { // 活动中默认展开第一条
val.isloading = true val.isloading = true
ActivityApi.getActiveTaskList({activityId: 1}).then(res => { ActivityApi.getActiveTaskList({activityId: val.id}).then(res => {
val.isloading = false val.isloading = false
val.missionList = res val.missionList = res
val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7) val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
...@@ -99,9 +99,14 @@ Page({ ...@@ -99,9 +99,14 @@ Page({
if (num == 2 && pageNum == 1 && index == 0) { // 活动诊断展开第一条 if (num == 2 && pageNum == 1 && index == 0) { // 活动诊断展开第一条
ActivityApi.getActivityEndInstallOrderList({activityId: val.id}).then(res => { ActivityApi.getActivityEndInstallOrderList({activityId: val.id}).then(res => {
val.isCollapse = false val.isCollapse = false
res.orderList && res.orderList.forEach(it => {
it.time = new Date(it.payDate).format('yyyy-MM-dd hh:mm:ss')
})
val.orderList = res.orderList val.orderList = res.orderList
val.orderTotal = res.orderTotal val.orderTotal = res.orderTotal
let itemVal = 'activityList['+ind+']' val.reInstallContactsName = res.reInstallContactsName
val.reInstallContactsPhone = res.reInstallContactsPhone
let itemVal = 'activityEndList['+index+']'
this.setData({ this.setData({
[itemVal]: val [itemVal]: val
}) })
...@@ -110,13 +115,12 @@ Page({ ...@@ -110,13 +115,12 @@ Page({
}) })
if (num == 1) { if (num == 1) {
this.setData({ this.setData({
activeList: [...activeList, ...res.data], activeList: onPullDown ? res.data : [...activeList, ...res.data],
activeTotal: res.count activeTotal: res.count
}) })
if ([...activeList, ...res.data]) activeList.forEach
} else { } else {
this.setData({ this.setData({
activityEndList: [...activityEndList, ...res.data], activityEndList: onPullDown ? res.data : [...activityEndList, ...res.data],
total: res.count total: res.count
}) })
} }
...@@ -157,7 +161,7 @@ Page({ ...@@ -157,7 +161,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.getData() this.getData(true)
}, },
/** /**
......
...@@ -7,36 +7,41 @@ class Draw { ...@@ -7,36 +7,41 @@ class Draw {
[_pixelRatio_] = null; [_pixelRatio_] = null;
[_canvasObject_] = null; [_canvasObject_] = null;
[_canvas_] = null [_canvas_] = null
constructor(canvasObject) { constructor(canvasObject, isCompInst) {
wx.getSystemInfo().then(({ pixelRatio }) => { this[_canvasObject_] = canvasObject
// console.log(pixelRatio) this[_pixelRatio_] = canvasObject.pixelRatio || 2
this[_canvasObject_] = canvasObject const height = this.toRpx(canvasObject.height),
this[_pixelRatio_] = canvasObject.pixelRatio || pixelRatio || 2 width = this.toRpx(canvasObject.width),
const height = this.toRpx(canvasObject.height), canvas = wx.createOffscreenCanvas({
width = this.toRpx(canvasObject.width), type: '2d',
canvas = wx.createOffscreenCanvas({
type: '2d',
width,
height
}),
ctx = canvas.getContext('2d')
this[_canvas_] = canvas
this[_ctx_] = ctx
this[_ctx_].clearRect(0, 0, width, height)
this.drawFill({
x: 0,
y: 0,
width, width,
height, height,
color: canvasObject.backgroundColor || 'rgb(255, 255, 255)' compInst:isCompInst
}) }),
this[_ctx_].save() ctx = canvas.getContext('2d')
this[_canvas_] = canvas
this[_ctx_] = ctx
this[_ctx_].clearRect(0, 0, width, height)
this.drawFill({
x: 0,
y: 0,
width,
height,
color: canvasObject.backgroundColor || 'rgb(255, 255, 255)'
}) })
this[_ctx_].save()
} }
drawImages(imageParams, callback) { async drawImages(imageParams, callback) {
this[_ctx_].beginPath() this[_ctx_].beginPath()
this[_ctx_].save() this[_ctx_].save()
let { borderRadius, height, width, url, x, y } = imageParams let {
borderRadius,
height,
width,
url,
x,
y
} = imageParams
height = this.toRpx(height) height = this.toRpx(height)
width = this.toRpx(width) width = this.toRpx(width)
x = this.toRpx(x) x = this.toRpx(x)
...@@ -52,13 +57,14 @@ class Draw { ...@@ -52,13 +57,14 @@ class Draw {
this[_ctx_].clip() this[_ctx_].clip()
} }
let image = this[_canvas_].createImage() let image = this[_canvas_].createImage()
new Promise(resolve => { image.src = `${url}?v=${Date.now()}`
image.onload = resolve return new Promise(resolve => {
image.src = `${url}?v=${Date.now()}` image.onload = () => {
}).then(() => { this[_ctx_].drawImage(image, x, y, width, height)
this[_ctx_].drawImage(image, x, y, width, height) this[_ctx_].restore()
this[_ctx_].restore() if (callback) callback()
if (callback) callback() resolve(imageParams)
}
}) })
} }
toRpx(val) { toRpx(val) {
...@@ -69,7 +75,13 @@ class Draw { ...@@ -69,7 +75,13 @@ class Draw {
if (fontSize) this[_ctx_].font = `${fontSize}px${font}` if (fontSize) this[_ctx_].font = `${fontSize}px${font}`
return this[_ctx_].measureText(text).width return this[_ctx_].measureText(text).width
} }
drawFill({ x, y, width, height, color }) { drawFill({
x,
y,
width,
height,
color
}) {
height = this.toRpx(height) height = this.toRpx(height)
width = this.toRpx(width) width = this.toRpx(width)
x = this.toRpx(x) x = this.toRpx(x)
...@@ -82,8 +94,25 @@ class Draw { ...@@ -82,8 +94,25 @@ class Draw {
this[_ctx_].save() this[_ctx_].save()
} }
drawText(textParams) { drawText(textParams) {
let { textDecoration, textBaseline, lineHeight, fontWeight, textAlign, textWidth, maxWidth, fontSize, lastFont, opacity, lineNum, width, color, text, x, y } = textParams, let {
font = this[_ctx_].font.split('px')[1] textDecoration,
textBaseline,
lineHeight,
fontWeight,
textAlign,
textWidth,
maxWidth,
fontSize,
lastFont,
opacity,
lineNum,
width,
color,
text,
x,
y
} = textParams,
font = this[_ctx_].font.split('px')[1]
textAlign = textAlign || 'left' textAlign = textAlign || 'left'
textBaseline = textBaseline || 'normal' textBaseline = textBaseline || 'normal'
opacity = typeof opacity === 'number' ? opacity : 1 opacity = typeof opacity === 'number' ? opacity : 1
...@@ -140,6 +169,7 @@ class Draw { ...@@ -140,6 +169,7 @@ class Draw {
height: boxHeight, height: boxHeight,
color: textParams.background color: textParams.background
}) })
} }
const drawOneLineText = () => { const drawOneLineText = () => {
let textArr = text.toString().split(''), let textArr = text.toString().split(''),
...@@ -218,15 +248,20 @@ class Draw { ...@@ -218,15 +248,20 @@ class Draw {
} else { } else {
drawOneLineText() drawOneLineText()
} }
} else { } else drawOneLineText()
drawOneLineText()
}
this[_ctx_].stroke() this[_ctx_].stroke()
} }
drawLine(lineParams, callback) { drawLine(lineParams, callback) {
this[_ctx_].beginPath() this[_ctx_].beginPath()
let { opacity, startX, startY, width, color, endX, endY } = lineParams let {
opacity,
startX,
startY,
width,
color,
endX,
endY
} = lineParams
startX = this.toRpx(startX) startX = this.toRpx(startX)
startY = this.toRpx(startY) startY = this.toRpx(startY)
width = this.toRpx(width) width = this.toRpx(width)
...@@ -243,7 +278,12 @@ class Draw { ...@@ -243,7 +278,12 @@ class Draw {
if (callback) callback() if (callback) callback()
} }
setLineY = params => { setLineY = params => {
let { textDecoration, textBaseline, fontSize, y } = params let {
textDecoration,
textBaseline,
fontSize,
y
} = params
let type = { let type = {
underline: { underline: {
top: y + fontSize, top: y + fontSize,
...@@ -266,8 +306,11 @@ class Draw { ...@@ -266,8 +306,11 @@ class Draw {
} }
return type[textDecoration][textBaseline] return type[textDecoration][textBaseline]
} }
setLineX({
setLineX({ textAlign, text, x }) { textAlign,
text,
x
}) {
let textWidth = this.getTextWidth(text) let textWidth = this.getTextWidth(text)
let type = { let type = {
left: x, left: x,
...@@ -276,8 +319,13 @@ class Draw { ...@@ -276,8 +319,13 @@ class Draw {
} }
return type[textAlign] return type[textAlign]
} }
drawRadiusRect({
drawRadiusRect({ borderRadius, height, width, x, y }, callBack) { borderRadius,
height,
width,
x,
y
}, callBack) {
let radius = typeof borderRadius === 'string' ? ((Number(borderRadius.split('%')[0]) / 100) * width) / 2 : borderRadius / 2 let radius = typeof borderRadius === 'string' ? ((Number(borderRadius.split('%')[0]) / 100) * width) / 2 : borderRadius / 2
radius = radius || 0 radius = radius || 0
this[_ctx_].beginPath() this[_ctx_].beginPath()
...@@ -288,7 +336,12 @@ class Draw { ...@@ -288,7 +336,12 @@ class Draw {
} }
if (callBack) callBack() if (callBack) callBack()
} }
getFontWidth({ textAlign, fontSize, text, x }) { getFontWidth({
textAlign,
fontSize,
text,
x
}) {
let type = { let type = {
left: x, left: x,
center: x - (fontSize * text.length) / 2, center: x - (fontSize * text.length) / 2,
...@@ -298,7 +351,12 @@ class Draw { ...@@ -298,7 +351,12 @@ class Draw {
} }
drawDecoration(params) { drawDecoration(params) {
let { newText, opacity, y, x } = params let {
newText,
opacity,
y,
x
} = params
let lineX = x let lineX = x
let lineY = y let lineY = y
lineX = this.setLineX(params) lineX = this.setLineX(params)
...@@ -329,10 +387,33 @@ class Draw { ...@@ -329,10 +387,33 @@ class Draw {
}) })
} }
base64src(url).then(img => { base64src(url).then(img => {
console.log('img', img)
createLocalImg(img, callBack) createLocalImg(img, callBack)
}) })
} }
async begin(data = {}) {
return new Promise(async (resolve, reject) => {
const drawFun = () => {
data.textList && data.textList.length && data.textList.map(e => {
this.drawText(e)
})
data.lineList && data.lineList.length && data.lineList.map(e => {
this.drawLine(e)
})
wx.nextTick(() => {
this.toDataURL(res => resolve(res))
})
}
if (data.imageList && data.imageList.length) {
await this.drawImages(data.imageList[0])
if (data.imageList.length > 1)
for (let index = 1; index < data.imageList.length; index++) {
await this.drawImages(data.imageList[index])
if (index == data.imageList.length - 1) drawFun()
}
else drawFun()
}
})
}
} }
const checkTextDecoration = textDecoration => { const checkTextDecoration = textDecoration => {
return textDecoration && (textDecoration === 'underline' || textDecoration === 'overline' || textDecoration === 'line-through') return textDecoration && (textDecoration === 'underline' || textDecoration === 'overline' || textDecoration === 'line-through')
...@@ -355,4 +436,4 @@ const createLocalImg = (url, callBack) => { ...@@ -355,4 +436,4 @@ const createLocalImg = (url, callBack) => {
} }
}) })
} }
export default Draw export default Draw
\ No newline at end of file \ No newline at end of file
...@@ -38,6 +38,7 @@ class Share { ...@@ -38,6 +38,7 @@ class Share {
if (sharePath) path = `/${sharePath}` if (sharePath) path = `/${sharePath}`
if (shareQuery) path += `?${shareQuery}` if (shareQuery) path += `?${shareQuery}`
if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}` if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}`
console.log(path)
return { return {
path, path,
title: shareTitle, title: shareTitle,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!