许成详 преди 6 години
родител
ревизия
55b38d678c

+ 49
- 0
src/components/caseTableItem/index.vue Целия файл

@@ -0,0 +1,49 @@
1
+<template>
2
+  <div class="caseTableItem flex-h">
3
+    <i class="iconfont icon-yinchenglogo"></i>
4
+    <div class="itemNo">
5
+      <a>
6
+        <div class="centerLabel">
7
+          <i v-if="String(index + 1).length < 2" class="iconfont icon-0"></i>
8
+          <i class="iconfont" v-for="(numItem,numIndex) in String(index + 1).length" :key="numIndex" :class="'icon-' + String(index + 1).substring(numIndex, numIndex + 1)"></i>
9
+        </div>
10
+      </a>
11
+    </div>
12
+    <div class="flex-item">
13
+      <div>
14
+        <span>案场一号桌</span>
15
+        <router-link :to="{name: 'placeOrder', query: {}}">选择点单</router-link>
16
+      </div>
17
+    </div>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+
23
+export default {
24
+  name: '',
25
+  props: ['item','index'],
26
+  data () {
27
+    return {
28
+      
29
+    }
30
+  },
31
+  computed: {
32
+    
33
+  },
34
+  components: {
35
+    
36
+  },
37
+  created () {
38
+    
39
+  },
40
+  methods: {
41
+    
42
+  }
43
+}
44
+</script>
45
+
46
+<!-- Add "scoped" attribute to limit CSS to this component only -->
47
+<style lang="scss" scoped>
48
+@import "page.scss";
49
+</style>

+ 69
- 0
src/components/caseTableItem/page.scss Целия файл

@@ -0,0 +1,69 @@
1
+.caseTableItem{
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  align-items: center;
6
+  &>i{
7
+    display: inline-block;
8
+    position: absolute;
9
+    right: .1rem;
10
+    top: .05rem;
11
+    font-size: .36rem;
12
+    z-index: 1;
13
+    color: rgba(255, 0, 0, .1);
14
+  }
15
+  .itemNo{
16
+    width: .44rem;
17
+    position: relative;
18
+    overflow: hidden;
19
+    margin-left: .15rem;
20
+    z-index: 2;
21
+    a{
22
+      width: 100%;
23
+      display: block;
24
+      padding-bottom: 100%;
25
+      box-sizing: border-box;
26
+      border: .01rem solid #eee;
27
+      border-radius: 100%;
28
+      position: relative;
29
+      overflow: hidden;
30
+      div{
31
+        width: 100%;
32
+        text-align: center;
33
+        font-size: 0;
34
+        white-space: nowrap;
35
+        i{
36
+          display: inline-block;
37
+          font-size: .13rem;
38
+          color: #666;
39
+        }
40
+      }
41
+    }
42
+  }
43
+  &>div.flex-item{
44
+    margin: 0 .1rem;
45
+    position: relative;
46
+    overflow: hidden;
47
+    z-index: 2;
48
+    &>div{
49
+      width: 100%;
50
+      position: relative;
51
+      overflow: hidden;
52
+      span{
53
+        width: 100%;
54
+        display: block;
55
+        overflow: hidden;
56
+        text-overflow: ellipsis;
57
+        white-space: nowrap;
58
+        font-size: .13rem;
59
+        color: #666;
60
+        line-height: .24rem;
61
+      }
62
+      a{
63
+        line-height: .22rem;
64
+        color: #fb6b2f;
65
+        font-size: .13rem;
66
+      }
67
+    }
68
+  }
69
+}

+ 3
- 1
src/module/sales/App.vue Целия файл

@@ -1,5 +1,7 @@
1 1
 <template>
2
-  <div id="app"></div>
2
+  <div id="app">
3
+    <router-view></router-view>
4
+  </div>
3 5
 </template>
4 6
 
5 7
 <script>

+ 115
- 0
src/module/sales/coffeeIndex/index.vue Целия файл

