xuqiang 4 лет назад
Родитель
Сommit
793bcd0b13
3 измененных файлов с 632 добавлено и 191 удалено
  1. 165 0
      src/mixins/plugins/http.js
  2. 26 27
      src/pages/addBlessing.vue
  3. 441 164
      src/pages/store/productEdit.vue

+ 165 - 0
src/mixins/plugins/http.js

@@ -0,0 +1,165 @@
+const baseUrl = process.env.VUE_APP_BASE_URL;
+function parseUrl(url) {
+    let _baseUrl = baseUrl;
+    if (url.startsWith('http')) {
+        return url;
+    }
+    if (!_baseUrl.endsWith('/')) {
+        _baseUrl += '/';
+    }
+    if (url.startsWith('/')) {
+        url = url.slice(1);
+    }
+    return _baseUrl + url;
+}
+const http = {
+    parseUrl: parseUrl,
+    setToken(token) {
+        wx.setStorageSync('token', token);
+        this.token = token;
+    },
+    clearToken() {
+        this.token = '';
+        wx.removeStorageSync('token');
+        console.log('clear token');
+    },
+    getToken() {
+        if (!this.token) {
+            try {
+                this.token = wx.getStorageSync('token');
+            } catch (e) {}
+        }
+        return this.token;
+    },
+    get(url, params, options) {
+        options = options || {};
+        return new Promise((resolve, reject) => {
+            wx.request({
+                method: 'GET',
+                url: parseUrl(url),
+                data: params,
+                dataType: 'json',
+                header: {
+                    Accept: 'application/json',
+                    Authorization: this.getToken() ? 'Bearer ' + this.getToken() : 'Bearer ',
+                    ...(options.header || {})
+                },
+                success(res) {
+                    if (res && res.statusCode === 200) {
+                        resolve(res.data);
+                    } else {
+                        reject(res.data || res);
+                    }
+                },
+                fail(err) {
+                    reject(err.data || err);
+                }
+            });
+        });
+    },
+    post(url, data, options, backHeader = false) {
+        console.log('post');
+        options = options || {};
+        return new Promise((resolve, reject) => {
+            wx.request({
+                method: 'post',
+                url: parseUrl(url),
+                data: data,
+                dataType: 'json',
+                header: {
+                    Accept: 'application/json',
+                    'content-type': 'application/x-www-form-urlencoded',
+                    Authorization: this.getToken() ? 'Bearer ' + this.getToken() : '',
+                    ...(options.header || {})
+                },
+                success(res) {
+                    if (res && res.statusCode === 200) {
+                        resolve(backHeader ? res : res.data);
+                    } else {
+                        reject(res.data || res);
+                    }
+                },
+                fail(err) {
+                    reject(err.data || err);
+                }
+            });
+        });
+    },
+    postJson(url, data, options, backHeader = false) {
+        options = options || {};
+        return new Promise((resolve, reject) => {
+            wx.request({
+                method: 'post',
+                url: parseUrl(url),
+                data: data,
+                dataType: 'json',
+                header: {
+                    Accept: 'application/json',
+                    'Content-Type': 'application/json',
+                    Authorization: this.getToken() ? 'Bearer ' + this.getToken() : '',
+                    ...(options.header || {})
+                },
+                success(res) {
+                    if (res && res.statusCode === 200) {
+                        resolve(backHeader ? res : res.data);
+                    } else {
+                        reject(res.data || res);
+                    }
+                },
+                fail(err) {
+                    reject(err.data || err);
+                }
+            });
+        });
+    },
+    uploadFile(filePath, options) {
+        options = options || {};
+        return new Promise((resolve, reject) => {
+            wx.uploadFile({
+                url: baseUrl + '/upload/file',
+                filePath: filePath,
+                name: 'file',
+                header: {
+                    Accept: 'application/json',
+                    'content-type': 'application/x-www-form-urlencoded',
+                    Authorization: this.getToken() ? 'Bearer ' + this.getToken() : '',
+                    ...(options.header || {})
+                },
+                formData: options.formData || {},
+                success(res) {
+                    if (res && res.statusCode === 200) {
+                        try {
+                            resolve(res.data);
+                        } catch (e) {
+                            reject(e);
+                        }
+                    } else {
+                        reject(res);
+                    }
+                },
+                fail(err) {
+                    reject(err);
+                }
+            });
+        });
+    }
+};
+export default {
+    http: http,
+    install(_Vue) {
+        _Vue.prototype.$baseUrl = baseUrl;
+        _Vue.prototype.$http = http;
+        _Vue.prototype.$request = options => {
+            options = options || {};
+            options.url = parseUrl(options.url);
+            return new Promise((resolve, reject) => {
+                options.success = res => {
+                    resolve(res);
+                };
+                options.success = err => {
+                    reject(err);
+                };
+            });
+        };
+    }
+};

