xuqiang 4 ani în urmă
părinte
comite
6b75810700

+ 210 - 210
project.config.json

@@ -1,217 +1,217 @@
 {
-    "description": "项目配置文件",
-    "packOptions": {
-        "ignore": []
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": false,
+    "es6": true,
+    "enhance": false,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": false,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
     },
-    "setting": {
-        "urlCheck": false,
-        "es6": true,
-        "enhance": false,
-        "postcss": true,
-        "preloadBackgroundData": false,
-        "minified": true,
-        "newFeature": true,
-        "coverView": true,
-        "nodeModules": false,
-        "autoAudits": false,
-        "showShadowRootInWxmlPanel": true,
-        "scopeDataCheck": false,
-        "uglifyFileName": false,
-        "checkInvalidKey": true,
-        "checkSiteMap": true,
-        "uploadWithSourceMap": true,
-        "compileHotReLoad": false,
-        "useMultiFrameRuntime": true,
-        "useApiHook": true,
-        "useApiHostProcess": true,
-        "babelSetting": {
-            "ignore": [],
-            "disablePlugins": [],
-            "outputPath": ""
-        },
-        "enableEngineNative": false,
-        "bundle": false,
-        "useIsolateContext": true,
-        "useCompilerModule": true,
-        "userConfirmedUseCompilerModuleSwitch": false,
-        "userConfirmedBundleSwitch": false,
-        "packNpmManually": false,
-        "packNpmRelationList": [],
-        "minifyWXSS": true
+    "enableEngineNative": false,
+    "bundle": false,
+    "useIsolateContext": true,
+    "useCompilerModule": true,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.16.1",
+  "appid": "wxf3120271892d4f18",
+  "projectname": "%E5%8D%A1%E7%89%8C%E5%B0%8F%E7%A8%8B%E5%BA%8F",
+  "cloudfunctionTemplateRoot": "",
+  "watchOptions": {
+    "ignore": []
+  },
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "scripts": {},
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "miniprogramRoot": "dist-wechat/",
+  "condition": {
+    "search": {
+      "list": []
     },
-    "compileType": "miniprogram",
-    "libVersion": "2.16.1",
-    "appid": "wxf3120271892d4f18",
-    "projectname": "%E5%8D%A1%E7%89%8C%E5%B0%8F%E7%A8%8B%E5%BA%8F",
-    "cloudfunctionTemplateRoot": "",
-    "watchOptions": {
-        "ignore": []
+    "conversation": {
+      "list": []
     },
-    "debugOptions": {
-        "hidedInDevtools": []
+    "plugin": {
+      "list": []
     },
-    "scripts": {},
-    "simulatorType": "wechat",
-    "simulatorPluginLibVersion": {},
-    "miniprogramRoot": "dist-wechat/",
-    "condition": {
-        "search": {
-            "list": []
-        },
-        "conversation": {
-            "list": []
-        },
-        "plugin": {
-            "list": []
-        },
-        "game": {
-            "list": []
-        },
-        "gamePlugin": {
-            "list": []
-        },
-        "miniprogram": {
-            "list": [
-                {
-                    "id": -1,
-                    "name": "消息",
-                    "pathName": "/pages/news",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "聊天页面",
-                    "pathName": "/pages/chat",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的",
-                    "pathName": "/pages/mine",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的收藏",
-                    "pathName": "/pages/mineFollow",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "个人设置",
-                    "pathName": "/pages/setting",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的钱包",
-                    "pathName": "/pages/wallet",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "授权登陆",
-                    "pathName": "/pages/authorized",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "常见问题",
-                    "pathName": "/pages/questions",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "选择地址",
-                    "pathName": "/pages/chooseAddress",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "订单详情",
-                    "pathName": "/pages/orderdetails",
-                    "query": "id=779"
-                },
-                {
-                    "id": -1,
-                    "name": "新增地址",
-                    "pathName": "/pages/receiving",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "首页",
-                    "pathName": "/pages/Home",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "拼箱详情",
-                    "pathName": "/pages/details",
-                    "query": "id=2353"
-                },
-                {
-                    "id": -1,
-                    "name": "收货地址",
-                    "pathName": "/pages/address",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "确认订单",
-                    "pathName": "/pages/confirmorder",
-                    "query": "caseId=2248&boxIds=2251%2C2257%2C2275%2C2281",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我买到的",
-                    "pathName": "/pages/allorder",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "店铺申请",
-                    "pathName": "/pages/store/apply",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "认证审核进度",
-                    "pathName": "/pages/store/review",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "店铺首页",
-                    "pathName": "/pages/store/homePage",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "新增商品",
-                    "pathName": "/pages/store/productEdit",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "申请退款",
-                    "pathName": "/pages/Apply",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "退款详情",
-                    "pathName": "/pages/Applydetails",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我卖出的",
-                    "pathName": "/pages/allsellout",
-                    "scene": null
-                }
-            ]
+    "game": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "id": -1,
+          "name": "消息",
+          "pathName": "/pages/news",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "聊天页面",
+          "pathName": "/pages/chat",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的",
+          "pathName": "/pages/mine",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的收藏",
+          "pathName": "/pages/mineFollow",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "个人设置",
+          "pathName": "/pages/setting",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的钱包",
+          "pathName": "/pages/wallet",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "授权登陆",
+          "pathName": "/pages/authorized",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "常见问题",
+          "pathName": "/pages/questions",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "选择地址",
+          "pathName": "/pages/chooseAddress",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "订单详情",
+          "pathName": "/pages/orderdetails",
+          "query": "id=779"
+        },
+        {
+          "id": -1,
+          "name": "新增地址",
+          "pathName": "/pages/receiving",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "首页",
+          "pathName": "/pages/Home",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "拼箱详情",
+          "pathName": "/pages/details",
+          "query": "id=2353"
+        },
+        {
+          "id": -1,
+          "name": "收货地址",
+          "pathName": "/pages/address",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "确认订单",
+          "pathName": "/pages/confirmorder",
+          "query": "caseId=2248&boxIds=2251%2C2257%2C2275%2C2281",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我买到的",
+          "pathName": "/pages/allorder",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "店铺申请",
+          "pathName": "/pages/store/apply",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "认证审核进度",
+          "pathName": "/pages/store/review",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "店铺首页",
+          "pathName": "/pages/store/homePage",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "新增商品",
+          "pathName": "/pages/store/productEdit",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "申请退款",
+          "pathName": "/pages/Apply",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "退款详情",
+          "pathName": "/pages/Applydetails",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我卖出的",
+          "pathName": "/pages/allsellout",
+          "scene": null
         }
+      ]
     }
-}
+  }
+}

+ 1 - 1
src/components/ProductInfo.vue

@@ -89,7 +89,7 @@ export default {
     },
     methods: {
         manage() {
-            this.navigateTo('/pages/store/administration?id=' + this.info.cardCaseId);
+            this.navigateTo('/pages/store/productEdit?id=' + this.info.cardCaseId);
         },
         detail() {
             if (this.isMine && this.showBtn) {

+ 186 - 0
src/components/PublishInfo.vue

@@ -0,0 +1,186 @@
+<template>
+    <div class="product-card" @click="detail">
+        <van-image width="80" height="115" :src="info.image" fit="cover" radius="6" />
+
+        <div class="product-content">
+            <div class="text1">{{ info.caseName }}</div>
+            <div class="text2">
+                <span>距结束</span>
+                <van-count-down class="val" :time="time" format="DD 天 HH:mm:ss" />
+            </div>
+            <div class="text2">
+                <span>已拼箱</span>
+                <span class="val">{{ info.preorder || 0 }}/{{ info.total || 0 }}</span>
+            </div>
+
+            <div class="flex1"></div>
+
+            <div class="price">
+                <van-icon size="10" :color="$colors.red" name="jiage" class-prefix="iconfont" />
+                <span>{{ info.price }}</span>
+            </div>
+
+            <div class="button" v-if="showBtn">
+                <van-button @click.stop="manage" type="primary" size="small" v-if="isMine">管理拼箱</van-button>
+                <!-- <van-button type="primary" size="small" v-else>立即拼箱</van-button> -->
+            </div>
+        </div>
+
+        <div class="live" v-if="!isMine">
+            <img src="/native/svgs/icon_kapai_zhibo.svg" alt="" />
+            <span>直播</span>
+        </div>
+    </div>
+</template>
+
+<script>
+import dayjs from 'dayjs';
+import collection from '../mixins/collection';
+export default {
+    name: 'ProductInfo',
+    mixins: [collection],
+    props: {
+        info: {
+            type: Object,
+            default: () => {
+                return {};
+            }
+        },
+        showBtn: {
+            type: Boolean,
+            default: true
+        },
+        showType: {
+            type: String,
+            default: 'product'
+        },
+        isMine: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data() {
+        return {
+            cartId: 0,
+            isCollection: false
+        };
+    },
+    mounted() {
+        this.$nextTick(() => {
+            if (this.showType === 'collect') {
+                this.cartId = this.info.cartId;
+                this.isCollection = true;
+            }
+        });
+    },
+    computed: {
+        time() {
+            if (this.info.endTime) {
+                let date = dayjs(this.info.endTime, 'YYYY-MM-DD HH:mm:ss');
+
+                return date.diff(dayjs());
+            } else {
+                return 0;
+            }
+        }
+    },
+    methods: {
+        manage() {
+            this.navigateTo('/pages/store/productEdit?id=' + this.info.cardCaseId);
+        },
+        detail() {
+            if (this.isMine && this.showBtn) {
+                this.$emit('choose', this.info.cardCaseId);
+            } else {
+                this.navigateTo('/pages/details?id=' + this.info.cardCaseId, false);
+            }
+        }
+    }
+};
+</script>
+
+<style lang="less" scoped>
+.product-card {
+    height: 115px;
+    .flex();
+    position: relative;
+}
+
+.product-content {
+    flex-grow: 1;
+    margin-left: 10px;
+    align-self: stretch;
+    .flex-col();
+    position: relative;
+    overflow: hidden;
+    .text1 {
+        font-size: 16px;
+        font-weight: bold;
+        color: #000000;
+        line-height: 24px;
+        .ellipsis();
+        margin-bottom: 6px;
+    }
+
+    .text2 {
+        padding: 2px 0;
+        .flex();
+        span {
+            font-size: 14px;
+            color: #c8c9cc;
+            line-height: 24px;
+
+            &.val {
+                font-size: 14px;
+                color: @prim;
+            }
+        }
+
+        /deep/ .val {
+            .van-count-down {
+                --count-down-text-color: @prim;
+            }
+        }
+    }
+
+    .flex1 {
+        flex-grow: 1;
+    }
+
+    .price {
+        .flex();
+        font-size: 24px;
+        font-family: 'OSP';
+        font-weight: normal;
+        color: #f42202;
+        line-height: 22px;
+    }
+}
+
+.button {
+    position: absolute;
+    right: 0;
+    bottom: 0;
+}
+
+.live {
+    padding: 4px 3px;
+    background-color: @prim;
+    border-radius: 4px;
+    position: absolute;
+    top: 10px;
+    left: -7px;
+
+    .flex();
+    img {
+        width: 14px;
+        height: 14px;
+        margin-right: 4px;
+    }
+    span {
+        font-size: 12px;
+        color: #ffffff;
+        line-height: 14px;
+    }
+}
+</style>

+ 83 - 39
src/pages/minePublish.vue

@@ -5,25 +5,6 @@
 </config>
 <template>
     <div>
-        <div v-for="(item, index) in Boxes" :key="index.id">
-            <div class="box-con">
-                <div class="box-con-Cards">
-                    <img :src="cardCaseInfo.images[0]" alt="" />
-                    <div class="box-con-right">
-                        <p class="box-con-tit">{{ cardCaseInfo.name }}</p>
-                        <div class="box-con-today">
-                            <p>卡盒选号: {{ item.groupCode + item.boxCode }}</p>
-                        </div>
-                        <div class="box-con-money">
-                            <div class="box-con-num">
-                                <p>¥{{ item.boxPrice }}</p>
-                            </div>
-                            <p>×1</p>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
         <van-empty
             image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_wofabude.png"
             description="你还没有发布商品哦~"
@@ -34,33 +15,96 @@
 </template>
 
 <script>
+import PublishInfo from '../components/PublishInfo.vue';
 export default {
+    // components: { PublishInfo },
     name: 'MinePublish',
     data() {
         return {};
     },
     methods: {
-        Applydetail() {
-            this.showLoading();
-            this.$http
-                .get('/orderInfo/get/' + this.$mp.query.id)
-                .then(res => {
-                    this.hideLoading();
-                    this.cardCaseInfo = res.cardCase.collection;
-                    this.ApplydetailList = res;
-                    this.store = res.store;
-                    this.cardBoxList = res.cardBoxList;
-                    this.Boxes = res.cardBoxList;
-                })
-                .catch(e => {
-                    this.hideLoading();
-                    if (e.error) {
-                        this.toast(e.rror);
-                    }
-                });
-        }
+        // Applydetail() {
+        //     this.showLoading();
+        //     this.$http
+        //         .get('/orderInfo/get/' + this.$mp.query.id)
+        //         .then(res => {
+        //             this.hideLoading();
+        //             console.log(res);
+        //             this.cardCaseInfo = res.cardCase.collection;
+        //             this.ApplydetailList = res;
+        //             this.store = res.store;
+        //             this.cardBoxList = res.cardBoxList;
+        //             this.Boxes = res.cardBoxList;
+        //         })
+        //         .catch(e => {
+        //             this.hideLoading();
+        //             if (e.error) {
+        //                 this.toast(e.rror);
+        //             }
+        //         });
+        // }
     }
+    // created() {
+    //     this.Applydetail();
+    // }
 };
 </script>
 
-<style></style>
+<style lang="less" scoped>
+.box-con {
+    background: #ffffff;
+    border-radius: 12px;
+    .box-con-Cards {
+        display: flex;
+        img {
+            width: 62px;
+            height: 90px;
+            border-radius: 6px;
+        }
+        .box-con-right {
+            width: 78%;
+            margin-left: 8px;
+            .box-con-tit {
+                font-size: 16px;
+                font-weight: bold;
+                color: #000000;
+                margin: 5px 0 10px 0;
+            }
+        }
+        .box-con-today {
+            .flex();
+            height: 30px;
+            background: #f5f7fa;
+            border-radius: 6px;
+            width: 142px;
+            margin: 4px 0 11px 0;
+            p {
+                font-size: 14px;
+                font-weight: 400;
+                color: #303133;
+            }
+        }
+        .box-con-money {
+            .flex();
+            justify-content: space-between;
+            .box-con-num {
+                .flex();
+                img {
+                    width: 16px;
+                    height: 16px;
+                }
+                p {
+                    font-size: 14px;
+                    font-weight: normal;
+                    color: #c8c9cc;
+                }
+            }
+            p {
+                font-size: 14px;
+                font-weight: 400;
+                color: #c8c9cc;
+            }
+        }
+    }
+}</style
+>>

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

@@ -48,7 +48,7 @@
         </van-cell-group>
         <div class="box-con">
             <div class="label">卡牌细节图</div>
-            <van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg(images)" />
+            <van-uploader :file-list="images[0]" :after-read="afterRead" @delete="deleteImg(images)" />
             <div v-if="!showId">
                 <div class="box-top">
                     <div class="top">
@@ -98,7 +98,7 @@
                     </div>
                 </div>
                 <div class="content">
-                    <div class="card" v-for="(card, index) in groupDTOS" :key="index">
+                    <div class="card" v-for="(card, index) in form.groupDTOS" :key="index">
                         <div class="card-title">第{{ index + 1 }}组</div>
                         <div class="card-list">
                             <div
@@ -177,8 +177,9 @@ export default {
             closeFlag: false,
             newShow: false,
             showId: false,
-            groupDTOS: [],
+            id: 0,
             images: [],
+            cardList: [],
             imagesList: [],
             imageUrls: [],
             nowChooseId: [],
@@ -237,7 +238,7 @@ export default {
                 .then(res => {
                     this.hideLoading();
                     this.actions = res.content;
-                    console.log(this.actions);
+                    // console.log(this.actions);
                     this.sotrId = this.actions.find(item => {
                         return item.id;
                     });
@@ -293,10 +294,10 @@ export default {
         cartBox() {
             this.$http.get('/cardCase/getCardCase', { id: this.$mp.query.id }).then(res => {
                 console.log(res);
-                this.groupDTOS = res.groupDTOS;
                 this.showId = res.id;
                 this.form = {
                     boxPrice: res.boxPrice,
+                    groupDTOS: res.groupDTOS,
                     startTime: res.startTime,
                     description: res.description,
                     boxesCount: res.boxesCount || 0,
@@ -395,53 +396,47 @@ export default {
             // this.images.splice(this.imagesList, 1);
         },
         submit() {
-            if (!this.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;
-            }
-            if (!this.form.boxesCount) {
-                wx.showToast({
-                    icon: 'none',
-                    title: '请选拼箱人数'
-                });
-                return;
-            }
-            if (this.images.length == 0) {
-                wx.showToast({
-                    icon: 'none',
-                    title: '请添加图片'
-                });
-                return;
-            }
-            if (this.form.groupDTOS.length == 0) {
-                wx.showToast({
-                    icon: 'none',
-                    title: '请选择卡包种类'
-                });
-                return;
-            }
+            // if (!this.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;
+            // }
+            // if (!this.form.boxesCount) {
+            //     wx.showToast({
+            //         icon: 'none',
+            //         title: '请选拼箱人数'
+            //     });
+            //     return;
+            // }
+            // if (this.images.length == 0) {
+            //     wx.showToast({
+            //         icon: 'none',
+            //         title: '请添加图片'
+            //     });
+            //     return;
+            // }
             let cardCaseInputDTO = { ...this.form };
             let images = this.imageUrls.join(',');
-            let groupDTOS = this.groupDTOS;
             cardCaseInputDTO.images = images;
-            cardCaseInputDTO.groupDTOS = groupDTOS;
+            console.log(this.form.groupDTOS);
+            console.log('=========');
+            console.log(cardCaseInputDTO);
             this.showLoading();
             this.$http
                 .post('/cardCase/save', cardCaseInputDTO, {
@@ -450,11 +445,27 @@ export default {
                     }
                 })
                 .then(res => {
+                    console.log(res);
+                    this.id = res.id;
                     this.hideLoading();
+                    this.form = {
+                        boxPrice: res.boxPrice,
+                        groupDTOS: res.groupDTOS,
+                        startTime: res.startTime,
+                        description: res.description,
+                        boxesCount: res.boxesCount || 0,
+                        postage: res.postage || 10
+                    };
+                    console.log('++++++++++++');
+                    console.log(this.form);
                     wx.showToast({
                         title: '商品上架成功'
                     });
-                    this.navigateTo('/pages/store/homePage');
+                    if (this.showId) {
+                        this.navigateTo('/pages/store/homePage');
+                    } else {
+                        this.navigateTo('/pages/minePublish?orderInfoId=' + this.id);
+                    }
                 })
                 .catch(e => {
                     this.hideLoading();