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";
as.shareLink = as.domains + "/index.html";
as.shareImgUrl = as.domains + "/share.jpg";
as.shareTitle = "我C位出道,需要你的一票";
as.shareDesc = "我参加了立白集团立乐家和嘉佳卡通卫视联合举办的“小戏骨选拔赛”,C位出道需要你的一票。你也想成为C位主角吗?不要犹豫了,赶紧来报名吧!"
as.success = function () { };
as.appSuccess = function () { };
......@@ -78,7 +80,8 @@ as.setShare = function (link, title, desc, imgurl) {
"timelineShareSucc": as.success
});
};
as.setShare("", "了解「亚洲万里通」", "", "https://k.wxpai.cn/saMS/share.jpg?v20190625");
as.setShare("", "", "", "");
//获取用户微信信息
as.getWxUserInfo = function (callback) {
as.weixin.getUserInfoV2({
......
......@@ -2,6 +2,10 @@ import axios from 'axios';
import Vue from 'vue';
import Router from '../router'
import { Toast } from "vant";
Vue.use(Toast);
// import {
// Toast
// } from 'vant';
......@@ -42,6 +46,9 @@ axios.interceptors.request.use(
// 响应拦截器
axios.interceptors.response.use(
response => {
if(!response){
return;
}
if (response.status === 200) {
if (response.data.code === 200) {
return Promise.resolve(response);
......@@ -50,6 +57,8 @@ axios.interceptors.response.use(
store.removeSession();
store.saveRedirectUrl();
Router.push("/");
} else {
Toast(response.data.errMsg);
}
return Promise.reject(response);
}
......@@ -59,8 +68,7 @@ axios.interceptors.response.use(
},
// 服务器状态码不是200的情况
error => {
console.log("Router.path === ", Router.history.current);
if (error.response.status) {
if (error && error.response && error.response.status) {
switch (error.response.status) {
case 404:
Toast({
......@@ -70,12 +78,12 @@ axios.interceptors.response.use(
});
break;
// 其他错误,直接抛出错误提示
default:
Toast({
message: error.response.data.message,
duration: 1500,
forbidClick: true
});
// default:
// Toast({
// message: error.response.data.message,
// duration: 1500,
// forbidClick: true
// });
}
return Promise.reject(error.response);
}
......
<template>
<van-popup v-model="data.show">
<div class="model">
<div class="model-close" @click="modelCloseHandler"></div>
<!-- 积分或者优惠券 -->
<div
class="model-content"
v-if="data.drawResult.prizeType == 'integral' || data.drawResult.prizeType == 'coupon'"
>
<div class="model-head-line"></div>
<div class="model-title">恭喜获得</div>
<div class="content">
<div
class="prize-thumb"
v-bind:style="{backgroundImage:'url(' + data.drawResult.thumb + ')'}"
></div>
<div class="prize-name">{{data.drawResult.prizeName}}</div>
<div class="tip-container">
<span class="use-tip">奖品说明</span>
</div>
<div class="tip-container" v-if="data.drawResult.prizeType == 'integral'">
<span class="tip">积分可以在立乐家商城兑换礼品</span>
</div>
<div class="tip-container" v-if="data.drawResult.prizeType == 'coupon'">
<span class="tip">优惠券可以在立乐家商城购物当现金使用</span>
</div>
<div
class="sys-btn-02 base-top"
@click="toViewIntegralHandler"
v-if="data.drawResult.prizeType == 'integral'"
>前往查看</div>
<div
class="sys-btn-02 base-top"
@click="toViewCouponHandler"
v-if="data.drawResult.prizeType == 'coupon'"
>前往使用</div>
<div class="sys-btn-02" @click="modelBtnClickHandler">返回抽奖</div>
</div>
</div>
<!-- 实物-->
<div class="model-content" v-if="data.drawResult.prizeType == 'real'">
<div class="model-head-line"></div>
<div class="model-title">恭喜获得</div>
<div class="content">
<div
class="prize-thumb"
v-bind:style="{backgroundImage:'url(' + data.drawResult.thumb + ')'}"
></div>
<div class="prize-name">{{data.drawResult.prizeName}}</div>
<div class="form-contaner">
<div class="form-item">
<div class="form-label">收件人:</div>
<div class="form-input">
<input v-model="submitForm.contactName" placeholder="请填写真实姓名" />
</div>
</div>
<div class="form-item">
<div class="form-label">联系方式:</div>
<div class="form-input">
<input v-model="submitForm.contactMobile" placeholder="请填写手机号码" />
</div>
</div>
<div class="form-item align-top">
<div class="form-label">收件地址:</div>
<div class="form-input">
<textarea v-model="submitForm.address" placeholder="请填写真实收件地址" rows="3" cols="20"></textarea>
</div>
</div>
</div>
<div class="sys-btn-02 base-top" @click="submitContactHandler">确认提交</div>
</div>
</div>
<!-- 不中奖-->
<div class="model-content" v-if="data.drawResult.status == 0">
<div class="model-head-line"></div>
<div class="model-title"></div>
<div class="content">
<div
class="prize-thumb"
v-bind:style="{backgroundImage:'url(' + data.drawResult.thumb + ')'}"
></div>
<div>
<span class="tip" style="text-align:center">再接再厉,也许下一份大奖就是你的 ~</span>
</div>
<div class="sys-btn-02 base-top" @click="modelBtnClickHandler">返回抽奖</div>
</div>
</div>
</div>
</van-popup>
</template>
<script>
let urls = {
submit: "/jiajiaCHApi/app/prize/contracts/submit"
};
import { httpGet, httpPost } from "@/api/fetch-api";
import Vue from "vue";
import { Popup, Toast } from "vant";
import { Field } from "vant";
Vue.use(Field);
Vue.use(Popup);
export default {
props: ["value"],
data() {
return {
loading: false,
data: this.value,
submitForm: {
drawCode: "",
contactName: "",
contactMobile: "",
province: "",
city: "",
district: "",
address: ""
}
};
},
methods: {
modelCloseHandler() {
typeof this.data.confirmHandler == "function" &&
this.data.confirmHandler();
this.data.show = false;
},
modelBtnClickHandler() {
this.data.show = false;
typeof this.data.confirmHandler == "function" &&
this.data.confirmHandler();
},
toViewIntegralHandler() {},
toViewCouponHandler() {},
submitContactHandler() {
if (!this.submitForm.contactName) {
Toast("请填写真实姓名");
return;
}
if (
this.submitForm.contactMobile.indexOf("1") != 0 ||
this.submitForm.contactMobile.length != 11
) {
Toast("请填写正确的手机号码");
return;
}
if (!this.submitForm.address) {
Toast("请填写真实收件地址");
return;
}
this.loading = true;
Toast.loading({
mask: true,
forbidClick: true,
message: "数据提交中..."
});
this.submitForm.drawCode = this.data.drawResult.drawCode;
httpPost({ url: urls.submit, data: this.submitForm })
.then(res => {
Toast.clear();
Toast("收件地址提交成功");
})
.catch(e => {
this.loading = false;
Toast.clear();
Toast("收件地址提交失败");
});
}
},
created() {
this.data = this.data
? this.data
: {
show: false,
drawResult: {}
};
}
};
</script>
<style lang="less" scoped>
.van-popup {
background-color: transparent;
top: 45%;
}
.model {
display: flex;
width: 650px;
min-height: 576px;
flex-direction: column;
align-items: flex-end;
}
.prize-thumb {
width: 240px;
height: 240px;
background-size: 100%;
background-repeat: no-repeat;
margin: 30px auto;
}
.prize-name {
font-size: 28px;
margin-bottom: 30px;
font-weight: bold;
}
.tip-container {
text-align: left;
padding-left: 50px;
height: 50px;
line-height: 80px;
}
.use-tip {
padding: 5px 10px 5px 18px;
background-color: #addfe1;
color: #606561;
font-size: 26px;
font-weight: 500;
letter-spacing: 3px;
border-radius: 10px;
}
.tip {
color: #606561;
font-size: 26px;
font-weight: 500;
padding-left: 10px;
}
.base-top {
margin-top: 60px !important;
}
.content {
padding-bottom: 60px;
}
.model-head-line {
height: 50px;
background-color: transparent;
}
.model-bottom-line {
height: 50px;
background-color: transparent;
}
.model-close {
width: 64px;
height: 116px;
background: url(../../assets/imgs/model-close.png);
background-size: 100%;
}
.model-content {
width: 650px;
min-height: 460px;
height: auto;
background: url(../../assets/imgs/model-bottom.png) no-repeat;
background-size: 100% auto;
background-position: bottom;
border-radius: 50px;
background-color: #fff;
}
.model-title {
font-size: 45px;
font-weight: bold;
}
.model-data {
font-size: 30px;
margin: 50px auto 70px auto;
width: 560px;
text-align: center;
}
.sys-btn-02 {
width: 350px;
height: 90px;
font-size: 30px;
line-height: 80px;
background-size: 350px 90px;
margin-top: 30px;
}
.label-btn {
font-size: 26px;
text-align: center;
}
.form-contaner {
margin-top: 30px;
}
.form-item {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
.align-top {
align-items: flex-start !important;
}
.form-label {
width: 140px;
text-align: right;
padding-right: 10px;
font-size: 26px;
font-weight: 600;
color: #606561;
}
.form-input {
display: flex;
}
.form-input input,
textarea {
width: 370px;
line-height: 50px;
border-radius: 25px;
padding: 5px 15px 5px 20px;
border: 1px solid #82acae;
background-color: #addfe1;
color: #303030;
font-size: 26px;
font-weight: 600;
}
.form-input input {
height: 50px;
}
textarea::-webkit-input-placeholder,
input::-webkit-input-placeholder {
color: #4f9984;
font-size: 26px;
}
</style>
......@@ -6,53 +6,27 @@
<div class="head-line"></div>
<div class="remain-tip">
您现在还有
<b>1</b>次抽奖机会
<b>{{remainDrawTime}}</b>次抽奖机会
</div>
<van-row>
<van-col span="8">
<van-col span="8" v-for="(item,index) in cardStrs" :key="index">
<div
class="card"
:class="{rotate180 : rotate.target == 'all' || rotate.target==item, rotate0 : rotate.target != 'all' && rotate.target!=item}"
@click="drawHandler(item)"
:ref="item"
>
<div class="card-bg">
<div class="card-logo logo-01"></div>
<div v-bind:class="item" class="card-logo"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-02"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-03"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-04"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-05"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-06"></div>
<div class="card-front-bg">
<div class="prize-name">{{model.drawResult.prizeName}}</div>
<div
class="prize-logo"
v-bind:style="{backgroundImage:'url(' + model.drawResult.thumb + ')'}"
></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-07"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-08"></div>
</div>
</van-col>
<van-col span="8">
<div class="card-bg">
<div class="card-logo logo-09"></div>
</div>
</van-col>
</van-row>
......@@ -65,52 +39,109 @@
<div class="bottom-line"></div>
<bottom-tool v-model="activityIndex"></bottom-tool>
<biz-model v-model="model"></biz-model>
<draw-model v-model="model"></draw-model>
</div>
</template>
<script>
let urls = {
remainTime: "/jiajiaCHApi/app/draw/times",
draw: "/jiajiaCHApi/app/draw"
};
import { httpGet } from "@/api/fetch-api";
import BottomTool from "@/components/bottom-tools/bottom-tools";
import BizModel from "@/components/biz-model/biz-model";
import DrawModel from "@/components/biz-model/draw-model";
import HeadView from "@/components/plugins/head";
import Vue from "vue";
import { Row, Col } from "vant";
import { Toast } from "vant";
import { setTimeout } from "timers";
Vue.use(Toast);
Vue.use(Row).use(Col);
export default {
name: "home",
data() {
return {
cardStrs: [
"logo-01",
"logo-02",
"logo-03",
"logo-04",
"logo-05",
"logo-06",
"logo-07",
"logo-08",
"logo-09"
],
init: false,
activityIndex: 4,
title: "幸运大抽奖",
remainDrawTime: 0,
model: {
show: false,
title: "",
content: "",
index: "prize",
btnShow: false,
btnText: "",
confirmHandler: null,
labelBtnShow: false,
labelBtnText: "",
labelBtnHandler: null
}
drawResult: {}
},
rotate: {
target: "",
isRotate: false
},
indexForm: {}
};
},
methods: {
toSign() {
this.$router.push("/sign");
initActivity() {
httpGet({ url: urls.remainTime, data: null }).then(res => {
this.init = true;
let remainDrawTime = res.times;
remainDrawTime = !remainDrawTime ? 0 : remainDrawTime;
this.remainDrawTime = remainDrawTime;
this.rotate.target = "";
});
},
drawHandler(ref) {
// if (!this.init || this.remainDrawTime <= 0) {
// return;
// }
Toast.loading({
mask: true,
message: "加载中..."
});
httpGet({ url: urls.draw, data: null }).then(res => {
Toast.clear();
let that = this;
setTimeout(function() {
that.rotate.target = ref;
that.model.drawResult = res;
}, 200);
setTimeout(this.showModelHandler, 2300);
});
},
showModelHandler() {
let that = this;
this.model.show = true;
this.model.confirmHandler = function() {
that.init = false;
setTimeout(function() {
that.initActivity();
}, 500);
};
}
},
components: {
BottomTool,
BizModel,
DrawModel,
HeadView
},
mounted() {
this.initActivity();
}
};
</script>
......@@ -152,17 +183,35 @@ export default {
margin-top: 10px;
}
.card {
width: 214px;
height: 268px;
position: relative;
transition: transform 2s;
transform-style: preserve-3d;
}
.card-bg {
width: 214px;
height: 268px;
position: absolute;
background: url(../../assets/imgs/draw-card-bg.png);
background-size: 100%;
display: flex;
align-items: center;
backface-visibility: hidden;
}
.rotate180 {
transform: rotateY(180deg);
}
.rotate0 {
transform: rotateY(0deg);
}
.card-logo {
margin: auto;
margin: 40px auto 0 auto;
}
.logo-01 {
......@@ -233,4 +282,33 @@ export default {
background-size: 100%;
margin: 30px auto 0 auto;
}
.card-front-bg {
position: absolute;
width: 214px;
height: 268px;
background: url(../../assets/imgs/draw-card-frontbg.png);
background-size: 100%;
display: flex;
align-items: center;
backface-visibility: hidden;
transform: rotateY(180deg);
flex-direction: column;
}
.prize-name {
width: 168px;
font-size: 16px;
font-weight: bold;
text-align: center;
margin: 40px auto 0 auto;
}
.prize-logo {
width: 128px;
height: 128px;
background-size: 100%;
margin: 10px auto;
background-repeat: no-repeat;
}
</style>
......
......@@ -108,7 +108,8 @@ export default {
area: {
show: false
},
formData: this.value
formData: this.value,
loading: false
};
},
methods: {
......@@ -179,15 +180,27 @@ export default {
return;
}
if (this.loading) {
return;
}
this.loading = true;
Toast.loading({
mask: true,
forbidClick: true,
message: "数据提交中..."
});
httpPost({ url: urls.submit, data: this.formData }).then(res => {
httpPost({ url: urls.submit, data: this.formData })
.then(res => {
this.loading = false;
Toast.clear();
this.formData.worksCode = res;
console.log("submit === =", res);
this.$emit("submit", res);
})
.catch(res => {
this.loading = false;
Toast.clear();
Toast("作品提交失败");
});
}
},
......
......@@ -39,7 +39,7 @@ export default {
uploadSumit(params) {
console.log(params);
let data = {
path: "/pro/jiajiaChildrenHost",
path: "/pro/jiajiaChildrenHost/works",
file: params.file
};
request
......
......@@ -38,8 +38,8 @@ module.exports = {
// 它支持webPack-dev-server的所有选项
devServer: {
// host: "192.168.0.101",
host: "localhost",
host: "192.168.0.101",
// host: "localhost",
port: 9001, // 端口号
https: false, // https:{type:Boolean}
open: true, //配置自动启动浏览器
......