94b758ac by joe

备份

1 parent 4467193a
let global_gzh_name = "袋鼠妈妈学堂";
let global_gzh_wxAppId = "wxaf7d9b7414c6df11";
let global_register_redirect = false;
// let global_gzh_name = "安敏健行";
// let global_gzh_wxAppId = "wx3a4821f58cc1ded7";
// let global_register_redirect = "https://nutwpgateway.novaetech.cn/wx/oauth2/authorize?brandId=17378876&scope=snsapi_base&url=http%3A%2F%2Fh5.novaetech.cn%2F%23%2Fshowqrcode";
\ No newline at end of file
let global_view_coupon_url = "http://www.baidu.com";
let global_view_integral_url = "http://www.bing.com";
\ No newline at end of file
......
......@@ -113,15 +113,17 @@ export default {
return {
loading: false,
data: this.value,
submitForm: {
drawCode: "",
contactName: "",
contactMobile: "",
province: "",
city: "",
district: "",
address: ""
}
submitForm: !this.value || !this.value.drawResult
? {
drawCode: "",
contactName: "",
contactMobile: "",
province: "",
city: "",
district: "",
address: ""
}
: this.value.drawResult
};
},
methods: {
......@@ -135,8 +137,12 @@ export default {
typeof this.data.confirmHandler == "function" &&
this.data.confirmHandler();
},
toViewIntegralHandler() {},
toViewCouponHandler() {},
toViewIntegralHandler() {
location.href = global_view_integral_url;
},
toViewCouponHandler() {
location.href = global_view_coupon_url;
},
submitContactHandler() {
if (!this.submitForm.contactName) {
Toast("请填写真实姓名");
......@@ -164,6 +170,7 @@ export default {
.then(res => {
Toast.clear();
Toast("收件地址提交成功");
this.$emit("submitSuccess");
})
.catch(e => {
this.loading = false;
......
<template>
<div class="home">
<head-view></head-view>
<div class="btn-back" @click="backHandler"></div>
<div class="btn-prize-list" @click="prizeListHandler"></div>
<div class="sys-container-panel content">
<div class="container-title">{{title}}</div>
<div class="head-line"></div>
......@@ -106,11 +109,12 @@ export default {
});
},
drawHandler(ref) {
// if (!this.init || this.remainDrawTime <= 0) {
// return;
// }
if (!this.init || this.remainDrawTime <= 0) {
return;
}
Toast.loading({
mask: true,
forbidClick: true,
message: "加载中..."
});
httpGet({ url: urls.draw, data: null }).then(res => {
......@@ -133,6 +137,12 @@ export default {
that.initActivity();
}, 500);
};
},
backHandler(){
window.history.go(-1);
},
prizeListHandler(){
this.$router.push("/prize");
}
},
components: {
......@@ -311,4 +321,25 @@ export default {
margin: 10px auto;
background-repeat: no-repeat;
}
.btn-back {
width: 170px;
height: 52px;
background: url(../../assets/imgs/list-btn-back.png) no-repeat;
background-size: 100%;
position: fixed;
left: 0;
top: 30px;
z-index: 8000;
}
.btn-prize-list{
width: 166px;
height: 52px;
background: url(../../assets/imgs/draw-btn-prizelist.png) no-repeat;
background-size: 100%;
position: fixed;
right: 0;
top: 30px;
z-index: 8000;
}
</style>
......
<template>
<div class="home">
<head-view></head-view>
<div class="sys-container-panel content">
<div class="container-title">{{title}}</div>
<div class="head-line"></div>
<div class="prize-container">
<div
class="prize-item"
v-for="(item,index) in prizeList"
:key="index"
:class="{'prize-coupon-bg':item.prizeType=='coupon','prize-normal-bg':item.prizeType!='coupon'}"
>
<div class="prize-name">{{item.prizeName}}</div>
<div
class="prize-btn"
@click="viewDetailHandler(item)"
>{{item.prizeType == 'real' ? '提交信息' : '查看详情'}}</div>
</div>
<div class="empty" v-if="init && prizeList.length == 0">
<div class="empty-icon">
<van-icon name="warn-o" />
</div>
<div class="empty-message">您还没有任何奖品 !</div>
</div>
</div>
</div>
<div class="bottom-line"></div>
<bottom-tool v-model="activityIndex"></bottom-tool>
<draw-model v-if="model.show" v-model="model" v-on:submitSuccess="model.show = false"></draw-model>
</div>
</template>
<script>
let urls = {
prizeList: "/jiajiaCHApi/app/prize/list"
};
import { httpGet } from "@/api/fetch-api";
import BottomTool from "@/components/bottom-tools/bottom-tools";
import DrawModel from "@/components/biz-model/draw-model";
import HeadView from "@/components/plugins/head";
import Vue from "vue";
import { Toast } from "vant";
import { Icon } from "vant";
Vue.use(Icon);
Vue.use(Toast);
export default {
name: "home",
data() {
return {
init: false,
activityIndex: 4,
title: "我的奖品",
remainDrawTime: 0,
model: {
show: false,
drawResult: {}
},
indexForm: {},
prizeList: []
};
},
methods: {
initActivity() {
Toast.loading({
mask: true,
message: "加载中..."
});
httpGet({ url: urls.prizeList, data: null }).then(res => {
Toast.clear();
this.init = true;
this.prizeList = res;
});
},
viewDetailHandler(item) {
console.log(item);
let type = item.prizeType;
switch (type) {
case "real":
this.model.drawResult = item;
this.model.show = true;
break;
case "coupon":
location.href = global_view_coupon_url;
break;
default:
location.href = global_view_integral_url;
break;
}
}
},
components: {
BottomTool,
DrawModel,
HeadView
},
mounted() {
this.initActivity();
}
};
</script>
<style lang="scss" scoped>
.content {
margin: 85px auto 60px auto;
padding-bottom: 60px;
min-height: 500px;
}
.container-title {
font-size: 30px;
}
.head-line {
height: 60px;
}
.bottom-line {
height: 150px;
background-color: transparent;
}
.prize-container {
width: 700;
margin: auto;
}
.prize-item {
margin: auto;
display: flex;
align-items: center;
justify-content: space-between;
width: 590px;
height: 140px;
border-radius: 15px;
padding: 0 30px;
}
.prize-coupon-bg {
background: url(../../assets/imgs/prize-item-coupon-bg.png);
background-size: 100%;
}
.prize-normal-bg {
background: url(../../assets/imgs/prize-item-normal-bg.png);
background-size: 100%;
}
.prize-name {
font-size: 24px;
color: #fff;
font-weight: bold;
line-height: 140px;
height: 140px;
}
.prize-btn {
font-size: 22px;
font-weight: 600;
text-align: center;
width: 140px;
height: 40px;
line-height: 40px;
border-radius: 26px;
background-color: #f6b843;
}
.empty {
padding-top: 100px;
height: 300px;
.empty-icon {
font-size: 60px;
color: #a1a1a1;
}
.empty-message {
font-size: 24px;
color: #a1a1a1;
}
}
</style>
......@@ -51,6 +51,14 @@ const routes = [{
meta: {
title: '幸运抽奖'
}
},
{
path: '/prize',
name: 'prize',
component: () => import('./pages/prize/index.vue'),
meta: {
title: '我的奖品'
}
}
]
......