yuantianjiao 6 anni fa
parent
commit
2b1e358054

BIN
src/common/icon/indexlogo.jpg Vedi File


+ 1
- 1
src/components/topCaseInfo/index.vue Vedi File

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="topCaseInfo flex-h">
3 3
     <i class="iconfont icon-dingwei"></i>
4
-      <span>{{data.CaseName}}</span>
4
+      <span>{{data.caseName}}</span>
5 5
       <a v-if="data.ShowSelect" @click="selectCase">请选择</a>
6 6
       <div class="flex-item">
7 7
         <span>{{userName}}您好!</span>

+ 1
- 1
src/pages/sales/cardAndCouponNum/index.vue Vedi File

@@ -87,7 +87,7 @@ export default {
87 87
       this.getCouponNum({ id: this.$route.query.id }).then(() => {
88 88
         this.getSales({ type: 'sales' }).then(() => {
89 89
           this.data = this.cardAndCoupon
90
-          this.data.CustomerCard = this.data.CustomerCard || []
90
+          this.data.CustomerCard = this.data.CustomerCoupon || []
91 91
         })
92 92
       })
93 93
     }

+ 0
- 266
src/pages/sales/coffeeIndex/index.vue Vedi File

@@ -1,266 +0,0 @@
1
-<template>
2
-  <div class="mainPage flex-v">
3
-    <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
5
-    </div>
6
-    <nav class="flex-h">
7
-      <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
8
-    </nav>
9
-    <div class="content flex-item">
10
-      <div>
11
-        <ul>
12
-          <li :hidden="navActive !== 0" class="placeOrder">
13
-            <div class="topInfo flex-h">
14
-              <div class="flex-item">
15
-                <div>
16
-                  <span>共计已使用:{{caseTotal.total}}杯</span>
17
-                </div>
18
-              </div>
19
-              <div class="flex-item">
20
-                <div>
21
-                  <span>本月已用:{{caseTotal.monthtotal}}杯</span>
22
-                </div>
23
-              </div>
24
-              <a>点单记录</a>
25
-            </div>
26
-            <div class="areaListParent flex-h">
27
-              <div class="flex-item">
28
-                <div>
29
-                  <ul class="areaList">
30
-                    <li v-for="(item,index) in CaseTableList" :key="index">
31
-                      <div class="title">
32
-                        <i class="iconfont icon-yinchenglogo"></i>
33
-                        <span>{{item.AreaName}}</span>
34
-                      </div>
35
-                      <ul class="subAreaList flex-h">
36
-                        <router-link tag="li" class="flex-item flex-h" v-for="(subItem,subIndex) in item.Tables" :key="subIndex" :to="{name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(topCaseInfoData.CaseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName)}}">
37
-                          <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
38
-                        </router-link>
39
-                        <li class="flex-item noData" v-if="item.Tables.length % 2 != 0"></li>
40
-                      </ul>
41
-                    </li>
42
-                  </ul>
43
-                </div>
44
-              </div>
45
-            </div>
46
-          </li>
47
-          <li :hidden="navActive !== 1" class="my-card">
48
-            <div class="list-box">
49
-              <div class="cardAndCouponInfo flex-h">
50
-                <div class="flex-item">
51
-                  <div>
52
-                    <span>卡券货值总额:</span>
53
-                    <span>¥1000</span>
54
-                    <span>万</span>
55
-                  </div>
56
-                </div>
57
-                <router-link :to="{name: 'salesRecord',query: {}}">销售记录</router-link>
58
-              </div>
59
-              <myCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></myCard>
60
-            </div>
61
-          </li>
62
-          <li :hidden="navActive !== 2" class="customer-card">
63
-            <div class="list-box">
64
-              <div class="search-bar flex-h">
65
-                <span>共15位客户</span>
66
-                <van-checkbox v-model="checked">
67
-                  我推荐的客户(8人)
68
-                  <img
69
-                    slot="icon"
70
-                    slot-scope="props"
71
-                    :src="props.checked ? icon.active : icon.normal"
72
-                    style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
73
-                  >
74
-                </van-checkbox>
75
-                <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
76
-              </div>
77
-              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @remark='remark' @history='history' @record='record'></customerCard>
78
-            </div>
79
-          </li>
80
-        </ul>
81
-      </div>
82
-    </div>
83
-    <div class="selectCase" :hidden="!showSelect"></div>
84
-    <van-picker :hidden="!showSelect"
85
-      show-toolbar
86
-      title="选择案场"
87
-      :columns="caseList"
88
-      @cancel="showSelect = false"
89
-      @confirm="selectCase"
90
-      value-key="value"
91
-    />
92
-    <van-dialog
93
-      v-model="showDialog"
94
-      show-cancel-button
95
-      title='添加备注'
96
-      :before-close="beforeClose">
97
-      <van-field
98
-        v-model="message"
99
-        type="textarea"
100
-        placeholder="请输入备注"
101
-        rows="3"
102
-        autosize/>
103
-    </van-dialog>
104
-  </div>
105
-</template>
106
-
107
-<script>
108
-import caseTableItem from '../../../components/caseTableItem/index'
109
-import topCaseInfo from '../../../components/topCaseInfo/index'
110
-import myCard from '../../../components/myCard/myCard'
111
-import customerCard from '../../../components/customerCard/customerCard'
112
-import active from '../../../common/icon/check-box-checked.png'
113
-import normal from '../../../common/icon/check-box-empty.png'
114
-import { mapState, createNamespacedHelpers } from 'vuex'
115
-const { mapActions: actions } = createNamespacedHelpers('app')
116
-const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
117
-const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
118
-
119
-export default {
120
-  name: '',
121
-  data () {
122
-    return {
123
-      icon: {
124
-        active: active,
125
-        normal: normal
126
-      },
127
-      navActive: 2,
128
-      checked: true,
129
-      showDialog: false,
130
-      message: '',
131
-      cutNavList: [{
132
-        value: '城咖啡',
133
-        id: '1',
134
-      }, {
135
-        value: '我的卡券',
136
-        id: '2',
137
-      }, {
138
-        value: '我的客户',
139
-        id: '3',
140
-      }],
141
-      topCaseInfoData: {
142
-        caseName: '',
143
-        caseId: '',
144
-        showSelect: true,
145
-        userName: 'xxx'
146
-      },
147
-      caseInfo: {
148
-        value: '',
149
-        id: ''
150
-      },
151
-      showSelect: false,
152
-      caseList: [{
153
-        value: '案场一',
154
-        id: ''
155
-      }, {
156
-        value: '案场二',
157
-        id: ''
158
-      }, {
159
-        value: '案场三',
160
-        id: ''
161
-      }, {
162
-        value: '案场四',
163
-        id: ''
164
-      }],
165
-      list: [{
166
-        name: '案场名称1',
167
-        list: [{}, {}, {}, {}, {}],
168
-      }, {
169
-        name: '案场名称2',
170
-        list: [{}, {}, {}, {}, {}],
171
-      }],
172
-      cardList: [
173
-        {
174
-          invalid: true
175
-        },
176
-        {
177
-          invalid: false
178
-        },
179
-        {
180
-          invalid: false
181
-        }
182
-      ]
183
-    }
184
-  },
185
-  computed: {
186
-    ...mapState({
187
-      userInfo: x => x.userCenter.userInfo,
188
-      CaseList: x => x.app.CaseList,
189
-      CaseTableList: x => x.placeOrderForCoffee.CaseTableList,
190
-    }),
191
-    ...mapCaseState({
192
-      caseTotal: x => x.caseTotal,
193
-    })
194
-  },
195
-  components: {
196
-    topCaseInfo,
197
-    caseTableItem,
198
-    myCard,
199
-    customerCard
200
-  },
201
-  created () {
202
-    this.getCaseList().then((res) => {
203
-      this.topCaseInfoData.CaseName = res.cases[0].CaseName
204
-      this.topCaseInfoData.CaseId = res.cases[0].CaseId
205
-      this.getCaseTableList({
206
-        caseid: this.topCaseInfoData.CaseId
207
-      })
208
-      this.getCaseTotal({
209
-        caseid: this.topCaseInfoData.CaseId
210
-      })
211
-    })
212
-  },
213
-  methods: {
214
-    ...actions([
215
-      'getCaseList',
216
-    ]),
217
-    ...caseTableActions([
218
-      'getCaseTableList',
219
-    ]),
220
-    ...mapCaseActions([
221
-      'getCaseTotal',
222
-    ]),
223
-    selectCase (val) { // 选择案场
224
-      this.topCaseInfoData.CaseName = val.CaseName
225
-      this.topCaseInfoData.CaseId = val.CaseId
226
-      this.getCaseTableList({
227
-        caseid: this.topCaseInfoData.CaseId
228
-      })
229
-      this.ShowSelect = false
230
-    },
231
-    cutNav (index) { // 切换nav
232
-      this.navActive = index
233
-    },
234
-    share (item) {
235
-      console.log(item)
236
-    },
237
-    remark (item) {
238
-      console.log(item)
239
-      this.showDialog = true
240
-    },
241
-    history (item) {
242
-      console.log(item)
243
-      this.$router.push({ name: 'history' })
244
-    },
245
-    record (item) {
246
-      console.log(item)
247
-      this.$router.push({ name: 'getRecord' })
248
-    },
249
-    searchMask () {
250
-      this.$router.push({ name: 'customerSearch' })
251
-    },
252
-    beforeClose (action, done) {
253
-      if (action === 'confirm') {
254
-        setTimeout(done, 1000)
255
-      } else {
256
-        done()
257
-      }
258
-    }
259
-  }
260
-}
261
-</script>
262
-
263
-<!-- Add "scoped" attribute to limit CSS to this component only -->
264
-<style lang="scss" scoped>
265
-@import 'page.scss';
266
-</style>

