index.js
4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import api from '~/subvehicleConversion/api'
import NP from 'number-precision'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({
properties: {
navBarHeight: Number
},
data: {
IMG_URL,
productionValueList: [
{title: '当日访客', num: '2', imgName: 'icon_5',valueName:'todayfansCount'},
{title: '当日订单', num: '3', imgName: 'icon_4',valueName:'todayOrderCount'},
{title: '当日产值', num: '4', imgName: 'icon_3',valueName:'todayAmount'},
{title: '累计访客', num: '5', imgName: 'icon_10',valueName:'totalfansCount'},
{title: '累计订单', num: '6', imgName: 'icon_9',valueName:'totalOrderCount'},
{title: '累计产值', num: '1', imgName: 'icon_8',valueName:'totalAmount'}
],
businessDevelopmentList: [
{title: '调查问卷', imgName: 'questionnaire', isOpen: false},
{title: '营销素材', imgName: 'marketingMaterial', isOpen: false},
{title: '业务申请', imgName: 'businessApplication', isOpen: false},
],
exhibitionToolsList: [
{title: '调查问卷', icon: 'questionnaire', isOpen: false},
{title: '营销素材', icon: 'marketing_materials', isOpen: false},
{title: '业务申请', icon: 'business_application', isOpen: false},
{title: '活动管理', icon: 'event_management', isOpen: true,path:'activityManagement', isTab: true, tabIndex: 2},
// {title: '话术库', icon: 'script _library', isOpen: false},
{title: '订单补录', icon: 'supplementary_order', isOpen: true, path: 'supplementaryOrderList', isTab: true, tabIndex: 1}
],
staticDataList: [{
label: '今日营业额',
value: 'todayAmount',
tipsLabel: '今日成交量',
tipsValue: 'todayOrderCount'
}, {
label: '本月营业额',
value: 'monthAmount',
tipsLabel: '本月成交量',
tipsValue: 'monthOrderCount'
}, {
label: '累计营业额',
value: 'totalAmount',
tipsLabel: '累计成交量',
tipsValue: 'totalOrderCount'
}],
conversionList: {},
staticData: {}
},
lifetimes: {
attached() {
this.onLoad()
}
},
methods: {
clickTap(e) {
const {item} = e.currentTarget.dataset
const thisPage = wx.$router.getPageInstance()
const {isOpen,path, isTab, tabIndex} = item
if (!isOpen) {
wx.showToast({
// image:'../../images/funel.png',
title: `模块暂未开通\r\n敬请期待`,
icon:'none',
})
return
}
if (isTab) return thisPage.changeTabBar && thisPage.changeTabBar({detail: tabIndex})
wx.$router.go(path)
},
onLoad() {
const params = {
merchantId: wx.$util.getUserInfo()?.default4SStoreInfo_newCarConversion?.merchantId || ''
}
if (!params.merchantId) return
api.getHomeStaticData(params).then(res => {
if (res.code == 0) {
if (res.data?.totalAmount) {
res.data.totalAmount = NP.divide(res.data.totalAmount,100)
}
if (res.data?.monthAmount) {
res.data.monthAmount = NP.divide(res.data.monthAmount,100)
}
if (res.data?.todayAmount) {
res.data.todayAmount = NP.divide(res.data.todayAmount,100)
}
this.setData({
conversionList: res.data
})
} else {
wx.$util.showToast(res.message)
}
})
// api.summaryOfOutputValueList(params).then(res => {
// if (res.code == 0) {
// if (res.data?.totalOutputValue) {
// res.data.totalOutputValue = NP.divide(res.data.totalOutputValue,100)
// }
// if (res.data?.todayOutputValue) {
// res.data.todayOutputValue = NP.divide(res.data.todayOutputValue,100)
// }
// if (res.data?.monthOutputValue) {
// res.data.monthOutputValue = NP.divide(res.data.monthOutputValue,100)
// }
// this.setData({
// conversionList: res.data
// })
// }
// })
},
}
});