Commit 74e2c989 by zhangxw

活动模块

1 parent 419498cf
Showing 32 changed files with 512 additions and 101 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'),
})
} }
} }
...@@ -57,7 +57,8 @@ ...@@ -57,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>
...@@ -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)
}, },
/** /**
......
...@@ -155,8 +155,15 @@ ...@@ -155,8 +155,15 @@
"scene": null "scene": null
}, },
{ {
"name": "分享页", "name": "",
"pathName": "pages/checkProduct/checkProduct", "pathName": "packageActivity/pages/shareTaskDetail/shareTaskDetail",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "packageActivity/pages/shareTaskDetail/shareTaskDetail",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
......
...@@ -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!