+ 26 - 27
src/pages/addBlessing.vue

@@ -6,7 +6,7 @@
 </config>
 <template>
     <div class="container">
-        <div v-if="Flag">
+        <div v-if="flag">
             <div class="top">
                 <div class="txt1">福袋总数量</div>
                 <div class="txt2">当前{{ cardList.length }}个福袋</div>
@@ -16,15 +16,15 @@
                 <div v-for="(item, index) in cardList" :key="index">
                     <div class="con">
                         <div class="con-l">
-                            <img src="../native/svgs/icon_fenxiang.svg" alt="" />
+                            <img :src="item.images" alt="" />
                             <span>{{ item.name }}</span>
                         </div>
-                        <p>x{{ item.num }}</p>
+                        <p>x{{ item.boxesCount }}</p>
                     </div>
                     <div class="bor"></div>
                 </div>
             </div>
-            <div class="add" @click="Flag = false">
+            <div class="add" @click="addCon">
                 <img src="../native/tabbar/icon_shangchuan@3x.png" alt="" />
                 <p>点击添加</p>
             </div>
@@ -54,7 +54,7 @@
             <div class="tit">福袋细节图</div>
             <van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg" />
             <div class="bottom">
-                <van-button type="primary" block @click="Flag = true">完成</van-button>
+                <van-button type="primary" block @click="submit">完成</van-button>
             </div>
         </div>
     </div>
