yuantianjiao 6 years ago
parent
commit
f2c2c75b31

BIN
src/common/icon/qrCode.jpg View File


+ 2
- 2
src/components/topCaseInfo/index.vue View File

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

+ 1
- 1
src/components/topCaseInfo/page.scss View File

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

+ 6
- 2
src/pages/user/mainPage/coffeeIndex/index.vue View File

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

+ 24
- 12
src/pages/user/rush/index.vue View File

13
       <span>秒</span>
13
       <span>秒</span>
14
     </div>
14
     </div>
15
     <div class="content">
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
         <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">
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">
19
           <source :src="data.VideoUrl" type="video/mp4">
20
           <source :src="data.VideoUrl" type="video/avi">
20
           <source :src="data.VideoUrl" type="video/avi">
23
           <source :src="data.VideoUrl" type="video/rm">
23
           <source :src="data.VideoUrl" type="video/rm">
24
         </video>
24
         </video>
25
         <img v-else src="" width="100%" height="100%">
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
       <div class="scope-of-time">
28
       <div class="scope-of-time">
29
         <div>活动时间</div>
29
         <div>活动时间</div>
30
-        <div></div>
30
+        <div>{{toolClass.dateFormat(detail.StartDate)}} ~ {{toolClass.dateFormat(detail.EndDate)}}</div>
31
       </div>
31
       </div>
32
     </div>
32
     </div>
33
     <div class="submit">
33
     <div class="submit">
34
       <div :class="{light:timeStatus === 1}" @click="submit()">{{btnText[timeStatus]}}</div>
34
       <div :class="{light:timeStatus === 1}" @click="submit()">{{btnText[timeStatus]}}</div>
35
     </div>
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
   </div>
44
   </div>
37
 </template>
45
 </template>
38
 
46
 
39
 <script>
47
 <script>
48
+import logo from '../../../common/icon/qrCode.jpg'
40
 import { mapState, createNamespacedHelpers } from 'vuex'
49
 import { mapState, createNamespacedHelpers } from 'vuex'
41
 const { mapActions: actions } = createNamespacedHelpers('app')
50
 const { mapActions: actions } = createNamespacedHelpers('app')
42
 const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
51
 const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
43
 export default {
52
 export default {
44
   data () {
53
   data () {
45
     return {
54
     return {
55
+      logo,
46
       day: '00',
56
       day: '00',
47
       hour: '00',
57
       hour: '00',
48
       minute: '00',
58
       minute: '00',
50
       hasTime: false,
60
       hasTime: false,
51
       timeStatus: 0, // 0、未开始 1、进行中 2、已结束 3、已抢购
61
       timeStatus: 0, // 0、未开始 1、进行中 2、已结束 3、已抢购
52
       btnText: ['立即抢购', '立即抢购', '已结束', '已抢购'],
62
       btnText: ['立即抢购', '立即抢购', '已结束', '已抢购'],
53
-      Interval: null
63
+      Interval: null,
64
+      showDialog: false
54
     }
65
     }
55
   },
66
   },
56
   created () {
67
   created () {
57
     this.getRush({ flashBuyId: this.$route.query.flashBuyId }).then(() => {
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
   computed: {
75
   computed: {
66
     ...mapRushState({
76
     ...mapRushState({
101
       if (this.timeStatus !== 1) {
111
       if (this.timeStatus !== 1) {
102
         return
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 View File

79
   .light{
79
   .light{
80
     background: #9D876D;
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 View File

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

+ 11
- 1
src/store/userCenter/userCenter.js View File

240
       })
240
       })
241
     },
241
     },
242
     recommendCode (context, data) {
242
     recommendCode (context, data) {
243
-      console.log(data)
244
       return new Promise((resolve) => {
243
       return new Promise((resolve) => {
245
         Ajax({
244
         Ajax({
246
           ...api.user.recommendCode, 
245
           ...api.user.recommendCode, 
260
           reject()
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 View File

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