+ 0
- 194
src/pages/sales/coffeeIndex/page.scss Vedi File

@@ -1,194 +0,0 @@
1
-.mainPage{
2
-  .top{
3
-    position: relative;
4
-    overflow: hidden;
5
-  }
6
-  >nav{
7
-    width: 100%;
8
-    position: relative;
9
-    z-index: 10;
10
-    background: #fff;
11
-    box-shadow: 0 0 .1rem .02rem rgba(0, 0, 0, .1);
12
-    a{
13
-      text-align: center;
14
-      line-height: .4rem;
15
-      font-size: .14rem;
16
-      color: #ccc;
17
-      position: relative;
18
-      &.active{
19
-        color: #333;
20
-        &::after{
21
-          content: '';
22
-          width: 50%;
23
-          height: .02rem;
24
-          background: #fc6243;
25
-          position: absolute;
26
-          bottom: 0;
27
-          left: 50%;
28
-          transform: translateX(-50%);
29
-          -webkit-transform: translateX(-50%);
30
-        }
31
-      }
32
-    }
33
-  }
34
-  .content{
35
-    &>div{
36
-      width: 100%;
37
-      position: absolute;
38
-      left: 0;
39
-      top: 0;
40
-      bottom: 0;
41
-      overflow: hidden;
42
-      &>ul{
43
-        width: 100%;
44
-        height: 100%;
45
-        position: relative;
46
-        overflow: hidden;
47
-        &>li{
48
-          width: 100%;
49
-          height: 100%;
50
-          position: relative;
51
-          overflow-y: scroll;
52
-          -webkit-overflow-scrolling: touch;
53
-          transform: translateZ(0);
54
-          -webkit-transform: translateZ(0);
55
-          &.placeOrder{
56
-            .topInfo{
57
-              align-items: center;
58
-              margin: .1rem auto 0;
59
-              >div{
60
-                >div{
61
-                  width: 100%;
62
-                  position: relative;
63
-                  overflow: hidden;
64
-                  span{
65
-                    width: 100%;
66
-                    display: block;
67
-                    text-indent: .2rem;
68
-                    line-height: .3rem;
69
-                    font-size: .14rem;
70
-                    color: #666;
71
-                  }
72
-                }
73
-              }
74
-              a{
75
-                line-height: .22rem;
76
-                font-size: .12rem;
77
-                color: #fc6243;
78
-                border: .01rem solid #fc6243;
79
-                padding: 0 .15rem;
80
-                border-radius: .05rem;
81
-                margin-right: .2rem;
82
-              }
83
-            }
84
-            .areaListParent{
85
-              position: relative;
86
-              overflow: visible;
87
-              >div{
88
-                margin: 0 .2rem;
89
-                position: relative;
90
-                overflow: visible;
91
-                >div{
92
-                  width: 100%;
93
-                  position: relative;
94
-                  overflow: visible;
95
-                  .areaList{
96
-                    &:last-child{
97
-                      margin-bottom: .2rem;
98
-                    }
99
-                    .title{
100
-                      font-size: 0;
101
-                      white-space: nowrap;
102
-                      margin-top: .22rem;
103
-                      *{
104
-                        line-height: .26rem;
105
-                        font-size: .14rem;
106
-                      }
107
-                      i{
108
-                        color: red;
109
-                        margin-right: .05rem;
110
-                      }
111
-                    }
112
-                    .subAreaList{
113
-                      position: relative;
114
-                      overflow: visible;
115
-                      flex-wrap: wrap;
116
-                      -webkit-flex-wrap: wrap;
117
-                      &>li{
118
-                        position: relative;
119
-                        overflow: hidden;
120
-                        border-radius: .06rem;
121
-                        background: #fff;
122
-                        padding: .15rem 0;
123
-                        box-shadow: 0 0 .1rem .01rem rgba(0, 0, 0, .1);
124
-                        min-width: 40%;
125
-                        margin-top: .2rem;
126
-                        &:nth-child(2n){
127
-                          margin-left: .2rem;
128
-                        }
129
-                        &.noData{
130
-                          box-shadow: none;
131
-                          background: none;
132
-                        }
133
-                      }
134
-                    }
135
-                  }
136
-                }
137
-              }
138
-            }
139
-          }
140
-          &.my-card, &.customer-card{
141
-            .cardAndCouponInfo{
142
-              align-items: center;
143
-              margin: .1rem 0 .15rem;
144
-              div{
145
-                font-size: 0;
146
-                white-space: nowrap;
147
-                span{
148
-                  line-height: .3rem;
149
-                  font-size: .13rem;
150
-                  display: inline-block;
151
-                  margin-right: .05rem;
152
-                  &:nth-child(2){
153
-                    font-size: .16rem;
154
-                    color: #fc6243;
155
-                  }
156
-                }
157
-              }
158
-              a{
159
-                line-height: .24rem;
160
-                padding: 0 .1rem;
161
-                box-sizing: border-box;
162
-                border: .01rem solid #333;
163
-                color: #333;
164
-                border-radius: .04rem;
165
-                font-size: .12rem;
166
-              }
167
-            }
168
-            .list-box{
169
-              padding: .1rem .2rem .2rem;
170
-            }
171
-          }
172
-          .search-bar{
173
-            align-items: center;
174
-            justify-content: space-between;
175
-            padding: 0 .1rem .1rem;
176
-            .search-icon{
177
-              font-size: .18rem;
178
-              color: #909090;
179
-            }
180
-          }
181
-        }
182
-      }
183
-    }
184
-  }
185
-  .selectCase{
186
-    width: 100%;
187
-    position: absolute;
188
-    left: 0;
189
-    top: 0;
190
-    bottom: 0;
191
-    background: rgba(0, 0, 0, .3);
192
-    z-index: 100;
193
-  }
194
-}

