xuqiang 4 yıl önce
ebeveyn
işleme
7efa53dd80

+ 4 - 15
src/pages/Home.vue

@@ -26,7 +26,7 @@
                     <van-field
                         @confirm="searchData"
                         :value="searchVal"
-                        @clear="clear"
+                        @change="change"
                         type="text"
                         clearable
                         placeholder="搜索拼箱..."
@@ -99,17 +99,6 @@ export default {
             columns: []
         };
     },
-    // watch: {
-    //     search: {
-    //         handler: function(newVal) {
-    //             console.log(newVal);
-    //             if (newVal) {
-    //                 console.log(111);
-    //                 this.getData();
-    //             }
-    //         }
-    //     }
-    // },
     computed: {
         bgImg() {
             let info = [...this.columns].find(item => {
@@ -208,10 +197,10 @@ export default {
             this.search = e.detail;
             this.getData();
         },
-        clear() {
+        change(e) {
             this.collectionId = 0;
-            this.searchVal = '';
-            this.search = '';
+            this.searchVal = e.detail;
+            this.search = e.detail;
             this.getData();
         },
         showSeries(type = 'series') {

+ 9 - 1
src/pages/allselldetails.vue

@@ -378,7 +378,15 @@ export default {
                     this.Boxes = res.cardBoxList;
                     this.orderInfoId = res.id;
                     this.postage = res.cardCase.postage;
-                    this.cardCaseInfo = res.cardCase.collection;
+                    if (res.cardCase.customName) {
+                        this.cardCaseInfo = res.cardCase;
+                        this.cardCaseInfo.name = res.cardCase.customName;
+                        this.cardCaseInfo.images = res.cardCase.images;
+                    } else {
+                        this.cardCaseInfo = res.cardCase;
+                        this.cardCaseInfo.name = res.cardCase.collection.name;
+                        this.cardCaseInfo.images = res.cardCase.collection.images;
+                    }
                     if (this.status.orderStatus === 'CREATED') {
                         this.status.label = '买家待支付';
                         this.initTime(this.orderInfoId, this.status.createdAt);

+ 10 - 3
src/pages/confirmorder.vue

@@ -166,14 +166,21 @@ export default {
                 })
                 .then(res => {
                     this.hideLoading();
-                    // console.log(res);
+                    console.log(res);
                     this.total = res.total;
                     this.store = res.store;
                     // console.log(this.store);
                     this.Boxes = res.selectedBoxes;
                     this.postage = res.selectedCase.postage;
-                    // console.log(this.postage);
-                    this.cardCaseInfo = res.selectedCase.collection;
+                    this.cardCaseInfo = res.selectedCase;
+                    if (this.cardCaseInfo.customName) {
+                        this.cardCaseInfo = res.selectedCase;
+                        this.cardCaseInfo.name = res.selectedCase.customName;
+                        this.cardCaseInfo.images = res.selectedCase.images;
+                    } else {
+                        this.cardCaseInfo.name = res.selectedCase.collection.name;
+                        this.cardCaseInfo.images = res.selectedCase.collection.images;
+                    }
                 })
                 .catch(e => {
                     this.hideLoading();

+ 54 - 28
src/pages/details.vue

@@ -81,7 +81,7 @@
                         @click="preview(item.image, getImgs(cardList))"
                         alt=""
                     />
-                    <!-- <p class="swiper-itemText">{{ item.cardName }}</p> -->
+                    <p class="swiper-itemText">×{{ index }}</p>
                 </swiper-item>
             </template>
         </swiper>
@@ -99,6 +99,7 @@
                         @click="preview(item.image, getImgs(defaultCards))"
                         alt=""
                     />
+                    <p class="swiper-itemTexts">×{{ index }}</p>
                 </div>
             </div>
             <div v-if="collectFlag" class="btn" @click="add">查看全部</div>
@@ -110,6 +111,10 @@
             2.带有“直播开箱”的拼箱商品,是指当拼箱成团后,店家会实时直播开箱,原箱开封,把所有卡包拆开确认卡片内容,买家可以在小程序上观看直播<br />
             3.拼箱商品支付成功后不支持退款退货,请谨慎、理智购买<br />
         </div>
+        <div :style="{ top: '68%' }" @click="result" class="open-btn">
+            <div class="txt1">已开</div>
+            <div>福袋</div>
+        </div>
         <div class="box-footer">
             <card-case
                 ref="cardCase"
@@ -135,10 +140,10 @@
                     </div>
                 </div>
                 <div class="box-footer-right">
-                    <van-button v-if="cardCaseInfo.caseStatus == 'FINISH'" type="warning" @click="result"
+                    <!-- <van-button v-if="cardCaseInfo.caseStatus == 'FINISH'" type="warning" @click="result"
                         >查看结果</van-button
-                    >
-                    <van-button v-else type="warning" @click="purchase">立即购买</van-button>
+                    > -->
+                    <div class="btn" type="warning" @click="purchase">立即购买</div>
                 </div>
             </div>
         </div>
@@ -304,17 +309,26 @@ export default {
 </script>
 <style lang="less" scoped>
 .container {
-    /deep/ .van-button {
-        width: 210px;
-        height: 48px;
-        background: #ff6c00;
-        font-size: 16px;
-        font-weight: 400;
-        color: #ffffff;
-    }
     /deep/ .indicator-dots {
         overflow: hidden;
     }
+    .open-btn {
+        position: fixed;
+        right: 0;
+        top: 50%;
+        width: 58px;
+        height: 58px;
+        border-radius: 50%;
+        background: #ff6c00;
+        text-align: center;
+        line-height: 50px;
+        color: #fff;
+        font-size: 15px;
+        .txt1 {
+            height: 0;
+            margin: -5px 0 18px 0;
+        }
+    }
     padding: 15px 20px 150px 20px;
     .bottom(150px);
     img {
@@ -380,12 +394,20 @@ export default {
         .flex();
         flex-wrap: wrap;
         width: 342px !important;
-        margin: -5px 0 20px 0;
+        margin: -5px 0 12px 0;
+        position: relative;
         .img {
             width: 75px;
             height: 110px;
             margin: 0 5px;
         }
+        .swiper-itemTexts {
+            position: absolute;
+            color: #fff;
+            font-size: 13px;
+            font-weight: bold;
+            margin: -24px 0 0 34px;
+        }
     }
     ._img:nth-child(3) {
         padding: 0;
@@ -396,21 +418,16 @@ export default {
     //     display: flex;
     //     justify-content: center;
     // }
-    // .swiper-itemText {
-    //     position: absolute;
-    //     left: 5px;
-    //     right: 5px;
-    //     bottom: 0px;
-    //     font-size: 12px;
-    //     color: #fff;
-    //     font-weight: bold;
-    //     overflow: hidden;
-    //     text-overflow: ellipsis;
-    //     white-space: nowrap;
-    //     background-color: rgba(0, 0, 0, 0.6);
-    //     line-height: 32px;
-    //     text-align: center;
-    // }
+    .swiper-itemText {
+        position: absolute;
+        left: 5px;
+        right: 5px;
+        bottom: 3px;
+        font-size: 13px;
+        color: #fff;
+        font-weight: bold;
+        text-align: center;
+    }
     // .customDots .customDots-item {
     //     margin: 0 8px;
     //     width: 8px;
@@ -634,6 +651,15 @@ export default {
             }
             .box-footer-right {
                 margin-left: 46px;
+                .btn {
+                    width: 210px;
+                    height: 48px;
+                    background: #ff6c00;
+                    font-size: 16px;
+                    font-weight: 400;
+                    color: #ffffff;
+                    line-height: 48px;
+                }
             }
         }
     }

+ 10 - 1
src/pages/orderdetails.vue

@@ -313,7 +313,16 @@ export default {
                     this.Boxes = res.cardBoxList;
                     this.orderInfoId = res.id;
                     this.postage = res.cardCase.postage;
-                    this.cardCaseInfo = res.cardCase.collection;
+                    // this.cardCaseInfo = res.cardCase;
+                    if (res.cardCase.customName) {
+                        this.cardCaseInfo = res.cardCase;
+                        this.cardCaseInfo.name = res.cardCase.customName;
+                        this.cardCaseInfo.images = res.cardCase.images;
+                    } else {
+                        this.cardCaseInfo = res.cardCase;
+                        this.cardCaseInfo.name = res.cardCase.collection.name;
+                        this.cardCaseInfo.images = res.cardCase.collection.images;
+                    }
                     if (this.status.orderStatus === 'CREATED') {
                         this.status.label = '待支付';
                         this.initTime(this.orderInfoId, this.status.createdAt);

+ 73 - 61
src/pages/store/productEdit.vue

@@ -10,7 +10,7 @@
 <template>
     <div class="addorder">
         <van-cell-group :border="false" class="form">
-            <van-field
+            <!-- <van-field
                 label="卡牌名称"
                 :value="name"
                 placeholder="请输入卡牌名称"
@@ -18,7 +18,16 @@
                 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"
@@ -183,17 +192,18 @@ export default {
     data() {
         return {
             form: {
-                collectionId: '',
-                seriesId: '',
+                // collectionId: '',
+                // seriesId: '',
                 code: 1,
                 id: '',
+                name: '',
                 postage: '',
                 // boxesCount: null,
                 boxPrice: '',
                 startTime: '',
                 description: '',
                 packagesCount: null,
-                caseStatus: 'PROGRESS',
+                caseStatus: 'UNDO',
                 cardCaseId: '',
                 special: false,
                 limitOne: false,
@@ -207,11 +217,11 @@ export default {
             newShow: false,
             showId: false,
             id: 0,
-            // images: [],
-            // cardList: [],
-            // imagesList: [],
-            // imageUrls: [],
-            // nowChooseId: [],
+            images: [],
+            cardList: [],
+            imagesList: [],
+            imageUrls: [],
+            nowChooseId: [],
             sotrId: [],
             list: [],
             actions: [],
@@ -357,6 +367,7 @@ export default {
                 }
                 this.form = {
                     id: res.id,
+                    name: res.name,
                     boxPrice: res.boxPrice,
                     groupDTOS: res.groupDTOS,
                     startTime: res.startTime,
@@ -366,16 +377,16 @@ export default {
                     collectionId: res.collectionId,
                     caseStatus: res.caseStatus,
                     packagesCount: res.packagesCount,
-                    postage: res.postage || 0
-                    // images: res.images,
+                    postage: res.postage || 0,
+                    images: res.images
                     // boxesCount: res.boxesCount || null
                 };
-                // this.images = res.images.split(',').map(item => {
-                //     return {
-                //         url: item
-                //     };
-                // });
-                // this.imageUrls = res.images.split(',');
+                this.images = res.images.split(',').map(item => {
+                    return {
+                        url: item
+                    };
+                });
+                this.imageUrls = res.images.split(',');
             });
         },
         select(e) {
@@ -444,42 +455,42 @@ export default {
                     });
                 });
         },
-        // afterRead(file) {
-        //     this.showLoading();
-        //     this.$http
-        //         .uploadFile(file.path)
-        //         .then(res => {
-        //             if (this.images.length > 2) {
-        //                 this.toast('最多上传三张图片');
-        //                 return;
-        //             }
-        //             this.hideLoading();
-        //             this.imagesList.push({ ...file, url: res });
-        //             this.images = [...this.imagesList];
-        //             this.imageUrls.push(res);
-        //             // console.log(this.images);
-        //         })
-        //         .catch(e => {
-        //             this.hideLoading();
-        //             wx.showToast({
-        //                 icon: 'none',
-        //                 title: e.error
-        //             });
-        //         });
-        // },
-        // deleteImg(e) {
-        //     let list = [...this.images];
-        //     list.splice(e.detail.index, 1);
-        //     this.images = list;
-        //     this.imageUrls = list.map(item => {
-        //         return item.url;
-        //     });
-        // },
+        afterRead(file) {
+            this.showLoading();
+            this.$http
+                .uploadFile(file.path)
+                .then(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.images);
+                })
+                .catch(e => {
+                    this.hideLoading();
+                    wx.showToast({
+                        icon: 'none',
+                        title: e.error
+                    });
+                });
+        },
+        deleteImg(e) {
+            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) {
+            if (!this.form.name) {
                 wx.showToast({
                     icon: 'none',
-                    title: '请选择卡牌名称'
+                    title: '请填写卡牌名称'
                 });
                 return;
             }
@@ -504,16 +515,17 @@ export default {
             //     });
             //     return;
             // }
-            // if (this.imageUrls.length == 0) {
-            //     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(',');
-            // cardCaseInputDTO.images = images;
+            let images = this.imageUrls.join(',');
+            // let images = this.imageUrls;
+            cardCaseInputDTO.images = images;
             console.log(cardCaseInputDTO);
             this.showLoading();
             this.$http
@@ -537,8 +549,8 @@ export default {
                         caseStatus: res.caseStatus,
                         limitOne: res.limitOne,
                         packagesCount: res.packagesCount,
-                        postage: res.postage || 0
-                        // images: res.images,
+                        postage: res.postage || 0,
+                        images: res.images
                         // boxesCount: res.boxesCount || null
                     };
                     wx.showToast({