4467193a by joe

临时保存

1 parent 7c65a283
No preview for this file type
...@@ -10,6 +10,8 @@ as.defineAvatar = "http://cdn.aiwanpai.com/s/d.jpg"; ...@@ -10,6 +10,8 @@ as.defineAvatar = "http://cdn.aiwanpai.com/s/d.jpg";
10 10
11 as.shareLink = as.domains + "/index.html"; 11 as.shareLink = as.domains + "/index.html";
12 as.shareImgUrl = as.domains + "/share.jpg"; 12 as.shareImgUrl = as.domains + "/share.jpg";
13 as.shareTitle = "我C位出道,需要你的一票";
14 as.shareDesc = "我参加了立白集团立乐家和嘉佳卡通卫视联合举办的“小戏骨选拔赛”,C位出道需要你的一票。你也想成为C位主角吗?不要犹豫了,赶紧来报名吧!"
13 as.success = function () { }; 15 as.success = function () { };
14 as.appSuccess = function () { }; 16 as.appSuccess = function () { };
15 17
...@@ -78,7 +80,8 @@ as.setShare = function (link, title, desc, imgurl) { ...@@ -78,7 +80,8 @@ as.setShare = function (link, title, desc, imgurl) {
78 "timelineShareSucc": as.success 80 "timelineShareSucc": as.success
79 }); 81 });
80 }; 82 };
81 as.setShare("", "了解「亚洲万里通」", "", "https://k.wxpai.cn/saMS/share.jpg?v20190625"); 83 as.setShare("", "", "", "");
84
82 //获取用户微信信息 85 //获取用户微信信息
83 as.getWxUserInfo = function (callback) { 86 as.getWxUserInfo = function (callback) {
84 as.weixin.getUserInfoV2({ 87 as.weixin.getUserInfoV2({
......
...@@ -2,6 +2,10 @@ import axios from 'axios'; ...@@ -2,6 +2,10 @@ import axios from 'axios';
2 import Vue from 'vue'; 2 import Vue from 'vue';
3 import Router from '../router' 3 import Router from '../router'
4 4
5
6 import { Toast } from "vant";
7 Vue.use(Toast);
8
5 // import { 9 // import {
6 // Toast 10 // Toast
7 // } from 'vant'; 11 // } from 'vant';
...@@ -42,6 +46,9 @@ axios.interceptors.request.use( ...@@ -42,6 +46,9 @@ axios.interceptors.request.use(
42 // 响应拦截器 46 // 响应拦截器
43 axios.interceptors.response.use( 47 axios.interceptors.response.use(
44 response => { 48 response => {
49 if(!response){
50 return;
51 }
45 if (response.status === 200) { 52 if (response.status === 200) {
46 if (response.data.code === 200) { 53 if (response.data.code === 200) {
47 return Promise.resolve(response); 54 return Promise.resolve(response);
...@@ -50,6 +57,8 @@ axios.interceptors.response.use( ...@@ -50,6 +57,8 @@ axios.interceptors.response.use(
50 store.removeSession(); 57 store.removeSession();
51 store.saveRedirectUrl(); 58 store.saveRedirectUrl();
52 Router.push("/"); 59 Router.push("/");
60 } else {
61 Toast(response.data.errMsg);
53 } 62 }
54 return Promise.reject(response); 63 return Promise.reject(response);
55 } 64 }
...@@ -59,8 +68,7 @@ axios.interceptors.response.use( ...@@ -59,8 +68,7 @@ axios.interceptors.response.use(
59 }, 68 },
60 // 服务器状态码不是200的情况 69 // 服务器状态码不是200的情况
61 error => { 70 error => {
62 console.log("Router.path === ", Router.history.current); 71 if (error && error.response && error.response.status) {
63 if (error.response.status) {
64 switch (error.response.status) { 72 switch (error.response.status) {
65 case 404: 73 case 404:
66 Toast({ 74 Toast({
...@@ -70,12 +78,12 @@ axios.interceptors.response.use( ...@@ -70,12 +78,12 @@ axios.interceptors.response.use(
70 }); 78 });
71 break; 79 break;
72 // 其他错误,直接抛出错误提示 80 // 其他错误,直接抛出错误提示
73 default: 81 // default:
74 Toast({ 82 // Toast({
75 message: error.response.data.message, 83 // message: error.response.data.message,
76 duration: 1500, 84 // duration: 1500,
77 forbidClick: true 85 // forbidClick: true
78 }); 86 // });
79 } 87 }
80 return Promise.reject(error.response); 88 return Promise.reject(error.response);
81 } 89 }
......
1 <template>
2 <van-popup v-model="data.show">
3 <div class="model">
4 <div class="model-close" @click="modelCloseHandler"></div>
5 <!-- 积分或者优惠券 -->
6 <div
7 class="model-content"
8 v-if="data.drawResult.prizeType == 'integral' || data.drawResult.prizeType == 'coupon'"
9 >
10 <div class="model-head-line"></div>
11 <div class="model-title">恭喜获得</div>
12
13 <div class="content">
14 <div
15 class="prize-thumb"
16 v-bind:style="{backgroundImage:'url(' + data.drawResult.thumb + ')'}"
17 ></div>
18 <div class="prize-name">{{data.drawResult.prizeName}}</div>
19 <div class="tip-container">
20 <span class="use-tip">奖品说明</span>
21 </div>
22 <div class="tip-container" v-if="data.drawResult.prizeType == 'integral'">
23 <span class="tip">积分可以在立乐家商城兑换礼品</span>
24 </div>
25 <div class="tip-container" v-if="data.drawResult.prizeType == 'coupon'">
26 <span class="tip">优惠券可以在立乐家商城购物当现金使用</span>
27 </div>
28 <div
29 class="sys-btn-02 base-top"
30 @click="toViewIntegralHandler"
31 v-if="data.drawResult.prizeType == 'integral'"
32 >前往查看</div>
33 <div
34 class="sys-btn-02 base-top"
35 @click="toViewCouponHandler"
36 v-if="data.drawResult.prizeType == 'coupon'"
37 >前往使用</div>
38 <div class="sys-btn-02" @click="modelBtnClickHandler">返回抽奖</div>
39 </div>
40 </div>
41
42 <!-- 实物-->
43 <div class="model-content" v-if="data.drawResult.prizeType == 'real'">
44 <div class="model-head-line"></div>
45 <div class="model-title">恭喜获得</div>
46
47 <div class="content">
48 <div
49 class="prize-thumb"
50 v-bind:style="{backgroundImage:'url(' + data.drawResult.thumb + ')'}"
51 ></div>
52 <div class="prize-name">{{data.drawResult.prizeName}}</div>
53 <div class="form-contaner">
54 <div class="form-item">
55 <div class="form-label">收件人:</div>
56 <div class="form-input">
57 <input v-model="submitForm.contactName" placeholder="请填写真实姓名" />
58 </div>
59 </div>
60 <div class="form-item">
61 <div class="form-label">联系方式:</div>
62 <div class="form-input">
63 <input v-model="submitForm.contactMobile" placeholder="请填写手机号码" />
64 </div>
65 </div>
66 <div class="form-item align-top">
67 <div class="form-label">收件地址:</div>
68 <div class="form-input">
69 <textarea v-model="submitForm.address" placeholder="请填写真实收件地址" rows="3" cols="20"></textarea>
70 </div>
71 </div>
72 </div>
73 <div class="sys-btn-02 base-top" @click="submitContactHandler">确认提交</div>
74 </div>
75 </div>
76
77 <!-- 不中奖-->
78 <div class="model-content" v-if="data.drawResult.status == 0">
79 <div class="model-head-line"></div>
80 <div class="model-title"></div>
81 <div class="content">
82 <div
83 class="prize-thumb"
84 v-bind:style="{backgroundImage:'url(' + data.drawResult.thumb + ')'}"
85 ></div>
86 <div>
87 <span class="tip" style="text-align:center">再接再厉,也许下一份大奖就是你的 ~</span>
88 </div>
89 <div class="sys-btn-02 base-top" @click="modelBtnClickHandler">返回抽奖</div>
90 </div>
91 </div>
92 </div>
93 </van-popup>
94 </template>
95
96 <script>
97 let urls = {
98 submit: "/jiajiaCHApi/app/prize/contracts/submit"
99 };
100
101 import { httpGet, httpPost } from "@/api/fetch-api";
102
103 import Vue from "vue";
104 import { Popup, Toast } from "vant";
105 import { Field } from "vant";
106
107 Vue.use(Field);
108 Vue.use(Popup);
109
110 export default {
111 props: ["value"],
112 data() {
113 return {
114 loading: false,
115 data: this.value,
116 submitForm: {
117 drawCode: "",
118 contactName: "",
119 contactMobile: "",
120 province: "",
121 city: "",
122 district: "",
123 address: ""
124 }
125 };
126 },
127 methods: {
128 modelCloseHandler() {
129 typeof this.data.confirmHandler == "function" &&
130 this.data.confirmHandler();
131 this.data.show = false;
132 },
133 modelBtnClickHandler() {
134 this.data.show = false;
135 typeof this.data.confirmHandler == "function" &&
136 this.data.confirmHandler();
137 },
138 toViewIntegralHandler() {},
139 toViewCouponHandler() {},
140 submitContactHandler() {
141 if (!this.submitForm.contactName) {
142 Toast("请填写真实姓名");
143 return;
144 }
145 if (
146 this.submitForm.contactMobile.indexOf("1") != 0 ||
147 this.submitForm.contactMobile.length != 11
148 ) {
149 Toast("请填写正确的手机号码");
150 return;
151 }
152 if (!this.submitForm.address) {
153 Toast("请填写真实收件地址");
154 return;
155 }
156 this.loading = true;
157 Toast.loading({
158 mask: true,
159 forbidClick: true,
160 message: "数据提交中..."
161 });
162 this.submitForm.drawCode = this.data.drawResult.drawCode;
163 httpPost({ url: urls.submit, data: this.submitForm })
164 .then(res => {
165 Toast.clear();
166 Toast("收件地址提交成功");
167 })
168 .catch(e => {
169 this.loading = false;
170 Toast.clear();
171 Toast("收件地址提交失败");
172 });
173 }
174 },
175 created() {
176 this.data = this.data
177 ? this.data
178 : {
179 show: false,
180 drawResult: {}
181 };
182 }
183 };
184 </script>
185
186 <style lang="less" scoped>
187 .van-popup {
188 background-color: transparent;
189 top: 45%;
190 }
191
192 .model {
193 display: flex;
194 width: 650px;
195 min-height: 576px;
196 flex-direction: column;
197 align-items: flex-end;
198 }
199
200 .prize-thumb {
201 width: 240px;
202 height: 240px;
203 background-size: 100%;
204 background-repeat: no-repeat;
205 margin: 30px auto;
206 }
207
208 .prize-name {
209 font-size: 28px;
210 margin-bottom: 30px;
211 font-weight: bold;
212 }
213
214 .tip-container {
215 text-align: left;
216 padding-left: 50px;
217 height: 50px;
218 line-height: 80px;
219 }
220 .use-tip {
221 padding: 5px 10px 5px 18px;
222 background-color: #addfe1;
223 color: #606561;
224 font-size: 26px;
225 font-weight: 500;
226 letter-spacing: 3px;
227 border-radius: 10px;
228 }
229
230 .tip {
231 color: #606561;
232 font-size: 26px;
233 font-weight: 500;
234 padding-left: 10px;
235 }
236
237 .base-top {
238 margin-top: 60px !important;
239 }
240 .content {
241 padding-bottom: 60px;
242 }
243
244 .model-head-line {
245 height: 50px;
246 background-color: transparent;
247 }
248 .model-bottom-line {
249 height: 50px;
250 background-color: transparent;
251 }
252
253 .model-close {
254 width: 64px;
255 height: 116px;
256 background: url(../../assets/imgs/model-close.png);
257 background-size: 100%;
258 }
259
260 .model-content {
261 width: 650px;
262 min-height: 460px;
263 height: auto;
264 background: url(../../assets/imgs/model-bottom.png) no-repeat;
265 background-size: 100% auto;
266 background-position: bottom;
267 border-radius: 50px;
268 background-color: #fff;
269 }
270
271 .model-title {
272 font-size: 45px;
273 font-weight: bold;
274 }
275
276 .model-data {
277 font-size: 30px;
278 margin: 50px auto 70px auto;
279 width: 560px;
280 text-align: center;
281 }
282
283 .sys-btn-02 {
284 width: 350px;
285 height: 90px;
286 font-size: 30px;
287 line-height: 80px;
288 background-size: 350px 90px;
289 margin-top: 30px;
290 }
291
292 .label-btn {
293 font-size: 26px;
294 text-align: center;
295 }
296
297 .form-contaner {
298 margin-top: 30px;
299 }
300
301 .form-item {
302 display: flex;
303 justify-content: center;
304 align-items: center;
305 margin-bottom: 20px;
306 }
307
308 .align-top {
309 align-items: flex-start !important;
310 }
311
312 .form-label {
313 width: 140px;
314 text-align: right;
315 padding-right: 10px;
316 font-size: 26px;
317 font-weight: 600;
318 color: #606561;
319 }
320 .form-input {
321 display: flex;
322 }
323 .form-input input,
324 textarea {
325 width: 370px;
326 line-height: 50px;
327 border-radius: 25px;
328 padding: 5px 15px 5px 20px;
329 border: 1px solid #82acae;
330 background-color: #addfe1;
331 color: #303030;
332 font-size: 26px;
333 font-weight: 600;
334 }
335 .form-input input {
336 height: 50px;
337 }
338
339 textarea::-webkit-input-placeholder,
340 input::-webkit-input-placeholder {
341 color: #4f9984;
342 font-size: 26px;
343 }
344 </style>
...@@ -6,53 +6,27 @@ ...@@ -6,53 +6,27 @@
6 <div class="head-line"></div> 6 <div class="head-line"></div>
7 <div class="remain-tip"> 7 <div class="remain-tip">
8 您现在还有 8 您现在还有
9 <b>1</b>次抽奖机会 9 <b>{{remainDrawTime}}</b>次抽奖机会
10 </div> 10 </div>
11 11
12 <van-row> 12 <van-row>
13 <van-col span="8"> 13 <van-col span="8" v-for="(item,index) in cardStrs" :key="index">
14 <div
15 class="card"
16 :class="{rotate180 : rotate.target == 'all' || rotate.target==item, rotate0 : rotate.target != 'all' && rotate.target!=item}"
17 @click="drawHandler(item)"
18 :ref="item"
19 >
14 <div class="card-bg"> 20 <div class="card-bg">
15 <div class="card-logo logo-01"></div> 21 <div v-bind:class="item" class="card-logo"></div>
16 </div> 22 </div>
17 </van-col> 23 <div class="card-front-bg">
18 <van-col span="8"> 24 <div class="prize-name">{{model.drawResult.prizeName}}</div>
19 <div class="card-bg"> 25 <div
20 <div class="card-logo logo-02"></div> 26 class="prize-logo"
21 </div> 27 v-bind:style="{backgroundImage:'url(' + model.drawResult.thumb + ')'}"
22 </van-col> 28 ></div>
23 <van-col span="8">
24 <div class="card-bg">
25 <div class="card-logo logo-03"></div>
26 </div>
27 </van-col>
28 <van-col span="8">
29 <div class="card-bg">
30 <div class="card-logo logo-04"></div>
31 </div>
32 </van-col>
33 <van-col span="8">
34 <div class="card-bg">
35 <div class="card-logo logo-05"></div>
36 </div>
37 </van-col>
38 <van-col span="8">
39 <div class="card-bg">
40 <div class="card-logo logo-06"></div>
41 </div> 29 </div>
42 </van-col>
43 <van-col span="8">
44 <div class="card-bg">
45 <div class="card-logo logo-07"></div>
46 </div>
47 </van-col>
48 <van-col span="8">
49 <div class="card-bg">
50 <div class="card-logo logo-08"></div>
51 </div>
52 </van-col>
53 <van-col span="8">
54 <div class="card-bg">
55 <div class="card-logo logo-09"></div>
56 </div> 30 </div>
57 </van-col> 31 </van-col>
58 </van-row> 32 </van-row>
...@@ -65,52 +39,109 @@ ...@@ -65,52 +39,109 @@
65 <div class="bottom-line"></div> 39 <div class="bottom-line"></div>
66 40
67 <bottom-tool v-model="activityIndex"></bottom-tool> 41 <bottom-tool v-model="activityIndex"></bottom-tool>
68 <biz-model v-model="model"></biz-model> 42 <draw-model v-model="model"></draw-model>
69 </div> 43 </div>
70 </template> 44 </template>
71 45
72 46
73 47
74 <script> 48 <script>
49 let urls = {
50 remainTime: "/jiajiaCHApi/app/draw/times",
51 draw: "/jiajiaCHApi/app/draw"
52 };
53
75 import { httpGet } from "@/api/fetch-api"; 54 import { httpGet } from "@/api/fetch-api";
76 import BottomTool from "@/components/bottom-tools/bottom-tools"; 55 import BottomTool from "@/components/bottom-tools/bottom-tools";
77 import BizModel from "@/components/biz-model/biz-model"; 56 import DrawModel from "@/components/biz-model/draw-model";
57
78 import HeadView from "@/components/plugins/head"; 58 import HeadView from "@/components/plugins/head";
79 59
80 import Vue from "vue"; 60 import Vue from "vue";
81 import { Row, Col } from "vant"; 61 import { Row, Col } from "vant";
62 import { Toast } from "vant";
63 import { setTimeout } from "timers";
82 64
65 Vue.use(Toast);
83 Vue.use(Row).use(Col); 66 Vue.use(Row).use(Col);
84 67
85 export default { 68 export default {
86 name: "home", 69 name: "home",
87 data() { 70 data() {
88 return { 71 return {
72 cardStrs: [
73 "logo-01",
74 "logo-02",
75 "logo-03",
76 "logo-04",
77 "logo-05",
78 "logo-06",
79 "logo-07",
80 "logo-08",
81 "logo-09"
82 ],
83 init: false,
89 activityIndex: 4, 84 activityIndex: 4,
90 title: "幸运大抽奖", 85 title: "幸运大抽奖",
86 remainDrawTime: 0,
91 model: { 87 model: {
92 show: false, 88 show: false,
93 title: "", 89 drawResult: {}
94 content: "", 90 },
95 index: "prize", 91 rotate: {
96 btnShow: false, 92 target: "",
97 btnText: "", 93 isRotate: false
98 confirmHandler: null, 94 },
99 labelBtnShow: false, 95 indexForm: {}
100 labelBtnText: "",
101 labelBtnHandler: null
102 }
103 }; 96 };
104 }, 97 },
105 methods: { 98 methods: {
106 toSign() { 99 initActivity() {
107 this.$router.push("/sign"); 100 httpGet({ url: urls.remainTime, data: null }).then(res => {
101 this.init = true;
102 let remainDrawTime = res.times;
103 remainDrawTime = !remainDrawTime ? 0 : remainDrawTime;
104 this.remainDrawTime = remainDrawTime;
105 this.rotate.target = "";
106 });
107 },
108 drawHandler(ref) {
109 // if (!this.init || this.remainDrawTime <= 0) {
110 // return;
111 // }
112 Toast.loading({
113 mask: true,
114 message: "加载中..."
115 });
116 httpGet({ url: urls.draw, data: null }).then(res => {
117 Toast.clear();
118 let that = this;
119 setTimeout(function() {
120 that.rotate.target = ref;
121 that.model.drawResult = res;
122 }, 200);
123
124 setTimeout(this.showModelHandler, 2300);
125 });
126 },
127 showModelHandler() {
128 let that = this;
129 this.model.show = true;
130 this.model.confirmHandler = function() {
131 that.init = false;
132 setTimeout(function() {
133 that.initActivity();
134 }, 500);
135 };
108 } 136 }
109 }, 137 },
110 components: { 138 components: {
111 BottomTool, 139 BottomTool,
112 BizModel, 140 DrawModel,
113 HeadView 141 HeadView
142 },
143 mounted() {
144 this.initActivity();
114 } 145 }
115 }; 146 };
116 </script> 147 </script>
...@@ -152,17 +183,35 @@ export default { ...@@ -152,17 +183,35 @@ export default {
152 margin-top: 10px; 183 margin-top: 10px;
153 } 184 }
154 185
186 .card {
187 width: 214px;
188 height: 268px;
189 position: relative;
190 transition: transform 2s;
191 transform-style: preserve-3d;
192 }
193
155 .card-bg { 194 .card-bg {
156 width: 214px; 195 width: 214px;
157 height: 268px; 196 height: 268px;
197 position: absolute;
158 background: url(../../assets/imgs/draw-card-bg.png); 198 background: url(../../assets/imgs/draw-card-bg.png);
159 background-size: 100%; 199 background-size: 100%;
160 display: flex; 200 display: flex;
161 align-items: center; 201 align-items: center;
202 backface-visibility: hidden;
203 }
204
205 .rotate180 {
206 transform: rotateY(180deg);
207 }
208
209 .rotate0 {
210 transform: rotateY(0deg);
162 } 211 }
163 212
164 .card-logo { 213 .card-logo {
165 margin: auto; 214 margin: 40px auto 0 auto;
166 } 215 }
167 216
168 .logo-01 { 217 .logo-01 {
...@@ -233,4 +282,33 @@ export default { ...@@ -233,4 +282,33 @@ export default {
233 background-size: 100%; 282 background-size: 100%;
234 margin: 30px auto 0 auto; 283 margin: 30px auto 0 auto;
235 } 284 }
285
286 .card-front-bg {
287 position: absolute;
288 width: 214px;
289 height: 268px;
290 background: url(../../assets/imgs/draw-card-frontbg.png);
291 background-size: 100%;
292 display: flex;
293 align-items: center;
294 backface-visibility: hidden;
295 transform: rotateY(180deg);
296 flex-direction: column;
297 }
298
299 .prize-name {
300 width: 168px;
301 font-size: 16px;
302 font-weight: bold;
303 text-align: center;
304 margin: 40px auto 0 auto;
305 }
306
307 .prize-logo {
308 width: 128px;
309 height: 128px;
310 background-size: 100%;
311 margin: 10px auto;
312 background-repeat: no-repeat;
313 }
236 </style> 314 </style>
......
...@@ -108,7 +108,8 @@ export default { ...@@ -108,7 +108,8 @@ export default {
108 area: { 108 area: {
109 show: false 109 show: false
110 }, 110 },
111 formData: this.value 111 formData: this.value,
112 loading: false
112 }; 113 };
113 }, 114 },
114 methods: { 115 methods: {
...@@ -179,15 +180,27 @@ export default { ...@@ -179,15 +180,27 @@ export default {
179 return; 180 return;
180 } 181 }
181 182
183 if (this.loading) {
184 return;
185 }
186 this.loading = true;
182 Toast.loading({ 187 Toast.loading({
183 mask: true, 188 mask: true,
189 forbidClick: true,
184 message: "数据提交中..." 190 message: "数据提交中..."
185 }); 191 });
186 httpPost({ url: urls.submit, data: this.formData }).then(res => { 192 httpPost({ url: urls.submit, data: this.formData })
193 .then(res => {
194 this.loading = false;
187 Toast.clear(); 195 Toast.clear();
188 this.formData.worksCode = res; 196 this.formData.worksCode = res;
189 console.log("submit === =", res); 197 console.log("submit === =", res);
190 this.$emit("submit", res); 198 this.$emit("submit", res);
199 })
200 .catch(res => {
201 this.loading = false;
202 Toast.clear();
203 Toast("作品提交失败");
191 }); 204 });
192 } 205 }
193 }, 206 },
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
39 uploadSumit(params) { 39 uploadSumit(params) {
40 console.log(params); 40 console.log(params);
41 let data = { 41 let data = {
42 path: "/pro/jiajiaChildrenHost", 42 path: "/pro/jiajiaChildrenHost/works",
43 file: params.file 43 file: params.file
44 }; 44 };
45 request 45 request
......
...@@ -38,8 +38,8 @@ module.exports = { ...@@ -38,8 +38,8 @@ module.exports = {
38 38
39 // 它支持webPack-dev-server的所有选项 39 // 它支持webPack-dev-server的所有选项
40 devServer: { 40 devServer: {
41 // host: "192.168.0.101", 41 host: "192.168.0.101",
42 host: "localhost", 42 // host: "localhost",
43 port: 9001, // 端口号 43 port: 9001, // 端口号
44 https: false, // https:{type:Boolean} 44 https: false, // https:{type:Boolean}
45 open: true, //配置自动启动浏览器 45 open: true, //配置自动启动浏览器
......