Quellcode durchsuchen

Merge branch 'dev' of http://git.izouma.com/panhui/card-wechat into dev

xuqiang vor 4 Jahren
Ursprung
Commit
5906266f27

BIN
.DS_Store


+ 1 - 1
.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=https://zhuoka.izouma.com
+VUE_APP_BASE_URL=http://192.168.50.120:8080

BIN
src/.DS_Store


+ 1 - 1
src/components/AllselloutInfo.vue

@@ -45,7 +45,7 @@
                 <div v-if="status == 'COMPETED'" @click="Buyers" class="box-but">联系买家</div>
                 <div v-if="status == 'COMPETED'" @click="logistics" class="box-but3">查看物流</div>
                 <div v-if="status == 'CANCELED'" @click="deletes" class="box-but">删除订单</div>
-                <div v-if="status == 'CANCELED'" @click="Buyers" class="box-but3">联系买家</div>
+                <div v-if="status == 'CANCELED'" @click="again" class="box-but3">联系买家</div>
             </div>
         </div>
         <van-popup :show="show" custom-style="background:transparent;border-radius: 12px 12px 0 0;" use-slot>

+ 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>

+ 22 - 22
src/pages/allselldetails.vue

@@ -86,7 +86,7 @@
                 <p class="box-buttom-p">¥10</p>
             </div>
         </div>
-        <div class="box-buttom">
+        <div v-if="status.orderStatus !== 'CREATED'" class="box-buttom">
             <div class="box-buttom-con">
                 <p>实际支付</p>
                 <p class="box-buttom-p3">¥{{ total }}</p>
@@ -114,36 +114,36 @@
                 <p>创建时间</p>
                 <p class="box-footer-p">{{ status.createdAt }}</p>
             </div>
-        </div>
-        <div v-if="status.orderStatus !== 'CREATED'" class="box-footer">
-            <div class="box-footer-con">
-                <p>付款时间</p>
-                <p class="box-footer-p">{{ status.paidTime }}</p>
+            <div v-if="status.orderStatus !== 'CREATED'" class="box-footer">
+                <div class="box-footer-con">
+                    <p>付款时间</p>
+                    <p class="box-footer-p">{{ status.paidTime }}</p>
+                </div>
             </div>
-        </div>
-        <div v-if="status.orderStatus !== 'CREATED'" class="box-footer">
-            <div class="box-footer-con">
-                <p>成交时间</p>
-                <p class="box-footer-p">{{ status.paidTime }}</p>
+            <div v-if="status.orderStatus !== 'CREATED'" class="box-footer">
+                <div class="box-footer-con">
+                    <p>成交时间</p>
+                    <p class="box-footer-p">{{ status.paidTime }}</p>
+                </div>
             </div>
         </div>
         <div class="box-footer-nav">
             <div class="box-btn">
-                <!-- 交易成功 -->
-                <div v-if="status.orderStatus === 'COMPETED'" class="box-btn-left2" @click="Buyers">
+                <!-- 已完成 -->
+                <div v-if="status.orderStatus === 'COMPETED'" class="box-btn-left" @click="deletes">
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>联系买家</span>
                 </div>
-                <div v-if="status.orderStatus === 'COMPETED'" class="box-btn-right" @click="logistics">
+                <div v-if="status.orderStatus === 'COMPETED'" class="box-btn-right" @click="sales">
                     <img src="/native/imgs/btn_01@4x.png" alt="" />
                     <span class="box-btn-sp">查看物流</span>
                 </div>
                 <!-- 已发货 -->
-                <div v-if="status.orderStatus === 'SEND'" class="box-btn-left2" @click="logistics">
+                <div v-if="status.orderStatus === 'SEND'" class="box-btn-left" @click="logistics">
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>查看物流</span>
                 </div>
-                <div v-if="status.orderStatus === 'SEND'" class="box-btn-left" @click="Buyers">
+                <div v-if="status.orderStatus === 'SEND'" class="box-btn-right" @click="comfrim">
                     <img src="/native/imgs/btn_01@3x.png" alt="" />
                     <span>联系买家</span>
                 </div>
@@ -152,16 +152,16 @@
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>取消订单</span>
                 </div>
-                <div v-if="status.orderStatus === 'PAYED'" class="box-btn-left" @click="deliver">
+                <div v-if="status.orderStatus === 'PAYED'" class="box-btn-right" @click="comfrim">
                     <img src="/native/imgs/btn_01@3x.png" alt="" />
                     <span>立即发货</span>
                 </div>
-                <!-- 买家待支付 -->
+                <!-- 待支付 -->
                 <div v-if="status.orderStatus === 'CREATED'" class="box-btn-left2" @click="cancel">
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>取消订单</span>
                 </div>