@@ -63,24 +63,8 @@
 export default {
     data() {
         return {
-            cardList: [
-                {
-                    name: '宝可梦',
-                    num: 2,
-                    id: 1
-                },
-                {
-                    name: '皮卡丘',
-                    num: 3,
-                    id: 2
-                },
-                {
-                    name: '小火龙',
-                    num: 1,
-                    id: 3
-                }
-            ],
-            Flag: true,
+            cardList: [],
+            flag: true,
             form: { name: '', boxesCount: '' },
             images: [],
             imagesList: [],
@@ -97,18 +81,21 @@ export default {
             );
         },
         afterRead(file) {
+            console.log(111);
             this.showLoading();
             this.$http
                 .uploadFile(file.path)
                 .then(res => {
-                    if (this.images.length > 0) {
-                        this.toast('最多上传一张图片');
-                        return;
-                    }
+                    console.log(res);
+                    // if (this.images.length > 0) {
+                    //     this.toast('最多上传一张图片');
+                    //     return;
+                    // }
                     this.hideLoading();
                     this.imagesList.push({ ...file, url: res });
                     this.images = [...this.imagesList];
                     this.imageUrls.push(res);
+                    console.log(this.imageUrls);
                 })
                 .catch(e => {
                     this.hideLoading();
@@ -125,6 +112,18 @@ export default {
             this.imageUrls = list.map(item => {
                 return item.url;
             });
+        },
+        addCon() {
+            this.flag = false;
+            this.form.name = '';
+            this.form.boxesCount = '';
+            this.imageUrls = '';
+        },
+        submit() {
+            let cardLists = { name: this.form.name, boxesCount: this.form.boxesCount, images: this.imageUrls };
+            this.cardList.push(cardLists);
+            console.log(this.cardList);
+            this.flag = true;
         }
     }
 };

+ 441 - 164
src/pages/store/productEdit.vue

@@ -9,44 +9,54 @@
 </config>
 <template>
     <div class="addorder">
-        <van-cell-group :border="false" class="form">
-            <van-field
-                label="卡牌名称"
-                :value="name"
-                placeholder="请输入卡牌名称"
-                is-link
-                readonly
-                @click="pickerShow('show')"
-            >
-            </van-field>
-            <!-- <van-field
-                label="卡牌名称"
-                type="digit"
-                :value="form.name"
-                @input="form.name = $event.detail"
-                placeholder="请输入卡牌名称"
-            >
-            </van-field>
-            <van-uploader style="padding-left:20px" :file-list="images" :after-read="afterRead" @delete="deleteImg" /> -->
-            <van-field
-                label="卡牌售价"
-                type="digit"
-                :value="form.boxPrice"
-                @input="form.boxPrice = $event.detail"
-                placeholder="请输入金额"
-            >
-                <span slot="right-icon">元</span>
-            </van-field>
-            <van-field
-                label="拼箱结束"
-                is-link
-                :value="form.startTime"
-                placeholder="请输入结束日期"
-                @click="pickerShow('newShow')"
-                readonly
-            >
-            </van-field>
-            <!-- <van-field
+        <div v-if="flag">
+            <van-cell-group :border="false" class="form">
+                <div v-if="time != 4">
+                    <van-field
+                        label="卡牌名称"
+                        :value="name"
+                        placeholder="请输入卡牌名称"
+                        is-link
+                        readonly
+                        @click="pickerShow('show')"
+                    >
+                    </van-field>
+                </div>
+                <div v-else>
+                    <van-field
+                        label="卡牌名称"
+                        type="digit"
+                        :value="form.name"
+                        @input="form.name = $event.detail"
+                        placeholder="请输入卡牌名称"
+                    >
+                    </van-field>
+                    <van-uploader
+                        style="padding-left:20px"
+                        :file-list="images"
+                        :after-read="afterRead"
+                        @delete="deleteImg"
+                    />
+                </div>
+                <van-field
+                    label="卡牌售价"
+                    type="digit"
+                    :value="form.boxPrice"
+                    @input="form.boxPrice = $event.detail"
+                    placeholder="请输入金额"
+                >
+                    <span slot="right-icon">元</span>
+                </van-field>
+                <van-field
+                    label="拼箱结束"
+                    is-link
+                    :value="form.startTime"
+                    placeholder="请输入结束日期"
+                    @click="pickerShow('newShow')"
+                    readonly
+                >
+                </van-field>
+                <!-- <van-field
                 label="拼箱人数"
                 type="number"
                 :value="form.boxesCount"
@@ -54,58 +64,54 @@
                 placeholder="请输入参加人数"
             >
             </van-field> -->
-            <van-field
-                label="邮费"
-                type="digit"
-                :value="form.postage"
-                @input="form.postage = $event.detail"
-                placeholder="请输入邮费"
-            >
-                <span slot="right-icon">元</span>
-            </van-field>
-            <div v-if="time == 4" @click="navigateTo('/pages/addBlessing')">
                 <van-field
-                    label="福袋管理"
-                    is-link
-                    :value="form.boxesCount"
-                    @input="form.boxesCount = $event.detail"
+                    label="邮费"
                     type="digit"
+                    :value="form.postage"
+                    @input="form.postage = $event.detail"
+                    placeholder="请输入邮费"
                 >
-                    <span slot="right-icon">{{ !addBlessing ? '去添加' : `已新增${addBlessingNum}个福袋` }}</span>
+                    <span slot="right-icon">元</span>
                 </van-field>
-            </div>
-        </van-cell-group>
-        <div class="box-con">
-            <div class="box-top">
-                <div class="top">
-                    <span>限购选择</span>
+                <div v-if="time == 4" @click="flag = false">
+                    <van-field label="福袋管理" is-link readonly>
+                        <span slot="right-icon" v-if="cardList.length < 1">去添加</span>
+                        <span slot="right-icon" v-else>已新增{{ cardList.length }}个福袋</span>
+                        <!-- <span slot="right-icon">{{ !!cardList ? `已新增${cardList.length}个福袋` : '去添加' }}</span> -->
+                    </van-field>
                 </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="label">卡牌细节图</div>
-            <van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg" /> -->
-            <div v-if="!showId">
+            </van-cell-group>
+            <div class="box-con">
                 <div class="box-top">
                     <div class="top">
-                        <span>选择卡包</span>
+                        <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 direction="up">
+                                <van-dropdown-item @change="onChange" :value="times" :options="option2" />
                             </van-dropdown-menu>
                         </div>
                     </van-sticky>
                 </div>
-                <!-- <div class="box" v-if="switchs">
+            </div>
+            <div class="box-con">
+                <!-- <div class="label">卡牌细节图</div>
+            <van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg" /> -->
+                <div v-if="!showId">
+                    <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">
                         <div class="right">
                             <div class="tool-item">
@@ -127,12 +133,12 @@
                         </div>
                     </div>
                 </div> -->
-            </div>
+                </div>
 
-            <div class="box" v-else>
-                <div class="top2">
-                    <span>已售/总数</span>
-                    <!-- <div class="right">
+                <div class="box" v-else>
+                    <div class="top2">
+                        <span>已售/总数</span>
+                        <!-- <div class="right">
                         <div class="tool-item">
                             出售中
                         </div>
@@ -140,9 +146,9 @@
                             下架
                         </div>
                     </div> -->
-                </div>
-                <div style="margin-top:10px">{{ soldStatus }}</div>
-                <!-- <div class="content">
+                    </div>
+                    <div style="margin-top:10px">{{ soldStatus }}</div>
+                    <!-- <div class="content">
                     <div class="card" v-for="(card, index) in form.groupDTOS" :key="index">
                         <div class="card-title">第{{ index + 1 }}组</div>
                         <div class="card-list">
@@ -160,44 +166,104 @@
                         </div>
                     </div>
                 </div> -->
+                </div>
+
+                <div class="label">卡牌详情描述</div>
+                <van-field
+                    :value="form.description"
+                    @input="form.description = $event.detail"
+                    :border="false"
+                    rows="1"
+                    autosize
+                    type="textarea"
+                    placeholder="多多介绍您的卡牌信息,更受欢迎哦"
+                />
             </div>
 
-            <div class="label">卡牌详情描述</div>
-            <van-field
-                :value="form.description"
-                @input="form.description = $event.detail"
-                :border="false"
-                rows="1"
-                autosize
-                type="textarea"
-                placeholder="多多介绍您的卡牌信息,更受欢迎哦"
-            />
-        </div>
+            <div class="btn-list">
+                <div v-if="time != 4" @click="submit">确认上架</div>
+                <div v-else @click="submits">确认上架</div>
+            </div>
+            <van-action-sheet
+                :show="show"
+                description="卡牌名称"
+                cancel-text="取消"
+                :actions="actions"
+                @overlay="overlay = false"
+                @select="select"
+                @cancel="cancel"
+            >
+            </van-action-sheet>
 
-        <div class="btn-list">
-            <div @click="submit">确认上架</div>
+            <van-popup :show="newShow" position="bottom" @close="onClose">
+                <van-datetime-picker
+                    type="datetime"
+                    :value="currentDate"
+                    @confirm="onConfirm"
+                    @cancel="onCancel"
+                    :min-date="minDate"
+                    :max-date="maxDate"
+                />
+            </van-popup>
+        </div>
+        <div v-else class="addImg">
+            <div v-if="flags">
+                <div class="top">
+                    <div class="txt1">福袋总数量</div>
+                    <div class="txt2">当前{{ cardList.length }}个福袋</div>
+                </div>
+                <div class="border"></div>
+                <div v-if="cardList.length > 0">
+                    <div v-for="(item, index) in cardList" :key="index">
+                        <div class="con">
+                            <div class="con-l">
+                                <img :src="item.images" alt="" />
+                                <span>{{ item.name }}</span>
+                            </div>
+                            <p>x{{ item.amount }}</p>
+                        </div>
+                        <div class="bor"></div>
+                    </div>
+                </div>
+                <div class="add" @click="addCon">
+                    <img src="../../native/tabbar/icon_shangchuan@3x.png" alt="" />
+                    <p>点击添加</p>
+                </div>
+                <div class="bottom">
+                    <van-button type="primary" block @click="flag = true">完成</van-button>
+                </div>
+            </div>
+            <div v-else>
+                <van-cell-group :border="false" class="form">
+                    <van-field
+                        label="福袋名称"
+                        type="digit"
+                        :value="forms.name"
+                        @input="forms.name = $event.detail"
+                        placeholder="请输入福袋名称"
+                    >
+                    </van-field>
+                    <van-field
+                        label="数量(个)"
+                        type="number"
+                        :value="forms.amount"
+                        @input="forms.amount = $event.detail"
+                        placeholder="请输入数量"
+                    >
+                    </van-field>
+                </van-cell-group>
+                <div class="tit">福袋细节图</div>
+                <van-uploader
+                    style="margin-left:20px"
+                    :file-list="forms.images"
+                    :after-read="afterReads"
+                    @delete="deleteImgs"
+                />
+                <div class="bottom">
+                    <van-button type="primary" block @click="submitNum">完成</van-button>
+                </div>
+            </div>
         </div>
-        <van-action-sheet
-            :show="show"
-            description="卡牌名称"
-            cancel-text="取消"
-            :actions="actions"
-            @overlay="overlay = false"
-            @select="select"
-            @cancel="cancel"
-        >
-        </van-action-sheet>
-
-        <van-popup :show="newShow" position="bottom" @close="onClose">
-            <van-datetime-picker
-                type="datetime"
-                :value="currentDate"
-                @confirm="onConfirm"
-                @cancel="onCancel"
-                :min-date="minDate"
-                :max-date="maxDate"
-            />
-        </van-popup>
     </div>
 </template>
 <script>
@@ -210,23 +276,24 @@ export default {
                 seriesId: '',
                 code: 1,
                 id: '',
-                // name: '',
+                name: '',
                 postage: '',
-                boxesCount: null,
+                // boxesCount: null,
                 boxPrice: '',
                 startTime: '',
                 description: '',
                 packagesCount: null,
-                // caseStatus: 'UNDO',
-                caseStatus: 'PROGRESS',
                 cardCaseId: '',
                 special: false,
                 limitOne: false,
                 groupDTOS: []
             },
+            forms: { name: '', amount: '', images: [], imagesList: [], imageUrls: [] },
             name: '',
             soldStatus: '',
             show: false,
+            flag: true,
+            flags: true,
             closeFlag: false,
             newShow: false,
             showId: false,
@@ -239,10 +306,11 @@ export default {
             sotrId: [],
             list: [],
             actions: [],
+            cardCaseInputDTOs: [],
             time: 0,
             times: 1,
             typeOptions: [
-                // { id: 4, name: '福袋模式' },
+                { id: 4, name: '福袋模式' },
                 { id: 0, name: '组队模板(24队每队6人)', group: 24, groupCount: 6, special: false },
                 { id: 1, name: '端盒模板(AB组24对)', group: 2, groupCount: 24, special: true },
                 { id: 2, name: '端盒模板(单组24盒)', group: 1, groupCount: 24, special: false },
@@ -272,13 +340,13 @@ export default {
                     value: item.id
                 };
             });
-        },
-        addBlessing() {
-            return this.$mp.query.cardList;
-        },
-        addBlessingNum() {
-            return this.$mp.query.num;
         }
+        // addBlessing() {
+        //     return this.$mp.query.cardList;
+        // },
+        // addBlessingNum() {
+        //     return this.$mp.query.num;
+        // }
     },
     watch: {
         show: {
@@ -291,14 +359,15 @@ export default {
         }
     },
     onLoad(options) {
+        console.log(this.addBlessing);
         if (this.$mp.query.id) {
             this.cartBox();
             this.name = options.name;
         } else {
             this.$nextTick(() => {
                 this.change({
-                    detail: 0
-                    // detail: 4
+                    // detail: 0
+                    detail: 4
                 });
             });
         }
@@ -376,6 +445,32 @@ export default {
             this.form.limitOne = nameList.limitOne;
             // console.log(this.form.limitOne);
         },
+        addCon() {
+            this.flags = false;
+            this.forms.name = '';
+            this.forms.amount = '';
+            this.forms.images = '';
+        },
+        submitNum() {
+            if (!this.forms.name) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请填写福袋名称'
+                });
+                return;
+            }
+            if (!this.forms.amount) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请填写福袋数量'
+                });
+                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;
+        },
         // canChoose(info) {
         //     return info.sold;
         // },
