Przeglądaj źródła

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

wangfei 6 lat temu
rodzic
commit
28c7969614
40 zmienionych plików z 1228 dodań i 227 usunięć
  1. BIN
      public/favicon.ico
  2. 1
    1
      public/index.html
  3. 4
    0
      src/common/css/reset.css
  4. BIN
      src/common/icon/qrCode.jpg
  5. BIN
      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

BIN
public/favicon.ico Wyświetl plik


+ 1
- 1
public/index.html Wyświetl plik

@@ -6,7 +6,7 @@
6 6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
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 10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
11 11
   <title>
12 12
     <%= htmlWebpackPlugin.options.title %>

+ 4
- 0
src/common/css/reset.css Wyświetl plik

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

BIN
src/common/icon/qrCode.jpg Wyświetl plik


BIN
src/common/icon/vipBg.jpg Wyświetl plik


+ 16
- 0
src/components/customerCard/customerCard.vue Wyświetl plik

@@ -13,8 +13,13 @@
13 13
       </div>
14 14
       <div>
15 15
         <div @click="record">领取记录</div>
16
+        <div @click="history">历史备注</div>
16 17
       </div>
17 18
     </div>
19
+    <div class="card-bottom">
20
+      <span>备注:{{data.Remark}}</span>
21
+      <span @click="remark">+ 添加备注</span>
22
+    </div>
18 23
   </div>
19 24
 </template>
20 25
 
