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

+ 36
- 4
src/module/sales/coffeeIndex/index.vue Visa fil

@@ -9,13 +9,45 @@
9 9
     <div class="content flex-item">
10 10
       <div>
11 11
         <ul>
12
-          <li v-if="navActive === 0">
13
-            1
12
+          <li :hidden="navActive !== 0" class="placeOrder">
13
+            <div class="topInfo flex-h">
14
+              <div class="flex-item">
15
+                <div>
16
+                  <span>共计已使用:45杯</span>
17
+                </div>
18
+              </div>
19
+              <div class="flex-item">
20
+                <div>
21
+                  <span>本月已用:0杯</span>
22
+                </div>
23
+              </div>
24
+              <a>点单记录</a>
25
+            </div>
26
+            <div class="areaListParent flex-h">
27
+              <div class="flex-item">
28
+                <div>
29
+                  <ul class="areaList">
30
+                    <li v-for="(item,index) in list" :key="index">
31
+                      <div class="title">
32
+                        <i class="iconfont icon-yinchenglogo"></i>
33
+                        <span>{{item.name}}</span>
34
+                      </div>
35
+                      <ul class="subAreaList flex-h">
36
+                        <li class="flex-item flex-h" v-for="(subItem,subIndex) in item.list" :key="subIndex">
37
+                          <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
38
+                        </li>
39
+                        <li class="flex-item noData" v-if="item.list.length % 2 != 0"></li>
40
+                      </ul>
41
+                    </li>
42
+                  </ul>
43
+                </div>
44
+              </div>
45
+            </div>
14 46
           </li>
15
-          <li v-if="navActive === 1">
47
+          <li :hidden="navActive !== 1">
16 48
             2
17 49
           </li>
18
-          <li v-if="navActive === 2">
50
+          <li :hidden="navActive !== 2">
19 51
             3
20 52
           </li>
21 53
         </ul>

+ 100
- 1
src/module/sales/coffeeIndex/page.scss Visa fil

@@ -39,7 +39,106 @@
39 39
       top: 0;
40 40
       bottom: 0;
41 41
       overflow: hidden;
42
-      
42
+      &>ul{
43
+        width: 100%;
44
+        height: 100%;
45
+        position: relative;
46
+        overflow: hidden;
47
+        &>li{
48
+          width: 100%;
49
+          height: 100%;
50
+          position: relative;
51
+          overflow-y: scroll;
52
+          -webkit-overflow-scrolling: touch;
53
+          transform: translateZ(0);
54
+          -webkit-transform: translateZ(0);
55
+          &.placeOrder{
56
+            .topInfo{
57
+              align-items: center;
58
+              margin: .1rem auto 0;
59
+              >div{
60
+                >div{
61
+                  width: 100%;
62
+                  position: relative;
63
+                  overflow: hidden;
64
+                  span{
65
+                    width: 100%;
66
+                    display: block;
67
+                    text-indent: .2rem;
68
+                    line-height: .3rem;
69
+                    font-size: .14rem;
70
+                    color: #666;
71
+                  }
72
+                }
73
+              }
74
+              a{
75
+                line-height: .22rem;
76
+                font-size: .12rem;
77
+                color: #fc6243;
78
+                border: .01rem solid #fc6243;
79
+                padding: 0 .15rem;
80
+                border-radius: .05rem;
81
+                margin-right: .2rem;
82
+              }
83
+            }
84
+            .areaListParent{
85
+              position: relative;
86
+              overflow: visible;
87
+              >div{
88
+                margin: 0 .2rem;
89
+                position: relative;
90
+                overflow: visible;
91
+                >div{
92
+                  width: 100%;
93
+                  position: relative;
94
+                  overflow: visible;
95
+                  .areaList{
96
+                    &:last-child{
97
+                      margin-bottom: .2rem;
98
+                    }
99
+                    .title{
100
+                      font-size: 0;
101
+                      white-space: nowrap;
102
+                      margin-top: .22rem;
103
+                      *{
104
+                        line-height: .26rem;
105
+                        font-size: .14rem;
106
+                      }
107
+                      i{
108
+                        color: red;
109
+                        margin-right: .05rem;
110
+                      }
111
+                    }
112
+                    .subAreaList{
113
+                      position: relative;
114
+                      overflow: visible;
115
+                      flex-wrap: wrap;
116
+                      -webkit-flex-wrap: wrap;
117
+                      &>li{
118
+                        position: relative;
119
+                        overflow: hidden;
120
+                        border-radius: .06rem;
121
+                        background: #fff;
122
+                        padding: .15rem 0;
123
+                        box-shadow: 0 0 .1rem .01rem rgba(0, 0, 0, .1);
124
+                        min-width: 40%;
125
+                        margin-top: .2rem;
126
+                        &:nth-child(2n){
127
+                          margin-left: .2rem;
128
+                        }
129
+                        &.noData{
130
+                          box-shadow: none;
131
+                          background: none;
132
+                        }
133
+                      }
134
+                    }
135
+                  }
136
+                }
137
+              }
138
+            }
139
+          }
140
+        }
141
+      }
43 142
     }
44 143
   }
