|
@@ -3,14 +3,14 @@
|
3
|
3
|
<div class="top">
|
4
|
4
|
<topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
|
5
|
5
|
</div>
|
6
|
|
- <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
|
|
6
|
+ <nav class="flex-h" v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">
|
7
|
7
|
<a class="flex-item" v-for="(item,index) in cutNavList" :key="index" v-if="userInfo.customer.UserTypeId !== 'manager' || item.id !== '4'" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
|
8
|
8
|
</nav>
|
9
|
9
|
<div class="content">
|
10
|
10
|
<div>
|
11
|
11
|
<ul>
|
12
|
12
|
<li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
|
13
|
|
- <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== ''">
|
|
13
|
+ <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">
|
14
|
14
|
<div class="flex-item">
|
15
|
15
|
<div>
|
16
|
16
|
<span>共计已使用:{{caseTotal.total}}杯</span>
|
|
@@ -146,6 +146,7 @@ export default {
|
146
|
146
|
name: '',
|
147
|
147
|
data () {
|
148
|
148
|
return {
|
|
149
|
+ fromPage: '',
|
149
|
150
|
myRecommendUserList: [],
|
150
|
151
|
forbidList: [],
|
151
|
152
|
postCustomerData: {
|
|
@@ -247,6 +248,7 @@ export default {
|
247
|
248
|
}),
|
248
|
249
|
...mapCaseState({
|
249
|
250
|
caseTotal: x => x.caseTotal,
|
|
251
|
+ choosedCase: x => x.choosedCase
|
250
|
252
|
}),
|
251
|
253
|
...mapCardState({
|
252
|
254
|
cardList: x => x.cardList
|
|
@@ -260,7 +262,8 @@ export default {
|
260
|
262
|
noMore
|
261
|
263
|
},
|
262
|
264
|
created () {
|
263
|
|
- if (!this.userInfo.customer.MapUser) {
|
|
265
|
+ this.fromPage = sessionStorage.getItem('from')
|
|
266
|
+ if (!this.userInfo.customer.MapUser || (this.userInfo.customer.MapUser && this.fromPage !== 'sales')) {
|
264
|
267
|
this.topCaseInfoData.ShowSelect = true
|
265
|
268
|
}
|
266
|
269
|
if (this.userInfo.customer.MapUser !== '') {
|
|
@@ -365,6 +368,7 @@ export default {
|
365
|
368
|
...mapCaseActions([
|
366
|
369
|
'getCaseTotal',
|
367
|
370
|
'getCaseConf',
|
|
371
|
+ 'changeChoosedCase'
|
368
|
372
|
]),
|
369
|
373
|
...mapCardActions(['getCardList']),
|
370
|
374
|
checkCanDo () {
|
|
@@ -413,6 +417,7 @@ export default {
|
413
|
417
|
caseid: this.topCaseInfoData.caseId
|
414
|
418
|
})
|
415
|
419
|
this.showSelect = false
|
|
420
|
+ this.changeChoosedCase({ CaseName: val.CaseName, CaseId: val.CaseId })
|
416
|
421
|
},
|
417
|
422
|
cutNav (index) { // 切换nav
|
418
|
423
|
this.navActive = index
|
|
@@ -498,41 +503,55 @@ export default {
|
498
|
503
|
})
|
499
|
504
|
}
|
500
|
505
|
} else {
|
501
|
|
- wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
|
502
|
|
- title: '城的空间',
|
503
|
|
- desc: '城的空间',
|
504
|
|
- link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
|
505
|
|
- thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
|
506
|
|
- }).then(() => {
|
507
|
|
- wx.getLocation({
|
508
|
|
- type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
509
|
|
- success: function (res) {
|
510
|
|
- let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
|
511
|
|
- let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
|
512
|
|
- for (let i = 0; i < that.CaseList.length; i++) {
|
513
|
|
- let result = that.CaseList[i].Coordinate.split(",")
|
514
|
|
- let latitude2 = parseFloat(result[0])
|
515
|
|
- let longitude2 = parseFloat(result[1])
|
516
|
|
- if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
|
517
|
|
- that.topCaseInfoData.caseName = that.CaseList[i].CaseName
|
518
|
|
- that.topCaseInfoData.caseId = that.CaseList[i].CaseId
|
519
|
|
- that.getCaseTableList({
|
520
|
|
- caseid: that.topCaseInfoData.caseId
|
521
|
|
- })
|
522
|
|
- if (this.userInfo.customer.MapUser !== '') {
|
523
|
|
- that.getCaseTotal({
|
|
506
|
+ // console.log(this.choosedCase)
|
|
507
|
+ if (this.choosedCase.CaseId) {
|
|
508
|
+ that.topCaseInfoData.caseName = this.choosedCase.CaseName
|
|
509
|
+ that.topCaseInfoData.caseId = this.choosedCase.CaseId
|
|
510
|
+ // that.getCaseTableList({
|
|
511
|
+ // caseid: that.topCaseInfoData.caseId
|
|
512
|
+ // })
|
|
513
|
+ // if (this.userInfo.customer.MapUser !== '') {
|
|
514
|
+ // that.getCaseTotal({
|
|
515
|
+ // caseid: that.topCaseInfoData.caseId
|
|
516
|
+ // })
|
|
517
|
+ // }
|
|
518
|
+ } else {
|
|
519
|
+ wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
|
|
520
|
+ title: '城的空间',
|
|
521
|
+ desc: '城的空间',
|
|
522
|
+ link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
|
|
523
|
+ thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
|
|
524
|
+ }).then(() => {
|
|
525
|
+ wx.getLocation({
|
|
526
|
+ type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|
527
|
+ success: function (res) {
|
|
528
|
+ let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
|
|
529
|
+ let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
|
|
530
|
+ for (let i = 0; i < that.CaseList.length; i++) {
|
|
531
|
+ let result = that.CaseList[i].Coordinate.split(",")
|
|
532
|
+ let latitude2 = parseFloat(result[0])
|
|
533
|
+ let longitude2 = parseFloat(result[1])
|
|
534
|
+ if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
|
|
535
|
+ that.topCaseInfoData.caseName = that.CaseList[i].CaseName
|
|
536
|
+ that.topCaseInfoData.caseId = that.CaseList[i].CaseId
|
|
537
|
+ that.getCaseTableList({
|
524
|
538
|
caseid: that.topCaseInfoData.caseId
|
525
|
539
|
})
|
|
540
|
+ if (this.userInfo.customer.MapUser !== '') {
|
|
541
|
+ that.getCaseTotal({
|
|
542
|
+ caseid: that.topCaseInfoData.caseId
|
|
543
|
+ })
|
|
544
|
+ }
|
526
|
545
|
}
|
527
|
546
|
}
|
|
547
|
+ if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
|
|
548
|
+ that.$toast('当前位置无案场')
|
|
549
|
+ that.topCaseInfoData.caseName = '当前位置无案场'
|
|
550
|
+ }
|
528
|
551
|
}
|
529
|
|
- if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
|
530
|
|
- that.$toast('当前位置无案场')
|
531
|
|
- that.topCaseInfoData.caseName = '当前位置无案场'
|
532
|
|
- }
|
533
|
|
- }
|
|
552
|
+ })
|
534
|
553
|
})
|
535
|
|
- })
|
|
554
|
+ }
|
536
|
555
|
}
|
537
|
556
|
},
|
538
|
557
|
beforeClose (action, done) {
|
|
@@ -545,7 +564,7 @@ export default {
|
545
|
564
|
toOrders (subItem, item) {
|
546
|
565
|
const _that = this
|
547
|
566
|
this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
|
548
|
|
- if (this.checkCanOrder()) {
|
|
567
|
+ if (this.checkCanOrder() && sessionStorage.getItem('from') === 'sales') {
|
549
|
568
|
_that.$toast('您的点单功能已被关闭!')
|
550
|
569
|
return
|
551
|
570
|
}
|