yuantianjiao пре 6 година
родитељ
комит
2ceac3c003

BIN
public/favicon.ico Прегледај датотеку


+ 46
- 29
src/pages/user/mainPage/coffeeIndex/index.vue Прегледај датотеку

@@ -247,6 +247,7 @@ export default {
247 247
     }),
248 248
     ...mapCaseState({
249 249
       caseTotal: x => x.caseTotal,
250
+      choosedCase: x => x.choosedCase
250 251
     }),
251 252
     ...mapCardState({
252 253
       cardList: x => x.cardList
@@ -365,6 +366,7 @@ export default {
365 366
     ...mapCaseActions([
366 367
       'getCaseTotal',
367 368
       'getCaseConf',
369
+      'changeChoosedCase'
368 370
     ]),
369 371
     ...mapCardActions(['getCardList']),
370 372
     checkCanDo () {
@@ -413,6 +415,7 @@ export default {
413 415
         caseid: this.topCaseInfoData.caseId
414 416
       })
415 417
       this.showSelect = false
418
+      this.changeChoosedCase({ CaseName: val.CaseName, CaseId: val.CaseId })
416 419
     },
417 420
     cutNav (index) { // 切换nav
418 421
       this.navActive = index
@@ -498,41 +501,55 @@ export default {
498 501
           })
499 502
         }
500 503
       } 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({
504
+        // console.log(this.choosedCase)
505
+        if (this.choosedCase.CaseId) {
506
+          that.topCaseInfoData.caseName = this.choosedCase.CaseName
507
+          that.topCaseInfoData.caseId = this.choosedCase.CaseId
508
+          // that.getCaseTableList({
509
+          //   caseid: that.topCaseInfoData.caseId
510
+          // })
511
+          // if (this.userInfo.customer.MapUser !== '') {
512
+          //   that.getCaseTotal({
513
+          //     caseid: that.topCaseInfoData.caseId
514
+          //   })
515
+          // }
516
+        } else {
517
+          wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
518
+            title: '城的空间',
519
+            desc: '城的空间',
520
+            link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
521
+            thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
522
+          }).then(() => {
523
+            wx.getLocation({
524
+              type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
525
+              success: function (res) {
526
+                let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
527
+                let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
528
+                for (let i = 0; i < that.CaseList.length; i++) {
529
+                  let result = that.CaseList[i].Coordinate.split(",")
530
+                  let latitude2 = parseFloat(result[0])
531
+                  let longitude2 = parseFloat(result[1])
532
+                  if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
533
+                    that.topCaseInfoData.caseName = that.CaseList[i].CaseName
534
+                    that.topCaseInfoData.caseId = that.CaseList[i].CaseId
535
+                    that.getCaseTableList({
524 536
                       caseid: that.topCaseInfoData.caseId
525 537
                     })
538
+                    if (this.userInfo.customer.MapUser !== '') {
539
+                      that.getCaseTotal({
540
+                        caseid: that.topCaseInfoData.caseId
541
+                      })
542
+                    }
526 543
                   }
527 544
                 }
545
+                if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
546
+                  that.$toast('当前位置无案场')
547
+                  that.topCaseInfoData.caseName = '当前位置无案场'
548
+                }
528 549
               }
529
-              if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
530
-                that.$toast('当前位置无案场')
531
-                that.topCaseInfoData.caseName = '当前位置无案场'
532
-              }
533
-            }
550
+            })
534 551
           })
535
-        })
552
+        }
536 553
       }
537 554
     },
538 555
     beforeClose (action, done) {

+ 4
- 3
src/pages/user/mainPage/index.vue Прегледај датотеку

@@ -19,7 +19,7 @@
19 19
 </template>
20 20
 
21 21
 <script>
22
-import { mapState } from 'vuex'
22
+import { mapState, mapActions } from 'vuex'
23 23
 export default {
24 24
   name: '',
25 25
   data () {
@@ -48,8 +48,9 @@ export default {
48 48
     if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
49 49
       this.showTabBar = true
50 50
     }
51
-  },
52
-  methods: {
51
+    if (this.$route.query.hideTabbar){
52
+      sessionStorage.setItem('from','sales')
53
+    }
53 54
   }
54 55
 }
55 56
 </script>

+ 4
- 2
src/pages/user/placeOrder/index.vue Прегледај датотеку

@@ -275,13 +275,14 @@ export default {
275 275
       })