@@ -0,0 +1,115 @@
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 v-if="navActive === 0">
13
+            1
14
+          </li>
15
+          <li v-if="navActive === 1">
16
+            2
17
+          </li>
18
+          <li v-if="navActive === 2">
19
+            3
20
+          </li>
21
+        </ul>
22
+      </div>
23
+    </div>
24
+    <div class="selectCase" :hidden="!showSelect"></div>
25
+    <van-picker :hidden="!showSelect"
26
+      show-toolbar
27
+      title="选择案场"
28
+      :columns="caseList"
29
+      @cancel="showSelect = false"
30
+      @confirm="selectCase"
31
+      value-key="value"
32
+    />
33
+  </div>
34
+</template>
35
+
36
+<script>
37
+import caseTableItem from '../../../components/caseTableItem/index'
38
+import topCaseInfo from '../../../components/topCaseInfo/index'
39
+
40
+export default {
41
+  name: '',
42
+  data () {
43
+    return {
44
+      navActive: 0,
45
+      cutNavList: [{
46
+        value: '城咖啡',
47
+        id: '1',
48
+      }, {
49
+        value: '我的卡券',
50
+        id: '2',
51
+      }, {
52
+        value: '我的客户',
53
+        id: '3',
54
+      }],
55
+      topCaseInfoData: {
56
+        caseName: '',
57
+        caseId: '',
58
+        showSelect: true,
59
+        userName: 'xxx'
60
+      },
61
+      caseInfo: {
62
+        value: '',
63
+        id: ''
64
+      },
65
+      showSelect: false,
66
+      caseList: [{
67
+        value: '案场一',
68
+        id: ''
69
+      }, {
70
+        value: '案场二',
71
+        id: ''
72
+      }, {
73
+        value: '案场三',
74
+        id: ''
75
+      }, {
76
+        value: '案场四',
77
+        id: ''
78
+      }],
79
+      list: [{
80
+        name: '案场名称1',
81
+        list: [{}, {}, {}, {}, {}],
82
+      }, {
83
+        name: '案场名称2',
84
+        list: [{}, {}, {}, {}, {}],
85
+      }]
86
+    }
87
+  },
88
+  computed: {
89
+
90
+  },
91
+  components: {
92
+    topCaseInfo,
93
+    caseTableItem,
94
+  },
95
+  created () {
96
+
97
+  },
98
+  methods: {
99
+    cutNav (index) { // 切换nav
100
+      this.navActive = index
101
+    },
102
+    selectCase (val) { // 选择案场
103
+      this.caseInfo = val
104
+      this.topCaseInfoData.caseName = val.value
105
+      this.topCaseInfoData.caseId = val.id
106
+      this.showSelect = false
107
+    },
108
+  }
109
+}
110
+</script>
111
+
112
+<!-- Add "scoped" attribute to limit CSS to this component only -->
113
+<style lang="scss" scoped>
114
+@import "page.scss";
115
+</style>

+ 54
- 0
src/module/sales/coffeeIndex/page.scss Целия файл

@@ -0,0 +1,54 @@
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
+      
43
+    }
44
+  }
45
+  .selectCase{
46
+    width: 100%;
47
+    position: absolute;
48
+    left: 0;
49
+    top: 0;
50
+    bottom: 0;
51
+    background: rgba(0, 0, 0, .3);
52
+    z-index: 100;
53
+  }
54
+}

+ 308
- 0
src/module/sales/placeOrder/index.vue Целия файл

