Commit 0b905995 by Caiyijun

做了一些东西

parent 97409d89
...@@ -34,33 +34,119 @@ ...@@ -34,33 +34,119 @@
</div> </div>
</div> </div>
</div> </div>
<div class="share-btn">邀请好友来参赛</div> <div class="share-btn" @click="inviteFriend">邀请好友来参赛</div>
<ShareModal
v-on:close="closeShareModal"
v-if="showShareModal"
></ShareModal>
</div> </div>
</template> </template>
<script> <script>
import Title from "@/components/Title.vue"; import Title from "@/components/Title.vue";
export default { import ShareModal from "@/components/ShareModal.vue";
import {dakaPay, shareContent, track, liinShare} from "@/components/axios/api";
export default {
name: "ChallengeDetail", name: "ChallengeDetail",
components: { components: {
Title Title,
ShareModal
}, },
data() { data() {
return { return {
} showShareModal: false,
userData: null
};
}, },
created() { created() {},
mounted() {
console.log("this.pageType", this.page_type);
if (window["userData"]) {
this.userData = window["userData"];
} else {
let localUserData = localStorage.getItem("bs_userData");
if (localUserData) {
window["userData"] = JSON.parse(localUserData);
this.userData = window["userData"];
}
}
console.log("userData", this.userData);
}, },
methods: { methods: {
goback() { goback() {
history.go(-1); history.go(-1);
}, },
inviteFriend() {
console.log("inviteFriend");
this.showShareModal = true;
// let id = this.userData.id;
let id = 'yijun';
track("free_contract_share");
let links = `${
location.href.split("#")[0].split("?")[0]}?inviter=${id}&from_type=free_contract&`;
shareContent("free_contract").then(res => {
let result = res.data;
console.log("分享内容", result, links);
let option1 = {
title: result.title, // 分享标题
desc: result.desc, // 分享描述
link: links, // 分享链接
imgUrl: result.img_url, // 分享图标
success: function(res) {
track("free_contract_share_act");
console.log("option1Success", res);
} }
};
wx.updateAppMessageShareData(option1);
//微信分享菜单测试
let option2 = {
title: result.title, // 分享标题
desc: result.desc, // 分享描述
link: links, // 分享链接
imgUrl: result.img_url, // 分享图标
success: function(res) {
console.log("option2Success", res);
} }
};
let option3 = {
title: result.title, // 分享标题
desc: result.desc, // 分享描述
link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: result.img_url, // 分享图标
success: function(res) {
// 用户点击了分享后执行的回调函数
track("free_contract_share_act");
console.log("option3Success", res);
},
fail: err => {
console.log("option3error", err);
}
};
wx.onMenuShareAppMessage(option3);
let option4 = {
title: result.title, // 分享标题
link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: result.img_url, // 分享图标
success: function(res) {
console.log("option4Success", res);
},
fail: err => {
console.log("option4error", err);
}
};
// wx.onMenuShareTimeline(option4);
console.log("option", option1, option2, option3, option4);
});
},
closeShareModal() {
this.showShareModal = false;
}
}
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.partake-challenge-page { .partake-challenge-page {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
background-color: rgb(70, 88, 149); background-color: rgb(70, 88, 149);
...@@ -82,63 +168,68 @@ ...@@ -82,63 +168,68 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: absolute; position: absolute;
top: .3rem; top: 0.3rem;
right: .22rem; right: 0.22rem;
font-size: .26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
color: #465895; color: #465895;
img { img {
width: .3rem; width: 0.3rem;
height: .3rem; height: 0.3rem;
margin-right: .1rem; margin-right: 0.1rem;
} }
} }
.game-bonus-container { .game-bonus-container {
width: 6.4rem; width: 6.4rem;
padding: .3rem 0; padding: 0.3rem 0;
box-sizing: border-box; box-sizing: border-box;
background: linear-gradient(90deg, rgba(255, 255, 255, 0), #1A285A, rgba(255, 255, 255, 0)); background: linear-gradient(
90deg,
rgba(255, 255, 255, 0),
#1a285a,
rgba(255, 255, 255, 0)
);
margin-top: 2.38rem; margin-top: 2.38rem;
.bonus-title { .bonus-title {
font-size: .3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
text-align: center; text-align: center;
} }
.bonus-amount { .bonus-amount {
font-size: .64rem; font-size: 0.64rem;
line-height: .8; line-height: 0.8;
color: #FFE253; color: #ffe253;
text-align: center; text-align: center;
margin-top: .26rem; margin-top: 0.26rem;
} }
} }
.game-title { .game-title {
font-size: .36rem; font-size: 0.36rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
margin-top: .4rem; margin-top: 0.4rem;
} }
.game-time { .game-time {
font-size: .24rem; font-size: 0.24rem;
line-height: 1; line-height: 1;
color: #D6DFFF; color: #d6dfff;
padding: .12rem .38rem; padding: 0.12rem 0.38rem;
border-radius: .48rem; border-radius: 0.48rem;
background: #556CB6; background: #556cb6;
margin-top: .14rem; margin-top: 0.14rem;
} }
.hr { .hr {
width: 3rem; width: 3rem;
height: .01rem; height: 0.01rem;
background: #6F82C3; background: #6f82c3;
margin-top: .5rem; margin-top: 0.5rem;
} }
.game-info-container { .game-info-container {
width: 6rem; width: 6rem;
background: #3D4F8F; background: #3d4f8f;
margin-top: .5rem; margin-top: 0.5rem;
.game-info-section { .game-info-section {
width: 100%; width: 100%;
height: 1.34rem; height: 1.34rem;
...@@ -148,41 +239,41 @@ ...@@ -148,41 +239,41 @@
flex: 1; flex: 1;
position: relative; position: relative;
&:last-child:after { &:last-child:after {
content: ''; content: "";
width: .02rem; width: 0.02rem;
height: .4rem; height: 0.4rem;
background: #A2B4EE; background: #a2b4ee;
position: absolute; position: absolute;
left: 0; left: 0;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
.item-value { .item-value {
font-size: .4rem; font-size: 0.4rem;
line-height: .8; line-height: 0.8;
color: #fff; color: #fff;
text-align: center; text-align: center;
} }
.item-key { .item-key {
font-size: .26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
text-align: center; text-align: center;
margin-top: .18rem; margin-top: 0.18rem;
} }
} }
} }
} }
.share-btn { .share-btn {
width: 5.6rem; width: 5.6rem;
border-radius: .92rem; border-radius: 0.92rem;
background: #1FDBB1; background: #1fdbb1;
font-size: .4rem; font-size: 0.4rem;
line-height: .92rem; line-height: 0.92rem;
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
margin-top: 2.24rem; margin-top: 2.24rem;
} }
} }
</style> </style>
...@@ -14,25 +14,6 @@ ...@@ -14,25 +14,6 @@
<div class="target-people-text">已有2468人参赛</div> <div class="target-people-text">已有2468人参赛</div>
</div> </div>
<div class="hr"></div> <div class="hr"></div>
<!--<div class="game-scroll-container">-->
<!--<div class="game-scroll-item">-->
<!--<div class="item-title-status">-->
<!--<div class="item-title">第一天</div>-->
<!--<div class="item-status2">已淘汰</div>-->
<!--</div>-->
<!--<div class="item-income" style="visibility: hidden;">-->
<!--<div class="item-amount">2.56</div>-->
<!--<div class="item-text">(元) 预计收益</div>-->
<!--</div>-->
<!--<div class="item-progress-num">-->
<!--<div class="item-num" v-if="false">还有01天03小时56秒开始</div>-->
<!--<template v-else>-->
<!--<div class="item-progress" :style="'width: '+rate/100*2.46+'rem;'"></div>-->
<!--<div class="item-num">2635/5000步</div>-->
<!--</template>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<swiper :options="swiperOption" class="game-scroll-container"> <swiper :options="swiperOption" class="game-scroll-container">
<swiper-slide> <swiper-slide>
<div class="game-scroll-item"> <div class="game-scroll-item">
...@@ -153,17 +134,6 @@ ...@@ -153,17 +134,6 @@
data () { data () {
return { return {
rate: 50, rate: 50,
banner_list: [
{
// image: "http://localhost:8080/img/img_card.440e4585.png"
},
{
// image: "http://localhost:8080/img/img_card.440e4585.png"
},
{
// image: "http://localhost:8080/img/img_card.440e4585.png"
}
],
swiperOption: { swiperOption: {
slidesPerView: "auto", slidesPerView: "auto",
centeredSlides: true, centeredSlides: true,
...@@ -203,7 +173,7 @@ ...@@ -203,7 +173,7 @@
} }
.have-joined-game-page { .have-joined-game-page {
width: 100%; // width: 100%;
min-height: 100vh; min-height: 100vh;
background-color: rgb(70, 88, 149); background-color: rgb(70, 88, 149);
background-image: url(../images/SignUp/sy_beijing.png); background-image: url(../images/SignUp/sy_beijing.png);
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<div class="rule-page"> <div class="rule-page">
<Title class="page-title" title="活动规则与协议" titleColor="#000" @goback="goback" show_back="true" arrowColor="black"></Title> <Title class="page-title" title="活动规则与协议" titleColor="#000" @goback="goback" show_back="true" arrowColor="black"></Title>
<div class="section-title">挑战玩法:</div> <div class="section-title">挑战玩法:</div>
<img class="game-way-img" src="../images/Rule/img_rule.png"> <img class="game-way-img" v-if="bushuType == 0" src="../images/Rule/img_rule_0.png">
<img class="game-way-img" v-if="bushuType == 1" src="../images/Rule/img_rule_1.png">
<img class="game-way-img" v-if="bushuType == 2" src="../images/Rule/img_rule_2.png">
<div class="section-title">参赛须知:</div> <div class="section-title">参赛须知:</div>
<div class="content1-container"> <div class="content1-container">
<div class="content1-item">• 为督促大家运动,每位用户报名均需提供契约金</div> <div class="content1-item">• 为督促大家运动,每位用户报名均需提供契约金</div>
...@@ -35,8 +37,15 @@ ...@@ -35,8 +37,15 @@
}, },
data() { data() {
return { return {
bushuType: 0
}; };
}, },
mounted(){
let LastLevel = Number(sessionStorage.getItem('bushuType'))
if(LastLevel){
this.bushuType = LastLevel
}
},
methods: { methods: {
goback() { goback() {
history.go(-1); history.go(-1);
......
...@@ -57,18 +57,13 @@ ...@@ -57,18 +57,13 @@
</template> </template>
<script> <script>
import NoticeBonus from "@/components/NoticeBonus.vue"; import NoticeBonus from "@/components/NoticeBonus.vue";
import Free from "@/components/Free.vue"; import Free from "@/components/Free.vue";
import Modal from "@/components/Modal.vue"; import Modal from "@/components/Modal.vue";
import PayFailModal from "@/components/PayFailModal.vue"; import PayFailModal from "@/components/PayFailModal.vue";
import { import { dakaPay, track, userCards, daka_index } from "@/components/axios/api";
dakaPay,
track,
userCards,
daka_index
} from "@/components/axios/api";
export default { export default {
name: "SignUp", name: "SignUp",
components: { components: {
NoticeBonus, NoticeBonus,
...@@ -89,42 +84,52 @@ ...@@ -89,42 +84,52 @@
gameList: [], gameList: [],
choosedLevel: 0 choosedLevel: 0
} };
}, },
created() { created() {
this.getPageData(); this.getPageData();
}, },
mounted() {
//获取步数tab缓存
let LastLevel = Number(sessionStorage.getItem("bushuType"));
if (LastLevel) {
this.choosedLevel = LastLevel;
}else{
sessionStorage.setItem("bushuType", this.choosedLevel);
}
},
methods: { methods: {
chooseGameLevel(level) { chooseGameLevel(level) {
sessionStorage.setItem("bushuType", level);
this.choosedLevel = level; this.choosedLevel = level;
}, },
goOtherPage(pageName) { goOtherPage(pageName) {
this.$router.push({name: pageName}); this.$router.push({ name: pageName });
}, },
getPageData(grade = 1) { getPageData(grade = 1) {
daka_index(grade).then(res => { daka_index(grade).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.gameList = res.data; this.gameList = res.data;
console.log(this.gameList) console.log(this.gameList);
} }
}) });
}, },
togglePayFail() { togglePayFail() {
this.isShowPayFail = !this.isShowPayFail this.isShowPayFail = !this.isShowPayFail;
}, },
showSuccess() { showSuccess() {
this.showModal("温馨提示", "报名成功", { this.showModal("温馨提示", "报名成功", {
scb: () => { scb: () => {
if (this.isFollow == 1) { if (this.isFollow == 1) {
this.$router.push({name: "Read"}) this.$router.push({ name: "Read" });
} else { } else {
this.$router.push({name: "Success"}) this.$router.push({ name: "Success" });
} }
} }
}); });
}, },
confirmModal(scb) { confirmModal(scb) {
scb && scb() scb && scb();
this.modalShown = false; this.modalShown = false;
}, },
showFree(e) { showFree(e) {
...@@ -165,7 +170,7 @@ ...@@ -165,7 +170,7 @@
showModal(title, desc, option) { showModal(title, desc, option) {
this.modalTitle = title || ""; this.modalTitle = title || "";
this.modalDesc = desc || ""; this.modalDesc = desc || "";
this.modalOption = option || {} this.modalOption = option || {};
this.modalShown = true; this.modalShown = true;
}, },
closeModal() { closeModal() {
...@@ -202,9 +207,9 @@ ...@@ -202,9 +207,9 @@
this.showModal("温馨提示", "报名成功", { this.showModal("温馨提示", "报名成功", {
scb: () => { scb: () => {
if (this.isFollow == 1) { if (this.isFollow == 1) {
this.$router.push({name: "Read"}) this.$router.push({ name: "Read" });
} else { } else {
this.$router.push({name: "Success"}) this.$router.push({ name: "Success" });
} }
} }
}); });
...@@ -214,23 +219,23 @@ ...@@ -214,23 +219,23 @@
} }
if (res.err_msg == "get_brand_wcpay_request:fail") { if (res.err_msg == "get_brand_wcpay_request:fail") {
// this.showModal("温馨提示", "支付服务繁忙,请稍后重试"); // this.showModal("温馨提示", "支付服务繁忙,请稍后重试");
this.togglePayFail() this.togglePayFail();
} }
if (res.err_msg == "get_brand_wcpay_request:cancel") { if (res.err_msg == "get_brand_wcpay_request:cancel") {
// console.log("支付取消"); // console.log("支付取消");
this.togglePayFail() this.togglePayFail();
} }
} }
); );
} }
}); });
},
} }
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.sign-up-page { .sign-up-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: scroll; overflow-y: scroll;
...@@ -245,27 +250,27 @@ ...@@ -245,27 +250,27 @@
align-items: center; align-items: center;
.top-nav-level { .top-nav-level {
flex-shrink: 0; flex-shrink: 0;
margin-top: .3rem; margin-top: 0.3rem;
border: .02rem solid #fff; border: 0.02rem solid #fff;
border-radius: .1rem; border-radius: 0.1rem;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
.level-item { .level-item {
width: 1.76rem; width: 1.76rem;
font-size: .3rem; font-size: 0.3rem;
line-height: .54rem; line-height: 0.54rem;
color: #465895; color: #465895;
text-align: center; text-align: center;
position: relative; position: relative;
&:after { &:after {
content: ''; content: "";
height: .26rem; height: 0.26rem;
width: .02rem; width: 0.02rem;
background: #465895; background: #465895;
position: absolute; position: absolute;
left: -.02rem; left: -0.02rem;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
...@@ -275,7 +280,7 @@ ...@@ -275,7 +280,7 @@
&.active { &.active {
background: #465895; background: #465895;
color: #fff; color: #fff;
border-radius: .1rem; border-radius: 0.1rem;
font-weight: bold; font-weight: bold;
} }
&.active:after { &.active:after {
...@@ -286,7 +291,7 @@ ...@@ -286,7 +291,7 @@
.view-steps-btn { .view-steps-btn {
flex-shrink: 0; flex-shrink: 0;
width: 1.11rem; width: 1.11rem;
height: .84rem; height: 0.84rem;
display: block; display: block;
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -294,7 +299,7 @@ ...@@ -294,7 +299,7 @@
} }
.notice-broadcast { .notice-broadcast {
flex-shrink: 0; flex-shrink: 0;
margin: 3.68rem 0 .18rem; margin: 3.68rem 0 0.18rem;
} }
.challenge-card { .challenge-card {
flex-shrink: 0; flex-shrink: 0;
...@@ -302,7 +307,7 @@ ...@@ -302,7 +307,7 @@
height: 4.4rem; height: 4.4rem;
background-image: url(../images/SignUp/sy_dikuang.png); background-image: url(../images/SignUp/sy_dikuang.png);
background-size: 100% 100%; background-size: 100% 100%;
margin-bottom: .4rem; margin-bottom: 0.4rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -311,30 +316,30 @@ ...@@ -311,30 +316,30 @@
width: 1.39rem; width: 1.39rem;
height: 1.39rem; height: 1.39rem;
position: absolute; position: absolute;
top: -.02rem; top: -0.02rem;
right: -.02rem; right: -0.02rem;
} }
.card-title { .card-title {
font-size: .36rem; font-size: 0.36rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
margin-top: .28rem; margin-top: 0.28rem;
} }
.card-time { .card-time {
font-size: .22rem; font-size: 0.22rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
margin-top: .16rem; margin-top: 0.16rem;
} }
.card-info { .card-info {
width: 100%; width: 100%;
margin-top: .56rem; margin-top: 0.56rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.info-item { .info-item {
flex: 1; flex: 1;
border-left: .02rem solid #fff; border-left: 0.02rem solid #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -342,46 +347,46 @@ ...@@ -342,46 +347,46 @@
border-left: none; border-left: none;
} }
.item-title { .item-title {
font-size: .28rem; font-size: 0.28rem;
line-height: .8; line-height: 0.8;
color: #fff; color: #fff;
} }
.item-content { .item-content {
font-size: .48rem; font-size: 0.48rem;
line-height: .8; line-height: 0.8;
color: #fff; color: #fff;
margin-top: .12rem; margin-top: 0.12rem;
} }
.item-money { .item-money {
font-size: .48rem; font-size: 0.48rem;
line-height: .8; line-height: 0.8;
color: #fcf776; color: #fcf776;
margin-top: .12rem; margin-top: 0.12rem;
} }
} }
} }
.card-btn { .card-btn {
width: 4rem; width: 4rem;
height: .8rem; height: 0.8rem;
background: #fabd21; background: #fabd21;
border-radius: .74rem; border-radius: 0.74rem;
box-shadow: 0 .02rem .04rem 0 rgba(0, 0, 0, .2); box-shadow: 0 0.02rem 0.04rem 0 rgba(0, 0, 0, 0.2);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: .3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
position: absolute; position: absolute;
bottom: .38rem; bottom: 0.38rem;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
.card-btn-tip { .card-btn-tip {
font-size: .22rem; font-size: 0.22rem;
margin-top: .06rem; margin-top: 0.06rem;
}
} }
} }
} }
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment