feat; 更新业务
This commit is contained in:
1 parent
aba3958d9d
commit
5f63979f9f
26 files changed
+790
-275
No files matched your search
@@ -15,10 +15,10 @@ import { mapGetters, mapActions } from "vuex";
|
||||
export default {
|
||||
name: "BoboYqView",
|
||||
props: {
|
||||
uid: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
}
|
||||
// actId: {
|
||||
// type: [String, Number],
|
||||
// default: ""
|
||||
// }
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["remainTicketNum"])
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
...mapActions(["getQueryTicketNum"])
|
||||
},
|
||||
created() {
|
||||
this.getQueryTicketNum({ uid: this.uid });
|
||||
this.getQueryTicketNum();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="bobo-lottery">
|
||||
<bobo-yq-view :uid="uid"></bobo-yq-view>
|
||||
<bobo-yq-view></bobo-yq-view>
|
||||
<bobo-lottery-count></bobo-lottery-count>
|
||||
<button class="bobo-lottery-button" @touchend="clickLottery"></button>
|
||||
<button class="bobo-lottery-button" @click="clickLottery"></button>
|
||||
</div>
|
||||
<lottery-prizes-dialog
|
||||
v-model="show"
|
||||
@@ -35,13 +35,7 @@ export default {
|
||||
"remainTicketNum",
|
||||
"curTicketRuleValue",
|
||||
"lotteryPrizeItemList"
|
||||
]),
|
||||
uid() {
|
||||
return this.$route.query.uid;
|
||||
},
|
||||
roomUid() {
|
||||
return this.$route.query.roomUid;
|
||||
}
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["SetCanLottery"]),
|
||||
@@ -63,10 +57,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
this.runLottery({
|
||||
uid: this.uid,
|
||||
roomUid: this.roomUid
|
||||
})
|
||||
this.runLottery()
|
||||
.then(res => {
|
||||
this.SetCanLottery(true);
|
||||
const { code } = res;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<template>
|
||||
<div class="balance-view" :class="modeClass">
|
||||
<div class="balance-view-text">
|
||||
<label>鱼券:</label>
|
||||
<label>{{ moneyStr }}</label>
|
||||
<span>{{ value }}</span>
|
||||
</div>
|
||||
<div class="balance-view-btn" @touchstart="() => {}"></div>
|
||||
<div class="balance-view-btn" @click="clickHandler"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { money } from "@/config";
|
||||
import eventBus from "@/lib/eventBus";
|
||||
export default {
|
||||
name: "BalanceView",
|
||||
props: {
|
||||
@@ -21,10 +23,23 @@ export default {
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
money
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
modeClass() {
|
||||
if (this.drawType === "turntable1") return "balance-view-xy";
|
||||
return "balance-view-hh";
|
||||
},
|
||||
moneyStr() {
|
||||
return `${money}余额:`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickHandler() {
|
||||
eventBus.$emit("rechargeView");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="lottery-btn" :class="modeClass" @touchend="clickLottery"></div>
|
||||
<div class="lottery-btn" :class="modeClass" @click="clickLottery"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getQueryTicketNum({ uid: this.uid });
|
||||
this.getQueryTicketNum();
|
||||
this.getqueryTicketRule(this.drawType);
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="btn-view" :class="modeClass" @touchend="clickEntryBtn">
|
||||
<div class="btn-view" :class="modeClass" @click="clickEntryBtn">
|
||||
<div class="btn-view-touch">{{ text }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btnList: ["规则", "奖品", "排行", "记录"]
|
||||
btnList: ["反馈", "规则", "奖品", "记录"]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -91,12 +91,6 @@ export default {
|
||||
if (this.drawType === "turntable1") return this.blueImages;
|
||||
return this.goldImages;
|
||||
},
|
||||
uid() {
|
||||
return this.$route.query.uid;
|
||||
},
|
||||
roomUid() {
|
||||
return this.$route.query.roomUid;
|
||||
},
|
||||
runTime() {
|
||||
if (this.ruleType === "one") return 1000;
|
||||
if (this.ruleType === "ten") return 2000;
|
||||
@@ -152,11 +146,8 @@ export default {
|
||||
]),
|
||||
...mapActions(["getQueryPrizeInfo", "runLottery"]),
|
||||
queryPrizeInfo() {
|
||||
this.getQueryPrizeInfo().then(res => {
|
||||
const { code, data } = res;
|
||||
if (code === 200) {
|
||||
this.prizes = this.configPrizes(data);
|
||||
}
|
||||
this.getQueryPrizeInfo().then(list => {
|
||||
this.prizes = this.configPrizes(list);
|
||||
});
|
||||
},
|
||||
postDoLottery() {
|
||||
@@ -172,10 +163,7 @@ export default {
|
||||
this.request = false;
|
||||
this.$refs.LuckDraw.play();
|
||||
|
||||
this.runLottery({
|
||||
uid: this.uid,
|
||||
roomUid: this.roomUid
|
||||
}).then(res => {
|
||||
this.runLottery().then(res => {
|
||||
const { code } = res;
|
||||
if (code === 200) {
|
||||
this.request = true;
|
||||
|
||||
@@ -1,32 +1,34 @@
|
||||
<template>
|
||||
<div class="record-list">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished"
|
||||
finished-text="没有更多了"
|
||||
:error.sync="error"
|
||||
error-text="请求失败,点击重新加载"
|
||||
@load="getDrawRecord"
|
||||
>
|
||||
<div
|
||||
class="record-list-item"
|
||||
v-for="(item, index) in recordList"
|
||||
:key="`${item.prizeId}_${index}`"
|
||||
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished"
|
||||
finished-text="没有更多了"
|
||||
:error.sync="error"
|
||||
error-text="请求失败,点击重新加载"
|
||||
@load="getDrawRecord"
|
||||
>
|
||||
<record-item
|
||||
:img="item.prizeImgUrl"
|
||||
:name="item.prizeName"
|
||||
:dateTime="dateFormat(item.createTime)"
|
||||
></record-item>
|
||||
</div>
|
||||
</van-list>
|
||||
<div
|
||||
class="record-list-item"
|
||||
v-for="(item, index) in recordList"
|
||||
:key="`${item.prizeId}_${index}`"
|
||||
>
|
||||
<record-item
|
||||
:img="item.prizeImgUrl"
|
||||
:name="item.prizeName"
|
||||
:dateTime="dateFormat(item.createTime)"
|
||||
></record-item>
|
||||
</div>
|
||||
</van-list>
|
||||
</van-pull-refresh>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapGetters } from "vuex";
|
||||
import { drawRecord } from "@/api";
|
||||
import recordItem from "./recordItem.vue";
|
||||
import { mapMutations } from "vuex";
|
||||
export default {
|
||||
name: "RecordItem",
|
||||
components: {
|
||||
@@ -47,6 +49,7 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
finished: false,
|
||||
refreshing: false,
|
||||
recordList: [],
|
||||
pageSize: 10,
|
||||
page: 1,
|
||||
@@ -54,21 +57,26 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
uid() {
|
||||
return this.$route.query.uid;
|
||||
...mapGetters(["drawType"]),
|
||||
actId() {
|
||||
return this.$route.query.actId;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getDrawRecord();
|
||||
// console.log("created");
|
||||
},
|
||||
mounted() {
|
||||
this.page = 1;
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["SetLotteryRecordRateVo"]),
|
||||
// loadData() {},
|
||||
getDrawRecord() {
|
||||
console.log("getDrawRecord");
|
||||
this.loading = true;
|
||||
drawRecord({
|
||||
uid: this.uid,
|
||||
actId: this.actId,
|
||||
drawType: this.drawType,
|
||||
sortType: this.sortType,
|
||||
page: this.page,
|
||||
pageSize: this.pageSize
|
||||
@@ -77,10 +85,20 @@ export default {
|
||||
this.loading = false;
|
||||
const { code, data, msg } = res;
|
||||
if (code === 200) {
|
||||
const { drawPrizeItemVos, lotteryRecordRateVo } = data;
|
||||
this.recordList = this.recordList.concat(drawPrizeItemVos);
|
||||
this.SetLotteryRecordRateVo(lotteryRecordRateVo);
|
||||
if (drawPrizeItemVos.length < this.pageSize) this.finished = true;
|
||||
if (this.page === 1 && (!data || data.length === 0)) {
|
||||
this.$toast.fail("您还没有抽奖记录哦,赶紧去参与抽奖吧!");
|
||||
this.finished = true;
|
||||
this.refreshing = false;
|
||||
return;
|
||||
}
|
||||
if (this.refreshing) {
|
||||
this.recordList = [];
|
||||
this.refreshing = false;
|
||||
}
|
||||
// const { drawPrizeItemVos, lotteryRecordRateVo } = data;
|
||||
this.recordList = this.recordList.concat(data);
|
||||
// this.SetLotteryRecordRateVo(lotteryRecordRateVo);
|
||||
if (data.length < this.pageSize) this.finished = true;
|
||||
} else {
|
||||
this.$toast.fail(msg);
|
||||
}
|
||||
@@ -89,6 +107,7 @@ export default {
|
||||
this.loading = false;
|
||||
this.$toast.fail("获取抽奖记录失败!");
|
||||
});
|
||||
this.page++;
|
||||
},
|
||||
dateFormat(datetime, fmt = "YYYY-mm-dd HH:MM") {
|
||||
let ret;
|
||||
@@ -112,6 +131,11 @@ export default {
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
},
|
||||
onRefresh() {
|
||||
this.finished = false;
|
||||
this.page = 1;
|
||||
this.getDrawRecord();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<swiper-slide
|
||||
class="notice-swiper-slide"
|
||||
v-for="(item, index) in recordList"
|
||||
:key="`notice-swiper-slide-${item.id}-${index}`"
|
||||
:key="`notice-swiper-slide-${item.erbanNo}-${index}`"
|
||||
>
|
||||
<div class="notice-swiper-slide-content">
|
||||
<label>{{ item.nick }}</label>
|
||||
<span>{{ text }}</span>
|
||||
<label>{{ item.prizeName }}x{{ item.num }}</label>
|
||||
<label>{{ item.prizeName }}×{{ item.num || 1 }}</label>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
@@ -17,6 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { queryPrizeMsg } from "@/api";
|
||||
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
|
||||
export default {
|
||||
@@ -45,7 +46,19 @@ export default {
|
||||
interval: 0
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters(["drawType"]),
|
||||
actId() {
|
||||
return this.$route.query.actId;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
drawType() {
|
||||
clearInterval(this.interval);
|
||||
this.getQueryPrizeMsg();
|
||||
this.interval = setInterval(this.getQueryPrizeMsg, 120 * 1000);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getQueryPrizeMsg();
|
||||
},
|
||||
@@ -57,14 +70,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getQueryPrizeMsg() {
|
||||
queryPrizeMsg().then(res => {
|
||||
const { code, data, msg } = res;
|
||||
if (code === 200) {
|
||||
this.recordList = data;
|
||||
} else {
|
||||
this.$toast.fail(msg);
|
||||
queryPrizeMsg({ actId: this.actId, drawType: this.drawType }).then(
|
||||
res => {
|
||||
const { code, data, msg } = res;
|
||||
if (code === 200) {
|
||||
this.recordList = data;
|
||||
} else {
|
||||
this.$toast.fail(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user