|
@@ -2,6 +2,9 @@
|
|
|
{
|
|
{
|
|
|
"navigationBarTitleText": "新增商品",
|
|
"navigationBarTitleText": "新增商品",
|
|
|
"navigationBarBackgroundColor": "#ffffff",
|
|
"navigationBarBackgroundColor": "#ffffff",
|
|
|
|
|
+ "usingComponents": {
|
|
|
|
|
+ "van-switch": "/vant/switch/index",
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</config>
|
|
</config>
|
|
|
<template>
|
|
<template>
|
|
@@ -52,6 +55,20 @@
|
|
|
<span slot="right-icon">元</span>
|
|
<span slot="right-icon">元</span>
|
|
|
</van-field>
|
|
</van-field>
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
|
|
+ <div class="box-con">
|
|
|
|
|
+ <div class="box-top">
|
|
|
|
|
+ <div class="top">
|
|
|
|
|
+ <span>限购选择</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <van-sticky :offset-top="0">
|
|
|
|
|
+ <div class="time-box">
|
|
|
|
|
+ <van-dropdown-menu direction="up">
|
|
|
|
|
+ <van-dropdown-item @change="onChange" :value="times" :options="option2" />
|
|
|
|
|
+ </van-dropdown-menu>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-sticky>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="box-con">
|
|
<div class="box-con">
|
|
|
<!-- <div class="label">卡牌细节图</div>
|
|
<!-- <div class="label">卡牌细节图</div>
|
|
|
<van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg" /> -->
|
|
<van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg" /> -->
|
|
@@ -178,6 +195,8 @@ export default {
|
|
|
packagesCount: null,
|
|
packagesCount: null,
|
|
|
caseStatus: 'PROGRESS',
|
|
caseStatus: 'PROGRESS',
|
|
|
cardCaseId: '',
|
|
cardCaseId: '',
|
|
|
|
|
+ special: false,
|
|
|
|
|
+ limitOne: false,
|
|
|
groupDTOS: []
|
|
groupDTOS: []
|
|
|
},
|
|
},
|
|
|
name: '',
|
|
name: '',
|
|
@@ -197,12 +216,14 @@ export default {
|
|
|
list: [],
|
|
list: [],
|
|
|
actions: [],
|
|
actions: [],
|
|
|
time: 0,
|
|
time: 0,
|
|
|
|
|
+ times: 1,
|
|
|
typeOptions: [
|
|
typeOptions: [
|
|
|
{ id: 0, name: '组队模板(24队每队6人)', group: 24, groupCount: 6, special: false },
|
|
{ id: 0, name: '组队模板(24队每队6人)', group: 24, groupCount: 6, special: false },
|
|
|
{ id: 1, name: '端盒模板(AB组24对)', group: 2, groupCount: 24, special: true },
|
|
{ id: 1, name: '端盒模板(AB组24对)', group: 2, groupCount: 24, special: true },
|
|
|
{ id: 2, name: '组队模板(单组24包)', group: 1, groupCount: 24, special: false },
|
|
{ id: 2, name: '组队模板(单组24包)', group: 1, groupCount: 24, special: false },
|
|
|
{ id: 3, name: '组队模板(单组20包)', group: 1, groupCount: 20, special: false }
|
|
{ id: 3, name: '组队模板(单组20包)', group: 1, groupCount: 20, special: false }
|
|
|
],
|
|
],
|
|
|
|
|
+ nameOptions: [{ id: 0, name: '是', limitOne: true }, { id: 1, name: '否', limitOne: false }],
|
|
|
minDate: new Date(new Date().getFullYear() - 1, 10, 1).getTime(),
|
|
minDate: new Date(new Date().getFullYear() - 1, 10, 1).getTime(),
|
|
|
maxDate: new Date(new Date().getFullYear() + 2, 10, 1).getTime(),
|
|
maxDate: new Date(new Date().getFullYear() + 2, 10, 1).getTime(),
|
|
|
currentDate: new Date().getTime()
|
|
currentDate: new Date().getTime()
|
|
@@ -217,6 +238,15 @@ export default {
|
|
|
value: item.id
|
|
value: item.id
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ option2() {
|
|
|
|
|
+ let list = [...this.nameOptions];
|
|
|
|
|
+ return list.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ text: item.name,
|
|
|
|
|
+ value: item.id
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -306,27 +336,39 @@ export default {
|
|
|
cancel() {
|
|
cancel() {
|
|
|
this.show = false;
|
|
this.show = false;
|
|
|
},
|
|
},
|
|
|
|
|
+ onChange(e) {
|
|
|
|
|
+ this.times = e.detail;
|
|
|
|
|
+ let nameList = [...this.nameOptions].find(item => {
|
|
|
|
|
+ return item.id == this.times;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.form.limitOne = nameList.limitOne;
|
|
|
|
|
+ // console.log(this.form.limitOne);
|
|
|
|
|
+ },
|
|
|
// canChoose(info) {
|
|
// canChoose(info) {
|
|
|
// return info.sold;
|
|
// return info.sold;
|
|
|
// },
|
|
// },
|
|
|
cartBox() {
|
|
cartBox() {
|
|
|
- // console.log(this.form.caseStatus);
|
|
|
|
|
this.$http.get('/cardCase/getCardCase', { id: this.$mp.query.id }).then(res => {
|
|
this.$http.get('/cardCase/getCardCase', { id: this.$mp.query.id }).then(res => {
|
|
|
// console.log(res);
|
|
// console.log(res);
|
|
|
this.soldStatus = res.soldStatus;
|
|
this.soldStatus = res.soldStatus;
|
|
|
this.showId = res.id;
|
|
this.showId = res.id;
|
|
|
|
|
+ if (res.limitOne == true) {
|
|
|
|
|
+ this.times = 0;
|
|
|
|
|
+ }
|
|
|
this.form = {
|
|
this.form = {
|
|
|
|
|
+ id: res.id,
|
|
|
boxPrice: res.boxPrice,
|
|
boxPrice: res.boxPrice,
|
|
|
groupDTOS: res.groupDTOS,
|
|
groupDTOS: res.groupDTOS,
|
|
|
startTime: res.startTime,
|
|
startTime: res.startTime,
|
|
|
description: res.description,
|
|
description: res.description,
|
|
|
- id: res.id,
|
|
|
|
|
|
|
+ limitOne: res.limitOne,
|
|
|
|
|
+ special: res.special,
|
|
|
collectionId: res.collectionId,
|
|
collectionId: res.collectionId,
|
|
|
- // images: res.images,
|
|
|
|
|
caseStatus: res.caseStatus,
|
|
caseStatus: res.caseStatus,
|
|
|
packagesCount: res.packagesCount,
|
|
packagesCount: res.packagesCount,
|
|
|
- // boxesCount: res.boxesCount || null,
|
|
|
|
|
postage: res.postage || 0
|
|
postage: res.postage || 0
|
|
|
|
|
+ // images: res.images,
|
|
|
|
|
+ // boxesCount: res.boxesCount || null
|
|
|
};
|
|
};
|
|
|
// this.images = res.images.split(',').map(item => {
|
|
// this.images = res.images.split(',').map(item => {
|
|
|
// return {
|
|
// return {
|
|
@@ -388,10 +430,10 @@ export default {
|
|
|
special: params.special
|
|
special: params.special
|
|
|
})
|
|
})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ // console.log(res);
|
|
|
this.hideLoading();
|
|
this.hideLoading();
|
|
|
this.form.special = params.special;
|
|
this.form.special = params.special;
|
|
|
- // this.form.groupDTOS = res;
|
|
|
|
|
|
|
+ this.form.groupDTOS = res;
|
|
|
// console.log(this.form.groupDTOS);
|
|
// console.log(this.form.groupDTOS);
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
@@ -472,6 +514,7 @@ export default {
|
|
|
let cardCaseInputDTO = { ...this.form };
|
|
let cardCaseInputDTO = { ...this.form };
|
|
|
// let images = this.imageUrls.join(',');
|
|
// let images = this.imageUrls.join(',');
|
|
|
// cardCaseInputDTO.images = images;
|
|
// cardCaseInputDTO.images = images;
|
|
|
|
|
+ console.log(cardCaseInputDTO);
|
|
|
this.showLoading();
|
|
this.showLoading();
|
|
|
this.$http
|
|
this.$http
|
|
|
.post('/cardCase/save', cardCaseInputDTO, {
|
|
.post('/cardCase/save', cardCaseInputDTO, {
|
|
@@ -484,17 +527,19 @@ export default {
|
|
|
this.id = res.id;
|
|
this.id = res.id;
|
|
|
this.hideLoading();
|
|
this.hideLoading();
|
|
|
this.form = {
|
|
this.form = {
|
|
|
|
|
+ id: res.id,
|
|
|
boxPrice: res.boxPrice,
|
|
boxPrice: res.boxPrice,
|
|
|
|
|
+ special: res.special,
|
|
|
groupDTOS: res.groupDTOS,
|
|
groupDTOS: res.groupDTOS,
|
|
|
startTime: res.startTime,
|
|
startTime: res.startTime,
|
|
|
description: res.description,
|
|
description: res.description,
|
|
|
- id: res.id,
|
|
|
|
|
collectionId: res.collectionId,
|
|
collectionId: res.collectionId,
|
|
|
- // images: res.images,
|
|
|
|
|
caseStatus: res.caseStatus,
|
|
caseStatus: res.caseStatus,
|
|
|
|
|
+ limitOne: res.limitOne,
|
|
|
packagesCount: res.packagesCount,
|
|
packagesCount: res.packagesCount,
|
|
|
- // boxesCount: res.boxesCount || null,
|
|
|
|
|
postage: res.postage || 0
|
|
postage: res.postage || 0
|
|
|
|
|
+ // images: res.images,
|
|
|
|
|
+ // boxesCount: res.boxesCount || null
|
|
|
};
|
|
};
|
|
|
wx.showToast({
|
|
wx.showToast({
|
|
|
title: '商品上架成功'
|
|
title: '商品上架成功'
|