yuantianjiao 6 年前
父节点
当前提交
f2c2c75b31

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


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

@@ -4,7 +4,7 @@
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">我的推荐码{{data.recommendCode}}</span>
7
+        <span v-if="data.recommendCode && fromPage === 'sales'">我的推荐码{{data.recommendCode}}</span>
8 8
         <span v-else></span>
9 9
         <span>{{userName}}您好!</span>
10 10
       </div>
@@ -15,7 +15,7 @@
15 15
 
16 16
 export default {
17 17
   name: '',
18
-  props: ['data', 'userName'],
18
+  props: ['data', 'userName' ,'fromPage'],
19 19
   data () {
20 20
     return {
21 21
 

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

@@ -23,7 +23,7 @@
23 23
     display: flex;
24 24
     justify-content: space-between;
25 25
     align-items: center;
26
-    margin: 0 .2rem 0 .1rem;
26
+    margin: 0 .2rem 0 .2rem;
27 27
     font-size: 0;
28 28
     span{
29 29
       font-size: .12rem;

+ 6
- 2
src/pages/user/mainPage/coffeeIndex/index.vue 查看文件

@@ -1,7 +1,7 @@
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 6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">
7 7
       <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
@@ -196,7 +196,7 @@ export default {
196 196
         caseName: '',
197 197
         caseId: '',
198 198
         ShowSelect: false,
199
-        recommendCode: 3066
199
+        recommendCode: ''
200 200
       },
201 201
       caseInfo: {
202 202
         value: '',
@@ -348,6 +348,9 @@ export default {
348 348
           }
349 349
         })
350 350
       })
351
+      this.getRecommendCode().then((res) => {
352
+        this.topCaseInfoData.recommendCode = res
353
+      })
351 354
     } else {
352 355
 
353 356
     }
@@ -361,6 +364,7 @@ export default {
361 364
       'getMyCouponList',
362 365
       'getForbidInfo',
363 366
       'getCustomerList',
367
+      'getRecommendCode'
364 368
     ]),
