panhui há 4 anos atrás
pai
commit
d5aed0b4cc

BIN
.DS_Store


+ 171 - 172
project.private.config.json

@@ -1,175 +1,174 @@
 {
-    "setting": {},
-    "condition": {
-        "plugin": {
-            "list": []
-        },
-        "game": {
-            "list": []
-        },
-        "gamePlugin": {
-            "list": []
-        },
-        "miniprogram": {
-            "list": [
-                {
-                    "id": -1,
-                    "name": "消息",
-                    "pathName": "/pages/news",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "聊天页面",
-                    "pathName": "/pages/chat",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的",
-                    "pathName": "/pages/mine",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的收藏",
-                    "pathName": "/pages/mineFollow",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "个人设置",
-                    "pathName": "/pages/setting",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的钱包",
-                    "pathName": "/pages/wallet",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "授权登陆",
-                    "pathName": "/pages/authorized",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "常见问题",
-                    "pathName": "/pages/questions",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "选择地址",
-                    "pathName": "/pages/chooseAddress",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "订单详情",
-                    "pathName": "/pages/orderdetails",
-                    "query": "id=779"
-                },
-                {
-                    "id": -1,
-                    "name": "新增地址",
-                    "pathName": "/pages/receiving",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "首页",
-                    "pathName": "/pages/Home",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "拼箱详情",
-                    "pathName": "/pages/details",
-                    "query": "id=2570",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "收货地址",
-                    "pathName": "/pages/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "确认订单",
-                    "pathName": "/pages/confirmorder",
-                    "query": "caseId=2248&boxIds=2251%2C2257%2C2275%2C2281",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我买到的",
-                    "pathName": "/pages/allorder",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "店铺申请",
-                    "pathName": "/pages/store/apply",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "认证审核进度",
-                    "pathName": "/pages/store/review",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "店铺首页",
-                    "pathName": "/pages/store/homePage",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "申请退款",
-                    "pathName": "/pages/Apply",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "退款详情",
-                    "pathName": "/pages/Applydetails",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "我卖出的",
-                    "pathName": "pages/allsellout",
-                    "query": "null",
-                    "scene": null
-                },
-                {
-                    "name": "新增商品",
-                    "pathName": "pages/store/productEdit",
-                    "query": "null",
-                    "scene": null
-                }
-            ]
+  "setting": {},
+  "condition": {
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "id": -1,
+          "name": "消息",
+          "pathName": "/pages/news",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "聊天页面",
+          "pathName": "/pages/chat",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的",
+          "pathName": "/pages/mine",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的收藏",
+          "pathName": "/pages/mineFollow",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "个人设置",
+          "pathName": "/pages/setting",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的钱包",
+          "pathName": "/pages/wallet",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "授权登陆",
+          "pathName": "/pages/authorized",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "常见问题",
+          "pathName": "/pages/questions",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "选择地址",
+          "pathName": "/pages/chooseAddress",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "订单详情",
+          "pathName": "/pages/orderdetails",
+          "query": "id=779"
+        },
+        {
+          "id": -1,
+          "name": "新增地址",
+          "pathName": "/pages/receiving",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "首页",
+          "pathName": "/pages/Home",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "拼箱详情",
+          "pathName": "/pages/details",
+          "query": "id=2570",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "收货地址",
+          "pathName": "/pages/address",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "确认订单",
+          "pathName": "/pages/confirmorder",
+          "query": "caseId=2248&boxIds=2251%2C2257%2C2275%2C2281",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我买到的",
+          "pathName": "/pages/allorder",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "店铺申请",
+          "pathName": "/pages/store/apply",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "认证审核进度",
+          "pathName": "/pages/store/review",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "店铺首页",
+          "pathName": "/pages/store/homePage",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "申请退款",
+          "pathName": "/pages/Apply",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "退款详情",
+          "pathName": "/pages/Applydetails",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "我卖出的",
+          "pathName": "pages/allsellout",
+          "query": "null",
+          "scene": null
+        },
+        {
+          "name": "新增商品",
+          "pathName": "pages/store/productEdit",
+          "query": "null",
+          "scene": null
         }
+      ]
     }
-}
+  }
+}

BIN
src/.DS_Store


+ 7 - 2
src/components/ButtonBg.vue

@@ -1,5 +1,5 @@
 <template>
-    <div :class="`btn btn-${type} iconfont ${isRight ? 'isRight' : ''}`">
+    <div @click="clickBtn" :class="`btn btn-${type} iconfont ${isRight ? 'isRight' : ''}`">
         <span><slot></slot></span>
 
         <button class="btnForm" v-if="openType" :open-type="openType"></button>