@@ -401,7 +496,7 @@ export default {
                     packagesCount: res.packagesCount,
                     postage: res.postage || 0
                     // images: res.images
-                    // boxesCount: res.boxesCount || null
+                    // amount: res.boxesCount || null
                 };
                 this.images = res.images.split(',').map(item => {
                     return {
@@ -491,7 +586,7 @@ export default {
                     this.imagesList.push({ ...file, url: res });
                     this.images = [...this.imagesList];
                     this.imageUrls.push(res);
-                    // console.log(this.images);
+                    console.log(this.images);
                 })
                 .catch(e => {
                     this.hideLoading();
@@ -509,21 +604,42 @@ export default {
                 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
+                        });
+                    });
+            });
+        },
+
+        deleteImgs(e) {
+            let list = [...this.forms.images];
+            list.splice(e.detail.index, 1);
+            this.forms.images = list;
+            this.forms.imageUrls = list.map(item => {
+                return item.url;
+            });
+        },
         submit() {
-            if (!this.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',
@@ -538,24 +654,10 @@ export default {
                 });
                 return;
             }
-            // if (!this.form.boxesCount) {
-            //     wx.showToast({
-            //         icon: 'none',
-            //         title: '请选拼箱人数'
-            //     });
-            //     return;
-            // }
-            // if (this.imageUrls.length == 0) {
-            //     wx.showToast({
-            //         icon: 'none',
-            //         title: '请添加图片'
-            //     });
-            //     return;
-            // }
             let cardCaseInputDTO = { ...this.form };