+ 19
- 4
src/pages/sales/customerSearch/index.vue Vedi File

@@ -42,8 +42,8 @@ export default {
42 42
   data () {
43 43
     return {
44 44
       topCaseInfoData: {
45
-        CaseName: '',
46
-        CaseId: '',
45
+        caseName: '',
46
+        caseId: '',
47 47
         ShowSelect: false,
48 48
       },
49 49
       icon: {
@@ -73,8 +73,12 @@ export default {
73 73
   },
74 74
   created () {
75 75
     this.getCaseList().then((res) => {
76
-      this.topCaseInfoData.CaseName = res.cases[0].CaseName
77
-      this.topCaseInfoData.CaseId = res.cases[0].CaseId
76
+      this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
77
+      for (let i = 0; i < this.CaseList.length; i++) {
78
+        if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
79
+          this.topCaseInfoData.caseName = this.CaseList[i].CaseName
80
+        }
81
+      }
78 82
     })
79 83
   },
80 84
   methods: {
@@ -110,6 +114,17 @@ export default {
110 114
         this.ajaxOff = true
111 115
       })
112 116
     },
117
+    showVanPicker () {
118
+      this.showSelect = true
119
+    },
120
+    selectCase (val) { // 选择案场
121
+      this.topCaseInfoData.caseName = val.CaseName
122
+      this.topCaseInfoData.caseId = val.CaseId
123
+      this.getCaseTableList({
124
+        caseid: this.topCaseInfoData.caseId
125
+      })
126
+      this.showSelect = false
127
+    }
113 128
   }
114 129
 }
115 130
 </script>

+ 20
- 6
src/pages/sales/getRecord/index.vue Vedi File

@@ -64,10 +64,9 @@ export default {
64 64
       cardList: [],
65 65
       couponList: [],
66 66
       topCaseInfoData: {
67
-        CaseName: '',
68
-        CaseId: '',
69
-        showSelect: false,
70
-        userName: ''
67
+        caseName: '',
68
+        caseId: '',
69
+        showSelect: false
71 70
       },
72 71
     }
73 72
   },
@@ -82,8 +81,12 @@ export default {
82 81
   },
83 82
   created () {
84 83
     this.getCaseList().then((res) => {
85
-      this.topCaseInfoData.CaseName = res.cases[0].CaseName
86
-      this.topCaseInfoData.CaseId = res.cases[0].CaseId
84
+      this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
85
+      for (let i = 0; i < this.CaseList.length; i++) {
86
+        if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
87
+          this.topCaseInfoData.caseName = this.CaseList[i].CaseName
88
+        }
89
+      }
87 90
     })