276 276
     },
277 277
     placeOrder (Remark) { // 下单
278
-      if(this.ajaxOff){
278
+      if (this.ajaxOff) {
279 279
         this.ajaxOff = false
280 280
         this.postData.info.OrgId = this.orgId
281 281
         this.postData.info.UserId = this.userInfo.CustomerId
282 282
         this.postData.info.UserName = this.userInfo.customer.CustomerName
283 283
         this.postData.info.PayType = 'sys user'
284 284
         this.postData.info.Remark = Remark
285
+        this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
285 286
         var orderInfo = this.selGoods
286 287
         this.postData.detail = []
287 288
         var amount = 0
@@ -304,7 +305,8 @@ export default {
304 305
         this.toPay({
305 306
           info: JSON.stringify(this.postData.info),
306 307
           detail: JSON.stringify(this.postData.detail),
307
-          coupon: JSON.stringify(this.postData.coupon)
308
+          customercouponid: JSON.stringify(this.postData.coupon) || '',
309
+          from: this.postData.from
308 310
         }).then((res) => {
309 311
           this.ajaxOff = true
310 312
           this.showCalcMenu = false

+ 2
- 1
src/pages/user/placeOrderDetail/index.vue Прегледај датотеку

@@ -237,7 +237,8 @@ export default {
237 237
         this.toPay({
238 238
           info: JSON.stringify(this.postData.info),
239 239
           detail: JSON.stringify(this.postData.detail),
240
-          customercouponid: this.postData.customercouponid
240
+          customercouponid: this.postData.customercouponid || '',
241
+          from: ''
241 242
         }).then((res) => {
242 243
           this.showSuccessPopup = true
243 244
           // this.$dialog.alert({

+ 8
- 1
src/store/case/case.js Прегледај датотеку

@@ -7,6 +7,7 @@ export default {
7 7
   state: {
8 8
     caseTotal: {},
9 9
     caseConf: {},
10
+    choosedCase: {}
10 11
   },
11 12
   mutations: {
12 13
     setCaseTotal (state, data) { // 获取案场下单数量信息
@@ -15,6 +16,9 @@ export default {
15 16
     setCaseConf (state, data) { // 获取案场下单数量信息
16 17
       state.caseConf = data
17 18
     },
19
+    setChoosedCase (state, data) { // 获取案场下单数量信息
20
+      state.choosedCase = data
21
+    },
18 22
   },
19 23
   actions: {
20 24
     getCaseTotal ({ commit }, { caseid }) {
@@ -32,7 +36,7 @@ export default {
32 36
         })
33 37
       })
34 38
     },
35
-    getCaseConf ({ commit },{ caseid }) {
39
+    getCaseConf ({ commit }, { caseid }) {
36 40
       return new Promise((resolve, reject) => {
37 41
         Ajax(api.case.conf.url, {
38 42
           method: api.case.conf.method,
@@ -46,6 +50,9 @@ export default {
46 50
           reject(err)
47 51
         })
48 52
       })
53
+    },
54
+    changeChoosedCase ({ commit }, data) {
55
+      commit("setChoosedCase", data)
49 56
     }
50 57
   }
51 58
 }

+ 2
- 1
src/store/placeOrderForCoffee/index.js Прегледај датотеку

@@ -63,7 +63,7 @@ export default {
63 63
         })
64 64
       })
65 65
     },
66
-    toPay (context, { info, detail, customercouponid }) { // 下单
66
+    toPay (context, { info, detail, customercouponid, from }) { // 下单
67 67
       return new Promise((resolve, reject) => {
68 68
         Ajax(api.caseForCoffee.placeGoodsOrder.url, {
69 69
           method: api.caseForCoffee.placeGoodsOrder.method,
@@ -71,6 +71,7 @@ export default {
71 71
             info,
72 72
             detail,
73 73
             customercouponid,
74
+            from
74 75
           },
75 76
         }).then(res => {
76 77
           resolve(res)

+ 1
- 0
vue.config.js Прегледај датотеку

@@ -34,6 +34,7 @@ module.exports = {
34 34
       },
35 35
     },
36 36
     // compress: true,
37
+    devtool: 'source-map',
37 38
     disableHostCheck: true,   // That solved it
38 39
   }
39 40
 }