-            // let images = this.imageUrls.join(',');
-            // let images = this.imageUrls;
-            // cardCaseInputDTO.images = images;
+            let caseStatus = 'PROGRESS';
+            delete this.form.name;
+            cardCaseInputDTO.caseStatus = caseStatus;
             console.log(cardCaseInputDTO);
             this.showLoading();
             this.$http
@@ -598,6 +700,94 @@ export default {
                     });
                 });
         },
+        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;
+            // }
+            let newJackpot = {};
+            this.cardList.map(item => {
+                newJackpot.name = item.name;
+                newJackpot.images = item.images;
+                newJackpot.amount = item.amount;
+            });
+            // this.$set(newJackpot, cardCaseInputDTO);
+            let caseStatus = 'UNDO';
+            delete this.form.collectionId;
+            delete this.form.seriesId;
+            delete this.form.groupDTOS;
+            let cardCaseInputDTO = { ...this.form };
+            // let images = this.imageUrls.join(',');
+            let images = this.imageUrls;
+            cardCaseInputDTO.images = images;
+            cardCaseInputDTO.caseStatus = caseStatus;
+            console.log(this.cardList);
+            console.log(this.cardCaseInputDTOs);
+            console.log(cardCaseInputDTO);
+            // this.showLoading();
+            // this.$http
+            //     .post('/cardCase/save', cardCaseInputDTO, {
+            //         header: {
+            //             'Content-Type': 'application/json'
+            //         }
+            //     })
+            //     .then(res => {
+            //         // console.log(res);
+            //         this.id = res.id;
+            //         this.hideLoading();
+            //         this.form = {
+            //             id: res.id,
+            //             boxPrice: res.boxPrice,
+            //             special: res.special,
+            //             groupDTOS: res.groupDTOS,
+            //             startTime: res.startTime,
+            //             description: res.description,
+            //             collectionId: res.collectionId,
+            //             caseStatus: res.caseStatus,
+            //             limitOne: res.limitOne,
+            //             packagesCount: res.packagesCount,
+            //             postage: res.postage || 0
+            //             // images: res.images
+            //         };
+            //         wx.showToast({
+            //             title: '商品上架成功'
+            //         });
+            //         setTimeout(() => {
+            //             this.navigateBack();
+            //         }, 1000);
+            //     })
+            //     .catch(e => {
+            //         this.hideLoading();
+            //         wx.showToast({
+            //             icon: 'none',
+            //             title: e.error
+            //         });
+            //     });
+        },
         pickerShow(key = 'show') {
             this[key] = true;
             wx.hideKeyboard();
@@ -803,6 +993,93 @@ export default {
             }
         }
     }