-                <div v-if="status.orderStatus === 'CREATED'" class="box-btn-left" @click="Buyers">
+                <div v-if="status.orderStatus === 'CREATED'" class="box-btn-right" @click="pay">
                     <img src="/native/imgs/btn_01@3x.png" alt="" />
                     <span>联系买家</span>
                 </div>
@@ -170,9 +170,9 @@
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>删除订单</span>
                 </div>
-                <div v-if="status.orderStatus === 'CANCELED'" class="box-btn-right" @click="Buyers">
-                    <img src="/native/imgs/btn_01@4x.png" alt="" />
-                    <span class="box-btn-sp">联系买家</span>
+                <div v-if="status.orderStatus === 'CANCELED'" class="box-btn-right" @click="again">
+                    <img src="/native/imgs/btn_01@3x.png" alt="" />
+                    <span>重新购买</span>
                 </div>
             </div>
         </div>

+ 7 - 0
src/pages/chat.vue

@@ -56,6 +56,13 @@ export default {
             return this.showAttach ? 114 : 0;
         }
     },
+    onLoad(options) {
+        if (options.toName) {
+            wx.setNavigationBarTitle({
+                title: options.toName
+            });
+        }
+    },
     methods: {
         sendImg() {
             this.choosePhoto().then(res => {

+ 1 - 1
src/pages/details.vue

@@ -13,7 +13,7 @@
         </swiper>
         <div class="box-tit">{{ cardCaseInfo.caseName }}</div>
 
-        <div class="box-live">
+        <div class="box-live" @click="wait">
             <img src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/icon_kapai_zhibo@3x.png" alt="" />
             <p>直播未开始</p>
         </div>

+ 2 - 0
src/pages/orderdetails.vue

@@ -215,7 +215,9 @@
 </template>
 
 <script>
+import store from '../mixins/store';
 export default {
+    mixins: [store],
     name: '',
     data() {
         return {

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

@@ -34,29 +34,52 @@
                         <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
+                        v-if="isManage"
+                        :color="checkChoose(item.id) ? $colors.prim : '#C8C9CC'"
+                        class="check"
+                        :name="checkChoose(item.id) ? 'checked' : 'circle'"
+                        size="18px"
+                    />
+                    <product-info :info="item" :isMine="isMineShop" :showBtn="isManage" @click="choose"></product-info>
                 </div>
+                <van-icon name="checked" />
+                <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">新增商品 </button-bg>
+                <button-bg type="prim" isRight v-if="chooseIds.length > 0" @click="del">删除</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="chatWith">联系他</button-bg>
+            </block>
         </div>
     </div>
 </template>
@@ -65,22 +88,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 +105,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 +138,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,25 +168,66 @@ export default {
         getStoreById(id) {
             return this.$http.get('/store/get/' + id);
         },
+        changeStatus(value) {
+            console.log(value);
+            this.caseStatus = value.detail;
+            this.sort = '';
+            this.getData();
+        },
         getData() {
-            console.log(this.storeInfo.id);
+            this.empty = false;
             let data = {
-                page: this.page,
-                size: 20
+                storeId: this.storeInfo.id
             };
+            if (this.caseStatus) {
+                data.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();
+            return this.$http.post('/store/findStoreCases', data).then(res => {
+                this.list = res.caseInfo;
+                if (res.caseInfo.length == 0) {
+                    this.empty = true;
+                }
+                this.hideLoading();
+                return Promise.resolve();
             });
         },
+        del() {
+            this.$http
+                .get('/cardCase/multipleDelete', {
+                    caseIds: this.chooseIds
+                })
+                .then(res => {
+                    return this.getData();
+                })
+                .then(() => {
+                    this.toast('删除成功', 'success');
+                    this.chooseIds = [];
+                });
+        },
         goNext() {
             if (this.isMineShop) {
                 this.navigateTo('/pages/store/setting');
             }
+        },
+        chatWith() {
+            this.navigateTo('/pages/chat?toUserId=' + this.storeInfo.userId + '&toName=' + this.storeInfo.storeName);
+        },
+        checkChoose(id) {
+            let list = [...this.chooseIds];
+            return list.includes(id);
+        },
+        choose(id) {
+            let list = [...this.chooseIds];
+            if (this.checkChoose(id)) {
+                list.splice(list.indexOf(id), 1);
+            } else {
+                list.push(id);
+            }
+            this.chooseIds = list;
         }
     },
     onPageScroll() {},
@@ -270,5 +346,15 @@ export default {
 
 .procuct {
     padding: 20px 25px;
+
+    .flex();
+
+    .product-card {
+        flex-grow: 1;
+    }
+
+    .check {
+        margin-right: 5px;
+    }
 }
 </style>