yuantianjiao před 6 roky
rodič
revize
1f2130a44c

+ 23
- 9
src/App.vue Zobrazit soubor

@@ -1,23 +1,37 @@
1 1
 <template>
2
-  <div id="app">
2
+  <div id="app" v-if="showPage">
3 3
     <router-view/>
4 4
   </div>
5 5
 </template>
6 6
 
7 7
 <script>
8 8
 import { createNamespacedHelpers } from 'vuex'
9
-const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('main')
9
+const { mapActions: mapIndexActions } = createNamespacedHelpers('main')
10 10
 export default {
11 11
   data () {
12
-    return {}
12
+    return {
13
+      showPage: false
14
+    }
13 15
   },
14
-  computed:{
15
-    ...mapIndexState({
16
-      userInfo: item => item.userInfo
17
-    })
16
+  created () {
17
+    if (location.search && this.toolClass.UrlSearch(location.search).code) {
18
+      this.code = this.toolClass.UrlSearch(location.search).code
19
+      let oldCode = localStorage.getItem('code')
20
+      if (this.code === oldCode) {
21
+        localStorage.setItem('code', this.code)
22
+        this.toolClass.getCode('wx32e2e8c81f66070e')
23
+      } else {
24
+        localStorage.setItem('code', this.code)
25
+        this.customer(this.code).then(() => {
26
+          this.showPage = true
27
+        })
28
+      }
29
+    } else {
30
+      this.toolClass.getCode('wx32e2e8c81f66070e')
31
+    }
18 32
   },
19
-  methods:{
20
-    ...mapIndexActions(['setUserInfo'])
33
+  methods: {
34
+    ...mapIndexActions(['customer'])
21 35
   }
22 36
 }
23 37
 </script>

+ 1
- 1
src/router.js Zobrazit soubor

@@ -14,7 +14,7 @@ export default new Router({
14 14
       component: () => import(/* webpackChunkName: "supportMain" */ './views/supportMain/supportMain.vue')
15 15
     },
16 16
     {
17
-      path: '/supportDetail',
17
+      path: '/supportDetail/:other/:recordid',
18 18
       name: 'supportDetail',
19 19
       component: () => import(/* webpackChunkName: "supportDetail" */ './views/supportDetail/supportDetail.vue')
20 20
     }

+ 5
- 13
src/store/main.js Zobrazit soubor

@@ -6,19 +6,10 @@ export default {
6 6
   state: {
7 7
     gameid: '1',
8 8
     game: {},
9
-    userInfo: {
10
-      Address: "江苏省,南京市,玄武区",
11
-      CreateDate: "2018-12-08T19:06:15+08:00",
12
-      CustomerId: "1",
13
-      CustomerName: "kini",
14
-      HeadImg: "",
15
-      Name: "袁天骄",
16
-      Openid: "123",
17
-      Phone: "13776975175",
18
-      Sex: 0
19
-    },
9
+    userInfo: {},
20 10
     recordInfo: {},
21
-    supports: []
11
+    supports: [],
12
+    recordUser: {}
22 13
   },
23 14
   mutations: {
24 15
     updateGame (state, data) {
@@ -30,6 +21,7 @@ export default {
30 21
     updateRecordInfo (state, data) {
31 22
       state.recordInfo = data.record || {}
32 23
       state.supports = data.supports || []
24
+      state.recordUser = data.customer || {}
33 25
     }
34 26
   },
35 27
   actions: {
@@ -65,7 +57,7 @@ export default {
65 57
         ajax({
66 58
           ...api.signup,
67 59
           urlData: {
68
-            customerid: context.state.userInfo.customerid
60
+            customerid: context.state.userInfo.CustomerId
69 61
           },
70 62
           data: data
71 63
         }).then((res) => {

+ 4
- 0
src/util/api.js Zobrazit soubor

@@ -25,6 +25,10 @@ const $api = {
25 25
   setSupport: { // 助力
26 26
     method: 'post',
27 27
     url: `${baseUrl}${common}/support/:customerid/:recordid`
28
+  },
29
+  share:{ // 分享
30
+    method: 'get',
31
+    url: `${baseUrl}${common}/wechat/jssdk/signature`
28 32
   }
29 33
 }
30 34
 export default $api

+ 4
- 2
src/util/share.js Zobrazit soubor

@@ -12,8 +12,8 @@ function wxsdk (params, config) {
12 12
   }
13 13
   // 初始化
14 14
   return new Promise(function (resolve, reject) {
15
-    Ajax(api.share.share.url, {
16
-      method: api.share.share.method,
15
+    Ajax({
16
+      ...api.share,
17 17
       queryData: {
18 18
         ...params
19 19
       }
@@ -37,6 +37,8 @@ function wxsdk (params, config) {
37 37
         ]
38 38
       })
39 39
       wx.ready(function () {
40
+        // 此console.log不要删除,删除后可能会出错
41
+        console.log('share', shareData)
40 42
         wx.onMenuShareTimeline(shareData)
41 43
         wx.onMenuShareAppMessage(shareData)
42 44
         resolve('success')

+ 1
- 1
src/util/util.js Zobrazit soubor

@@ -40,7 +40,7 @@ const toolClass = {
40 40
     return theRequest
41 41
   },
42 42
   getCode: (appid) => {
43
-    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${wechatConfig.redirect_uri}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
43
+    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(window.location.href)}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
44 44
     window.location.href = url
45 45
   },
46 46
 

+ 45
- 39
src/views/supportDetail/supportDetail.vue Zobrazit soubor

@@ -7,14 +7,14 @@
7 7
           <div class="countdown" :class="{'on':status < 3,'off':status == 3}" v-html="countdown"></div>
8 8
           <div class="userInfo">
9 9
             <div class="avatars">
10
-              <img class="cover" :src="userInfo.HeadImg">
10
+              <img class="cover" :src="recordUser.HeadImg">
11 11
             </div>
12 12
             <div class="info">
13
-              <p>&nbsp;{{userInfo.Name}}</p>
13
+              <p>&nbsp;{{recordUser.Name}}</p>
14 14
               <p>
15 15
                 已有
16 16
                 <span class="marked">{{list.length}}</span> 位好友帮TA砍价了,共砍掉
17
-                <span class="marked">¥{{list.length*29.6}}</span> 元
17
+                <span class="marked">¥{{(list.length*29.6).toFixed(1)}}</span> 元
18 18
               </p>
19 19
             </div>
20 20
           </div>
@@ -25,19 +25,18 @@
25 25
             <span>0</span>
26 26
             <span>元</span>
27 27
           </div>
28
-          <div>获得一次免费拍照机会~</div>
29
-          <div>请及时前往江北新区.白马路10号.银城颐居.</div>
30
-          <div>悦见山营销中心领取</div>
28
+          <div>获得价值1888元的悦见山感恩馈赠福利一份</div>
29
+          <div>请及时前往江北新区.白马路10号.银城颐居.悦见山营销中心领取</div>
31 30
         </div>
32 31
       </div>
33 32
       <div class="active" v-if="status<4">
34 33
         <h2>悦见山全家福拍摄助力砍价活动</h2>
35 34
         <div class="price">
36
-          <span :class="{'off':status == 3}">砍后价:¥{{888-list.length*29.6}}</span>
35
+          <span :class="{'off':status == 3}">砍后价:¥{{(888-list.length*29.6).toFixed(1)}}</span>
37 36
           <span>最多砍至0元</span>
38 37
         </div>
39 38
         <div class="desc">
40
-          <span>原价2888元, 悦见山亲情价¥888</span>
39
+          <span>原价1888元, 悦见山亲情价¥888</span>
41 40
           <span>仅剩{{game.note.LeftNum}}个名额</span>
42 41
         </div>
43 42
       </div>
@@ -48,11 +47,11 @@
48 47
         </div>
49 48
         <div class="item" v-for="(item,index) in list" :key="index">
50 49
           <div class="avatars">
51
-            <img class="cover" :src="paihang" alt>
50
+            <img class="cover" :src="item.HeadImg" alt>
52 51
           </div>
53 52
           <div class="info">
54
-            <p>Lina豆豆</p>
55
-            <span>2018-9-0</span>
53
+            <p>{{item.CustomerName}}</p>
54
+            <span>{{toolClass.dateFormat(item.CreateDate,'yyyy-MM-dd')}}</span>
56 55
           </div>
57 56
           <div class="price">
58 57
             <span>已砍:</span>
@@ -61,8 +60,7 @@
61 60
         </div>
62 61
       </div>
63 62
     </div>
64
-    <!-- <div class="dailog" v-if="showDailog" @click="showDailog = false"> -->
65
-    <div class="dailog" v-if="showDailog">
63
+    <div class="dailog" v-if="showDailog" @click="showDailog = false">
66 64
       <div class="dailog-box" @click.stop="1+1">
67 65
         <img :src="popBg">
68 66
         <div class="log1">
@@ -72,7 +70,7 @@
72 70
             <span>元</span>
73 71
           </div>
74 72
           <div @click="toLuckDraw()">
75
-            您有一份福利待领取!去领取
73
+            您有一次抽奖机会,立即前往
76 74
             <i class="iconfont icon-you"></i>
77 75
           </div>
78 76
           <img class="present" :src="presentClose">
@@ -83,7 +81,7 @@
83 81
     <div class="other-end" v-if="status == 5">
84 82
       <div class="box">
85 83
         <p>您的好友已砍价至0元,</p>
86
-        <p>获得免费拍照机会!</p>
84
+        <p>感谢您的参与</p>
87 85
         <div @click="$router.push({name:'supportMain'})">我也要报名</div>
88 86
       </div>
89 87
     </div>
@@ -125,7 +123,8 @@ export default {
125 123
       showDailog: false,
126 124
       showPage: false,
127 125
       seconds: 0,
128
-      time: 0
126
+      time: 0,
127
+      recordid: ''
129 128
     }
130 129
   },
131 130
   computed: {
@@ -133,7 +132,8 @@ export default {
133 132
       userInfo: item => item.userInfo,
134 133
       game: item => item.game,
135 134
       recordInfo: item => item.recordInfo,
136
-      list: item => item.supports
135
+      list: item => item.supports,
136
+      recordUser: item => item.recordUser
137 137
     }),
138 138
     countdown () {
139 139
       if (this.status != 3 && this.time >= 0) {
@@ -141,35 +141,35 @@ export default {
141 141
         let minutes = 59 - new Date().getMinutes()
142 142
         let seconds = 59 - new Date().getSeconds()
143 143
         return `<span style='color:#fff;'>砍价倒计时</span>
144
-        <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour > 9 ? hour : '0' + hour}</span>
144
+        <span style='padding: 0.02rem 0.03rem 0;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour > 9 ? hour : '0' + hour}</span>
145 145
         <span style='color:#fff;'>:</span>
146
-        <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes > 9 ? minutes : '0' + minutes}</span>
146
+        <span style='padding: 0.02rem 0.03rem 0;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes > 9 ? minutes : '0' + minutes}</span>
147 147
         <span style='color:#fff;'>:</span>
148
-        <span style='padding: 0 0.03rem;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds > 9 ? seconds : '0' + seconds}</span>`
148
+        <span style='padding: 0.02rem 0.03rem 0;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds > 9 ? seconds : '0' + seconds}</span>`
149 149
       } else {
150 150
         let hour = '00'
151 151
         let minutes = '00'
152 152
         let seconds = '00'
153 153
         return `<span style='color:#fff;'>活动已结束</span>
154
-        <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour}</span>
154
+        <span style='padding: 0.02rem 0.03rem 0;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour}</span>
155 155
         <span style='color:#fff;'>:</span>
156
-        <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes}</span>
156
+        <span style='padding: 0.02rem 0.03rem 0;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes}</span>
157 157
         <span style='color:#fff;'>:</span>
158
-        <span style='padding: 0 0.03rem;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds}</span>`
158
+        <span style='padding: 0.02rem 0.03rem 0;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds}</span>`
159 159
       }
160 160
     }
161 161
   },
162 162
   created () {
163 163
     this.getGame().then(() => {
164
-      if (!this.$route.query.recordid) {
165
-        this.getRecord(this.game.record.RecordId).then(() => {
166
-          this.checkStatus()
167
-          // this.share(this.game.record.RecordId)
164
+      if (this.$route.params.recordid == 0) {
165
+        this.recordid = this.game.record.RecordId
166
+        this.getRecord(this.recordid).then(() => {
167
+          this.share(this.recordid)
168 168
         })
169 169
       } else {
170
-        this.getRecord(this.game.record.RecordId).then(() => {
171
-          // this.share(this.$route.query.recordid)
172
-          this.checkStatus()
170
+        this.recordid = this.$route.params.recordid
171
+        this.getRecord(this.recordid).then(() => {
172
+          this.share(this.recordid)
173 173
         })
174 174
       }
175 175
     })
@@ -180,7 +180,7 @@ export default {
180 180
   methods: {
181 181
     ...mapIndexActions(['getGame', 'getRecord', 'setSupport']),
182 182
     checkStatus () {
183
-      if (this.$route.query.other === 'other') {
183
+      if (this.$route.params.other === 'other') {
184 184
         this.status = 2
185 185
         this.btnText = '立即助力TA'
186 186
         if (this.list.length >= this.game.game.UserNum) {
@@ -196,34 +196,39 @@ export default {
196 196
       if (now > end) {
197 197
         this.status = 3
198 198
         this.btnText = '立即助力TA'
199
-      } else if (this.game.note.LeftNum <= 0 && !this.$route.query.other) {
199
+      } else if (this.game.note.LeftNum <= 0 && this.$route.params.other != 'other') {
200 200
         this.status = 6
201 201
       }
202 202
       this.showPage = true
203 203
     },
204 204
     share (recordid) {
205
+      let link = `${window.location.origin}${window.location.pathname}#/supportDetail/other/${recordid}`
205 206
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
206 207
         title: '城的空间',
207 208
         desc: '城的空间',
208
-        link: `${window.location.origin}${window.location.pathname}#/supportDetail?other=other&recordid=${recordid}`,
209
+        link: link,
209 210
         thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
211
+      }).then(() => {
212
+        setTimeout(() => {
213
+          this.checkStatus()
214
+        }, 200)
210 215
       })
211 216
     },
212 217
     support () {
213 218
       if (this.status === 1) {
214 219
         this.$toast('微信右上角分享,让好友帮你助力哦!')
215 220
       } else if (this.status === 2) {
216
-        this.setSupport({ customerid: this.userInfo.CustomerId, recordid: this.$route.query.recordid }).then(() => {
217
-          this.showDailog = true
218
-        }).catch(() => {
219
-          this.showDailog = true
221
+        this.setSupport({ customerid: this.userInfo.CustomerId, recordid: this.$route.params.recordid }).then(() => {
222
+          this.getRecord(this.recordid).then(() => {
223
+            this.showDailog = true
224
+          })
220 225
         })
221 226
       } else if (this.status === 3) {
222 227
         this.$toast('活动已结束')
223 228
       }
224 229
     },
225 230
     toLuckDraw () {
226
-
231
+      window.location.href = 'http://dev.jinchengjiaye.com/game/luckdraw/#/?lotteryId=2557197b-3a49-4067-b52c-97fdd2c93edc'
227 232
     }
228 233
   }
229 234
 }
@@ -379,6 +384,7 @@ export default {
379 384
 .top {
380 385
   img {
381 386
     width: 100%;
387
+    height: 2.5rem;
382 388
   }
383 389
   .top-div {
384 390
     padding: 0.1rem 0.18rem;
@@ -439,7 +445,7 @@ export default {
439 445
       background: rgba(252, 98, 67, 1);
440 446
       border-radius: 2px;
441 447
       color: #fff;
442
-      padding: 0.02rem 0.08rem;
448
+      padding: 0.04rem 0.08rem 0.02rem;
443 449
       margin-right: 0.2rem;
444 450
       font-size: 0.13rem;
445 451
     }

+ 12
- 37
src/views/supportMain/supportMain.vue Zobrazit soubor

@@ -4,9 +4,9 @@
4 4
       <div class="top">
5 5
         <img :src="topImg">
6 6
         <div class="top-div">
7
-          <b>{{game.game.GameName}}</b>
7
+          <b>悦见山全家福拍摄助力砍价活动</b>
8 8
           <p>时间: {{`${this.toolClass.dateFormat(game.game.BeginDate,'yyyy年MM月dd日')} ~ ${this.toolClass.dateFormat(game.game.EndDate,'yyyy年MM月dd日')}`}}</p>
9
-          <p>地点: 南京悦见山G99</p>
9
+          <p>地点: 南京•国家级江北新区•白马路10号</p>
10 10
         </div>
11 11
       </div>
12 12
       <div class="main">
@@ -15,14 +15,13 @@
15 15
         <p>原价:888元</p>
16 16
         <p>可邀请最多30个好友帮忙砍价,最多可砍至0元</p>
17 17
         <div>套餐包含:</div>
18
-        <div>10寸专属定制水晶PVC相册1本(入册15张)</div>
19
-        <div>10寸复古精美摆台1幅</div>
20
-        <div>拍摄精修:拍摄至少60张,精修入册15张</div>
18
+        <div>服装提供:免费提供1组拍摄服装</div>
19
+        <div>拍摄精修:拍摄至少12张有效照片,精修刻盘</div>
20
+        <div>台历赠送:选取6张精修照片定制2019年新年台历(具体台历形式由悦见山统一定制)</div>
21 21
         <p>照片赠送:照片全送</p>
22
+        <div>活动规则:</div>
23
+        <p>本次活动共招募1212组家庭,每天报名砍价成功人数不得超过10组。</p>
22 24
         <p>活动电话:025-86426677</p>
23
-        <p>服务案场:银城悦见山G99</p>
24
-        <p>地址:江宁区秣陵街道创新东路2号</p>
25
-        <p>*活动最终解释权归银城蓝溪郡开发商所有</p>
26 25
       </div>
27 26
     </div>
28 27
     <div class="bottom">
@@ -43,20 +42,11 @@
43 42
         </div>
44 43
         <div class="item">
45 44
           <label for="address">住址</label>
46
-          <div @click="showArea = true">{{address}}</div>
45
+          <input type="text" v-model="address">
47 46
         </div>
48
-        <textarea name="addressDetail" rows="5" placeholder="详细地址" v-model="adderssDetail"></textarea>
49 47
         <div class="submit" @click="sign()">提交</div>
50 48
       </div>
51 49
     </div>
52
-    <van-area
53
-      class="area"
54
-      :value="'320100'"
55
-      :area-list="area"
56
-      @confirm="confirm"
57
-      @cancel="cancel"
58
-      v-if="showArea"
59
-    />
60 50
   </div>
61 51
 </template>
62 52
 
@@ -114,13 +104,6 @@ export default {
114 104
   },
115 105
   methods: {
116 106
     ...mapIndexActions(['getGame', 'signUp', 'setRecord']),
117
-    confirm (val) {
118
-      this.address = `${val[0].name},${val[1].name},${val[2].name}`
119
-      this.showArea = false
120
-    },
121
-    cancel () {
122
-      this.showArea = false
123
-    },
124 107
     submit () {
125 108
       if (this.userInfo.Phone) {
126 109
         this.record()
@@ -138,10 +121,8 @@ export default {
138 121
       } else if (!this.address) {
139 122
         this.$toast('地址为必填项')
140 123
         return
141
-      } else if (!this.adderssDetail) {
142
-        this.$toast('详细地址为必填项')
143
-        return
144 124
       }
125
+      this.login = false
145 126
       let data = {
146 127
         name: this.name,
147 128
         phone: this.phone,
@@ -154,10 +135,10 @@ export default {
154 135
     record () {
155 136
       if (this.btn.status === 1) {
156 137
         this.setRecord().then(() => {
157
-          this.$router.push({ name: 'supportDetail' })
138
+          this.$router.push({ name: 'supportDetail', params: { other: 'own', recordid: '0' } })
158 139
         })
159 140
       } else if (this.btn.status === 3) {
160
-        this.$router.push({ name: 'supportDetail' })
141
+        this.$router.push({ name: 'supportDetail', params: { other: 'own', recordid: '0' } })
161 142
       }
162 143
     }
163 144
   }
@@ -165,16 +146,10 @@ export default {
165 146
 </script>
166 147
 
167 148
 <style lang="scss" scoped>
168
-.area {
169
-  position: fixed;
170
-  bottom: 0;
171
-  left: 0;
172
-  z-index: 1001;
173
-  width: 100%;
174
-}
175 149
 .top {
176 150
   img {
177 151
     width: 100%;
152
+    height: 2.5rem;
178 153
   }
179 154
   .top-div {
180 155
     padding: 0.12rem 0.25rem;