@@ -37,6 +42,12 @@ export default {
37 42
     record () {
38 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 53
 </script>
@@ -112,8 +123,13 @@ export default {
112 123
     display: flex;
113 124
     padding: 0.15rem;
114 125
     justify-content: space-between;
126
+    align-items: center;
115 127
     span:nth-of-type(1) {
116 128
       color: #323645;
129
+      width: 2.3rem;
130
+      white-space: nowrap;
131
+      overflow: hidden;
132
+      text-overflow: ellipsis;
117 133
     }
118 134
     span:nth-of-type(2) {
119 135
       color: #909090;

+ 2
- 1
src/components/myCard/myCard.vue Wyświetl plik

@@ -9,7 +9,8 @@
9 9
       <div>
10 10
         <h2>{{data.title}}</h2>
11 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 14
       </div>
14 15
     </div>
15 16
     <div class="card-main flex-h" @click="detail">

+ 3
- 1
src/components/topCaseInfo/index.vue Wyświetl plik

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

+ 4
- 2
src/components/topCaseInfo/page.scss Wyświetl plik

@@ -20,8 +20,10 @@
20 20
     margin-left: .2rem;
21 21
   }
22 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 27
     font-size: 0;
26 28
     span{
27 29
       font-size: .12rem;

+ 2
- 1
src/pages/sales/cardAndCouponNum/index.vue Wyświetl plik

@@ -6,7 +6,8 @@
6 6
         <div>
7 7
           <span>{{data.CardName}}</span>
8 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 11
         </div>
11 12
       </div>
12 13
     </div>

+ 61
- 3
src/pages/sales/customerSearch/index.vue Wyświetl plik

@@ -8,7 +8,7 @@
8 8
         <ul>
9 9
           <li class="customer-card">
10 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 12
               <!-- <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span> -->
13 13
               <noMore v-if="ajaxOff && hasPic"></noMore>
14 14
             </div>
@@ -24,6 +24,18 @@
24 24
       </div>
25 25
       <div class="mask-bottom"></div>
26 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 39
   </div>
28 40
 </template>
29 41
 
@@ -38,6 +50,7 @@ const { mapActions: actions } = createNamespacedHelpers('app')
38 50
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
39 51
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
40 52
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
53
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
41 54
 
42 55
 export default {
43 56
   name: '',
@@ -58,6 +71,8 @@ export default {
58 71
       mask: true,
59 72
       checked: true,
60 73
       cardList: [],
74
+      showDialog: false,
75
+      remarkCustomerId: ''
61 76
     }
62 77
   },
63 78
   computed: {
@@ -98,9 +113,43 @@ export default {
98 113
     ...mapCaseActions([
99 114
       'getCaseTotal',
100 115
     ]),
116
+    ...mapRemarkActions(['setRemark']),
101 117
     record (item) {
102 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 154
     searchMask () {
106 155
       this.getCustomerList({
@@ -139,7 +188,16 @@ export default {
139 188
         caseid: this.topCaseInfoData.caseId
140 189
       })
141 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 203
 </script>

+ 41
- 14
src/pages/sales/history/index.vue Wyświetl plik

@@ -1,48 +1,75 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 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 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 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 12
       <div class="list-card" v-for="(item,index) in list" :key="index">
13 13
         <div class="point-top"></div>
14 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 17
       </div>
18 18
     </div>
19
+    <noMore v-if="list.length <= 0"></noMore>
19 20
   </div>
20 21
 </template>
21 22
 
22 23
 <script>
23 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 29
 export default {
26 30
   name: '',
27 31
   data () {
28 32
     return {
29
-      list: [1,1,1,1,1],
30 33
       topCaseInfoData: {
31 34
         caseName: '',
32 35
         caseId: '',
33
-        showSelect: false,
34
-        userName: 'xxx'
36
+        ShowSelect: false,
35 37
       },
36 38
     }
37 39
   },
38 40
   components: {
39 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 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 66
   methods: {
45
-    
67
+    ...actions([
68
+      'getCaseList',
69
+    ]),
70
+    ...mapRemarkActions([
71
+      'getRemark',
72
+    ])
46 73
   }
47 74
 }
48 75
 </script>

+ 1
- 1
src/pages/sales/salesGiveOutDetail/index.vue Wyświetl plik

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

+ 124
- 83
src/pages/user/bindMobile/bindMobile.vue Wyświetl plik

@@ -10,7 +10,7 @@
10 10
           <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
11 11
         </div>
12 12
 
13
-        <div class="recommend">
13
+        <!-- <div class="recommend">
14 14
           <span>推荐人</span>
15 15
           <div @click="selectCase">
16 16
             <span>{{caseName}}</span>
@@ -20,6 +20,11 @@
20 20
             <span>{{salesName}}</span>
21 21
             <i class="iconfont icon-triangle-bottom"></i>
22 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 28
         </div>
24 29
 
25 30
         <div class="sms">
@@ -33,7 +38,7 @@
33 38
           <div>提交</div>
34 39
         </div>
35 40
       </div>
36
-      <transition name="slide">
41
+      <!-- <transition name="slide">
37 42
         <div class="select" v-if="showCase">
38 43
           <van-picker
39 44
             show-toolbar
@@ -56,7 +61,7 @@
56 61
             @confirm="onConfirmS"
57 62
           />
58 63
         </div>
59
-      </transition>
64
+      </transition> -->
60 65
     </div>
61 66
   </div>
62 67
 </template>
@@ -65,7 +70,6 @@
65 70
 import logo from '../../../common/icon/logo.png'
66 71
 import { mapState, createNamespacedHelpers } from 'vuex'
67 72
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
68
-let canSubmit
69 73
 export default {
70 74
   data () {
71 75
     return {
@@ -79,10 +83,12 @@ export default {
79 83
       seconds: 61,
80 84
       postData: {
81 85
         phone: '',
82
-        case: '',
83
-        sales: '',
86
+        // case: '',
87
+        // sales: '',
88
+        recommendCode: '',
84 89
         captcha: ''
85
-      }
90
+      },
91
+      canSubmit: true
86 92
     }
87 93
   },
88 94
   computed: {
@@ -91,68 +97,84 @@ export default {
91 97
     })
92 98
   },
93 99
   created () {
94
-    canSubmit = true
95 100
     this.getCaseInfo(1).then(() => {
96 101
       this.columns = this.caseInfo.cases
97 102
     })
103
+    console.log(1123)
98 104
   },
99 105
   methods: {
100 106
     ...actions(['getCaseInfo']),
101 107
     ...actions(['getCaptcha']),
102 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 155
     sandMsg () {
149 156
       if (!this.postData.phone) {
150 157
         this.$toast('请先填写手机号')
151 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 179
     runTime () {
158 180
       setTimeout(() => {
@@ -165,39 +187,58 @@ export default {
165 187
       }, 1000)
166 188
     },
167 189
     submit () {
168
-      if (!canSubmit){
190
+      if (!this.canSubmit) {
169 191
         return
170 192
       }
171
-      canSubmit = false
193
+      this.canSubmit = false
172 194
       if (!this.postData.captcha) {
173 195
         this.$toast('请填写验证码')
174
-        canSubmit = true
196
+        this.canSubmit = true
175 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 Wyświetl plik

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

+ 94
- 40
src/pages/user/mainPage/coffeeIndex/index.vue Wyświetl plik

@@ -1,16 +1,16 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 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 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 8
     </nav>
9 9
       <div class="content">
10 10
         <div>
11 11
           <ul>
12 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 14
                 <div class="flex-item">
15 15
                   <div>
16 16
                     <span>共计已使用:{{caseTotal.total}}杯</span>
@@ -93,7 +93,7 @@
93 93
                   </van-checkbox>
94 94
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
95 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 97
                 <noMore v-if="data[3].hasPic"></noMore>
98 98
               </div>
99 99
             </li>
@@ -138,6 +138,7 @@ import { mapState, createNamespacedHelpers } from 'vuex'
138 138
 const { mapActions: actions } = createNamespacedHelpers('app')
139 139
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
140 140
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
141
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
141 142
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
142 143
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
143 144
 const wx = require('weixin-js-sdk')
@@ -146,6 +147,7 @@ export default {
146 147
   name: '',
147 148
   data () {
148 149
     return {
150
+      fromPage: '',
149 151
       myRecommendUserList: [],
150 152
       forbidList: [],
151 153
       postCustomerData: {
@@ -194,6 +196,7 @@ export default {
194 196
         caseName: '',
195 197
         caseId: '',
196 198
         ShowSelect: false,
199
+        recommendCode: ''
197 200
       },
198 201
       caseInfo: {
199 202
         value: '',
@@ -236,7 +239,8 @@ export default {
236 239
           pagesize: 1,
237 240
           list: []
238 241
         }
239
-      ]
242
+      ],
243
+      remarkCustomerId: ''
240 244
     }
241 245
   },
242 246
   computed: {
@@ -247,6 +251,7 @@ export default {
247 251
     }),
248 252
     ...mapCaseState({
249 253
       caseTotal: x => x.caseTotal,
254
+      choosedCase: x => x.choosedCase
250 255
     }),
251 256
     ...mapCardState({
252 257
       cardList: x => x.cardList
@@ -260,7 +265,8 @@ export default {
260 265
     noMore
261 266
   },
262 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 270
       this.topCaseInfoData.ShowSelect = true
265 271
     }
266 272
     if (this.userInfo.customer.MapUser !== '') {
@@ -300,7 +306,8 @@ export default {
300 306
                 SentCount: res.list[n].SentCount,
301 307
                 usedCount: res.list[n].UsedCount,
302 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 313
             var count = 0
@@ -342,6 +349,9 @@ export default {
342 349
           }
343 350
         })
344 351
       })
352
+      this.getRecommendCode().then((res) => {
353
+        this.topCaseInfoData.recommendCode = res
354
+      })
345 355
     } else {
346 356
 
347 357
     }
@@ -355,6 +365,7 @@ export default {
355 365
       'getMyCouponList',
356 366
       'getForbidInfo',
357 367
       'getCustomerList',
368
+      'getRecommendCode'
358 369
     ]),
359 370
     ...actions([
360 371
       'getCaseList',
@@ -365,8 +376,10 @@ export default {
365 376
     ...mapCaseActions([
366 377
       'getCaseTotal',
367 378
       'getCaseConf',
379
+      'changeChoosedCase'
368 380
     ]),
369 381
     ...mapCardActions(['getCardList']),
382
+    ...mapRemarkActions(['setRemark']),
370 383
     checkCanDo () {
371 384
       const _that = this
372 385
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
@@ -386,6 +399,10 @@ export default {
386 399
       }
387 400
     },
388 401
     returnInvalid (item, type) {
402
+      console.log(item)
403
+      if (item.ValidDays && item.ValidDays > 0) {
404
+        return false
405
+      }
389 406
       for (var n = 0; n < this.forbidList.length; n++) {
390 407
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
391 408
           return true
@@ -413,6 +430,7 @@ export default {
413 430
         caseid: this.topCaseInfoData.caseId
414 431
       })
415 432
       this.showSelect = false
433
+      this.changeChoosedCase({ CaseName: val.CaseName, CaseId: val.CaseId })
416 434
     },
417 435
     cutNav (index) { // 切换nav
418 436
       this.navActive = index
@@ -460,10 +478,11 @@ export default {
460 478
     remark (item) {
461 479
       // console.log(item)
462 480
       this.showDialog = true
481
+      this.remarkCustomerId = item.CustomerId
463 482
     },
464 483
     history (item) {
465 484
       // console.log(item)
466
-      window.location.href = this.getUrl('history')
485
+      window.location.href = this.getUrl(`history?customerId=${item.CustomerId}`)
467 486
     },
468 487
     record (item) {
469 488
       // console.log(item)
@@ -498,46 +517,81 @@ export default {
498 517
           })
499 518
         }
500 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 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 571
     beforeClose (action, done) {
539 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 595
       } else {
542 596
         done()
543 597
       }
@@ -545,7 +599,7 @@ export default {
545 599
     toOrders (subItem, item) {
546 600
       const _that = this
547 601
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
548
-        if (this.checkCanOrder()) {
602
+        if (this.checkCanOrder() && sessionStorage.getItem('from') === 'sales') {
549 603
           _that.$toast('您的点单功能已被关闭!')
550 604
           return
551 605
         }

+ 11
- 4
src/pages/user/mainPage/index.vue Wyświetl plik

@@ -5,7 +5,7 @@
5 5
         <router-view></router-view>
6 6
       </div>
7 7
     </div>
8
-    <nav class="flex-h">
8
+    <nav class="flex-h" :style="{paddingBottom: isIphoneX ? '.1rem' : '0'}">
9 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 10
         <div>
11 11
           <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
@@ -19,11 +19,12 @@
19 19
 </template>
20 20
 
21 21
 <script>
22
-import { mapState } from 'vuex'
22
+import { mapState, mapActions } from 'vuex'
23 23
 export default {
24 24
   name: '',
25 25
   data () {
26 26
     return {
27
+      isIphoneX: false,
27 28
       tabBar: [{
28 29
         pathName: 'indexPage',
29 30
         name: '城的空间'
@@ -45,11 +46,17 @@ export default {
45 46
   components: {
46 47
   },
47 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 54
     if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
49 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 62
 </script>

+ 9
- 3
src/pages/user/mainPage/userCenter/index.vue Wyświetl plik

@@ -30,12 +30,13 @@
30 30
           <span>卡券</span>
31 31
           <span>0张未使用</span>
32 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 35
           <div class="img-box">
35 36
             <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
36 37
           </div>
37 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 40
         </div>
40 41
       </div>
41 42
 
@@ -86,6 +87,8 @@ export default {
86 87
       this.user = this.userInfo.customer
87 88
       if (this.user.AccountInfo) {
88 89
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
90
+
91
+        
89 92
       }
90 93
       this.headimgurl = this.user.Headimgurl
91 94
     })
@@ -99,6 +102,9 @@ export default {
99 102
     toVip () {
100 103
       this.$router.push({ name: 'vip' })
101 104
     },
105
+    toVipDetail() {
106
+      this.$router.push({ name: 'vipDetail' })
107
+    },
102 108
     toCard () {
103 109
       this.$router.push({ name: 'card' })
104 110
     },
@@ -109,7 +115,7 @@ export default {
109 115
       this.$router.push({ name: 'bindMobile' })
110 116
     },
111 117
     toGoodsOrder () {
112
-      this.$router.push({ name: 'orderList' })
118
+      this.$router.push({ name: 'orderList', query: { from: 'c' } })
113 119
     },
114 120
     toBodyCheck () {
115 121
       var url = window.location.pathname

+ 7
- 1
src/pages/user/mainPage/userCenter/page.scss Wyświetl plik

@@ -84,12 +84,18 @@
84 84
   box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85 85
   border-radius:8px;
86 86
   box-sizing: border-box;
87
-
88 87
   .privilege-item {
89 88
     display: flex;
90 89
     flex-flow: column nowrap;
91 90
     justify-content: center;
92 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 99
     .img-box {
94 100
       width: 0.24rem;
95 101
       height: 0.18rem;

+ 15
- 2
src/pages/user/majorProjectsDetail/index.vue Wyświetl plik

@@ -112,6 +112,7 @@ export default {
112 112
       message: x => x.index.message,
113 113
       project: x => x.index.project,
114 114
       cms: x => x.index.cms,
115
+      user: x => x.userCenter.userInfo
115 116
     }),
116 117
     ...mapProjectState({
117 118
       courseDetail: x => x.courseDetail
@@ -136,7 +137,7 @@ export default {
136 137
         this.courseDetail.CourseImgs.sort(this.getSortFun('asc', 'Sort'))
137 138
         this.detailImage = this.courseDetail.CourseImgs
138 139
       }
139
-      console.log(this.detailImage)
140
+      // console.log(this.detailImage)
140 141
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
141 142
       let nowDate = Date.now()
142 143
       let endData = new Date(this.courseDetail.EndDate).getTime()
@@ -153,6 +154,7 @@ export default {
153 154
   methods: {
154 155
     ...mapProjectActions([
155 156
       'getCourseDetailInfo',
157
+      'placeCourseOrderBefore',
156 158
     ]),
157 159
     getSortFun (order, sortBy) {
158 160
       var ordAlpah = (order == 'asc') ? '>' : '<'
@@ -184,7 +186,18 @@ export default {
184 186
       if (nowDate > endData) {
185 187
         this.$toast('该课程已过期')
186 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 203
     openMap () {

+ 5
- 3
src/pages/user/orderList/index.vue Wyświetl plik

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

+ 52
- 13
src/pages/user/placeOrder/index.vue Wyświetl plik

@@ -16,7 +16,7 @@
16 16
         <div class="flex-item">
17 17
           <div>
18 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 20
           </div>
21 21
         </div>
22 22
         <a @click="reback">返回选择桌号</a>
@@ -68,7 +68,7 @@
68 68
       </div>
69 69
       <a @click="toPlaceOrder">下单</a>
70 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 72
     <calcMenu :show="showCalcMenu" :totalNum="sumNum + caseTotal.total" :data="selGoods" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
73 73
     <div class="successPopup" v-if="showSuccessPopup">
74 74
       <div>
@@ -185,6 +185,7 @@ export default {
185 185
     calcMenu,
186 186
   },
187 187
   created () {
188
+    this.fromPage = sessionStorage.getItem('from')
188 189
     this.getGoodsTypeList({
189 190
       caseid: this.caseId,
190 191
     }).then((res) => {
@@ -206,6 +207,7 @@ export default {
206 207
     ...caseTableActions([
207 208
       'getGoodsTypeList',
208 209
       'getGoodsList',
210
+      'toPayBefore',
209 211
       'toPay',
210 212
     ]),
211 213
     ...mapCaseActions([
@@ -213,8 +215,47 @@ export default {
213 215
     ]),
214 216
     toPlaceOrder () { // 下单 
215 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 259
         } else {
219 260
           this.showCalcMenu = true
220 261
         }
@@ -275,13 +316,14 @@ export default {
275 316
       })
276 317
     },
277 318
     placeOrder (Remark) { // 下单
278
-      if(this.ajaxOff){
319
+      if (this.ajaxOff) {
279 320
         this.ajaxOff = false
280 321
         this.postData.info.OrgId = this.orgId
281 322
         this.postData.info.UserId = this.userInfo.CustomerId
282 323
         this.postData.info.UserName = this.userInfo.customer.CustomerName
283 324
         this.postData.info.PayType = 'sys user'
284 325
         this.postData.info.Remark = Remark
326
+        this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
285 327
         var orderInfo = this.selGoods
286 328
         this.postData.detail = []
287 329
         var amount = 0
@@ -304,7 +346,8 @@ export default {
304 346
         this.toPay({
305 347
           info: JSON.stringify(this.postData.info),
306 348
           detail: JSON.stringify(this.postData.detail),
307
-          coupon: JSON.stringify(this.postData.coupon)
349
+          customercouponid: '',
350
+          from: this.postData.from
308 351
         }).then((res) => {
309 352
           this.ajaxOff = true
310 353
           this.showCalcMenu = false
@@ -315,6 +358,8 @@ export default {
315 358
           // }).then(() => {
316 359
 
317 360
           // })
361
+        }).catch(() => {
362
+          this.ajaxOff = true
318 363
         })
319 364
       }
320 365
     },
@@ -389,10 +434,4 @@ export default {
389 434
 <!-- Add "scoped" attribute to limit CSS to this component only -->
390 435
 <style lang="scss" scoped>
391 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 Wyświetl plik

@@ -211,32 +211,9 @@ export default {
211 211
     toPayer () { // 下单
212 212
       if (this.ajaxoff) {
213 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 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 217
           customercouponid: this.postData.customercouponid
241 218
         }).then((res) => {
242 219
           this.showSuccessPopup = true
@@ -246,7 +223,7 @@ export default {
246 223
           //   window.history.go(-2)
247 224
           // })
248 225
         }).catch(() => {
249
-          // this.ajaxoff = true
226
+          this.ajaxOff = true
250 227
         })
251 228
       }
252 229
     },

+ 6
- 14
src/pages/user/placeOrderForCourse/index.vue Wyświetl plik

@@ -164,6 +164,7 @@ export default {
164 164
   },
165 165
   created () {
166 166
     this.getCouponList().then((res) => {
167
+      res = res || []
167 168
       this.getCourseDetailInfo({ id: this.$route.query.id }).then((result) => {
168 169
         var arr = result.CourseDetail, caseid = result.CaseId
169 170
         // console.log(arr)
@@ -244,13 +245,10 @@ export default {
244 245
         return false
245 246
       }
246 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 252
       }).then((res) => {
255 253
         // console.log(JSON.stringify(res))
256 254
         this.$dialog.alert({
@@ -295,10 +293,4 @@ export default {
295 293
 <!-- Add "scoped" attribute to limit CSS to this component only -->
296 294
 <style lang="scss" scoped>
297 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 Wyświetl plik

@@ -29,7 +29,8 @@
29 29
           <i class="icon-kaquan iconfont"></i>
30 30
           <span>卡券有效期</span>
31 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 34
       </div>
34 35
       <div class="text">
35 36
         <div>
@@ -114,6 +115,11 @@ export default {
114 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 124
     receive () {
119 125
       if (this.$route.query.type === 'card') {

+ 11
- 0
src/pages/user/router.js Wyświetl plik

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

+ 145
- 0
src/pages/user/rush/index.vue Wyświetl plik

@@ -0,0 +1,145 @@
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 Wyświetl plik

@@ -0,0 +1,139 @@
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 Wyświetl plik

@@ -0,0 +1,87 @@
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 Wyświetl plik

@@ -0,0 +1,86 @@
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 Wyświetl plik

@@ -7,6 +7,7 @@ export default {
7 7
   state: {
8 8
     caseTotal: {},
9 9
     caseConf: {},
10
+    choosedCase: {}
10 11
   },
11 12
   mutations: {
12 13
     setCaseTotal (state, data) { // 获取案场下单数量信息
@@ -15,6 +16,9 @@ export default {
15 16
     setCaseConf (state, data) { // 获取案场下单数量信息
16 17
       state.caseConf = data
17 18
     },
19
+    setChoosedCase (state, data) { // 获取案场下单数量信息
20
+      state.choosedCase = data
21
+    },
18 22
   },
19 23
   actions: {
20 24
     getCaseTotal ({ commit }, { caseid }) {
@@ -32,7 +36,7 @@ export default {
32 36
         })
33 37
       })
34 38
     },
35
-    getCaseConf ({ commit },{ caseid }) {
39
+    getCaseConf ({ commit }, { caseid }) {
36 40
       return new Promise((resolve, reject) => {
37 41
         Ajax(api.case.conf.url, {
38 42
           method: api.case.conf.method,
@@ -46,6 +50,9 @@ export default {
46 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 Wyświetl plik

@@ -25,6 +25,9 @@ export const modules = {
25 25
   forbid: () => require('./forbid/index').default,
26 26
   share: () => require('./share/index').default,
27 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 33
 Object.keys(modules).forEach((modKey) => {

+ 20
- 3
src/store/majorProjects/majorProjects.js Wyświetl plik

@@ -17,10 +17,10 @@ export default {
17 17
     }
18 18
   },
19 19
   actions: {
20
-    placeOrderForCourse (context, { order, customercouponid }) { // 课程下单
20
+    placeCourseOrderBefore (context, { order, customercouponid }) { // 课程下单
21 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 24
           data: {
25 25
             info: window.JSON.stringify(order),
26 26
             customercouponid,
@@ -32,6 +32,23 @@ export default {
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 52
     getProjectInfo (context, { id }) { // 获取课程列表
36 53
       return new Promise((resolve) => {
37 54
         Ajax(api.majorProjects.getCourseList.url, {

+ 22
- 3
src/store/placeOrderForCoffee/index.js Wyświetl plik

@@ -63,14 +63,15 @@ export default {
63 63
         })
64 64
       })
65 65
     },
66
-    toPay (context, { info, detail, customercouponid }) { // 下单
66
+    toPayBefore (context, { info, detail, customercouponid, from }) { // 下单
67 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 70
           data: {
71 71
             info,
72 72
             detail,
73 73
             customercouponid,
74
+            from
74 75
           },
75 76
         }).then(res => {
76 77
           resolve(res)
@@ -79,6 +80,24 @@ export default {
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 101
     getCouponList (context) { // 获取优惠券列表
83 102
       return new Promise((resolve) => {
84 103
         Ajax(api.caseForCoffee.getCouponList.url, {

+ 50
- 0
src/store/remark/index.js Wyświetl plik

@@ -0,0 +1,50 @@
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 Wyświetl plik

@@ -0,0 +1,77 @@
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 Wyświetl plik

@@ -239,14 +239,37 @@ export default {
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 254
     submitData (context, data) {
243
-      return new Promise((resolve,reject) => {
255
+      return new Promise((resolve, reject) => {
244 256
         http.submitData(data).then((res) => {
245 257
           resolve(res)
246 258
         }).catch(() => {
247 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 Wyświetl plik

@@ -0,0 +1,30 @@
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 Wyświetl plik

@@ -47,10 +47,14 @@ const $api = {
47 47
       method: 'get',
48 48
       url: `${baseUrl}${guest}/goods`
49 49
     },
50
-    placeGoodsOrder: { // 商品下单
50
+    placeGoodsOrderBefore: { // 商品下单
51 51
       method: 'post',
52 52
       url: `${baseUrl}${wechat}/order/goods`
53 53
     },
54
+    placeGoodsOrder: { // 商品下单
55
+      method: 'put',
56
+      url: `${baseUrl}${wechat}/order/goods/:id`
57
+    },
54 58
     getCouponList: { // 获取优惠券列表
55 59
       method: 'get',
56 60
       url: `${baseUrl}${wechat}/customer/coupon`
@@ -69,10 +73,14 @@ const $api = {
69 73
       method: 'get',
70 74
       url: `${baseUrl}${guest}/course/:id`
71 75
     },
72
-    placeCourseOrder: { // 课程下单
76
+    placeCourseOrderBefore: { // 课程下单
73 77
       method: 'post',
74 78
       url: `${baseUrl}${wechat}/order/course`
75 79
     },
80
+    placeCourseOrder: { // 课程下单
81
+      method: 'put',
82
+      url: `${baseUrl}${wechat}/order/course/:id`
83
+    },
76 84
   },
77 85
   card: {
78 86
     myCustomer: { // 我的客户
@@ -105,6 +113,10 @@ const $api = {
105 113
       method: 'get',
106 114
       url: `${baseUrl}${guest}/captcha`
107 115
     },
116
+    recommendCode: { // 验证推荐码
117
+      method: 'get',
118
+      url: `${baseUrl}${guest}/customerremark/:recommendCode`
119
+    },
108 120
     getCaseList: { // 获取案场信息
109 121
       method: 'get',
110 122
       url: `${baseUrl}${guest}/case`
@@ -132,6 +144,14 @@ const $api = {
132 144
     getNum: { // 获取卡券数
133 145
       method: 'get',
134 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 157
   director: {
@@ -248,5 +268,37 @@ const $api = {
248 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 304
 export default $api

+ 1
- 0
vue.config.js Wyświetl plik

@@ -34,6 +34,7 @@ module.exports = {
34 34
       },
35 35
     },
36 36
     // compress: true,
37
+    devtool: 'source-map',
37 38
     disableHostCheck: true,   // That solved it
38 39
   }
39 40
 }