@@ -0,0 +1,308 @@
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>项目名称:xxxx</span>
10
+            </div>
11
+          </div>
12
+          <span>xxx您好!</span>
13
+        </div>
14
+      </div>
15
+      <div class="tableInfo flex-h">
16
+        <div class="flex-item">
17
+          <div>
18
+            <span>桌号:案场11号桌</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
+      <!-- <router-link :to="{name: 'placeOrderDetail', query: {info: JSON.stringify(settlementList)}}">下单</router-link> -->
70
+      <a @click="showCalcMenu = true">下单</a>
71
+    </div>
72
+    <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
73
+    <calcMenu :show="showCalcMenu" :totalNum="totalCupNum" :data="settlementList" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import orderItem from '../../../components/orderItem/index'
79
+import orderPopup from '../../../components/orderPopup/index'
80
+import calcMenu from '../../../components/calcMenu/index'
81
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
82
+import 'swiper/dist/css/swiper.css'
83
+
84
+export default {
85
+  name: '',
86
+  data () {
87
+    const _self = this
88
+    return {
89
+      totalCupNum: 0, // 共计使用杯数
90
+      showCalcMenu: false, // 显隐已点菜单弹窗
91
+      currentSpec: null, // 当前选择规格
92
+      showPopup: false, // 显隐选规格弹窗
93
+      totalNum: 0, // 总杯数
94
+      totalPrice: 0, // 总价格
95
+      settlementList: [], // 商品选择清单
96
+      slideMenusActive: 0, // 左侧菜单选中索引值
97
+      menuList: [{ // 商品数据
98
+        value: '咖啡',
99
+        eValue: 'Coffee',
100
+        id: '1',
101
+        status: 1,
102
+        list: [{
103
+          img: '',
104
+          name: '商品名称',
105
+          id: '1-1',
106
+          status: 1,
107
+          spec: [{
108
+            value: '去冰',
109
+            id: '1-1-1',
110
+            num: 0,
111
+            status: 0,
112
+            price: '10',
113
+          }, {
114
+            value: '少冰',
115
+            id: '1-1-2',
116
+            num: 0,
117
+            status: 1,
118
+            price: '15',
119
+          }, {
120
+            value: '正常',
121
+            id: '1-1-3',
122
+            num: 0,
123
+            status: 1,
124
+            price: '20',
125
+          }, {
126
+            value: '多冰',
127
+            id: '1-1-4',
128
+            num: 0,
129
+            status: 1,
130
+            price: '25',
131
+          }],
132
+          price: '100',
133
+        }, {
134
+          img: '',
135
+          name: '商品名称',
136
+          id: '1-2',
137
+          spec: [],
138
+          status: 0,
139
+          price: '100',
140
+        }, {
141
+          img: '',
142
+          name: '商品名称',
143
+          id: '1-3',
144
+          spec: [],
145
+          status: 1,
146
+          price: '100',
147
+        }, {
148
+          img: '',
149
+          name: '商品名称',
150
+          id: '1-4',
151
+          spec: [],
152
+          status: 1,
153
+          price: '100',
154
+        }, {
155
+          img: '',
156
+          name: '商品名称',
157
+          id: '1-5',
158
+          spec: [],
159
+          status: 1,
160
+          price: '100',
161
+        }, {
162
+          img: '',
163
+          name: '商品名称',
164
+          id: '1-6',
165
+          spec: [],
166
+          status: 1,
167
+          price: '100',
168
+        }],
169
+      }, {
170
+        value: '咖啡一',
171
+        eValue: 'Coffee',
172
+        id: '2',
173
+        status: 1,
174
+        list: [],
175
+      }, {
176
+        value: '咖啡二',
177
+        eValue: 'Coffee',
178
+        id: '3',
179
+        status: 1,
180
+        list: [],
181
+      }, {
182
+        value: '咖啡三',
183
+        eValue: 'Coffee',
184
+        id: '4',
185
+        status: 1,
186
+        list: [],
187
+      }, {
188
+        value: '咖啡四',
189
+        eValue: 'Coffee',
190
+        id: '5',
191
+        status: 1,
192
+        list: [],
193
+      }],
194
+      swiperOption: {
195
+        observer: true,
196
+        direction: 'vertical',
197
+        on: {
198
+          transitionEnd () {
199
+            _self.slideMenusActive = this.activeIndex
200
+          },
201
+        }
202
+      },
203
+      subSwiperOption: {
204
+        observer: true,
205
+        direction: 'vertical',
206
+        nested: true,
207
+        slidesPerView: 'auto',
208
+        freeMode: true,
209
+        freeModeMomentumVelocityRatio: 2,
210
+      },
211
+    }
212
+  },
213
+  computed: {
214
+    MySwiper () {
215
+      return this.$refs.mySwiper.swiper
216
+    },
217
+    MySubSwiper () {
218
+      return this.$refs.mySubSwiper.swiper
219
+    },
220
+  },
221
+  components: {
222
+    swiper,
223
+    swiperSlide,
224
+    orderItem,
225
+    orderPopup,
226
+    calcMenu,
227
+  },
228
+  created () { },
229
+  methods: {
230
+    placeOrder () { // 下单
231
+      this.$router.push({name: 'orderList', query: {}})
232
+    },
233
+    closeCalcMenu () { // 关闭已选菜单
234
+      this.showCalcMenu = false
235
+    },
236
+    emptyMenus () { // 清空菜单
237
+      this.settlementList = []
238
+    },
239
+    closePopup () { // 关闭规格弹窗
240
+      this.showPopup = false
241
+      this.currentSpec = null
242
+    },
243
+    selectSpec (val) { // 选规格
244
+      this.currentSpec = val
245
+      this.showPopup = true
246
+    },
247
+    cutMenu (index) { // 切换菜单
248
+      this.MySwiper.slideTo(index, 300)
249
+    },
250
+    calcMenus (val) { // 计算清单
251
+      var bool = true, arr = this.settlementList.slice()
252
+      if (val.specId === null) {
253
+        for (var n = 0; n < arr.length; n++) {
254
+          if (arr[n].id === val.id && arr[n].specId === null) {
255
+            bool = false
256
+            arr[n] = val
257
+          }
258
+        }
259
+        if (bool) {
260
+          arr.push(val)
261
+        }
262
+      } else {
263
+        for (var n = 0; n < arr.length; n++) {
264
+          if (arr[n].specId === val.specId) {
265
+            bool = false
266
+            arr[n] = val
267
+          }
268
+        }
269
+        if (bool) {
270
+          arr.push(val)
271
+        }
272
+      }
273
+      for (var n = 0; n < arr.length; n++) {
274
+        if (arr[n].num === 0 || arr[n].defaultNum === 0) {
275
+          arr.splice(n, 1)
276
+        }
277
+      }
278
+      this.settlementList = arr
279
+      // console.log(JSON.stringify(this.settlementList))
280
+      this.calcTotalNum()
281
+    },
282
+    calcTotalNum () { // 计算总数量、价格
283
+      var num = 0, price = 0
284
+      if (!this.settlementList.length) {
285
+        this.totalNum = 0
286
+        this.totalPrice = 0
287
+        return
288
+      }
289
+      for (var n = 0; n < this.settlementList.length; n++) {
290
+        if (this.settlementList[n].specId === null) {
291
+          num += this.settlementList[n].defaultNum
292
+          price += this.settlementList[n].defaultPrice * this.settlementList[n].defaultNum
293
+        } else {
294
+          num += this.settlementList[n].num
295
+          price += this.settlementList[n].price * this.settlementList[n].num
296
+        }
297
+      }
298
+      this.totalNum = num
299
+      this.totalPrice = price
300
+    },
301
+  }
302
+}
303
+</script>
304
+
305
+<!-- Add "scoped" attribute to limit CSS to this component only -->
306
+<style lang="scss" scoped>
307
+@import "page.scss";
308
+</style>