88 91
     this.getCustomerCardList({
89 92
       id: this.user.id,
@@ -125,6 +128,17 @@ export default {
125 128
     cutNav (index) {
126 129
       this.activeIndex = index
127 130
     },
131
+    showVanPicker () {
132
+      this.showSelect = true
133
+    },
134
+    selectCase (val) { // 选择案场
135
+      this.topCaseInfoData.caseName = val.CaseName
136
+      this.topCaseInfoData.caseId = val.CaseId
137
+      this.getCaseTableList({
138
+        caseid: this.topCaseInfoData.caseId
139
+      })
140
+      this.showSelect = false
141
+    }
128 142
   }
129 143
 }
130 144
 </script>

+ 0
- 338
src/pages/sales/placeOrder/index.vue Vedi File

@@ -1,338 +0,0 @@
1
-<template>
2
-  <div class="mainPage flex-v">
3
-    <div class="flex-item flex-v">
4
-      <div class="banner">
5
-        <img src="" class="centerLabel cover" alt="">
6
-        <div class="bannerInfo flex-h">
7
-          <div class="flex-item">
8
-            <div>
9
-              <span>项目名称:{{caseName}}</span>
10
-            </div>
11
-          </div>
12
-          <span>{{userInfo.customer != undefined ? userInfo.customer.CustomerName : ''}}您好!</span>
13
-        </div>
14
-      </div>
15
-      <div class="tableInfo flex-h">
16
-        <div class="flex-item">
17
-          <div>
18
-            <span>桌号:{{postData.info.TableNo}}</span>
19
-            <!-- <span>本月已用:150杯</span> -->
20
-          </div>
21
-        </div>
22
-        <router-link :to="{name: 'coffeeIndex', query: {}}">返回选择桌号</router-link>
23
-      </div>
24
-      <div class="content flex-item flex-h">
25
-        <div class="slideMenus">
26
-          <div>
27
-            <ul>
28
-              <li v-for="(item,index) in menuList" :key="index" :class="{'active': slideMenusActive == index}" @click="cutMenu(index)">
29
-                <span>{{item.value}}</span>
30
-                <span>{{item.eValue}}</span>
31
-              </li>
32
-            </ul>
33
-          </div>
34
-        </div>
35
-        <div class="flex-item">
36
-          <div>
37
-            <swiper :options="swiperOption" ref="mySwiper">
38
-              <swiper-slide class="swiper-slide" v-for="(item,index) in menuList" :key="index">
39
-                <div class="flex-v">
40
-                  <h4>{{item.value + ' ' + item.eValue}}</h4>
41
-                  <div class="flex-item">
42
-                    <div>
43
-                      <swiper :options="subSwiperOption" ref="mySubSwiper">
44
-                        <swiper-slide class="swiper-slide" v-for="(subItem,subIndex) in item.list" :key="subIndex">
45
-                          <orderItem :data="subItem" @returnData="calcMenus" @selectSpec="selectSpec"></orderItem>
46
-                        </swiper-slide>
47
-                      </swiper>
48
-                    </div>
49
-                  </div>
50
-                </div>
51
-              </swiper-slide>
52
-            </swiper>
53
-          </div>
54
-        </div>
55
-      </div>
56
-    </div>
57
-    <div class="flex-h">
58
-      <div class="flex-item">
59
-        <div>
60
-          <span>总计</span>
61
-          <span>{{totalNum}}</span>
62
-          <span>杯</span>
63
-          <span>共</span>
64
-          <span>{{totalPrice}}</span>
65
-          <span>元</span>
66
-          <i class="iconfont" :class="{'icon-jiantou-up': !showCalcMenu,'icon-jiantou-down': showCalcMenu}" @click="showCalcMenu = true"></i>
67
-        </div>
68
-      </div>
69
-      <a @click="showCalcMenu = true">下单</a>
70
-    </div>
71
-    <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
72
-    <calcMenu :show="showCalcMenu" :totalNum="totalCupNum" :data="settlementList" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
73
-  </div>
74
-</template>
75
-
76
-<script>
77
-import { mapState, createNamespacedHelpers } from 'vuex'
78
-const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
79
-import orderItem from '../../../components/orderItem/index'
80
-import orderPopup from '../../../components/orderPopup/index'
81
-import calcMenu from '../../../components/calcMenu/index'
82
-import { swiper, swiperSlide } from 'vue-awesome-swiper'
83
-import 'swiper/dist/css/swiper.css'
84
-
85
-export default {
86
-  name: '',
87
-  data () {
88
-    const _self = this
89
-    return {
90
-      caseName: decodeURI(this.$route.query.casename),
91
-      totalCupNum: 0, // 共计使用杯数
92
-      showCalcMenu: false, // 显隐已点菜单弹窗
93
-      currentSpec: null, // 当前选择规格
94
-      showPopup: false, // 显隐选规格弹窗
95
-      totalNum: 0, // 总杯数
96
-      totalPrice: 0, // 总价格
97
-      settlementList: [], // 商品选择清单
98
-      slideMenusActive: 0, // 左侧菜单选中索引值
99
-      menuList: [],
100
-      postData: {
101
-        info: {
102
-          CaseId: decodeURI(_self.$route.query.caseid),
103
-          AreaId: decodeURI(_self.$route.query.areaid),
104
-          AreaName: decodeURI(_self.$route.query.areaname),
105
-          TableId: decodeURI(_self.$route.query.tableid),
106
-          TableNo: decodeURI(_self.$route.query.tableno),
107
-          Amount: 0,// String(_self.returnAmount()[0]), // 订单金额
108
-          OrdersNum: 0, // Number(_self.returnAmount()[1]),
109
-          Remark: '',
110
-        },
111
-        detail: [],
112
-        coupon: [],
113
-      },
114
-      swiperOption: {
115
-        observer: true,
116
-        direction: 'vertical',
117
-        on: {
118
-          transitionEnd () {
119
-            _self.slideMenusActive = this.activeIndex
120
-          },
121
-        }
122
-      },
123
-      subSwiperOption: {
124
-        observer: true,
125
-        direction: 'vertical',
126
-        nested: true,
127
-        slidesPerView: 'auto',
128
-        freeMode: true,
129
-        freeModeMomentumVelocityRatio: 2,
130
-      },
131
-    }
132
-  },
133
-  computed: {
134
-    ...mapState({
135
-      userInfo: x => x.userCenter.userInfo,
136
-      goodsTypeList: x => x.placeOrderForCoffee.goodsTypeList,
137
-      goodsList: x => x.placeOrderForCoffee.goodsList
138
-    }),
139
-    MySwiper () {
140
-      return this.$refs.mySwiper.swiper
141
-    },
142
-    MySubSwiper () {
143
-      return this.$refs.mySubSwiper.swiper
144
-    },
145
-  },
146
-  components: {
147
-    swiper,
148
-    swiperSlide,
149
-    orderItem,
150
-    orderPopup,
151
-    calcMenu,
152
-  },
153
-  created () {
154
-    this.getGoodsTypeList({
155
-      caseid: this.postData.info.CaseId,
156
-    }).then((res) => {
157
-      // console.log(JSON.stringify(res))
158
-      this.getGoodsList({
159
-        caseid: this.postData.info.CaseId,
160
-      }).then((res) => {
161
-        // console.log(JSON.stringify(res))
162
-        this.mapArr()
163
-      })
164
-    })
165
-  },
166
-  methods: {
167
-    ...caseTableActions([
168
-      'getGoodsTypeList',
169
-      'getGoodsList',
170
-      'toPay',
171
-    ]),
172
-    toPayer () { // 下单
173
-      this.postData.info.Amount = String(this.returnAmount()[0])
174
-      this.postData.info.OrdersNum = Number(this.returnAmount()[1])
175
-      this.postData.info.OrgId = this.orgId
176
-      this.postData.info.UserId = this.userInfo.CustomerId
177
-      this.postData.info.UserName = this.userInfo.CustomerName
178
-      this.postData.info.PayType = this.postData.coupon.length ? 'coupon' : 'vip'
179
-      var orderInfo = this.settlementList
180
-      this.postData.detail = []
181
-      for (var n = 0; n < orderInfo.length; n++) {
182
-        this.postData.detail.push({
183
-          GoodsId: orderInfo[n].id,
184
-          GoodsName: orderInfo[n].name,
185
-          SpecId: orderInfo[n].specId,
186
-          SpecName: orderInfo[n].specName,
187
-          Number: orderInfo[n].defaultNum === null ? orderInfo[n].num - 0 : orderInfo[n].defaultNum - 0,
188
-          Price: orderInfo[n].defaultNum === null ? String(orderInfo[n].price) : String(orderInfo[n].defaultPrice),
189
-        })
190
-      }
191
-      console.log(JSON.stringify(this.postData))
192
-      this.toPay({
193
-        info: JSON.stringify(this.postData.info),
194
-        detail: JSON.stringify(this.postData.detail),
195
-        coupon: JSON.stringify(this.postData.coupon)
196
-      }).then((res) => {
197
-        this.$dialog.alert({
198
-          message: '下单成功!'
199
-        }).then(() => {
200
-          window.history.go(-2)
201
-        })
202
-      })
203
-    },
204
-    returnAmount () { // 返回总金额  
205
-      var amount = 0, num = 0
206
-      for (var n = 0; n < this.settlementList.length; n++) {
207
-        if (this.settlementList[n].defaultPrice === null) {
208
-          amount += this.settlementList[n].price * this.settlementList[n].num
209
-          num += this.settlementList[n].num
210
-        } else {
211
-          amount += this.settlementList[n].defaultPrice * this.settlementList[n].defaultNum
212
-          num += this.settlementList[n].defaultNum
213
-        }
214
-      }
215
-      return [amount, num]
216
-    },
217
-    mapArr () { // 匹配商品规格
218
-      var aArr = this.goodsTypeList, bArr = this.goodsList
219
-      for (var n = 0; n < aArr.length; n++) {
220
-        aArr[n].list = []
221
-        for (var a = 0; a < bArr.length; a++) {
222
-          if (aArr[n].TypeId === bArr[a].TypeId) {
223
-            aArr[n].list.push(bArr[a])
224
-          }
225
-        }
226
-      }
227
-      this.menuList = []
228
-      for (var x = 0; x < aArr.length; x++) {
229
-        this.menuList.push({
230
-          value: aArr[x].TypeName,
231
-          eValue: aArr[x].EnglishName,
232
-          id: aArr[x].TypeId,
233
-          status: aArr[x].Status,
234
-          list: []
235
-        })
236
-        for (var y = 0; y < aArr[x].list.length; y++) {
237
-          this.menuList[x].list.push({
238
-            img: aArr[x].list[y].Images,
239
-            name: aArr[x].list[y].GoodsName,
240
-            id: aArr[x].list[y].GoodsId,
241
-            spec: [],
242
-            status: aArr[x].list[y].Status,
243
-            price: aArr[x].list[y].Price,
244
-          })
245
-          if(aArr[x].list[y].Specs !== null){
246
-            for (var z = 0; z < aArr[x].list[y].Specs.length; z++) {
247
-              this.menuList[x].list[y].spec.push({
248
-                value: aArr[x].list[y].Specs[z].SpecName,
249
-                id: aArr[x].list[y].Specs[z].SpecId,
250
-                num: 0,
251
-                status: aArr[x].list[y].Specs[z].Status,
252
-                price: aArr[x].list[y].Specs[z].GoodsPrice,
253
-              })
254
-            }
255
-          }
256
-        }
257
-      }
258
-      // console.log(JSON.stringify(this.menuList))
259
-    },
260
-    placeOrder () { // 下单
261
-      this.toPayer()
262
-    },
263
-    closeCalcMenu () { // 关闭已选菜单
264
-      this.showCalcMenu = false
265
-    },
266
-    emptyMenus () { // 清空菜单
267
-      this.settlementList = []
268
-    },
269
-    closePopup () { // 关闭规格弹窗
270
-      this.showPopup = false
271
-      this.currentSpec = null
272
-    },
273
-    selectSpec (val) { // 选规格
274
-      this.currentSpec = val
275
-      this.showPopup = true
276
-    },
277
-    cutMenu (index) { // 切换菜单
278
-      this.MySwiper.slideTo(index, 300)
279
-    },
280
-    calcMenus (val) { // 计算清单
281
-      var bool = true, arr = this.settlementList.slice()
282
-      if (val.specId === null) {
283
-        for (var n = 0; n < arr.length; n++) {
284
-          if (arr[n].id === val.id && arr[n].specId === null) {
285
-            bool = false
286
-            arr[n] = val
287
-          }
288
-        }
289
-        if (bool) {
290
-          arr.push(val)
291
-        }
292
-      } else {
293
-        for (var n = 0; n < arr.length; n++) {
294
-          if (arr[n].specId === val.specId) {
295
-            bool = false
296
-            arr[n] = val
297
-          }
298
-        }
299
-        if (bool) {
300
-          arr.push(val)
301
-        }
302
-      }
303
-      for (var n = 0; n < arr.length; n++) {
304
-        if (arr[n].num === 0 || arr[n].defaultNum === 0) {
305
-          arr.splice(n, 1)
306
-        }
307
-      }
308
-      this.settlementList = arr
309
-      // console.log(JSON.stringify(this.settlementList))
310
-      this.calcTotalNum()
311
-    },
312
-    calcTotalNum () { // 计算总数量、价格
313
-      var num = 0, price = 0
314
-      if (!this.settlementList.length) {
315
-        this.totalNum = 0
316
-        this.totalPrice = 0
317
-        return
318
-      }
319
-      for (var n = 0; n < this.settlementList.length; n++) {
320
-        if (this.settlementList[n].specId === null) {
321
-          num += this.settlementList[n].defaultNum
322
-          price += this.settlementList[n].defaultPrice * this.settlementList[n].defaultNum
323
-        } else {
324
-          num += this.settlementList[n].num
325
-          price += this.settlementList[n].price * this.settlementList[n].num
326
-        }
327
-      }
328
-      this.totalNum = num
329
-      this.totalPrice = price
330
-    },
331
-  }
332
-}
333
-</script>
334
-
335
-<!-- Add "scoped" attribute to limit CSS to this component only -->
336
-<style lang="scss" scoped>
337
-@import 'page.scss';
338
-</style>

+ 0
- 241
src/pages/sales/placeOrder/page.scss Vedi File

@@ -1,241 +0,0 @@
1
-.mainPage{
2
-  &>div.flex-item{
3
-    position: relative;
4
-    z-index: 1;
5
-    .banner{
6
-      width: 100%;
7
-      position: relative;
8
-      overflow: hidden;
9
-      padding-bottom: 35%;
10
-      background: #eee;
11
-      img{
12
-        z-index: 1;
13
-      }
14
-      .bannerInfo{
15
-        width: 100%;
16
-        position: absolute;
17
-        left: 0;
18
-        bottom: 0;
19
-        z-index: 2;
20
-        &>div{
21
-          margin-left: .2rem;
22
-          &>div{
23
-            width: 100%;
24
-            font-size: 0;
25
-            white-space: nowrap;
26
-            span{
27
-              overflow: hidden;
28
-              text-overflow: ellipsis;
29
-              white-space: nowrap;
30
-              font-size: .15rem;
31
-              color: #fff;
32
-              line-height: .4rem;
33
-            }
34
-          }
35
-        }
36
-        &>span{
37
-          font-size: .15rem;
38
-          color: #fff;
39
-          line-height: .4rem;
40
-          margin-right: .2rem;
41
-          margin-left: .1rem;
42
-        }
43
-      }
44
-    }
45
-    .tableInfo{
46
-      align-items: center;
47
-      border-bottom: .01rem solid #eee;
48
-      &>div{
49
-        margin-left: .2rem;
50
-        &>div{
51
-          width: 100%;
52
-          position: relative;
53
-          overflow: hidden;
54
-          font-size: 0;
55
-          white-space: nowrap;
56
-          text-overflow: ellipsis;
57
-          span{
58
-            display: inline-block;
59
-            line-height: .4rem;
60
-            font-size: .13rem;
61
-            margin-right: .1rem;
62
-          }
63
-        }
64
-      }
65
-      &>a{
66
-        line-height: .22rem;
67
-        font-size: .13rem;
68
-        color: #fc6243;
69
-        border: .01rem solid #fc6243;
70
-        border-radius: .04rem;
71
-        padding: 0 .05rem;
72
-        margin-right: .2rem;
73
-      }
74
-    }
75
-    .content{
76
-      .slideMenus{
77
-        width: 24%;
78
-        min-width: .9rem;
79
-        position: relative;
80
-        overflow: hidden;
81
-        &>div{
82
-          width: 100%;
83
-          position: absolute;
84
-          left: 0;
85
-          top: 0;
86
-          bottom: 0;
87
-          overflow-y: scroll;
88
-          -webkit-overflow-scrolling: touch;
89
-          transform: translateZ(0);
90
-          -webkit-transform: translateZ(0);
91
-          background: #f7f7f7;
92
-          ul{
93
-            width: 100%;
94
-            overflow: hidden;
95
-            position: relative;
96
-            &>li{
97
-              width: 100%;
98
-              position: relative;
99
-              overflow: hidden;
100
-              padding: .18rem 0;
101
-              &.active{
102
-                background: #fff;
103
-              }
104
-              span{
105
-                width: 100%;
106
-                display: block;
107
-                text-align: center;
108
-                line-height: .22rem;
109
-                font-size: .14rem;
110
-              }
111
-            }
112
-          }
113
-        }
114
-      }
115
-      &>div.flex-item{
116
-        &>div{
117
-          width: 100%;
118
-          position: absolute;
119
-          left: 0;
120
-          top: 0;
121
-          bottom: 0;
122
-          overflow: hidden;
123
-          &>div{
124
-            width: 100%;
125
-            position: absolute;
126
-            left: 0;
127
-            top: 0;
128
-            bottom: 0;
129
-            overflow: hidden;
130
-            &>div{
131
-                &>.swiper-slide{
132
-                  &>div{
133
-                    width: 100%;
134
-                    position: absolute;
135
-                    left: 0;
136
-                    top: 0;
137
-                    bottom: 0;
138
-                    overflow: hidden;
139
-                    &>h4{
140
-                      width: 100%;
141
-                      display: block;
142
-                      line-height: .24rem;
143
-                      font-size: .11rem;
144
-                      text-indent: .1rem;
145
-                      margin-top: .1rem;
146
-                    }
147
-                    &>div{
148
-                      &>div{
149
-                        width: 100%;
150
-                        position: absolute;
151
-                        left: 0;
152
-                        top: 0;
153
-                        bottom: 0;
154
-                        overflow: hidden;
155
-                        &>div{
156
-                          width: 100%;
157
-                          position: absolute;
158
-                          left: 0;
159
-                          top: 0;
160
-                          bottom: 0;
161
-                          .swiper-slide{
162
-                            height: auto !important;
163
-                            padding: .15rem 0;
164
-                            position: relative;
165
-                            &::after{
166
-                              content: '';
167
-                              width: 100%;
168
-                              height: .01rem;
169
-                              background: #eee;
170
-                              position: absolute;
171
-                              left: 0;
172
-                              bottom: 0;
173
-                              z-index: 1;
174
-                            }
175
-                            &::before{
176
-                              content: '';
177
-                              width: .36rem;
178
-                              height: .01rem;
179
-                              background: #fff;
180
-                              position: absolute;
181
-                              left: 0;
182
-                              bottom: 0;
183
-                              z-index: 2;
184
-                            }
185
-                          }
186
-                        }
187
-                      }
188
-                    }
189
-                    .menuItem{
190
-                      width: 100%;
191
-                      position: relative;
192
-                      overflow: hidden;
193
-                    }
194
-                  }
195
-              }
196
-            }
197
-          }
198
-        }
199
-      }
200
-    }
201
-  }
202
-  &>div.flex-h{
203
-    padding: .1rem 0;
204
-    box-shadow: 0 0 .1rem .01rem rgba(0, 0, 0, .05);
205
-    position: relative;
206
-    z-index: 100;
207
-    a{
208
-      line-height: .4rem;
209
-      background: #fc6243;
210
-      color: #fff;
211
-      padding: 0 .5rem;
212
-      border-radius: .4rem;
213
-      font-size: .15rem;
214
-      margin-right: .2rem;
215
-    }
216
-    div{
217
-      font-size: 0;
218
-      white-space: nowrap;
219
-      span{
220
-        display: inline-block;
221
-        line-height: .4rem;
222
-        vertical-align: middle;
223
-        font-size: .13rem;
224
-        margin-left: .05rem;
225
-        &:first-child{
226
-          margin-left: .2rem;
227
-        }
228
-        &:nth-child(2){
229
-          font-size: .18rem;
230
-        }
231
-      }
232
-      i{
233
-        display: inline-block;
234
-        line-height: .4rem;
235
-        vertical-align: middle;
236
-        font-size: .13rem;
237
-        margin-left: .1rem;
238
-      }
239
-    }
240
-  }
241
-}

+ 0
- 12
src/pages/sales/router.js Vedi File

@@ -2,8 +2,6 @@ import Vue from 'vue'
2 2
 import Router from 'vue-router'
3 3
 
4 4
 import login from './login/index' // 登录
5
-import coffeeIndex from './coffeeIndex/index' // 点单首页
6
-import placeOrder from './placeOrder/index' // 城咖啡-点单
7 5
 import salesRecord from './salesRecord/index' // 销售记录
8 6
 import salesGiveOutDetail from './salesGiveOutDetail/index' // 销售发放详情
9 7
 import cardAndCouponNum from './cardAndCouponNum/index' // 卡券数量信息
@@ -19,16 +17,6 @@ const router = new Router({
19 17
     name: 'login',
20 18
     component: login,
21 19
     children: []
22
-  }, { // 点单首页
23
-    path: '/coffeeIndex',
24
-    name: 'coffeeIndex',
25
-    component: coffeeIndex,
26
-    children: []
27
-  }, { // 城咖啡-点单
28
-    path: '/placeOrder',
29
-    name: 'placeOrder',
30
-    component: placeOrder,
31
-    children: []
32 20
   }, { // 销售记录
33 21
     path: '/salesRecord',
34 22
     name: 'salesRecord',

+ 33
- 10
src/pages/sales/salesGiveOutDetail/index.vue Vedi File

@@ -1,18 +1,18 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <div class="flex-item flex-v body" v-if="data.allCard">
7 7
       <span>销售姓名:<em>{{data.RealName}}</em></span>
8 8
       <ul class="flex-h">
9 9
         <li class="flex-item" :class="{'active': activeIndex === 0}" @click="cutNav(0)">
10 10
           <span>饮品</span>
11
-          <span>(已赠送{{data.CustomerCard.length + data.CustomerCoupon.length}}杯)</span>  
11
+          <span>(已赠送{{data.OrdersDetail.length}}杯)</span>  
12 12
         </li> 
13 13
         <li class="flex-item" :class="{'active': activeIndex === 1}" @click="cutNav(1)">
14 14
           <span>卡券</span>
15
-          <span>(已发出{{data.OrdersDetail.length}}张)</span>  
15
+          <span>(已发出{{data.CustomerCard.length + data.CustomerCoupon.length}}张)</span>  
16 16
         </li> 
17 17
       </ul>
18 18
       <div class="flex-item">
@@ -31,13 +31,13 @@
31 31
                       <span>¥{{item.Price}} * 1</span>
32 32
                     </div>
33 33
                   </div>
34
-                  <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
34
+                  <span>{{toolClass.dateFormat(item.CreateDate)}}</span>
35 35
                 </li>
36 36
               </ul>
37 37
             </li>
38 38
             <li :hidden="activeIndex === 0">
39 39
               <ul class="list">
40
-                <router-link tag="li" class="flex-h" v-for="(item,index) in data.allCard" :key="index" :to="{name: 'cardAndCouponNum', query: { id: item.CardId || item.CaseId, type:item.CardId ? 'card' : 'coupon' }}">
40
+                <router-link tag="li" class="flex-h" v-for="(item,index) in data.allCard" :key="index" :to="{name: 'cardAndCouponNum', query: { id: item.CardId || item.CouponId, type:item.CardId ? 'card' : 'coupon' }}">
41 41
                   <div class="flex-item">
42 42
                     <div>
43 43
                       <span>{{item.CustomerCardName || item.CustomerCouponName}}</span>
@@ -61,8 +61,9 @@
61 61
 
62 62
 <script>
63 63
 import topCaseInfo from '../../../components/topCaseInfo/index'
64
-import { createNamespacedHelpers } from 'vuex'
64
+import { mapState, createNamespacedHelpers } from 'vuex'
65 65
 const { mapState: mapForbidState, mapActions: mapForbidActions } = createNamespacedHelpers('forbid')
66
+const { mapActions: actions } = createNamespacedHelpers('app')
66 67
 
67 68
 export default {
68 69
   name: '',
@@ -72,13 +73,16 @@ export default {
72 73
       topCaseInfoData: {
73 74
         caseName: '',
74 75
         caseId: '',
75
-        showSelect: false,
76
-        userName: 'xxx'
76
+        showSelect: false
77 77
       },
78 78
       data: {}
79 79
     }
80 80
   },
81 81
   computed: {
82
+    ...mapState({
83
+      userInfo: x => x.userCenter.userInfo,
84
+      CaseList: x => x.app.CaseList,
85
+    }),
82 86
     ...mapForbidState({
83 87
       salesCardList: x => x.salesCardList
84 88
     })
@@ -87,6 +91,14 @@ export default {
87 91
     topCaseInfo,
88 92
   },
89 93
   created () {
94
+    this.getCaseList().then((res) => {
95
+      this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
96
+      for (let i = 0; i < this.CaseList.length; i++) {
97
+        if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
98
+          this.topCaseInfoData.caseName = this.CaseList[i].CaseName
99
+        }
100
+      }
101
+    })
90 102
     this.getSalesCardList({ id: this.$route.query.id }).then(() => {
91 103
       this.data = this.salesCardList
92 104
       this.data.CustomerCard = this.data.CustomerCard ? this.data.CustomerCard : []
@@ -96,12 +108,23 @@ export default {
96 108
     })
97 109
   },
98 110
   methods: {
111
+    ...actions([
112
+      'getCaseList',
113
+    ]),
99 114
     ...mapForbidActions(['getSalesCardList']),
100 115
     cutNav (index) {
101 116
       this.activeIndex = index
102 117
     },
103
-    dateFomart (date) {
104
-      return this.toolClass.dateFormat(date)
118
+    showVanPicker () {
119
+      this.showSelect = true
120
+    },
121
+    selectCase (val) { // 选择案场
122
+      this.topCaseInfoData.caseName = val.CaseName
123
+      this.topCaseInfoData.caseId = val.CaseId
124
+      this.getCaseTableList({
125
+        caseid: this.topCaseInfoData.caseId
126
+      })
127
+      this.showSelect = false
105 128
     }
106 129
   }
107 130
 }

+ 10
- 15
src/pages/sales/salesRecord/index.vue Vedi File

@@ -21,14 +21,12 @@ import salesRecordItem from '../../../components/salesRecordItem/index'
21 21
 import { mapState, createNamespacedHelpers } from 'vuex'
22 22
 const { mapState: mapForbidState, mapActions: mapForbidActions } = createNamespacedHelpers('forbid')
23 23
 const { mapActions: actions } = createNamespacedHelpers('app')
24
-const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
25
-const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
26 24
 export default {
27 25
   name: '',
28 26
   data () {
29 27
     return {
30 28
       topCaseInfoData: {
31
-        CaseName: '',
29
+        caseName: '',
32 30
         caseId: '',
33 31
         showSelect: false
34 32
       },
@@ -43,10 +41,6 @@ export default {
43 41
     ...mapState({
44 42
       userInfo: x => x.userCenter.userInfo,
45 43
       CaseList: x => x.app.CaseList,
46
-      CaseTableList: x => x.placeOrderForCoffee.CaseTableList,
47
-    }),
48
-    ...mapCaseState({
49
-      caseTotal: x => x.caseTotal,
50 44
     }),
51 45
     ...mapForbidState({
52 46
       salesList: x => x.salesList,
@@ -55,8 +49,12 @@ export default {
55 49
   },
56 50
   created () {
57 51
     this.getCaseList().then((res) => {
58
-      this.topCaseInfoData.CaseName = res.cases[0].CaseName
59
-      this.topCaseInfoData.CaseId = res.cases[0].CaseId
52
+      this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
53
+      for (let i=0;i<this.CaseList.length;i++){
54
+        if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId){
55
+          this.topCaseInfoData.caseName = this.CaseList[i].CaseName
56
+        }
57
+      }
60 58
     })
61 59
     this.init()
62 60
   },
@@ -64,9 +62,6 @@ export default {
64 62
     ...actions([
65 63
       'getCaseList',
66 64
     ]),
67
-    ...mapCaseActions([
68
-      'getCaseTotal',
69
-    ]),
70 65
     fibdata (item) {
71 66
       const couponfib = this.forbidList.filter(x => x.UserId === item.UserId && x.ForbidType === 'coupon').length > 0 ? true : false
72 67
       const orderfib = this.forbidList.filter(x => x.UserId === item.UserId && x.ForbidType === 'order').length > 0 ? true : false
@@ -79,10 +74,10 @@ export default {
79 74
       this.showSelect = true
80 75
     },
81 76
     selectCase (val) { // 选择案场
82
-      this.topCaseInfoData.CaseName = val.CaseName
83
-      this.topCaseInfoData.CaseId = val.CaseId
77
+      this.topCaseInfoData.caseName = val.CaseName
78
+      this.topCaseInfoData.caseId = val.CaseId
84 79
       this.getCaseTableList({
85
-        caseid: this.topCaseInfoData.CaseId
80
+        caseid: this.topCaseInfoData.caseId
86 81
       })
87 82
       this.showSelect = false
88 83
     },

+ 10
- 2
src/pages/user/App.vue Vedi File

@@ -6,13 +6,16 @@
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'
9 11
 import { mapState, createNamespacedHelpers } from 'vuex'
10 12
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
11 13
 export default {
12 14
   name: 'app',
13 15
   data () {
14 16
     return {
15
-      showPage: false
17
+      showPage: false,
18
+      logo
16 19
     }
17 20
   },
18 21
   components: {},
@@ -23,7 +26,6 @@ export default {
23 26
     })
24 27
   },
25 28
   created () {
26
-    // console.log('creatde')
27 29
     if (location.search && this.toolClass.UrlSearch(location.search).code) {
28 30
       this.code = this.toolClass.UrlSearch(location.search).code
29 31
     } else {
@@ -32,6 +34,12 @@ export default {
32 34
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
33 35
       this.showPage = true
34 36
     })
37
+    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
38
+      title: '城的空间',
39
+      desc: '城的空间',
40
+      link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
41
+      thu_image: `${window.location.origin}${window.location.pathname}${logo}`
42
+    })
35 43
     // 计算距离方法
36 44
     console.log(this.toolClass.getGreatCircleDistance(117.225495, 39.133713, 117.225962, 39.132573))
37 45
   },

+ 1
- 1
src/pages/user/card/index.vue Vedi File

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="mainPage">
3
-    <nav class="flex-h">
3
+    <nav class="flex-h" v-if='false'>
4 4
       <a class="flex-item" v-for="(item,index) in nav" :key="index" :class="{'active':index==active}" @click="change(item,index)">{{item}}</a>
5 5
     </nav>
6 6
     <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='data[active].list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>

+ 44
- 14
src/pages/user/mainPage/coffeeIndex/index.vue Vedi File

@@ -33,7 +33,7 @@
33 33
                           <span>{{item.AreaName}}</span>
34 34
                         </div>
35 35
                         <ul class="subAreaList flex-h">
36
-                          <router-link tag="li" class="flex-item flex-h" v-for="(subItem,subIndex) in item.Tables" :key="subIndex" :to="{name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(topCaseInfoData.CaseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName)}}">
36
+                          <router-link tag="li" class="flex-item flex-h" v-for="(subItem,subIndex) in item.Tables" :key="subIndex" :to="{name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(topCaseInfoData.caseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName)}}">
37 37
                             <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
38 38
                           </router-link>
39 39
                           <li class="flex-item noData" v-if="(item.Tables || []).length % 2 != 0"></li>
@@ -124,6 +124,8 @@ import myCard from '../../../../components/myCard/myCard'
124 124
 import customerCard from '../../../../components/customerCard/customerCard'
125 125
 import active from '../../../../common/icon/check-box-checked.png'
126 126
 import normal from '../../../../common/icon/check-box-empty.png'
127
+import logo from '../../../../common/icon/indexlogo.jpg'
128
+import wxsdk from '../../../../util/share'
127 129
 import { mapState, createNamespacedHelpers } from 'vuex'
128 130
 const { mapActions: actions } = createNamespacedHelpers('app')
129 131
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
@@ -165,6 +167,7 @@ export default {
165 167
       navActive: 0,
166 168
       showDialog: false,
167 169
       message: '',
170
+      logo,
168 171
       cutNavList: [{
169 172
         value: '城咖啡',
170 173
         id: '1',
@@ -179,8 +182,8 @@ export default {
179 182
         id: '4',
180 183
       }],
181 184
       topCaseInfoData: {
182
-        CaseName: '',
183
-        CaseId: '',
185
+        caseName: '',
186
+        caseId: '',
184 187
         ShowSelect: false,
185 188
       },
186 189
       caseInfo: {
@@ -326,14 +329,7 @@ export default {
326 329
       })
327 330
     }
328 331
     this.getCaseList().then((res) => {
329
-      this.topCaseInfoData.CaseName = res.cases[0].CaseName
330
-      this.topCaseInfoData.CaseId = res.cases[0].CaseId
331
-      this.getCaseTableList({
332
-        caseid: this.topCaseInfoData.CaseId
333
-      })
334
-      this.getCaseTotal({
335
-        caseid: this.topCaseInfoData.CaseId
336
-      })
332
+      this.locationMapping()
337 333
     })
338 334
   },
339 335
   methods: {
@@ -375,10 +371,10 @@ export default {
375 371
       this.showSelect = true
376 372
     },
377 373
     selectCase (val) { // 选择案场
378
-      this.topCaseInfoData.CaseName = val.CaseName
379
-      this.topCaseInfoData.CaseId = val.CaseId
374
+      this.topCaseInfoData.caseName = val.CaseName
375
+      this.topCaseInfoData.caseId = val.CaseId
380 376
       this.getCaseTableList({
381
-        caseid: this.topCaseInfoData.CaseId
377
+        caseid: this.topCaseInfoData.caseId
382 378
       })
383 379
       this.showSelect = false
384 380
     },
@@ -430,6 +426,40 @@ export default {
430 426
     searchMask () {
431 427
       window.location.href = this.getUrl('customerSearch')
432 428
     },
429
+    locationMapping () {
430
+      wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
431
+        title: '城的空间',
432
+        desc: '城的空间',
433
+        link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
434
+        thu_image: `${window.location.origin}${window.location.pathname}${logo}`
435
+      }).then(() => {
436
+        wx.getLocation({
437
+          type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
438
+          success: function (res) {
439
+            let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
440
+            let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
441
+            for (let i = 0; i < this.CaseList.length; i++) {
442
+              let result = this.CaseList[i].Coordinate.split(",")
443
+              let latitude2 = parseFloat(result[0])
444
+              let longitude2 = parseFloat(result[1])
445
+              if (this.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
446
+                this.topCaseInfoData.caseName = this.CaseList[i].CaseName
447
+                this.topCaseInfoData.caseId = this.CaseList[i].CaseId
448
+                this.getCaseTableList({
449
+                  caseid: this.topCaseInfoData.caseId
450
+                })
451
+                this.getCaseTotal({
452
+                  caseid: this.topCaseInfoData.caseId
453
+                })
454
+              }
455
+            }
456
+            if (!this.topCaseInfoData.caseId || !this.topCaseInfoData.caseName){
457
+              this.topCaseInfoData.caseName = '当前位置无案场'
458
+            }
459
+          }
460
+        })
461
+      })
462
+    },
433 463
     beforeClose (action, done) {
434 464
       if (action === 'confirm') {
435 465
         setTimeout(done, 1000)

+ 2
- 2
src/pages/user/receive/index.vue Vedi File

@@ -140,11 +140,11 @@ export default {
140 140
       return `${rnd}${timestamp}`
141 141
     },
142 142
     sdk (info) {
143
-      let logo = this.logo.substring(2, this.logo.length)
143
+      let logo = this.data.Images[0].CouponImageUrl ? this.data.Images[0].CouponImageUrl : this.data.Images[0].CardImageUrl
144 144
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
145 145
         title: '领取卡券',
146 146
         desc: info,
147
-        link: `${window.location.origin}${window.location.pathname}#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/receive`,
147
+        link: `${window.location.origin}${window.location.pathname}/user.html#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/receive`,
148 148
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
149 149
       })
150 150
     }

+ 2
- 2
src/pages/user/receiveChannel/index.vue Vedi File

@@ -131,11 +131,11 @@ export default {
131 131
       }
132 132
     },
133 133
     sdk (info) {
134
-      let logo = this.logo.substring(2, this.logo.length)
134
+      let logo = this.data.Images[0].CouponImageUrl ? this.data.Images[0].CouponImageUrl : this.data.Images[0].CardImageUrl
135 135
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
136 136
         title: '领取卡券',
137 137
         desc: info,
138
-        link: `${window.location.origin}${window.location.pathname}#/receiveChannelShared/${this.$route.query.id}/${this.$route.query.type}/receive`,
138
+        link: `${window.location.origin}${window.location.pathname}/user.html#/receiveChannelShared/${this.$route.query.id}/${this.$route.query.type}/receive`,
139 139
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
140 140
       })
141 141
     }

+ 1
- 1
src/store/forbid/index.js Vedi File

@@ -110,7 +110,7 @@ export default {
110 110
         })
111 111
       })
112 112
     },
113
-    getCouponNum (context, data) {
113
+    getCouponNum (context, data) { 
114 114
       return new Promise((resolve, reject) => {
115 115
         Ajax(api.director.getCouponNum.url, {
116 116
           method: api.director.getCouponNum.method,

+ 0
- 1
src/util/ajax.js Vedi File

@@ -29,7 +29,6 @@ Axios.interceptors.request.use((config) => {
29 29
   config.headers.authorization = token()
30 30
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
31 31
   config.urlData = { ...config.urlData, org: 'MQ' }
32
-  let urlData = qs.stringify(config.urlData)
33 32
   let queryData = qs.stringify(config.queryData)
34 33
   // 判断是通过斜杠传参还是通过query传参
35 34
   if (config.url.indexOf(':') > -1) {

+ 8
- 0
src/util/api.js Vedi File

@@ -148,6 +148,14 @@ const $api = {
148 148
       method: 'get',
149 149
       url: `${baseUrl}${wechat}/user/detail/:id`
150 150
     },
151
+    getCardNum: {
152
+      method: 'get',
153
+      url: `${baseUrl}${wechat}/card/detail/:id`
154
+    },
155
+    getCouponNum: {
156
+      method: 'get',
157
+      url: `${baseUrl}${wechat}/coupon/detail/:id`
158
+    },
151 159
   },
152 160
   sales: {
153 161
     getCardList: { // 获取我的卡列表

+ 3
- 3
src/util/share.js Vedi File

@@ -30,15 +30,15 @@ function wxsdk (params, config) {
30 30
           'onMenuShareQQ',
31 31
           'onMenuShareWeibo',
32 32
           'onMenuShareQZone',
33
-          'openLocation'
33
+          'openLocation',
34
+          'getLocation'
34 35
         ]
35 36
       })
36 37
       wx.ready(function () {
37 38
         wx.onMenuShareTimeline(shareData)
38 39
         wx.onMenuShareAppMessage(shareData)
39
-        resolve()
40
+        resolve('success')
40 41
       })
41
-      // resolve(res)
42 42
     }).catch((err) => {
43 43
       reject(err)
44 44
     })

+ 4
- 4
src/util/util.js Vedi File

@@ -44,10 +44,10 @@ const toolClass = {
44 44
   /**
45 45
    * caculate the great circle distance
46 46
    * 经纬度计算距离
47
-   * @param {Object} lat1 度1
48
-   * @param {Object} lng1 度1
49
-   * @param {Object} lat2 度2
50
-   * @param {Object} lng2 度2
47
+   * @param {Object} lat1 度1
48
+   * @param {Object} lng1 度1
49
+   * @param {Object} lat2 度2
50
+   * @param {Object} lng2 度2
51 51
    */
52 52
 
53 53
   getGreatCircleDistance: (lat1, lng1, lat2, lng2) => {