+    .addImg {
+        .top {
+            .flex();
+            justify-content: space-between;
+            padding: 0 20px;
+            margin-top: 23px;
+            .txt1 {
+                font-size: 14px;
+                font-weight: 500;
+                color: #000000;
+                line-height: 24px;
+            }
+            .txt2 {
+                font-size: 13px;
+                font-weight: 400;
+                color: #aaabad;
+                line-height: 24px;
+            }
+        }
+        .border {
+            width: 375px;
+            height: 5px;
+            background: #f5f7fa;
+            margin: 23px 0 20px 0;
+        }
+        .con {
+            .flex();
+            padding: 0 20px;
+            justify-content: space-between;
+            img {
+                width: 62px;
+                height: 90px;
+                border-radius: 6px;
+                padding-right: 10px;
+            }
+            .con-l {
+                .flex();
+                span {
+                    font-size: 14px;
+                    font-weight: bold;
+                    color: #000000;
+                    line-height: 24px;
+                }
+            }
+            p {
+                font-size: 16px;
+                font-weight: 400;
+                color: #000000;
+                line-height: 24px;
+            }
+        }
+        .bor {
+            height: 1px;
+            background: #f5f7fa;
+            margin: 20px 20px 0 20px;
+        }
+        .add {
+            text-align: center;
+            img {
+                width: 24px;
+                height: 24px;
+                margin-top: 30px;
+            }
+            p {
+                font-size: 13px;
+                font-weight: 500;
+                color: #ff6c00;
+                line-height: 24px;
+            }
+        }
+        .tit {
+            font-size: 14px;
+            font-weight: bold;
+            color: #000000;
+            line-height: 24px;
+            margin: 23px 0 18px 20px;
+        }
+        .bottom {
+            position: fixed;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            padding: 6px 43px;
+            background-color: #fff;
+            .bottom(6px);
+        }
+    }
 }
 .van-cell {
     line-height: 40px;