Commit 78550792 by 杨明

fixed

1 parent 642d6a20
import { imgUrlMixin } from '~/mixins/index' import { imgUrlMixin } from '~/mixins/index'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
behaviors: [imgUrlMixin], behaviors: [imgUrlMixin],
properties: { properties: {
data: { data: {
type: Object, type: Object,
value: {}, value: {},
observer(v) { observer(v) {
if (v) { if (v) {
// 活动概览数据处理 // 活动概览数据处理
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)
this.setData({ data: v })
}
} }
console.log(v) },
this.setData({ data: v }) activityOverviewList: {
type: Array,
value: []
},
backStyle: {
type: Array,
value: []
},
textType: {
type: Number,
value: 0
} }
}
},
activityOverviewList: {
type: Array,
value: []
},
backStyle: {
type: Array,
value: []
}, },
textType: {
type: Number,
value: 0
}
},
/**
* 组件的初始数据
*/
data: {
textTypeList: ['', '当前排名:', '最终排名:']
},
/** /**
* 组件的方法列表 * 组件的初始数据
*/ */
methods: { data: {
// 实时战报 textTypeList: ['', '当前排名:', '最终排名:']
jumpReport(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
if(item.activityStatus == 2)
wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
else
wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item)
},
// 跳转
jump(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/visitor/visitor", { ...item })
},
jumpOutput(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
},
// 价格格式化
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位,让其数字后面加单位万
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) + '亿'
}
}, },
}
/**
* 组件的方法列表
*/
methods: {
// 实时战报
jumpReport(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
// if(item.activityStatus == 2)
// 不区分活动是否在进行中 有返回值就跳转
item.reportUrl && wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
// else
// wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item)
},
// 跳转
jump(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/visitor/visitor", { ...item })
},
jumpOutput(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
},
// 价格格式化
priceFormat(num, point = 2) {
let numStr = (num / 100).toString().split('.')[0]
return numStr;
},
// 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 })
......
...@@ -4,119 +4,121 @@ import index_const from "~/packagesList/outDetail/index_const" ...@@ -4,119 +4,121 @@ import index_const from "~/packagesList/outDetail/index_const"
import { commentTime } from '~/utils/format' import { commentTime } from '~/utils/format'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list: [], list: [],
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
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
}, },
onRoute(options) { onRoute(options) {
let activityId = options.activityId wx.showLoading()
ActivityApi.getActivityVisitorList({ let activityId = options.activityId
activityId, ActivityApi.getActivityVisitorList({
staffFlag:true activityId,
}).then(res => { staffFlag: true
res.visitorList && res.visitorList.forEach(val => { }).then(res => {
val.lastVisitFormatTime = commentTime(val.lastVisitDate) res.visitorList && res.visitorList.forEach(val => {
if(!val.customerPhone&&val.guestId){ val.lastVisitFormatTime = commentTime(val.lastVisitDate)
val.gId = (val.guestId.split('_')).pop() || '' if (!val.customerPhone && val.guestId) {
val.gId = (val.guestId.split('_')).pop() || ''
}
})
this.setData({
allNum: res.visitorTotal,
todayNum: res.todayTotal,
list: res.visitorList
})
wx.hideLoading()
})
},
toCopyName(e) {
const { name } = e.currentTarget.dataset
if (name) {
wx.setClipboardData({
data: name
})
} }
}) },
this.setData({
allNum: res.visitorTotal, // 打电话
todayNum: res.todayTotal, callPhone(e) {
list: res.visitorList let { mobile } = e.currentTarget.dataset
}) wx.makePhoneCall({
}) phoneNumber: mobile.toString()
},
toCopyName(e){
const {name} = e.currentTarget.dataset
if(name){
wx.setClipboardData({
data: name
})
}
},
// 打电话
callPhone(e) {
let { mobile } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: mobile.toString()
})
},
// 复制微信号
copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success (res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
}) })
} },
}) // 复制微信号
}, copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success(res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
})
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -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!