瀏覽代碼

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

wangfei 6 年之前
父節點
當前提交
28c7969614
共有 40 個檔案被更改,包括 1228 行新增227 行删除
  1. 二進制
      public/favicon.ico
  2. 1
    1
      public/index.html
  3. 4
    0
      src/common/css/reset.css
  4. 二進制
      src/common/icon/qrCode.jpg
  5. 二進制
      src/common/icon/vipBg.jpg
  6. 16
    0
      src/components/customerCard/customerCard.vue
  7. 2
    1
      src/components/myCard/myCard.vue
  8. 3
    1
      src/components/topCaseInfo/index.vue
  9. 4
    2
      src/components/topCaseInfo/page.scss
  10. 2
    1
      src/pages/sales/cardAndCouponNum/index.vue
  11. 61
    3
      src/pages/sales/customerSearch/index.vue
  12. 41
    14
      src/pages/sales/history/index.vue
  13. 1
    1
      src/pages/sales/salesGiveOutDetail/index.vue
  14. 124
    83
      src/pages/user/bindMobile/bindMobile.vue
  15. 3
    3
      src/pages/user/bindMobile/page.scss
  16. 94
    40
      src/pages/user/mainPage/coffeeIndex/index.vue
  17. 11
    4
      src/pages/user/mainPage/index.vue
  18. 9
    3
      src/pages/user/mainPage/userCenter/index.vue
  19. 7
    1
      src/pages/user/mainPage/userCenter/page.scss
  20. 15
    2
      src/pages/user/majorProjectsDetail/index.vue
  21. 5
    3
      src/pages/user/orderList/index.vue
  22. 52
    13
      src/pages/user/placeOrder/index.vue
  23. 3
    26
      src/pages/user/placeOrderDetail/index.vue
  24. 6
    14
      src/pages/user/placeOrderForCourse/index.vue
  25. 7
    1
      src/pages/user/receive/index.vue
  26. 11
    0
      src/pages/user/router.js
  27. 145
    0
      src/pages/user/rush/index.vue
  28. 139
    0
      src/pages/user/rush/page.scss
  29. 87
    0
      src/pages/user/vipDetail/index.vue
  30. 86
    0
      src/pages/user/vipDetail/page.scss
  31. 8
    1
      src/store/case/case.js
  32. 3
    0
      src/store/index.js
  33. 20
    3
      src/store/majorProjects/majorProjects.js
  34. 22
    3
      src/store/placeOrderForCoffee/index.js
  35. 50
    0
      src/store/remark/index.js
  36. 77
    0
      src/store/rush/index.js
  37. 24
    1
      src/store/userCenter/userCenter.js
  38. 30
    0
      src/store/vip/index.js
  39. 54
    2
      src/util/api.js
  40. 1
    0
      vue.config.js

二進制
public/favicon.ico 查看文件


+ 1
- 1
public/index.html 查看文件

6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
8
     charset="utf-8" />
8
     charset="utf-8" />
9
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_q841vrk4ihm.css">
9
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_s109s6ry4gl.css">
10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
11
   <title>
11
   <title>
12
     <%= htmlWebpackPlugin.options.title %>
12
     <%= htmlWebpackPlugin.options.title %>

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

79
 	display: none;
79
 	display: none;
80
 }
80
 }
81
 
81
 
82
+.van-dialog__message {
83
+  text-align: center;
84
+}
85
+
82
 .van-dialog__message .van-dialog__message--has-title{
86
 .van-dialog__message .van-dialog__message--has-title{
83
 	text-align: center;
87
 	text-align: center;
84
 }
88
 }

二進制
src/common/icon/qrCode.jpg 查看文件


二進制
src/common/icon/vipBg.jpg 查看文件


+ 16
- 0
src/components/customerCard/customerCard.vue 查看文件

13
       </div>
13
       </div>
14
       <div>
14
       <div>
15
         <div @click="record">领取记录</div>
15
         <div @click="record">领取记录</div>
16
+        <div @click="history">历史备注</div>
16
       </div>
17
       </div>
17
     </div>
18
     </div>
19
+    <div class="card-bottom">
20
+      <span>备注:{{data.Remark}}</span>
21
+      <span @click="remark">+ 添加备注</span>
22
+    </div>
18
   </div>
23
   </div>
19
 </template>
24
 </template>
20
 
25
 
37
     record () {
42
     record () {
38
       this.$emit('record', this.data)
43
       this.$emit('record', this.data)
39
     },
44
     },
45
+    remark () {
46
+      this.$emit('remark', this.data)
47
+    },
48
+    history () {
49
+      this.$emit('history', this.data)
50
+    }
40
   }
51
   }
41
 }
52
 }
42
 </script>
53
 </script>
112
     display: flex;
123
     display: flex;
113
     padding: 0.15rem;
124
     padding: 0.15rem;
114
     justify-content: space-between;
125
     justify-content: space-between;
126
+    align-items: center;
115
     span:nth-of-type(1) {
127
     span:nth-of-type(1) {
116
       color: #323645;
128
       color: #323645;
129
+      width: 2.3rem;
130
+      white-space: nowrap;
131
+      overflow: hidden;
132
+      text-overflow: ellipsis;
117
     }
133
     }
118
     span:nth-of-type(2) {
134
     span:nth-of-type(2) {
119
       color: #909090;
135
       color: #909090;

+ 2
- 1
src/components/myCard/myCard.vue 查看文件

9
       <div>
9
       <div>
10
         <h2>{{data.title}}</h2>
10
         <h2>{{data.title}}</h2>
11
         <span class="descs">{{data.desc}}</span>
11
         <span class="descs">{{data.desc}}</span>
12
-        <span>{{data.startDate}}-{{data.endDate}}</span>
12
+        <span v-if="data.ValidDays">领取后{{data.ValidDays}}天内有效</span>
13
+        <span v-else>{{data.startDate}}-{{data.endDate}}</span>
13
       </div>
14
       </div>
14
     </div>
15
     </div>
15
     <div class="card-main flex-h" @click="detail">
16
     <div class="card-main flex-h" @click="detail">

+ 3
- 1
src/components/topCaseInfo/index.vue 查看文件

4
       <span>{{data.caseName}}</span>
4
       <span>{{data.caseName}}</span>
5
       <a v-if="data.ShowSelect" @click="selectCase">请选择</a>
5
       <a v-if="data.ShowSelect" @click="selectCase">请选择</a>
6
       <div class="flex-item">
6
       <div class="flex-item">
7
+        <span v-if="data.recommendCode && fromPage === 'sales'">我的推荐码{{data.recommendCode}}</span>
8
+        <span v-else></span>
7
         <span>{{userName}}您好!</span>
9
         <span>{{userName}}您好!</span>
8
       </div>
10
       </div>
9
   </div>
11
   </div>
13
 
15
 
14
 export default {
16
 export default {
15
   name: '',
17
   name: '',
16
-  props: ['data', 'userName'],
18
+  props: ['data', 'userName' ,'fromPage'],
17
   data () {
19
   data () {
18
     return {
20
     return {
19
 
21
 

+ 4
- 2
src/components/topCaseInfo/page.scss 查看文件

20
     margin-left: .2rem;
20
     margin-left: .2rem;
21
   }
21
   }
22
   &>div{
22
   &>div{
23
-    text-align: right;
24
-    margin-right: .2rem;
23
+    display: flex;
24
+    justify-content: space-between;
25
+    align-items: center;
26
+    margin: 0 .2rem 0 .2rem;
25
     font-size: 0;
27
     font-size: 0;
26
     span{
28
     span{
27
       font-size: .12rem;
29
       font-size: .12rem;

+ 2
- 1
src/pages/sales/cardAndCouponNum/index.vue 查看文件

6
         <div>
6
         <div>
7
           <span>{{data.CardName}}</span>
7
           <span>{{data.CardName}}</span>
8
           <span>卡券描述卡券描述卡券描述卡券描述卡券描述</span>
8
           <span>卡券描述卡券描述卡券描述卡券描述卡券描述</span>
9
-          <span>{{toolClass.dateFormat(data.StartDate)}} - {{toolClass.dateFormat(data.EndDate)}}</span>
9
+          <span v-if="data.ValidDays>0">领取后{{data.ValidDays}}天有效</span>
10
+          <span v-else>{{toolClass.dateFormat(data.StartDate)}} - {{toolClass.dateFormat(data.EndDate)}}</span>
10
         </div>
11
         </div>
11
       </div>
12
       </div>
12
     </div>
13
     </div>

+ 61
- 3
src/pages/sales/customerSearch/index.vue 查看文件

8
         <ul>
8
         <ul>
9
           <li class="customer-card">
9
           <li class="customer-card">
10
             <div class="list-box">
10
             <div class="list-box">
11
-              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @record='record'></customerCard>
11
+              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @record='record' @history='history' @remark='remark'></customerCard>
12
               <!-- <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span> -->
12
               <!-- <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span> -->
13
               <noMore v-if="ajaxOff && hasPic"></noMore>
13
               <noMore v-if="ajaxOff && hasPic"></noMore>
14
             </div>
14
             </div>
24
       </div>
24
       </div>
25
       <div class="mask-bottom"></div>
25
       <div class="mask-bottom"></div>
26
     </div>
26
     </div>
27
+    <van-dialog
28
+      v-model="showDialog"
29
+      show-cancel-button
30
+      title='添加备注'
31
+      :before-close="beforeClose">
32
+      <van-field
33
+        v-model="message"
34
+        type="textarea"
35
+        placeholder="请输入备注"
36
+        rows="3"
37
+        autosize/>
38
+    </van-dialog>
27
   </div>
39
   </div>
28
 </template>
40
 </template>
29
 
41
 
38
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
50
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
39
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
51
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
40
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
52
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
53
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
41
 
54
 
42
 export default {
55
 export default {
43
   name: '',
56
   name: '',
58
       mask: true,
71
       mask: true,
59
       checked: true,
72
       checked: true,
60
       cardList: [],
73
       cardList: [],
74
+      showDialog: false,
75
+      remarkCustomerId: ''
61
     }
76
     }
62
   },
77
   },
63
   computed: {
78
   computed: {
98
     ...mapCaseActions([
113
     ...mapCaseActions([
99
       'getCaseTotal',
114
       'getCaseTotal',
100
     ]),
115
     ]),
116
+    ...mapRemarkActions(['setRemark']),
101
     record (item) {
117
     record (item) {
102
       // console.log(item)
118
       // console.log(item)
103
-      this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } })
119
+      this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } }).then(() => {
120
+        this.getCustomerList({
121
+          page: 1,
122
+          pagesize: 10000,
123
+          isrecommend: false,
124
+          key: this.key,
125
+        }).then((res) => {
126
+          this.message = null
127
+          this.cardList = []
128
+          if (res) {
129
+            for (var n = 0; n < res.length; n++) {
130
+              if (res[n].RecommendId === this.userInfo.customer.MapUser) {
131
+                res[n].showTag = true
132
+              } else {
133
+                res[n].showTag = false
134
+              }
135
+              this.cardList.push(res[n])
136
+            }
137
+          } else {
138
+            this.hasPic = true
139
+          }
140
+          this.mask = false
141
+          this.ajaxOff = true
142
+        })
143
+      })
144
+    },
145
+    remark (item) {
146
+      // console.log(item)
147
+      this.showDialog = true
148
+      this.remarkCustomerId = item.CustomerId
149
+    },
150
+    history (item) {
151
+      // console.log(item)
152
+      this.$router.push({ name: 'history', query: { customerId: item.CustomerId } })
104
     },
153
     },
105
     searchMask () {
154
     searchMask () {
106
       this.getCustomerList({
155
       this.getCustomerList({
139
         caseid: this.topCaseInfoData.caseId
188
         caseid: this.topCaseInfoData.caseId
140
       })
189
       })
141
       this.showSelect = false
190
       this.showSelect = false
142
-    }
191
+    },
192
+    beforeClose (action, done) {
193
+      if (action === 'confirm') {
194
+        this.setRemark({ salesId: this.userInfo.customer.MapUser, customerId: this.remarkCustomerId, remark: this.message }).then(() => {
195
+          done()
196
+        })
197
+      } else {
198
+        done()
199
+      }
200
+    },
143
   }
201
   }
144
 }
202
 }
145
 </script>
203
 </script>