+ 241
- 0
src/module/sales/placeOrder/page.scss Целия файл

@@ -0,0 +1,241 @@
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
+}

+ 28
- 0
src/module/sales/router.js Целия файл

@@ -0,0 +1,28 @@
1
+import Vue from 'vue'
2
+import Router from 'vue-router'
3
+
4
+import coffeeIndex from './coffeeIndex/index' // 点单首页
5
+import placeOrder from './placeOrder/index' // 城咖啡-点单
6
+
7
+Vue.use(Router)
8
+
9
+const router = new Router({
10
+  routes: [{
11
+    path: '/coffeeIndex',
12
+    name: 'coffeeIndex',
13
+    component: coffeeIndex,
14
+    children: []
15
+  },{
16
+    path: '/placeOrder',
17
+    name: 'placeOrder',
18
+    component: placeOrder,
19
+    children: []
20
+  }],
21
+})
22
+
23
+router.beforeEach((to, from, next) => {
24
+  
25
+  next()
26
+})
27
+
28
+export default router

+ 3
- 1
src/module/sales/sales.html Целия файл

@@ -2,7 +2,9 @@
2 2
 <html>
3 3
 <head>
4 4
   <meta charset="utf-8">
5
-  <title>sales</title>
5
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" charset="utf-8" />
6
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_w203meltjv9.css">
7
+  <title>城的空间</title>
6 8
 </head>
