Commit 01b0b6f4 by 张晓玮

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

Zhangxw dev 3.0

See merge request !59
2 parents 2bd4ceac 73f96de9
Showing 32 changed files with 283 additions and 151 deletions
...@@ -78,7 +78,8 @@ ...@@ -78,7 +78,8 @@
"van-picker": "@vant/weapp/picker/index", "van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"install-popup": "/components/installPopup/installPopup", "install-popup": "/components/installPopup/installPopup",
"van-loading": "@vant/weapp/loading/index" "van-loading": "@vant/weapp/loading/index",
"mp-html": "/components/mp-html"
}, },
"resolveAlias": { "resolveAlias": {
"~/*": "/*" "~/*": "/*"
......
...@@ -83,10 +83,6 @@ ...@@ -83,10 +83,6 @@
color: #C1C2C3; color: #C1C2C3;
} }
.list-nothing.to-bottom::after{
content: '- 到 底 了 -'
}
.list-loading{ .list-loading{
width: 100%; width: 100%;
padding: 8rpx 0 30rpx; padding: 8rpx 0 30rpx;
......
/* components/installPopup/installPopup.wxss */ /* components/installPopup/installPopup.wxss */
.content{ .content{
width: 560rpx; width: 560rpx;
height: 480rpx; // height: 480rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: inset 0 0 48rpx 16rpx #E0EAFF; box-shadow: inset 0 0 48rpx 16rpx #E0EAFF;
.title{ .title{
...@@ -12,29 +12,41 @@ ...@@ -12,29 +12,41 @@
text-align: center; text-align: center;
} }
.middle{ .middle{
padding: 40rpx 0 80rpx 80rpx; display: flex;
view{ flex-flow: column;
justify-content: flex-start;
padding: 60rpx;
.name{
display: flex;
font-size: 30rpx; font-size: 30rpx;
color: #1B233D; color: #1B233D;
.label{ .label{
color: #7A8299; color: #7A8299;
display: inline-block; display: inline-block;
width: 140rpx; flex: 0 0 140rpx;
}
} }
} }
.mobile{ .mobile{
padding-top: 10rpx; display: flex;
line-height: 56rpx; font-size: 30rpx;
color: #1B233D;
margin-top: 10rpx;
.label{
color: #7A8299;
display: inline-block;
flex: 0 0140rpx;
}
image{ image{
width: 56rpx; width: 56rpx;
height: 56rpx; height: 56rpx;
margin-left: 16rpx; margin-left: 16rpx;
} }
} }
}
.btn-box{ .btn-box{
display: flex; display: flex;
justify-content: center; justify-content: center;
padding-bottom: 48rpx;
.btn{ .btn{
width: 320rpx; width: 320rpx;
height: 88rpx; height: 88rpx;
......
import activityApi from "~/api/activityApi/index" import ActivityApi from "~/api/activityApi/index"
import UsersApi from "~/api/usersApi/index"
import { import {
reportData reportData
} from '~/api/api.js' } from '~/api/api.js'
Page({ Page({
data: { data: {
list: [
{
name: '新车洽谈场景',
tip: '1.0 新车权益销售',
},
{
name: '新车交付场景',
tip: '1.1 新车精品升级',
},
{
name: '0-12个月',
tip: '1.2 新车线上转化',
},
{
name: '12个月以上',
tip: '1.3 存量用户众筹',
},
],
currentIndex: 0, currentIndex: 0,
product: [ currentSceneCode: '',
{ currentSceneName: '',
id: 1, product: []
name: '360全景导航',
isSelect: false
},
{
id: 2,
name: '360全景导航',
isSelect: false
},
{
id: 3,
name: '360全景导航',
isSelect: false
}, },
{ onLoad() {
id: 4, UsersApi.getWXUserInfo()
name: '360全景导航', const {
isSelect: false USERINFO
} = this.getCommonData()
// 已开通场景
ActivityApi.getOpenSceneList({merchantId: USERINFO.merchantId}).then(res => {
let arr = []
res && res.forEach(val => {
if (val.status == 1) arr.push(val)
})
if (arr[0] && arr[0].sceneCode) this.getProducts(arr[0].sceneCode)
this.setData({
list: arr,
currentSceneCode: (arr[0] && arr[0].sceneCode) || 'SC001',
currentSceneName: (arr[0] && arr[0].name)
})
})
}, },
{ getProducts(code) {
id: 5, let arr = []
name: '360全景导航', const {
isSelect: false USERINFO
} } = this.getCommonData()
] ActivityApi.getNotOpenProductsList({merchantId: USERINFO.merchantId, sceneCode: code}).then(res => { // 默认选中第一个业务场景 获取可用产品/活动
res.forEach(item => {
item.isSelect = false
if (item.status == 0) arr.push(item)
})
this.setData({
product: arr
})
})
}, },
select(e) { select(e) {
const { index } = e.currentTarget.dataset const { index, item } = e.currentTarget.dataset
this.setData({ this.setData({
currentIndex: index currentIndex: index,
currentSceneCode: item.sceneCode,
currentSceneName: item.name
}) })
this.getProducts(code)
}, },
selectProduct(e) { selectProduct(e) {
const { item, index } = e.currentTarget.dataset const { item, index } = e.currentTarget.dataset
...@@ -68,60 +64,46 @@ Page({ ...@@ -68,60 +64,46 @@ Page({
// 申请开通 // 申请开通
applyOpened() { applyOpened() {
// 获取已选的产品code // 获取已选的产品code
let { product, currentIndex } = this.data let { product, currentSceneCode, currentSceneName } = this.data
let arr = [] let [arr1, arr2] = [[], []]
product.forEach(val => { product.forEach(val => {
if (val.isSelect) arr.push(val.id) if (val.isSelect) {
}) arr1.push(val.productCode)
console.log(reportData) arr2.push(val.productName)
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 (!arr1.length) return wx.showToast({
title: '请选择产品/活动', title: '请选择产品/活动',
icon: "none" icon: "none"
}) })
activityApi.applyActivity({
serviceMerchantId: 1,
merchantId: 2,
sceneCode: currentIndex,
productCodes: arr
}).then(res => {
if (res.code == 200) {
const { const {
USERINFO USERINFO,
WXUSERINFO
} = this.getCommonData() } = this.getCommonData()
reportData({ reportData({
openId: USERINFO.weChatOpenId || '', openId: WXUSERINFO.openId || '',
unionId: USERINFO.uuid || '', unionId: USERINFO.uuid || '',
nickName: USERINFO.weChatNickName || '', nickName: USERINFO.weChatNickName || '',
avatar: USERINFO.weChatAvatarUrl || '', avatar: USERINFO.weChatAvatarUrl || '',
phone: USERINFO.weChatPhone || '', phone: USERINFO.weChatPhone || '',
merchantId: USERINFO.merchantId || '' merchantId: USERINFO.merchantId || '',
}).then(res => { shopName: USERINFO.merchantName || '',
console.log(res) sceneCode: currentSceneCode || '',
}) sceneName: currentSceneName || '',
wx.$router.go('packageActivity.applySuccess') productCode: arr1.join(','),
} productDesc: arr2.join(','),
shopId: USERINFO.merchantId || ''
}, 2).then(res => {
wx.$router.redirectTo('packageActivity.applySuccess')
}) })
}, },
getCommonData() { getCommonData() {
const USERINFO = wx.$storage.get('userInfo') const USERINFO = wx.$storage.get('userInfo')
const WXUSERINFO = wx.$storage.get('wx_user_info')
return { return {
USERINFO USERINFO,
WXUSERINFO
} }
} }
......
...@@ -69,10 +69,12 @@ page { ...@@ -69,10 +69,12 @@ page {
.widget { .widget {
box-sizing: border-box; box-sizing: border-box;
padding: 0 16rpx; padding: 0 16rpx;
display: flex;
.element { .element {
width: 154rpx; flex: 0 0 23%;
// width: 154rpx;
height: 180rpx; height: 180rpx;
margin-right: 2%;
background: #F7F8FA; background: #F7F8FA;
border-radius: 16rpx; border-radius: 16rpx;
display: flex; display: flex;
...@@ -80,7 +82,6 @@ page { ...@@ -80,7 +82,6 @@ page {
align-items: center; align-items: center;
position: relative; position: relative;
border: 2rpx solid #F7F8FA; border: 2rpx solid #F7F8FA;
.icon { .icon {
width: 56rpx; width: 56rpx;
height: 56rpx; height: 56rpx;
...@@ -167,9 +168,14 @@ page { ...@@ -167,9 +168,14 @@ page {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #323436; color: #323436;
line-height: 44rpx; line-height: 60rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
border: 1rpx solid #F5F6FA; border: 1rpx solid #F5F6FA;
display: inline-block;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.active { .active {
......
<view class="container"> <view class="container">
<image mode="widthFix" style="height: 480rpx;" src="{{IMGURL + 'apply_activity_bg_' + currentIndex + '.png'}}" /> <image mode="widthFix" style="height: 480rpx;" src="{{IMGURL + 'apply_activity_bg_' + currentSceneCode + '.png'}}" />
<view class="pos_wrap"> <view class="pos_wrap">
<view class="wrapper"> <view class="wrapper">
<view class="title"> <view class="title">
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
<view class="label">开通门店活动产品/活动</view> <view class="label">开通门店活动产品/活动</view>
</view> </view>
<view class="sinceTitle">业务场景</view> <view class="sinceTitle">业务场景</view>
<view class="widget flex_scb"> <view class="widget">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<view bind:tap="select" data-index="{{index}}" class="element {{currentIndex==index?'active':''}}"> <view bind:tap="select" data-index="{{index}}" data-item="{{item}}" class="element {{currentIndex==index?'active':''}}">
<image mode="widthFix" class="icon" src="{{IMGURL}}apply_activity_icon_{{index+1}}.png" /> <image mode="widthFix" class="icon" src="{{IMGURL}}apply_activity_icon_{{index+1}}.png" />
<view class="name {{currentIndex==index?'active_color':''}}"> <view class="name {{currentIndex==index?'active_color':''}}">
{{item.name}} {{item.stage}}
</view> </view>
<view class="tip {{currentIndex==index?'active_color':''}}"> <view class="tip {{currentIndex==index?'active_color':''}}">
{{item.tip}} {{item.name}}
</view> </view>
<view class="triangle-down"></view> <view class="triangle-down"></view>
<!-- <view class="triangle-down_temp"></view> --> <!-- <view class="triangle-down_temp"></view> -->
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<block wx:for="{{product}}" wx:key="index"> <block wx:for="{{product}}" wx:key="index">
<view class="box"> <view class="box">
<view bind:tap="selectProduct" data-index="{{index}}" data-item="{{item}}" class="element flex_cc {{item.isSelect?'active':''}}"> <view bind:tap="selectProduct" data-index="{{index}}" data-item="{{item}}" class="element flex_cc {{item.isSelect?'active':''}}">
{{item.name}} {{item.productName}}
</view> </view>
</view> </view>
</block> </block>
......
...@@ -34,7 +34,7 @@ Page({ ...@@ -34,7 +34,7 @@ Page({
activityId activityId
}).then(res => { }).then(res => {
res.orderList && res.orderList.forEach(val => { res.orderList && res.orderList.forEach(val => {
val.time = val.payDate ? new Date(val.payDate).format('yyyy-MM-dd hh:mm:ss') : '' val.time = val.createdDate ? new Date(val.createdDate).format('yyyy-MM-dd hh:mm:ss') : ''
val.orderPrice = centsToyuan(val.orderPrice) val.orderPrice = centsToyuan(val.orderPrice)
}) })
this.setData({ this.setData({
......
...@@ -163,5 +163,22 @@ ...@@ -163,5 +163,22 @@
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);
} }
} }
.no-data{
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
margin-top: 240rpx;
image{
width: 400rpx;
height: 400rpx;
}
.text{
margin-top: 32rpx;
font-size: 28rpx;
color: #7A8299;
}
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
</view> </view>
</block> </block>
</view> </view>
<view class="no-data" wx:if="{{!list.length}}">
<image webp src="{{IMGURL}}no_order_data.png"></image>
<view class="text">暂无订单</view>
</view>
</view> </view>
</view> </view>
<!-- 预约安装弹窗 --> <!-- 预约安装弹窗 -->
......
// packageActivity/pages/shareTaskDetail/shareTaskDetail.js // packageActivity/pages/shareTaskDetail/shareTaskDetail.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 { showEmoji } from '~/utils/emoji'
Page({ Page({
/** /**
...@@ -29,7 +30,7 @@ Page({ ...@@ -29,7 +30,7 @@ Page({
res.platformMerchantMissionMaterialResponseList && res.platformMerchantMissionMaterialResponseList.forEach(val => { res.platformMerchantMissionMaterialResponseList && res.platformMerchantMissionMaterialResponseList.forEach(val => {
typeArr.push(val.materialType) typeArr.push(val.materialType)
if (val.materialType == 1) { // 文案 if (val.materialType == 1) { // 文案
res.textContent = val.materialContent res.filterTextContent = `<view>${showEmoji(val.materialContent)}</view>`
} }
if (val.materialType == 2 || val.materialType == 3) { // 图片视频 if (val.materialType == 2 || val.materialType == 3) { // 图片视频
res.imgUrlList.push({ res.imgUrlList.push({
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</view> </view>
<view class="content" wx:if="{{!fn.indexOf(materialTypeArr, 4)}}"> <view class="content" wx:if="{{!fn.indexOf(materialTypeArr, 4)}}">
<view class="text-box"> <view class="text-box">
<text>{{detailInfo.textContent}}</text> <mp-html content="{{detailInfo.filterTextContent}}"></mp-html>
</view> </view>
<view class="img_video"> <view class="img_video">
<block wx:for="{{detailInfo.imgUrlList}}" wx:key="index"> <block wx:for="{{detailInfo.imgUrlList}}" wx:key="index">
......
// 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 { showEmoji } from '~/utils/emoji'
import {
taskShareReport
} from '~/api/api.js'
import { import {
domain domain
} from '~/utils/request/http' } from '~/utils/request/http'
...@@ -68,6 +72,7 @@ Page({ ...@@ -68,6 +72,7 @@ Page({
// materialType 素材类型1文案 2图片 3视频 4专属链接 // materialType 素材类型1文案 2图片 3视频 4专属链接
if (val.materialType == 1) { // 文案 if (val.materialType == 1) { // 文案
res.textContent = val.materialContent res.textContent = val.materialContent
res.filterTextContent = `<view>${showEmoji(val.materialContent)}</view>`
} }
if (val.materialType == 2 || val.materialType == 3) { // 图片视频 if (val.materialType == 2 || val.materialType == 3) { // 图片视频
res.imgUrlList.push({ res.imgUrlList.push({
...@@ -85,7 +90,7 @@ Page({ ...@@ -85,7 +90,7 @@ Page({
detailInfo: res, detailInfo: res,
materialTypeArr: typeArr materialTypeArr: typeArr
}) })
this.shareImage = res.imgUrlList[0] ? res.imgUrlList[0].url : `${this.data.IMGURL}share_task_default_img.png` this.shareImage = res.imgUrlList[0] && res.imgUrlList[0].materialType == 2 ? res.imgUrlList[0].url : `${this.data.IMGURL}share_task_default_img.png`
this.shareTitle = res.activityName || '门店助手' this.shareTitle = res.activityName || '门店助手'
}) })
}, },
...@@ -129,7 +134,8 @@ Page({ ...@@ -129,7 +134,8 @@ Page({
// 复制链接 // 复制链接
copyUrl(e) { copyUrl(e) {
let { linkUrl, activityName } = this.data.detailInfo let that = this
let { linkUrl, activityName, missonType } = that.data.detailInfo
const userStorage = wx.$storage.get('userInfo') const userStorage = wx.$storage.get('userInfo')
wx.setClipboardData({ wx.setClipboardData({
data: `${userStorage.name || ''}邀请你参加${activityName || ""} ${linkUrl}`, data: `${userStorage.name || ''}邀请你参加${activityName || ""} ${linkUrl}`,
...@@ -138,6 +144,21 @@ Page({ ...@@ -138,6 +144,21 @@ Page({
title: '活动链接已复制,请打开企微进行转发', title: '活动链接已复制,请打开企微进行转发',
icon: "none" icon: "none"
}) })
if (missonType == 2) { // 复制触发一次埋点上报
const USERINFO = wx.$storage.get('userInfo')
let data = {
action_type: 4, // 事件类型固定为4-分享
item_type: 3, // 商品类型,固定为3-众筹活动
merchant_id: USERINFO.merchantId, // 门店号
staff_uuid: USERINFO.uuid,
business_type: 1, // 业务类型,固定为1
add_way: 104, // 来源,固定为104
create_time: new Date().format("yyyy-MM-dd hh:mm:ss"), // 分享时间
...that.shareTrackData
}
let jsonList = JSON.stringify(data)
taskShareReport({jsonList})
}
} }
}) })
}, },
...@@ -237,7 +258,6 @@ Page({ ...@@ -237,7 +258,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow(options) { onShow(options) {
console.log(options)
}, },
/** /**
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
<view class="activity">{{userStorage.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" wx:if="{{!fn.indexOf(materialTypeArr, 4)}}"> <view class="content" wx:if="{{!fn.indexOf(materialTypeArr, 4) && detailInfo.platformMerchantMissionMaterialResponseList.length}}">
<view class="text-box"> <view class="text-box">
<text>{{detailInfo.textContent}}</text> <mp-html content="{{detailInfo.filterTextContent}}"></mp-html>
</view> </view>
<view class="img_video"> <view class="img_video">
<block wx:for="{{detailInfo.imgUrlList}}" wx:key="index"> <block wx:for="{{detailInfo.imgUrlList}}" wx:key="index">
...@@ -63,10 +63,10 @@ ...@@ -63,10 +63,10 @@
<view class="btn" wx:if="{{fn.indexOf(materialTypeArr, 1)}}" bind:tap="copyText">复制文案</view> <view class="btn" wx:if="{{fn.indexOf(materialTypeArr, 1)}}" bind:tap="copyText">复制文案</view>
<view class="btn" wx:if="{{detailInfo.missonType != 2 || fn.indexOf(materialTypeArr, 4)}}" bind:tap="copyUrl">复制链接</view> <view class="btn" wx:if="{{detailInfo.missonType != 2 || fn.indexOf(materialTypeArr, 4)}}" bind:tap="copyUrl">复制链接</view>
<view class="btn" bind:tap="saveWith" wx:if="{{fn.indexOf(materialTypeArr, 2) || fn.indexOf(materialTypeArr, 3)}}"> <view class="btn" bind:tap="saveWith" wx:if="{{fn.indexOf(materialTypeArr, 2) || fn.indexOf(materialTypeArr, 3)}}">
<text>一键保存图片</text> <text>一键保存{{fn.indexOf(materialTypeArr, 2) ? '图片' : '视频'}}</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" bind:tap="share">分享</view> --> <!-- <view class="btn primary" bind:tap="share">分享</view> -->
<button class="btn primary" wx:if="{{detailInfo.missonType == 2}}" open-type="share">分享</button> <button class="btn primary" wx:if="{{detailInfo.missonType == 2 && !fn.indexOf(materialTypeArr, 4)}}" open-type="share">分享</button>
</view> </view>
</view> </view>
...@@ -112,5 +112,21 @@ ...@@ -112,5 +112,21 @@
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);
} }
} }
.no-data{
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
margin-top: 240rpx;
image{
width: 400rpx;
height: 400rpx;
}
.text{
margin-top: 32rpx;
font-size: 28rpx;
color: #7A8299;
}
}
} }
} }
...@@ -40,5 +40,9 @@ ...@@ -40,5 +40,9 @@
</view> </view>
</block> </block>
</view> </view>
<view class="no-data" wx:if="{{!list.length}}">
<image webp src="{{IMGURL}}no_visitor_data.png"></image>
<view class="text">暂无访客</view>
</view>
</view> </view>
</view> </view>
...@@ -16,7 +16,6 @@ Page({ ...@@ -16,7 +16,6 @@ Page({
}, },
onRoute(e) { onRoute(e) {
console.log(e)
this.setData({ this.setData({
infoData: e infoData: e
}) })
......
...@@ -14,4 +14,18 @@ ...@@ -14,4 +14,18 @@
text-align: center; text-align: center;
color: #1B233D; color: #1B233D;
} }
.no-data{
display: flex;
flex-flow: column;
margin-top: 328rpx;
image{
width: 400rpx;
height: 400rpx;
}
.text{
font-size: 28rpx;
color: #7A8299;
text-align: center;
}
}
} }
\ 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">
<view class="time-box">{{infoData.reportCreatedDate}}</view> <block wx:if="{{infoData.reportCreatedDate && infoData.reportUrl}}">
<view class="time-box">最近更新于 {{infoData.reportCreatedDate}}</view>
<image src="{{infoData.reportUrl}}" mode="widthFix"></image> <image src="{{infoData.reportUrl}}" mode="widthFix"></image>
</block>
<view wx:else class="no-data">
<image webp src="{{IMGURL}}no_warReport_data.png"></image>
<view class="text">活动战报未生成,请耐心等待</view>
</view>
</view> </view>
/* pages/tab/index/components/activeBox/activeBox.wxss */ /* pages/tab/index/components/activeBox/activeBox.wxss */
.content{ .content-box{
padding: 0 22rpx 2rpx 24rpx; padding: 0 22rpx 50rpx 24rpx;
.content-item{ .content-item{
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
display: inline-block; display: inline-block;
margin: 32rpx 0 8rpx 0; margin: 32rpx 0 8rpx 0;
border-radius: 24rpx;
overflow: hidden;
.item-bg{ .item-bg{
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 24rpx;
overflow: hidden;
position: absolute; position: absolute;
box-shadow: 0 10rpx 20rpx 0 rgba(204,133,122,0.16); box-shadow: 0 10rpx 20rpx 0 rgba(204,133,122,0.16);
z-index: -1; z-index: -1;
...@@ -69,9 +69,10 @@ ...@@ -69,9 +69,10 @@
padding-bottom: 40rpx; padding-bottom: 40rpx;
} }
.hidden{ .hidden{
height: 80rpx; height: 64rpx;
padding: 0; padding: 0;
background: transparent; background: transparent;
margin-top: 0;
transition: height .3; transition: height .3;
.box-content{ .box-content{
display: none; display: none;
...@@ -85,7 +86,6 @@ ...@@ -85,7 +86,6 @@
justify-content: center; justify-content: center;
font-size: 26rpx; font-size: 26rpx;
position: absolute; position: absolute;
bottom: 40rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
.btn{ .btn{
...@@ -141,4 +141,7 @@ ...@@ -141,4 +141,7 @@
} }
} }
} }
.content-item:first-child{
margin: 16rpx 0 8rpx 0;
}
} }
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/activeBox/activeBox.wxml--> <!--pages/tab/index/components/activeBox/activeBox.wxml-->
<view class="content"> <view class="content-box">
<block wx:for="{{activeList}}" wx:key="index"> <block wx:for="{{activeList}}" wx:key="index">
<view class="content-item"> <view class="content-item">
<view class="item-bg"> <view class="item-bg">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</view> </view>
</view> </view>
<!-- 展开/收起 --> <!-- 展开/收起 -->
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}"> <view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}" style="bottom: {{item.isCollapse ? 24 : 48}}rpx;">
<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="{{item.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>
......
...@@ -38,15 +38,18 @@ ...@@ -38,15 +38,18 @@
color: #1B233D; color: #1B233D;
} }
} }
.active{
background-image: linear-gradient(180deg, #FFF7DB 15%, #FFF1E0 87%);
}
.completed{ .completed{
background-image: linear-gradient(180deg, #FFD84B 28%, #FFB33E 76%); background-image: linear-gradient(180deg, #FFD84B 28%, #FFB33E 76%);
.task-time{ .task-time{
color: #FFFFFF; color: #FFFFFF;
} }
} }
.active{
background-image: linear-gradient(180deg, #FFF7DB 15%, #FFF1E0 87%);
.task-time{
color: #1B233D;
}
}
} }
} }
.swiper-dots{ .swiper-dots{
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<block wx:for="{{data.newtaskCalenderList}}" wx:for-item="val" wx:for-index="k" wx:key="k"> <block wx:for="{{data.newtaskCalenderList}}" wx:for-item="val" wx:for-index="k" wx:key="k">
<swiper-item class='swiper_item'> <swiper-item class='swiper_item'>
<block wx:for="{{val}}" wx:for-item="v" wx:for-index="j" wx:key="j"> <block wx:for="{{val}}" wx:for-item="v" wx:for-index="j" wx:key="j">
<view class="time-box {{v.status == 2 ? 'completed' : (activeDateIndex == v.ind ? 'active' : '')}}" bind:tap="changeDate" data-dateindex="{{v.ind}}"> <view class="time-box {{v.status == 2 ? 'completed' : ''}} {{activeDateIndex == v.ind ? 'active' : ''}}" bind:tap="changeDate" data-dateindex="{{v.ind}}">
<image webp src="{{IMGURL}}{{v.status == 2 ? 'task_completed.png' : 'calender_integral_icon.png'}}"></image> <image webp src="{{IMGURL}}{{v.status == 2 ? 'task_completed.png' : 'calender_integral_icon.png'}}"></image>
<view class="task-time">{{v.status == 2 ? '已完成' : v.time}}</view> <view class="task-time">{{v.status == 2 ? '已完成' : v.time}}</view>
</view> </view>
......
...@@ -58,7 +58,7 @@ Component({ ...@@ -58,7 +58,7 @@ Component({
val.isloading = true val.isloading = true
ActivityApi.getActivityEndInstallOrderList({activityId: 495}).then(res => { ActivityApi.getActivityEndInstallOrderList({activityId: 495}).then(res => {
res.orderList && res.orderList.forEach(it => { res.orderList && res.orderList.forEach(it => {
it.time = new Date(it.payDate).format('yyyy-MM-dd hh:mm:ss') it.time = new Date(it.createdDate).format('yyyy-MM-dd hh:mm:ss')
}) })
val.isloading = false val.isloading = false
val.isCollapse = false val.isCollapse = false
......
/* pages/tab/index/components/activityDiagnosis/activityDiagnosis.wxss */ /* pages/tab/index/components/activityDiagnosis/activityDiagnosis.wxss */
.content{ .content{
padding: 0 22rpx 2rpx 24rpx; padding: 0 22rpx 50rpx 24rpx;
.content-item{ .content-item{
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
background-image: linear-gradient(180deg, #99B4FF 16%, #6276F5 93%); background-image: linear-gradient(180deg, #99B4FF 16%, #6276F5 93%);
border-radius: 20rpx; border-radius: 20rpx;
display: flex; display: flex;
align-items: center;
padding: 32rpx; padding: 32rpx;
box-sizing: border-box; box-sizing: border-box;
.left{ .left{
...@@ -172,4 +173,7 @@ ...@@ -172,4 +173,7 @@
} }
} }
} }
.content-item:first-child{
margin: 16rpx 0 8rpx 0;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
<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 || 0}}</view> <view class="number">{{data.overviewData[i].all.num || 0}}</view>
<view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].all.sort || '-'}}</view> <view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].all.sort || '-'}}</view>
<view wx:else class="sort"><text>排名 </text><text class="{{data.overviewData[i].all.sort > 0 ? 'up' : 'down'}}">{{fn.mathABS(data.overviewData[i].all.sort) || '-'}}<text wx:if="{{data.overviewData[i].all.sort}}">{{data.overviewData[i].all.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view> <view wx:else class="sort"><text>排名 </text><text class="{{!data.overviewData[i].all.sort ? '' : (data.overviewData[i].all.sort > 0 ? 'up' : 'down')}}">{{fn.mathABS(data.overviewData[i].all.sort) || '-'}}<text wx:if="{{data.overviewData[i].all.sort}}">{{data.overviewData[i].all.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view>
</view> </view>
<view class="today"> <view class="today">
<view class="title">{{data.overviewData[i].today.title}}</view> <view class="title">{{data.overviewData[i].today.title}}</view>
<view class="number">{{data.overviewData[i].today.num || 0}}</view> <view class="number">{{data.overviewData[i].today.num || 0}}</view>
<view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].today.sort || '-'}}</view> <view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].today.sort || '-'}}</view>
<view wx:else class="sort"><text>排名 </text><text class="{{data.overviewData[i].today.sort > 0 ? 'up' : 'down'}}">{{fn.mathABS(data.overviewData[i].today.sort) || '-'}}<text wx:if="{{data.overviewData[i].today.sort}}">{{data.overviewData[i].today.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view> <view wx:else class="sort"><text>排名 </text><text class="{{!data.overviewData[i].today.sort ? '' : (data.overviewData[i].today.sort > 0 ? 'up' : 'down')}}">{{fn.mathABS(data.overviewData[i].today.sort) || '-'}}<text wx:if="{{data.overviewData[i].today.sort}}">{{data.overviewData[i].today.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view>
</view> </view>
</view> </view>
</block> </block>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,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}}"> <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 {{key > 1 ? 'primary-title': ''}}">{{val.title}}</view>
<view class="number">{{val.num || 0}}</view> <view class="number">{{val.num || 0}}</view>
<view class="sort"><text>最终排名:</text>{{val.sort || '-'}}</view> <view class="sort"><text>最终排名:</text>{{val.sort || '-'}}</view>
</view> </view>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
.active-top{ .active-top{
display: flex; display: flex;
.active-img{ .active-img{
flex-shrink: 0;
position: relative; position: relative;
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
...@@ -47,7 +48,9 @@ ...@@ -47,7 +48,9 @@
float: right; float: right;
line-height: 44rpx; line-height: 44rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400;
color: #FE5662; color: #FE5662;
margin-top: 4rpx;
image{ image{
margin-top: 4rpx; margin-top: 4rpx;
width: 32rpx; width: 32rpx;
......
...@@ -13,7 +13,8 @@ var formatNumber = function (e) { ...@@ -13,7 +13,8 @@ var formatNumber = function (e) {
} }
var timeFilter = function(e) { var timeFilter = function(e) {
return getDate(e) > getDate().setHours(0, 0, 0, 0); console.log(getDate(e).getTime(), getDate().setHours(8, 0, 0, 0))
return getDate(e).getTime() == getDate().setHours(8, 0, 0, 0);
} }
module.exports = { module.exports = {
......
...@@ -14,12 +14,12 @@ Component({ ...@@ -14,12 +14,12 @@ Component({
if (s) { if (s) {
v.numList = [ v.numList = [
{title: '浏览量', num: s.browseCount}, {title: '浏览量', num: s.browseCount},
{title: '访问量', num: s.fansCount}, {title: '访客量', num: s.fansCount},
{title: '订单量', num: s.orderCount} {title: '订单量', num: s.orderCount}
] ]
v.sortList = [ v.sortList = [
{title: '访客率', sort: s.conversionRate}, {title: '访客率', sort: s.fansRate},
{title: '转化率', sort: s.fansRate} {title: '转化率', sort: s.conversionRate}
] ]
} }
this.setData({data: v}) this.setData({data: v})
......
...@@ -72,7 +72,8 @@ Page({ ...@@ -72,7 +72,8 @@ Page({
pageNum: num == 1 ? activePageNum : pageNum, pageNum: num == 1 ? activePageNum : pageNum,
pageSize pageSize
}).then(res => { }).then(res => {
let activityTitleViewWidth = wx.getSystemInfoSync().windowWidth - 139 // 活动title区域宽度 let windowWidth = wx.getSystemInfoSync().windowWidth
let activityTitleViewWidth = windowWidth - (((windowWidth / 375) * (46 + 48 + 160 + 24))) / 2 // 活动title区域宽度
res.list && res.list.forEach((val, index) => { res.list && res.list.forEach((val, index) => {
val.isCollapse = true val.isCollapse = true
val.startTime = val.startTime.split(' ')[0] val.startTime = val.startTime.split(' ')[0]
...@@ -115,7 +116,7 @@ Page({ ...@@ -115,7 +116,7 @@ Page({
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 => { res.orderList && res.orderList.forEach(it => {
it.time = new Date(it.payDate).format('yyyy-MM-dd hh:mm:ss') it.time = new Date(it.createdDate).format('yyyy-MM-dd hh:mm:ss')
}) })
val.orderList = res.orderList val.orderList = res.orderList
val.orderTotal = res.orderTotal val.orderTotal = res.orderTotal
......
page{
overflow: hidden;
}
.navigation-bar { .navigation-bar {
position: fixed; position: fixed;
top: 0; top: 0;
...@@ -25,12 +28,14 @@ ...@@ -25,12 +28,14 @@
left: 0; left: 0;
} }
} }
.content {
position: relative;
overflow: hidden;
.tab-box { .tab-box {
position: sticky;
top: 0;
left: 0;
z-index: 2;
display: flex; display: flex;
height: 112rpx; height: 112rpx;
margin-bottom: 16rpx;
.tab { .tab {
flex: 1; flex: 1;
display: flex; display: flex;
...@@ -56,11 +61,13 @@ ...@@ -56,11 +61,13 @@
height: 8rpx; height: 8rpx;
background: #708CFF; background: #708CFF;
border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0;
box-shadow: 0 4rpx 4rpx 0 #708CFF; // box-shadow: 0 4rpx 4rpx 0 #708CFF;
transform: scale(1); transform: scale(1);
} }
} }
} }
.content{
height: calc(100% - 112rpx);
} }
.add-activity{ .add-activity{
position: fixed; position: fixed;
......
...@@ -4,14 +4,13 @@ ...@@ -4,14 +4,13 @@
</navigation-bar> </navigation-bar>
</view> </view>
<block wx:if="{{navHeight}}"> <block wx:if="{{navHeight}}">
<view class="layout" style="top:{{navHeight}}px"> <view class="layout" style="top:{{navHeight}}px;height: calc(100vh - {{navHeight*2}}rpx);">
<!-- 背景图 --> <!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px"> <view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg"> <view class="bg">
<image webp src="{{IMGURL}}/index_bg.png?v={{img_version}}"></image> <image webp src="{{IMGURL}}/index_bg.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="content">
<!-- tab切换 --> <!-- tab切换 -->
<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">
...@@ -22,18 +21,17 @@ ...@@ -22,18 +21,17 @@
</block> </block>
</view> </view>
<!-- 活动中 --> <!-- 活动中 -->
<view class="active-content" hidden="{{tabIndex != 0}}"> <scroll-view scroll-y class="content" hidden="{{tabIndex != 0}}">
<block> <block>
<active-box activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}" allTaskCount="{{allTaskCount}}"></active-box> <active-box activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}" allTaskCount="{{allTaskCount}}"></active-box>
</block> </block>
</view> </scroll-view>
<!-- 活动诊断 --> <!-- 活动诊断 -->
<view class="activity-diag-content" hidden="{{tabIndex != 1}}"> <scroll-view scroll-y class="content" hidden="{{tabIndex != 1}}">
<block> <block>
<activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis> <activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis>
</block> </block>
</view> </scroll-view>
</view>
<!-- 申请活动 --> <!-- 申请活动 -->
<view class="add-activity" bind:tap="applyActivity"> <view class="add-activity" bind:tap="applyActivity">
<image webp src="{{IMGURL}}application_activity.png"></image> <image webp src="{{IMGURL}}application_activity.png"></image>
......
/**emoji正则 */ /**emoji正则 */
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
const emojiReg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac])/g const emojiReg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac])/g
/**过滤表情 */ /**过滤表情 */
...@@ -20,3 +37,20 @@ export function replaceEmoji(value) { ...@@ -20,3 +37,20 @@ export function replaceEmoji(value) {
let val = value.replace(emojiReg, '') let val = value.replace(emojiReg, '')
return val.trimStart().trimEnd() return val.trimStart().trimEnd()
} }
// 表情回显 文本内容
export function showEmoji(value) {
let filterValue = value.replace(/\[[\u4E00-\u9FA5]{1,3}\]/gi, (res) => {
const list = emoji.flat(Infinity)
let word = res.replace(/\[|\]/gi,'');
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
console.log(index, word)
return `<img webp style="width: 40rpx; height: 40rpx;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png" />`;
})
return filterValue
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!