+ 41
- 14
src/pages/sales/history/index.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="mainPage">
2
   <div class="mainPage">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName"></topCaseInfo>
5
     </div>
5
     </div>
6
-    <div class="info">
7
-      <span><em>姓名</em>:顶顶顶</span>
8
-      <span><em>手机号</em>:13888888888</span>
6
+    <div class="info" v-if="list.length > 0">
7
+      <span><em>姓名</em>:{{list[0].CustomerName}}</span>
8
+      <span><em>手机号</em>:{{list[0].Phone}}</span>
9
     </div>
9
     </div>
10
-    <div class="list-content">
11
-      <div class="list-year">2018年备注记录</div>
10
+    <div class="list-content" v-if="list.length > 0">
11
+      <div class="list-year">备注记录</div>
12
       <div class="list-card" v-for="(item,index) in list" :key="index">
12
       <div class="list-card" v-for="(item,index) in list" :key="index">
13
         <div class="point-top"></div>
13
         <div class="point-top"></div>
14
         <div class="point-bottom"></div>
14
         <div class="point-bottom"></div>
15
-        <div class="card-time">7.29</div>
16
-        <div class="card-content">更多备注信息更多备注信息,更多备注信息更多备注信息更多备注信息更多备注信息。更多备注信息更多备注信息。</div>
15
+        <div class="card-time">{{toolClass.dateFormat(item.CreateDate,'MM-dd')}}</div>
16
+        <div class="card-content">{{item.Remark}}</div>
17
       </div>
17
       </div>
18
     </div>
18
     </div>
19
+    <noMore v-if="list.length <= 0"></noMore>
19
   </div>
20
   </div>
20
 </template>
21
 </template>
21
 
22
 
22
 <script>
23
 <script>
23
 import topCaseInfo from '../../../components/topCaseInfo/index'
24
 import topCaseInfo from '../../../components/topCaseInfo/index'
24
-
25
+import noMore from '../../../components/noMore/noMore'
26
+import { mapState, createNamespacedHelpers } from 'vuex'
27
+const { mapActions: actions } = createNamespacedHelpers('app')
28
+const { mapState: mapRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
25
 export default {
29
 export default {
26
   name: '',
30
   name: '',
27
   data () {
31
   data () {
28
     return {
32
     return {
29
-      list: [1,1,1,1,1],
30
       topCaseInfoData: {
33
       topCaseInfoData: {
31
         caseName: '',
34
         caseName: '',
32
         caseId: '',
35
         caseId: '',
33
-        showSelect: false,
34
-        userName: 'xxx'
36
+        ShowSelect: false,
35
       },
37
       },
36
     }
38
     }
37
   },
39
   },
38
   components: {
40
   components: {
39
     topCaseInfo,
41
     topCaseInfo,
42
+    noMore
43
+  },
44
+  computed: {
45
+    ...mapState({
46
+      userInfo: x => x.userCenter.userInfo,
47
+      CaseList: x => x.app.CaseList,
48
+    }),
49
+    ...mapRemarkState({
50
+      list: x => x.remarkList
51
+    }),
40
   },
52
   },
41
   created () {
53
   created () {
42
-
54
+    this.getCaseList().then((res) => {
55
+      this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
56
+      for (let i = 0; i < this.CaseList.length; i++) {
57
+        if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
58
+          this.topCaseInfoData.caseName = this.CaseList[i].CaseName
59
+        }
60
+      }
61
+      this.getRemark({ salesId: this.userInfo.customer.MapUser, customerId: this.$route.query.customerId }).then(() => {
62
+        console.log(this.list)
63
+      })
64
+    })
43
   },
65
   },
44
   methods: {
66
   methods: {
45
-    
67
+    ...actions([
68
+      'getCaseList',
69
+    ]),
70
+    ...mapRemarkActions([
71
+      'getRemark',
72
+    ])
46
   }
73
   }
47
 }
74
 }
48
 </script>
75
 </script>

+ 1
- 1
src/pages/sales/salesGiveOutDetail/index.vue 查看文件

28
                   </div>
28
                   </div>
29
                   <div class="flex-item">
29
                   <div class="flex-item">
30
                     <div>
30
                     <div>
31
-                      <span>¥{{item.Price}} * 1</span>
31
+                      <span>¥{{item.Price}} * {{item.Number}}</span>
32
                     </div>
32
                     </div>
33
                   </div>
33
                   </div>
34
                   <span>{{toolClass.dateFormat(item.CreateDate, 'yyyy/MM/dd hh:mm')}}</span>
34
                   <span>{{toolClass.dateFormat(item.CreateDate, 'yyyy/MM/dd hh:mm')}}</span>

+ 124
- 83
src/pages/user/bindMobile/bindMobile.vue 查看文件

10
           <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
10
           <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
11
         </div>
11
         </div>
12
 
12
 
13
-        <div class="recommend">
13
+        <!-- <div class="recommend">
14
           <span>推荐人</span>
14
           <span>推荐人</span>
15
           <div @click="selectCase">
15
           <div @click="selectCase">
16
             <span>{{caseName}}</span>
16
             <span>{{caseName}}</span>
20
             <span>{{salesName}}</span>
20
             <span>{{salesName}}</span>
21
             <i class="iconfont icon-triangle-bottom"></i>
21
             <i class="iconfont icon-triangle-bottom"></i>
22
           </div>
22
           </div>
23
+        </div> -->
24
+
25
+        <div class="mobile">
26
+          <i class="iconfont icon-zhanghu"></i>
27
+          <input type="tel" placeholder="推荐码" v-model="postData.recommendCode">
23
         </div>
28
         </div>
24
 
29
 
25
         <div class="sms">
30
         <div class="sms">
33
           <div>提交</div>
38
           <div>提交</div>
34
         </div>
39
         </div>
35
       </div>
40
       </div>
36
-      <transition name="slide">
41
+      <!-- <transition name="slide">
37
         <div class="select" v-if="showCase">
42
         <div class="select" v-if="showCase">
38
           <van-picker
43
           <van-picker
39
             show-toolbar
44
             show-toolbar
56
             @confirm="onConfirmS"
61
             @confirm="onConfirmS"
57
           />
62
           />
58
         </div>
63
         </div>
59
-      </transition>
64
+      </transition> -->
60
     </div>
65
     </div>
61
   </div>
66
   </div>
62
 </template>
67
 </template>
65
 import logo from '../../../common/icon/logo.png'
70
 import logo from '../../../common/icon/logo.png'
66
 import { mapState, createNamespacedHelpers } from 'vuex'
71
 import { mapState, createNamespacedHelpers } from 'vuex'
67
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
72
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
68
-let canSubmit
69
 export default {
73
 export default {
70
   data () {
74
   data () {
71
     return {
75
     return {
79
       seconds: 61,
83
       seconds: 61,
80
       postData: {
84
       postData: {
81
         phone: '',
85
         phone: '',
82
-        case: '',
83
-        sales: '',
86
+        // case: '',
87
+        // sales: '',
88
+        recommendCode: '',
84
         captcha: ''
89
         captcha: ''
85
-      }
90
+      },
91
+      canSubmit: true
86
     }
92
     }
87
   },
93
   },
88
   computed: {
94
   computed: {
91
     })
97
     })
92
   },
98
   },
93
   created () {
99
   created () {
94
-    canSubmit = true
95
     this.getCaseInfo(1).then(() => {
100
     this.getCaseInfo(1).then(() => {
96
       this.columns = this.caseInfo.cases
101
       this.columns = this.caseInfo.cases
97
     })
102
     })
103
+    console.log(1123)
98
   },
104
   },
99
   methods: {
105
   methods: {
100
     ...actions(['getCaseInfo']),
106
     ...actions(['getCaseInfo']),
101
     ...actions(['getCaptcha']),
107
     ...actions(['getCaptcha']),
102
     ...actions(['submitData']),
108
     ...actions(['submitData']),
103
-    onConfirmC (value, index) {
104
-      this.caseName = value.CaseName
105
-      this.postData.case = value.CaseId
106
-      this.columnsS = []
107
-      this.salesName = '选择销售'
108
-      if (this.caseInfo.sales) {
109
-        for (let i = 0; i < this.caseInfo.sales.length; i++) {
110
-          if (this.caseInfo.sales[i].CaseId === this.postData.case) {
111
-            this.columnsS.push(this.caseInfo.sales[i])
112
-          }
113
-        }
114
-      }
115
-      if (this.caseInfo.manager) {
116
-        for (let i = 0; i < this.caseInfo.manager.length; i++) {
117
-          if (this.caseInfo.manager[i].CaseId === this.postData.case) {
118
-            this.columnsS.push(this.caseInfo.manager[i])
119
-          }
120
-        }
121
-      }
122
-      this.showCase = false
123
-    },
124
-    onCancelC () {
125
-      this.showCase = false
126
-    },
127
-    onConfirmS (value, index) {
128
-      this.salesName = value.UserName
129
-      this.postData.sales = value.UserId
130
-      this.showSales = false
131
-    },
132
-    onCancelS () {
133
-      this.showSales = false
134
-    },
135
-    selectCase () {
136
-      this.showCase = true
137
-    },
138
-    selectSales () {
139
-      if (!this.postData.case) {
140
-        this.$toast('请先选择案场')
141
-        return
142
-      } else if (this.columnsS.length <= 0) {
143
-        this.$toast('此案场无销售')
144
-        return
145
-      }
146
-      this.showSales = true
147
-    },
109
+    ...actions(['recommendCode']),
110
+    // onConfirmC (value, index) {
111
+    //   this.caseName = value.CaseName
112
+    //   this.postData.case = value.CaseId
113
+    //   this.columnsS = []
114
+    //   this.salesName = '选择销售'
115
+    //   if (this.caseInfo.sales) {
116
+    //     for (let i = 0; i < this.caseInfo.sales.length; i++) {
117
+    //       if (this.caseInfo.sales[i].CaseId === this.postData.case) {
118
+    //         this.columnsS.push(this.caseInfo.sales[i])
119
+    //       }
120
+    //     }
121
+    //   }
122
+    //   if (this.caseInfo.manager) {
123
+    //     for (let i = 0; i < this.caseInfo.manager.length; i++) {
124
+    //       if (this.caseInfo.manager[i].CaseId === this.postData.case) {
125
+    //         this.columnsS.push(this.caseInfo.manager[i])
126
+    //       }
127
+    //     }
128
+    //   }
129
+    //   this.showCase = false
130
+    // },
131
+    // onCancelC () {
132
+    //   this.showCase = false
133
+    // },
134
+    // onConfirmS (value, index) {
135
+    //   this.salesName = value.UserName
136
+    //   this.postData.sales = value.UserId
137
+    //   this.showSales = false
138
+    // },
139
+    // onCancelS () {
140
+    //   this.showSales = false
141
+    // },
142
+    // selectCase () {
143
+    //   this.showCase = true
144
+    // },
145
+    // selectSales () {
146
+    //   if (!this.postData.case) {
147
+    //     this.$toast('请先选择案场')
148
+    //     return
149
+    //   } else if (this.columnsS.length <= 0) {
150
+    //     this.$toast('此案场无销售')
151
+    //     return
152
+    //   }
153
+    //   this.showSales = true
154
+    // },
148
     sandMsg () {
155
     sandMsg () {
149
       if (!this.postData.phone) {
156
       if (!this.postData.phone) {
150
         this.$toast('请先填写手机号')
157
         this.$toast('请先填写手机号')
151
         return
158
         return
152
       }
159
       }
153
-      this.getCaptcha(this.postData.phone)
154
-      this.seconds = 60
155
-      this.runTime()
160
+      if (this.postData.recommendCode) {
161
+        this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
162
+          if (res) {
163
+            this.getCaptcha(this.postData.phone)
164
+            this.seconds = 60
165
+            this.runTime()
166
+          } else {
167
+            this.$toast('推荐码不正确,请与案场人员核对')
168
+            return
169
+          }
170
+        }).catch((err) => {
171
+          return
172
+        })
173
+      } else {
174
+        this.getCaptcha(this.postData.phone)
175
+        this.seconds = 60
176
+        this.runTime()
177
+      }
156
     },
178
     },
157
     runTime () {
179
     runTime () {
158
       setTimeout(() => {
180
       setTimeout(() => {
165
       }, 1000)
187
       }, 1000)
166
     },
188
     },
