xuqiang há 4 anos atrás
pai
commit
85654bcf1b
3 ficheiros alterados com 125 adições e 104 exclusões
  1. 9 4
      src/pages/details.vue
  2. 57 80
      src/pages/store/productEdit.vue
  3. 59 20
      src/pages/unpacking.vue

+ 9 - 4
src/pages/details.vue

@@ -6,7 +6,7 @@
 </config>
 <template>
     <div class="container">
-        <swiper style="height:335px;" :autoplay="true" :indicator-dots="true">
+        <swiper class="swiperImgBox" :autoplay="true" :indicator-dots="true">
             <swiper-item v-for="(item, index) in banners" :key="index">
                 <img :src="item" alt="" />
             </swiper-item>
@@ -318,11 +318,15 @@ export default {
     }
     padding: 15px 20px 150px 20px;
     .bottom(150px);
-    img {
-        width: 335px;
+    .swiperImgBox {
         height: 335px;
-        border-radius: 8px;
+        img {
+            width: 100%;
+            height: 100%;
+            border-radius: 8px;
+        }
     }
+
     .box-tit {
         font-size: 20px;
         font-weight: bold;
@@ -384,6 +388,7 @@ export default {
         .img {
             width: 75px;
             height: 110px;
+            border-radius: 8px;
             margin: 0 5px 4px 5px;
         }
         .swiper-itemTexts {

+ 57 - 80
src/pages/store/productEdit.vue

@@ -57,14 +57,6 @@
                     readonly
                 >
                 </van-field>
-                <!-- <van-field
-                label="拼箱人数"
-                type="number"
-                :value="form.boxesCount"
-                @input="form.boxesCount = $event.detail"
-                placeholder="请输入参加人数"
-            >
-            </van-field> -->
                 <van-field
                     label="邮费"
                     type="digit"
@@ -81,12 +73,7 @@
                             <van-sticky class="index">
                                 <div class="time-box">
                                     <van-dropdown-menu>
-                                        <van-dropdown-item
-                                            class="cell"
-                                            @change="change"
-                                            :value="time"
-                                            :options="option1"
-                                        />
+                                        <van-dropdown-item @change="change" :value="time" :options="option1" />
                                     </van-dropdown-menu>
                                 </div>
                             </van-sticky>
@@ -146,18 +133,11 @@
                 </div> -->
                     </div>
                 </div>
-                <div v-if="time == 4" @click="flag = false">
-                    <van-field label="福袋管理" is-link readonly>
-                        <span slot="right-icon" style="font-size: 14px;" v-if="cardList.length < 1">去添加</span>
-                        <span slot="right-icon" style="font-size: 14px;" v-else>已新增{{ cardList.length }}个福袋</span>
-                        <!-- <span slot="right-icon">{{ !!cardList ? `已新增${cardList.length}个福袋` : '去添加' }}</span> -->
-                    </van-field>
-                </div>
             </van-cell-group>
 
             <div class="box-con">
                 <div class="box-top">
-                    <van-field style="margin:10px 0 10px 4px" :border="false" label="限购选择" readonly> </van-field>
+                    <van-field style="margin:5px 0 8px 2px" :border="false" label="限购选择" readonly> </van-field>
                     <div class="time-box indexs">
                         <van-dropdown-menu>
                             <van-dropdown-item @change="onChange" :value="times" :options="option2" />
@@ -165,8 +145,26 @@
                     </div>
                 </div>
             </div>
+
+            <div class="box-con">
+                <div class="box-top">
+                    <van-field style="margin:5px 0 12px 2px" :border="false" label="是否即开即得" readonly> </van-field>
+                    <div class="time-box indexs">
+                        <van-dropdown-menu>
+                            <van-dropdown-item @change="instantss" :value="values" :options="option3" />
+                        </van-dropdown-menu>
+                    </div>
+                </div>
+            </div>
+            <div class="box-bottom1" v-if="time == 4" @click="flag = false">
+                <van-field label="福袋管理" :border="false" is-link readonly>
+                    <span slot="right-icon" style="font-size: 14px;" v-if="cardList.length < 1">去添加</span>
+                    <span slot="right-icon" style="font-size: 14px;" v-else>已新增{{ cardList.length }}个福袋</span>
+                    <!-- <span slot="right-icon">{{ !!cardList ? `已新增${cardList.length}个福袋` : '去添加' }}</span> -->
+                </van-field>
+            </div>
             <div class="box-bottom">
-                <van-field :border="false" label="卡牌详情描述" readonly> </van-field>
+                <van-field :border="false" label="牌详情描述" readonly> </van-field>
                 <van-field
                     :value="form.description"
                     @input="form.description = $event.detail"
@@ -308,6 +306,7 @@ export default {
             caseJackpots: [],
             time: 0,
             times: 1,
+            values: 1,
             chooseType: null,
             typeOptions: [
                 { id: 4, name: '福袋模式' },
@@ -317,6 +316,7 @@ export default {
                 { id: 3, name: '端盒模板(单组20盒)', group: 1, groupCount: 20, special: false }
             ],
             nameOptions: [{ id: 0, name: '是', limitOne: true }, { id: 1, name: '否', limitOne: false }],
+            instants: [{ id: 0, name: '是', instant: true }, { id: 1, name: '否', instant: false }],
             minDate: new Date(new Date().getFullYear() - 1, 10, 1).getTime(),
             maxDate: new Date(new Date().getFullYear() + 2, 10, 1).getTime(),
             currentDate: new Date().getTime()
@@ -340,6 +340,15 @@ export default {
                     value: item.id
                 };
             });
+        },
+        option3() {
+            let list = [...this.instants];
+            return list.map(item => {
+                return {
+                    text: item.name,
+                    value: item.id
+                };
+            });
         }
     },
     watch: {
@@ -360,9 +369,11 @@ export default {
         } else {
             this.$nextTick(() => {
                 this.change({
-                    // detail: 0
                     detail: 4
                 });
+                this.instantss({
+                    detail: 1
+                });
             });
         }
     },
@@ -437,7 +448,14 @@ export default {
                 return item.id == this.times;
             });
             this.form.limitOne = nameList.limitOne;
-            // console.log(this.form.limitOne);
+            console.log(this.form.limitOne);
+        },
+        instantss(e) {
+            this.values = e.detail;
+            let instants = [...this.instants].find(item => {
+                return item.id == this.values;
+            });
+            this.form.instant = instants.instant;
         },
         add() {
             this.flags = false;
@@ -785,6 +803,7 @@ export default {
                 cardCaseInputDTO.images = images[0].url;
                 cardCaseInputDTO.caseStatus = caseStatus;
                 cardCaseInputDTO.caseJackpots = this.caseJackpots;
+                // console.log(cardCaseInputDTO);
                 this.showLoading();
                 this.$http
                     .post('/cardCase/save', cardCaseInputDTO, {
@@ -841,8 +860,8 @@ export default {
 /deep/.form {
     position: relative;
     .van-cell {
-        --cell-vertical-padding: 20px;
-        --cell-horizontal-padding: 20px;
+        --cell-vertical-padding: 18px;
+        --cell-horizontal-padding: 18px;
         --field-label-color: #000000;
         --cell-text-color: #000;
         .van-field__label,
@@ -857,7 +876,6 @@ export default {
         .van-cell__value {
             // text-align: left;
         }
-
         &::after {
             left: 100px !important;
         }
@@ -892,20 +910,15 @@ export default {
             }
         }
         .box {
-            // padding-right: 20px;
-            // .flex-col();
-            // padding-bottom: 6px;
             .num {
                 margin-left: 20px;
             }
         }
-
         .content {
             flex-grow: 1;
             overflow: auto;
             padding: 0 0 12px;
         }
-
         .top {
             .flex();
             justify-content: space-between;
@@ -947,50 +960,9 @@ export default {
                 }
             }
         }
-        .top2 {
-            .flex();
-            justify-content: space-between;
-            padding: 10px 0;
-            flex-shrink: 0;
-            span {
-                font-size: 14px;
-                font-weight: bold;
-                color: #000000;
-                line-height: 24px;
-            }
-
-            .right {
-                .flex();
-                .tool-item {
-                    font-size: 14px;
-                    color: #000000;
-                    line-height: 24px;
-                    .flex();
-                    margin-left: 30px;
-
-                    &::before {
-                        content: '';
-                        flex-shrink: 0;
-                        width: 16px;
-                        height: 16px;
-                        background: #ffffff;
-                        border-radius: 4px;
-                        border: 1px solid #f5f7fa;
-                        margin-right: 4px;
-                    }
-
-                    &.used {
-                        &::before {
-                            background-color: #939599;
-                        }
-                    }
-                }
-            }
-        }
         .card + .card {
             margin-top: 12px;
         }
-
         .card-title {
             font-size: 14px;
             color: #939599;
@@ -1018,21 +990,17 @@ export default {
                         background-color: #939599;
                         color: #ffffff;
                     }
-
                     &.active {
                         background-color: @prim;
                         color: #ffffff;
                     }
-
                     &:active {
                         opacity: 0.8;
                     }
-
                     &:nth-child(6n + 1) {
                         margin-left: 0 !important;
                     }
                 }
-
                 .card-item + .card-item {
                     margin-left: 10px;
                 }
@@ -1041,12 +1009,21 @@ export default {
     }
     .box-bottom {
         /deep/ .van-field__label {
-            margin-top: 10px;
+            margin: 10px 0 0 2px;
+            font-weight: bold;
+            color: #000;
+            /deep/ .van-field__body {
+                margin-left: 3px !important;
+            }
+        }
+    }
+    .box-bottom1 {
+        /deep/ .van-field__label {
+            margin-left: 2px;
             font-weight: bold;
             color: #000;
         }
     }
-
     .addImg {
         .top {
             .flex();

+ 59 - 20
src/pages/unpacking.vue

@@ -11,10 +11,17 @@
             <div class="product-content">
                 <div class="text1">{{ cardCaseInfo.caseName }}</div>
                 <div class="text2">
-                    <span>已结束</span>
+                    <div class="text2" v-if="cardCaseInfo.caseStatus === 'PROGRESS'">
+                        <span>距结束</span>
+                        <van-count-down class="val" :time="time" format="DD 天 HH:mm:ss" />
+                    </div>
+                    <div v-else>
+                        <span>已结束</span>
+                    </div>
                 </div>
                 <div class="text2">
-                    <span>拼箱已完成</span>
+                    <span>已拼箱</span>
+                    <span class="val">{{ cardCaseInfo.preorder || 0 }}/{{ cardCaseInfo.total || 0 }}</span>
                 </div>
                 <div class="flex1"></div>
                 <div class="price">
@@ -22,37 +29,56 @@
                     <span>{{ cardCaseInfo.price }}</span>
                 </div>
                 <div class="button">
-                    <van-button type="info" size="small">已开箱</van-button>
+                    <van-button v-if="cardCaseInfo.caseStatus === 'PROGRESS'" type="primary" size="small"
+                        >立即拼箱</van-button
+                    >
+                    <van-button v-else type="info" size="small">已结束</van-button>
                 </div>
             </div>
         </div>
         <div class="border"></div>
         <h3>开箱记录</h3>
-        <div class="box" v-for="(card, index) in cardList" :key="index">
-            <div class="box-tit">
-                <van-image width="30" height="30" :src="card.avatar" fit="cover" radius="16" />
-                <p>{{ card.userName }}</p>
-            </div>
-            <div class="border"></div>
-            <div class="box-con-Cards" v-for="item in card.details" :key="item">
-                <van-image width="60" height="90" :src="item.image" fit="cover" radius="6" />
-                <div class="box-con-right">
-                    <p class="box-con-tit">{{ item.cardName }}</p>
-                    <div class="box-con-today">
-                        <p>卡盒选号:{{ card.boxName }}</p>
-                    </div>
-                    <div class="box-con-money">
-                        <div class="box-con-num">
-                            <!-- <p>¥{{ item.value }}</p> -->
+        <div v-if="cardCaseInfo.caseStatus == 'FINISH' || cardCaseInfo.instant">
+            <div class="box" v-for="(card, index) in cardList" :key="index">
+                <div class="box-tit">
+                    <van-image width="30" height="30" :src="card.avatar" fit="cover" radius="16" />
+                    <p>{{ card.userName }}</p>
+                </div>
+                <div class="border"></div>
+                <div class="box-con-Cards" v-for="item in card.details" :key="item">
+                    <van-image width="60" height="90" :src="item.image" fit="cover" radius="6" />
+                    <div class="box-con-right">
+                        <p class="box-con-tit">{{ item.cardName }}</p>
+                        <div class="box-con-today">
+                            <p>卡盒选号:{{ card.boxName }}</p>
+                        </div>
+                        <div class="box-con-money">
+                            <div class="box-con-num">
+                                <!-- <p>¥{{ item.value }}</p> -->
+                            </div>
+                            <p>×{{ item.amount }}</p>
                         </div>
-                        <p>×{{ item.amount }}</p>
                     </div>
                 </div>
             </div>
+            <van-empty
+                v-if="cardList.length == 0"
+                image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_wukabao.png"
+                description="暂无开奖记录哦~"
+            >
+            </van-empty>
+        </div>
+        <div v-else>
+            <van-empty
+                image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_wukabao.png"
+                description="暂无开奖记录哦~"
+            >
+            </van-empty>
         </div>
     </div>
 </template>
 <script>
+import dayjs from 'dayjs';
 export default {
     data() {
         return {
@@ -61,12 +87,24 @@ export default {
             cardImg: []
         };
     },
+    computed: {
+        time() {
+            if (this.cardCaseInfo.endTime) {
+                let date = dayjs(this.cardCaseInfo.endTime, 'YYYY-MM-DD HH:mm:ss');
+
+                return date.diff(dayjs());
+            } else {
+                return 0;
+            }
+        }
+    },
     methods: {
         getFn() {
             this.showLoading();
             this.$http
                 .get('/cardCase/showInfoMA?caseId=' + this.$mp.options.id)
                 .then(res => {
+                    console.log(res);
                     this.hideLoading();
                     this.cardCaseInfo = res.cardCaseInfo || {};
                     this.cardImg = res.cardCaseInfo.images[0];
@@ -80,6 +118,7 @@ export default {
             this.$http
                 .post('/caseResult/getResult', { caseId: this.$mp.options.id })
                 .then(res => {
+                    console.log(res);
                     this.hideLoading();
                     this.cardList = res;
                 })