|
@@ -26,17 +26,17 @@
|
|
|
|
|
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<div class="card" v-for="(card, index) in cardList" :key="index">
|
|
<div class="card" v-for="(card, index) in cardList" :key="index">
|
|
|
- <div class="card-title">第{{ getNumStr(index + 1) }}组</div>
|
|
|
|
|
|
|
+ <div class="card-title">第{{ index + 1 }}组</div>
|
|
|
<div class="card-list">
|
|
<div class="card-list">
|
|
|
<div
|
|
<div
|
|
|
v-for="(item, itemIndex) in card"
|
|
v-for="(item, itemIndex) in card"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
class="card-item"
|
|
class="card-item"
|
|
|
:class="{
|
|
:class="{
|
|
|
- used: item.caseStatus !== 'WAIT' || item.userId,
|
|
|
|
|
|
|
+ used: item.caseStatus !== ('WAIT' || 'PROGRESS') || item.userId,
|
|
|
active: nowChoose.includes(item.id)
|
|
active: nowChoose.includes(item.id)
|
|
|
}"
|
|
}"
|
|
|
- @click="choose(item.id, item.caseStatus !== 'WAIT' || item.userId)"
|
|
|
|
|
|
|
+ @click="choose(item.id, item.caseStatus !== ('WAIT' || 'PROGRESS') || item.userId)"
|
|
|
>
|
|
>
|
|
|
{{ itemIndex + 1 }}
|
|
{{ itemIndex + 1 }}
|
|
|
</div>
|
|
</div>
|
|
@@ -116,14 +116,11 @@ export default {
|
|
|
if (used) {
|
|
if (used) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- console.log(id);
|
|
|
|
|
let list = [...this.nowChoose];
|
|
let list = [...this.nowChoose];
|
|
|
if (list.includes(id)) {
|
|
if (list.includes(id)) {
|
|
|
list.splice(list.indexOf(id), 1);
|
|
list.splice(list.indexOf(id), 1);
|
|
|
- } else if (list.length < 6) {
|
|
|
|
|
- list.push(id);
|
|
|
|
|
} else {
|
|
} else {
|
|
|
- this.toast('最多选择六张');
|
|
|
|
|
|
|
+ list.push(id);
|
|
|
}
|
|
}
|
|
|
this.nowChoose = list;
|
|
this.nowChoose = list;
|
|
|
},
|
|
},
|
|
@@ -132,16 +129,40 @@ export default {
|
|
|
this.toast('请选择卡牌');
|
|
this.toast('请选择卡牌');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.$emit('update:chooseIds', this.nowChoose);
|
|
|
|
|
- this.show = false;
|
|
|
|
|
- if (this.buy) {
|
|
|
|
|
- this.$emit('buy');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let caseId = this.cardCaseInfo.cardCaseId;
|
|
|
|
|
+ let boxIds = this.nowChoose.join(',');
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .get('/orderInfo/checkBox', {
|
|
|
|
|
+ caseId,
|
|
|
|
|
+ boxIds
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ let checkResult = false;
|
|
|
|
|
+ checkResult = res;
|
|
|
|
|
+ if (!checkResult) {
|
|
|
|
|
+ this.toast('该卡箱需要两个卡包组选择数量一样.');
|
|
|
|
|
+ return Promise.reject();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Promise.resolve();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.$emit('update:chooseIds', this.nowChoose);
|
|
|
|
|
+ this.show = false;
|
|
|
|
|
+ if (this.buy) {
|
|
|
|
|
+ this.$emit('buy');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ wx.hideLoading();
|
|
|
|
|
+ if (e.error) {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: e.error
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- // getChart(index) {
|
|
|
|
|
- // const list = ['1', '2', '3', '4', '5', '6'];
|
|
|
|
|
- // return list[index];
|
|
|
|
|
- // }
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -227,17 +248,13 @@ export default {
|
|
|
color: #939599;
|
|
color: #939599;
|
|
|
line-height: 24px;
|
|
line-height: 24px;
|
|
|
}
|
|
}
|
|
|
-.card-list {
|
|
|
|
|
- margin: 5px;
|
|
|
|
|
-}
|
|
|
|
|
.card {
|
|
.card {
|
|
|
background-color: @bg;
|
|
background-color: @bg;
|
|
|
padding: 12px 16px;
|
|
padding: 12px 16px;
|
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
|
- min-height: 80px;
|
|
|
|
|
.card-list {
|
|
.card-list {
|
|
|
.flex();
|
|
.flex();
|
|
|
-
|
|
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
.card-item {
|
|
.card-item {
|
|
|
width: 42px;
|
|
width: 42px;
|
|
|
height: 42px;
|
|
height: 42px;
|
|
@@ -248,7 +265,7 @@ export default {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
color: #000000;
|
|
color: #000000;
|
|
|
line-height: 42px;
|
|
line-height: 42px;
|
|
|
-
|
|
|
|
|
|
|
+ margin-top: 10px;
|
|
|
&.used {
|
|
&.used {
|
|
|
background-color: #939599;
|
|
background-color: #939599;
|
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
@@ -262,6 +279,10 @@ export default {
|
|
|
&:active {
|
|
&:active {
|
|
|
opacity: 0.8;
|
|
opacity: 0.8;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ &:nth-child(6n + 1) {
|
|
|
|
|
+ margin-left: 0 !important;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.card-item + .card-item {
|
|
.card-item + .card-item {
|