|
|
@@ -10,9 +10,9 @@
|
|
|
<van-sticky>
|
|
|
<div class="container-bg">
|
|
|
<div class="mytest"><img class="mytest" src="../static/imgs/home_top_bg@3x.png" alt="" /></div>
|
|
|
- <span>游戏王OCG</span>
|
|
|
+ <span>{{ seriesName }}</span>
|
|
|
<div class="box-top">
|
|
|
- <div class="box-img">
|
|
|
+ <div class="box-img" @click="showSeries('series')">
|
|
|
<p class="box-top-img"><img src="../static/imgs/home_icon_qihuan@3x.png" alt="" /></p>
|
|
|
<p class="box-top-sp">切换卡片</p>
|
|
|
</div>
|
|
|
@@ -27,7 +27,7 @@
|
|
|
clearable
|
|
|
placeholder="搜索拼箱..."
|
|
|
/>
|
|
|
- <div class="scan" @click="showSeries">
|
|
|
+ <div class="scan" @click="showSeries('collectId')">
|
|
|
<van-icon size="16" :color="$colors.prim" name="liebiao" class-prefix="iconfont" />
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -58,8 +58,13 @@
|
|
|
>
|
|
|
</van-empty>
|
|
|
</div>
|
|
|
-
|
|
|
- <series-select ref="series" v-model="collectionId" :name.sync="searchVal" @input="getData"></series-select>
|
|
|
+ <series-select
|
|
|
+ ref="series"
|
|
|
+ :isSeries="isSeries"
|
|
|
+ :seriesId="seriesId"
|
|
|
+ :name.sync="selectName"
|
|
|
+ @input="changeSelect"
|
|
|
+ ></series-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -73,15 +78,42 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
searchVal: '',
|
|
|
+ selectName: '',
|
|
|
search: '',
|
|
|
active: '进行中',
|
|
|
list: [],
|
|
|
tabs: ['进行中', '已完成', '已过期'],
|
|
|
empty: false,
|
|
|
- collectionId: 0
|
|
|
+ collectionId: 0,
|
|
|
+ seriesId: 0,
|
|
|
+ seriesName: '',
|
|
|
+ isSeries: true
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ getSeries() {
|
|
|
+ return this.$http
|
|
|
+ .post(
|
|
|
+ '/series/all',
|
|
|
+ {
|
|
|
+ page: 0,
|
|
|
+ size: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ header: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ if (!this.empty) {
|
|
|
+ this.seriesId = res.content[0].id;
|
|
|
+ this.seriesName = res.content[0].name;
|
|
|
+ }
|
|
|
+
|
|
|
+ return Promise.resolve();
|
|
|
+ });
|
|
|
+ },
|
|
|
chageData(name) {
|
|
|
this.active = name;
|
|
|
this.getData();
|
|
|
@@ -93,6 +125,9 @@ export default {
|
|
|
let data = {
|
|
|
caseStatus: this.getStatus(this.active)
|
|
|
};
|
|
|
+ if (this.seriesId) {
|
|
|
+ data.seriesId = this.seriesId;
|
|
|
+ }
|
|
|
|
|
|
if (this.collectionId) {
|
|
|
data.collectionId = this.collectionId;
|
|
|
@@ -128,13 +163,35 @@ export default {
|
|
|
this.search = '';
|
|
|
this.getData();
|
|
|
},
|
|
|
- showSeries() {
|
|
|
+ showSeries(type = 'series') {
|
|
|
+ if (type === 'series') {
|
|
|
+ this.isSeries = true;
|
|
|
+ } else {
|
|
|
+ this.isSeries = false;
|
|
|
+ }
|
|
|
this.search = '';
|
|
|
- this.$refs.series.show = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.series.init();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeSelect(id) {
|
|
|
+ if (this.isSeries) {
|
|
|
+ this.seriesId = id;
|
|
|
+ this.seriesName = this.selectName;
|
|
|
+ this.collectionId = 0;
|
|
|
+ this.searchVal = '';
|
|
|
+ } else {
|
|
|
+ this.collectionId = id;
|
|
|
+ this.searchVal = this.selectName;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getData();
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.getData();
|
|
|
+ this.getSeries().then(() => {
|
|
|
+ this.getData();
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
</script>
|