365 369
     ...actions([
366 370
       'getCaseList',

+ 24
- 12
src/pages/user/rush/index.vue 查看文件

@@ -13,8 +13,8 @@
13 13
       <span>秒</span>
14 14
     </div>
15 15
     <div class="content">
16
-      <div class="title">悦见山咖啡抽奖活动</div>
17
-      <div class="video-or-cover">
16
+      <div class="title">{{detail.FlashBuyName}}</div>
17
+      <!-- <div class="video-or-cover">
18 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 19
           <source :src="data.VideoUrl" type="video/mp4">
20 20
           <source :src="data.VideoUrl" type="video/avi">
@@ -23,26 +23,36 @@
23 23
           <source :src="data.VideoUrl" type="video/rm">
24 24
         </video>
25 25
         <img v-else src="" width="100%" height="100%">
26
-      </div>
27
-      <pre class="rule"></pre>
26
+      </div> -->
27
+      <pre class="rule">{{detail.FlashBuyInfo}}</pre>
28 28
       <div class="scope-of-time">
29 29
         <div>活动时间</div>
30
-        <div></div>
30
+        <div>{{toolClass.dateFormat(detail.StartDate)}} ~ {{toolClass.dateFormat(detail.EndDate)}}</div>
31 31
       </div>
32 32
     </div>
33 33
     <div class="submit">
34 34
       <div :class="{light:timeStatus === 1}" @click="submit()">{{btnText[timeStatus]}}</div>
35 35
     </div>
36
+    <div class="success-box" v-if="showDialog">
37
+      <div class="success">
38
+        <span>恭喜您!抢购成功</span>
39
+        <img :src="logo" alt="">
40
+        <span>长按二维码关注“城的空间”,进入会员中心查看吧</span>
41
+        <div @click="showDialog = false">确定</div>
42
+      </div>
43
+    </div>
36 44
   </div>
37 45
 </template>
38 46
 
39 47
 <script>
48
+import logo from '../../../common/icon/qrCode.jpg'
40 49
 import { mapState, createNamespacedHelpers } from 'vuex'
41 50
 const { mapActions: actions } = createNamespacedHelpers('app')
42 51
 const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
43 52
 export default {
44 53
   data () {
45 54
     return {
55
+      logo,
46 56
       day: '00',
47 57
       hour: '00',
48 58
       minute: '00',
@@ -50,17 +60,17 @@ export default {
50 60
       hasTime: false,
51 61
       timeStatus: 0, // 0、未开始 1、进行中 2、已结束 3、已抢购
52 62
       btnText: ['立即抢购', '立即抢购', '已结束', '已抢购'],
53
-      Interval: null
63
+      Interval: null,
64
+      showDialog: false
54 65
     }
55 66
   },
56 67
   created () {
57 68
     this.getRush({ flashBuyId: this.$route.query.flashBuyId }).then(() => {
58
-
69
+      let start = new Date(this.detail.StartDate).getTime()
70
+      let end = new Date(this.detail.EndDate).getTime()
71
+      this.timing(start, end)
59 72
     })
60
-    let start = 1540275765202
61
-    let end = 1540481765202
62
-    console.log(this)
63
-    this.timing(start, end)
73
+
64 74
   },
65 75
   computed: {
66 76
     ...mapRushState({
@@ -101,7 +111,9 @@ export default {
101 111
       if (this.timeStatus !== 1) {
102 112
         return
103 113
       }
104
-      this.setRush()
114
+      this.setRush({ id: this.detail.FlashBuyId }).then(() => {
115
+        this.showDialog = true
116
+      })
105 117
     }
106 118
   }
107 119
 }

+ 44
- 1
src/pages/user/rush/page.scss 查看文件

@@ -79,4 +79,47 @@
79 79
   .light{
80 80
     background: #9D876D;
81 81
   }
82
-}
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
+}

+ 2
- 1
src/store/rush/index.js 查看文件

@@ -29,7 +29,8 @@ export default {
29 29
     setRush (context, data) {
30 30
       return new Promise((resolve, reject) => {
31 31
         Ajax({
32
-          ...api.rush.setRush
32
+          ...api.rush.setRush,
33
+          urlData: { ...data }
33 34
         }).then(res => {
34 35
           resolve(res)
35 36
         }).catch((err) => {

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

@@ -240,7 +240,6 @@ export default {
240 240
       })
241 241
     },
242 242
     recommendCode (context, data) {
243
-      console.log(data)
244 243
       return new Promise((resolve) => {
245 244
         Ajax({
246 245
           ...api.user.recommendCode, 
@@ -260,6 +259,17 @@ export default {
260 259
           reject()
261 260
         })
262 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
+      })
263 273
     }
264 274
   }
265 275
 }

+ 7
- 3
src/util/api.js 查看文件

@@ -148,6 +148,10 @@ const $api = {
148 148
     getVip: { // vip卡详情
149 149
       method: 'get',
150 150
       url: `${baseUrl}${wechat}/vip`
151
+    },
152
+    code: { // 获取我的推荐码
153
+      method: 'get',
154
+      url: `${baseUrl}${wechat}/user/code`
151 155
     }
152 156
   },
153 157
   director: {
@@ -264,7 +268,7 @@ const $api = {
264 268
       url: `${baseUrl}${wechat}/GetCheckByUser`
265 269
     }
266 270
   },
267
-  remark:{
271
+  remark: {
268 272
     setRemark: {
269 273
       method: 'post',
270 274
       url: `${baseUrl}${wechat}/customerremark`
@@ -274,10 +278,10 @@ const $api = {
274 278
       url: `${baseUrl}${wechat}/customerremark/:salesId/:customerId`
275 279
     }
276 280
   },
277
-  rush:{
281
+  rush: {
278 282
     setRush: {
279 283
       method: 'post',
280
-      url: `${baseUrl}${wechat}/customerremark`
284
+      url: `${baseUrl}${wechat}/flashbuy/:id`
281 285
     },
282 286
     getRush: {
283 287
       method: 'get',