45 144
   .selectCase{

+ 170
- 0
src/module/sales/login/index.vue Visa fil

@@ -0,0 +1,170 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="mask">
4
+      <img :src="logo" class="logo" alt="">
5
+      <div class="centerLabel" style="width:100%;">
6
+        <div class="box" style="margin:0 auto;">
7
+          <div class="title">登录</div>
8
+
9
+          <div class="mobile">
10
+            <i class="iconfont icon-dianhua"></i>
11
+            <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
12
+          </div>
13
+
14
+          <div class="sms" style="margin-top:.2rem;">
15
+            <i class="iconfont icon-mima"></i>
16
+            <input type="number" maxlength="6" placeholder="验证码" v-model="postData.captcha">
17
+            <div class="sand" v-if="seconds === 60" @click="sandMsg">发送验证码</div>
18
+            <div class="sand" v-else>{{seconds}}后可重发</div>
19
+          </div>
20
+        </div>
21
+        <div class="submit" @click="submit">
22
+          <div>通过验证</div>
23
+        </div>
24
+      </div>
25
+
26
+      <transition name="slide">
27
+        <div class="select" v-if="showCase">
28
+          <van-picker
29
+            show-toolbar
30
+            title="请选择"
31
+            value-key='CaseName'
32
+            :columns="columns"
33
+            @cancel="onCancelC"
34
+            @confirm="onConfirmC"
35
+          />
36
+        </div>
37
+      </transition>
38
+      <transition name="slide">
39
+        <div class="select" v-if="showSales">
40
+          <van-picker
41
+            show-toolbar
42
+            title="请选择"
43
+            value-key='UserName'
44
+            :columns="columnsS"
45
+            @cancel="onCancelS"
46
+            @confirm="onConfirmS"
47
+          />
48
+        </div>
49
+      </transition>
50
+    </div>
51
+  </div>
52
+</template>
53
+
54
+<script>
55
+import logo from '../../../common/icon/logo.png'
56
+import { mapState, createNamespacedHelpers } from 'vuex'
57
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
58
+export default {
59
+  data () {
60
+    return {
61
+      logo,
62
+      showCase: false,
63
+      showSales: false,
64
+      columns: [],
65
+      columnsS: [],
66
+      caseName: '选择案场',
67
+      salesName: '选择销售',
68
+      seconds: 60,
69
+      postData: {
70
+        phone: '',
71
+        case: '',
72
+        sales: '',
73
+        captcha: ''
74
+      }
75
+    }
76
+  },
77
+  computed: {
78
+    ...mapState({
79
+      caseInfo: x => x.userCenter.caseInfo
80
+    })
81
+  },
82
+  created () {
83
+    this.getCaseInfo(1).then(() => {
84
+      this.columns = this.caseInfo.cases
85
+    })
86
+  },
87
+  methods: {
88
+    ...actions(['getCaseInfo']),
89
+    ...actions(['getCaptcha']),
90
+    ...actions(['submitData']),
91
+    onConfirmC (value, index) {
92
+      this.caseName = value.CaseName
93
+      this.postData.case = value.CaseId
94
+      this.columnsS = []
95
+      this.salesName = '选择销售'
96
+      if (this.caseInfo.sales) {
97
+        for (let i = 0; i < this.caseInfo.sales.length; i++) {
98
+          if (this.caseInfo.sales[i].CaseId === this.postData.case) {
99
+            this.columnsS.push(this.caseInfo.sales[i])
100
+          }
101
+        }
102
+      }
103
+      this.showCase = false
104
+    },
105
+    onCancelC () {
106
+      this.showCase = false
107
+    },
108
+    onConfirmS (value, index) {
109
+      this.salesName = value.UserName
110
+      this.postData.sales = value.UserId
111
+      this.showSales = false
112
+    },
113
+    onCancelS () {
114
+      this.showSales = false
115
+    },
116
+    selectCase () {
117
+      this.showCase = true
118
+    },
119
+    selectSales () {
120
+      if (!this.postData.case) {
121
+        this.$toast('请先选择案场')
122
+        return
123
+      } else if (this.columnsS.length <= 0) {
124
+        this.$toast('此案场无销售')
125
+        return
126
+      }
127
+      this.showSales = true
128
+    },
129
+    sandMsg () {
130
+      if (!this.postData.phone) {
131
+        this.$toast('请先填写手机号')
132
+        return
133
+      }
134
+      this.getCaptcha(this.postData.phone)
135
+      this.runTime()
136
+    },
137
+    runTime () {
138
+      setTimeout(() => {
139
+        this.seconds--
140
+        if (this.seconds < 60 && this.seconds >= 1) {
141
+          this.runTime()
142
+        } else if (this.seconds < 1) {
143
+          this.seconds = 60
144
+        }
145
+      }, 1000)
146
+    },
147
+    submit () {
148
+      if (!this.postData.captcha) {
149
+        this.$toast('请先获取验证码')
150
+        return
151
+      }
152
+      if (!this.postData.case) {
153
+        this.$toast('请选择案场')
154
+        return
155
+      }
156
+      if (!this.postData.sales) {
157
+        this.$toast('请选择销售')
158
+        return
159
+      }
160
+      this.submitData(this.postData).then((res) => {
161
+        this.$toast(res)
162
+      })
163
+    }
164
+  }
165
+}
166
+</script>
167
+
168
+<style lang="scss" scoped>
169
+@import "page.scss";
170
+</style>

+ 130
- 0
src/module/sales/login/page.scss Visa fil

@@ -0,0 +1,130 @@
1
+.mainPage {
2
+  background: url("../../../common/icon/bg.jpg") no-repeat 0 -0.8rem;
3
+  background-size: 100% calc(100% + 90px);
4
+  position: relative;
5
+  .mask{
6
+    width: 100%;
7
+    height: 100%;
8
+    display: flex;
9
+    justify-content: center;
10
+    align-items: center;
11
+    // background: rgba(0,0,0,0.3);
12
+    position: relative;
13
+    .logo{
14
+      position: absolute;
15
+      top: .5rem;
16
+      left: .3rem;
17
+      width: 1.8rem;
18
+    }
19
+    .select {
20
+      position: absolute;
21
+      bottom: 0;
22
+      left: 0;
23
+      width: 100%;
24
+    }
25
+    .box{
26
+      width: 3.25rem;
27
+      overflow: hidden;
28
+      background:rgba(255,255,255,1);
29
+      border-radius:8px;
30
+      padding: .2rem;
31
+      box-sizing: border-box;
32
+      .title{
33
+        font-size: .16rem;
34
+        font-weight: bold;
35
+        text-align: center;
36
+        padding-bottom: .24rem;
37
+      }
38
+      .mobile,.sms{
39
+        width: 2.85rem;
40
+        height: .5rem;
41
+        background:rgba(255,255,255,1);
42
+        border-radius:8px;
43
+        border:1px solid rgba(168,182,200,0.2);
44
+        display: flex;
45
+        align-items: center;
46
+        position: relative;
47
+        i{
48
+          color: rgba(168,182,200,1);
49
+          padding: .14rem;
50
+          font-size: .18rem;
51
+        }
52
+        input{
53
+          flex: 1;
54
+          height: 100%;
55
+        }
56
+        .sand{
57
+          padding: 0 .1rem;
58
+          height: .24rem;
59
+          border-radius:20px;
60
+          border:1px solid rgba(218,218,218,1);
61
+          color: rgba(218,218,218,1);
62
+          font-size: .12rem;
63
+          text-align: center;
64
+          line-height: .24rem;
65
+          position: absolute;
66
+          right: .1rem;
67
+        }
68
+      }
69
+      .recommend{
70
+        width: 2.85rem;
71
+        height: .4rem;
72
+        padding: .15rem 0;
73
+        display: flex;
74
+        align-items: center;
75
+        justify-content: space-between;
76
+        span{
77
+          color: rgba(168,182,200,1);
78
+        }
79
+        i{
80
+          color: rgba(168,182,200,1);
81
+          padding-left: .14rem;
82
+          font-size: .12rem;
83
+        }
84
+        div{
85
+          height: 100%;
86
+          display: flex;
87
+          flex: 1;
88
+          margin-left: .1rem;
89
+          align-items: center;
90
+          border-radius:8px;
91
+          border:1px solid rgba(168,182,200,0.2);
92
+          padding: .1rem;
93
+          box-sizing: border-box;
94
+          span{
95
+            width: 70%;
96
+            overflow:hidden;
97
+            text-overflow:ellipsis;
98
+            white-space:nowrap;
99
+          }
100
+        }
101
+      }
102
+    }
103
+    
104
+    .submit{
105
+      margin: .24rem auto 0;
106
+      width: 2.85rem;
107
+      height: .48rem;
108
+      border-radius:.04rem;
109
+      background: rgba(255,66,28,1);
110
+      text-align: center;
111
+      line-height: .48rem;
112
+      div{
113
+        font-size: .15rem;
114
+        color: #fff;
115
+      }
116
+    }
117
+  }
118
+}
119
+
120
+.slide-enter-active {
121
+  transition: all .3s ease;
122
+}
123
+.slide-leave-active {
124
+  transition: all .3s ease;
125
+}
126
+.slide-enter, .slide-leave-to
127
+/* .slide-fade-leave-active for below version 2.1.8 */ {
128
+  transform: translateY(2.6rem);
129
+  opacity: 0;
130
+}

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

@@ -1,6 +1,7 @@
1 1
 import Vue from 'vue'
2 2
 import Router from 'vue-router'
3 3
 
4
+import login from './login/index' // 登录
4 5
 import coffeeIndex from './coffeeIndex/index' // 点单首页
5 6
 import placeOrder from './placeOrder/index' // 城咖啡-点单
6 7
 
@@ -8,6 +9,11 @@ Vue.use(Router)
8 9
 
9 10
 const router = new Router({
10 11
   routes: [{
12
+    path: '/login',
13
+    name: 'login',
14
+    component: login,
15
+    children: []
16
+  },{
11 17
     path: '/coffeeIndex',
12 18
     name: 'coffeeIndex',
13 19
     component: coffeeIndex,