Commit eada3f87 by zhangxw

活动模块

1 parent b879b51f
import api from '~/utils/request/request'
const path = 'scrm.api.assistant.service.activity'
module.exports = {
// 获取活动列表数据
getActivityList(data) {
return api.post({
method: `${path}.list`,
...data
})
},
// 获取活动中任务内容
getActiveTaskList(data) {
return api.post({
method: `${path}.detail.new`,
...data
})
},
// 获取活动诊断订单数据
getActivityEndOrderList(data) {
return api.post({
method: `${path}.detail.old`,
...data
})
}
}
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request'
const path = 'scrm.api.stoassistant'
class ActivityApi {
// 获取活动列表数据
getActivityList(data) {
return api.post({
method: `scrm.api.assistant.activity.page`,
...data
})
}
// 获取活动中任务内容
getActiveTaskList(data) {
return api.post({
method: `stoassistant.api.mission.findStaffMissionList`,
...data
})
}
// 获取单个任务详情内容
getActiveTaskDetail(data) {
return api.post({
method: 'stoassistant.api.mission.getMissionById',
...data
})
}
// 获取活动诊断订单数据
getActivityEndOrderList(data) {
return api.post({
method: `${path}.service.activity.detail.old`,
...data
})
}
// 申请活动
applyActivity(data) {
return api.post({
method: `${path}.service.activity.apply`,
...data
})
}
// 获取我的订单数据
getActivityOrderList(data) {
return api.post({
method: `${path}.user.activity.order.list`,
...data
})
}
// 获取活动诊断待预约安装订单数据
getActivityEndInstallOrderList(data) {
return api.post({
method: `${path}.user.activity.to.be.installed.list`,
...data
})
}
// 获取我的访客数据
getActivityVisitorList(data) {
return api.post({
method: `${path}.user.activity.visitor.list`,
...data
})
}
}
export default ActivityApi
\ No newline at end of file \ No newline at end of file
import ActivityApi from './ActivityApi.js'
export default new ActivityApi()
\ No newline at end of file \ No newline at end of file
...@@ -11,6 +11,9 @@ import getUpdateManager from './utils/lib/wxUpdateManager' ...@@ -11,6 +11,9 @@ import getUpdateManager from './utils/lib/wxUpdateManager'
// 埋点 // 埋点
// import './utils/track/Track' // import './utils/track/Track'
//全局分享
import './utils/share'
import eventbus from './utils/evenbus' import eventbus from './utils/evenbus'
// 微信小程序异步使用 使用方法wx.pro+对应api即可 promisify 这个是配置单独某个api // 微信小程序异步使用 使用方法wx.pro+对应api即可 promisify 这个是配置单独某个api
......
...@@ -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.userName}}</text> <text>{{data.name}}</text>
</view> </view>
<view class="mobile"> <view class="mobile">
<text class="label">联系方式</text> <text class="label">联系方式</text>
<text>{{data.userMobile}}</text> <text>{{data.mobile}}</text>
<image wx:if="{{data.userMobile}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{data.userMobile}}"></image> <image wx:if="{{data.mobile}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{data.mobile}}"></image>
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
......
import activityApi from "~/api/activityApi/index"
Page({ Page({
data: { data: {
...@@ -23,27 +23,27 @@ Page({ ...@@ -23,27 +23,27 @@ Page({
currentIndex: 0, currentIndex: 0,
product: [ product: [
{ {
id: 0, id: 1,
name: '360全景导航', name: '360全景导航',
isSelect: false isSelect: false
}, },
{ {
id: 0, id: 2,
name: '360全景导航', name: '360全景导航',
isSelect: false isSelect: false
}, },
{ {
id: 0, id: 3,
name: '360全景导航', name: '360全景导航',
isSelect: false isSelect: false
}, },
{ {
id: 0, id: 4,
name: '360全景导航', name: '360全景导航',
isSelect: false isSelect: false
}, },
{ {
id: 0, id: 5,
name: '360全景导航', name: '360全景导航',
isSelect: false isSelect: false
} }
...@@ -64,8 +64,26 @@ Page({ ...@@ -64,8 +64,26 @@ Page({
}, },
// 申请开通 // 申请开通
applyOpened() { applyOpened() {
// 接口 // 获取已选的产品code
let { product, currentIndex } = this.data
let arr = []
product.forEach(val => {
if (val.isSelect) arr.push(val.id)
})
if (!arr.length) return wx.showToast({
title: '请选择产品/活动',
icon: "none"
})
activityApi.applyActivity({
serviceMerchantId: 1,
merchantId: 2,
sceneCode: currentIndex,
productCodes: arr
}).then(res => {
if (res.code == 200) {
wx.$router.go('packageActivity.applySuccess') wx.$router.go('packageActivity.applySuccess')
} }
})
}
}) })
\ No newline at end of file \ No newline at end of file
// packageActivity/pages/order/order.js // packageActivity/pages/order/order.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'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list: [ list: [],
{ allNum: 0,
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0', todayNum: 0,
userName: '李四', orderStatusImgList: {1: '待付款', 7: '待安装', 8: '已安装'},
userMobile: '15678947894', statusColor: {1: '#DF9800', 7: '#4466F0', 8: '#7A8299'},
userWechartNo: 'abcabc123', statusBackgroundColor: {
orderStatus: 1, 1: 'linear-gradient(90deg, #FCF4F0 0%, #FCFDFF 77%)',
activityName: 'AR导航', 7: 'linear-gradient(90deg, #F2F6FF 9%, #FCFDFF 100%)',
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png', 8: 'linear-gradient(90deg, #F2F6FF 9%, #FCFDFF 100%)'
activityType: 1,
viewAccount: 10,
time: "2022-10-13 12:00:00",
price: "50.45"
}, },
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947894',
orderStatus: 2,
activityName: '全景',
activityType: 1,
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
viewAccount: 10,
time: "2022-10-13 10:00:00",
price: "0.45"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947784',
userWechartNo: 'abcabc123',
orderStatus: 2,
activityName: '众筹',
activityType: 1,
viewAccount: 10,
time: "2022-10-13 12:33:00",
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
price: "15.45"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
orderStatus: 1,
activityName: '众筹',
activityType: 1,
viewAccount: 10,
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
time: "2022-10-13 12:00:00",
price: "50.45"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947894',
orderStatus: 2,
activityName: '全景',
activityType: 1,
viewAccount: 10,
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
time: "2022-10-13 10:00:00",
price: "50.45"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947784',
userWechartNo: 'abcabc123',
orderStatus: 2,
activityName: '众筹',
activityType: 1,
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
viewAccount: 10,
time: "2022-10-13 12:33:00",
price: "50.45"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947894',
orderStatus: 3,
activityName: '全景',
activityType: 1,
viewAccount: 10,
time: "2022-10-13 10:00:00",
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
price: "50.45"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947784',
userWechartNo: 'abcabc123',
orderStatus: 3,
activityName: '众筹',
activityImgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
activityType: 1,
viewAccount: 10,
time: "2022-10-13 12:33:00"
},
],
allVisitorNum: 861,
todayVisitorNum: 15,
orderStatusImgList: ['已完成', '待付款', '待安装'],
statusColor: ['#7A8299', '#DF9800', '#4466F0'],
statusBackgroundColor: [
'linear-gradient(90deg, #F2F4FA 9%, #FCFDFF 100%)',
'linear-gradient(90deg, #FCF4F0 0%, #FCFDFF 77%)',
'linear-gradient(90deg, #F2F6FF 9%, #FCFDFF 100%)'
],
installItem: {}, installItem: {},
activityTypList: index_const.data.activityTypList activityTypList: index_const.data.activityTypList
}, },
...@@ -125,6 +27,21 @@ Page({ ...@@ -125,6 +27,21 @@ Page({
onLoad(options) { onLoad(options) {
}, },
onRoute(options) {
let activityId = options.activityId
ActivityApi.getActivityOrderList({
activityId
}).then(res => {
this.setData({
titleData: {
allNum: res.orderTotal,
todayNum: res.todayTotal
},
list: res.orderList
})
})
},
// 打电话 // 打电话
callPhone(e) { callPhone(e) {
let { mobile } = e.currentTarget.dataset let { mobile } = e.currentTarget.dataset
...@@ -149,6 +66,14 @@ Page({ ...@@ -149,6 +66,14 @@ Page({
// 查看预约安装信息 // 查看预约安装信息
showPopup(e) { showPopup(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
item.name = item.reInstallContactsName
item.mobile = item.reInstallContactsPhone
if (!item.name || item.mobile) {
return wx.showToast({
title: '暂无安装联系人信息',
icon: 'none'
})
}
this.setData({ this.setData({
installItem: item, installItem: item,
showPopup: true showPopup: true
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
.list-item{ .list-item{
position: relative; position: relative;
margin-bottom: 24rpx; margin-bottom: 24rpx;
background-image: linear-gradient(90deg, #FCF4F0 0%, #FCFDFF 77%);
border-radius: 24rpx; border-radius: 24rpx;
padding: 24rpx 40rpx; padding: 24rpx 40rpx;
box-shadow: 0 10rpx 20rpx 0 rgba(129,146,214,0.24), inset 0 -2rpx 6rpx 0 rgba(255,255,255,0.40); box-shadow: 0 10rpx 20rpx 0 rgba(129,146,214,0.24), inset 0 -2rpx 6rpx 0 rgba(255,255,255,0.40);
......
...@@ -5,41 +5,41 @@ ...@@ -5,41 +5,41 @@
</view> </view>
<view class="content"> <view class="content">
<view class="title"> <view class="title">
<view>总订单<text> · {{allVisitorNum}}</text></view> <view>总订单<text> · {{allNum}}</text></view>
<view>今日订单<text> · {{todayVisitorNum}}</text></view> <view>今日订单<text> · {{todayNum}}</text></view>
</view> </view>
<view class="list-box"> <view class="list-box">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<view class="list-item" style="background-image: {{statusBackgroundColor[item.orderStatus - 1]}};"> <view class="list-item" style="background-image: {{statusBackgroundColor[item.orderStatus]}};">
<view class="top"> <view class="top">
<view class="top-left"> <view class="top-left">
<image webp src="{{item.imgUrl ? item.imgUrl : 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"> <view class="name" wx:if="{{item.customerNickName}}">
{{item.userName}} {{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">{{item.userMobile}}</view> <view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view>
</view> </view>
</view> </view>
<view class="top-right"> <view class="top-right">
<image wx:if="{{item.userMobile}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.userMobile}}"></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.userWechartNo}}" webp src="{{IMGURL}}activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></image> <image wx:if="{{item.userWechartNo}}" webp src="{{IMGURL}}activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></image>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<image webp src="{{item.activityImgUrl}}"></image> <image webp src="{{item.activityImg}}"></image>
<view class="activity"> <view class="activity">
<view class="name">{{item.activityName}} <text>¥{{item.price}}</text></view> <view class="name">{{item.activityName}} <text>¥{{item.orderPrice}}</text></view>
<view class="activity-type">{{item.activityName+'-'+activityTypList[item.activityType - 1]}}</view> <view class="activity-type">{{item.activityName+'-'+activityTypList[0]}}</view>
<view class="time">下单时间<text>{{item.time}}</text></view> <view class="time">下单时间<text>{{item.time}}</text></view>
</view> </view>
</view> </view>
<view class="order-status"> <view class="order-status">
<image webp src="{{IMGURL}}order_status_{{item.orderStatus}}.png"></image> <image webp src="{{IMGURL}}order_status_{{item.orderStatus}}.png"></image>
<text style="color: {{statusColor[item.orderStatus - 1]}};">{{orderStatusImgList[item.orderStatus - 1]}}</text> <text style="color: {{statusColor[item.orderStatus]}};">{{orderStatusImgList[item.orderStatus]}}</text>
</view> </view>
<view wx:if="{{item.orderStatus == 3}}" class="btn-box"><view class="btn" bind:tap="showPopup" data-item="{{item}}">预约安装</view></view> <view wx:if="{{item.orderStatus == 7}}" class="btn-box"><view class="btn" bind:tap="showPopup" data-item="{{item}}">预约安装</view></view>
</view> </view>
</block> </block>
</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'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
taskTypeImgList: index_const.data.taskTypeImgList,
activityTypList: index_const.data.activityTypList, activityTypList: index_const.data.activityTypList,
detailInfo: { detailInfo: {
title: '今日完成首次分享', title: '今日完成首次分享',
...@@ -14,8 +14,10 @@ Page({ ...@@ -14,8 +14,10 @@ Page({
integralAccount: 20, integralAccount: 20,
activityName: '360全景活动', activityName: '360全景活动',
merchantName: '广汽丰田鹏峰4S店360全景活动360全景活动', merchantName: '广汽丰田鹏峰4S店360全景活动360全景活动',
activityUrl: 'https://baidu.com',
userName: '余皖平123', userName: '余皖平123',
activityType: 1, activityType: 1,
activityImg: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/order_person_default.png',
taskType: 1, taskType: 1,
textContent: '💫广汽丰田鹏峰4S店💫\n#360全景影像系统大酬宾\n任意角度查看 行车无忧\n多角度高清采集,拒绝盲区\n活动时间:9月20日-26日\n联系我获取专属报名通道!', textContent: '💫广汽丰田鹏峰4S店💫\n#360全景影像系统大酬宾\n任意角度查看 行车无忧\n多角度高清采集,拒绝盲区\n活动时间:9月20日-26日\n联系我获取专属报名通道!',
imgUrlList: [ imgUrlList: [
...@@ -29,12 +31,26 @@ Page({ ...@@ -29,12 +31,26 @@ Page({
}, },
isloading: false isloading: false
}, },
shareTitle: '',
shareImage: '',
sharePath: '',
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.shareTitle = this.data.detailInfo.activityName
this.shareImage = this.data.detailInfo.activityImg
this.sharePath = `pages/webView/webView?url=${this.data.detailInfo.activityUrl}`
},
onRoute(options) {
let missionId = options.id
// 获取任务详情
ActivityApi.getActiveTaskDetail({missionId: missionId}).then(res => {
this.setData({
detailInfo: res
})
})
}, },
/** /**
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
<view class="title">任务</view> <view class="title">任务</view>
<view class="task-box"> <view class="task-box">
<view class="left"> <view class="left">
<image webp src="{{IMGURL}}{{taskTypeImgList[detailInfo.taskType - 1]}}.png"></image> <image webp src="{{IMGURL}}task_icon_{{detailInfo.missonType}}.png"></image>
<view class="text-message"> <view class="text-message">
<view class="name">{{detailInfo.title}}</view> <view class="name">{{detailInfo.missionName}}</view>
<view>{{detailInfo.content}}</view> <view>{{detailInfo.missonDesc}}</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<image webp src="{{IMGURL}}integral_icon.png"></image> <image webp src="{{IMGURL}}integral_icon.png"></image>
<view>+{{detailInfo.integralAccount}}积分</view> <view>+{{detailInfo.gainScore}}积分</view>
</view> </view>
</view> </view>
<view class="title">分享内容</view> <view class="title">分享内容</view>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<image webp src="{{detailInfo.userImgUrl ? detailInfo.userImgUrl : IMGURL + 'order_person_default.png'}}"></image> <image webp src="{{detailInfo.userImgUrl ? detailInfo.userImgUrl : IMGURL + 'order_person_default.png'}}"></image>
<view class="message"> <view class="message">
<view class="name">{{detailInfo.userName}}<text>邀请你参加</text></view> <view class="name">{{detailInfo.userName}}<text>邀请你参加</text></view>
<view class="activity">{{detailInfo.merchantName}}{{detailInfo.activityName}}<text>{{activityTypList[detailInfo.activityType - 1]}}</text></view> <view class="activity">{{detailInfo.merchantName}}{{detailInfo.activityName}}<text>{{activityTypList[0]}}</text></view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<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>
<view class="btn primary">分享</view> <!-- <view class="btn primary" bind:tap="share">分享</view> -->
<!-- <button class="btn primary" open-type="share">分享</button> --> <button class="btn primary" open-type="share">分享</button>
</view> </view>
</view> </view>
// packageActivity/pages/visitor/visitor.js // packageActivity/pages/visitor/visitor.js
import index_const from "../../../pages/tab/index/index_const" import ActivityApi from '~/api/activityApi/index'
import index_const from "~/pages/tab/index/index_const"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list: [ list: [],
{ allNum: 0,
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0', todayNum: 0,
userName: '李四',
userMobile: '15678947894',
userWechartNo: 'abcabc123',
orderStatus: 1,
activityName: 'AR导航',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 12:00:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947894',
orderStatus: 2,
activityName: '全景',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 10:00:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947784',
userWechartNo: 'abcabc123',
orderStatus: 2,
activityName: '众筹',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 12:33:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
orderStatus: 1,
activityName: '众筹',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 12:00:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947894',
orderStatus: 2,
activityName: '全景',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 10:00:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947784',
userWechartNo: 'abcabc123',
orderStatus: 2,
activityName: '众筹',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 12:33:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947894',
orderStatus: 2,
activityName: '全景',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 10:00:00"
},
{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/equity/scrm_mini_no_vip.png?v=1.0.0',
userName: '李四',
userMobile: '15678947784',
userWechartNo: 'abcabc123',
orderStatus: 2,
activityName: '众筹',
activityType: 1,
viewAccount: 10,
viewTime: "2022-10-13 12:33:00"
},
],
allVisitorNum: 861,
todayVisitorNum: 15,
activityTypList: index_const.data.activityTypList activityTypList: index_const.data.activityTypList
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) {}, onLoad(options) {
},
onRoute(options) { onRoute(options) {
console.log(options) let activityId = options.id
ActivityApi.getActivityVisitorList({
activityId
}).then(res => {
this.setData({
allNum: res.visitorTotal,
todayNum: res.todayTotal,
list: res.visitorList
})
})
}, },
// 打电话 // 打电话
......
...@@ -5,36 +5,36 @@ ...@@ -5,36 +5,36 @@
</view> </view>
<view class="content"> <view class="content">
<view class="title"> <view class="title">
<view>总访客<text> · {{allVisitorNum}}</text></view> <view>总访客<text> · {{allNum}}</text></view>
<view>今日访客<text> · {{todayVisitorNum}}</text></view> <view>今日访客<text> · {{todayNum}}</text></view>
</view> </view>
<view class="list-box"> <view class="list-box">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<view class="list-item {{item.orderStatus == 1 ? '' : 'orderde'}}"> <view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}">
<view class="top"> <view class="top">
<view class="top-left"> <view class="top-left">
<image webp src="{{item.imgUrl}}"></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"> <view class="name">
{{item.userName}} {{item.customerNickName}}
<text class="order-statue {{item.orderStatus == 1 ? '' : 'green'}}">{{item.orderStatus == 1 ? '未下单' : '已下单'}}</text> <text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text>
</view> </view>
<view class="mobile">{{item.userMobile}}</view> <view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view>
</view> </view>
</view> </view>
<view class="top-right"> <view class="top-right">
<image wx:if="{{item.userMobile}}" webp src="{{IMGURL}}activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.userMobile}}"></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.userWechartNo}}" webp src="{{IMGURL}}activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></image> <image wx:if="{{item.userWechartNo}}" webp src="{{IMGURL}}activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></image>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="activity"> <view class="activity">
{{item.activityName}} {{item.activityName}}
<text>{{activityTypList[item.activityType - 1]}}</text> <text>{{activityTypList[0]}}</text>
</view> </view>
<view class="footprint"> <view class="footprint">
<text>浏览 {{item.viewAccount}} 次</text> <text>浏览 {{item.visitCount}} 次</text>
<text>{{item.viewTime}} 访问过</text> <text>{{item.lastVisitTime}} 访问过</text>
</view> </view>
</view> </view>
</view> </view>
......
// pages/tab/index/components/activeBox/activeBox.js // pages/tab/index/components/activeBox/activeBox.js
import {imgUrlMixin} from '~/mixins/index' import {imgUrlMixin} from '~/mixins/index'
import { activityApi } from "~/api/api" import ActivityApi from "~/api/activityApi/index"
import {
domain
} from '~/utils/request/http'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -9,7 +12,6 @@ Component({ ...@@ -9,7 +12,6 @@ Component({
properties: { properties: {
activeList: { activeList: {
type: Array, type: Array,
value: [],
observer(newVal) { observer(newVal) {
if (newVal) { if (newVal) {
this.setData({ this.setData({
...@@ -31,7 +33,7 @@ Component({ ...@@ -31,7 +33,7 @@ Component({
'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 16rpx 0 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 16rpx 0 0;',
'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBFEFF 100%);' 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBFEFF 100%);'
], ],
isloading: false activeList: []
}, },
/** /**
...@@ -47,40 +49,23 @@ Component({ ...@@ -47,40 +49,23 @@ Component({
// 展开收起 // 展开收起
collapseClick(e) { collapseClick(e) {
let { key, flag } = e.currentTarget.dataset let { key, flag } = e.currentTarget.dataset
this.properties.activeList.forEach((val, ind) => { let { activeList } = this.data
// if (key == ind) { activeList.forEach((val, idx) => {
// if (flag && !val.missionList.length) { if (key == idx) {
// this.setData({ if (flag && !val.missionList) {
// isloading: true val.isloading = true
// }) ActivityApi.getActiveTaskList({activityId: val.id}).then(res => {
// activityApi.getActiveTaskList({id: val.id}).then(res => { val.isloading = false
// this.setData({ val.missionList = res
// isloading: false
// })
// val.isCollapse = !flag
// val.missionList = res.missionList
// })
// }
// } else {
// val.isCollapse = !flag
// }
if (flag) {
this.setData({
isloading: true
})
}
setTimeout(() => {
if (key == ind) {
val.isCollapse = !flag
val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7) val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
let d = new Date() let d = new Date()
let nowDate = (d.getMonth() + 1).toString().padStart(2, "0") + "月" + d.getDate().toString().padStart(2, "0") + "日" let nowDate = (d.getMonth() + 1).toString().padStart(2, "0") + "月" + d.getDate().toString().padStart(2, "0") + "日"
let ind = 0 let ind = 0
val.newtaskCalenderList.forEach((v, index) => { val.newtaskCalenderList.forEach((v, index) => {
v.forEach(k => { v.forEach(k => {
k.time = (new Date(k.activeTime).getMonth() + 1).toString().padStart(2, "0") + "月" + new Date(k.activeTime).getDate().toString().padStart(2, "0") + "日" k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, "0") + "月" + new Date(k.activityTime).getDate().toString().padStart(2, "0") + "日"
k.ind = ind k.ind = ind
if (d > k.activeTime) k.status = 2 if (d.getTime() > new Date(`${k.activityTime} 23:59:59`).getTime()) k.status = 2
if (nowDate == k.time) { if (nowDate == k.time) {
val.calenderActiveIndex = index val.calenderActiveIndex = index
this.setData({activeDateIndex: ind}) this.setData({activeDateIndex: ind})
...@@ -88,17 +73,22 @@ Component({ ...@@ -88,17 +73,22 @@ Component({
ind++ ind++
}) })
}) })
} val.isCollapse = false
let itemVal = 'activeList['+idx+']'
this.setData({ this.setData({
isloading: false [itemVal]: val
}) })
this.setData({
activeList: this.properties.activeList
}) })
}, 1000) } else {
val.isCollapse = !flag
}
} else {
console.log(ind)
val.isCollapse = true
}
}) })
this.setData({ this.setData({
activeList: this.properties.activeList activeList
}) })
}, },
...@@ -111,11 +101,24 @@ Component({ ...@@ -111,11 +101,24 @@ Component({
return _arr return _arr
}, },
toUnicode (chineseStr = '') {
let unicodeStr = ''
for (let i = 0, iLength = chineseStr.length; i < iLength; i++) {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
}
return unicodeStr
},
filterJumpUrl(id) {
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()}`
},
// 分享活动(复制链接) // 分享活动(复制链接)
copyActivityUrl(e) { copyActivityUrl(e) {
let { url } = e.currentTarget.dataset let { id } = e.currentTarget.dataset
wx.setClipboardData({ wx.setClipboardData({
data: url.toString(), data: this.filterJumpUrl(id),
success (res) { success (res) {
wx.showToast({ wx.showToast({
title: '活动链接已复制', title: '活动链接已复制',
...@@ -126,14 +129,14 @@ Component({ ...@@ -126,14 +129,14 @@ Component({
}, },
// 活动详情 // 活动详情
goToDetail(e) { goToDetail(e) {
let { item } = e.currentTarget.dataset let { id } = e.currentTarget.dataset
let h5Url = `https://baidu.com?id=${item.name}` let h5Url = this.filterJumpUrl(id)
console.log(h5Url)
wx.$router.jumpH5(h5Url) wx.$router.jumpH5(h5Url)
}, },
// 活动战报 // 活动战报
jump(e) { jump(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
item.linkUrl = 'https://scrm.test.glsx.com.cn/group1/M00/02/69/wKgD3mNJFJ-AJMXHAAIXrDs4dcE605.jpg'
wx.$router.go('packageActivity.warReport', item) wx.$router.go('packageActivity.warReport', item)
} }
} }
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
</activity-top> </activity-top>
<!-- 活动操作按钮 --> <!-- 活动操作按钮 -->
<view class="active-btn"> <view class="active-btn">
<view class="btn" bind:tap="jump" data-item="{{item}}">活动战报</view> <view class="btn" bind:tap="jump" data-id="{{item.id}}">活动战报</view>
<view class="btn" bind:tap="copyActivityUrl" data-url="{{item.activityUrl}}">分享活动</view> <view class="btn" bind:tap="copyActivityUrl" data-id="{{item.id}}">分享活动</view>
<view class="btn primary" bind:tap="goToDetail" data-item="{{item}}">查看详情</view> <view class="btn primary" bind:tap="goToDetail" data-id="{{item.id}}">查看详情</view>
</view> </view>
<!-- 活动概览 --> <!-- 活动概览 -->
<activity-overview data="{{item}}" activityOverviewList="{{activityOverviewList}}" backStyle="{{backStyle}}" textType="{{1}}"></activity-overview> <activity-overview data="{{item}}" activityOverviewList="{{activityOverviewList}}" backStyle="{{backStyle}}" textType="{{1}}"></activity-overview>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 展开/收起 --> <!-- 展开/收起 -->
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}"> <view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}">
<text>{{item.isCollapse ? '展开' : '收起'}}</text><text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text> <text>{{item.isCollapse ? '展开' : '收起'}}</text><text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text>
<van-loading wx:if="{{isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" /> <van-loading wx:if="{{item.isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" />
</view> </view>
</view> </view>
</view> </view>
......
// pages/tab/index/components/activityCalender/activityCalender.js // pages/tab/index/components/activityCalender/activityCalender.js
import {imgUrlMixin} from '~/mixins/index' import {imgUrlMixin} from '~/mixins/index'
import index_const from '../../index_const' import {
domain
} from '~/utils/request/http'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -29,7 +31,6 @@ Component({ ...@@ -29,7 +31,6 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
taskTypeImgList: index_const.data.taskTypeImgList,
}, },
/** /**
...@@ -45,6 +46,7 @@ Component({ ...@@ -45,6 +46,7 @@ Component({
// 任务详情 // 任务详情
jump(e) { jump(e) {
let { status, item } = e.currentTarget.dataset let { status, item } = 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)
}, },
......
...@@ -28,19 +28,19 @@ ...@@ -28,19 +28,19 @@
<block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky"> <block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky">
<view class="task-item"> <view class="task-item">
<view class="left"> <view class="left">
<image webp src="{{IMGURL}}{{taskTypeImgList[val.type - 1]}}.png"></image> <image webp src="{{IMGURL}}task_icon_{{val.missonType}}.png"></image>
<view class="task-message"> <view class="task-message">
<view class="task-title"> <view class="task-title">
<view class="text">{{val.title}}</view> <view class="text">{{val.missionName}}</view>
<image webp src="{{IMGURL}}integral_icon.png"></image> <image webp src="{{IMGURL}}integral_icon.png"></image>
<view class="integral-num">+{{val.inteNum}}积分</view> <view class="integral-num">+{{val.gainScore}}积分</view>
</view> </view>
<view class="task-content">{{val.content}}</view> <view class="task-content">{{val.missonDesc}}</view>
</view> </view>
</view> </view>
<view class="task-btn"> <view class="task-btn">
<view class="btn {{val.status == 1 ? 'primary' : ''}}" bind:tap="jump" data-status="{{val.status}}" data-item="{{val}}">{{val.status == 1 ? '去完成' : '已完成'}}</view> <view class="btn {{val.completeStatus == 1 ? 'primary' : ''}}" bind:tap="jump" data-status="{{val.completeStatus}}" data-item="{{val}}">{{val.completeStatus == 1 ? '去完成' : '已完成'}}</view>
<view class="btn_title" wx:if="{{val.status == 2}}">奖励已发放</view> <view class="btn_title" wx:if="{{val.completeStatus == 2}}">奖励已发放</view>
</view> </view>
</view> </view>
</block> </block>
......
// 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"
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -35,48 +36,43 @@ Component({ ...@@ -35,48 +36,43 @@ Component({
// 展开收起 // 展开收起
collapseClick(e) { collapseClick(e) {
let { key, flag } = e.currentTarget.dataset let { key, flag } = e.currentTarget.dataset
this.properties.activityList.forEach((val, ind) => { let { activityList } = this.data
// if (key == ind) { activityList.forEach((val, ind) => {
// if (flag && !val.missionList.length) {
// this.setData({
// isloading: true
// })
// activityApi.getActivityEndOrderList({id: val.id}).then(res => {
// this.setData({
// isloading: false
// })
// val.isCollapse = !flag
// val.missionList = res.missionList
// })
// }
// } else {
// val.isCollapse = !flag
// }
if (flag) {
this.setData({
isloading: true
})
}
setTimeout(() => {
if (key == ind) { if (key == ind) {
val.isCollapse = !flag if (flag && !val.orderList) {
} val.isloading = true
ActivityApi.getActivityEndInstallOrderList({activityId: val.id}).then(res => {
val.isloading = false
val.isCollapse = false
val.orderList = res.orderList
val.orderTotal = res.orderTotal
let itemVal = 'activityList['+ind+']'
this.setData({ this.setData({
isloading: false [itemVal]: val
}) })
this.setData({
activityList: this.properties.activityList
}) })
}, 1000) } else {
val.isCollapse = !flag
}
} else {
val.isCollapse = true
}
}) })
this.setData({ this.setData({
activityList: this.properties.activityList activityList: this.properties.activityList
}) })
}, },
filterJumpUrl(id) {
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()}`
},
// 活动详情 // 活动详情
goToDetail(e) { goToDetail(e) {
let { item } = e.currentTarget.dataset let { id } = e.currentTarget.dataset
let h5Url = `https://baidu.com?id=${item.name}` let h5Url = this.filterJumpUrl(id)
console.log(h5Url)
wx.$router.jumpH5(h5Url) wx.$router.jumpH5(h5Url)
}, },
// 活动战报 // 活动战报
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
</activity-top> </activity-top>
<!-- 活动操作按钮 --> <!-- 活动操作按钮 -->
<view class="active-btn"> <view class="active-btn">
<view class="btn" bind:tap="jump" data-item="{{item}}">活动战报</view> <view class="btn" bind:tap="jump" data-id="{{item.id}}">活动战报</view>
<view class="btn primary" bind:tap="goToDetail" data-item="{{item}}">查看详情</view> <view class="btn primary" bind:tap="goToDetail" data-id="{{item.id}}">查看详情</view>
</view> </view>
<!-- 活动概览 --> <!-- 活动概览 -->
<activity-overview data="{{item}}" backStyle="{{backStyle}}" textType="{{2}}"></activity-overview> <activity-overview data="{{item}}" backStyle="{{backStyle}}" textType="{{2}}"></activity-overview>
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<view class="earnings-box"> <view class="earnings-box">
<view class="left"> <view class="left">
<view class="title">累计收益</view> <view class="title">累计收益</view>
<view class="sort">最终排名:{{item.statistics.incomeRank}}</view> <view class="sort">最终排名:{{item.statics.incomeRank}}</view>
</view> </view>
<view class="integral-num">{{fn.filterIntegral(item.statistics.income)}}<text>积分</text></view> <view class="integral-num">{{fn.filterIntegral(item.statics.income)}}<text>积分</text></view>
</view> </view>
<!-- 转化分析 --> <!-- 转化分析 -->
<view class="invert-box {{item.isCollapse ? 'hidden' : ''}}"> <view class="invert-box {{item.isCollapse ? 'hidden' : ''}}">
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<!-- 展开/收起 --> <!-- 展开/收起 -->
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}"> <view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}">
<text>{{item.isCollapse ? '展开' : '收起'}}</text><text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text> <text>{{item.isCollapse ? '展开' : '收起'}}</text><text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text>
<van-loading wx:if="{{isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" /> <van-loading wx:if="{{item.isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -10,41 +10,41 @@ Component({ ...@@ -10,41 +10,41 @@ Component({
observer(v) { observer(v) {
if (v) { if (v) {
// 活动概览数据处理 // 活动概览数据处理
let s = v.statistics let s = v.statics
if (s && v.tabIndex == 0) { if (s && v.tabIndex == 0) {
v.overviewData = { // 活动中 v.overviewData = { // 活动中
shareData: { shareData: {
all: { title: '总分享', num: s.shareCount, sort: s.shareRank }, all: { title: '总分享', num: s.shareCount, sort: s.shareCountRank },
today: { title: '今日分享', num: s.todayShareCount, sort: s.todayShareRank } today: { title: '今日分享', num: s.todayShareCount, sort: s.todayShareCountRank }
}, },
browseData: { browseData: {
all: { title: '总浏览', num: s.browseCount, sort: s.browseRank }, all: { title: '总浏览', num: s.browseCount, sort: s.browseCountRank },
today: { title: '今日浏览', num: s.todayBrowseCount, sort: s.todayBrowseRank } today: { title: '今日浏览', num: s.todayBrowseCount, sort: s.todayBrowseCountRank }
}, },
visitorData: { visitorData: {
all: { title: '总访客', num: s.visitorCount, sort: s.visitorRank }, all: { title: '总访客', num: s.fansCount, sort: s.fansCountRank },
today: { title: '今日访客', num: s.todayVisitorCount, sort: s.todayVisitorRank } today: { title: '今日访客', num: s.todayFansCount, sort: s.todayFansCountRank }
}, },
orderData: { orderData: {
all: { title: '总订单', num: s.orderCount, sort: s.orderRank }, all: { title: '总订单', num: s.orderCount, sort: s.orderCountRank },
today: { title: '今日订单', num: s.todayOrderCount, sort: s.todayOrderRank } today: { title: '今日订单', num: s.todayOrderCount, sort: s.todayOrderCountRank }
} }
} }
} else if (s) { } else if (s) {
v.overviewData = [ // 活动诊断 v.overviewData = [ // 活动诊断
{title: '分享', num: s.shareCount, sort: s.shareRank}, {title: '分享', num: s.shareCount, sort: s.shareCountRank},
{title: '浏览', num: s.browseCount, sort: s.browseRank}, {title: '浏览', num: s.browseCount, sort: s.browseCountRank},
{title: '访客', num: s.visitorCount, sort: s.visitorRank}, {title: '访客', num: s.fansCount, sort: s.fansCountRank},
{title: '订单', num: s.orderCount, sort: s.orderRank} {title: '订单', num: s.orderCount, sort: s.orderCountRank}
] ]
v.numList = [ v.numList = [
{title: '浏览量', num: s.browseCount}, {title: '浏览量', num: s.browseCount},
{title: '访问量', num: s.visitorCount}, {title: '访问量', num: s.fansCount},
{title: '订单量', num: s.orderCount} {title: '订单量', num: s.orderCount}
] ]
v.sortList = [ v.sortList = [
{title: '访客率', sort: s.conversionRate}, {title: '访客率', sort: s.conversionRate},
{title: '转化率', sort: s.visitorRate} {title: '转化率', sort: s.browseRate}
] ]
} }
this.setData({data: v}) this.setData({data: v})
...@@ -78,14 +78,15 @@ Component({ ...@@ -78,14 +78,15 @@ Component({
methods: { methods: {
// 跳转 // 跳转
jump(e) { jump(e) {
let { index, flag } = e.currentTarget.dataset let { index } = e.currentTarget.dataset
let itemData = this.data.data
if (index < 2) return // 分享和浏览数据不作跳转 if (index < 2) return // 分享和浏览数据不作跳转
switch(index) { switch(index) {
case 2: // 访客 case 2: // 访客
wx.$router.go("packageActivity.visitor", flag) wx.$router.go("packageActivity.visitor", {...itemData})
break break
case 3: // 订单 case 3: // 订单
wx.$router.go("packageActivity.order", flag) wx.$router.go("packageActivity.order", {...itemData})
break break
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- 活动中 --> <!-- 活动中 -->
<view wx:if="{{textType == 1}}" class="active-overview"> <view wx:if="{{textType == 1}}" class="active-overview">
<block wx:for="{{activityOverviewList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind"> <block wx:for="{{activityOverviewList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="overview-item-box" style="{{backStyle[ind]}}" bind:tap="jump" data-index="{{ind}}" data-flag="1"> <view class="overview-item-box" style="{{backStyle[ind]}}" bind:tap="jump" data-index="{{ind}}">
<view class="all"> <view class="all">
<view class="title {{ind > 1 ? 'primary-title': ''}}">{{data.overviewData[i].all.title}}</view> <view class="title {{ind > 1 ? 'primary-title': ''}}">{{data.overviewData[i].all.title}}</view>
<view class="number">{{data.overviewData[i].all.num}}</view> <view class="number">{{data.overviewData[i].all.num}}</view>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- 活动诊断 --> <!-- 活动诊断 -->
<view wx:else class="active-overview"> <view wx:else class="active-overview">
<view class="overview-item-box" style="{{backStyle[0]}}"> <view class="overview-item-box" style="{{backStyle[0]}}">
<view class="all" wx:for="{{data.overviewData}}" wx:for-item="val" wx:for-index="key" wx:key="key" bind:tap="jump" data-index="{{key}}" data-flag="2"> <view class="all" wx:for="{{data.overviewData}}" wx:for-item="val" wx:for-index="key" wx:key="key" bind:tap="jump" data-index="{{key}}">
<view class="title">{{val.title}}</view> <view class="title">{{val.title}}</view>
<view class="number">{{val.num}}</view> <view class="number">{{val.num}}</view>
<view class="sort"><text>最终排名:</text>{{val.sort}}</view> <view class="sort"><text>最终排名:</text>{{val.sort}}</view>
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<view class="active-top"> <view class="active-top">
<view class="active-img"> <view class="active-img">
<view class="thum-icon"> <view class="thum-icon">
<image webp src="{{data.imgUrl}}"></image> <image webp src="{{data.activityImg}}"></image>
</view> </view>
<view class="active-type">{{activityTypList[data.type]}}</view> <view class="active-type">{{activityTypList[0]}}</view>
</view> </view>
<view class="active-title"> <view class="active-title">
<view class="name"> <view class="name">
<view class="left">{{data.name}}</view> <view class="left">{{data.activityName}}</view>
<view class="right"> <view class="right">
<slot></slot> <slot></slot>
</view> </view>
......
...@@ -53,7 +53,7 @@ Component({ ...@@ -53,7 +53,7 @@ Component({
// 查看预约安装信息 // 查看预约安装信息
showPopup(e) { showPopup(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
console.log(item) if (!item.reInstallContactsName && !item.reInstallContactsPhone)
this.setData({ this.setData({
installItem: item, installItem: item,
showPopup: true showPopup: true
......
<!--pages/tab/index/components/bookingOrder/bookingOrder.wxml--> <!--pages/tab/index/components/bookingOrder/bookingOrder.wxml-->
<view class="title"> <view class="title">
<view> <view>
待预约安装订单<text> · {{data.orderAccount}}</text> 待预约安装订单<text> · {{data.orderTotal}}</text>
</view> </view>
<view class="text-btn" bind:tap="showPopup" data-item="{{data}}">预约安装信息</view> <view class="text-btn" bind:tap="showPopup" data-item="{{data}}">预约安装信息</view>
</view> </view>
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<view class="item-content"> <view class="item-content">
<view class="top"> <view class="top">
<view class="top-left"> <view class="top-left">
<image webp src="{{item.userImgUrl ? item.userImgUrl : 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">{{item.userName}}</view> <view class="name" wx:if="{{item.customerNickName}}">{{item.customerNickName}}</view>
<view class="mobile">{{item.mobile}}</view> <view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view>
</view> </view>
</view> </view>
......
...@@ -10,16 +10,16 @@ Component({ ...@@ -10,16 +10,16 @@ Component({
type: Object, type: Object,
value: {}, value: {},
observer(v) { observer(v) {
let s = v.statistics let s = v.statics
if (s) { if (s) {
v.numList = [ v.numList = [
{title: '浏览量', num: s.browseCount}, {title: '浏览量', num: s.browseCount},
{title: '访问量', num: s.visitorCount}, {title: '访问量', num: s.fansCount},
{title: '订单量', num: s.orderCount} {title: '订单量', num: s.orderCount}
] ]
v.sortList = [ v.sortList = [
{title: '访客率', sort: s.conversionRate}, {title: '访客率', sort: s.conversionRate},
{title: '转化率', sort: s.visitorRate} {title: '转化率', sort: s.browseRate}
] ]
} }
this.setData({data: v}) this.setData({data: v})
......
...@@ -44,15 +44,15 @@ ...@@ -44,15 +44,15 @@
.right{ .right{
flex: 1; flex: 1;
flex-flow: column; flex-flow: column;
align-items: flex-end; align-items: flex-start;
margin-left: 8rpx; margin-left: 20rpx;
color: #4466F0; color: #4466F0;
padding-top: 20rpx; padding-top: 20rpx;
font-size: 24rpx; font-size: 24rpx;
position: relative; position: relative;
.sort-box:last-child{ .sort-box:last-child{
position: absolute; position: absolute;
left: -36rpx; left: -46rpx;
top: 55%; top: 55%;
} }
.sort{ .sort{
......
...@@ -16,20 +16,20 @@ ...@@ -16,20 +16,20 @@
<view class="tab-box" style="top: {{navHeight}}px"> <view class="tab-box" style="top: {{navHeight}}px">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index == tabIndex? 'active' : '' }}" bindtap="click" data-index="{{index}}"> <view class="tab {{index == tabIndex? 'active' : '' }}" bindtap="click" data-index="{{index}}">
<view class="text">{{item.name}} ({{item.account}})</view> <view class="text">{{item.name}} ({{index == 0 ? activeTotal : total}})</view>
<view class="line"></view> <view class="line"></view>
</view> </view>
</block> </block>
</view> </view>
<!-- 活动中 --> <!-- 活动中 -->
<view class="active-content"> <view class="active-content" hidden="{{tabIndex != 0}}">
<block wx:if="{{tabIndex == 0}}"> <block>
<active-box activeList="{{activeList}}"></active-box> <active-box activeList="{{activeList}}"></active-box>
</block> </block>
</view> </view>
<!-- 活动诊断 --> <!-- 活动诊断 -->
<view class="activity-diag-content"> <view class="activity-diag-content" hidden="{{tabIndex != 1}}">
<block wx:if="{{tabIndex == 1}}"> <block>
<activity-diagnosis activityList="{{activityEndList}}"></activity-diagnosis> <activity-diagnosis activityList="{{activityEndList}}"></activity-diagnosis>
</block> </block>
</view> </view>
......
export default { export default {
data: { data: {
activityTypList: ['众筹', ''], activityTypList: ['众筹']
taskTypeImgList: ['share_task_icon', 'overview_task_icon', 'reward_task_icon'],
} }
} }
\ No newline at end of file \ No newline at end of file
{
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"setting": {
"urlCheck": true,
"scopeDataCheck": false,
"coverView": true,
"es6": false,
"postcss": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"minified": true,
"autoAudits": false,
"newFeature": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"useIsolateContext": false,
"nodeModules": false,
"enhance": true,
"useMultiFrameRuntime": true,
"showShadowRootInWxmlPanel": true,
"minifyWXSS": true,
"disableUseStrict": false,
"ignoreUploadUnusedFiles": true,
"minifyWXML": true,
"useStaticServer": true,
"showES6CompileOption": false,
"checkInvalidKey": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useCompilerPlugins": [
"sass"
],
"packNpmManually": true,
"packNpmRelationList": [
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./"
}
]
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {
"qywx_simulator_plugin": "2.4.0"
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"condition": {},
"packOptions": {
"ignore": [
{
"value": ".md",
"type": "file"
}
],
"include": []
},
"appid": "wxc50d04ae5aa9984a"
}
\ No newline at end of file \ No newline at end of file
...@@ -134,22 +134,8 @@ ...@@ -134,22 +134,8 @@
"scene": null "scene": null
}, },
{ {
"name": "发现页", "name": "",
"pathName": "pages/tab/discovery/discovery", "pathName": "packageActivity/pages/order/order",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "模拟分享",
"pathName": "pages/authentication/loading/loading",
"query": "url=%2Fpages%2Ftab%2Fdiscovery%2Fdiscovery",
"launchMode": "default",
"scene": null
},
{
"name": "申请活动",
"pathName": "packageActivity/pages/applyActivity/applyActivity",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
......
...@@ -55,7 +55,11 @@ const pathEnum = { ...@@ -55,7 +55,11 @@ const pathEnum = {
customercollect: '/rop-scrm-bigdatautil/', customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/', drac: '/rop-scrm-entmicro/',
withdrawal:'/rop-scrm-stoassistant/', withdrawal:'/rop-scrm-stoassistant/',
score:'/rop-scrm-stoassistant/' score:'/rop-scrm-stoassistant/',
stoassistant: '/rop-scrm-stoassistant/',
assistant: '/rop-scrm-stoassistant/',
mission: '/rop-scrm-stoassistant/',
busassistant: '/rop-scrm-busassistant/'
} }
const defaultMerchantId = { const defaultMerchantId = {
ip: '44184606', ip: '44184606',
......
/** 分享
* @param {*} shareTitle 分享标题
* @param {*} sharePath 分享页面路径 不传默认当前页
* @param {*} shareImage 分享图片 不传默认当前页面截图
* @param {*} shareQuery 分享页面参数
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @returns
*/
class Share {
constructor() {
console.log('---------------- 分享初始化 ----------------')
this.initPageProxy()
}
/**全局注册事件 */
initPageProxy() {
let thisPage = Page
let _this = this
Page = function (el) {
try {
el || (el = {}), _this.pageLeaveProxy(el), thisPage.apply(this, arguments)
} catch (el) {
thisPage.apply(this, arguments)
}
}
}
/**设置全局分享 */
pageLeaveProxy(page) {
if (page.onShareAppMessage) {
page.onShareAppMessage = function () {
let {
shareTitle,
sharePath,
shareImage,
shareQuery,
noPageAuth=true
} = this,
path = `/${this.route}`
if (sharePath) path = `/${sharePath}`
if (shareQuery) path += `?${shareQuery}`
if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}`
return {
path,
title: shareTitle,
imageUrl: shareImage
}
}
}
}
}
new Share()
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!