167
     submit () {
189
     submit () {
168
-      if (!canSubmit){
190
+      if (!this.canSubmit) {
169
         return
191
         return
170
       }
192
       }
171
-      canSubmit = false
193
+      this.canSubmit = false
172
       if (!this.postData.captcha) {
194
       if (!this.postData.captcha) {
173
         this.$toast('请填写验证码')
195
         this.$toast('请填写验证码')
174
-        canSubmit = true
196
+        this.canSubmit = true
175
         return
197
         return
176
       }
198
       }
177
-      // if (!this.postData.case) {
178
-      //   this.$toast('请选择案场')
179
-      //   return
180
-      // }
181
-      // if (!this.postData.sales) {
182
-      //   this.$toast('请选择销售')
183
-      //   return
184
-      // }
185
-      this.submitData(this.postData).then((res) => {
186
-        if (this.$route.query.isLottery) {
187
-          setTimeout(() => {
188
-            const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}` : ''
189
-            window.location.href = `${window.location.origin}/game/luckdraw/${from}`
190
-          }, 2000)
191
-        } else {
192
-          setTimeout(() => {
193
-            // this.$router.push({name: 'userCenter'})
194
-            window.history.go(-1)
195
-          }, 2000)
196
-        }
197
-      }).catch(() => {
198
-        console.log(111)
199
-        canSubmit = true
200
-      })
199
+      if (this.postData.recommendCode) {
200
+        this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
201
+          if (res) {
202
+            this.submitData(this.postData).then((res) => {
203
+              if (this.$route.query.isLottery) {
204
+                setTimeout(() => {
205
+                  const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}?lotteryId=${this.$route.query.lotteryId}&isnew=1` : `?lotteryId=${this.$route.query.lotteryId}&isnew=1`
206
+                  window.location.href = `${window.location.origin}/game/luckdraw/${from}`
207
+                }, 2000)
208
+              } else {
209
+                setTimeout(() => {
210
+                  // this.$router.push({name: 'userCenter'})
211
+                  window.history.go(-1)
212
+                }, 2000)
213
+              }
214
+            }).catch(() => {
215
+              console.log(111)
216
+              this.canSubmit = true
217
+            })
218
+          } else {
219
+            this.$toast('推荐码不正确,请与案场人员核对')
220
+            this.canSubmit = true
221
+            return
222
+          }
223
+        })
224
+      } else {
225
+        this.submitData(this.postData).then((res) => {
226
+          if (this.$route.query.isLottery) {
227
+            setTimeout(() => {
228
+              const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}?lotteryId=${this.$route.query.lotteryId}&isnew=1` : `?lotteryId=${this.$route.query.lotteryId}&isnew=1`
229
+              window.location.href = `${window.location.origin}/game/luckdraw/${from}`
230
+            }, 2000)
231
+          } else {
232
+            setTimeout(() => {
233
+              // this.$router.push({name: 'userCenter'})
234
+              window.history.go(-1)
235
+            }, 2000)
236
+          }
237
+        }).catch(() => {
238
+          console.log(111)
239
+          this.canSubmit = true
240
+        })
241
+      }
201
     }
242
     }
202
   }
243
   }
203
 }
244
 }

+ 3
- 3
src/pages/user/bindMobile/page.scss 查看文件

27
     }
27
     }
28
     .box{
28
     .box{
29
       width: 3.25rem;
29
       width: 3.25rem;
30
-      height: 3.34rem;
30
+      height: 3.5rem;
31
       background:rgba(255,255,255,1);
31
       background:rgba(255,255,255,1);
32
       border-radius:8px;
32
       border-radius:8px;
33
       padding: .2rem;
33
       padding: .2rem;
36
         font-size: .16rem;
36
         font-size: .16rem;
37
         font-weight: bold;
37
         font-weight: bold;
38
         text-align: center;
38
         text-align: center;
39
-        padding-bottom: .24rem;
40
       }
39
       }
41
       .mobile,.sms{
40
       .mobile,.sms{
42
         width: 2.85rem;
41
         width: 2.85rem;
47
         display: flex;
46
         display: flex;
48
         align-items: center;
47
         align-items: center;
49
         position: relative;
48
         position: relative;
49
+        margin-top: .2rem;
50
         i{
50
         i{
51
           color: rgba(168,182,200,1);
51
           color: rgba(168,182,200,1);
52
           padding: .14rem;
52
           padding: .14rem;
107
         }
107
         }
108
       }
108
       }
109
       .submit{
109
       .submit{
110
-        margin-top: .24rem;
110
+        margin-top: .2rem;
111
         width: 2.85rem;
111
         width: 2.85rem;
112
         height: .48rem;
112
         height: .48rem;
113
         border-radius:25px;
113
         border-radius:25px;

+ 94
- 40
src/pages/user/mainPage/coffeeIndex/index.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :fromPage='fromPage' :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
5
     </div>
5
     </div>
6
-    <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
7
-      <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" v-if="userInfo.customer.UserTypeId !== 'manager' || item.id !== '4'" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
6
+    <nav class="flex-h" v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">
7
+      <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
8
     </nav>
8
     </nav>
9
       <div class="content">
9
       <div class="content">
10
         <div>
10
         <div>
11
           <ul>
11
           <ul>
12
             <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
12
             <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
13
-              <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== ''">
13
+              <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">
14
                 <div class="flex-item">
14
                 <div class="flex-item">
15
                   <div>
15
                   <div>
16
                     <span>共计已使用:{{caseTotal.total}}杯</span>
16
                     <span>共计已使用:{{caseTotal.total}}杯</span>
93
                   </van-checkbox>
93
                   </van-checkbox>
94
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
94
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
95
                 </div>
95
                 </div>
96
-                <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
96
+                <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record' @history='history' @remark='remark'></customerCard>
97
                 <noMore v-if="data[3].hasPic"></noMore>
97
                 <noMore v-if="data[3].hasPic"></noMore>
98
               </div>
98
               </div>
99
             </li>
99
             </li>
138
 const { mapActions: actions } = createNamespacedHelpers('app')
138
 const { mapActions: actions } = createNamespacedHelpers('app')
139
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
139
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
140
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
140
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
141
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
141
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
142
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
142
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
143
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
143
 const wx = require('weixin-js-sdk')
144
 const wx = require('weixin-js-sdk')
146
   name: '',
147
   name: '',
147
   data () {
148
   data () {
148
     return {
149
     return {
150
+      fromPage: '',
149
       myRecommendUserList: [],
151
       myRecommendUserList: [],
150
       forbidList: [],
152
       forbidList: [],
151
       postCustomerData: {
153
       postCustomerData: {
194
         caseName: '',
196
         caseName: '',
195
         caseId: '',
197
         caseId: '',
196
         ShowSelect: false,
198
         ShowSelect: false,
199
+        recommendCode: ''
197
       },
200
       },
198
       caseInfo: {
201
       caseInfo: {
199
         value: '',
202
         value: '',
236
           pagesize: 1,
239
           pagesize: 1,
237
           list: []
240
           list: []
238
         }
241
         }
239
-      ]
242
+      ],
243
+      remarkCustomerId: ''
240
     }
244
     }
241
   },
245
   },
242
   computed: {
246
   computed: {
247
     }),
251
     }),
248
     ...mapCaseState({
252
     ...mapCaseState({
249
       caseTotal: x => x.caseTotal,
253
       caseTotal: x => x.caseTotal,
254
+      choosedCase: x => x.choosedCase
250
     }),
255
     }),
251
     ...mapCardState({
256
     ...mapCardState({
252
       cardList: x => x.cardList
257
       cardList: x => x.cardList
260
     noMore
265
     noMore
261
   },
266
   },
262
   created () {
267
   created () {
263
-    if (!this.userInfo.customer.MapUser) {
268
+    this.fromPage = sessionStorage.getItem('from')
269
+    if (!this.userInfo.customer.MapUser || (this.userInfo.customer.MapUser && this.fromPage !== 'sales')) {
264
       this.topCaseInfoData.ShowSelect = true
270
       this.topCaseInfoData.ShowSelect = true
265
     }
271
     }
266
     if (this.userInfo.customer.MapUser !== '') {
272
     if (this.userInfo.customer.MapUser !== '') {
300
                 SentCount: res.list[n].SentCount,
306
                 SentCount: res.list[n].SentCount,
301
                 usedCount: res.list[n].UsedCount,
307
                 usedCount: res.list[n].UsedCount,
302
                 CardId: res.list[n].CouponId,
308
                 CardId: res.list[n].CouponId,
303
-                CustomerList: res.list[n].CustomerCoupon || []
309
+                CustomerList: res.list[n].CustomerCoupon || [],
310
+                ValidDays: res.list[n].ValidDays
304
               })
311
               })
305
             }
312
             }
306
             var count = 0
313
             var count = 0
342
           }
349
           }
343
         })
350
         })
344
       })
351
       })
352
+      this.getRecommendCode().then((res) => {
353
+        this.topCaseInfoData.recommendCode = res
354
+      })
345
     } else {
355
     } else {
346
 
356
 
347
     }
357
     }
355
       'getMyCouponList',
365
       'getMyCouponList',
356
       'getForbidInfo',
366
       'getForbidInfo',
357
       'getCustomerList',
367
       'getCustomerList',
368
+      'getRecommendCode'
358
     ]),
369
     ]),
359
     ...actions([
370
     ...actions([
360
       'getCaseList',
371
       'getCaseList',
365
     ...mapCaseActions([
376
     ...mapCaseActions([
366
       'getCaseTotal',
377
       'getCaseTotal',
367
       'getCaseConf',
378
       'getCaseConf',
379
+      'changeChoosedCase'
368
     ]),
380
     ]),
369
     ...mapCardActions(['getCardList']),
381
     ...mapCardActions(['getCardList']),
382
+    ...mapRemarkActions(['setRemark']),
370
     checkCanDo () {
383
     checkCanDo () {
371
       const _that = this
384
       const _that = this
372
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
385
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
386
       }
399
       }
387
     },
400
     },
388
     returnInvalid (item, type) {
401
     returnInvalid (item, type) {
402
+      console.log(item)
403
+      if (item.ValidDays && item.ValidDays > 0) {
404
+        return false
405
+      }
389
       for (var n = 0; n < this.forbidList.length; n++) {
406
       for (var n = 0; n < this.forbidList.length; n++) {
390
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
407
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
391
           return true
408
           return true
413
         caseid: this.topCaseInfoData.caseId
430
         caseid: this.topCaseInfoData.caseId
414
       })
431
       })
415
       this.showSelect = false
432
       this.showSelect = false
433
+      this.changeChoosedCase({ CaseName: val.CaseName, CaseId: val.CaseId })
416
     },
434
     },
417
     cutNav (index) { // 切换nav
435
     cutNav (index) { // 切换nav
418
       this.navActive = index
436
       this.navActive = index
460
     remark (item) {
478
     remark (item) {
461
       // console.log(item)
479
       // console.log(item)
462
       this.showDialog = true
480
       this.showDialog = true
481
+      this.remarkCustomerId = item.CustomerId
463
     },
482
     },
464
     history (item) {
483
     history (item) {
465
       // console.log(item)
484
       // console.log(item)
466
-      window.location.href = this.getUrl('history')
485
+      window.location.href = this.getUrl(`history?customerId=${item.CustomerId}`)
467
     },
486
     },
468
     record (item) {
487
     record (item) {
469
       // console.log(item)
488
       // console.log(item)
498
           })
517
           })
499
         }
518
         }
500
       } else {
519
       } else {
501
-        wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
502
-          title: '城的空间',
503
-          desc: '城的空间',
504
-          link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
505
-          thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
506
-        }).then(() => {
507
-          wx.getLocation({
508
-            type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
509
-            success: function (res) {
510
-              let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
511
-              let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
512
-              for (let i = 0; i < that.CaseList.length; i++) {
513
-                let result = that.CaseList[i].Coordinate.split(",")
514
-                let latitude2 = parseFloat(result[0])
515
-                let longitude2 = parseFloat(result[1])
516
-                if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
517
-                  that.topCaseInfoData.caseName = that.CaseList[i].CaseName
518
-                  that.topCaseInfoData.caseId = that.CaseList[i].CaseId
519
-                  that.getCaseTableList({
520
-                    caseid: that.topCaseInfoData.caseId
521
-                  })
522
-                  if (this.userInfo.customer.MapUser !== '') {
523
-                    that.getCaseTotal({
520
+        // console.log(this.choosedCase)
521
+        if (this.choosedCase.CaseId) {
522
+          that.topCaseInfoData.caseName = this.choosedCase.CaseName
523
+          that.topCaseInfoData.caseId = this.choosedCase.CaseId
524
+          // that.getCaseTableList({
525
+          //   caseid: that.topCaseInfoData.caseId
526
+          // })
527
+          // if (this.userInfo.customer.MapUser !== '') {
528
+          //   that.getCaseTotal({
529
+          //     caseid: that.topCaseInfoData.caseId
530
+          //   })
531
+          // }
532
+        } else {
533
+          wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
534
+            title: '城的空间',
535
+            desc: '城的空间',
536
+            link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
537
+            thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
538
+          }).then(() => {
539
+            wx.getLocation({
540
+              type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
541
+              success: function (res) {
542
+                let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
543
+                let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
544
+                for (let i = 0; i < that.CaseList.length; i++) {
545
+                  let result = that.CaseList[i].Coordinate.split(",")
546
+                  let latitude2 = parseFloat(result[0])
547
+                  let longitude2 = parseFloat(result[1])
548
+                  if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
549
+                    that.topCaseInfoData.caseName = that.CaseList[i].CaseName
550
+                    that.topCaseInfoData.caseId = that.CaseList[i].CaseId
551
+                    that.getCaseTableList({
524
                       caseid: that.topCaseInfoData.caseId
552
                       caseid: that.topCaseInfoData.caseId
525
                     })
553
                     })
554
+                    if (this.userInfo.customer.MapUser !== '') {
555
+                      that.getCaseTotal({
556
+                        caseid: that.topCaseInfoData.caseId
557
+                      })
558
+                    }
526
                   }
559
                   }
527
                 }
560
                 }
561
+                if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
562
+                  that.$toast('当前位置无案场')
563
+                  that.topCaseInfoData.caseName = '当前位置无案场'
564
+                }
528
               }
565
               }
529
-              if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
530
-                that.$toast('当前位置无案场')
531
-                that.topCaseInfoData.caseName = '当前位置无案场'
532
-              }
533
-            }
566
+            })
534
           })
567
           })
535
-        })
568
+        }
536
       }
569
       }
537
     },
570
     },
538
     beforeClose (action, done) {
571
     beforeClose (action, done) {
539
       if (action === 'confirm') {
572
       if (action === 'confirm') {
540
-        setTimeout(done, 1000)
573
+        this.setRemark({ salesId: this.userInfo.customer.MapUser, customerId: this.remarkCustomerId, remark: this.message }).then(() => {
574
+          this.getCustomerList({
575
+            ...this.postCustomerData
576
+          }).then((res) => {
577
+            this.message = null
578
+            this.data[3].list = []
579
+            if (res) {
580
+              for (var n = 0; n < res.length; n++) {
581
+                if (res[n].RecommendId === this.userInfo.customer.MapUser) {
582
+                  this.myRecommendUserList.push(res[n])
583
+                  res[n].showTag = true
584
+                } else {
585
+                  res[n].showTag = false
586
+                }
587
+                this.data[3].list.push(res[n])
588
+              }
589
+            } else {
590
+              this.data[3].hasPic = true
591
+            }
592
+          })
593
+          done()
594
+        })
541
       } else {
595
       } else {
542
         done()
596
         done()
543
       }
597
       }
545
     toOrders (subItem, item) {
599
     toOrders (subItem, item) {
546
       const _that = this
600
       const _that = this
547
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
601
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
548
-        if (this.checkCanOrder()) {
602
+        if (this.checkCanOrder() && sessionStorage.getItem('from') === 'sales') {
549
           _that.$toast('您的点单功能已被关闭!')
603
           _that.$toast('您的点单功能已被关闭!')
550
           return
604
           return
551
         }
605
         }

+ 11
- 4
src/pages/user/mainPage/index.vue 查看文件

5
         <router-view></router-view>
5
         <router-view></router-view>
6
       </div>
6
       </div>
7
     </div>
7
     </div>
8
-    <nav class="flex-h">
8
+    <nav class="flex-h" :style="{paddingBottom: isIphoneX ? '.1rem' : '0'}">
9
       <router-link :to="{name:item.pathName,query:{}}" v-if="showTabBar" class="flex-item" active-class="active" v-for="(item, index) in tabBar" :key="index">
9
       <router-link :to="{name:item.pathName,query:{}}" v-if="showTabBar" class="flex-item" active-class="active" v-for="(item, index) in tabBar" :key="index">
10
         <div>
10
         <div>
11
           <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
11
           <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
19
 </template>
19
 </template>
20
 
20
 
21
 <script>
21
 <script>
22
-import { mapState } from 'vuex'
22
+import { mapState, mapActions } from 'vuex'
23
 export default {
23
 export default {
24
   name: '',
24
   name: '',
25
   data () {
25
   data () {
26
     return {
26
     return {
27
+      isIphoneX: false,
27
       tabBar: [{
28
       tabBar: [{
28
         pathName: 'indexPage',
29
         pathName: 'indexPage',
29
         name: '城的空间'
30
         name: '城的空间'
45
   components: {
46
   components: {
46
   },
47
   },
47
   created () {
48
   created () {
49
+    var aHeight = document.documentElement.clientHeight,
50
+      aWidth = document.documentElement.clientWidth
51
+    if (aHeight === 724 && aWidth === 375) {
52
+      this.isIphoneX = true
53
+    }
48
     if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
54
     if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
49
       this.showTabBar = true
55
       this.showTabBar = true
50
     }
56
     }
51
-  },
52
-  methods: {
57
+    if (this.$route.query.hideTabbar) {
58
+      sessionStorage.setItem('from', 'sales')
59
+    }
53
   }
60
   }
54
 }
61
 }
55
 </script>
62
 </script>

+ 9
- 3
src/pages/user/mainPage/userCenter/index.vue 查看文件

30
           <span>卡券</span>
30
           <span>卡券</span>
31
           <span>0张未使用</span>
31
           <span>0张未使用</span>
32
         </div>
32
         </div>
33
-        <div class="flex-item privilege-item" @click="toVip">
33
+        <div class="flex-item privilege-item" @click="toVipDetail">
34
+          <i class="iconfont icon-01" @click.stop="toVip"></i>
34
           <div class="img-box">
35
           <div class="img-box">
35
             <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
36
             <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
36
           </div>
37
           </div>
37
           <span>VIP卡</span>
38
           <span>VIP卡</span>
38
-          <span>¥{{(Nums.account || {}).Amount || 0}} <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
39
+          <span>¥{{Nums.vipbalance}} <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
39
         </div>
40
         </div>
40
       </div>
41
       </div>
41
 
42
 
86
       this.user = this.userInfo.customer
87
       this.user = this.userInfo.customer
87
       if (this.user.AccountInfo) {
88
       if (this.user.AccountInfo) {
88
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
89
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
90
+
91
+        
89
       }
92
       }
90
       this.headimgurl = this.user.Headimgurl
93
       this.headimgurl = this.user.Headimgurl
91
     })
94
     })
99
     toVip () {
102
     toVip () {
100
       this.$router.push({ name: 'vip' })
103
       this.$router.push({ name: 'vip' })
101
     },
104
     },
105
+    toVipDetail() {
106
+      this.$router.push({ name: 'vipDetail' })
107
+    },
102
     toCard () {
108
     toCard () {
103
       this.$router.push({ name: 'card' })
109
       this.$router.push({ name: 'card' })
104
     },
110
     },
109
       this.$router.push({ name: 'bindMobile' })
115
       this.$router.push({ name: 'bindMobile' })
110
     },
116
     },
111
     toGoodsOrder () {
117
     toGoodsOrder () {
112
-      this.$router.push({ name: 'orderList' })
118
+      this.$router.push({ name: 'orderList', query: { from: 'c' } })
113
     },
119
     },
114
     toBodyCheck () {
120
     toBodyCheck () {
115
       var url = window.location.pathname
121
       var url = window.location.pathname

+ 7
- 1
src/pages/user/mainPage/userCenter/page.scss 查看文件

84
   box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
84
   box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85
   border-radius:8px;
85
   border-radius:8px;
86
   box-sizing: border-box;
86
   box-sizing: border-box;
87
-
88
   .privilege-item {
87
   .privilege-item {
89
     display: flex;
88
     display: flex;
90
     flex-flow: column nowrap;
89
     flex-flow: column nowrap;
91
     justify-content: center;
90
     justify-content: center;
92
     align-items: center;
91
     align-items: center;
92
+    position: relative;
93
+    .icon-01{
94
+      position: absolute;
95
+      top: .05rem;
96
+      right: .05rem;
97
+      font-size: .18rem;
98
+    }
93
     .img-box {
99
     .img-box {
94
       width: 0.24rem;
100
       width: 0.24rem;
95
       height: 0.18rem;
101
       height: 0.18rem;

+ 15
- 2
src/pages/user/majorProjectsDetail/index.vue 查看文件

112
       message: x => x.index.message,
112
       message: x => x.index.message,
113
       project: x => x.index.project,
113
       project: x => x.index.project,
114
       cms: x => x.index.cms,
114
       cms: x => x.index.cms,
115
+      user: x => x.userCenter.userInfo
115
     }),
116
     }),
116
     ...mapProjectState({
117
     ...mapProjectState({
117
       courseDetail: x => x.courseDetail
118
       courseDetail: x => x.courseDetail
136
         this.courseDetail.CourseImgs.sort(this.getSortFun('asc', 'Sort'))
137
         this.courseDetail.CourseImgs.sort(this.getSortFun('asc', 'Sort'))
137
         this.detailImage = this.courseDetail.CourseImgs
138
         this.detailImage = this.courseDetail.CourseImgs
138
       }
139
       }
139
-      console.log(this.detailImage)
140
+      // console.log(this.detailImage)
140
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
141
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
141
       let nowDate = Date.now()
142
       let nowDate = Date.now()
142
       let endData = new Date(this.courseDetail.EndDate).getTime()
143
       let endData = new Date(this.courseDetail.EndDate).getTime()
153
   methods: {
154
   methods: {
154
     ...mapProjectActions([
155
     ...mapProjectActions([
155
       'getCourseDetailInfo',
156
       'getCourseDetailInfo',
157
+      'placeCourseOrderBefore',
156
     ]),
158
     ]),
157
     getSortFun (order, sortBy) {
159
     getSortFun (order, sortBy) {
158
       var ordAlpah = (order == 'asc') ? '>' : '<'
160
       var ordAlpah = (order == 'asc') ? '>' : '<'
184
       if (nowDate > endData) {
186
       if (nowDate > endData) {
185
         this.$toast('该课程已过期')
187
         this.$toast('该课程已过期')
186
       } else {
188
       } else {
187
-        this.$router.push({ name: 'placeOrderForCourse', query: { id: this.courseDetail.CourseId } })
189
+        this.placeCourseOrderBefore({
190
+          order: {
191
+            CourseId: this.courseDetail.CourseId,
192
+            CaseId: this.courseDetail.CaseId,
193
+            CustomerId: this.user.CustomerId,
194
+            Price: this.courseDetail.Price
195
+          },
196
+          customercouponid: ''
197
+        }).then((res) => {
198
+          // console.log(JSON.stringify(res))
199
+          this.$router.push({ name: 'placeOrderForCourse', query: { id: this.courseDetail.CourseId, ordersid: res.OrdersId } })
200
+        })
188
       }
201
       }
189
     },
202
     },
190
     openMap () {
203
     openMap () {

+ 5
- 3
src/pages/user/orderList/index.vue 查看文件

79
     this.getCustomerGoodsOrder({
79
     this.getCustomerGoodsOrder({
80
       page: this.page,
80
       page: this.page,
81
       pagesize: this.pagesize,
81
       pagesize: this.pagesize,
82
+      from: this.$route.query.from || ''
82
     }).then((res) => {
83
     }).then((res) => {
83
       // console.log(JSON.stringify(res))
84
       // console.log(JSON.stringify(res))
84
-      if(res.list === null){
85
+      if (res.list === null) {
85
         this.noData = true
86
         this.noData = true
86
       }
87
       }
87
     })
88
     })
95
       Math.ceil(this.orders.pagenum / this.orders.pagesize) > this.page ? this.hasMore = true : this.hasMore = false
96
       Math.ceil(this.orders.pagenum / this.orders.pagesize) > this.page ? this.hasMore = true : this.hasMore = false
96
       // this.list.length <= 8 ? this.hasMore = true : this.hasMore = false
97
       // this.list.length <= 8 ? this.hasMore = true : this.hasMore = false
97
       if (this.hasMore) {
98
       if (this.hasMore) {
98
-        this.page = this.page+1
99
+        this.page = this.page + 1
99
         setTimeout(() => {
100
         setTimeout(() => {
100
           _that.getCustomerGoodsOrder({
101
           _that.getCustomerGoodsOrder({
101
             page: _that.page,
102
             page: _that.page,
102
             pagesize: _that.pagesize,
103
             pagesize: _that.pagesize,
104
+            from: this.$route.query.from || ''
103
           })
105
           })
104
         }, 1000)
106
         }, 1000)
105
       } else {
107
       } else {
113
 
115
 
114
 <!-- Add "scoped" attribute to limit CSS to this component only -->
116
 <!-- Add "scoped" attribute to limit CSS to this component only -->
115
 <style lang="scss" scoped>
117
 <style lang="scss" scoped>
116
-@import "page.scss";
118
+@import 'page.scss';
117
 </style>
119
 </style>

+ 52
- 13
src/pages/user/placeOrder/index.vue 查看文件

16
         <div class="flex-item">
16
         <div class="flex-item">
17
           <div>
17
           <div>
18
             <span>桌号:{{tableNo}}</span>
18
             <span>桌号:{{tableNo}}</span>
19
-            <span v-if="userInfo.customer.MapUser !== ''">本月已用:{{caseTotal.monthtotal}}杯</span>
19
+            <span v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">本月已用:{{caseTotal.monthtotal}}杯</span>
20
           </div>
20
           </div>
21
         </div>
21
         </div>
22
         <a @click="reback">返回选择桌号</a>
22
         <a @click="reback">返回选择桌号</a>
68
       </div>
68
       </div>
69
       <a @click="toPlaceOrder">下单</a>
69
       <a @click="toPlaceOrder">下单</a>
70
     </div>
70
     </div>
71
-    <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
71
+    <orderPopup v-if="showPopup" :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
72
     <calcMenu :show="showCalcMenu" :totalNum="sumNum + caseTotal.total" :data="selGoods" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
72
     <calcMenu :show="showCalcMenu" :totalNum="sumNum + caseTotal.total" :data="selGoods" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
73
     <div class="successPopup" v-if="showSuccessPopup">
73
     <div class="successPopup" v-if="showSuccessPopup">
74
       <div>
74
       <div>
185
     calcMenu,
185
     calcMenu,
186
   },
186
   },
187
   created () {
187
   created () {
188
+    this.fromPage = sessionStorage.getItem('from')
188
     this.getGoodsTypeList({
189
     this.getGoodsTypeList({
189
       caseid: this.caseId,
190
       caseid: this.caseId,
190
     }).then((res) => {
191
     }).then((res) => {
206
     ...caseTableActions([
207
     ...caseTableActions([
207
       'getGoodsTypeList',
208
       'getGoodsTypeList',
208
       'getGoodsList',
209
       'getGoodsList',
210
+      'toPayBefore',
209
       'toPay',
211
       'toPay',
210
     ]),
212
     ]),
211
     ...mapCaseActions([
213
     ...mapCaseActions([
213
     ]),
215
     ]),
214
     toPlaceOrder () { // 下单 
216
     toPlaceOrder () { // 下单 
215
       if (this.selGoods.length) {
217
       if (this.selGoods.length) {
216
-        if (this.userInfo.customer.MapUser === '') {
217
-          this.$router.push({ name: 'placeOrderDetail', query: { info: JSON.stringify(this.selGoods), caseid: encodeURI(this.caseId), areaid: encodeURI(this.areaId), areaname: encodeURI(this.areaName), areaid: encodeURI(this.areaId), tableid: encodeURI(this.tableId), tableno: encodeURI(this.tableNo) } })
218
+        if (this.userInfo.customer.MapUser === '' || (this.userInfo.customer.MapUser !== '' && sessionStorage.getItem('from') !== 'sales')) {
219
+          if (this.ajaxOff) {
220
+            this.ajaxOff = false
221
+            this.postData.info.OrgId = this.orgId
222
+            this.postData.info.UserId = this.userInfo.CustomerId
223
+            this.postData.info.UserName = this.userInfo.customer.CustomerName
224
+            this.postData.info.PayType = 'sys user'
225
+            this.postData.info.Remark = ''
226
+            this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
227
+            var orderInfo = this.selGoods
228
+            this.postData.detail = []
229
+            var amount = 0
230
+            var num = 0
231
+            for (var n = 0; n < orderInfo.length; n++) {
232
+              this.postData.detail.push({
233
+                GoodsId: orderInfo[n].id,
234
+                GoodsName: orderInfo[n].name,
235
+                SpecId: orderInfo[n].spec,
236
+                SpecName: orderInfo[n].specname,
237
+                Number: orderInfo[n].num - 0,
238
+                Price: String(orderInfo[n].price - 0),
239
+              })
240
+              amount += (orderInfo[n].price - 0) * orderInfo[n].num
241
+              num += orderInfo[n].num - 0
242
+            }
243
+            this.postData.info.Amount = String(amount)
244
+            this.postData.info.OrdersNum = num
245
+            // console.log(JSON.stringify(this.postData))
246
+            this.toPayBefore({
247
+              info: JSON.stringify(this.postData.info),
248
+              detail: JSON.stringify(this.postData.detail),
249
+              customercouponid: '',
250
+              from: this.postData.from
251
+            }).then((res) => {
252
+              // console.log(JSON.stringify(res))
253
+              this.ajaxOff = true
254
+              this.$router.push({ name: 'placeOrderDetail', query: { info: JSON.stringify(this.selGoods), caseid: encodeURI(this.caseId), areaid: encodeURI(this.areaId), areaname: encodeURI(this.areaName), areaid: encodeURI(this.areaId), tableid: encodeURI(this.tableId), tableno: encodeURI(this.tableNo), ordersid: res.OrdersId } })
255
+            }).catch(() => {
256
+              this.ajaxOff = true
257
+            })
258
+          }
218
         } else {
259
         } else {
219
           this.showCalcMenu = true
260
           this.showCalcMenu = true
220
         }
261
         }
275
       })
316
       })
276
     },
317
     },
277
     placeOrder (Remark) { // 下单
318
     placeOrder (Remark) { // 下单
278
-      if(this.ajaxOff){
319
+      if (this.ajaxOff) {
279
         this.ajaxOff = false
320
         this.ajaxOff = false
280
         this.postData.info.OrgId = this.orgId
321
         this.postData.info.OrgId = this.orgId
281
         this.postData.info.UserId = this.userInfo.CustomerId
322
         this.postData.info.UserId = this.userInfo.CustomerId
282
         this.postData.info.UserName = this.userInfo.customer.CustomerName
323
         this.postData.info.UserName = this.userInfo.customer.CustomerName
283
         this.postData.info.PayType = 'sys user'
324
         this.postData.info.PayType = 'sys user'
284
         this.postData.info.Remark = Remark
325
         this.postData.info.Remark = Remark
326
+        this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
285
         var orderInfo = this.selGoods
327
         var orderInfo = this.selGoods
286
         this.postData.detail = []
328
         this.postData.detail = []
287
         var amount = 0
329
         var amount = 0
304
         this.toPay({
346
         this.toPay({
305
           info: JSON.stringify(this.postData.info),
347
           info: JSON.stringify(this.postData.info),
306
           detail: JSON.stringify(this.postData.detail),
348
           detail: JSON.stringify(this.postData.detail),
307
-          coupon: JSON.stringify(this.postData.coupon)
349
+          customercouponid: '',
350
+          from: this.postData.from
308
         }).then((res) => {
351
         }).then((res) => {
309
           this.ajaxOff = true
352
           this.ajaxOff = true
310
           this.showCalcMenu = false
353
           this.showCalcMenu = false
315
           // }).then(() => {
358
           // }).then(() => {
316
 
359
 
317
           // })
360
           // })
361
+        }).catch(() => {
362
+          this.ajaxOff = true
318
         })
363
         })
319
       }
364
       }
320
     },
365
     },
389
 <!-- Add "scoped" attribute to limit CSS to this component only -->
434
 <!-- Add "scoped" attribute to limit CSS to this component only -->
390
 <style lang="scss" scoped>
435
 <style lang="scss" scoped>
391
 @import 'page.scss';
436
 @import 'page.scss';
392
-</style>
393
-
394
-<style>
395
-.van-dialog__message {
396
-  text-align: center;
397
-}
398
-</style>
437
+</style>

+ 3
- 26
src/pages/user/placeOrderDetail/index.vue 查看文件

211
     toPayer () { // 下单
211
     toPayer () { // 下单
212
       if (this.ajaxoff) {
212
       if (this.ajaxoff) {
213
         this.ajaxoff = false
213
         this.ajaxoff = false
214
-        this.postData.info.OrgId = this.orgId
215
-        this.postData.info.UserId = this.userInfo.CustomerId
216
-        this.postData.info.UserName = this.userInfo.customer.CustomerName
217
-        this.postData.info.PayType = this.postData.customercouponid === '' ? 'coupon' : 'vip'
218
-        var orderInfo = JSON.parse(this.$route.query.info)
219
-        this.postData.detail = []
220
-        var amount = 0
221
-        var num = 0
222
-        for (var n = 0; n < orderInfo.length; n++) {
223
-          this.postData.detail.push({
224
-            GoodsId: orderInfo[n].id,
225
-            GoodsName: orderInfo[n].name,
226
-            SpecId: orderInfo[n].spec,
227
-            SpecName: orderInfo[n].specname,
228
-            Number: orderInfo[n].num - 0,
229
-            Price: String(orderInfo[n].price - 0),
230
-          })
231
-          amount += (orderInfo[n].price - 0) * orderInfo[n].num
232
-          num += orderInfo[n].num - 0
233
-        }
234
-        this.postData.info.Amount = String(amount)
235
-        this.postData.info.OrdersNum = num
236
-        console.log(JSON.stringify(this.postData))
237
         this.toPay({
214
         this.toPay({
238
-          info: JSON.stringify(this.postData.info),
239
-          detail: JSON.stringify(this.postData.detail),
215
+          id: this.$route.query.ordersid,
216
+          remark: this.postData.info.Remark,
240
           customercouponid: this.postData.customercouponid
217
           customercouponid: this.postData.customercouponid
241
         }).then((res) => {
218
         }).then((res) => {
242
           this.showSuccessPopup = true
219
           this.showSuccessPopup = true
246
           //   window.history.go(-2)
223
           //   window.history.go(-2)
247
           // })
224
           // })
248
         }).catch(() => {
225
         }).catch(() => {
249
-          // this.ajaxoff = true
226
+          this.ajaxOff = true
250
         })
227
         })
251
       }
228
       }
252
     },
229
     },

+ 6
- 14
src/pages/user/placeOrderForCourse/index.vue 查看文件

164
   },
164
   },
165
   created () {
165
   created () {
166
     this.getCouponList().then((res) => {
166
     this.getCouponList().then((res) => {
167
+      res = res || []
167
       this.getCourseDetailInfo({ id: this.$route.query.id }).then((result) => {
168
       this.getCourseDetailInfo({ id: this.$route.query.id }).then((result) => {
168
         var arr = result.CourseDetail, caseid = result.CaseId
169
         var arr = result.CourseDetail, caseid = result.CaseId
169
         // console.log(arr)
170
         // console.log(arr)
244
         return false
245
         return false
245
       }
246
       }
246
       this.placeOrderForCourse({
247
       this.placeOrderForCourse({
247
-        order: {
248
-          CourseId: this.courseDetail.CourseId,
249
-          CaseId: this.courseDetail.CaseId,
250
-          CustomerId: this.user.CustomerId,
251
-          Price: this.courseDetail.Price
252
-        },
253
-        customercouponid: this.postData.customercouponid
248
+        id: this.$route.query.ordersid,
249
+        payload: {
250
+          customercouponid: this.postData.customercouponid,
251
+        }
254
       }).then((res) => {
252
       }).then((res) => {
255
         // console.log(JSON.stringify(res))
253
         // console.log(JSON.stringify(res))
256
         this.$dialog.alert({
254
         this.$dialog.alert({
295
 <!-- Add "scoped" attribute to limit CSS to this component only -->
293
 <!-- Add "scoped" attribute to limit CSS to this component only -->
296
 <style lang="scss" scoped>
294
 <style lang="scss" scoped>
297
 @import 'page.scss';
295
 @import 'page.scss';
298
-</style>
299
-
300
-<style lang="scss">
301
-.van-dialog{
302
-  width: 60% !important;
303
-}
304
-</style>
296
+</style>

+ 7
- 1
src/pages/user/receive/index.vue 查看文件

29
           <i class="icon-kaquan iconfont"></i>
29
           <i class="icon-kaquan iconfont"></i>
30
           <span>卡券有效期</span>
30
           <span>卡券有效期</span>
31
         </div>
31
         </div>
32
-        <pre>有效期至{{toolClass.dateFormat(data.EndDate,'yyyy-MM-dd')}},请在有效期结束前使用, 过期作废;</pre>
32
+        <pre v-if="data.ValidDays>0">领取后{{data.ValidDays}}天有效,请在有效期结束前使用, 过期作废;</pre>
33
+        <pre v-else>有效期至{{toolClass.dateFormat(data.EndDate,'yyyy-MM-dd')}},请在有效期结束前使用, 过期作废;</pre>
33
       </div>
34
       </div>
34
       <div class="text">
35
       <div class="text">
35
         <div>
36
         <div>
114
           this.sdk(this.data.Share.CouponShareInfo)
115
           this.sdk(this.data.Share.CouponShareInfo)
115
         })
116
         })
116
       }
117
       }
118
+      if (this.$route.query.isAuto === 'auto') {
119
+        setTimeout(() => {
120
+          this.receive()
121
+        }, 1000)
122
+      }
117
     },
123
     },
118
     receive () {
124
     receive () {
119
       if (this.$route.query.type === 'card') {
125
       if (this.$route.query.type === 'card') {

+ 11
- 0
src/pages/user/router.js 查看文件

15
 import bindMobile from './bindMobile/bindMobile' // 绑定手机号
15
 import bindMobile from './bindMobile/bindMobile' // 绑定手机号
16
 import lessonOrder from './lessonOrder/index' // 我的订单
16
 import lessonOrder from './lessonOrder/index' // 我的订单
17
 import vip from './vip/index' // vip卡说明
17
 import vip from './vip/index' // vip卡说明
18
+import vipDetail from './vipDetail/index' // vip卡说明
18
 import card from './card/index' // 卡
19
 import card from './card/index' // 卡
19
 import coupons from './coupons/index' // 优惠券
20
 import coupons from './coupons/index' // 优惠券
20
 import lessonDetail from './lessonDetail/index' // 课程详情
21
 import lessonDetail from './lessonDetail/index' // 课程详情
24
 import receive from './receive/index' // 领取页面
25
 import receive from './receive/index' // 领取页面
25
 import receiveResults from './receiveResults/index' // 领取结果页面
26
 import receiveResults from './receiveResults/index' // 领取结果页面
26
 import receiveChannel from './receiveChannel/index' // 渠道领取页面
27
 import receiveChannel from './receiveChannel/index' // 渠道领取页面
28
+import rush from './rush/index' // 抢购
27
 
29
 
28
 Vue.use(Router)
30
 Vue.use(Router)
29
 
31
 
98
     name: 'vip',
100
     name: 'vip',
99
     component: vip,
101
     component: vip,
100
     children: []
102
     children: []
103
+  }, { // vip卡详情
104
+    path: '/vipDetail',
105
+    name: 'vipDetail',
106
+    component: vipDetail,
107
+    children: []
101
   }, { // 卡
108
   }, { // 卡
102
     path: '/card',
109
     path: '/card',
103
     name: 'card',
110
     name: 'card',
151
     path: '/receiveChannelShared/:id/:type/:sharetype',
158
     path: '/receiveChannelShared/:id/:type/:sharetype',
152
     name: 'receiveChannel',
159
     name: 'receiveChannel',
153
     component: receiveChannel
160
     component: receiveChannel
161
+  }, { // 抢购
162
+    path: '/rush',
163
+    name: 'rush',
164
+    component: rush
154
   }],
165
   }],
155
   linkActiveClass: 'active',
166
   linkActiveClass: 'active',
156
 })
167
 })

+ 145
- 0
src/pages/user/rush/index.vue 查看文件

1
+<template>
2
+  <div class="mainPage" v-if="showPage">
3
+    <div class="top-time" v-if="timeStatus<2">
4
+      <span v-if="timeStatus === 0">距抢购开始</span>
5
+      <span v-if="timeStatus === 1">距抢购结束</span>
6
+      <span class="time">{{day}}</span>
7
+      <span>天</span>
8
+      <span class="time">{{hour}}</span>
9
+      <span>时</span>
10
+      <span class="time">{{minute}}</span>
11
+      <span>分</span>
12
+      <span class="time">{{second}}</span>
13
+      <span>秒</span>
14
+    </div>
15
+    <div class="content">
16
+      <div class="title">{{detail.FlashBuyName}}</div>
17
+      <!-- <div class="video-or-cover">
18
+        <video v-if="video" width="100%" height="100%" preload="auto" x5-playsinline="true" controls="controls" :poster="type === 'card' ? data.Images[0].CardImageUrl : data.Images[0].CouponImageUrl">
19
+          <source :src="data.VideoUrl" type="video/mp4">
20
+          <source :src="data.VideoUrl" type="video/avi">
21
+          <source :src="data.VideoUrl" type="video/wma">
22
+          <source :src="data.VideoUrl" type="video/rmvb">
23
+          <source :src="data.VideoUrl" type="video/rm">
24
+        </video>
25
+        <img v-else src="" width="100%" height="100%">
26
+      </div> -->
27
+      <pre class="rule" v-html="detail.FlashBuyInfo"></pre>
28
+      <div class="scope-of-time">
29
+        <div>活动时间</div>
30
+        <div>{{toolClass.dateFormat(detail.StartDate)}} ~ {{toolClass.dateFormat(detail.EndDate)}}</div>
31
+      </div>
32
+    </div>
33
+    <div class="sign-in" v-if="timeStatus !== 2 && newCustomer && detail.AttendantType === 'no'" @click="signIn">立即注册</div>
34
+    <div class="submit">
35
+      <div :class="{light:timeStatus === 1}" @click="submit()" v-if="!used">{{btnText[timeStatus]}}</div>
36
+      <div v-else>已抢购</div>
37
+    </div>
38
+    <div class="success-box" v-if="showDialog">
39
+      <div class="success">
40
+        <span>恭喜您!抢购成功</span>
41
+        <img :src="logo" alt="">
42
+        <span>长按二维码关注“城的空间”,进入会员中心查看吧</span>
43
+        <div @click="showDialog = false">确定</div>
44
+      </div>
45
+    </div>
46
+  </div>
47
+</template>
48
+
49
+<script>
50
+import logo from '../../../common/icon/qrCode.jpg'
51
+import { mapState, createNamespacedHelpers } from 'vuex'
52
+const { mapActions: actions } = createNamespacedHelpers('app')
53
+const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
54
+export default {
55
+  data () {
56
+    return {
57
+      logo,
58
+      day: '00',
59
+      hour: '00',
60
+      minute: '00',
61
+      second: '00',
62
+      hasTime: false,
63
+      timeStatus: 0, // 0、未开始 1、进行中 2、已结束 3、已抢购
64
+      btnText: ['立即抢购', '立即抢购', '已结束', '已抢购'],
65
+      Interval: null,
66
+      showDialog: false,
67
+      used: false,
68
+      showPage: false,
69
+      newCustomer: false
70
+    }
71
+  },
72
+  created () {
73
+    this.AddNewFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId }).then(() => {
74
+      this.getRush({ flashBuyId: this.$route.query.flashBuyId }).then((res) => {
75
+        if (res.userInfo) {
76
+          this.used = true
77
+          this.newCustomer = res
78
+        }
79
+        let start = new Date(this.detail.StartDate).getTime()
80
+        let end = new Date(this.detail.EndDate).getTime()
81
+        this.timing(start, end)
82
+      })
83
+    })
84
+  },
85
+  computed: {
86
+    ...mapRushState({
87
+      detail: item => item.rushDetail
88
+    })
89
+  },
90
+  methods: {
91
+    ...mapRushActions(['setRush', 'getRush', 'AddNewFlashBuyCustomer', 'IsNewCustomer', 'UpdateFlashBuyCustomer']),
92
+    timing (startTime, endTime) {
93
+      this.Interval = setInterval(() => {
94
+        let nowTime = new Date().getTime()
95
+        if (nowTime >= endTime) {
96
+          clearInterval(this.Interval)
97
+          this.timeStatus = 2
98
+          this.showPage = true
99
+          return
100
+        } else if (nowTime <= startTime) {
101
+          let time = Math.floor((startTime - nowTime) / 1000)
102
+          this.getTime(time)
103
+          this.timeStatus = 0
104
+          this.showPage = true
105
+        } else if (nowTime >= startTime && nowTime <= endTime) {
106
+          let time = Math.floor((endTime - nowTime) / 1000)
107
+          this.getTime(time)
108
+          this.timeStatus = 1
109
+          this.showPage = true
110
+        }
111
+      }, 1000)
112
+    },
113
+    getTime (time) {
114
+      let second = time % 60
115
+      let minute = ((time % (60 * 60)) - second) / 60
116
+      let hour = ((time % (60 * 60 * 24)) - (minute * 60) - second) / (60 * 60)
117
+      let day = Math.floor(time / (60 * 60 * 24))
118
+      this.second = second < 10 ? '0' + second : second
119
+      this.minute = minute < 10 ? '0' + minute : minute
120
+      this.hour = hour < 10 ? '0' + hour : hour
121
+      this.day = day < 10 ? '0' + day : day
122
+    },
123
+    submit () {
124
+      if (this.newCustomer && this.detail.AttendantType !== 'no') {
125
+        this.signIn()
126
+        return
127
+      }
128
+      if (this.timeStatus !== 1) {
129
+        return
130
+      }
131
+      this.setRush({ id: this.detail.FlashBuyId }).then(() => {
132
+        this.UpdateFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId })
133
+        this.showDialog = true
134
+      })
135
+    },
136
+    signIn () {
137
+      this.$router.push({ name: 'bindMobile' })
138
+    }
139
+  }
140
+}
141
+</script>
142
+
143
+<style lang="scss" scoped>
144
+@import 'page.scss';
145
+</style>

+ 139
- 0
src/pages/user/rush/page.scss 查看文件

1
+.top-time{
2
+  height: .4rem;
3
+  width: 100%;
4
+  background: #fff;
5
+  box-shadow:0px 0px 14px 0px rgba(199,199,199,0.5);
6
+  display: flex;
7
+  justify-content: center;
8
+  align-items: center;
9
+  span{
10
+    margin: .02rem;
11
+    padding: .02rem .05rem;
12
+    display: block;
13
+  }
14
+  .time{
15
+    background: #69563F;
16
+    border-radius: 2px;
17
+    color: #fff;
18
+  }
19
+}
20
+.content{
21
+  padding: .24rem .2rem .6rem;
22
+  box-sizing: border-box;
23
+  .title{
24
+    text-align: center;
25
+    font-size: .16rem;
26
+    color: #9D876D;
27
+    padding-bottom: .2rem
28
+  }
29
+  .video-or-cover{
30
+    width: 100%;
31
+    height: 2.22rem;
32
+    margin-bottom: .1rem;
33
+  }
34
+  .rule{
35
+    padding-bottom: .2rem;
36
+    white-space:pre-line;
37
+    text-align: left;
38
+    line-height: .18rem;
39
+    color: #585858;
40
+  }
41
+  .scope-of-time{
42
+    div:nth-of-type(1){
43
+      width: .66rem;
44
+      height: .26rem;
45
+      background:rgba(157,135,109,.3);
46
+      border-radius:.13rem;
47
+      text-align: center;
48
+      line-height: .26rem;
49
+      font-size: .12rem;
50
+      color: #69563F;
51
+      margin-bottom: .05rem;
52
+    }
53
+    div:nth-of-type(2){
54
+      color: #585858;
55
+      font-size: .14rem;
56
+    }
57
+  }
58
+}
59
+.submit{
60
+  display: flex;
61
+  justify-content: center;
62
+  align-items: center;
63
+  position: fixed;
64
+  bottom: 0;
65
+  left: 0;
66
+  z-index: 2;
67
+  width: 100%;
68
+  height: .6rem;
69
+  div{
70
+    width: 3.35rem;
71
+    height: .4rem;
72
+    color: #fff;
73
+    font-size: .16rem;
74
+    background: #aaa;
75
+    text-align: center;
76
+    line-height: .4rem;
77
+    border-radius: .2rem;
78
+  }
79
+  .light{
80
+    background: #9D876D;
81
+  }
82
+}
83
+.success-box{
84
+  position: fixed;
85
+  display: flex;
86
+  z-index: 999;
87
+  background: rgba(0,0,0,.2);
88
+  top: 0;
89
+  left: 0;
90
+  width: 100%;
91
+  height: 100%;
92
+  .success{
93
+    display: flex;
94
+    flex-flow: column nowrap;
95
+    justify-content: center;
96
+    align-items: center;
97
+    position: absolute;
98
+    top: 50%;
99
+    left: 50%;
100
+    width: 2.8rem;
101
+    height: 2.2rem;
102
+    border-radius: .2rem;
103
+    padding: .2rem .1rem;
104
+    transform: translate(-50%,-50%);
105
+    background: #fff;
106
+    span{
107
+      font-size: .14rem;
108
+    }
109
+    img{
110
+      width: .8rem;
111
+      height: .8rem;
112
+      margin: .15rem;
113
+    }
114
+    div{
115
+      width: .9rem;
116
+      height: .3rem;
117
+      background: #9D876D;
118
+      color: white;
119
+      font-size: .14rem;
120
+      border-radius: .08rem;
121
+      text-align: center;
122
+      line-height: .3rem;
123
+    }
124
+  }
125
+}
126
+.sign-in{
127
+  position: fixed;
128
+  bottom: .8rem;
129
+  right: .4rem;
130
+  width: .5rem;
131
+  height: .5rem;
132
+  background: #BAE0F6;
133
+  color: #fff;
134
+  font-size: .12rem;
135
+  display: flex;
136
+  justify-content: center;
137
+  align-items: center;
138
+  border-radius: 50%;
139
+}

+ 87
- 0
src/pages/user/vipDetail/index.vue 查看文件

1
+<template>
2
+  <div class="mainPage">
3
+    <swiper :options="swiperOption" ref="mySwiper" class="inner" v-if="detail.length > 0">
4
+      <swiper-slide class="swiper-slide" v-for="(item,index) in detail" :key="index">
5
+        <div class="vip-box">
6
+          <div class="vip-header">
7
+            <img :src='vipBg' width="100%" height="100%">
8
+            <div>
9
+              <span class="balance">¥ <span>{{item.Balance}}</span></span>
10
+              <span class="date">vip有效日期:{{toolClass.dateFormat(item.BeginDate, 'yyyy-MM-dd')}} ~ {{toolClass.dateFormat(item.EndDate, 'yyyy-MM-dd')}}</span>
11
+            </div>
12
+          </div>
13
+          <div class="vip-detail-list">
14
+            <div class="title">账单明细</div>
15
+            <div class="list-box">
16
+              <div class="list" v-for="(items,indexs) in item.Changes" :key="indexs">
17
+                <span>{{items.SourceName}}</span>
18
+                <span>{{items.FloatType}}{{items.Amount}}</span>
19
+                <span class="date">{{toolClass.dateFormat(items.CreateDate)}}</span>
20
+              </div>
21
+            </div>
22
+          </div>
23
+        </div>
24
+      </swiper-slide>
25
+    </swiper>
26
+    <div class="swiper-pagination" v-if="detail.length > 0"></div>
27
+    <noMore v-if='detail.length <= 0'></noMore>
28
+  </div>
29
+</template>
30
+
31
+<script>
32
+import vipBg from '../../../common/icon/vipBg.jpg'
33
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
34
+import 'swiper/dist/css/swiper.css'
35
+import noMore from '../../../components/noMore/noMore'
36
+import { createNamespacedHelpers } from 'vuex'
37
+const { mapState: mapVipState, mapActions: mapVipActions } = createNamespacedHelpers('vip')
38
+export default {
39
+  data () {
40
+    return {
41
+      vipBg,
42
+      swiperOption: {
43
+        observer: true,
44
+        pagination: {
45
+          el: '.swiper-pagination',
46
+          type: 'bullets',
47
+          //type: 'fraction',
48
+          //type : 'progressbar',
49
+          //type : 'custom',
50
+          clickable: true, //此参数设置为true时,点击分页器的指示点分页器会控制Swiper切换。
51
+        },
52
+      }
53
+    }
54
+  },
55
+  components: {
56
+    swiper,
57
+    swiperSlide,
58
+    noMore
59
+  },
60
+  created () {
61
+    this.getVipDetail().then((res) => {
62
+      console.log(this.detail)
63
+    })
64
+  },
65
+  computed: {
66
+    MySwiper () {
67
+      return this.$refs.mySwiper.swiper
68
+    },
69
+    ...mapVipState({
70
+      detail: item => item.vipDetails
71
+    })
72
+  },
73
+  methods: {
74
+    ...mapVipActions(['getVipDetail'])
75
+  }
76
+}
77
+</script>
78
+
79
+<style lang="scss" scoped>
80
+@import 'page.scss';
81
+</style>
82
+
83
+<style>
84
+.swiper-pagination > span {
85
+  margin: 0 0.025rem;
86
+}
87
+</style>

+ 86
- 0
src/pages/user/vipDetail/page.scss 查看文件

1
+.inner{
2
+  height: 100%;
3
+}
4
+.vip-box{
5
+  width: 100%;
6
+  height: 100%;
7
+  padding: .25rem .2rem;
8
+  box-sizing: border-box;
9
+  display: flex;
10
+  flex-flow: column nowrap;
11
+  .vip-header{
12
+    width: 100%;
13
+    position: relative;
14
+    margin-bottom: .4rem;
15
+    box-shadow: 0 0 .05rem .05rem #eee;
16
+    border-radius: .1rem;
17
+    height: 1.8rem;
18
+    overflow: hidden;
19
+    img{
20
+      position: absolute;
21
+      top: 0;
22
+      left: 0;
23
+    }
24
+    div{
25
+      position: absolute;
26
+      bottom: .2rem;
27
+      left: .2rem;
28
+      width: 80%;
29
+      display: flex;
30
+      flex-flow: column nowrap;
31
+      justify-content: center;
32
+      align-items: flex-start;
33
+      .balance{
34
+        color: #FC6243;
35
+        padding-bottom: .1rem;
36
+        font-weight: bold;
37
+        span{
38
+          font-size: .24rem;
39
+          font-weight: bold;
40
+          color: #FC6243;
41
+        }
42
+      }
43
+      .date{
44
+        color: #6D6D6D;
45
+      }
46
+    }
47
+  }
48
+  .vip-detail-list{
49
+    flex: 1;
50
+    display: flex;
51
+    flex-flow: column nowrap;
52
+    .title{
53
+      font-size: .16rem;
54
+      font-weight: bold;
55
+      padding-bottom: .15rem;
56
+    }
57
+    .list-box{
58
+      flex: 1;
59
+      overflow-y: scroll;
60
+      overflow-x: hidden;
61
+      .list{
62
+        display: flex;
63
+        align-items: center;
64
+        padding: .05rem 0 ;
65
+        border-bottom: 1px solid rgba(242,242,242,1);
66
+        span{
67
+          width: 30%;
68
+          overflow: hidden;
69
+          text-overflow: ellipsis;
70
+          white-space: nowrap;
71
+          margin-right: .05rem;
72
+        }
73
+        .date{
74
+          color: #999;
75
+          text-align: right;
76
+          flex: 1;
77
+        }
78
+      }
79
+    }
80
+  }
81
+}
82
+.swiper-pagination{
83
+  bottom: .2rem;
84
+  left: 50%;
85
+  transform: translateX(-50%);
86
+}

+ 8
- 1
src/store/case/case.js 查看文件

7
   state: {
7
   state: {
8
     caseTotal: {},
8
     caseTotal: {},
9
     caseConf: {},
9
     caseConf: {},
10
+    choosedCase: {}
10
   },
11
   },
11
   mutations: {
12
   mutations: {
12
     setCaseTotal (state, data) { // 获取案场下单数量信息
13
     setCaseTotal (state, data) { // 获取案场下单数量信息
15
     setCaseConf (state, data) { // 获取案场下单数量信息
16
     setCaseConf (state, data) { // 获取案场下单数量信息
16
       state.caseConf = data
17
       state.caseConf = data
17
     },
18
     },
19
+    setChoosedCase (state, data) { // 获取案场下单数量信息
20
+      state.choosedCase = data
21
+    },
18
   },
22
   },
19
   actions: {
23
   actions: {
20
     getCaseTotal ({ commit }, { caseid }) {
24
     getCaseTotal ({ commit }, { caseid }) {
32
         })
36
         })
33
       })
37
       })
34
     },
38
     },
35
-    getCaseConf ({ commit },{ caseid }) {
39
+    getCaseConf ({ commit }, { caseid }) {
36
       return new Promise((resolve, reject) => {
40
       return new Promise((resolve, reject) => {
37
         Ajax(api.case.conf.url, {
41
         Ajax(api.case.conf.url, {
38
           method: api.case.conf.method,
42
           method: api.case.conf.method,
46
           reject(err)
50
           reject(err)
47
         })
51
         })
48
       })
52
       })
53
+    },
54
+    changeChoosedCase ({ commit }, data) {
55
+      commit("setChoosedCase", data)
49
     }
56
     }
50
   }
57
   }
51
 }
58
 }

+ 3
- 0
src/store/index.js 查看文件

25
   forbid: () => require('./forbid/index').default,
25
   forbid: () => require('./forbid/index').default,
26
   share: () => require('./share/index').default,
26
   share: () => require('./share/index').default,
27
   bodyCheck: () => require('./bodyCheck/index').default,
27
   bodyCheck: () => require('./bodyCheck/index').default,
28
+  vip: () => require('./vip/index').default,
29
+  remark: () => require('./remark/index').default,
30
+  rush: () => require('./rush/index').default,
28
 }
31
 }
29
 
32
 
30
 Object.keys(modules).forEach((modKey) => {
33
 Object.keys(modules).forEach((modKey) => {

+ 20
- 3
src/store/majorProjects/majorProjects.js 查看文件

17
     }
17
     }
18
   },
18
   },
19
   actions: {
19
   actions: {
20
-    placeOrderForCourse (context, { order, customercouponid }) { // 课程下单
20
+    placeCourseOrderBefore (context, { order, customercouponid }) { // 课程下单
21
       return new Promise((resolve, reject) => {
21
       return new Promise((resolve, reject) => {
22
-        Ajax(api.majorProjects.placeCourseOrder.url, {
23
-          method: api.majorProjects.placeCourseOrder.method,
22
+        Ajax(api.majorProjects.placeCourseOrderBefore.url, {
23
+          method: api.majorProjects.placeCourseOrderBefore.method,
24
           data: {
24
           data: {
25
             info: window.JSON.stringify(order),
25
             info: window.JSON.stringify(order),
26
             customercouponid,
26
             customercouponid,
32
         })
32
         })
33
       })
33
       })
34
     },
34
     },
35
+    placeOrderForCourse (context, { id, payload }) { // 课程下单
36
+      return new Promise((resolve, reject) => {
37
+        Ajax(api.majorProjects.placeCourseOrder.url, {
38
+          method: api.majorProjects.placeCourseOrder.method,
39
+          urlData: {
40
+            id,
41
+          },
42
+          data: {
43
+            customercouponid: payload.customercouponid
44
+          }
45
+        }).then(res => {
46
+          resolve(res)
47
+        }).catch((err) => {
48
+          reject(err)
49
+        })
50
+      })
51
+    },
35
     getProjectInfo (context, { id }) { // 获取课程列表
52
     getProjectInfo (context, { id }) { // 获取课程列表
36
       return new Promise((resolve) => {
53
       return new Promise((resolve) => {
37
         Ajax(api.majorProjects.getCourseList.url, {
54
         Ajax(api.majorProjects.getCourseList.url, {

+ 22
- 3
src/store/placeOrderForCoffee/index.js 查看文件

63
         })
63
         })
64
       })
64
       })
65
     },
65
     },
66
-    toPay (context, { info, detail, customercouponid }) { // 下单
66
+    toPayBefore (context, { info, detail, customercouponid, from }) { // 下单
67
       return new Promise((resolve, reject) => {
67
       return new Promise((resolve, reject) => {
68
-        Ajax(api.caseForCoffee.placeGoodsOrder.url, {
69
-          method: api.caseForCoffee.placeGoodsOrder.method,
68
+        Ajax(api.caseForCoffee.placeGoodsOrderBefore.url, {
69
+          method: api.caseForCoffee.placeGoodsOrderBefore.method,
70
           data: {
70
           data: {
71
             info,
71
             info,
72
             detail,
72
             detail,
73
             customercouponid,
73
             customercouponid,
74
+            from
74
           },
75
           },
75
         }).then(res => {
76
         }).then(res => {
76
           resolve(res)
77
           resolve(res)
79
         })
80
         })
80
       })
81
       })
81
     },
82
     },
83
+    toPay (context, payload) { // 下单
84
+      return new Promise((resolve, reject) => {
85
+        Ajax(api.caseForCoffee.placeGoodsOrder.url, {
86
+          method: api.caseForCoffee.placeGoodsOrder.method,
87
+          urlData: {
88
+            id: payload.id
89
+          },
90
+          data: {
91
+            remark: payload.remark,
92
+            customercouponid: payload.customercouponid
93
+          }
94
+        }).then(res => {
95
+          resolve(res)
96
+        }).catch(() => {
97
+          reject()
98
+        })
99
+      })
100
+    },
82
     getCouponList (context) { // 获取优惠券列表
101
     getCouponList (context) { // 获取优惠券列表
83
       return new Promise((resolve) => {
102
       return new Promise((resolve) => {
84
         Ajax(api.caseForCoffee.getCouponList.url, {
103
         Ajax(api.caseForCoffee.getCouponList.url, {

+ 50
- 0
src/store/remark/index.js 查看文件

1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    remarkList: []
9
+  },
10
+  mutations: {
11
+    setRemark (state, data) {
12
+      state.remarkList = data.list || []
13
+    }
14
+  },
15
+  actions: {
16
+    getRemark (context, data) {
17
+      return new Promise((resolve, reject) => {
18
+        Ajax({
19
+          ...api.remark.getRemark,
20
+          urlData: { ...data },
21
+          queryData: {
22
+            page: 1,
23
+            pagesize: 10000
24
+          }
25
+        }).then(res => {
26
+          context.commit('setRemark', res)
27
+          resolve(res)
28
+        }).catch((err) => {
29
+          reject(err)
30
+        })
31
+      })
32
+    },
33
+    setRemark (context, data) {
34
+      return new Promise((resolve, reject) => {
35
+        Ajax({
36
+          ...api.remark.setRemark,
37
+          data: {
38
+            SalesId: data.salesId,
39
+            CustomerId: data.customerId,
40
+            Remark: data.remark
41
+          }
42
+        }).then(res => {
43
+          resolve(res)
44
+        }).catch((err) => {
45
+          reject(err)
46
+        })
47
+      })
48
+    }
49
+  }
50
+}

+ 77
- 0
src/store/rush/index.js 查看文件

1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    rushDetail: {}
9
+  },
10
+  mutations: {
11
+    setDetail (state, data) {
12
+      state.rushDetail = data.flashBuy || {}
13
+    }
14
+  },
15
+  actions: {
16
+    getRush (context, data) {
17
+      return new Promise((resolve, reject) => {
18
+        Ajax({
19
+          ...api.rush.getRush,
20
+          urlData: { ...data }
21
+        }).then(res => {
22
+          context.commit('setDetail', res)
23
+          resolve(res)
24
+        }).catch((err) => {
25
+          reject(err)
26
+        })
27
+      })
28
+    },
29
+    setRush (context, data) {
30
+      return new Promise((resolve, reject) => {
31
+        Ajax({
32
+          ...api.rush.setRush,
33
+          urlData: { ...data }
34
+        }).then(res => {
35
+          resolve(res)
36
+        }).catch((err) => {
37
+          reject(err)
38
+        })
39
+      })
40
+    },
41
+    IsNewCustomer (context) {
42
+      return new Promise((resolve, reject) => {
43
+        Ajax({
44
+          ...api.rush.IsNewCustomer
45
+        }).then(res => {
46
+          resolve(res)
47
+        }).catch((err) => {
48
+          reject(err)
49
+        })
50
+      })
51
+    },
52
+    AddNewFlashBuyCustomer (context, data) {
53
+      return new Promise((resolve, reject) => {
54
+        Ajax({
55
+          ...api.rush.AddNewFlashBuyCustomer,
56
+          urlData: { ...data }
57
+        }).then(res => {
58
+          resolve(res)
59
+        }).catch((err) => {
60
+          reject(err)
61
+        })
62
+      })
63
+    },
64
+    UpdateFlashBuyCustomer (context, data) {
65
+      return new Promise((resolve, reject) => {
66
+        Ajax({
67
+          ...api.rush.UpdateFlashBuyCustomer,
68
+          urlData: { ...data }
69
+        }).then(res => {
70
+          resolve(res)
71
+        }).catch((err) => {
72
+          reject(err)
73
+        })
74
+      })
75
+    }
76
+  }
77
+}

+ 24
- 1
src/store/userCenter/userCenter.js 查看文件

239
         })
239
         })
240
       })
240
       })
241
     },
241
     },
242
+    recommendCode (context, data) {
243
+      return new Promise((resolve) => {
244
+        Ajax({
245
+          ...api.user.recommendCode, 
246
+          urlData: { ...data }
247
+        }).then(res => {
248
+          resolve(res)
249
+        }).catch((err) => {
250
+          reject(err)
251
+        })
252
+      })
253
+    },
242
     submitData (context, data) {
254
     submitData (context, data) {
243
-      return new Promise((resolve,reject) => {
255
+      return new Promise((resolve, reject) => {
244
         http.submitData(data).then((res) => {
256
         http.submitData(data).then((res) => {
245
           resolve(res)
257
           resolve(res)
246
         }).catch(() => {
258
         }).catch(() => {
247
           reject()
259
           reject()
248
         })
260
         })
249
       })
261
       })
262
+    },
263
+    getRecommendCode (context) {
264
+      return new Promise((resolve) => {
265
+        Ajax({
266
+          ...api.user.code
267
+        }).then(res => {
268
+          resolve(res)
269
+        }).catch((err) => {
270
+          reject(err)
271
+        })
272
+      })
250
     }
273
     }
251
   }
274
   }
252
 }
275
 }

+ 30
- 0
src/store/vip/index.js 查看文件

1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    vipDetails: []
9
+  },
10
+  mutations: {
11
+    setVip (state, data) {
12
+      state.vipDetails = data || []
13
+    }
14
+  },
15
+  actions: {
16
+    getVipDetail (context) {
17
+      console.log(context)
18
+      return new Promise((resolve, reject) => {
19
+        Ajax({
20
+          ...api.user.getVip
21
+        }).then(res => {
22
+          context.commit('setVip', res)
23
+          resolve(res)
24
+        }).catch((err) => {
25
+          reject(err)
26
+        })
27
+      })
28
+    }
29
+  }
30
+}

+ 54
- 2
src/util/api.js 查看文件

47
       method: 'get',
47
       method: 'get',
48
       url: `${baseUrl}${guest}/goods`
48
       url: `${baseUrl}${guest}/goods`
49
     },
49
     },
50
-    placeGoodsOrder: { // 商品下单
50
+    placeGoodsOrderBefore: { // 商品下单
51
       method: 'post',
51
       method: 'post',
52
       url: `${baseUrl}${wechat}/order/goods`
52
       url: `${baseUrl}${wechat}/order/goods`
53
     },
53
     },
54
+    placeGoodsOrder: { // 商品下单
55
+      method: 'put',
56
+      url: `${baseUrl}${wechat}/order/goods/:id`
57
+    },
54
     getCouponList: { // 获取优惠券列表
58
     getCouponList: { // 获取优惠券列表
55
       method: 'get',
59
       method: 'get',
56
       url: `${baseUrl}${wechat}/customer/coupon`
60
       url: `${baseUrl}${wechat}/customer/coupon`
69
       method: 'get',
73
       method: 'get',
70
       url: `${baseUrl}${guest}/course/:id`
74
       url: `${baseUrl}${guest}/course/:id`
71
     },
75
     },
72
-    placeCourseOrder: { // 课程下单
76
+    placeCourseOrderBefore: { // 课程下单
73
       method: 'post',
77
       method: 'post',
74
       url: `${baseUrl}${wechat}/order/course`
78
       url: `${baseUrl}${wechat}/order/course`
75
     },
79
     },
80
+    placeCourseOrder: { // 课程下单
81
+      method: 'put',
82
+      url: `${baseUrl}${wechat}/order/course/:id`
83
+    },
76
   },
84
   },
77
   card: {
85
   card: {
78
     myCustomer: { // 我的客户
86
     myCustomer: { // 我的客户
105
       method: 'get',
113
       method: 'get',
106
       url: `${baseUrl}${guest}/captcha`
114
       url: `${baseUrl}${guest}/captcha`
107
     },
115
     },
116
+    recommendCode: { // 验证推荐码
117
+      method: 'get',
118
+      url: `${baseUrl}${guest}/customerremark/:recommendCode`
119
+    },
108
     getCaseList: { // 获取案场信息
120
     getCaseList: { // 获取案场信息
109
       method: 'get',
121
       method: 'get',
110
       url: `${baseUrl}${guest}/case`
122
       url: `${baseUrl}${guest}/case`
132
     getNum: { // 获取卡券数
144
     getNum: { // 获取卡券数
133
       method: 'get',
145
       method: 'get',
134
       url: `${baseUrl}${wechat}/customer/info`
146
       url: `${baseUrl}${wechat}/customer/info`
147
+    },
148
+    getVip: { // vip卡详情
149
+      method: 'get',
150
+      url: `${baseUrl}${wechat}/vip`
151
+    },
152
+    code: { // 获取我的推荐码
153
+      method: 'get',
154
+      url: `${baseUrl}${wechat}/user/code`
135
     }
155
     }
136
   },
156
   },
137
   director: {
157
   director: {
248
       url: `${baseUrl}${wechat}/GetCheckByUser`
268
       url: `${baseUrl}${wechat}/GetCheckByUser`
249
     }
269
     }
250
   },
270
   },
271
+  remark: {
272
+    setRemark: {
273
+      method: 'post',
274
+      url: `${baseUrl}${wechat}/customerremark`
275
+    },
276
+    getRemark: {
277
+      method: 'get',
278
+      url: `${baseUrl}${wechat}/customerremark/:salesId/:customerId`
279
+    }
280
+  },
281
+  rush: {
282
+    setRush: {
283
+      method: 'post',
284
+      url: `${baseUrl}${wechat}/flashbuy/:id`
285
+    },
286
+    getRush: {
287
+      method: 'get',
288
+      url: `${baseUrl}${wechat}/flashbuy/flash/:flashBuyId`
289
+    },
290
+    IsNewCustomer: { // 是否为新用户
291
+      method: 'get',
292
+      url: `${baseUrl}${wechat}/flashbuy/newcustomer`
293
+    },
294
+    AddNewFlashBuyCustomer: { 
295
+      method: 'post',
296
+      url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
297
+    },
298
+    UpdateFlashBuyCustomer: { 
299
+      method: 'put',
300
+      url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
301
+    }
302
+  }
251
 }
303
 }
252
 export default $api
304
 export default $api

+ 1
- 0
vue.config.js 查看文件

34
       },
34
       },
35
     },
35
     },
36
     // compress: true,
36
     // compress: true,
37
+    devtool: 'source-map',
37
     disableHostCheck: true,   // That solved it
38
     disableHostCheck: true,   // That solved it
38
   }
39
   }
39
 }
40
 }