许成详 6 år sedan
förälder
incheckning
6bac98fba8

+ 14
- 6
src/components/orderListItem/index.vue Visa fil

@@ -1,16 +1,24 @@
1 1
 <template>
2 2
   <div class="orderListItem">
3 3
     <div class="title flex-h">
4
-      <div class="orange">
4
+      <div class="orange" v-if="data.status === 0">
5 5
         <i class="iconfont icon-dengdai"></i><br>
6 6
         <span>制作中</span>
7 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>
8 16
       <div class="flex-item">
9 17
         <div>
10
-          <span>悦见山</span>
18
+          <span>{{data.caseName}}</span>
11 19
         </div>
12 20
       </div>
13
-      <span>02/16 14:20</span>
21
+      <span>{{data.creatTime}}</span>
14 22
     </div>
15 23
     <div class="line">
16 24
       <div>
@@ -20,10 +28,10 @@
20 28
     <div class="list flex-h">
21 29
       <div class="flex-item">
22 30
         <ul>
23
-          <li>
24
-            <span>商品名称</span>
31
+          <li v-for="(subItem,subIndex) in data.goodsList" :key="subIndex">
32
+            <span>{{subItem.name}}</span>
25 33
             <div>
26
-              <span>¥20 x 2</span>
34
+              <span>¥{{subItem.price === null ? subItem.specPrice : subItem.price}} x {{subItem.num === null ? subItem.specNum : subItem.num}}</span>
27 35
             </div>
28 36
           </li>
29 37
         </ul>

+ 86
- 2
src/module/user/orderList/index.vue Visa fil

@@ -7,8 +7,8 @@
7 7
       <div class="flex-h">
8 8
         <div class="flex-item">
9 9
           <ul>
10
-            <li v-for="(item,index) in 10" :key="index">
11
-              <orderListItem></orderListItem>
10
+            <li v-for="(item,index) in list" :key="index">
11
+              <orderListItem :data="item"></orderListItem>
12 12
             </li>
13 13
           </ul>
14 14
         </div>
@@ -31,6 +31,90 @@ export default {
31 31
         showSelect: false,
32 32
         userName: 'xxx'
33 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
+      }],
34 118
     }
35 119
   },
36 120
   computed: {},

+ 2
- 1
src/module/user/placeOrder/index.vue Visa fil

@@ -66,7 +66,8 @@
66 66
           <i class="iconfont" :class="{'icon-jiantou-up': !showCalcMenu,'icon-jiantou-down': showCalcMenu}" @click="showCalcMenu = true"></i>
67 67
         </div>
68 68
       </div>
69
-      <a @click="showCalcMenu = true">下单</a>
69
+      <router-link :to="{name: 'placeOrderDetail', query: {info: JSON.stringify(settlementList)}}">下单</router-link>
70
+      <!-- <a @click="showCalcMenu = true">下单</a> -->
70 71
     </div>
71 72
     <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
72 73
     <calcMenu :show="showCalcMenu" :totalNum="totalCupNum" :data="settlementList" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>

+ 103
- 0
src/module/user/placeOrderDetail/index.vue Visa fil

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

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

+ 6
- 0
src/module/user/router.js Visa fil

@@ -8,6 +8,7 @@ import majorProjects from './majorProjects/index' // 项目专题
8 8
 import majorProjectsDetail from './majorProjectsDetail/index' // 项目专题
9 9
 import coffeeIndex from './mainPage/coffeeIndex/index' // 城咖啡
10 10
 import placeOrder from './placeOrder/index' // 城咖啡-点单
11
+import placeOrderDetail from './placeOrderDetail/index' // 城咖啡-点单详情
11 12
 import orderList from './orderList/index' // 城咖啡-点单列表
12 13
 import userCenter from './mainPage/userCenter/index' // 个人中心
13 14
 import bindMobile from './bindMobile/bindMobile' // 绑定手机号
@@ -47,6 +48,11 @@ const router = new Router({
47 48
     name: 'placeOrder',
48 49
     component: placeOrder,
49 50
     children: []
51
+  },{ // 城咖啡-点单详情
52
+    path: '/placeOrderDetail',
53
+    name: 'placeOrderDetail',
54
+    component: placeOrderDetail,
55
+    children: []
50 56
   },{ // 城咖啡-点单列表
51 57
     path: '/orderList',
52 58
     name: 'orderList',