7 9
 <body>
8 10
 <div id="app"></div>

+ 13
- 2
src/module/sales/sales.js Целия файл

@@ -2,12 +2,23 @@ import Vue from 'vue'
2 2
 import App from './App'
3 3
 import Vant from 'vant'
4 4
 import 'vant/lib/vant-css/index.css'
5
+import router from './router'
6
+import store from '../../store/index'
7
+import Vuex from 'vuex'
8
+import Ajax from '../../util/ajax'
9
+import api from '../../util/api'
10
+import toolClass from '../../util/util'
5 11
 
6 12
 Vue.use(Vant)
7
-
13
+Vue.use(Vuex)
14
+Vue.prototype.$api = api
15
+Vue.prototype.$ajax = Ajax
16
+Vue.prototype.toolClass = toolClass
8 17
 /* eslint-disable no-new */
9 18
 new Vue({
10 19
   el: '#app',
11 20
   template: '<App/>',
12
-  components: { App }
21
+  components: { App },
22
+  router,
23
+  store,
13 24
 })

+ 8
- 18
src/module/user/mainPage/coffeeIndex/index.vue Целия файл

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="selectCase"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
5 5
     </div>
6 6
     <div class="content flex-item">
7 7
       <div>
@@ -15,21 +15,7 @@
15 15
                 </div>
16 16
                 <ul class="subAreaList flex-h">
17 17
                   <li class="flex-item flex-h" v-for="(subItem,subIndex) in item.list" :key="subIndex">
18
-                    <i class="iconfont icon-yinchenglogo"></i>
19
-                    <div class="itemNo">
20
-                      <a>
21
-                        <div class="centerLabel">
22
-                          <i v-if="String(subIndex + 1).length < 2" class="iconfont icon-0"></i>
23
-                          <i class="iconfont" v-for="(numItem,numIndex) in String(subIndex + 1).length" :key="numIndex" :class="'icon-' + String(subIndex + 1).substring(numIndex, numIndex + 1)"></i>
24
-                        </div>
25
-                      </a>
26
-                    </div>
27
-                    <div class="flex-item">
28
-                      <div>
29
-                        <span>案场一号桌</span>
30
-                        <router-link :to="{name: 'placeOrder', query: {}}">选择点单</router-link>
31
-                      </div>
32
-                    </div>
18
+                    <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
33 19
                   </li>
34 20
                   <li class="flex-item noData" v-if="item.list.length % 2 != 0"></li>
35 21
                 </ul>
@@ -52,6 +38,7 @@
52 38
 </template>
53 39
 
54 40
 <script>
41
+import caseTableItem from '../../../../components/caseTableItem/index'
55 42
 import topCaseInfo from '../../../../components/topCaseInfo/index'
56 43
 
