Pārlūkot izejas kodu

Merge branch '2.0.1' of http://git.ycjcjy.com/SpaceOfCheng/wechat into 2.0.1

许成详 6 gadus atpakaļ
vecāks
revīzija
6b5ab718cd

Binārs
public/favicon.ico Parādīt failu


+ 1
- 1
src/pages/sales/salesGiveOutDetail/index.vue Parādīt failu

@@ -28,7 +28,7 @@
28 28
                   </div>
29 29
                   <div class="flex-item">
30 30
                     <div>
31
-                      <span>¥{{item.Price}} * 1</span>
31
+                      <span>¥{{item.Price}} * {{item.Number}}</span>
32 32
                     </div>
33 33
                   </div>
34 34
                   <span>{{toolClass.dateFormat(item.CreateDate, 'yyyy/MM/dd hh:mm')}}</span>

+ 1
- 10
src/pages/user/App.vue Parādīt failu

@@ -6,16 +6,13 @@
6 6
 
7 7
 <script>
8 8
 import '../../common/css/reset.css'
9
-import logo from '../../common/icon/indexlogo.jpg'
10
-import wxsdk from '../../util/share'
11 9
 import { mapState, createNamespacedHelpers } from 'vuex'
12 10
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
13 11
 export default {
14 12
   name: 'app',
15 13
   data () {
16 14
     return {
17
-      showPage: false,
18
-      logo
15
+      showPage: false
19 16
     }
20 17
   },
21 18
   components: {},
@@ -34,12 +31,6 @@ export default {
34 31
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
35 32
       this.showPage = true
36 33
     })
37
-    // wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
38
-    //   title: '城的空间',
39
-    //   desc: '城的空间',
40
-    //   link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
41
-    //   thu_image: `https://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/citymini%2Findexlogo.jpg`
42
-    // })
43 34
   },
44 35
   methods: {
45 36
     ...actions(['getUserInfo'])

+ 52
- 33
src/pages/user/mainPage/coffeeIndex/index.vue Parādīt failu

@@ -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
         }

+ 4
- 3
src/pages/user/mainPage/index.vue Parādīt failu

@@ -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>

+ 3
- 1
src/pages/user/mainPage/userCenter/index.vue Parādīt failu

@@ -86,6 +86,8 @@ export default {
86 86
       this.user = this.userInfo.customer
87 87
       if (this.user.AccountInfo) {
88 88
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
89
+
90
+        
89 91
       }
90 92
       this.headimgurl = this.user.Headimgurl
91 93
     })
@@ -109,7 +111,7 @@ export default {
109 111
       this.$router.push({ name: 'bindMobile' })
110 112
     },
111 113
     toGoodsOrder () {
112
-      this.$router.push({ name: 'orderList' })
114
+      this.$router.push({ name: 'orderList', query: { from: 'c' } })
113 115
     },
114 116
     toBodyCheck () {
115 117
       var url = window.location.pathname

+ 4
- 1
src/pages/user/majorProjects/index.vue Parādīt failu

@@ -7,7 +7,7 @@
7 7
             <img :src='item.CaseImageUrl' class="cover" alt="">
8 8
           </swiper-slide>
9 9
         </swiper> -->
10
-        <img :src="projectInfo.CmsCaseImgs[0].CaseImageUrl" alt="">
10
+        <img :src="cover" alt="" class="cover">
11 11
       </div>
12 12
     </div>
13 13
     <p>{{projectInfo.DetailContent}}</p>
@@ -69,6 +69,7 @@ export default {
69 69
       },
70 70
       courseList: [], // 课程列表
71 71
       initList: [],
72
+      cover:''
72 73
     }
73 74
   },
74 75
   computed: {
@@ -141,6 +142,8 @@ export default {
141 142
             endDate: new Date(res.Courses[n].EndDate).getTime(),
142 143
           })
143 144
         }
145
+        this.cover = res.CmsCaseImgs.filter(item => item.ImageType === 'cover')[0].CaseImageUrl
146
+        console.log(this.cover)
144 147
         console.log(aArr)
