|
@@ -217,7 +217,7 @@
|
|
|
<div v-for="(item, index) in cardList" :key="index">
|
|
<div v-for="(item, index) in cardList" :key="index">
|
|
|
<div class="con">
|
|
<div class="con">
|
|
|
<div class="con-l">
|
|
<div class="con-l">
|
|
|
- <img :src="item.images" alt="" />
|
|
|
|
|
|
|
+ <img :src="item.image" alt="" />
|
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.name }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<p>x{{ item.amount }}</p>
|
|
<p>x{{ item.amount }}</p>
|
|
@@ -255,12 +255,12 @@
|
|
|
<div class="tit">福袋细节图</div>
|
|
<div class="tit">福袋细节图</div>
|
|
|
<van-uploader
|
|
<van-uploader
|
|
|
style="margin-left:20px"
|
|
style="margin-left:20px"
|
|
|
- :file-list="forms.images"
|
|
|
|
|
- :after-read="afterReads"
|
|
|
|
|
|
|
+ :file-list="forms.image"
|
|
|
|
|
+ :after-read="aaa"
|
|
|
@delete="deleteImgs"
|
|
@delete="deleteImgs"
|
|
|
/>
|
|
/>
|
|
|
<div class="bottom">
|
|
<div class="bottom">
|
|
|
- <van-button type="primary" block @click="submitNum">完成</van-button>
|
|
|
|
|
|
|
+ <van-button type="primary" block @click="submitNum">完成2</van-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -288,7 +288,7 @@ export default {
|
|
|
limitOne: false,
|
|
limitOne: false,
|
|
|
groupDTOS: []
|
|
groupDTOS: []
|
|
|
},
|
|
},
|
|
|
- forms: { name: '', amount: '', images: [], imagesList: [], imageUrls: [] },
|
|
|
|
|
|
|
+ forms: { name: '', amount: '', image: [], imagesList: [], imageUrls: [] },
|
|
|
name: '',
|
|
name: '',
|
|
|
soldStatus: '',
|
|
soldStatus: '',
|
|
|
show: false,
|
|
show: false,
|
|
@@ -298,6 +298,7 @@ export default {
|
|
|
newShow: false,
|
|
newShow: false,
|
|
|
showId: false,
|
|
showId: false,
|
|
|
id: 0,
|
|
id: 0,
|
|
|
|
|
+ count: 0,
|
|
|
images: [],
|
|
images: [],
|
|
|
cardList: [],
|
|
cardList: [],
|
|
|
imagesList: [],
|
|
imagesList: [],
|
|
@@ -309,6 +310,7 @@ export default {
|
|
|
caseJackpots: [],
|
|
caseJackpots: [],
|
|
|
time: 0,
|
|
time: 0,
|
|
|
times: 1,
|
|
times: 1,
|
|
|
|
|
+ chooseType: null,
|
|
|
typeOptions: [
|
|
typeOptions: [
|
|
|
{ id: 4, name: '福袋模式' },
|
|
{ id: 4, name: '福袋模式' },
|
|
|
{ id: 0, name: '组队模板(24队每队6人)', group: 24, groupCount: 6, special: false },
|
|
{ id: 0, name: '组队模板(24队每队6人)', group: 24, groupCount: 6, special: false },
|
|
@@ -449,7 +451,7 @@ export default {
|
|
|
this.flags = false;
|
|
this.flags = false;
|
|
|
this.forms.name = '';
|
|
this.forms.name = '';
|
|
|
this.forms.amount = '';
|
|
this.forms.amount = '';
|
|
|
- this.forms.images = '';
|
|
|
|
|
|
|
+ this.forms.image = [];
|
|
|
},
|
|
},
|
|
|
submitCon() {
|
|
submitCon() {
|
|
|
// if (this.cardLists.length < 0) {
|
|
// if (this.cardLists.length < 0) {
|
|
@@ -476,10 +478,42 @@ export default {
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- let cardLists = { name: this.forms.name, amount: this.forms.amount, images: this.forms.imageUrls };
|
|
|
|
|
- this.cardList.push(cardLists);
|
|
|
|
|
- console.log(this.cardList);
|
|
|
|
|
- this.flags = true;
|
|
|
|
|
|
|
+ if (this.forms.imageUrls <= 0) {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: '请添加福袋图片'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let data = { name: this.forms.name, amount: this.forms.amount };
|
|
|
|
|
+ let image = this.forms.imageUrls.join(',');
|
|
|
|
|
+ console.log(image);
|
|
|
|
|
+ data.image = image;
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .post('/jackpot/save', data, {
|
|
|
|
|
+ header: {
|
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res.id);
|
|
|
|
|
+ let cardLists = {
|
|
|
|
|
+ name: this.forms.name,
|
|
|
|
|
+ amount: this.forms.amount,
|
|
|
|
|
+ image: this.forms.imageUrls,
|
|
|
|
|
+ jackpotId: res.id
|
|
|
|
|
+ };
|
|
|
|
|
+ this.cardList.push(cardLists);
|
|
|
|
|
+
|
|
|
|
|
+ console.log(this.cardList);
|
|
|
|
|
+ this.flags = true;
|
|
|
|
|
+ this.saving = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ this.saving = false;
|
|
|
|
|
+ this.$message.error(e.error);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
// canChoose(info) {
|
|
// canChoose(info) {
|
|
|
// return info.sold;
|
|
// return info.sold;
|
|
@@ -552,15 +586,20 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
change(e) {
|
|
change(e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ this.chooseType = e.detail;
|
|
|
this.time = e.detail;
|
|
this.time = e.detail;
|
|
|
let cardBos = [...this.typeOptions].find(item => {
|
|
let cardBos = [...this.typeOptions].find(item => {
|
|
|
return item.id == this.time;
|
|
return item.id == this.time;
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ console.log(this.chooseType);
|
|
|
if (this.time != 4) {
|
|
if (this.time != 4) {
|
|
|
this.initApi(cardBos);
|
|
this.initApi(cardBos);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
initApi(params) {
|
|
initApi(params) {
|
|
|
|
|
+ console.log(params);
|
|
|
this.showLoading();
|
|
this.showLoading();
|
|
|
this.$http
|
|
this.$http
|
|
|
.post('/cardCase/genNew', {
|
|
.post('/cardCase/genNew', {
|
|
@@ -569,7 +608,7 @@ 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;
|
|
@@ -614,37 +653,36 @@ export default {
|
|
|
return item.url;
|
|
return item.url;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- afterReads(file) {
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.showLoading();
|
|
|
|
|
- this.$http
|
|
|
|
|
- .uploadFile(file.path)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- if (this.forms.images.length > 0) {
|
|
|
|
|
- this.toast('最多上传一张图片');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- this.hideLoading();
|
|
|
|
|
- this.forms.imagesList.push({ ...file, url: res });
|
|
|
|
|
- this.forms.images = [...this.forms.imagesList];
|
|
|
|
|
- this.forms.imageUrls.push(res);
|
|
|
|
|
- console.log(this.forms.imageUrls);
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.hideLoading();
|
|
|
|
|
- wx.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: e.error
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ aaa(file) {
|
|
|
|
|
+ console.log(file);
|
|
|
|
|
+ this.showLoading();
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .uploadFile(file.path)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ if (this.forms.image.length > 0) {
|
|
|
|
|
+ this.toast('最多上传一张图片');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.hideLoading();
|
|
|
|
|
+ this.forms.imagesList.push({ ...file, url: res });
|
|
|
|
|
+ this.forms.image = [...this.forms.imagesList];
|
|
|
|
|
+ this.forms.imageUrls.push(res);
|
|
|
|
|
+ console.log(this.forms.imageUrls);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ this.hideLoading();
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: e.error
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
deleteImgs(e) {
|
|
deleteImgs(e) {
|
|
|
- let list = [...this.forms.images];
|
|
|
|
|
|
|
+ let list = [...this.forms.image];
|
|
|
list.splice(e.detail.index, 1);
|
|
list.splice(e.detail.index, 1);
|
|
|
- this.forms.images = list;
|
|
|
|
|
|
|
+ this.forms.image = list;
|
|
|
this.forms.imageUrls = list.map(item => {
|
|
this.forms.imageUrls = list.map(item => {
|
|
|
return item.url;
|
|
return item.url;
|
|
|
});
|
|
});
|
|
@@ -711,54 +749,60 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
submits() {
|
|
submits() {
|
|
|
- // if (!this.form.name) {
|
|
|
|
|
- // wx.showToast({
|
|
|
|
|
- // icon: 'none',
|
|
|
|
|
- // title: '请选择卡牌名称'
|
|
|
|
|
- // });
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- // if (!this.form.name) {
|
|
|
|
|
- // wx.showToast({
|
|
|
|
|
- // icon: 'none',
|
|
|
|
|
- // title: '请填写卡牌名称'
|
|
|
|
|
- // });
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- // if (!this.form.boxPrice) {
|
|
|
|
|
- // wx.showToast({
|
|
|
|
|
- // icon: 'none',
|
|
|
|
|
- // title: '请填写价格'
|
|
|
|
|
- // });
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- // if (!this.form.startTime) {
|
|
|
|
|
- // wx.showToast({
|
|
|
|
|
- // icon: 'none',
|
|
|
|
|
- // title: '请选择结束时间'
|
|
|
|
|
- // });
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (!this.form.name) {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: '请填写卡牌名称'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.form.boxPrice) {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: '请填写价格'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.form.startTime) {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: '请选择结束时间'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let newJackpot = {};
|
|
let newJackpot = {};
|
|
|
|
|
+ var count = new Number('0');
|
|
|
this.cardList.map(item => {
|
|
this.cardList.map(item => {
|
|
|
newJackpot.name = item.name;
|
|
newJackpot.name = item.name;
|
|
|
- newJackpot.images = item.images;
|
|
|
|
|
|
|
+ newJackpot.image = item.image[0];
|
|
|
newJackpot.amount = item.amount;
|
|
newJackpot.amount = item.amount;
|
|
|
|
|
+ newJackpot.jackpotId = item.jackpotId;
|
|
|
|
|
+ var amount = new Number(item.amount);
|
|
|
|
|
+ count = count + amount;
|
|
|
this.caseJackpots.push(newJackpot);
|
|
this.caseJackpots.push(newJackpot);
|
|
|
});
|
|
});
|
|
|
- // this.$set(newJackpot, cardCaseInputDTO);
|
|
|
|
|
|
|
+ console.log(count);
|
|
|
|
|
+ if (!this.$mp.query.id) {
|
|
|
|
|
+ let box = {
|
|
|
|
|
+ group: 1,
|
|
|
|
|
+ groupCount: count,
|
|
|
|
|
+ special: false
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.initApi(box);
|
|
|
|
|
+ }
|
|
|
let caseStatus = 'UNDO';
|
|
let caseStatus = 'UNDO';
|
|
|
delete this.form.collectionId;
|
|
delete this.form.collectionId;
|
|
|
delete this.form.seriesId;
|
|
delete this.form.seriesId;
|
|
|
- delete this.form.groupDTOS;
|
|
|
|
|
|
|
+ // delete this.form.groupDTOS;
|
|
|
let cardCaseInputDTO = { ...this.form };
|
|
let cardCaseInputDTO = { ...this.form };
|
|
|
- // let images = this.imageUrls.join(',');
|
|
|
|
|
- let images = this.imageUrls;
|
|
|
|
|
|
|
+ let images = this.imageUrls.join(',');
|
|
|
|
|
+ // let images = this.imageUrls;
|
|
|
cardCaseInputDTO.images = images;
|
|
cardCaseInputDTO.images = images;
|
|
|
cardCaseInputDTO.caseStatus = caseStatus;
|
|
cardCaseInputDTO.caseStatus = caseStatus;
|
|
|
- cardCaseInputDTO.groupDTOS = this.caseJackpots;
|
|
|
|
|
|
|
+ cardCaseInputDTO.caseJackpots = this.caseJackpots;
|
|
|
console.log(this.cardList);
|
|
console.log(this.cardList);
|
|
|
- console.log(this.cardCaseInputDTOs);
|
|
|
|
|
console.log(cardCaseInputDTO);
|
|
console.log(cardCaseInputDTO);
|
|
|
this.showLoading();
|
|
this.showLoading();
|
|
|
this.$http
|
|
this.$http
|