|
|
@@ -9,7 +9,7 @@
|
|
|
<van-cell-group :border="false">
|
|
|
<van-field
|
|
|
label="卡牌名称"
|
|
|
- :value="form.name"
|
|
|
+ :value="name"
|
|
|
placeholder="请输入卡牌名称"
|
|
|
is-link
|
|
|
readonly
|
|
|
@@ -18,23 +18,23 @@
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
label="卡牌售价"
|
|
|
- :value="form.price"
|
|
|
- @input="form.price = $event.detail"
|
|
|
+ :value="form.boxPrice"
|
|
|
+ @input="form.boxPrice = $event.detail"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
label="拼箱结束"
|
|
|
is-link
|
|
|
- :value="form.dates"
|
|
|
+ :value="form.startTime"
|
|
|
placeholder="请输入结束日期"
|
|
|
@click="newShow = true"
|
|
|
>
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
label="拼箱人数"
|
|
|
- :value="form.num"
|
|
|
- @input="form.num = $event.detail"
|
|
|
+ :value="form.boxesCount"
|
|
|
+ @input="form.boxesCount = $event.detail"
|
|
|
placeholder="请输入参加人数"
|
|
|
>
|
|
|
</van-field>
|
|
|
@@ -48,18 +48,19 @@
|
|
|
</van-cell-group>
|
|
|
<div class="box-con">
|
|
|
<div class="label">卡牌细节图</div>
|
|
|
- <van-uploader :file-list="fileList" :after-read="afterRead" @delete="deleteImg" />
|
|
|
- <van-sticky :offset-top="0">
|
|
|
- <div class="time-box">
|
|
|
- <van-dropdown-menu>
|
|
|
- <van-dropdown-item @change="change" :value="time" :options="option1" />
|
|
|
- </van-dropdown-menu>
|
|
|
- </div>
|
|
|
- </van-sticky>
|
|
|
-
|
|
|
- <div class="box">
|
|
|
+ <van-uploader :file-list="form.images" :after-read="afterRead" @delete="deleteImg" />
|
|
|
+ <div class="box-top">
|
|
|
+ <div class="top"><span>选择卡包</span></div>
|
|
|
+ <van-sticky :offset-top="0">
|
|
|
+ <div class="time-box">
|
|
|
+ <van-dropdown-menu>
|
|
|
+ <van-dropdown-item @change="change" :value="time" :options="option1" />
|
|
|
+ </van-dropdown-menu>
|
|
|
+ </div>
|
|
|
+ </van-sticky>
|
|
|
+ </div>
|
|
|
+ <div class="box" v-if="switchs">
|
|
|
<div class="top">
|
|
|
- <span>选择卡包</span>
|
|
|
<div class="right">
|
|
|
<div class="tool-item">
|
|
|
出售中
|
|
|
@@ -70,11 +71,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
- <div class="card" v-for="(card, index) in cardLists" :key="index">
|
|
|
- <div class="card-title">第{{ index }}组</div>
|
|
|
+ <div class="card" v-for="(card, index) in form.groupDTOS" :key="index">
|
|
|
+ <div class="card-title">第{{ index + 1 }}组</div>
|
|
|
<div class="card-list">
|
|
|
- <div v-for="(item, itemIndex) in card" :key="item" class="card-item">
|
|
|
- {{ itemIndex }}
|
|
|
+ <div v-for="(item, itemIndex) in card.dynamicTags" :key="itemIndex" class="card-item">
|
|
|
+ {{ itemIndex + 1 }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -82,8 +83,8 @@
|
|
|
</div>
|
|
|
<div class="label">卡牌详情描述</div>
|
|
|
<van-field
|
|
|
- :value="form.message"
|
|
|
- @input="message = $event.detail"
|
|
|
+ :value="form.description"
|
|
|
+ @input="form.description = $event.detail"
|
|
|
:border="false"
|
|
|
rows="1"
|
|
|
autosize
|
|
|
@@ -123,45 +124,25 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form: {
|
|
|
- name: '',
|
|
|
- num: '',
|
|
|
+ boxesCount: '',
|
|
|
postage: 10,
|
|
|
- price: '',
|
|
|
- dates: '',
|
|
|
- message: ''
|
|
|
+ boxPrice: '',
|
|
|
+ startTime: '',
|
|
|
+ description: '',
|
|
|
+ collectionId: 0,
|
|
|
+ seriesId: 0,
|
|
|
+ caseStatus: 'progress',
|
|
|
+ images: [],
|
|
|
+ groupDTOS: []
|
|
|
},
|
|
|
show: false,
|
|
|
+ name: '',
|
|
|
newShow: false,
|
|
|
- fileList: [],
|
|
|
nowChooseId: [],
|
|
|
+ sotrId: [],
|
|
|
list: [],
|
|
|
+ switchs: false,
|
|
|
closeFlag: false,
|
|
|
- cardList: [
|
|
|
- // [
|
|
|
- // { id: '106', title: '数组' },
|
|
|
- // { id: '11', title: '数组' },
|
|
|
- // { id: '201', title: '数组' },
|
|
|
- // { id: '31', title: '数组' },
|
|
|
- // { id: '41', title: '数组' },
|
|
|
- // { id: '51', title: '数组' }
|
|
|
- // ],
|
|
|
- // [
|
|
|
- // { id: '100', title: '数组' },
|
|
|
- // { id: '212', title: '数组' },
|
|
|
- // { id: '22', title: '数组' },
|
|
|
- // { id: '32', title: '数组' },
|
|
|
- // { id: '47', title: '数组' },
|
|
|
- // { id: '58', title: '数组' }
|
|
|
- // ],
|
|
|
- // [
|
|
|
- // { id: '90', title: '数组' },
|
|
|
- // { id: '19', title: '数组' },
|
|
|
- // { id: '29', title: '数组' },
|
|
|
- // { id: '39', title: '数组' },
|
|
|
- // { id: '49', title: '数组' },
|
|
|
- // { id: '59', title: '数组' }
|
|
|
- // ]
|
|
|
- ],
|
|
|
time: 0,
|
|
|
typeOptions: [
|
|
|
{ id: 0, name: '组队模板(24组6包)', group: 24, groupCount: 6, special: false },
|
|
|
@@ -184,15 +165,6 @@ export default {
|
|
|
value: item.id
|
|
|
};
|
|
|
});
|
|
|
- },
|
|
|
- cardLists() {
|
|
|
- let boxMap = { ...this.cardList };
|
|
|
- return Object.keys(boxMap).map(item => {
|
|
|
- return boxMap[item];
|
|
|
- });
|
|
|
- },
|
|
|
- allCards() {
|
|
|
- return [...this.cardLists].flat();
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -221,6 +193,10 @@ export default {
|
|
|
.then(res => {
|
|
|
this.hideLoading();
|
|
|
this.actions = res.content;
|
|
|
+ this.sotrId = this.actions.find(item => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ this.form.collectionId = this.sotrId.id;
|
|
|
})
|
|
|
.catch(e => {
|
|
|
this.hideLoading();
|
|
|
@@ -251,7 +227,7 @@ export default {
|
|
|
onConfirm(event) {
|
|
|
this.currentDate = event.detail;
|
|
|
var timeValue = this.timeFormat(new Date(event.detail), 'yyyy-MM-dd hh:mm');
|
|
|
- this.form.dates = timeValue;
|
|
|
+ this.form.startTime = timeValue + ':00';
|
|
|
this.newShow = false;
|
|
|
},
|
|
|
// 时间取消按钮
|
|
|
@@ -268,13 +244,14 @@ export default {
|
|
|
},
|
|
|
select(e) {
|
|
|
if (this.closeFlag) {
|
|
|
- this.form.name = e.detail.name;
|
|
|
+ this.name = e.detail.name;
|
|
|
this.show = false;
|
|
|
return;
|
|
|
}
|
|
|
let data = {
|
|
|
seriesId: e.detail.id
|
|
|
};
|
|
|
+ this.form.seriesId = data.seriesId;
|
|
|
this.showLoading();
|
|
|
this.$http
|
|
|
.post(
|
|
|
@@ -305,6 +282,7 @@ export default {
|
|
|
return item.id == this.time;
|
|
|
});
|
|
|
this.initApi(cardBos);
|
|
|
+ this.switchs = true;
|
|
|
},
|
|
|
initApi(params) {
|
|
|
this.showLoading();
|
|
|
@@ -316,9 +294,15 @@ export default {
|
|
|
})
|
|
|
.then(res => {
|
|
|
this.hideLoading();
|
|
|
- console.log(res);
|
|
|
- this.cardList = { ...res };
|
|
|
- console.log(this.cardList);
|
|
|
+ this.form.groupDTOS = res;
|
|
|
+ console.log(this.form.groupDTOS);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.hideLoading();
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: e.error
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
afterRead(file) {
|
|
|
@@ -328,9 +312,10 @@ export default {
|
|
|
.then(res => {
|
|
|
this.hideLoading();
|
|
|
console.log(res);
|
|
|
- let fileList = [];
|
|
|
- fileList.push({ ...file, url: res });
|
|
|
- this.fileList = fileList;
|
|
|
+ let images = [];
|
|
|
+ images.push({ ...file, url: res });
|
|
|
+ this.form.images = images;
|
|
|
+ console.log(this.form.images);
|
|
|
})
|
|
|
.catch(e => {
|
|
|
this.hideLoading();
|
|
|
@@ -341,36 +326,49 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
deleteImg() {
|
|
|
- this.fileList = [];
|
|
|
+ this.form.images = [];
|
|
|
},
|
|
|
submit() {
|
|
|
- if (!this.form.name) {
|
|
|
+ if (!this.name) {
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '卡牌名称不能为空'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if (!this.form.price) {
|
|
|
+ if (!this.form.boxPrice) {
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '价格不能为空'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if (!this.form.dates) {
|
|
|
+ if (!this.form.startTime) {
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '结束时间不能为空'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- wx.showToast({
|
|
|
- title: '商品上架成功'
|
|
|
- });
|
|
|
- },
|
|
|
- created(params) {
|
|
|
- this.initApi(params.group, params.groupCount, params.special);
|
|
|
+ let form = { ...this.form };
|
|
|
+ console.log(form);
|
|
|
+ this.showLoading();
|
|
|
+ this.$http
|
|
|
+ .post('cardCase/save', { form })
|
|
|
+ .then(res => {
|
|
|
+ this.hideLoading();
|
|
|
+ console.log(res);
|
|
|
+ wx.showToast({
|
|
|
+ title: '商品上架成功'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.hideLoading();
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: e.error
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -379,24 +377,9 @@ export default {
|
|
|
/deep/ .van-uploader {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
-// /deep/ .van-dropdown-menu {
|
|
|
-// width: 110px;
|
|
|
-// border-radius: 4px;
|
|
|
-// overflow: hidden;
|
|
|
-// background: aquamarine;
|
|
|
|
|
|
-// .van-cell__value {
|
|
|
-// &::after {
|
|
|
-// content: '';
|
|
|
-// }
|
|
|
-// &::before {
|
|
|
-// content: '';
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
.time-box {
|
|
|
background-color: @bg;
|
|
|
- padding: 20px;
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
/deep/ .van-cell {
|
|
|
@@ -432,6 +415,12 @@ export default {
|
|
|
margin-left: -3px;
|
|
|
line-height: 24px;
|
|
|
}
|
|
|
+ .box-top {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-right: 6px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
.box {
|
|
|
max-height: 70vh;
|
|
|
min-height: 50vh;
|
|
|
@@ -449,9 +438,9 @@ export default {
|
|
|
.top {
|
|
|
.flex();
|
|
|
justify-content: space-between;
|
|
|
- padding: 20px 0;
|
|
|
+ padding: 10px 0;
|
|
|
flex-shrink: 0;
|
|
|
-
|
|
|
+ justify-content: flex-end;
|
|
|
span {
|
|
|
font-size: 14px;
|
|
|
font-weight: bold;
|