145 148
         this.initList = aArr
146 149
         this.calcArr()

+ 1
- 0
src/pages/user/orderList/index.vue Parādīt failu

@@ -79,6 +79,7 @@ export default {
79 79
     this.getCustomerGoodsOrder({
80 80
       page: this.page,
81 81
       pagesize: this.pagesize,
82
+      from: this.$route.query.from || ''
82 83
     }).then((res) => {
83 84
       // console.log(JSON.stringify(res))
84 85
       if(res.list === null){

+ 9
- 4
src/pages/user/placeOrder/index.vue Parādīt failu

@@ -16,7 +16,7 @@
16 16
         <div class="flex-item">
17 17
           <div>
18 18
             <span>桌号:{{tableNo}}</span>
19
-            <span v-if="userInfo.customer.MapUser !== ''">本月已用:{{caseTotal.monthtotal}}杯</span>
19
+            <span v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">本月已用:{{caseTotal.monthtotal}}杯</span>
20 20
           </div>
21 21
         </div>
22 22
         <a @click="reback">返回选择桌号</a>
@@ -185,6 +185,7 @@ export default {
185 185
     calcMenu,
186 186
   },
187 187
   created () {
188
+    this.fromPage = sessionStorage.getItem('from')
188 189
     this.getGoodsTypeList({
189 190
       caseid: this.caseId,
190 191
     }).then((res) => {
@@ -213,7 +214,7 @@ export default {
213 214
     ]),
214 215
     toPlaceOrder () { // 下单 
215 216
       if (this.selGoods.length) {
216
-        if (this.userInfo.customer.MapUser === '') {
217
+        if (this.userInfo.customer.MapUser === '' || (this.userInfo.customer.MapUser !== '' && sessionStorage.getItem('from') !== 'sales')) {
217 218
           this.$router.push({ name: 'placeOrderDetail', query: { info: JSON.stringify(this.selGoods), caseid: encodeURI(this.caseId), areaid: encodeURI(this.areaId), areaname: encodeURI(this.areaName), areaid: encodeURI(this.areaId), tableid: encodeURI(this.tableId), tableno: encodeURI(this.tableNo) } })
218 219
         } else {
219 220
           this.showCalcMenu = true
@@ -275,13 +276,14 @@ export default {
275 276
       })
276 277
     },
277 278
     placeOrder (Remark) { // 下单
278
-      if(this.ajaxOff){
279
+      if (this.ajaxOff) {
279 280
         this.ajaxOff = false
280 281
         this.postData.info.OrgId = this.orgId
281 282
         this.postData.info.UserId = this.userInfo.CustomerId
282 283
         this.postData.info.UserName = this.userInfo.customer.CustomerName
283 284
         this.postData.info.PayType = 'sys user'
284 285
         this.postData.info.Remark = Remark
286
+        this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
285 287
         var orderInfo = this.selGoods
286 288
         this.postData.detail = []
287 289
         var amount = 0
@@ -304,7 +306,8 @@ export default {
304 306
         this.toPay({
305 307
           info: JSON.stringify(this.postData.info),
306 308
           detail: JSON.stringify(this.postData.detail),
307
-          coupon: JSON.stringify(this.postData.coupon)
309
+          customercouponid: '',
310
+          from: this.postData.from
308 311
         }).then((res) => {
309 312
           this.ajaxOff = true
310 313
           this.showCalcMenu = false
@@ -315,6 +318,8 @@ export default {
315 318
           // }).then(() => {
316 319
 
317 320
           // })
321
+        }).catch(() => {
322
+          this.ajaxoff = true
318 323
         })
319 324
       }
320 325
     },

+ 3
- 2
src/pages/user/placeOrderDetail/index.vue Parādīt failu

@@ -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({
@@ -246,7 +247,7 @@ export default {
246 247
           //   window.history.go(-2)
247 248
           // })
248 249
         }).catch(() => {
249
-          // this.ajaxoff = true
250
+          this.ajaxoff = true
250 251
         })
251 252
       }
252 253
     },

+ 8
- 1
src/store/case/case.js Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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
 }