index.vue
8.05 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<template>
<view class="container" @click="handleTouchStart">
<view :class="['home', { show: !id && showHome }]">
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="$emit('changeTab', $event)" @stopAudio="stopAudio" />
<view class="right-side">
<template v-if="tabIndex == 0">
<view class="right-content">
<view class="start" @click="$emit('start')">
<image class="start-btn" src="../../assets/images/home/start.gif" alt="开始接待" />
<image class="start-border" src="../../assets/images/home/start-border.png" />
</view>
<view class="module-list">
<slot name="module" />
</view>
</view>
</template>
<template v-else>
<component :is="componentName" :userInfo="userInfo" @showPage="handleShowPage" />
</template>
<view class="store-addr" v-if="footerBox">
<view class="icon-addr sprite-icon icon-addr"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
</view>
</view>
<view :class="['detail', { show: id }]">
<slot name="detail" />
</view>
<view class="point-page" v-if="!showHome">
<component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" />
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox ref="previewRef" @confirm="$emit('preview')" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="$emit('previewCancel')" @close="$emit('previewClose')"></MessageBox>
<!-- 停留弹框 -->
<!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> -->
<!-- 退出弹框 -->
<MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
<template v-else>
完成接待
<text>(推荐)</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
仍要退出
<text>(不推荐)</text>
</view>
</view>
</MessageBox>
<!-- 升级弹框 -->
<update-box />
<slot name="content" />
<web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view>
</view>
</template>
<script>
import RecordList from './components/RecordList.vue'
// import myClick from '@/mixin/click'
import timeout from '@/mixin/timeout'
import recorder from '@/mixin/record/recorder'
import uploader from '@/mixin/record/uploader.js'
import versionCheck from '@/mixin/versionCheck.js'
import CustomerFile from './components/CustomerFile.vue'
import LeftSide from './components/LeftSide.vue'
import Point from './components/Point.vue'
import dayPoint from './components/Point/DayPoint.vue'
import rulePoint from './components/Point/RulePoint.vue'
import LevelPoint from './components/Point/LevelPoint.vue'
import Course from './components/Point/Course.vue'
import Ranking from './components/Point/Ranking.vue'
import Calendar from './components/Income/Calendar.vue'
import Promotion from './components/Income/Promotion.vue'
import History from './components/Income/History.vue'
import merge from '@/mixin/record/merge.js'
export default {
mixins: [recorder, uploader, timeout, versionCheck, merge],
components: { RecordList, CustomerFile, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History },
props: {
id: [String, Number],
finishDoneText: String,
finishContene: {
type: String,
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
},
data() {
return {
transfer: '',
footerBox: true,
showHome: true,
pointComponentName: 'Point',
userInfo: {},
tabIndex: 0
}
},
mounted() {
const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo
this.checkVersion()
},
provide() {
return {
showPage: this.handleShowPage,
hideFooter: this.handleFooter
}
},
computed: {
previewRef() {
return this.$refs.previewRef
},
finishRef() {
return this.$refs.finish
},
componentName() {
console.log(this.$refs.leftBox.tabs, this.tabIndex, this.$refs.leftBox.tabs[this.tabIndex].name)
return this.$refs.leftBox.tabs[this.tabIndex].name
}
},
methods: {
handleFooter(val) {
this.footerBox = val
},
backHome() {
this.showHome = true
},
jump(val) {
this.showHome = true
if (val == 'CustomerFile') {
this.tabIndex = 2
return
}
this.$emit('start')
},
handleShowPage(name, transfer) {
this.transfer = transfer
this.showHome = false
this.pointComponentName = name
}
}
}
</script>
<style scoped lang="scss">
.container {
position: relative;
&::after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/home-bg.webp');
background-size: 100% 100%;
}
.home,
.detail {
position: fixed;
width: 100%;
height: 100%;
z-index: -1;
top: 0;
left: 0;
visibility: hidden;
}
.point-page {
position: fixed;
width: 100%;
height: 100%;
z-index: 1;
top: 0;
left: 0;
}
.home {
display: flex;
height: 100vh;
}
.show {
position: absolute;
z-index: 1;
visibility: visible;
animation: show-content-left 0.15s forwards;
}
}
@keyframes show-content-left {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.right-side {
flex: 1;
position: relative;
width: calc(100vw - #{toRpx(240)});
.right-content {
padding-top: toRpx(92);
height: 100vh;
box-sizing: border-box;
position: relative;
animation: show-box 0.15s forwards;
overflow: hidden;
}
@keyframes show-box {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.start {
&-btn {
width: 100%;
height: 100%;
}
&-border {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
vertical-align: top;
}
height: toRpx(336);
box-sizing: border-box;
margin-right: toRpx(64);
position: relative;
padding: toRpx(32);
}
.module-list {
height: calc(100% - #{toRpx(336)});
}
.store-addr {
position: absolute;
left: 50%;
bottom: toRpx(24);
transform: translateX(-50%);
display: flex;
align-items: center;
margin-top: toRpx(38);
.icon-addr {
width: toRpx(32);
height: toRpx(32);
flex-shrink: 0;
}
.addr-text {
font-size: toRpx(24);
color: #999999;
word-wrap: break-word;
white-space: normal;
line-height: toRpx(32);
margin-left: toRpx(4);
flex-shrink: 0;
}
&::before,
&::after {
content: '';
width: toRpx(600);
height: toRpx(2);
margin: 0 toRpx(40);
}
&::before {
background-image: linear-gradient(270deg, #eeeeee 0%, #d8d8d800 100%);
}
&::after {
background-image: linear-gradient(90deg, #eeeeee 0%, #d8d8d800 100%);
}
}
}
.footer {
border-top: toRpx(2) solid #eff0f2;
font-weight: 600;
font-size: toRpx(32);
margin-top: toRpx(48);
.footer-btn {
justify-content: center;
margin: toRpx(16) auto 0;
}
.confirm {
width: toRpx(608);
height: toRpx(80);
background: #2c66f7;
border-radius: toRpx(40);
color: #fff;
}
.cancel {
width: toRpx(608);
height: toRpx(80);
background: #ffffff00;
border-radius: toRpx(40);
color: #2c66f7;
}
text {
font-size: toRpx(24);
}
}
</style>