瀏覽代碼

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

yuantianjiao 6 年之前
父節點
當前提交
9cd167b848

+ 5
- 0
package-lock.json 查看文件

@@ -5206,6 +5206,11 @@
5206 5206
       "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
5207 5207
       "dev": true
5208 5208
     },
5209
+    "qrcodejs2": {
5210
+      "version": "0.0.2",
5211
+      "resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
5212
+      "integrity": "sha1-Rlr+Xjnxn6zsuTLBH3oYYQkUauE="
5213
+    },
5209 5214
     "qs": {
5210 5215
       "version": "6.5.1",
5211 5216
       "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",

+ 1
- 0
package.json 查看文件

@@ -11,6 +11,7 @@
11 11
   "dependencies": {
12 12
     "better-scroll": "^1.12.6",
13 13
     "node-sass": "^4.9.3",
14
+    "qrcodejs2": "0.0.2",
14 15
     "sass-loader": "^7.1.0",
15 16
     "swiper": "^4.3.5",
16 17
     "vant": "^1.1.16",

+ 4
- 0
src/common/css/reset.css 查看文件

@@ -65,4 +65,8 @@ select option {
65 65
 
66 66
 .van-toast div{
67 67
 	color: white;
68
+}
69
+
70
+.van-picker{
71
+	z-index: 101;
68 72
 }

+ 77
- 0
src/components/calcMenu/index.vue 查看文件

@@ -0,0 +1,77 @@
1
+<template>
2
+  <div class="calcMenu" :class="{'show':show}">
3
+    <div class="centerLabel flex-h">
4
+      <div class="flex-item">
5
+        <div>
6
+          <div class="top">
7
+            <span>确认下单信息</span>
8
+            <span>下单完成后共计使用<em>{{totalNum}}</em>次</span>
9
+          </div>
10
+          <div class="content">
11
+            <span v-if="!data.length">您还没有点单哦~</span>  
12
+            <ul>
13
+              <li class="flex-h" v-for="(item,index) in data" :key="index">
14
+                <span>{{item.name}}</span>
15
+                <span v-if="item.specName !== null">({{item.specName}})</span>
16
+                <div class="flex-item">
17
+                  <div>
18
+                    <span>x{{item.defaultNum === null ? item.num : item.defaultNum}}</span>
19
+                  </div>
20
+                </div>
21
+              </li>
22
+            </ul>
23
+          </div>
24
+          <div class="bottom">
25
+            <div class="flex-h" v-if="data.length">
26
+              <span>备注:</span>
27
+              <div class="flex-item">
28
+                <div>
29
+                  <textarea cols="30" rows="3"></textarea>
30
+                </div>
31
+              </div>
32
+            </div>
33
+            <ul class="flex-h">
34
+              <li class="flex-item" @click="close">再看看</li>
35
+              <li class="flex-item" @click="placeOrder">下单</li>
36
+            </ul>
37
+          </div>
38
+        </div>
39
+      </div>
40
+    </div>
41
+  </div>
42
+</template>
43
+
44
+<script>
45
+
46
+export default {
47
+  name: '',
48
+  props: ['show', 'data', 'totalNum'],
49
+  data () {
50
+    return {
51
+
52
+    }
53
+  },
54
+  computed: {
55
+
56
+  },
57
+  components: {
58
+
59
+  },
60
+  created () {
61
+
62
+  },
63
+  methods: {
64
+    close () { // 关闭菜单
65
+      this.$emit('closeCalcMenu')
66
+    },
67
+    placeOrder () { // 点单
68
+      this.$emit('placeOrder')
69
+    },
70
+  }
71
+}
72
+</script>
73
+
74
+<!-- Add "scoped" attribute to limit CSS to this component only -->
75
+<style lang="scss" scoped>
76
+@import "page.scss";
77
+</style>

+ 148
- 0
src/components/calcMenu/page.scss 查看文件

@@ -0,0 +1,148 @@
1
+.calcMenu{
2
+  width: 100%;
3
+  position: absolute;
4
+  left: 0;
5
+  bottom: 0;
6
+  top: 0;
7
+  background: rgba(0, 0, 0, .5);
8
+  z-index: 500;
9
+  display: none;
10
+  &.show{
11
+    display: block;
12
+  }
13
+  &>div{
14
+    width: 3.2rem;
15
+    border-radius: .1rem;
16
+    background: #fff;
17
+    position: absolute;
18
+    overflow: hidden;
19
+    &>div{
20
+      margin: 0 .2rem;
21
+      &>div{
22
+        width: 100%;
23
+        position: relative;
24
+        overflow: hidden;
25
+        .top{
26
+          width: 100%;
27
+          position: relative;
28
+          overflow: hidden;
29
+          margin: .1rem auto 0;
30
+          padding-bottom: .05rem;
31
+          border-bottom: .01rem solid #eee;
32
+          span{
33
+            width: 100%;
34
+            display: block;
35
+            text-align: center;
36
+            font-size: .11rem;
37
+            color: #666;
38
+            line-height: .22rem;
39
+            &:first-child{
40
+              line-height: .26rem;
41
+              font-size: .15rem;
42
+              color: #333;
43
+            }
44
+            em{
45
+              color: #f1644b;
46
+              font-size: .11rem;
47
+            }
48
+          }
49
+        }
50
+        .content{
51
+          width: 100%;
52
+          max-height: 2rem;
53
+          position: relative;
54
+          overflow-y: scroll;
55
+          -webkit-overflow-scrolling: touch;
56
+          transform: translateZ(0);
57
+          -webkit-transform: translateZ(0);
58
+          border-bottom: .01rem solid #eee;
59
+          padding-bottom: .1rem;
60
+          &>span{
61
+            width: 100%;
62
+            display: block;
63
+            line-height: .4rem;
64
+            text-align: center;
65
+            font-size: .15rem;
66
+            color: #ccc;
67
+          }
68
+          ul{
69
+            margin: .1rem auto 0;
70
+            li{
71
+              &>*{
72
+                line-height: .34rem;
73
+                font-size: .14rem;
74
+                &:first-child{
75
+                  width: 30%;
76
+                  text-align: center;
77
+                }
78
+                &:nth-child(2){
79
+                  font-size: .11rem;
80
+                  color: #666;
81
+                }
82
+              }
83
+              &>div{
84
+                margin-right: .2rem;
85
+                &>div{
86
+                  width: 100%;
87
+                  position: relative;
88
+                  overflow: hidden;
89
+                  span{
90
+                    width: 100%;
91
+                    display: block;
92
+                    text-align: right;
93
+                    font-size: .14rem;
94
+                    color: #666;
95
+                  }
96
+                }
97
+              }
98
+            }
99
+          }
100
+        }
101
+        .bottom{
102
+          margin: .1rem auto 0;
103
+          &>div.flex-h{
104
+            align-items: flex-start;
105
+            &>span{
106
+              line-height: .2rem;
107
+              font-size: .13rem;
108
+              color: #666;
109
+            }
110
+            &>div{
111
+              &>div{
112
+                width: 100%;
113
+                position: relative;
114
+                overflow: hidden;
115
+                textarea{
116
+                  width: 100%;
117
+                  line-height: .2rem;
118
+                  font-size: .13rem;
119
+                  color: #666;
120
+                }
121
+              }
122
+            }
123
+          }
124
+          ul{
125
+            width: 100%;
126
+            position: relative;
127
+            overflow: hidden;
128
+            margin-bottom: .25rem;
129
+            li{
130
+              line-height: .36rem;
131
+              border: .01rem solid #333;
132
+              padding: 0 .15rem;
133
+              font-size: .15rem;
134
+              border-radius: .04rem;
135
+              text-align: center;
136
+              &:nth-child(1){
137
+                margin-right: .1rem;
138
+              }
139
+              &:nth-child(2){
140
+                margin-left: .1rem;
141
+              }
142
+            }
143
+          }
144
+        }
145
+      }
146
+    }
147
+  }
148
+}

+ 86
- 0
src/components/orderItem/index.vue 查看文件

@@ -0,0 +1,86 @@
1
+<template>
2
+  <div class="orderItem flex-h">
3
+    <div class="img">
4
+      <a>
5
+        <img src="" class="centerLabel cover" alt="">
6
+      </a>
7
+    </div>
8
+    <div class="content flex-item flex-v">
9
+      <div class="flex-item">
10
+        <div>
11
+          <span>{{data.name}}</span>
12
+        </div>
13
+      </div>
14
+      <div class="flex-h">
15
+        <div class="flex-item">
16
+          <div>
17
+            <span>¥{{data.price}}</span>
18
+          </div>
19
+        </div>
20
+        <i class="iconfont icon-jian" @click="subtract" v-if="!data.spec.length && data.status === 1"></i>
21
+        <input v-if="!data.spec.length && data.status === 1" type="tel" @input="input" v-model="defaultNum">
22
+        <i class="iconfont icon-jia" :class="{'active': defaultNum > 0}" @click="add" v-if="!data.spec.length && data.status === 1"></i>
23
+        <a v-if="data.spec.length && data.status === 1" @click="selectSpec">选规格</a>
24
+        <span v-if="data.status !== 1">已售罄</span>
25
+      </div>
26
+    </div>
27
+  </div>
28
+</template>
29
+
30
+<script>
31
+
32
+export default {
33
+  name: '',
34
+  props: ['data'],
35
+  data () {
36
+    return {
37
+      defaultNum: 0,
38
+    }
39
+  },
40
+  computed: {
41
+
42
+  },
43
+  components: {
44
+
45
+  },
46
+  created () {
47
+
48
+  },
49
+  methods: {
50
+    add () { // 增加
51
+      this.defaultNum += 1
52
+      this.select()
53
+    },
54
+    subtract () { // 减少
55
+      if (this.defaultNum > 0) this.defaultNum -= 1; this.select()
56
+    },
57
+    input () { // 输入
58
+      if (Number(this.defaultNum)) {
59
+        this.select()
60
+      } else {
61
+
62
+      }
63
+    },
64
+    select () { // 返回数据
65
+      this.$emit('returnData', {
66
+        name: this.data.name,
67
+        id: this.data.id,
68
+        specId: null,
69
+        specName: null,
70
+        num: null,
71
+        defaultNum: Number(this.defaultNum),
72
+        price: null,
73
+        defaultPrice: this.data.price,
74
+      })
75
+    },
76
+    selectSpec () { // 选规格
77
+      this.$emit('selectSpec', this.data)
78
+    },
79
+  }
80
+}
81
+</script>
82
+
83
+<!-- Add "scoped" attribute to limit CSS to this component only -->
84
+<style lang="scss" scoped>
85
+@import "page.scss";
86
+</style>

+ 74
- 0
src/components/orderItem/page.scss 查看文件

@@ -0,0 +1,74 @@
1
+.orderItem{
2
+  .img{
3
+    width: .72rem;
4
+    position: relative;
5
+    overflow: hidden;
6
+    margin: 0 .1rem;
7
+    a{
8
+      width: 100%;
9
+      display: block;
10
+      padding-bottom: 100%;
11
+      background: #eee;
12
+      border-radius: .04rem;
13
+      position: relative;
14
+      overflow: hidden;
15
+    }
16
+  }
17
+  &>.flex-item{
18
+    margin-right: .15rem;
19
+    &>div.flex-item{
20
+      &>div{
21
+        width: 100%;
22
+        position: relative;
23
+        overflow: hidden;
24
+        span{
25
+          width: 100%;
26
+          display: block;
27
+          line-height: .22rem;
28
+          font-size: .13rem;
29
+          overflow: hidden;
30
+          white-space: nowrap;
31
+          text-overflow: ellipsis;
32
+        }
33
+      }
34
+    }
35
+    &>div.flex-h{
36
+      &>div{
37
+        &>div{
38
+          span{
39
+            width: 100%;
40
+            line-height: .2rem;
41
+            font-size: .11rem;
42
+          }
43
+        }
44
+      }
45
+      i{
46
+        font-size: .18rem;
47
+        line-height: .2rem;
48
+        color: #ccc;
49
+        &.active{
50
+          color: red;
51
+        }
52
+      }
53
+      input{
54
+        width: .4rem;
55
+        line-height: .18rem;
56
+        text-align: center;
57
+        margin: 0 .05rem;
58
+      }
59
+      a{
60
+        display: inline-block;
61
+        line-height: .2rem;
62
+        font-size: .11rem;
63
+        padding: 0 .15rem;
64
+        border-radius: .2rem;
65
+        background: #fc6243;
66
+        color: #fff;
67
+      }
68
+      &>span{
69
+        font-size: .13rem;
70
+        color: #666;
71
+      }
72
+    }
73
+  }
74
+}

+ 71
- 0
src/components/orderListItem/index.vue 查看文件

@@ -0,0 +1,71 @@
1
+<template>
2
+  <div class="orderListItem">
3
+    <div class="title flex-h">
4
+      <div class="orange" v-if="data.status === 0">
5
+        <i class="iconfont icon-dengdai"></i><br>
6
+        <span>制作中</span>
7
+      </div>
8
+      <div class="grey" v-if="data.status === 1">
9
+        <i class="iconfont icon-quxiao"></i><br>
10
+        <span>已取消</span>
11
+      </div>
12
+      <div class="green" v-if="data.status === 2">
13
+        <i class="iconfont icon-gouxuan"></i><br>
14
+        <span>已完成</span>
15
+      </div>
16
+      <div class="flex-item">
17
+        <div>
18
+          <span>{{data.caseName}}</span>
19
+        </div>
20
+      </div>
21
+      <span>{{data.creatTime}}</span>
22
+    </div>
23
+    <div class="line">
24
+      <div>
25
+        <i v-for="(iconItem,iconIndex) in 40" :key="iconIndex"></i>
26
+      </div>
27
+    </div>
28
+    <div class="list flex-h">
29
+      <div class="flex-item">
30
+        <ul>
31
+          <li v-for="(subItem,subIndex) in data.goodsList" :key="subIndex">
32
+            <span>{{subItem.name}}</span>
33
+            <div>
34
+              <span>¥{{subItem.price === null ? subItem.specPrice : subItem.price}} x {{subItem.num === null ? subItem.specNum : subItem.num}}</span>
35
+            </div>
36
+          </li>
37
+        </ul>
38
+      </div>
39
+    </div>
40
+  </div>
41
+</template>
42
+
43
+<script>
44
+
45
+export default {
46
+  name: '',
47
+  props: ['data'],
48
+  data () {
49
+    return {
50
+
51
+    }
52
+  },
53
+  computed: {
54
+
55
+  },
56
+  components: {
57
+
58
+  },
59
+  created () {
60
+
61
+  },
62
+  methods: {
63
+    
64
+  }
65
+}
66
+</script>
67
+
68
+<!-- Add "scoped" attribute to limit CSS to this component only -->
69
+<style lang="scss" scoped>
70
+@import "page.scss";
71
+</style>

+ 120
- 0
src/components/orderListItem/page.scss 查看文件

@@ -0,0 +1,120 @@
1
+.orderListItem{
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  .title{
6
+    width: 100%;
7
+    position: relative;
8
+    overflow: hidden;
9
+    align-items: center;
10
+    &>div:nth-child(1){
11
+      width: .5rem;
12
+      text-align: center;
13
+      *{
14
+        display: inline-block;
15
+        font-size: .1rem;
16
+        line-height: .17rem;
17
+      }
18
+      i{
19
+        font-size: .15rem;
20
+      }
21
+    }
22
+    &>div:nth-child(1).orange{
23
+      *{
24
+        color: #fc6243;
25
+      }
26
+    }
27
+    &>div:nth-child(1).grey{
28
+      *{
29
+        color: #ccc;
30
+      }
31
+    }
32
+    &>div:nth-child(1).green{
33
+      *{
34
+        color: #63c86f;
35
+      }
36
+    }
37
+    &>div:nth-child(2){
38
+      margin-right: .1rem;
39
+      &>div{
40
+        width: 100%;
41
+        position: relative;
42
+        overflow: hidden;
43
+        span{
44
+          width: 100%;
45
+          display: block;
46
+          font-size: .14rem;
47
+          overflow: hidden;
48
+          text-overflow: ellipsis;
49
+          white-space: nowrap;
50
+        }
51
+      }
52
+    }
53
+    &>span{
54
+      font-size: .11rem;
55
+      color: #666;
56
+      margin-right: .15rem;
57
+    }
58
+  }
59
+  .line{
60
+    width: 100%;
61
+    height: .2rem;
62
+    position: relative;
63
+    overflow: hidden;
64
+    &>div{
65
+      width: 100%;
66
+      position: absolute;
67
+      overflow: hidden;
68
+      left: 0;
69
+      top: 50%;
70
+      transform: translateY(-50%) translateX(-.035rem);
71
+      -webkit-transform: translateY(-50%) translateX(-.035rem);
72
+      font-size: 0;
73
+      white-space: nowrap;
74
+      i{
75
+        display: inline-block;
76
+        width: .07rem;
77
+        height: .07rem;
78
+        position: relative;
79
+        overflow: hidden;
80
+        border-radius: 100%;
81
+        background: #eee;
82
+        margin-right: .1rem;
83
+      }
84
+    }
85
+  }
86
+  .list{
87
+    &>div{
88
+      margin: 0 .15rem;
89
+      &>ul{
90
+        margin: .06rem auto;
91
+        &>li{
92
+          font-size: 0;
93
+          white-space: nowrap;
94
+          &>*{
95
+            display: inline-block;
96
+            vertical-align: middle;
97
+            width: 50%;
98
+            overflow: hidden;
99
+            text-overflow: ellipsis;
100
+            white-space: nowrap;
101
+          }
102
+          &>span{
103
+            line-height: .26rem;
104
+            font-size: .14rem;
105
+            color: #555;
106
+          }
107
+          &>div{
108
+            text-align: right;
109
+            font-size: 0;
110
+            span{
111
+              font-size: .11rem;
112
+              line-height: .26rem;
113
+              color: #666;
114
+            }
115
+          }
116
+        }
117
+      }
118
+    }
119
+  }
120
+}

+ 115
- 0
src/components/orderPopup/index.vue 查看文件

@@ -0,0 +1,115 @@
1
+<template>
2
+  <div class="orderPopup" :class="{'show':show}">
3
+    <div class="centerLabel" v-if="data !== null">
4
+      <div class="top">
5
+        <span>{{data.name}}</span>
6
+        <i class="iconfont icon-guanbi" @click="close"></i>
7
+      </div>
8
+      <div class="content flex-h">
9
+        <div class="flex-item">
10
+          <div>
11
+            <span>规格:</span>
12
+            <ul>
13
+              <li v-for="(item,index) in data.spec" :class="{'active': index === activeIndex, 'grey': item.status !== 1}" :key="index" @click="selectItem(item, index)">{{item.value}}</li>
14
+            </ul>
15
+          </div>
16
+        </div>
17
+      </div>
18
+      <div class="bottom flex-h">
19
+        <div class="flex-item">
20
+          <div>
21
+            <span>¥{{price * num}}</span>
22
+          </div>
23
+        </div>
24
+        <i class="iconfont icon-jian" @click="subtract"></i>
25
+        <input type="tel" v-model="num">
26
+        <i class="iconfont icon-jia" @click="add"></i>
27
+        <a @click="sure">确定</a>
28
+      </div>
29
+      <!-- <a class="sure">确定</a> -->
30
+    </div>
31
+  </div>
32
+</template>
33
+
34
+<script>
35
+
36
+export default {
37
+  name: '',
38
+  props: ['show', 'data'],
39
+  data () {
40
+    return {
41
+      activeIndex: '',
42
+      price: 0,
43
+      num: 1,
44
+      specId: '',
45
+      specName: '',
46
+    }
47
+  },
48
+  computed: {
49
+
50
+  },
51
+  components: {
52
+
53
+  },
54
+  created () {
55
+
56
+  },
57
+  methods: {
58
+    sure () { // 确定
59
+      if (this.activeIndex === '' || this.price === 0 || this.num < 1) {
60
+        return false
61
+      }
62
+      this.$emit('returnData', {
63
+        name: this.data.name,
64
+        id: this.data.id,
65
+        specId: this.specId,
66
+        specName: this.specName,
67
+        num: this.num,
68
+        defaultNum: null,
69
+        price: this.price,
70
+        defaultPrice: null,
71
+      })
72
+      this.close()
73
+    },
74
+    subtract () { // 减
75
+      if (this.num > 1) {
76
+        this.num -= 1
77
+      }
78
+    },
79
+    add () { // 加
80
+      this.num += 1
81
+    },
82
+    selectItem (item, index) { // 选择规格
83
+      if (item.status === 1) {
84
+        if (this.activeIndex === index) {
85
+          this.activeIndex = ''
86
+          this.price = 0
87
+          this.specId = ''
88
+          this.specName = ''
89
+        } else {
90
+          this.activeIndex = index
91
+          this.price = item.price
92
+          this.specId = item.id
93
+          this.specName = item.value
94
+        }
95
+      }
96
+    },
97
+    close () { // 关闭弹窗
98
+      this.$emit('closePopup')
99
+      this.resetData()
100
+    },
101
+    resetData () { // 重置状态
102
+      this.activeIndex = ''
103
+      this.price = 0
104
+      this.num = 1
105
+      this.specName = ''
106
+      this.specId = ''
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>

+ 139
- 0
src/components/orderPopup/page.scss 查看文件

@@ -0,0 +1,139 @@
1
+.orderPopup{
2
+  width: 100%;
3
+  position: absolute;
4
+  left: 0;
5
+  bottom: 0;
6
+  top: 0;
7
+  background: rgba(0, 0, 0, .5);
8
+  z-index: 500;
9
+  display: none;
10
+  &.show{
11
+    display: block;
12
+  }
13
+  &>.centerLabel{
14
+    width: 3.35rem;
15
+    background: #fff;
16
+    border-radius: .08rem;
17
+    overflow: hidden;
18
+    .top{
19
+      width: 100%;
20
+      position: relative;
21
+      overflow: hidden;
22
+      margin: .1rem auto 0;
23
+      span{
24
+        width: 100%;
25
+        display: block;
26
+        line-height: .28rem;
27
+        text-align: center;
28
+        font-size: .17rem;
29
+      }
30
+      i{
31
+        display: inline-block;
32
+        position: absolute;
33
+        top: 50%;
34
+        transform: translateY(-50%);
35
+        -webkit-transform: translateY(-50%);
36
+        right: .1rem;
37
+        font-size: .2rem;
38
+        color: #999;
39
+      }
40
+    }
41
+    .content{
42
+      width: 100%;
43
+      position: relative;
44
+      overflow: hidden;
45
+      &>div{
46
+        margin: 0 .2rem;
47
+        &>div{
48
+          width: 100%;
49
+          position: relative;
50
+          overflow: hidden;
51
+          &>span{
52
+            width: 100%;
53
+            display: block;
54
+            line-height: .26rem;
55
+            font-size: .14rem;
56
+            color: #666;
57
+            margin: .24rem auto 0;
58
+          }
59
+          ul{
60
+            font-size: 0;
61
+            li{
62
+              display: inline-block;
63
+              line-height: .32rem;
64
+              padding: 0 .15rem;
65
+              font-size: .14rem;
66
+              color: #666;
67
+              border: .01rem solid #eee;
68
+              border-radius: .04rem;
69
+              margin: .1rem .1rem 0 0;
70
+              &.active{
71
+                color: #fc6243;
72
+                border-color: #fc6243;
73
+              }
74
+              &.grey{
75
+                color: #ccc;
76
+                border-color: #eee;
77
+                border-style: dashed;
78
+              }
79
+            }
80
+          }
81
+        }
82
+      }
83
+    }
84
+    .bottom{
85
+      background: #f2f2f2;
86
+      margin-top: .3rem;
87
+      align-items: center;
88
+      &>div{
89
+        &>div{
90
+          width: 100%;
91
+          position: relative;
92
+          overflow: hidden;
93
+          span{
94
+            width: 100%;
95
+            display: block;
96
+            text-indent: .2rem;
97
+            line-height: .5rem;
98
+            font-size: .15rem;
99
+            color: #fc6243;
100
+          }
101
+        }
102
+      }
103
+      i{
104
+        font-size: .2rem;
105
+        color: #fc6243;
106
+        margin-left: .1rem;
107
+        &:last-child{
108
+          margin-right: .2rem;
109
+        }
110
+      }
111
+      input{
112
+        width: .3rem;
113
+        background: none;
114
+        line-height: .2rem;
115
+        font-size: .13rem;
116
+        text-align: center;
117
+        margin-left: .1rem;
118
+      }
119
+      a{
120
+        display: inline-block;
121
+        line-height: .5rem;
122
+        background: #fc6243;
123
+        color: #fff;
124
+        font-size: .15rem;
125
+        padding: 0 .3rem;
126
+        margin-left: .3rem;
127
+      }
128
+    }
129
+    .sure{
130
+      width: 100%;
131
+      display: block;
132
+      line-height: .5rem;
133
+      text-align: center;
134
+      background: #fc6243;
135
+      color: #fff;
136
+      font-size: .15rem;
137
+    }
138
+  }
139
+}

+ 42
- 0
src/components/topCaseInfo/index.vue 查看文件

@@ -0,0 +1,42 @@
1
+<template>
2
+  <div class="topCaseInfo flex-h">
3
+    <i class="iconfont icon-dingwei"></i>
4
+      <span>{{data.caseName}}</span>
5
+      <a v-if="data.showSelect" @click="selectCase">请选择</a>
6
+      <div class="flex-item">
7
+        <span>{{data.userName}}您好!</span>
8
+      </div>
9
+  </div>
10
+</template>
11
+
12
+<script>
13
+
14
+export default {
15
+  name: '',
16
+  props: ['data'],
17
+  data () {
18
+    return {
19
+
20
+    }
21
+  },
22
+  computed: {
23
+
24
+  },
25
+  components: {
26
+
27
+  },
28
+  created () {
29
+
30
+  },
31
+  methods: {
32
+    selectCase () { // 选择案场
33
+      this.$emit('selectCase')
34
+    },
35
+  }
36
+}
37
+</script>
38
+
39
+<!-- Add "scoped" attribute to limit CSS to this component only -->
40
+<style lang="scss" scoped>
41
+@import "page.scss";
42
+</style>

+ 31
- 0
src/components/topCaseInfo/page.scss 查看文件

@@ -0,0 +1,31 @@
1
+.topCaseInfo{
2
+  align-items: center;
3
+  background: rgba(0, 0, 0, .3);
4
+  padding: .05rem 0;
5
+  &>*{
6
+    margin-left: .05rem;
7
+    line-height: .2rem;
8
+    font-size: .12rem;
9
+    color: #fff;
10
+  }
11
+  i{
12
+    font-size: .15rem;
13
+  }
14
+  a{
15
+    color: #fb6b2f;
16
+    text-decoration: underline;
17
+    margin-left: .1rem;
18
+  }
19
+  &>*:first-child{
20
+    margin-left: .2rem;
21
+  }
22
+  &>div{
23
+    text-align: right;
24
+    margin-right: .2rem;
25
+    font-size: 0;
26
+    span{
27
+      font-size: .12rem;
28
+      color: #fff;
29
+    }
30
+  }
31
+}

+ 56
- 21
src/module/user/mainPage/coffeeIndex/index.vue 查看文件

@@ -1,38 +1,37 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3
-    <div class="top flex-h">
4
-      <i class="iconfont icon-dingwei"></i>
5
-      <span>南京</span>
6
-      <a>请选择</a>
7
-      <div class="flex-item">
8
-        <span>Alise您好!</span>
9
-      </div>
3
+    <div class="top">
4
+      <topCaseInfo :data="topCaseInfoData" @selectCase="selectCase"></topCaseInfo>
10 5
     </div>
11 6
     <div class="content flex-item">
12 7
       <div>
13 8
         <div class="flex-h">
14 9
           <div class="flex-item">
15 10
             <ul class="areaList">
16
-              <li v-for="(item,index) in 10" :key="index">
11
+              <li v-for="(item,index) in list" :key="index">
17 12
                 <div class="title">
18 13
                   <i class="iconfont icon-yinchenglogo"></i>
19
-                  <span>悦见山区域一</span>
14
+                  <span>{{item.name}}</span>
20 15
                 </div>
21 16
                 <ul class="subAreaList flex-h">
22
-                  <li class="flex-item flex-h" v-for="(subItem,subIndex) in 10" :key="subIndex">
17
+                  <li class="flex-item flex-h" v-for="(subItem,subIndex) in item.list" :key="subIndex">
23 18
                     <i class="iconfont icon-yinchenglogo"></i>
24 19
                     <div class="itemNo">
25 20
                       <a>
26
-                        <div class="centerLabel" v-html="returnNo(subIndex)"></div>
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>
27 25
                       </a>
28 26
                     </div>
29 27
                     <div class="flex-item">
30 28
                       <div>
31 29
                         <span>案场一号桌</span>
32
-                        <a>选择点单</a>
30
+                        <router-link :to="{name: 'placeOrder', query: {}}">选择点单</router-link>
33 31
                       </div>
34 32
                     </div>
35 33
                   </li>
34
+                  <li class="flex-item noData" v-if="item.list.length % 2 != 0"></li>
36 35
                 </ul>
37 36
               </li>
38 37
             </ul>
@@ -40,35 +39,71 @@
40 39
         </div>
41 40
       </div>
42 41
     </div>
42
+    <div class="selectCase" :hidden="!showSelect"></div>
43
+    <van-picker :hidden="!showSelect"
44
+      show-toolbar
45
+      title="选择案场"
46
+      :columns="caseList"
47
+      @cancel="showSelect = false"
48
+      @confirm="selectCase"
49
+      value-key="value"
50
+    />
43 51
   </div>
44 52
 </template>
45 53
 
46 54
 <script>
55
+import topCaseInfo from '../../../../components/topCaseInfo/index'
47 56
 
48 57
 export default {
49 58
   name: '',
50 59
   data () {
51 60
     return {
52
-
61
+      topCaseInfoData: {
62
+        caseName: 'xxx',
63
+        caseId: '',
64
+        showSelect: true,
65
+        userName: 'xxx'
66
+      },
67
+      caseInfo: {
68
+        value: '案场一',
69
+        id: ''
70
+      },
71
+      showSelect: false,
72
+      caseList: [{
73
+        value: '案场一',
74
+        id: ''
75
+      }, {
76
+        value: '案场二',
77
+        id: ''
78
+      }, {
79
+        value: '案场三',
80
+        id: ''
81
+      }, {
82
+        value: '案场四',
83
+        id: ''
84
+      }],
85
+      list: [{
86
+        name: '案场名称1',
87
+        list: [{}, {}, {}, {}, {}],
88
+      }, {
89
+        name: '案场名称2',
90
+        list: [{}, {}, {}, {}, {}],
91
+      }]
53 92
     }
54 93
   },
55 94
   computed: {
56 95
 
57 96
   },
58 97
   components: {
59
-
98
+    topCaseInfo,
60 99
   },
61 100
   created () {
62 101
 
63 102
   },
64 103
   methods: {
65
-    returnNo (index) { // 返回桌号
66
-      index = String(index + 1)
67
-      let aHtml = ''
68
-      for (var n = 0; n < index.length; n++) {
69
-        aHtml += '<i class="iconfont icon-' + index.substring(n, n + 1) + '" style="display: inline-block;font-size: .13rem;color: #666;"></i>'
70
-      }
71
-      return index.length > 1 ? aHtml : '<i class="iconfont icon-0" style="display: inline-block;font-size: .13rem;color: #666;"></i>' + aHtml
104
+    selectCase (val) { // 选择案场
105
+      this.caseInfo = val
106
+      this.showSelect = false
72 107
     },
73 108
   }
74 109
 }

+ 44
- 29
src/module/user/mainPage/coffeeIndex/page.scss 查看文件

@@ -1,34 +1,36 @@
1 1
 .mainPage{
2 2
   .top{
3
-    align-items: center;
4
-    background: rgba(0, 0, 0, .3);
5
-    padding: .05rem 0;
6
-    &>*{
7
-      margin-left: .05rem;
8
-      line-height: .2rem;
9
-      font-size: .12rem;
10
-      color: #fff;
11
-    }
12
-    i{
13
-      font-size: .15rem;
14
-    }
15
-    a{
16
-      color: #fb6b2f;
17
-      text-decoration: underline;
18
-      margin-left: .1rem;
19
-    }
20
-    &>*:first-child{
21
-      margin-left: .2rem;
22
-    }
23
-    &>div{
24
-      text-align: right;
25
-      margin-right: .2rem;
26
-      font-size: 0;
27
-      span{
28
-        font-size: .12rem;
29
-        color: #fff;
30
-      }
31
-    }
3
+    position: relative;
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
+    // }
32 34
   }
33 35
   .content{
34 36
     &>div{
@@ -81,6 +83,10 @@
81 83
                 &:nth-child(2n){
82 84
                   margin-left: .2rem;
83 85
                 }
86
+                &.noData{
87
+                  box-shadow: none;
88
+                  background: none;
89
+                }
84 90
                 &>i{
85 91
                   display: inline-block;
86 92
                   position: absolute;
@@ -151,4 +157,13 @@
151 157
       }
152 158
     }
153 159
   }
160
+  .selectCase{
161
+    width: 100%;
162
+    position: absolute;
163
+    left: 0;
164
+    top: 0;
165
+    bottom: 0;
166
+    background: rgba(0, 0, 0, .3);
167
+    z-index: 100;
168
+  }
154 169
 }

+ 135
- 0
src/module/user/orderList/index.vue 查看文件

@@ -0,0 +1,135 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="top">
4
+      <topCaseInfo :data="topCaseInfoData"></topCaseInfo>
5
+    </div>
6
+    <div class="flex-item">
7
+      <div class="flex-h">
8
+        <div class="flex-item">
9
+          <ul>
10
+            <li v-for="(item,index) in list" :key="index">
11
+              <orderListItem :data="item"></orderListItem>
12
+            </li>
13
+          </ul>
14
+        </div>
15
+      </div>
16
+    </div>
17
+  </div>
18
+</template>
19
+
20
+<script>
21
+import topCaseInfo from '../../../components/topCaseInfo/index'
22
+import orderListItem from '../../../components/orderListItem/index'
23
+
24
+export default {
25
+  name: '',
26
+  data () {
27
+    return {
28
+      topCaseInfoData: {
29
+        caseName: 'xxx',
30
+        caseId: '',
31
+        showSelect: false,
32
+        userName: 'xxx'
33
+      },
34
+      list: [{
35
+        status: 0,
36
+        caseName: '案场名称',
37
+        creatTime: '02/16 14:20',
38
+        goodsList: [{
39
+          name: '商品名称1',
40
+          specName: '加冰',
41
+          price: null,
42
+          specPrice: 20,
43
+          num: null,
44
+          specNum: 2,
45
+        },{
46
+          name: '商品名称2',
47
+          specName: null,
48
+          price: 100,
49
+          specPrice: null,
50
+          num: 1,
51
+          specNum: null,
52
+        },{
53
+          name: '商品名称3',
54
+          specName: null,
55
+          price: 100,
56
+          specPrice: null,
57
+          num: 1,
58
+          specNum: null,
59
+        },{
60
+          name: '商品名称4',
61
+          specName: null,
62
+          price: 100,
63
+          specPrice: null,
64
+          num: 1,
65
+          specNum: null,
66
+        },{
67
+          name: '商品名称5',
68
+          specName: null,
69
+          price: 100,
70
+          specPrice: null,
71
+          num: 1,
72
+          specNum: null,
73
+        },{
74
+          name: '商品名称6',
75
+          specName: null,
76
+          price: 100,
77
+          specPrice: null,
78
+          num: 1,
79
+          specNum: null,
80
+        }],
81
+      },{
82
+        status: 1,
83
+        caseName: '案场名称',
84
+        creatTime: '02/16 14:20',
85
+        goodsList: [{
86
+          name: '商品名称1',
87
+          specName: '加冰',
88
+          price: null,
89
+          specPrice: 20,
90
+          num: null,
91
+          specNum: 2,
92
+        }],
93
+      },{
94
+        status: 2,
95
+        caseName: '案场名称',
96
+        creatTime: '02/16 14:20',
97
+        goodsList: [{
98
+          name: '商品名称1',
99
+          specName: '加冰',
100
+          price: null,
101
+          specPrice: 20,
102
+          num: null,
103
+          specNum: 2,
104
+        }],
105
+      },{
106
+        status: 0,
107
+        caseName: '案场名称',
108
+        creatTime: '02/16 14:20',
109
+        goodsList: [{
110
+          name: '商品名称1',
111
+          specName: '加冰',
112
+          price: null,
113
+          specPrice: 20,
114
+          num: null,
115
+          specNum: 2,
116
+        }],
117
+      }],
118
+    }
119
+  },
120
+  computed: {},
121
+  components: {
122
+    topCaseInfo,
123
+    orderListItem,
124
+  },
125
+  created () { },
126
+  methods: {
127
+    
128
+  }
129
+}
130
+</script>
131
+
132
+<!-- Add "scoped" attribute to limit CSS to this component only -->
133
+<style lang="scss" scoped>
134
+@import "page.scss";
135
+</style>

+ 150
- 0
src/module/user/orderList/page.scss 查看文件

@@ -0,0 +1,150 @@
1
+.mainPage{
2
+  &>div.flex-item{
3
+    &>div{
4
+      width: 100%;
5
+      position: absolute;
6
+      left: 0;
7
+      top: 0;
8
+      bottom: 0;
9
+      overflow-y: scroll;
10
+      -webkit-overflow-scrolling: touch;
11
+      transform: translateZ(0);
12
+      -webkit-transform: translateZ(0);
13
+      &>div{
14
+        margin: 0 .25rem;
15
+        overflow: visible;
16
+        &>ul{
17
+          width: 100%;
18
+          position: relative;
19
+          overflow: visible;
20
+          margin-bottom: .25rem;
21
+          &>li{
22
+            width: 100%;
23
+            position: relative;
24
+            overflow: hidden;
25
+            border-radius: .1rem;
26
+            background: #fff;
27
+            box-shadow: 0 0 .2rem .02rem rgba(0, 0, 0, .1);
28
+            padding: .08rem 0;
29
+            margin: .25rem auto 0;
30
+            // .title{
31
+            //   width: 100%;
32
+            //   position: relative;
33
+            //   overflow: hidden;
34
+            //   align-items: center;
35
+            //   &>div:nth-child(1){
36
+            //     width: .5rem;
37
+            //     text-align: center;
38
+            //     *{
39
+            //       display: inline-block;
40
+            //       font-size: .1rem;
41
+            //       line-height: .17rem;
42
+            //     }
43
+            //     i{
44
+            //       font-size: .15rem;
45
+            //     }
46
+            //   }
47
+            //   &>div:nth-child(1).orange{
48
+            //     *{
49
+            //       color: #fc6243;
50
+            //     }
51
+            //   }
52
+            //   &>div:nth-child(1).grey{
53
+            //     *{
54
+            //       color: #ccc;
55
+            //     }
56
+            //   }
57
+            //   &>div:nth-child(1).green{
58
+            //     *{
59
+            //       color: #63c86f;
60
+            //     }
61
+            //   }
62
+            //   &>div:nth-child(2){
63
+            //     margin-right: .1rem;
64
+            //     &>div{
65
+            //       width: 100%;
66
+            //       position: relative;
67
+            //       overflow: hidden;
68
+            //       span{
69
+            //         width: 100%;
70
+            //         display: block;
71
+            //         font-size: .14rem;
72
+            //         overflow: hidden;
73
+            //         text-overflow: ellipsis;
74
+            //         white-space: nowrap;
75
+            //       }
76
+            //     }
77
+            //   }
78
+            //   &>span{
79
+            //     font-size: .11rem;
80
+            //     color: #666;
81
+            //     margin-right: .15rem;
82
+            //   }
83
+            // }
84
+            // .line{
85
+            //   width: 100%;
86
+            //   height: .2rem;
87
+            //   position: relative;
88
+            //   overflow: hidden;
89
+            //   &>div{
90
+            //     width: 100%;
91
+            //     position: absolute;
92
+            //     overflow: hidden;
93
+            //     left: 0;
94
+            //     top: 50%;
95
+            //     transform: translateY(-50%) translateX(-.035rem);
96
+            //     -webkit-transform: translateY(-50%) translateX(-.035rem);
97
+            //     font-size: 0;
98
+            //     white-space: nowrap;
99
+            //     i{
100
+            //       display: inline-block;
101
+            //       width: .07rem;
102
+            //       height: .07rem;
103
+            //       position: relative;
104
+            //       overflow: hidden;
105
+            //       border-radius: 100%;
106
+            //       background: #eee;
107
+            //       margin-right: .1rem;
108
+            //     }
109
+            //   }
110
+            // }
111
+            // .list{
112
+            //   &>div{
113
+            //     margin: 0 .15rem;
114
+            //     &>ul{
115
+            //       margin: .06rem auto;
116
+            //       &>li{
117
+            //         font-size: 0;
118
+            //         white-space: nowrap;
119
+            //         &>*{
120
+            //           display: inline-block;
121
+            //           vertical-align: middle;
122
+            //           width: 50%;
123
+            //           overflow: hidden;
124
+            //           text-overflow: ellipsis;
125
+            //           white-space: nowrap;
126
+            //         }
127
+            //         &>span{
128
+            //           line-height: .26rem;
129
+            //           font-size: .14rem;
130
+            //           color: #555;
131
+            //         }
132
+            //         &>div{
133
+            //           text-align: right;
134
+            //           font-size: 0;
135
+            //           span{
136
+            //             font-size: .11rem;
137
+            //             line-height: .26rem;
138
+            //             color: #666;
139
+            //           }
140
+            //         }
141
+            //       }
142
+            //     }
143
+            //   }
144
+            // }
145
+          }
146
+        }
147
+      }
148
+    }
149
+  }
150
+}

+ 308
- 0
src/module/user/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/user/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
+}

+ 103
- 0
src/module/user/placeOrderDetail/index.vue 查看文件

@@ -0,0 +1,103 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="content">
4
+      <h2>确认下单信息</h2>
5
+      <div class="list flex-h">
6
+        <div class="flex-item">
7
+          <ul>
8
+            <li class="flex-h" v-for="(item,index) in 10" :key="index">
9
+              <div class="flex-item">
10
+                <div><span>美式特浓</span></div>
11
+              </div>
12
+              <div class="flex-item">
13
+                <div><span>加冰</span></div>
14
+              </div>
15
+              <div class="flex-item">
16
+                <div><span>x1</span></div>
17
+              </div>
18
+              <div class="flex-item">
19
+                <div><span>¥20</span></div>
20
+              </div>
21
+            </li>
22
+            <li class="flex-h">
23
+              <div class="flex-item">
24
+                <div><span>选择商品券</span></div>
25
+              </div>
26
+              <a class="active" @click="showSelect = true">
27
+                <span>{{postData.ticketName === '' ? '1张饮品券' : postData.ticketName}}</span>
28
+                <i class="iconfont icon-jiantou-right"></i>
29
+              </a>
30
+            </li>
31
+          </ul>
32
+        </div>
33
+      </div>
34
+      <h6>添加备注</h6>
35
+      <div class="remark flex-h">
36
+        <div class="flex-item flex-h">
37
+          <div class="flex-h">
38
+            <textarea class="flex-item" cols="30" rows="10"></textarea>
39
+          </div>
40
+        </div>
41
+      </div>
42
+      <span>下单人:小五子 18267901393</span>
43
+      <div class="bottom">
44
+        <a>取消</a>
45
+        <a>确定</a>
46
+      </div>
47
+    </div>
48
+    <div class="selectLayer" :class="{'show': showSelect}">
49
+      <div>
50
+        <van-picker
51
+          show-toolbar
52
+          title="选择优惠券"
53
+          :columns="ticketList"
54
+          @cancel="showSelect = false"
55
+          @confirm="onConfirm"
56
+          value-key="value"
57
+        />
58
+      </div>
59
+    </div>
60
+  </div>
61
+</template>
62
+
63
+<script>
64
+
65
+export default {
66
+  name: '',
67
+  data () {
68
+    return {
69
+      postData: {
70
+        ticketId: '',
71
+        ticketName: '',
72
+      },
73
+      ticketList: [{
74
+        value: '优惠券1',
75
+        id: '1',
76
+      }, {
77
+        value: '优惠券2',
78
+        id: '2',
79
+      }, {
80
+        value: '优惠券3',
81
+        id: '3',
82
+      }],
83
+      showSelect: false,
84
+      orderInfo: JSON.parse(this.$route.query.info)
85
+    }
86
+  },
87
+  created () {
88
+
89
+  },
90
+  methods: {
91
+    onConfirm (value, index) {
92
+      this.postData.ticketName = value.value
93
+      this.postData.ticketId = value.id
94
+      this.showSelect = false
95
+    },
96
+  }
97
+}
98
+</script>
99
+
100
+<!-- Add "scoped" attribute to limit CSS to this component only -->
101
+<style lang="scss" scoped>
102
+@import "page.scss";
103
+</style>

+ 170
- 0
src/module/user/placeOrderDetail/page.scss 查看文件

@@ -0,0 +1,170 @@
1
+.mainPage{
2
+  >div.content{
3
+    width: 100%;
4
+    position: absolute;
5
+    left: 0;
6
+    top: 0;
7
+    bottom: 0;
8
+    overflow-y: scroll;
9
+    -webkit-overflow-scrolling: touch;
10
+    transform: translateZ(0);
11
+    -webkit-transform: translateZ(0);
12
+    >h2{
13
+      width: 100%;
14
+      display: block;
15
+      line-height: .3rem;
16
+      font-size: .17rem;
17
+      text-align: center;
18
+      margin: .28rem auto 0;
19
+    }
20
+    .list{
21
+      >div.flex-item{
22
+        margin: 0 .2rem;
23
+        position: relative;
24
+        overflow: hidden;
25
+        &>ul{
26
+          width: 100%;
27
+          position: relative;
28
+          overflow: hidden;
29
+          margin: .18rem auto 0;
30
+          &>li{
31
+            align-items: center;
32
+            padding: .08rem 0;
33
+            border-bottom: .01rem solid #eee;
34
+            >div{
35
+              >div{
36
+                width: 100%;
37
+                position: relative;
38
+                overflow: hidden;
39
+                >span{
40
+                  width: 100%;
41
+                  display: block;
42
+                  line-height: .26rem;
43
+                  font-size: .11rem;
44
+                  text-align: right;
45
+                }
46
+              }
47
+              &:nth-child(1){
48
+                >div{
49
+                  span{
50
+                    text-align: left;
51
+                    font-size: .14rem;
52
+                    overflow: hidden;
53
+                    text-overflow: ellipsis;
54
+                    white-space: nowrap;
55
+                  }
56
+                }
57
+              }
58
+              &:nth-child(2){
59
+                margin: 0 .05rem;
60
+                >div{
61
+                  span{
62
+                    text-align: center;
63
+                    color: #666;
64
+                    overflow: hidden;
65
+                    text-overflow: ellipsis;
66
+                    white-space: nowrap;
67
+                  }
68
+                }
69
+              }
70
+            }
71
+            a{
72
+              font-size: 0;
73
+              white-space: nowrap;
74
+              *{
75
+                display: inline-block;
76
+                line-height: .26rem;
77
+                font-size: .11rem;
78
+                color: #ccc;
79
+              }
80
+              &.active{
81
+                *{
82
+                  color: #fd684a;
83
+                  font-size: .14rem;
84
+                }
85
+              }
86
+            }
87
+          }
88
+        }
89
+      }
90
+    }
91
+    h6{
92
+      width: 100%;
93
+      display: block;
94
+      line-height: .34rem;
95
+      font-size: .14rem;
96
+      text-indent: .2rem;
97
+      margin: .3rem auto 0;
98
+    }
99
+    .remark{
100
+      >div{
101
+        margin: 0 .2rem;
102
+        >div{
103
+          width: 100%;
104
+          position: relative;
105
+          overflow: hidden;
106
+          background: #f2f2f2;
107
+          border-radius: .06rem;
108
+          textarea{
109
+            margin: 0 .1rem;
110
+            width: 100%;
111
+            line-height: .2rem;
112
+            padding: .1rem 0;
113
+            background: none;
114
+          }
115
+        }
116
+      }
117
+    }
118
+    >span{
119
+      width: 100%;
120
+      display: block;
121
+      line-height: .36rem;
122
+      font-size: .13rem;
123
+      color: #666;
124
+      text-indent: .2rem;
125
+    }
126
+    .bottom{
127
+      width: 100%;
128
+      position: relative;
129
+      overflow: hidden;
130
+      text-align: center;
131
+      font-size: 0;
132
+      white-space: nowrap;
133
+      margin: .1rem auto .4rem;
134
+      a{
135
+        display: inline-block;
136
+        line-height: .32rem;
137
+        border-radius: .05rem;
138
+        border: .01rem solid #333;
139
+        padding: 0 .4rem;
140
+        font-size: .15rem;
141
+        color: #333;
142
+        &:nth-child(2){
143
+          color: #fd684a;
144
+          border-color: #fd684a;
145
+          margin-left: .4rem;
146
+        }
147
+      }
148
+    }
149
+  }
150
+  .selectLayer{
151
+    width: 100%;
152
+    position: absolute;
153
+    left: 0;
154
+    top: 0;
155
+    bottom: 0;
156
+    z-index: 100;
157
+    background: rgba(0,0,0,.5);
158
+    display: none;
159
+    &.show{
160
+      display: block;
161
+    }
162
+    >div{
163
+      width: 100%;
164
+      position: absolute;
165
+      left: 0;
166
+      bottom: 0;
167
+      overflow: hidden;
168
+    }
169
+  }
170
+}

+ 18
- 0
src/module/user/router.js 查看文件

@@ -7,6 +7,9 @@ import fiveA from './fiveA/index' // 5A
7 7
 import majorProjects from './majorProjects/index' // 项目专题
8 8
 import majorProjectsDetail from './majorProjectsDetail/index' // 项目专题
9 9
 import coffeeIndex from './mainPage/coffeeIndex/index' // 城咖啡
10
+import placeOrder from './placeOrder/index' // 城咖啡-点单
11
+import placeOrderDetail from './placeOrderDetail/index' // 城咖啡-点单详情
12
+import orderList from './orderList/index' // 城咖啡-点单列表
10 13
 import userCenter from './mainPage/userCenter/index' // 个人中心
11 14
 import bindMobile from './bindMobile/bindMobile' // 绑定手机号
12 15
 import lessonOrder from './lessonOrder/index' // 我的订单
@@ -40,6 +43,21 @@ const router = new Router({
40 43
       component: userCenter,
41 44
       children: []
42 45
     }]
46
+  },{ // 城咖啡-点单
47
+    path: '/placeOrder',
48
+    name: 'placeOrder',
49
+    component: placeOrder,
50
+    children: []
51
+  },{ // 城咖啡-点单详情
52
+    path: '/placeOrderDetail',
53
+    name: 'placeOrderDetail',
54
+    component: placeOrderDetail,
55
+    children: []
56
+  },{ // 城咖啡-点单列表
57
+    path: '/orderList',
58
+    name: 'orderList',
59
+    component: orderList,
60
+    children: []
43 61
   },{ // 项目专题
44 62
     path: '/majorProjects',
45 63
     name: 'majorProjects',

+ 1
- 1
src/module/user/user.html 查看文件

@@ -3,7 +3,7 @@
3 3
 <head>
4 4
   <meta charset="utf-8">
5 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_mdkkdwmio2.css">
6
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_w203meltjv9.css">
7 7
   <title>城的空间</title>
8 8
 </head>
9 9
 <body>