57 44
 export default {
@@ -59,13 +46,13 @@ export default {
59 46
   data () {
60 47
     return {
61 48
       topCaseInfoData: {
62
-        caseName: 'xxx',
49
+        caseName: '',
63 50
         caseId: '',
64 51
         showSelect: true,
65 52
         userName: 'xxx'
66 53
       },
67 54
       caseInfo: {
68
-        value: '案场一',
55
+        value: '',
69 56
         id: ''
70 57
       },
71 58
       showSelect: false,
@@ -96,6 +83,7 @@ export default {
96 83
   },
97 84
   components: {
98 85
     topCaseInfo,
86
+    caseTableItem,
99 87
   },
100 88
   created () {
101 89
 
@@ -103,6 +91,8 @@ export default {
103 91
   methods: {
104 92
     selectCase (val) { // 选择案场
105 93
       this.caseInfo = val
94
+      this.topCaseInfoData.caseName = val.value
95
+      this.topCaseInfoData.caseId = val.id
106 96
       this.showSelect = false
107 97
     },
108 98
   }

+ 0
- 93
src/module/user/mainPage/coffeeIndex/page.scss Целия файл

@@ -2,35 +2,6 @@
2 2
   .top{
3 3
     position: relative;
4 4
     overflow: hidden;
5
-    // align-items: center;
6
-    // background: rgba(0, 0, 0, .3);
7
-    // padding: .05rem 0;
8
-    // &>*{
9
-    //   margin-left: .05rem;
10
-    //   line-height: .2rem;
11
-    //   font-size: .12rem;
12
-    //   color: #fff;
13
-    // }
14
-    // i{
15
-    //   font-size: .15rem;
16
-    // }
17
-    // a{
18
-    //   color: #fb6b2f;
19
-    //   text-decoration: underline;
20
-    //   margin-left: .1rem;
21
-    // }
22
-    // &>*:first-child{
23
-    //   margin-left: .2rem;
24
-    // }
25
-    // &>div{
26
-    //   text-align: right;
27
-    //   margin-right: .2rem;
28
-    //   font-size: 0;
29
-    //   span{
30
-    //     font-size: .12rem;
31
-    //     color: #fff;
32
-    //   }
33
-    // }
34 5
   }
35 6
   .content{
36 7
     &>div{
@@ -79,7 +50,6 @@
79 50
                 box-shadow: 0 0 .1rem .01rem rgba(0, 0, 0, .1);
80 51
                 min-width: 40%;
81 52
                 margin-top: .2rem;
82
-                align-items: center;
83 53
                 &:nth-child(2n){
84 54
                   margin-left: .2rem;
85 55
                 }
@@ -87,69 +57,6 @@
87 57
                   box-shadow: none;
88 58
                   background: none;
89 59
                 }
90
-                &>i{
91
-                  display: inline-block;
92
-                  position: absolute;
93
-                  right: .1rem;
94
-                  top: .05rem;
95
-                  font-size: .36rem;
96
-                  z-index: 1;
97
-                  color: rgba(255, 0, 0, .1);
98
-                }
99
-                .itemNo{
100
-                  width: .44rem;
101
-                  position: relative;
102
-                  overflow: hidden;
103
-                  margin-left: .15rem;
104
-                  z-index: 2;
105
-                  a{
106
-                    width: 100%;
107
-                    display: block;
108
-                    padding-bottom: 100%;
109
-                    box-sizing: border-box;
110
-                    border: .01rem solid #eee;
111
-                    border-radius: 100%;
112
-                    position: relative;
113
-                    overflow: hidden;
114
-                    div{
115
-                      width: 100%;
116
-                      text-align: center;
117
-                      font-size: 0;
118
-                      white-space: nowrap;
119
-                      i{
120
-                        display: inline-block;
121
-                        font-size: .13rem;
122
-                        color: #666;
123
-                      }
124
-                    }
125
-                  }
126
-                }
127
-                &>div.flex-item{
128
-                  margin: 0 .1rem;
129
-                  position: relative;
130
-                  overflow: hidden;
131
-                  z-index: 2;
132
-                  &>div{
133
-                    width: 100%;
134
-                    position: relative;
135
-                    overflow: hidden;
136
-                    span{
137
-                      width: 100%;
138
-                      display: block;
139
-                      overflow: hidden;
140
-                      text-overflow: ellipsis;
141
-                      white-space: nowrap;
142
-                      font-size: .13rem;
143
-                      color: #666;
144
-                      line-height: .24rem;
145
-                    }
146
-                    a{
147
-                      line-height: .22rem;
148
-                      color: #fb6b2f;
149
-                      font-size: .13rem;
150
-                    }
151
-                  }
152
-                }
153 60
               }
154 61
             }
155 62
           }