Commit 4c2eba07 by 前端

fixed

1 parent 82113ebb
...@@ -68,7 +68,7 @@ class ActivityApi { ...@@ -68,7 +68,7 @@ class ActivityApi {
// 获取我的访客数据 // 获取我的访客数据
getActivityVisitorList(data) { getActivityVisitorList(data) {
return api.post({ return api.post({
method: `scrm.api.shopmall.customer.visitor.records`, method: `${path}.user.activity.visitor.list`,
...data, ...data,
}); });
} }
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
"name": "packageOutput", "name": "packageOutput",
"pages": [ "pages": [
"pages/shareWebview/shareWebview", "pages/shareWebview/shareWebview",
"pages/warReport/warReport",
"pages/visitor/visitor", "pages/visitor/visitor",
"pages/monthReport/monthReport", "pages/monthReport/monthReport",
"pages/crowdDetail/crowdDetail" "pages/crowdDetail/crowdDetail"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
// 配置预发布的小程序aapId // 配置预发布的小程序aapId
export const preReleaseAppId = '55555' export const preReleaseAppId = 'wx96c8f2a3e76907cb'
// 小程序id // 小程序id
export const appId = 'wxc50d04ae5aa9984a' export const appId = 'wxc50d04ae5aa9984a'
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
.up-box { .up-box {
position: absolute; position: absolute;
width: 108rpx; width: 128rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 0 18rpx 0 #3a596a1c; box-shadow: 0 0 18rpx 0 #3a596a1c;
border-radius: 8rpx; border-radius: 8rpx;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
padding: 24rpx; padding: 24rpx;
margin: 0rpx 16rpx; margin: 0rpx 16rpx;
border-radius: 32rpx; border-radius: 32rpx;
background: #F4F8FE;
.output-title { .output-title {
font-weight: 600; font-weight: 600;
font-size: 32rpx; font-size: 32rpx;
......
...@@ -57,9 +57,12 @@ Component({ ...@@ -57,9 +57,12 @@ Component({
jumpReport(e) { jumpReport(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始') if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
if(item.activityStatus == 2)
wx.navigateTo({ wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`, url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
}); });
else
wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item)
}, },
// 跳转 // 跳转
jump(e) { jump(e) {
...@@ -72,7 +75,7 @@ Component({ ...@@ -72,7 +75,7 @@ Component({
}, },
// 价格格式化 // 价格格式化
priceFormat(num, point = 2) { priceFormat(num, point = 2) {
let numStr = num.toString().split('.')[0] let numStr = (num/100).toString().split('.')[0]
if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示 if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
return numStr; return numStr;
} else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万 } else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
......
...@@ -15,7 +15,8 @@ Page({ ...@@ -15,7 +15,8 @@ Page({
outputValue: [{ outputValue: [{
label: '今日产值/元', label: '今日产值/元',
name: 'realAmountToday', name: 'realAmountToday',
unit: '¥' unit: '¥',
multiple: 0.01,
}, { }, {
label: '今日订单/单', label: '今日订单/单',
name: 'orderCountToday', name: 'orderCountToday',
...@@ -27,7 +28,8 @@ Page({ ...@@ -27,7 +28,8 @@ Page({
}, { }, {
label: '累计产值/元', label: '累计产值/元',
name: 'realAmount', name: 'realAmount',
unit: '¥' unit: '¥',
multiple: 0.01,
}, { }, {
label: '累计订单/单', label: '累计订单/单',
name: 'orderCount', name: 'orderCount',
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
<view class="output-value"> <view class="output-value">
<view class="output-item" wx:for="{{outputValue}}" wx:key="index"> <view class="output-item" wx:for="{{outputValue}}" wx:key="index">
<view class="output-num"><text>{{item.unit}}</text>{{outputData[item.name] || 0}}</view> <view class="output-num"><text>{{item.unit}}</text>{{outputData[item.name]*(item.multiple || 1) || 0}}</view>
<view class="output-label">{{item.label}}</view> <view class="output-label">{{item.label}}</view>
</view> </view>
</view> </view>
......
...@@ -12,8 +12,8 @@ Page({ ...@@ -12,8 +12,8 @@ Page({
allNum: 0, allNum: 0,
todayNum: 0, todayNum: 0,
activityTypList: index_const.data.activityTypList, activityTypList: index_const.data.activityTypList,
IMG_URL: IMG_URL_STORE, IMG_URL:IMG_URL_STORE,
isPravite: false isPravite:false
}, },
/** /**
...@@ -23,27 +23,27 @@ Page({ ...@@ -23,27 +23,27 @@ Page({
}, },
onRoute(options) { onRoute(options) {
let { activityId, visitCount, visitCountToday } = options let activityId = options.activityId
ActivityApi.getActivityVisitorList({ ActivityApi.getActivityVisitorList({
activityId activityId,
staffFlag:true
}).then(res => { }).then(res => {
console.log(res) res.visitorList && res.visitorList.forEach(val => {
res.list && res.list.forEach(val => { val.lastVisitFormatTime = commentTime(val.lastVisitDate)
val.lastVisitFormatTime = commentTime(new Date(val.lastBrowseDate).getTime()) if(!val.customerPhone&&val.guestId){
// if (!val.customerPhone && val.guestId) { val.gId = (val.guestId.split('_')).pop() || ''
// val.gId = (val.guestId.split('_')).pop() || '' }
// }
}) })
this.setData({ this.setData({
allNum: visitCount, allNum: res.visitorTotal,
todayNum: visitCountToday, todayNum: res.todayTotal,
list: res.list list: res.visitorList
}) })
}) })
}, },
toCopyName(e) { toCopyName(e){
const { name } = e.currentTarget.dataset const {name} = e.currentTarget.dataset
if (name) { if(name){
wx.setClipboardData({ wx.setClipboardData({
data: name data: name
}) })
...@@ -62,7 +62,7 @@ Page({ ...@@ -62,7 +62,7 @@ Page({
let { wechartno } = e.currentTarget.dataset let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({ wx.setClipboardData({
data: wechartno.toString(), data: wechartno.toString(),
success(res) { success (res) {
wx.showToast({ wx.showToast({
title: '微信号已复制', title: '微信号已复制',
icon: "none" icon: "none"
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
</view> </view>
<view class="content"> <view class="content">
<view class="title"> <view class="title">
<view>总访客<text> · {{allNum||0}}</text></view> <view>总访客<text> · {{allNum}}</text></view>
<view>今日访客<text> · {{todayNum||0}}</text></view> <view>今日访客<text> · {{todayNum}}</text></view>
</view> </view>
<view class="list-box"> <view class="list-box">
<block wx:if="{{!isPravite}}"> <block wx:if="{{!isPravite}}">
...@@ -14,15 +14,15 @@ ...@@ -14,15 +14,15 @@
<view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}"> <view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}">
<view class="top"> <view class="top">
<view class="top-left"> <view class="top-left">
<image webp src="{{item.customerAvatar ? item.customerAvatar : '{{IMG_URL}}store-assistant/default_avatar.png'}}"></image> <image webp src="{{item.customerImageUrl ? item.customerImageUrl : '{{IMG_URL}}store-assistant/default_avatar.png'}}"></image>
<view class="name-mobile"> <view class="name-mobile">
<view class="name"> <view class="name">
{{item.customerName || ""}} {{item.customerNickName || ""}}
<glsx-image wx:if="{{item.customerName&&item.customerName!='未知访客'}}" data-name="{{item.customerName}}" bind:tap="toCopyName" class="copy" src="store-assistant/copy_name.png"></glsx-image> <glsx-image wx:if="{{item.customerNickName&&item.customerNickName!='未知访客'}}" data-name="{{item.customerNickName}}" bind:tap="toCopyName" class="copy" src="store-assistant/copy_name.png"></glsx-image>
<!-- <text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text> --> <!-- <text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text> -->
</view> </view>
<view class="mobile" wx:if="{{item.mobile}}"> <view class="mobile" wx:if="{{item.customerPhone}}">
{{item.mobile}} {{item.customerPhone}}
<text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text> <text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text>
</view> </view>
<view class="mobile" wx:else> <view class="mobile" wx:else>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</view> </view>
</view> </view>
<view class="top-right"> <view class="top-right">
<glsx-image class="btn_icon" wx:if="{{item.mobile}}" webp src="store-assistant/activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.mobile}}"></glsx-image> <glsx-image class="btn_icon" wx:if="{{item.customerPhone}}" webp src="store-assistant/activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.customerPhone}}"></glsx-image>
<glsx-image class="btn_icon" wx:if="{{item.userWechartNo}}" webp src="store-assistant/activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></glsx-image> <glsx-image class="btn_icon" wx:if="{{item.userWechartNo}}" webp src="store-assistant/activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></glsx-image>
</view> </view>
</view> </view>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<!-- <text>{{activityTypList[0]}}</text> --> <!-- <text>{{activityTypList[0]}}</text> -->
</view> </view>
<view class="footprint"> <view class="footprint">
<text>浏览 {{item.browseCount}} 次</text> <text>浏览 {{item.visitCount}} 次</text>
<text>{{item.lastVisitFormatTime}} 访问过</text> <text>{{item.lastVisitFormatTime}} 访问过</text>
</view> </view>
</view> </view>
...@@ -54,11 +54,11 @@ ...@@ -54,11 +54,11 @@
<view class="list-item {{item.visitStatus==1?'orderde':''}}"> <view class="list-item {{item.visitStatus==1?'orderde':''}}">
<view class="top"> <view class="top">
<view class="top-left"> <view class="top-left">
<image webp src="{{item.customerAvatar ? item.customerAvatar : '{{IMG_URL}}store-assistant/default_avatar.png'}}"></image> <image webp src="{{item.customerImageUrl ? item.customerImageUrl : '{{IMG_URL}}store-assistant/default_avatar.png'}}"></image>
<view class="name-mobile"> <view class="name-mobile">
<view style="padding-top:8rpx" class="name"> <view style="padding-top:8rpx" class="name">
{{item.customerName || "未知访客"}} {{item.customerNickName || "未知访客"}}
<glsx-image wx:if="{{item.customerName&&item.customerName!='未知访客'}}" bind:tap="toCopyName" class="copy" src="store-assistant/copy_name.png"></glsx-image> <glsx-image wx:if="{{item.customerNickName&&item.customerNickName!='未知访客'}}" bind:tap="toCopyName" class="copy" src="store-assistant/copy_name.png"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
{{item.taskName || ''}} {{item.taskName || ''}}
</view> </view>
<view class="footprint"> <view class="footprint">
<text>浏览 {{item.browseCount}}次</text> <text>浏览 {{item.visitCount}}次</text>
<text>{{item.lastVisitFormatTime}} 访问过</text> <text>{{item.lastVisitFormatTime}} 访问过</text>
</view> </view>
</view> </view>
......
// packageActivity/pages/warReport/warReport.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(e) {
console.log(e)
this.setData({
infoData: e
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "活动战报"
}
\ No newline at end of file \ No newline at end of file
/* packageActivity/pages/warReport/warReport.wxss */
.content{
width: 100%;
min-height: 100vh;
display: flex;
flex-flow: column;
background: #fff;
align-items: center;
.time-box{
width: 100%;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
text-align: center;
color: #1B233D;
}
.no-data{
display: flex;
flex-flow: column;
margin-top: 328rpx;
.no_data_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-->
<view class="content">
<block wx:if="{{infoData.reportUrl}}">
<view class="time-box">最近更新于 {{infoData.reportCreatedDate}}</view>
<image src="{{infoData.reportUrl}}" mode="widthFix"></image>
</block>
<view wx:else class="no-data">
<glsx-image class="no_data_image" webp src="store-assistant/no_warReport_data.png"></glsx-image>
<view class="text">活动战报未生成,请耐心等待</view>
</view>
</view>
...@@ -218,8 +218,8 @@ Component({ ...@@ -218,8 +218,8 @@ Component({
// 跳转咨询页面 // 跳转咨询页面
goConsult() { goConsult() {
wx.openCustomerServiceChat({ wx.openCustomerServiceChat({
extInfo: { url: "https://work.weixin.qq.com/kfid/kfcfbc84ad072f27636" }, extInfo: { url: "https://work.weixin.qq.com/kfid/kfcf7b721472201345e" },
corpId: "wx51bda2e574d24a91", corpId: "ww047bdc0f1e76cc13",
complete: (r) => { complete: (r) => {
console.log(r); console.log(r);
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</view> --> </view> -->
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)"> <view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)">
<!-- 背景图 --> <!-- 背景图 -->
<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+16}}px">
<view class="bg"> <view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image> <glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view> </view>
......
...@@ -151,7 +151,51 @@ export function setPrice(price) { ...@@ -151,7 +151,51 @@ export function setPrice(price) {
if (!decimal) decimal = '00' if (!decimal) decimal = '00'
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}` return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}`
} }
/**精确加减 */
export function accAdd(arg1, arg2) {
var r1, r2, m;
try {
r1 = arg1.toString().split(".")[1].length;
}
catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
}
catch (e) {
r2 = 0;
}
m = Math.pow(10, Math.max(r1, r2));
return (arg1 * m + arg2 * m) / m;
}
/**
* 乘法函数,用来得到精确的乘法结果
* 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
* 调用:accMul(arg1,arg2)
* 返回值:arg1乘以 arg2的精确结果
**/
export const accMul = (arg1, arg2) => {
if (isNaN(arg1)) {
arg1 = 0;
}
if (isNaN(arg2)) {
arg2 = 0;
}
arg1 = Number(arg1);
arg2 = Number(arg2);
var m = 0,
s1 = arg1.toString(),
s2 = arg2.toString();
try {
m += s1.split(".")[1].length;
} catch (e) { }
try {
m += s2.split(".")[1].length;
} catch (e) { }
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
};
export function deleteSecond(time) { export function deleteSecond(time) {
console.log(time) console.log(time)
if (!time.length) return '' if (!time.length) return ''
......
...@@ -21,7 +21,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -21,7 +21,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 1 let index = 2
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!