panhui 5 年 前
コミット
c04add30af

+ 5 - 1
src/App.vue

@@ -97,7 +97,11 @@ p {
     color: #878d99;
     line-height: 22px;
 }
-
+.van-search {
+    .van-icon {
+        color: #878d99 !important;
+    }
+}
 .font14 {
     font-size: 14px;
 }

+ 4 - 1
src/components/Banner.vue

@@ -5,7 +5,7 @@
                 <swiper-item v-for="(item, index) in banners" :key="index">
                     <van-image
                         v-if="checkImg(item.img)"
-                        :src="item.img + $oss.normal"
+                        :src="item.img + oss"
                         width="100%"
                         height="100%"
                         fit="cover"
@@ -104,6 +104,9 @@ export default {
             } else {
                 return '';
             }
+        },
+        oss() {
+            return `?x-oss-process=image/resize,h_${this.height * 3},m_lfit`;
         }
     },
     methods: {

+ 17 - 5
src/components/bar/FilterSortBar.vue

@@ -36,10 +36,11 @@
             </div>
             <div class="shaixuan" @click="showFilter">
                 <span>筛选</span>
-                <van-icon
-                    :size="16"
-                    mame="https://imttech.oss-cn-hangzhou.aliyuncs.com/micro/iocn_shaixuan.png"
-                ></van-icon>
+                <van-image
+                    :width="16"
+                    :height="16"
+                    src="https://imttech.oss-cn-hangzhou.aliyuncs.com/micro/iocn_shaixuan.png"
+                ></van-image>
             </div>
         </div>
         <div class="filter-list" v-if="hasbottom">
@@ -172,12 +173,23 @@ export default {
         display: flex;
         align-items: center;
         padding: 0 16px;
+        flex-shrink: 0;
+        position: relative;
         span {
             margin-right: 4px;
         }
         &:active {
             background-color: overlay(@bg, #000);
         }
+
+        &::before {
+            content: '';
+            width: 1px;
+            height: 12px;
+            background: @bg;
+            position: absolute;
+            left: 0;
+        }
     }
     .showType {
         padding: 0 16px;
@@ -193,7 +205,7 @@ export default {
         flex-grow: 1;
         padding-left: 12px;
         .sort-item {
-            padding: 0 20px;
+            padding: 0 18px;
 
             &.active {
                 color: @warn;

+ 1 - 1
src/components/bar/SearchBar.vue

@@ -3,7 +3,7 @@
         <div class="navBar" :style="narStyle">
             <img class="logo" src="../../static/imgs/home_logo.png" alt="" />
             <div class="search">
-                <van-icon name="search" color="rgba(255,255,255,0.6)" />
+                <van-icon name="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/search.png" />
                 <span>搜索展商/产品/资讯</span>
             </div>
         </div>

+ 17 - 5
src/components/bar/SearchBarWithValue.vue

@@ -3,7 +3,7 @@
         <van-sticky :z-index="200">
             <div class="navBar" :style="narStyle" id="searchBar">
                 <!-- <img v-if="!isHome" class="logo" src="../../static/imgs/home_logo.png" alt="" /> -->
-                <van-icon name="arrow-left" :size="24" @click="navigateBack" :color="dark ? '#fff' : '#000'" />
+                <van-icon name="arrow-left" :size="24" @click="navigateBack" :color="fontColor" />
                 <van-search
                     :style="searchStyle"
                     :value="search"
@@ -13,6 +13,7 @@
                     placeholder="搜索..."
                     @change="inputChange"
                     @search="submitSearch"
+                    left-icon="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/search.png"
                 />
             </div>
         </van-sticky>
@@ -36,7 +37,11 @@ export default {
         dark: {
             type: Boolean,
             default: true
-        }
+        },
+        isDefault: {
+            type: Boolean,
+            default: true
+				},
     },
     data() {
         return {
@@ -56,9 +61,9 @@ export default {
         narStyle() {
             let style = {};
             if (this.fixed && this.dark) {
-                style.background = 'rgba(15, 38, 77,' + (0.3 + 0.7 * this.ratio) + ')';
+                style.background = 'rgba(15, 38, 77,' + (0 + 1 * this.ratio) + ')';
             } else {
-                style.background = 'rgba(255, 255, 255,' + (0.3 + 0.7 * this.ratio) + ')';
+                style.background = 'rgba(255, 255, 255,' + (0 + 1 * this.ratio) + ')';
             }
             if (this.menuButtonInfo.top) {
                 style.padding = this.menuButtonInfo.top + 'px ' + (15 + this.menuButtonInfo.width) + 'px 15px 15px';
@@ -76,6 +81,13 @@ export default {
             }
 
             return style;
+        },
+        fontColor() {
+            if (this.isDefault) {
+                return !this.dark ? '#000' : '#fff';
+            } else {
+                return !this.dark && this.ratio ? '#000' : '#fff';
+            }
         }
     },
     onReady() {
@@ -148,7 +160,7 @@ export default {
         .van-search__content {
         }
         .van-icon {
-            color: #bcc1cc;
+            color: #878d99 !important;
         }
         .van-search__field {
             .van-field__input {

+ 4 - 0
src/components/filter/Application.vue

@@ -105,6 +105,10 @@ export default {
                 transform: rotate(180deg);
             }
         }
+
+        .van-icon.van-icon-cross {
+            padding-right: 16px;
+        }
     }
     .list {
         display: flex;

+ 13 - 6
src/components/filter/Country.vue

@@ -27,11 +27,11 @@
                     @click="backChoose(headerInfo.value)"
                     v-if="headerInfo"
                     :border="false"
-                    :custom-class="chooseId === headerInfo.value ? 'active' : ''"
+                    :custom-class="value === headerInfo.value ? 'active' : ''"
                 >
                     <h3 class="fontNormal" slot="title">全部{{ $t(headerInfo.label) }}国家/地区</h3>
                     <van-icon
-                        v-if="chooseId === headerInfo.value"
+                        v-if="value === headerInfo.value"
                         slot="right-icon"
                         :size="18"
                         :color="$colors.warn"
@@ -42,11 +42,11 @@
                     <van-cell
                         @click="chooseList(item)"
                         :border="false"
-                        :custom-class="chooseId === item.value ? 'active' : ''"
+                        :custom-class="value === item.value ? 'active' : ''"
                     >
                         <h3 class="fontNormal" slot="title">{{ $t(item.label) }}</h3>
                         <van-icon
-                            v-if="chooseId === item.value"
+                            v-if="value === item.value"
                             slot="right-icon"
                             :size="18"
                             :color="$colors.warn"
@@ -152,7 +152,11 @@ export default {
         backChoose(value) {
             this.$nextTick(() => {
                 console.log(this.chooseInfo);
-                if (value) {
+                const _value = value || this.chooseId;
+                console.log(this.chooseInfo.value === _value);
+                if (this.value === _value) {
+                    this.$emit('input', '');
+                } else if (value) {
                     const countries = [...(this.headerInfo.children || [])]
                         .map(item => {
                             return item.value;
@@ -197,7 +201,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         .left-icon {
@@ -208,6 +212,9 @@ export default {
             text-align: center;
             padding: 0 10px;
         }
+        .van-icon&.van-icon-cross {
+            padding-right: 16px;
+        }
     }
 
     .van-cell {

+ 8 - 4
src/components/filter/EnterpriseType.vue

@@ -28,14 +28,14 @@
                     <van-cell
                         @click="chooseList(item)"
                         :border="false"
-                        :custom-class="chooseId === item.id ? 'active' : ''"
+                        :custom-class="value === item.id ? 'active' : ''"
                     >
                         <h3 class="fontNormal" slot="title">{{ $t(item.name) }}</h3>
                         <van-icon
                             slot="right-icon"
                             :size="18"
                             :color="$colors.warn"
-                            v-if="chooseId === item.id"
+                            v-if="value === item.id"
                             name="success"
                         />
                     </van-cell>
@@ -134,7 +134,8 @@ export default {
             }
         },
         backChoose(id) {
-            this.$emit('input', id || this.chooseId);
+            const _value = id || this.chooseId;
+            this.$emit('input', this.value === _value ? '' : _value);
             this.showPopup = false;
         },
         show() {
@@ -153,7 +154,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {
@@ -164,6 +165,9 @@ export default {
         .left-icon {
             width: 18px;
         }
+        .van-icon.van-icon-cross {
+            padding-right: 16px;
+        }
     }
 
     .van-cell {

+ 1 - 1
src/components/filter/ProductBrand.vue

@@ -132,7 +132,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {

+ 10 - 6
src/components/filter/ProductCategory.vue

@@ -27,14 +27,14 @@
                     @click="backChoose(headerInfo.id)"
                     v-if="headerInfo"
                     :border="false"
-                    :custom-class="chooseId === headerInfo.id ? 'active' : ''"
+                    :custom-class="value === headerInfo.id ? 'active' : ''"
                 >
                     <h3 class="fontNormal" slot="title">全部{{ getName(headerInfo) }}类别</h3>
                     <van-icon
                         slot="right-icon"
                         :size="18"
                         :color="$colors.warn"
-                        v-if="chooseId === headerInfo.id"
+                        v-if="value === headerInfo.id"
                         name="success"
                     />
                 </van-cell>
@@ -42,14 +42,14 @@
                     <van-cell
                         @click="chooseList(item)"
                         :border="false"
-                        :custom-class="chooseId === item.id ? 'active' : ''"
+                        :custom-class="value === item.id ? 'active' : ''"
                     >
                         <h3 class="fontNormal" slot="title">{{ getName(item) }}</h3>
                         <van-icon
                             slot="right-icon"
                             :size="18"
                             :color="$colors.warn"
-                            v-if="chooseId === item.id"
+                            v-if="value === item.id"
                             name="success"
                         />
                     </van-cell>
@@ -158,7 +158,8 @@ export default {
             }
         },
         backChoose(id) {
-            this.$emit('input', id || this.chooseId);
+            const _value = id || this.chooseId;
+            this.$emit('input', this.value === _value ? '' : _value);
             this.showPopup = false;
         },
         show() {
@@ -177,7 +178,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {
@@ -188,6 +189,9 @@ export default {
         .left-icon {
             width: 18px;
         }
+        .van-icon.van-icon-cross {
+            padding-right: 16px;
+        }
     }
 
     .van-cell {

+ 4 - 1
src/components/filter/ProductTags.vue

@@ -164,7 +164,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {
@@ -175,6 +175,9 @@ export default {
         .left-icon {
             width: 18px;
         }
+        .van-icon.van-icon-cross {
+            padding-right: 16px;
+        }
     }
 
     .van-cell {

+ 21 - 11
src/components/product/GridNormal.vue

@@ -2,15 +2,17 @@
     <div class="grid" @click="navigateTo(`/pagesProduct/Detail?id=${info.id}`, false)">
         <van-image class="grid-img" width="100%" height="170px" :src="img" fit="cover" />
         <div class="content">
-            <van-image class="grid-logo" width="56" height="24" :src="info.logo1 + $oss.logo1" fit="cover" />
-            <div class="text">
-                <h3 class="fontNormal">{{ name }}</h3>
-                <p>{{ info.model }}</p>
-            </div>
-            <div class="tags">
-                <van-tag v-for="(item, index) in tag" :key="index" custom-class="mini" plain color="#BCC1CC">{{
-                    item
-                }}</van-tag>
+            <van-image class="grid-logo" :height="42" :src="info.logo1 + $oss.logo1" fit="heightFix" />
+            <div class="content-bottom">
+                <div class="text">
+                    <h3 class="fontNormal">{{ name }}</h3>
+                    <p>{{ info.model }}</p>
+                </div>
+                <div class="tags">
+                    <van-tag v-for="(item, index) in tag" :key="index" custom-class="mini" plain :color="$colors.info">
+                        {{ item }}
+                    </van-tag>
+                </div>
             </div>
         </div>
     </div>
@@ -57,10 +59,10 @@ export default {
     border-radius: @radius;
     overflow: hidden;
     .content {
-        padding: 12px;
+        // padding: 12px;
         overflow: hidden;
         .text {
-            margin-top: 8px;
+            // margin-top: 8px;
             overflow: hidden;
             p {
                 white-space: nowrap;
@@ -69,6 +71,10 @@ export default {
                 height: 22px;
             }
         }
+
+        .content-bottom {
+            padding: 0 12px 12px;
+        }
     }
     background-color: @bgw;
 
@@ -90,6 +96,10 @@ export default {
             font-size: 10px;
             margin-right: 4px;
         }
+
+        &.van-tag--plain:before {
+            border: 1px solid #dcdfe6;
+        }
     }
 }
 </style>

+ 1 - 1
src/components/product/RowNormal.vue

@@ -7,7 +7,7 @@
             :size="16"
             style="margin-right: 12px;"
         />
-        <van-image :src="img" :width="110" :height="110" fit="cover" />
+        <van-image :src="img" width="220rpx" height="220rpx" fit="cover" />
         <div class="info">
             <h3>{{ getName(info) }}</h3>
             <div class="sub">

+ 1 - 1
src/components/select/Application.vue

@@ -148,7 +148,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {

+ 1 - 1
src/components/select/Country.vue

@@ -209,7 +209,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         .left-icon {

+ 1 - 1
src/components/select/Industry.vue

@@ -160,7 +160,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {

+ 4 - 1
src/components/select/ProductCategory.vue

@@ -167,7 +167,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {
@@ -178,6 +178,9 @@ export default {
         .left-icon {
             width: 18px;
         }
+        .van-icon.van-icon-cross {
+            padding-right: 16px;
+        }
     }
 
     .van-cell {

+ 5 - 1
src/components/select/ProductCategoryOnly.vue

@@ -161,7 +161,7 @@ export default {
         background: #ffffff;
         display: flex;
         align-items: center;
-        padding: 0 16px;
+        padding: 0 0 0 16px;
         margin-bottom: 6px;
         z-index: 20;
         h3 {
@@ -172,6 +172,10 @@ export default {
         .left-icon {
             width: 18px;
         }
+
+        .van-icon.van-icon-cross {
+            padding-right: 16px;
+        }
     }
 
     .van-cell {

+ 7 - 0
src/mixins/vendorInfo.js

@@ -26,6 +26,13 @@ export default {
         },
         logo() {
             return this.info.logo ? this.info.logo + '?x-oss-process=image/resize,m_fill,h_480,w_480' : '';
+        },
+        categoriesList() {
+            if (this.categories) {
+                return this.categories.split('/');
+            } else {
+                return [];
+            }
         }
     }
 };

+ 1 - 0
src/pages/Classify.vue

@@ -24,6 +24,7 @@
                     @search="confirm"
                     shape="round"
                     placeholder="搜索..."
+                    left-icon="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/search.png"
                 />
             </div>
         </van-sticky>

+ 1 - 1
src/pages/Home.vue

@@ -230,7 +230,7 @@ import SortList from '../components/SortList.vue';
 import searchList from '../mixins/searchList';
 import pages from '../mixins/pages';
 import FilterSortBar from '../components/bar/FilterSortBar.vue';
-import ProductGridNormal from '../components/product/GridNormal';
+import ProductGridNormal from '../components/product/GridNormal.vue';
 import ProductRow from '../components/product/RowNormal.vue';
 export default {
     data() {

+ 31 - 4
src/pagesHome/Brand.vue

@@ -9,7 +9,13 @@
 </config>
 <template>
     <div>
-        <search-bar v-model="searchKey" :ratio="ratio" @search="submitSearch"></search-bar>
+        <search-bar
+            v-model="searchKey"
+            :isDefault="false"
+            :dark="false"
+            :ratio="ratio"
+            @search="submitSearch"
+        ></search-bar>
         <banner :banners="banners"></banner>
 
         <div id="top">
@@ -21,15 +27,16 @@
                     placeholder="搜索..."
                     shape="round"
                     @search="submitSearch"
+                    left-icon="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/search.png"
                 />
             </div>
 
-            <scroll-view scroll-x style="width: 100%">
+            <scroll-view scroll-x style="width: 100%;">
                 <div class="hot-list">
                     <div class="hot-item" v-for="item in vendors" :key="item.id">
                         <vendor-grid :info="item"></vendor-grid>
                     </div>
-                    <div style="min-width:16px;height:100%"></div>
+                    <div style="min-width: 16px; height: 100%;"></div>
                 </div>
             </scroll-view>
 
@@ -93,7 +100,7 @@ import { getBanner } from '../utils/commont';
 import searchList from '../mixins/searchList';
 import VendorGrid from '../components/vendor/Grid.vue';
 import VendorRow from '../components/vendor/Row';
-import SearchBar from '../components/bar/SearchBarWithValue';
+import SearchBar from '../components/bar/SearchBarWithValue.vue';
 import FilterSortBar from '../components/bar/FilterSortBar';
 import SortList from '../components/SortList';
 import { EnterpriseType } from '../utils/appState';
@@ -181,6 +188,26 @@ export default {
         } else {
             this.ratio = 1;
         }
+
+        if (e.scrollTop > 0) {
+            wx.setNavigationBarColor({
+                frontColor: '#000000',
+                backgroundColor: '#ffffff',
+                animation: {
+                    duration: 400,
+                    timingFunc: 'easeIn'
+                }
+            });
+        } else {
+            wx.setNavigationBarColor({
+                frontColor: '#ffffff',
+                backgroundColor: '#000000',
+                animation: {
+                    duration: 400,
+                    timingFunc: 'easeIn'
+                }
+            });
+        }
     },
     onReachBottom() {
         if (!this.loading && !this.finish) {

+ 11 - 12
src/pagesHome/Product.vue

@@ -1,6 +1,7 @@
 <config>
 {
-'navigationBarTitleText': '全球产品',
+'navigationBarTitleText': '',
+'navigationStyle':'custom',
 'backgroundColorTop': '#0F264D',
 'backgroundColorBottom': '#f5f7fa',
 'navigationBarTextStyle':'white',
@@ -9,8 +10,9 @@
 </config>
 <template>
     <div>
-        <div class="top">
-            <van-sticky :offset-top="0" z-index="100">
+        <search-bar v-model="searchKey" :ratio="1" @search="submitSearch"></search-bar>
+        <div class="top" :style="{ height: `calc(88rpx + ${barHeight}px)` }">
+            <van-sticky :offset-top="barHeight" z-index="100">
                 <div class="tab-content" v-if="firstLevels.length > 0">
                     <van-tabs
                         :active="hotActive"
@@ -59,13 +61,7 @@
                 </filter-sort-bar>
             </van-sticky>
 
-            <sort-list
-                emptyText="敬请期待"
-                :empty="empty"
-                :loading="loading"
-                :finish="finish"
-                :top="`44px - 172rpx + ${barHeight}px`"
-            >
+            <sort-list emptyText="敬请期待" :empty="empty" :loading="loading" :finish="finish" :top="`44px - 172rpx`">
                 <div class="product-list" v-if="showType === 'grid'">
                     <div class="clo-2" v-for="item in list" :key="item.id">
                         <product-grid :info="item"></product-grid>
@@ -90,6 +86,7 @@ import ProductBrandFilter from '../components/filter/ProductBrand';
 import ProductCategoryFilter from '../components/filter/ProductCategory';
 import CountryFilter from '../components/filter/Country';
 import { mapState } from 'vuex';
+import SearchBar from '../components/bar/SearchBarWithValue.vue';
 export default {
     data() {
         return {
@@ -102,7 +99,8 @@ export default {
             url: '/product/show',
             tagIds: '',
             applicationField: '',
-            main: null
+            main: null,
+            ratio: 0
         };
     },
     mixins: [searchList],
@@ -185,7 +183,8 @@ export default {
         ProductBrandFilter,
         ProductCategoryFilter,
         CountryFilter,
-        ProductRow
+        ProductRow,
+        SearchBar
     },
     watch: {
         defaultCategoryId() {

+ 1 - 1
src/pagesHome/ProductList.vue

@@ -37,7 +37,7 @@
                 </filter-sort-bar>
             </van-sticky>
 
-            <sort-list :empty="empty" :loading="loading" :finish="finish" top="172rpx">
+            <sort-list :empty="empty" emptyText="敬请期待" :loading="loading" :finish="finish" top="172rpx">
                 <div class="product-list" v-if="showType === 'grid'">
                     <div class="clo-2" v-for="item in list" :key="item.id">
                         <product-grid :info="item"></product-grid>

+ 8 - 1
src/pagesHome/Search.vue

@@ -19,7 +19,14 @@
             <div class="navBar" :style="narStyle">
                 <van-icon name="arrow-left" @click="navigateBack" :size="24" color="#000" />
 
-                <van-search :focus="focus" :value="search" @search="confirm" shape="round" placeholder="搜索..." />
+                <van-search
+                    :focus="focus"
+                    left-icon="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/search.png"
+                    :value="search"
+                    @search="confirm"
+                    shape="round"
+                    placeholder="搜索..."
+                />
             </div>
         </van-sticky>
         <div class="content">

+ 44 - 50
src/pagesProduct/Detail.vue

@@ -12,8 +12,8 @@
         <banner :banners="banners" :height="375" :radius="0" :autoplay="false"></banner>
         <div class="main" id="main">
             <div class="info">
-                <div class="ad">
-                    <span>可在MT展厅线下体验,点击查看地址</span>
+                <div class="ad" @click="goLocation">
+                    <span>可在IMT展厅线下体验,点击查看地址</span>
                     <img src="../static/imgs/iocn_dingwei.png" alt="" />
                 </div>
 
@@ -80,9 +80,9 @@
                 >
                     <van-tab title="图文详情">
                         <div class="detail-content">
+                            <div class="tips" v-html="introduction"></div>
                             <!-- <rich-text v-if="detailImg" :nodes="detailImg"></rich-text> -->
                             <div v-html="detailImg" v-if="detailImg"></div>
-                            <van-empty v-else description="暂无详情" />
                         </div>
                     </van-tab>
                     <van-tab title="详细参数">
@@ -90,7 +90,7 @@
                             <parameter :productId="productId"></parameter>
                         </div>
                     </van-tab>
-                    <van-tab title="PDF资料" v-if="productInfo.pdf">
+                    <van-tab title="PDF资料" v-if="pdf.length > 0">
                         正在打开pdf...
                     </van-tab>
                 </van-tabs>
@@ -200,11 +200,10 @@ export default {
                 .includes(Number(this.productId));
         },
         pdf() {
-            return this.productInfo.pdf
-                ? this.productInfo.pdf.split(',').filter(item => {
-                      return item;
-                  })
-                : [];
+            return this.productInfo.pdf1 ? this.productInfo.pdf1 : [];
+        },
+        introduction() {
+            return (this.productInfo.introduction || '').replace(/\n/g, '<br/>');
         }
     },
     onLoad(options) {
@@ -224,62 +223,42 @@ export default {
                 saveBrowse(this.productId);
             }
         }
-
+    },
+    onPageScroll() {},
+    onReady() {
         setTimeout(() => {
             wx.createSelectorQuery()
-                .selectAll('.a-class')
-                .boundingClientRect(function(rects) {
-                    rects.forEach(function(rect) {
-                        rect.id; // 节点的ID
-                        rect.dataset; // 节点的dataset
-                        rect.left; // 节点的左边界坐标
-                        rect.right; // 节点的右边界坐标
-                        rect.top; // 节点的上边界坐标
-                        rect.bottom; // 节点的下边界坐标
-                        rect.width; // 节点的宽度
-                        rect.height; // 节点的高度
-                    });
+                .select('#main')
+                .boundingClientRect(rect => {
+                    const mainHeight = rect.height;
+                    wx.createSelectorQuery()
+                        .select('#detail')
+                        .boundingClientRect(rect => {
+                            this.detailTop = mainHeight - rect.height + rect.width + -this.barHeight - 30;
+                        })
+                        .exec();
                 })
                 .exec();
-        }, 1500);
+        }, 1000);
     },
-    onPageScroll() {},
     methods: {
         tabClick(e) {
-            console.log(e);
-            if (!this.detailTop) {
-                wx.createSelectorQuery()
-                    .select('#main')
-                    .boundingClientRect(rect => {
-                        const mainHeight = rect.height;
-                        wx.createSelectorQuery()
-                            .select('#detail')
-                            .boundingClientRect(rect => {
-                                this.detailTop = mainHeight - rect.height + 375 - 51;
-                                wx.pageScrollTo({
-                                    scrollTop: this.detailTop,
-                                    duration: 300
-                                });
-                            })
-                            .exec();
-                    })
-                    .exec();
-            } else {
-                wx.pageScrollTo({
-                    scrollTop: this.detailTop,
-                    duration: 300
-                });
-            }
+            wx.pageScrollTo({
+                scrollTop: this.detailTop,
+                duration: 300
+            });
             this.hotActive = e.detail.index;
+            console.log(this.pdf);
             if (e.detail.index === 2) {
                 wx.showActionSheet({
                     itemList: [...this.pdf].map((item, index) => {
-                        return '查看pdf文件' + (index + 1);
+                        console.log(item);
+                        return '查看pdf文件' + item.name;
                     }),
                     success: res => {
                         this.hotActive = 0;
                         wx.downloadFile({
-                            url: this.pdf[res.tapIndex],
+                            url: this.pdf[res.tapIndex].url,
                             success: res => {
                                 const filePath = res.tempFilePath;
 
@@ -326,6 +305,14 @@ export default {
             this.$store.commit('updateChooseList', [this.productInfo]);
             console.log(this.$store.state.chooseList);
             this.navigateTo('/pagesVendor/Connect?productId=' + this.productId + '&userId=' + this.vendorInfo.userId);
+        },
+        goLocation() {
+            wx.openLocation({
+                latitude: 31.298919,
+                longitude: 121.629521,
+                name: 'imt机床展示区',
+                address: '中国(上海)自由贸易试验区富特东三路526号'
+            });
         }
     }
 };
@@ -333,6 +320,13 @@ export default {
 <style lang="less">
 .main {
     background-color: @bgw;
+
+    .tips {
+        font-size: 14px;
+        color: #292c33;
+        line-height: 24px;
+        padding: 20px 16px;
+    }
 }
 .info {
     padding: 12px 16px 30px;

+ 27 - 27
src/pagesVendor/About.vue

@@ -1,16 +1,20 @@
 <template>
     <div>
-        <banner v-if="vendorInfo.img" :banners="banners" :height="180" :autoplay="false"></banner>
+        <banner v-if="info.img" :banners="banners" :height="180" :autoplay="false"></banner>
 
         <div class="auto-content">
-            <div class="box" style="order: 0;">
+            <div class="box" :style="{ order: decorationInfo.introductionOrder }">
                 <div class="introduce">
-                    {{ vendorInfo.introduction }}
+                    {{ info.introduction }}
                 </div>
             </div>
 
-            <div style="background: @bg;" v-if="productList.length > 0" :style="{ order: decorationInfo.popularOrder }">
-                <scroll-view :scroll-x="true">
+            <div
+                style="background: #fff;"
+                v-if="productList.length > 0"
+                :style="{ order: decorationInfo.popularOrder }"
+            >
+                <scroll-view :scroll-x="true" style="background-color: #f5f7fa;">
                     <div class="product-list">
                         <div class="product-item" v-for="item in productList" :key="item.id">
                             <product-grid :info="item"></product-grid>
@@ -20,23 +24,18 @@
                 </scroll-view>
             </div>
 
-            <div class="box" v-if="categories.length > 0">
-                <div class="box-title">主要服务</div>
+            <div class="box" v-if="categoriesList.length > 0" :style="{ order: decorationInfo.productOrder }">
+                <div class="box-title">主要产品</div>
 
                 <div class="serviceList">
                     <div
                         class="service"
-                        v-for="(item, index) in categories"
+                        v-for="(item, index) in categoriesList"
                         :key="item.id"
                         :style="{ backgroundColor: colors[index % colors.length] }"
-                        @click="
-                            navigateTo(
-                                '/pagesHome/ProductList?vendorId=' + vendorInfo.id + '&categoryIds=' + item.id,
-                                false
-                            )
-                        "
+                        @click="navigateTo('/pagesHome/ProductList', false)"
                     >
-                        {{ getName(item) }}
+                        {{ item }}
                     </div>
                 </div>
             </div>
@@ -50,7 +49,7 @@
                                 :index="index"
                                 :name="getName(item)"
                                 :id="item.id"
-                                :storeId="vendorInfo.id"
+                                :storeId="info.id"
                             ></application>
                         </block>
 
@@ -71,10 +70,12 @@
                     </div>
                 </scroll-view>
             </div>
+            <div class="imgList" :style="{ order: decorationInfo.customAreaOrder }">
+                <block v-for="(item, index) in customAreaImgs" :key="index">
+                    <van-image :src="item" fit="widthFix" />
+                </block>
+            </div>
         </div>
-        <block v-for="(item, index) in customAreaImgs" :key="index">
-            <van-image :src="item" fit="widthFix" />
-        </block>
 
         <div style="height: 100px;"></div>
     </div>
@@ -84,6 +85,7 @@ import Banner from '../components/Banner.vue';
 import Application from '../components/vendor/Application.vue';
 import ProductGrid from '../components/product/Grid.vue';
 import Case from '../components/vendor/Case.vue';
+import vendorInfo from '../mixins/vendorInfo';
 export default {
     components: { Banner, ProductGrid, Application, Case },
     data() {
@@ -93,8 +95,9 @@ export default {
             decorationInfo: {}
         };
     },
+    mixins: [vendorInfo],
     props: {
-        vendorInfo: {
+        info: {
             type: Object,
             default: () => {
                 return {};
@@ -107,8 +110,8 @@ export default {
     },
     computed: {
         banners() {
-            if (this.vendorInfo.img) {
-                return this.vendorInfo.img.split(',').map(item => {
+            if (this.info.img) {
+                return this.info.img.split(',').map(item => {
                     return {
                         img: item
                     };
@@ -117,13 +120,10 @@ export default {
             return [];
         },
         applications() {
-            return this.vendorInfo.applications || [];
+            return this.info.applications || [];
         },
         cases() {
-            return this.vendorInfo.cases || [];
-        },
-        categories() {
-            return this.vendorInfo.categories || [];
+            return this.info.cases || [];
         },
         customAreaImgs() {
             if (this.decorationInfo.customArea) {

+ 1 - 1
src/pagesVendor/Detail.vue

@@ -51,7 +51,7 @@
                         <van-tab title="新闻资讯"> </van-tab>
                     </van-tabs>
                 </van-sticky>
-                <about v-if="active === 0" :vendorInfo="vendorInfo" :showConnect="showConnect"></about>
+                <about v-if="active === 0" :info="vendorInfo" :showConnect="showConnect"></about>
                 <product v-else-if="active === 1" :vendorInfo="vendorInfo" :fixedTop="searchTop"></product>
                 <news v-else-if="active === 2" :vendorInfo="vendorInfo"></news>
             </div>

+ 4 - 3
src/pagesVendor/News.vue

@@ -54,9 +54,10 @@ export default {
     computed: {
         listQuery() {
             return {
-                query: JSON.stringify({
-                    vendorInfoId: this.vendorInfo.id
-                })
+                query: {
+                    vendorInfoId: this.vendorInfo.id,
+                    status: 'PASS'
+                }
             };
         }
     },

+ 5 - 3
src/pagesVendor/Product.vue

@@ -2,6 +2,7 @@
     <div class="productPage" :style="{ minHeight: ` calc(100vh - ${barHeight}px - 44px)` }">
         <scroll-view :scroll-top="scrollTop" :scroll-y="true" class="left-side" v-if="menus.length > 0">
             <van-sidebar :active-key="activeKey" @change="changeCustomCate">
+                <van-sidebar-item title="全部产品" />
                 <van-sidebar-item :title="getName(item)" :key="item.id" v-for="item in menus" />
             </van-sidebar>
         </scroll-view>
@@ -17,7 +18,7 @@
 </template>
 <script>
 import searchList from '../mixins/searchList';
-import ProductRow from '../components/product/Row';
+import ProductRow from '../components/product/Row.vue';
 import SortList from '../components/SortList.vue';
 import { mapState } from 'vuex';
 export default {
@@ -50,8 +51,8 @@ export default {
             };
         },
         customCateId() {
-            if (this.menus.length > this.activeKey) {
-                return [...this.menus][this.activeKey].id;
+            if (this.menus.length > this.activeKey - 1 && this.activeKey !== 0) {
+                return [...this.menus][this.activeKey - 1].id;
             } else {
                 return '';
             }
@@ -120,6 +121,7 @@ export default {
 
 .right {
     flex-grow: 1;
+    overflow: hidden;
 }
 .product-row-list {
     overflow: hidden;

+ 1 - 1
src/styles/common.less

@@ -2,7 +2,7 @@
 @success: #07c160;
 @danger: #ee0a24;
 @warn: #ffa526;
-@info: #bcc1cc;
+@info: #BCC1CC;
 @text1: #292c33;
 @text2: #606266;
 @text3: #909399;