Sfoglia il codice sorgente

编辑商品修改

panhui 4 anni fa
parent
commit
1d21e937e9

+ 1 - 1
.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=http://localhost:8080
+VUE_APP_BASE_URL=https://zhuoka.izouma.com

+ 1 - 1
src/components/ProductInfo.vue

@@ -93,7 +93,7 @@ export default {
     },
     methods: {
         manage() {
-            this.navigateTo('/pages/store/productEdit?id=' + this.info.cardCaseId);
+            this.navigateTo('/pages/store/productEdit?id=' + this.info.cardCaseId + '&name=' + this.info.caseName);
         },
         detail() {
             if (this.startChoose) {

+ 15 - 6
src/pages/store/apply.vue

@@ -22,15 +22,15 @@
                 name="店家名称"
                 label="店家名称"
                 placeholder="请输入您店铺的名称"
-                :value="form.storeName"
+                :value="form2.storeName"
                 @input="form.storeName = $event.detail"
             />
             <van-field
-                type="phone"
+                type="number"
                 name="手机号码"
                 label="手机号码"
                 placeholder="请输入您的手机号码"
-                :value="form.phone"
+                :value="form2.phone"
                 @input="form.phone = $event.detail"
             />
 
@@ -38,14 +38,14 @@
                 type="text"
                 label="电子邮箱"
                 placeholder="请输入邮箱"
-                :value="form.email"
+                :value="form2.email"
                 @input="form.email = $event.detail"
             />
             <van-field
-                type="text"
+                type="idcard"
                 label="身份证号"
                 placeholder="请输入18位身份证号"
-                :value="form.idNo"
+                :value="form2.idNo"
                 @input="form.idNo = $event.detail"
             />
 
@@ -78,6 +78,14 @@ export default {
                 idNo: '',
                 idNoImage: '',
                 licenseImage: ''
+            },
+            form2: {
+                storeName: '',
+                phone: '',
+                email: '',
+                idNo: '',
+                idNoImage: '',
+                licenseImage: ''
             }
         };
     },
@@ -148,6 +156,7 @@ export default {
                 })
                 .then(res => {
                     if (!res.empty) {
+                        this.form2 = res.content[0];
                         this.form = res.content[0];
                         this.$refs.idNoImage.setFile(res.content[0].idNoImage);
                         this.$refs.licenseImage.setFile(res.content[0].licenseImage);

+ 1 - 0
src/pages/store/liveProduct.vue

@@ -111,6 +111,7 @@ export default {
             });
         },
         start() {
+            this.showLoading();
             this.$http
                 .post('/live/createRoom', {
                     caseIdsStr: this.chooseIds.join(','),

+ 55 - 23
src/pages/store/productEdit.vue

@@ -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>