Commit 78550792 by 杨明

fixed

1 parent 642d6a20
...@@ -14,13 +14,13 @@ Component({ ...@@ -14,13 +14,13 @@ Component({
let s = v let s = v
v.overviewData = { // 活动中 v.overviewData = { // 活动中
browseData: { browseData: {
all: { title: '总浏览', num: s.browsCount} all: { title: '总浏览', num: s.browsCount }
}, },
shareData: { shareData: {
all: { title: '产值(总)/元', num: this.priceFormat(s.realAmount || 0), unit: '¥' } all: { title: '产值(总)/元', num: this.priceFormat(s.realAmount || 0), unit: '¥' }
}, },
visitorData: { visitorData: {
all: { title: '总访客', num: s.visitCount}, all: { title: '总访客', num: s.visitCount },
}, },
} }
console.log(v) console.log(v)
...@@ -57,12 +57,13 @@ Component({ ...@@ -57,12 +57,13 @@ 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) // if(item.activityStatus == 2)
wx.navigateTo({ // 不区分活动是否在进行中 有返回值就跳转
item.reportUrl && wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`, url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
}); });
else // else
wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item) // wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item)
}, },
// 跳转 // 跳转
jump(e) { jump(e) {
...@@ -75,19 +76,22 @@ Component({ ...@@ -75,19 +76,22 @@ Component({
}, },
// 价格格式化 // 价格格式化
priceFormat(num, point = 2) { priceFormat(num, point = 2) {
let numStr = (num/100).toString().split('.')[0] let numStr = (num / 100).toString().split('.')[0]
if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
return numStr; return numStr;
} else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
point = 0
let decimal = numStr.substring(numStr.length - 4, numStr.length - 4 + point)
console.log(decimal);
// 由千位,百位组成的一个数字
return parseFloat(parseInt(num / 10000) + '.' + decimal) + '万'
} else if (numStr.length > 8) { // 如果数字大于8位,让其数字后面加单位亿
let decimal = numStr.substring(numStr.length - 8, numStr.length - 8 + point);
return parseFloat(parseInt(num / 100000000) + '.' + decimal) + '亿'
}
}, },
// priceFormat(num, point = 2) {
// let numStr = (num/100).toString().split('.')[0]
// if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
// return numStr;
// } else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
// let decimal = numStr.substring(numStr.length - 4, numStr.length - 4 + point)
// console.log(decimal);
// // 由千位,百位组成的一个数字
// return parseFloat(parseInt(numStr / 10000) + '.' + decimal) + '万'
// } else if (numStr.length > 8) { // 如果数字大于8位,让其数字后面加单位亿
// let decimal = numStr.substring(numStr.length - 8, numStr.length - 8 + point);
// return parseFloat(parseInt(numStr / 100000000) + '.' + decimal) + '亿'
// }
// }
} }
}) })
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
image { image {
object-fit: cover; object-fit: cover;
background-size: 100% auto; background-size: 100% 100%;
} }
} }
......
...@@ -13,8 +13,8 @@ Component({ ...@@ -13,8 +13,8 @@ Component({
{ title: '订单量', num: s.orderCount } { title: '订单量', num: s.orderCount }
] ]
v.sortList = [ v.sortList = [
{ title: '访客率', sort: s.fansRate }, { title: '访客率', sort: Number(s.fansRate).toFixed(2) },
{ title: '转化率', sort: s.conversionRate } { title: '转化率', sort: Number(s.conversionRate).toFixed(2) }
] ]
} }
this.setData({ data: v }) this.setData({ data: v })
......
...@@ -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,14 +23,15 @@ Page({ ...@@ -23,14 +23,15 @@ Page({
}, },
onRoute(options) { onRoute(options) {
wx.showLoading()
let activityId = options.activityId let activityId = options.activityId
ActivityApi.getActivityVisitorList({ ActivityApi.getActivityVisitorList({
activityId, activityId,
staffFlag:true staffFlag: true
}).then(res => { }).then(res => {
res.visitorList && res.visitorList.forEach(val => { res.visitorList && res.visitorList.forEach(val => {
val.lastVisitFormatTime = commentTime(val.lastVisitDate) val.lastVisitFormatTime = commentTime(val.lastVisitDate)
if(!val.customerPhone&&val.guestId){ if (!val.customerPhone && val.guestId) {
val.gId = (val.guestId.split('_')).pop() || '' val.gId = (val.guestId.split('_')).pop() || ''
} }
}) })
...@@ -39,11 +40,12 @@ Page({ ...@@ -39,11 +40,12 @@ Page({
todayNum: res.todayTotal, todayNum: res.todayTotal,
list: res.visitorList list: res.visitorList
}) })
wx.hideLoading()
}) })
}, },
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 +64,7 @@ Page({ ...@@ -62,7 +64,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"
......
...@@ -92,5 +92,6 @@ ...@@ -92,5 +92,6 @@
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
"tabSize": 2 "tabSize": 2
} },
"libVersion": "2.31.0"
} }
\ 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!