Commit 25b74249 by 曾经

no message

parent 3161dcdf
......@@ -19,5 +19,6 @@
<script src="//web-1251519181.file.myqcloud.com/lib/axios/0.18.0/index.min.js"></script>
<script src="//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
</body>
</html>
......@@ -74,3 +74,4 @@ export function postRequest(url,params){
data: params,
});
}
......@@ -22,12 +22,12 @@
ref="mySwiper"
:options="swiperOptions"
:autoplay="swiperOptions.autoplay"
v-if="game.bulletFlag"
v-if="game.bulletFlag && barrageList && barrageList.length > 3"
>
<swiper-slide v-for="item in list" :key="item">
<swiper-slide v-for="item in barrageList" :key="item">
<div class="swiper-item">
<img src="./images/tips_bg.png" />
<span>{{ item }}</span>
<span>恭喜 {{ item.memberName }} 获得 {{ item.prizeName }}</span>
</div>
</swiper-slide>
</swiper>
......@@ -211,6 +211,7 @@ export default {
enterpriseId: "ff8080815dacd3a2015dacd3ef5c0000",
memberId: "ff808081804666e3018049dee09102af",
currentIntegral: "--",
rule:{},
};
},
created() {
......@@ -232,6 +233,7 @@ export default {
this.getGameRule();
this.getGamePlayNumber();
this.getIntegral();
this.getGamePlayBarrage();
},
methods: {
async getGame() {
......@@ -260,6 +262,12 @@ export default {
enterpriseId: this.enterpriseId,
})
this.rule = rule;
window.wx.miniProgram.postMessage({
data:{
shareTitle: rule.shareRuleDesc,
shareImage: rule.shareImageUrl,
}
})
},
async getGamePlayNumber() {
let playNumberObj = await getGamePlayNumber({
......@@ -267,14 +275,14 @@ export default {
enterpriseId: this.enterpriseId,
memberId: this.memberId,
});
console.log(playNumberObj);
this.playNumberObj = playNumberObj;
},
async getGamePlayBarrage() {
await getGamePlayBarrage({
let barrageList = await getGamePlayBarrage({
gameId: this.gameId,
enterpriseId: this.enterpriseId,
});
this.barrageList = barrageList || [];
},
async getIntegral() {
let currentIntegral = await getIntegral({
......@@ -292,7 +300,7 @@ export default {
},
toGameRule() {
this.$router.push({
path: "/rule",
path: "/cmh/rule",
query: {
gameId: this.gameId,
enterpriseId: this.enterpriseId,
......@@ -301,7 +309,7 @@ export default {
},
toMyReward() {
this.$router.push({
path: "/my-reward",
path: "/cmh/my-reward",
query: {
gameId: this.gameId,
enterpriseId: this.enterpriseId,
......
......@@ -61,7 +61,7 @@ export default {
return {};
},
created() {
document.title = "游戏规则";
document.title = "游戏助力";
this.loadData();
},
methods: {
......@@ -70,7 +70,7 @@ export default {
},
playGame() {
this.$router.replace({
path: "/",
path: "/cmh/",
query: {
gameId: "1121213",
},
......
<template>
<div class="box"></div>
</template>
<script>
import { gameRequestApi } from "@/api/common.js";
const { getGameInfo } = gameRequestApi;
export default {
components: {},
data() {
return {
};
},
created() {
document.title = "游戏";
this.loadData();
},
methods: {
loadData() {
let query = this.$route.query;
getGameInfo({
gameId: query.gameId,
enterpriseId: query.enterpriseId,
}).then((res) => {
let gameName = "";
switch (+res.templateType) {
case 1:
gameName = "cmh";
break;
case 2:
break;
default:
break;
}
this.$router.replace({
path: `/${ gameName }${ query.shareMemberId ? '/support' : '' }`,
query: query,
});
});
},
},
};
</script>
<style scoped></style>
......@@ -4,22 +4,26 @@ Vue.use(VueRouter);
const routes = [
{
path: '/',
path:'/',
component: () => import('@/components/index.vue'),
},
{
path: '/cmh',
name: '猜盲盒',
component: () => import('@/components/cmh/index.vue'),
},
{
path: '/rule',
path: '/cmh/rule',
component: () => import('@/components/cmh/rule.vue'),
name: '游戏规则'
},
{
path: '/my-reward',
path: '/cmh/my-reward',
component: () => import('@/components/cmh/my-reward.vue'),
name: '我的奖品'
},
{
path: '/support',
path: '/cmh/support',
component: () => import('@/components/cmh/support.vue'),
name: '助力拆盲盒'
},
......
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