|
|
@@ -6,7 +6,7 @@
|
|
|
</config>
|
|
|
<template>
|
|
|
<div class="addorder">
|
|
|
- <van-cell-group :border="false">
|
|
|
+ <van-cell-group :border="false" class="form">
|
|
|
<van-field
|
|
|
label="卡牌名称"
|
|
|
:value="name"
|
|
|
@@ -18,6 +18,7 @@
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
label="卡牌售价"
|
|
|
+ type="digit"
|
|
|
:value="form.boxPrice"
|
|
|
@input="form.boxPrice = $event.detail"
|
|
|
placeholder="请输入金额"
|
|
|
@@ -29,10 +30,12 @@
|
|
|
:value="form.startTime"
|
|
|
placeholder="请输入结束日期"
|
|
|
@click="newShow = true"
|
|
|
+ readonly
|
|
|
>
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
label="拼箱人数"
|
|
|
+ type="number"
|
|
|
:value="form.boxesCount"
|
|
|
@input="form.boxesCount = $event.detail"
|
|
|
placeholder="请输入参加人数"
|
|
|
@@ -221,8 +224,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- this.cartBox();
|
|
|
+ onLoad(options) {
|
|
|
+ if (this.$mp.query.id) {
|
|
|
+ this.cartBox();
|
|
|
+ this.name = options.name;
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.change({
|
|
|
+ detail: 0
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
cardInit() {
|
|
|
@@ -311,6 +323,12 @@ export default {
|
|
|
boxesCount: res.boxesCount || 0,
|
|
|
postage: res.postage || 10
|
|
|
};
|
|
|
+ this.images = res.images.split(',').map(item => {
|
|
|
+ return {
|
|
|
+ url: item
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.imageUrls = res.images.split(',');
|
|
|
});
|
|
|
},
|
|
|
select(e) {
|
|
|
@@ -349,7 +367,7 @@ export default {
|
|
|
},
|
|
|
change(e) {
|
|
|
this.time = e.detail;
|
|
|
- let cardBos = this.typeOptions.find(item => {
|
|
|
+ let cardBos = [...this.typeOptions].find(item => {
|
|
|
return item.id == this.time;
|
|
|
});
|
|
|
this.initApi(cardBos);
|
|
|
@@ -404,6 +422,9 @@ export default {
|
|
|
let list = [...this.images];
|
|
|
list.splice(e.detail.index, 1);
|
|
|
this.images = list;
|
|
|
+ this.imageUrls = list.map(item => {
|
|
|
+ return item.url;
|
|
|
+ });
|
|
|
},
|
|
|
submit() {
|
|
|
if (!this.name) {
|
|
|
@@ -503,26 +524,28 @@ export default {
|
|
|
background-color: @bg;
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
-/deep/ .van-cell {
|
|
|
- --cell-vertical-padding: 23px;
|
|
|
- --cell-horizontal-padding: 20px;
|
|
|
- --field-label-color: #000000;
|
|
|
- --cell-text-color: #000;
|
|
|
- .van-field__label,
|
|
|
- .van-cell__title {
|
|
|
- font-weight: bold;
|
|
|
- width: 70px;
|
|
|
- max-width: 70px !important;
|
|
|
- min-width: 70px !important;
|
|
|
- flex-shrink: 0;
|
|
|
- margin-right: 10px !important;
|
|
|
- }
|
|
|
- .van-cell__value {
|
|
|
- text-align: left;
|
|
|
- }
|
|
|
+/deep/.form {
|
|
|
+ .van-cell {
|
|
|
+ --cell-vertical-padding: 23px;
|
|
|
+ --cell-horizontal-padding: 20px;
|
|
|
+ --field-label-color: #000000;
|
|
|
+ --cell-text-color: #000;
|
|
|
+ .van-field__label,
|
|
|
+ .van-cell__title {
|
|
|
+ font-weight: bold;
|
|
|
+ width: 70px;
|
|
|
+ max-width: 70px !important;
|
|
|
+ min-width: 70px !important;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 10px !important;
|
|
|
+ }
|
|
|
+ .van-cell__value {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
|
|
|
- &::after {
|
|
|
- left: 100px !important;
|
|
|
+ &::after {
|
|
|
+ left: 100px !important;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.addorder {
|
|
|
@@ -712,4 +735,13 @@ export default {
|
|
|
color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+/deep/ .van-dropdown-item {
|
|
|
+ .van-cell {
|
|
|
+ .van-cell__title {
|
|
|
+ width: 200px;
|
|
|
+ max-width: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|