Explorar el Código

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

许成详 hace 6 años
padre
commit
6b5ab718cd

BIN
public/favicon.ico Ver fichero


+ 1
- 1
src/pages/sales/salesGiveOutDetail/index.vue Ver fichero

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

+ 1
- 10
src/pages/user/App.vue Ver fichero

6
 
6
 
7
 <script>
7
 <script>
8
 import '../../common/css/reset.css'
8
 import '../../common/css/reset.css'
9
-import logo from '../../common/icon/indexlogo.jpg'
10
-import wxsdk from '../../util/share'
11
 import { mapState, createNamespacedHelpers } from 'vuex'
9
 import { mapState, createNamespacedHelpers } from 'vuex'
12
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
10
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
13
 export default {
11
 export default {
14
   name: 'app',
12
   name: 'app',
15
   data () {
13
   data () {
16
     return {
14
     return {
17
-      showPage: false,
18
-      logo
15
+      showPage: false
19
     }
16
     }
20
   },
17
   },
21
   components: {},
18
   components: {},
34
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
31
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
35
       this.showPage = true
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
   methods: {
35
   methods: {
45
     ...actions(['getUserInfo'])
36
     ...actions(['getUserInfo'])

+ 52
- 33
src/pages/user/mainPage/coffeeIndex/index.vue Ver fichero

3
     <div class="top">
3
     <div class="top">
4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
5
     </div>
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
       <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>
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
     </nav>
8
     </nav>
9
       <div class="content">
9
       <div class="content">
10
         <div>
10
         <div>
11
           <ul>
11
           <ul>
12
             <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
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
                 <div class="flex-item">
14
                 <div class="flex-item">
15
                   <div>
15
                   <div>
16
                     <span>共计已使用:{{caseTotal.total}}杯</span>
16
                     <span>共计已使用:{{caseTotal.total}}杯</span>
146
   name: '',
146
   name: '',
147
   data () {
147
   data () {
148
     return {
148
     return {
149
+      fromPage: '',
149
       myRecommendUserList: [],
150
       myRecommendUserList: [],
150
       forbidList: [],
151
       forbidList: [],
151
       postCustomerData: {
152
       postCustomerData: {
247
     }),
248
     }),
248
     ...mapCaseState({
249
     ...mapCaseState({
249
       caseTotal: x => x.caseTotal,
250
       caseTotal: x => x.caseTotal,
251
+      choosedCase: x => x.choosedCase
250
     }),
252
     }),
251
     ...mapCardState({
253
     ...mapCardState({
252
       cardList: x => x.cardList
254
       cardList: x => x.cardList
260
     noMore
262
     noMore
261
   },
263
   },
262
   created () {
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
       this.topCaseInfoData.ShowSelect = true
267
       this.topCaseInfoData.ShowSelect = true
265
     }
268
     }
266
     if (this.userInfo.customer.MapUser !== '') {
269
     if (this.userInfo.customer.MapUser !== '') {
365
     ...mapCaseActions([
368
     ...mapCaseActions([
366
       'getCaseTotal',
369
       'getCaseTotal',
367
       'getCaseConf',
370
       'getCaseConf',
371
+      'changeChoosedCase'
368
     ]),
372
     ]),
369
     ...mapCardActions(['getCardList']),
373
     ...mapCardActions(['getCardList']),
370
     checkCanDo () {
374
     checkCanDo () {
413
         caseid: this.topCaseInfoData.caseId
417
         caseid: this.topCaseInfoData.caseId
414
       })
418
       })
415
       this.showSelect = false
419
       this.showSelect = false
420
+      this.changeChoosedCase({ CaseName: val.CaseName, CaseId: val.CaseId })
416
     },
421
     },
417
     cutNav (index) { // 切换nav
422
     cutNav (index) { // 切换nav
418
       this.navActive = index
423
       this.navActive = index
498
           })
503
           })
499
         }
504
         }
500
       } else {
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
                       caseid: that.topCaseInfoData.caseId
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
     beforeClose (action, done) {
557
     beforeClose (action, done) {
545
     toOrders (subItem, item) {
564
     toOrders (subItem, item) {
546
       const _that = this
565
       const _that = this
547
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
566
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
548
-        if (this.checkCanOrder()) {
567
+        if (this.checkCanOrder() && sessionStorage.getItem('from') === 'sales') {
549
           _that.$toast('您的点单功能已被关闭!')
568
           _that.$toast('您的点单功能已被关闭!')
550
           return
569
           return
551
         }
570
         }

+ 4
- 3
src/pages/user/mainPage/index.vue Ver fichero

19
 </template>
19
 </template>
20
 
20
 
21
 <script>
21
 <script>
22
-import { mapState } from 'vuex'
22
+import { mapState, mapActions } from 'vuex'
23
 export default {
23
 export default {
24
   name: '',
24
   name: '',
25
   data () {
25
   data () {
48
     if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
48
     if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
49
       this.showTabBar = true
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
 </script>
56
 </script>

+ 3
- 1
src/pages/user/mainPage/userCenter/index.vue Ver fichero

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

+ 4
- 1
src/pages/user/majorProjects/index.vue Ver fichero

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

+ 1
- 0
src/pages/user/orderList/index.vue Ver fichero

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

+ 9
- 4
src/pages/user/placeOrder/index.vue Ver fichero

16
         <div class="flex-item">
16
         <div class="flex-item">
17
           <div>
17
           <div>
18
             <span>桌号:{{tableNo}}</span>
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
           </div>
20
           </div>
21
         </div>
21
         </div>
22
         <a @click="reback">返回选择桌号</a>
22
         <a @click="reback">返回选择桌号</a>
185
     calcMenu,
185
     calcMenu,
186
   },
186
   },
187
   created () {
187
   created () {
188
+    this.fromPage = sessionStorage.getItem('from')
188
     this.getGoodsTypeList({
189
     this.getGoodsTypeList({
189
       caseid: this.caseId,
190
       caseid: this.caseId,
190
     }).then((res) => {
191
     }).then((res) => {
213
     ]),
214
     ]),
214
     toPlaceOrder () { // 下单 
215
     toPlaceOrder () { // 下单 
215
       if (this.selGoods.length) {
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
           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
           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
         } else {
219
         } else {
219
           this.showCalcMenu = true
220
           this.showCalcMenu = true
275
       })
276
       })
276
     },
277
     },
277
     placeOrder (Remark) { // 下单
278
     placeOrder (Remark) { // 下单
278
-      if(this.ajaxOff){
279
+      if (this.ajaxOff) {
279
         this.ajaxOff = false
280
         this.ajaxOff = false
280
         this.postData.info.OrgId = this.orgId
281
         this.postData.info.OrgId = this.orgId
281
         this.postData.info.UserId = this.userInfo.CustomerId
282
         this.postData.info.UserId = this.userInfo.CustomerId
282
         this.postData.info.UserName = this.userInfo.customer.CustomerName
283
         this.postData.info.UserName = this.userInfo.customer.CustomerName
283
         this.postData.info.PayType = 'sys user'
284
         this.postData.info.PayType = 'sys user'
284
         this.postData.info.Remark = Remark
285
         this.postData.info.Remark = Remark
286
+        this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
285
         var orderInfo = this.selGoods
287
         var orderInfo = this.selGoods
286
         this.postData.detail = []
288
         this.postData.detail = []
287
         var amount = 0
289
         var amount = 0
304
         this.toPay({
306
         this.toPay({
305
           info: JSON.stringify(this.postData.info),
307
           info: JSON.stringify(this.postData.info),
306
           detail: JSON.stringify(this.postData.detail),
308
           detail: JSON.stringify(this.postData.detail),
307
-          coupon: JSON.stringify(this.postData.coupon)
309
+          customercouponid: '',
310
+          from: this.postData.from
308
         }).then((res) => {
311
         }).then((res) => {
309
           this.ajaxOff = true
312
           this.ajaxOff = true
310
           this.showCalcMenu = false
313
           this.showCalcMenu = false
315
           // }).then(() => {
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 Ver fichero

237
         this.toPay({
237
         this.toPay({
238
           info: JSON.stringify(this.postData.info),
238
           info: JSON.stringify(this.postData.info),
239
           detail: JSON.stringify(this.postData.detail),
239
           detail: JSON.stringify(this.postData.detail),
240
-          customercouponid: this.postData.customercouponid
240
+          customercouponid: this.postData.customercouponid || '',
241
+          from: ''
241
         }).then((res) => {
242
         }).then((res) => {
242
           this.showSuccessPopup = true
243
           this.showSuccessPopup = true
243
           // this.$dialog.alert({
244
           // this.$dialog.alert({
246
           //   window.history.go(-2)
247
           //   window.history.go(-2)
247
           // })
248
           // })
248
         }).catch(() => {
249
         }).catch(() => {
249
-          // this.ajaxoff = true
250
+          this.ajaxoff = true
250
         })
251
         })
251
       }
252
       }
252
     },
253
     },

+ 8
- 1
src/store/case/case.js Ver fichero

7
   state: {
7
   state: {
8
     caseTotal: {},
8
     caseTotal: {},
9
     caseConf: {},
9
     caseConf: {},
10
+    choosedCase: {}
10
   },
11
   },
11
   mutations: {
12
   mutations: {
12
     setCaseTotal (state, data) { // 获取案场下单数量信息
13
     setCaseTotal (state, data) { // 获取案场下单数量信息
15
     setCaseConf (state, data) { // 获取案场下单数量信息
16
     setCaseConf (state, data) { // 获取案场下单数量信息
16
       state.caseConf = data
17
       state.caseConf = data
17
     },
18
     },
19
+    setChoosedCase (state, data) { // 获取案场下单数量信息
20
+      state.choosedCase = data
21
+    },
18
   },
22
   },
19
   actions: {
23
   actions: {
20
     getCaseTotal ({ commit }, { caseid }) {
24
     getCaseTotal ({ commit }, { caseid }) {
32
         })
36
         })
33
       })
37
       })
34
     },
38
     },
35
-    getCaseConf ({ commit },{ caseid }) {
39
+    getCaseConf ({ commit }, { caseid }) {
36
       return new Promise((resolve, reject) => {
40
       return new Promise((resolve, reject) => {
37
         Ajax(api.case.conf.url, {
41
         Ajax(api.case.conf.url, {
38
           method: api.case.conf.method,
42
           method: api.case.conf.method,
46
           reject(err)
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 Ver fichero

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

+ 1
- 0
vue.config.js Ver fichero

34
       },
34
       },
35
     },
35
     },
36
     // compress: true,
36
     // compress: true,
37
+    devtool: 'source-map',
37
     disableHostCheck: true,   // That solved it
38
     disableHostCheck: true,   // That solved it
38
   }
39
   }
39
 }
40
 }