@@ -8,7 +8,12 @@
 
 <script>
 export default {
-    props: ['type', 'isRight', 'openType']
+    props: ['type', 'isRight', 'openType'],
+    methods: {
+        clickBtn() {
+            this.$emit('click');
+        }
+    }
 };
 </script>
 

+ 39 - 2
src/components/ProductInfo.vue

@@ -21,12 +21,18 @@
             </div>
 
             <div class="button" v-if="showBtn">
-                <van-button @click.stop="cancelFollow" type="info" plain size="small" v-if="showType === 'collect'"
+                <van-button @click.stop="manage" type="info" plain size="small" v-if="isMine">管理拼箱</van-button>
+                <van-button @click.stop="cancelFollow" type="info" plain size="small" v-else-if="showType === 'collect'"
                     >取消关注</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>
 
@@ -50,6 +56,10 @@ export default {
         showType: {
             type: String,
             default: 'product'
+        },
+        isMine: {
+            type: Boolean,
+            default: false
         }
     },
     data() {
@@ -78,8 +88,13 @@ export default {
         }
     },
     methods: {
+        manage() {},
         detail() {
-            this.navigateTo('/pages/details?id=' + this.info.cardCaseId, false);
+            if (this.isMine && this.showBtn) {
+                this.$emit('choose', this.info.cardCaseId);
+            } else {
+                this.navigateTo('/pages/details?id=' + this.info.cardCaseId, false);
+            }
         },
         cancelFollow() {
             wx.showModal({
@@ -104,6 +119,7 @@ export default {
 .product-card {
     height: 115px;
     .flex();
+    position: relative;
 }
 
 .product-content {
@@ -162,4 +178,25 @@ export default {
     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>

BIN
src/native/.DS_Store


+ 20 - 0
src/native/svgs/icon_kapai_zhibo.svg

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>icon_kapai_zhibo</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="店铺页-上滑效果" transform="translate(-43.000000, -270.000000)">
+            <g id="编组-2" transform="translate(32.000000, 241.000000)">
+                <g id="编组-3" transform="translate(8.000000, 25.000000)">
+                    <g id="icon/直播" transform="translate(3.000000, 4.000000)">
+                        <rect id="矩形" x="0" y="0" width="14" height="14"></rect>
+                        <g id="编组-8" transform="translate(1.000000, 2.000000)">
+                            <path d="M2,0 L7,0 C8.1045695,-2.02906125e-16 9,0.8954305 9,2 L9,8 C9,9.1045695 8.1045695,10 7,10 L2,10 C0.8954305,10 1.3527075e-16,9.1045695 0,8 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" id="矩形" fill="#FFFFFF"></path>
+                            <path d="M3,4 C3.55228475,4 4,3.55228475 4,3 C4,2.44771525 3.55228475,2 3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.55228475 2.44771525,4 3,4 Z" id="椭圆形" fill="#FF6C00"></path>
+                            <path d="M7.85749293,3.48550424 L10.1826051,2.09043694 C10.7509014,1.74945915 11.4880137,1.93373723 11.8289915,2.50203355 C11.9408906,2.68853203 12,2.90193572 12,3.11942845 L12,6.88057155 C12,7.54331325 11.4627417,8.08057155 10.8,8.08057155 C10.5825073,8.08057155 10.3691036,8.02146215 10.1826051,7.90956306 L7.85749293,6.51449576 C7.32550683,6.1953041 7,5.62039707 7,5 C7,4.37960293 7.32550683,3.8046959 7.85749293,3.48550424 Z" id="矩形" fill="#FFFFFF"></path>
+                        </g>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 76 - 29
src/pages/store/homePage.vue

@@ -34,29 +34,46 @@
                         <van-dropdown-menu>
                             <van-dropdown-item
                                 title-class="van-icon van-icon-arrow"
-                                :value="value1"
-                                :options="option1"
+                                :value="caseStatus"
+                                :options="dropCaseStatusList"
+                                @change="changeStatus"
                             />
                         </van-dropdown-menu>
                     </div>
                     <div class="col-3">
-                        <sort-item v-model="sort" name="price">价格</sort-item>
+                        <sort-item v-model="sort" @input="getData" name="boxPrice">价格</sort-item>
                     </div>
                     <div class="col-3">
-                        <sort-item v-model="sort" name="createAt">最新</sort-item>
+                        <sort-item v-model="sort" @input="getData" name="id">最新</sort-item>
                     </div>
                 </div>
             </van-sticky>
             <div class="list-content">
                 <div class="procuct" v-for="(item, index) in list" :key="index">
-                    <product-info-mine :info="item"></product-info-mine>
+                    <van-icon color="#C8C9CC" class="check" name="circle" size="18px" />
+                    <product-info :info="item" :isMine="isMineShop" :showBtn="isManage"></product-info>
                 </div>
+
+                <van-empty
+                    v-if="empty"
+                    image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_wukabao.png"
+                    description="暂无卡包信息哦~"
+                >
+                </van-empty>
             </div>
         </div>
 
         <div class="bottom">
-            <button-bg type="warning" openType="share">分享店铺 </button-bg>
-            <button-bg type="prim" isRight>管理商品</button-bg>
+            <block v-if="isManage">
+                <button-bg type="warning" openType="share">新增商品 </button-bg>
+                <button-bg type="prim" isRight v-if="chooseIds.length > 0">删除</button-bg>
+                <button-bg type="prim" isRight v-else @click="isManage = false">完成</button-bg>
+            </block>
+            <block v-else>
+                <button-bg type="warning" openType="share">分享店铺 </button-bg>
+                <button-bg type="prim" isRight v-if="isMineShop" @click="isManage = true">管理商品</button-bg>
+                <button-bg type="prim" isRight v-else @click="wait">联系他</button-bg>
+            </block>
         </div>
     </div>
 </template>
@@ -65,22 +82,16 @@
 import { mapState } from 'vuex';
 import ButtonBg from '../../components/ButtonBg.vue';
 import NavHeader from '../../components/NavHeader.vue';
-import ProductInfoMine from '../../components/ProductInfoMine.vue';
+import ProductInfo from '../../components/ProductInfo.vue';
 import SortItem from '../../components/SortItem.vue';
 import store from '../../mixins/store';
+import cardPage from '../../mixins/cardPage';
 export default {
-    components: { ButtonBg, SortItem, NavHeader, ProductInfoMine },
-    mixins: [store],
+    components: { ButtonBg, SortItem, NavHeader, ProductInfo },
+    mixins: [store, cardPage],
     data() {
         return {
-            option1: [{ text: '全部商品', value: 0 }, { text: '新款商品', value: 1 }, { text: '活动商品', value: 2 }],
-            option2: [
-                { text: '默认排序', value: 'a' },
-                { text: '好评排序', value: 'b' },
-                { text: '销量排序', value: 'c' }
-            ],
-            value1: 0,
-            value2: 'a',
+            caseStatus: '',
             sort: '',
             page: 0,
             loading: false,
@@ -88,11 +99,27 @@ export default {
             empty: false,
             finish: false,
             isMineShop: false,
-            offsetTop: 0
+            offsetTop: 0,
+            isManage: false,
+            chooseIds: []
         };
     },
     computed: {
-        ...mapState(['systemInfo', 'userStoreInfo'])
+        ...mapState(['systemInfo', 'userStoreInfo']),
+        dropCaseStatusList() {
+            let list = [...this.caseStatusList];
+            list = list.map(item => {
+                return {
+                    value: item.value,
+                    text: item.label
+                };
+            });
+            let first = {
+                value: '',
+                text: '全部商品'
+            };
+            return [first, ...list];
+        }
     },
     onShow() {
         if (this.isLogin) {
@@ -105,7 +132,9 @@ export default {
             this.getStore().then(res => {
                 this.storeInfo = res;
                 this.getData();
-                this.offsetTop = this.systemInfo.statusBarHeight + 44;
+                setTimeout(() => {
+                    this.offsetTop = this.systemInfo.statusBarHeight + 44;
+                }, 1000);
             });
         },
         getStore() {
@@ -133,19 +162,27 @@ export default {
         getStoreById(id) {
             return this.$http.get('/store/get/' + id);
         },
+        changeStatus(value) {
+            console.log(value);
+            this.caseStatus = value.detail;
+            this.getData();
+        },
         getData() {
-            console.log(this.storeInfo.id);
+            this.empty = false;
             let data = {
-                page: this.page,
-                size: 20
+                storeId: this.storeInfo.id,
+                caseStatus: this.caseStatus
             };
             if (this.sort) {
-                data.sort = this.sort;
+                data.sortStr = this.sort;
             }
-            this.$http.postJson('/collection/all', data).then(res => {
-                this.empty = res.empty;
-                this.finish = res.last;
-                this.list = [...this.list, ...res.content];
+            this.showLoading();
+            this.$http.post('/store/findStoreCases', data).then(res => {
+                this.list = res.caseInfo;
+                if (res.caseInfo.length == 0) {
+                    this.empty = true;
+                }
+                this.hideLoading();
             });
         },
         goNext() {
@@ -270,5 +307,15 @@ export default {
 
 .procuct {
     padding: 20px 25px;
+
+    .flex();
+
+    .product-card {
+        flex-grow: 1;
+    }
+
+    .check {
+        margin-right: 5px;
+    }
 }
 </style>