panhui 5 years ago
parent
commit
859dcf76a5

+ 8 - 1
project.config.json

@@ -84,7 +84,14 @@
                     "id": -1,
                     "name": "展商详情",
                     "pathName": "pagesVendor/Detail",
-                    "query": "id=262",
+                    "query": "id=1421",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "商品",
+                    "pathName": "pagesProduct/Detail",
+                    "query": "id=14857",
                     "scene": null
                 }
             ]

+ 1 - 1
src/components/SortList.vue

@@ -38,7 +38,7 @@ export default {
         },
         emptyText: {
             type: String,
-            default: '什么都没有哦~'
+            default: '敬请期待'
         }
     },
     computed: {

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

@@ -41,7 +41,7 @@ export default {
         isDefault: {
             type: Boolean,
             default: true
-				},
+        }
     },
     data() {
         return {

+ 1 - 0
src/components/product/RowMini.vue

@@ -81,6 +81,7 @@ export default {
     .info {
         flex-grow: 1;
         margin-left: 8px;
+        overflow: hidden;
     }
 
     ._van-icon {

+ 6 - 4
src/components/vendor/Application.vue

@@ -1,8 +1,5 @@
 <template>
-    <div
-        class="application "
-        @click="navigateTo('/pagesHome/ProductList?vendorId=' + storeId + '&applicationField=' + id)"
-    >
+    <div class="application" @click="goDetail">
         <van-image :src="bgs[index % 8]" :radius="4" :width="100" :height="120" fit="cover" />
         <div class="text">{{ name }}</div>
     </div>
@@ -42,6 +39,11 @@ export default {
                 'http://imttech.oss-cn-hangzhou.aliyuncs.com/case/application/yingyong_img_082x.jpg'
             ]
         };
+    },
+    methods: {
+        goDetail() {
+            this.$emit('goDetail');
+        }
     }
 };
 </script>

+ 1 - 1
src/components/vendor/Case.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="case">
+    <div class="case" @click="navigateTo(`/pagesVendor/Case?id=${info.id}`)">
         <van-image :width="300" :height="170" :src="info.img" fit="contain" />
         <h3>{{ info.title }}</h3>
     </div>

+ 1 - 1
src/locales/zh.json

@@ -11,7 +11,7 @@
   "zheng-ce-xin-xi": "政策信息",
   "zong-he": "综合",
   "ren-qi": "人气",
-  "vip-tui-jian-qi-ye": "VIP推荐企业",
+  "vip-tui-jian-qi-ye": "VIP推荐",
   "shi-jian": "时间",
   "da-tu": "大图",
   "lie-biao": "列表",

+ 3 - 2
src/main.js

@@ -15,7 +15,8 @@ Vue.prototype.$colors = {
     prim: '#0F264D',
     warn: '#FFA526',
     info: '#BCC1CC',
-    text: '#292C33'
+    text: '#292C33',
+    bg: '#f5f7fa'
 };
 
 Vue.prototype.$oss = {
@@ -116,7 +117,7 @@ export default {
             },
             {
                 root: 'pagesVendor',
-                pages: ['Detail', 'Connect', 'FilterProduct']
+                pages: ['Detail', 'Connect', 'FilterProduct', 'Case']
             }
         ],
         tabBar: {

+ 1 - 1
src/mixins/vendorInfo.js

@@ -22,7 +22,7 @@ export default {
             return str;
         },
         country() {
-            return this.info.country || '中国';
+            return this.info.headquarter || this.info.country || '中国';
         },
         logo() {
             return this.info.logo ? this.info.logo + '?x-oss-process=image/resize,m_fill,h_480,w_480' : '';

+ 1 - 1
src/pages/My.vue

@@ -43,7 +43,7 @@
             </div>
 
             <div class="userInfo">
-                <van-image :src="icon" width="96" height="96" fit="cover" />
+                <van-image :src="icon" width="96" height="96" :radius="4" fit="cover" />
                 <h2>{{ name }}</h2>
             </div>
         </div>

+ 2 - 1
src/pagesImt/Connect.vue

@@ -60,7 +60,7 @@ export default {
             wx.openLocation({
                 latitude: 31.298919,
                 longitude: 121.629521,
-                name: 'imt机床展示区',
+                name: '外高桥智能制造服务产业园',
                 address: '中国(上海)自由贸易试验区富特东三路526号'
             });
         }
@@ -112,5 +112,6 @@ export default {
     font-size: 12px;
     border-radius: 2px;
     color: #fff;
+    display: inline-block;
 }
 </style>

+ 7 - 1
src/pagesImt/Index.vue

@@ -87,7 +87,7 @@
 import Banner from '../components/Banner';
 import CustomBar from '../components/bar/CustomBar.vue';
 import Title from '../components/imt/Title';
-import Core from '../components/imt/Core';
+import Core from '../components/imt/Core.vue';
 import Bottom from '../components/imt/Bottom.vue';
 import Advantage from './Advantage';
 import Service from './Service';
@@ -249,6 +249,7 @@ export default {
         color: #000000;
         line-height: 24px;
         padding: 20px 0;
+        text-align: justify;
     }
 
     .introduce-img {
@@ -291,3 +292,8 @@ export default {
     padding: 30px 16px;
 }
 </style>
+<style lang="less">
+p {
+    text-align: justify;
+}
+</style>

+ 10 - 1
src/pagesImt/Service.vue

@@ -23,7 +23,7 @@ export default {
                 return {
                     icon: item.icon,
                     name: item.name,
-                    sub: item.sub
+                    sub: item.content
                 };
             });
         }
@@ -35,14 +35,23 @@ export default {
 .services {
     background: @bg;
     padding: 12px 16px;
+    p {
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        word-wrap: normal;
+        overflow: hidden;
+    }
 }
 .service-item {
     display: flex;
     background-color: @bgw;
     padding: 23px 14px;
     border-radius: 4px;
+    overflow: hidden;
     .servce-info {
         margin-left: 10px;
+        overflow: hidden;
+        flex-grow: 1;
     }
 
     &:active {

+ 1 - 0
src/pagesImt/ServiceDetail.vue

@@ -128,6 +128,7 @@ export default {
         color: #292c33;
         line-height: 24px;
         margin-top: 10px;
+        text-align: justify;
     }
 }
 

+ 14 - 2
src/pagesMine/Enter.vue

@@ -36,7 +36,7 @@
         </scroll-view>
 
         <fixed-button>
-            <van-button :color="$colors.warn" block>请在PC端进行入驻</van-button>
+            <van-button :color="$colors.warn" @click="showDiloag" block>请在PC端进行入驻</van-button>
         </fixed-button>
 
         <van-popup :show="show" round position="bottom" @close="show = false">
@@ -47,11 +47,13 @@
                 </div>
             </div>
         </van-popup>
+        <van-dialog id="van-dialog" />
     </div>
 </template>
 <script>
 import FixedButton from '../components/FixedButton.vue';
 import Process from '../components/Process.vue';
+import Dialog from '../native/vant/dialog/dialog';
 export default {
     components: { Process, FixedButton },
     data() {
@@ -136,7 +138,17 @@ export default {
             ]
         };
     },
-    onShow() {}
+    methods: {
+        showDiloag() {
+            Dialog.confirm({
+                title: '请在PC端访问',
+                message: '详情咨询:021-60797117',
+                confirmButtonColor: this.$colors.warn,
+                showCancelButton: false,
+                confirmButtonText: '我知道了'
+            });
+        }
+    }
 };
 </script>
 <style lang="less">

+ 4 - 4
src/pagesProduct/Contrast.vue

@@ -10,7 +10,7 @@
                 left-icon="volume-o"
                 wrapable
                 color="#565B66"
-                background="@bg"
+                :background="$colors.bg"
                 :scrollable="false"
                 custom-class="my-notice"
                 text="产品对比仅限同类别产品进行对比,若要更换类别,请先将列表中的产品删除,再次添加产品则会变为新产品的类别"
@@ -63,13 +63,13 @@
             </div>
         </van-dialog>
 
-        <fixed-button :btnList="true">
-            <van-button
+        <fixed-button>
+            <!-- <van-button
                 block
                 :radius="4"
                 @click="navigateTo('/pagesProduct/FilterVendor?categoryIds=' + (category.id || ''))"
                 >添加产品</van-button
-            >
+            > -->
             <van-button block :color="$colors.warn" :radius="4" :disabled="chooseIds.length < 2" @click="compare"
                 >开始对比({{ chooseIds.length }})</van-button
             >

+ 108 - 15
src/pagesProduct/Detail.vue

@@ -79,10 +79,22 @@
                     :offset-top="barHeight"
                 >
                     <van-tab title="图文详情">
-                        <div class="detail-content">
+                        <div class="detail-content first">
+                            <van-button
+                                class="imgList-btn"
+                                size="small"
+                                :color="$colors.warn"
+                                round
+                                icon="photo"
+                                plain
+                                v-if="showBtn && detailImgList.length > 0"
+                                @click="showImgs"
+                            ></van-button>
                             <div class="tips" v-html="introduction"></div>
                             <!-- <rich-text v-if="detailImg" :nodes="detailImg"></rich-text> -->
-                            <div v-html="detailImg" v-if="detailImg"></div>
+                            <div class="detailhtml">
+                                <div v-html="detailImg" v-if="detailImg"></div>
+                            </div>
                         </div>
                     </van-tab>
                     <van-tab title="详细参数">
@@ -91,7 +103,9 @@
                         </div>
                     </van-tab>
                     <van-tab title="PDF资料" v-if="pdf.length > 0">
-                        正在打开pdf...
+                        <div class="detail-content">
+                            正在打开pdf...
+                        </div>
                     </van-tab>
                 </van-tabs>
             </div>
@@ -145,21 +159,31 @@ export default {
             vendorInfo: {},
             hotActive: 0,
             detailTop: 0,
-            collectionType: 'PRODUCT'
+            collectionType: 'PRODUCT',
+            detailImgList: [],
+            showBtn: false,
+            screenHeight: 300
         };
     },
     mixins: [collection],
     computed: {
         ...mapState(['intentionList', 'barHeight']),
         banners() {
+            let list = [];
             if (this.productInfo.img) {
-                return this.productInfo.img.split(',').map((item, index) => {
+                list = this.productInfo.img.split(',').map((item, index) => {
                     return {
                         img: item
                     };
                 });
             }
-            return [];
+
+            if (this.productInfo.video) {
+                list.splice(0, 0, {
+                    img: this.productInfo.video
+                });
+            }
+            return list;
         },
         applicationField() {
             let list = this.productInfo.applicationField ? [...this.productInfo.applicationField] : [];
@@ -213,6 +237,7 @@ export default {
                 .get(`/product/getDto/${options.id}`)
                 .then(res => {
                     this.productInfo = res;
+                    this.getImgList(res.detailImg);
                     return this.$http.get('/vendorInfo/getHome/' + res.vendorInfoId);
                 })
                 .then(res => {
@@ -224,8 +249,19 @@ export default {
             }
         }
     },
-    onPageScroll() {},
+    onPageScroll(e) {
+        if (e.scrollTop > this.detailTop - this.screenHeight + 300) {
+            this.showBtn = true;
+        } else {
+            this.showBtn = false;
+        }
+    },
     onReady() {
+        wx.getSystemInfo({
+            success: res => {
+                this.screenHeight = res.screenHeight;
+            }
+        });
         setTimeout(() => {
             wx.createSelectorQuery()
                 .select('#main')
@@ -248,24 +284,28 @@ export default {
                 duration: 300
             });
             this.hotActive = e.detail.index;
-            console.log(this.pdf);
             if (e.detail.index === 2) {
                 wx.showActionSheet({
                     itemList: [...this.pdf].map((item, index) => {
-                        console.log(item);
-                        return '查看pdf文件' + item.name;
+                        const name = item.name.indexOf('http') !== -1 ? `文件${index + 1}` : item.name;
+                        return name;
                     }),
                     success: res => {
-                        this.hotActive = 0;
+                        this.$loading('加载中...');
                         wx.downloadFile({
                             url: this.pdf[res.tapIndex].url,
+                            fileType: 'pdf',
                             success: res => {
+                                this.hotActive = 0;
+                                console.log(res);
                                 const filePath = res.tempFilePath;
-
                                 wx.openDocument({
                                     filePath: filePath,
                                     success: res => {}
                                 });
+                            },
+                            complete: () => {
+                                this.$loading.close();
                             }
                         });
                     },
@@ -310,22 +350,49 @@ export default {
             wx.openLocation({
                 latitude: 31.298919,
                 longitude: 121.629521,
-                name: 'imt机床展示区',
+                name: '外高桥智能制造服务产业园',
                 address: '中国(上海)自由贸易试验区富特东三路526号'
             });
+        },
+        getImgList(detailImg) {
+            if (detailImg) {
+                this.detailImgList = detailImg
+                    .split('<img ')
+                    .map(item => {
+                        return item.split('/>')[0];
+                    })
+                    .map(item => {
+                        return item.split('src="').length > 1 ? item.split('src="')[1] : '';
+                    })
+                    .map(item => {
+                        return item.split('"')[0];
+                    })
+                    .filter(item => {
+                        return item;
+                    });
+            } else {
+                this.detailImgList = [];
+            }
+        },
+        showImgs() {
+            if (this.detailImgList.length > 0) {
+                wx.previewImage({
+                    current: this.detailImgList[0], // 当前显示图片的http链接
+                    urls: [...this.detailImgList] // 需要预览的图片http链接列表
+                });
+            }
         }
     }
 };
 </script>
 <style lang="less">
 .main {
-    background-color: @bgw;
-
     .tips {
         font-size: 14px;
         color: #292c33;
         line-height: 24px;
         padding: 20px 16px;
+        font-weight: bold;
     }
 }
 .info {
@@ -436,6 +503,19 @@ export default {
     min-height: calc(100vh - 105px - 80rpx);
     padding: 20px 16px;
     box-sizing: border-box;
+
+    &.first {
+        background-color: @bg;
+        padding: 0 0;
+        .tips {
+            background-color: @bgw;
+            margin-bottom: 16px;
+        }
+        .detailhtml {
+            background-color: @bgw;
+            padding: 20px 16px;
+        }
+    }
 }
 
 .detaiImg {
@@ -505,4 +585,17 @@ export default {
         }
     }
 }
+
+.imgList-btn {
+    position: fixed;
+    right: 10px;
+    bottom: 15vh;
+    .van-button {
+        background-color: @bgw;
+        z-index: 200;
+        --button-small-min-width: 30px;
+        --button-border-width: 0px;
+        box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.1);
+    }
+}
 </style>

+ 16 - 11
src/pagesProduct/FilterVendor.vue

@@ -65,9 +65,13 @@ export default {
         indexList() {
             return [
                 ...new Set(
-                    [...this.nameList].map(item => {
-                        return item.spell('first', 'up');
-                    })
+                    [...this.list]
+                        .map(item => {
+                            return item.first[0].toUpperCase();
+                        })
+                        .sort((a, b) => {
+                            return a > b ? 1 : -1;
+                        })
                 )
             ];
         },
@@ -77,7 +81,7 @@ export default {
                 return [
                     item,
                     list.filter(child => {
-                        return child.name[0].spell('first', 'up') === item;
+                        return child.first[0] === item;
                     })
                 ];
             });
@@ -95,13 +99,14 @@ export default {
     methods: {
         getList() {
             this.$http.get('/vendorInfo/allList').then(res => {
-                this.list = res
-                    .map(item => {
-                        return { ...item, name: this.getName(item, ['chCompanyName', 'enCompanyName']) };
-                    })
-                    .sort((a, b) => {
-                        return cnchar.compareSpell(a.name[0], b.name[0]) === 'more' ? 1 : -1;
-                    });
+                this.list = res.map(item => {
+                    return {
+                        ...item,
+                        name: this.getName(item, ['chCompanyName', 'enCompanyName']),
+                        first: cnchar.spell(this.getName(item, ['chCompanyName', 'enCompanyName'], 'first', 'up'))
+                    };
+                });
+                console.log(this.list);
             });
         }
     }

+ 35 - 5
src/pagesVendor/About.vue

@@ -33,14 +33,18 @@
                         v-for="(item, index) in categoriesList"
                         :key="item.id"
                         :style="{ backgroundColor: colors[index % colors.length] }"
-                        @click="navigateTo('/pagesHome/ProductList', false)"
+                        @click="changeActive"
                     >
                         {{ item }}
                     </div>
                 </div>
             </div>
 
-            <div class="box" v-if="applications.length > 0" :style="{ order: decorationInfo.applicationOrder }">
+            <div
+                class="box scrollBox"
+                v-if="applications.length > 0"
+                :style="{ order: decorationInfo.applicationOrder }"
+            >
                 <div class="box-title">应用领域</div>
                 <scroll-view :scroll-x="true">
                     <div class="applications">
@@ -50,6 +54,7 @@
                                 :name="getName(item)"
                                 :id="item.id"
                                 :storeId="info.id"
+                                @goDetail="changeActive"
                             ></application>
                         </block>
 
@@ -58,7 +63,7 @@
                 </scroll-view>
             </div>
 
-            <div class="box" v-if="cases.length > 0" :style="{ order: decorationInfo.caseOrder }">
+            <div class="box scrollBox" v-if="cases.length > 0" :style="{ order: decorationInfo.caseOrder }">
                 <div class="box-title">成功案例</div>
                 <scroll-view :scroll-x="true">
                     <div class="applications">
@@ -72,7 +77,7 @@
             </div>
             <div class="imgList" :style="{ order: decorationInfo.customAreaOrder }">
                 <block v-for="(item, index) in customAreaImgs" :key="index">
-                    <van-image :src="item" fit="widthFix" />
+                    <van-image :src="item" fit="widthFix" @click="choosePhoto(item)" />
                 </block>
             </div>
         </div>
@@ -161,6 +166,17 @@ export default {
                     this.decorationInfo = res.content[0];
                 }
             });
+    },
+    methods: {
+        changeActive() {
+            this.$emit('changeActive', 1);
+        },
+        choosePhoto(info) {
+            wx.previewImage({
+                current: info, // 当前显示图片的http链接
+                urls: [...this.customAreaImgs] // 需要预览的图片http链接列表
+            });
+        }
     }
 };
 </script>
@@ -192,6 +208,13 @@ export default {
         line-height: 24px;
         padding-bottom: 20px;
     }
+
+    &.scrollBox {
+        padding: 30px 0;
+        .box-title {
+            padding: 0 16px 20px;
+        }
+    }
 }
 
 .introduce {
@@ -221,10 +244,17 @@ export default {
 .applications {
     display: flex;
     flex-wrap: no-wrap;
-    padding: 20px 0;
+    padding: 20px 16px;
+    // margin: 0 -16px;
     .application + .application {
         margin-left: 10px;
     }
+
+    &::after {
+        content: '';
+        min-width: 16px;
+        height: 30px;
+    }
 }
 
 .auto-content {

+ 125 - 0
src/pagesVendor/Case.vue

@@ -0,0 +1,125 @@
+<config>
+{
+'navigationBarTitleText': '',
+'navigationStyle':'custom',
+'navigationBarTextStyle':'white',
+'backgroundColorTop': '#fff',
+'backgroundColorBottom': '#f5f7fa',
+'enablePullDownRefresh':false
+}
+</config>
+<template>
+    <div>
+        <custom-bar :pre="0" title="案例详情" :barTop="260"></custom-bar>
+        <banner :banners="banners" fixed :height="260" :radius="0"></banner>
+
+        <div class="main" id="main">
+            <!-- <h2>{{ info.title }}</h2> -->
+            <div class="title">{{ info.title }}</div>
+
+            <div class="detail">
+                <h2>案例详情</h2>
+
+                <div class="html" v-html="info.content"></div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import Banner from '../components/Banner.vue';
+import CustomBar from '../components/bar/CustomBar.vue';
+export default {
+    data() {
+        return {
+            informationId: 0,
+            info: {},
+            activityId: 0
+        };
+    },
+    computed: {
+        banners() {
+            return this.info.img
+                ? this.info.img.split(',').map(item => {
+                      return {
+                          img: item
+                      };
+                  })
+                : [];
+        },
+        isActivity() {
+            if (this.info.type === 'INDUSTRY_ACTIVITIES') {
+                return true;
+            } else {
+                return false;
+            }
+        },
+        session() {
+            return this.info.session || [];
+        },
+        isEnd() {
+            return this.info.isEnd || false;
+        }
+    },
+    onLoad(options) {
+        this.informationId = options.id;
+        this.$http.get('/successCase/get/' + options.id).then(res => {
+            this.info = res;
+        });
+    },
+    onShow() {},
+    onPageScroll() {},
+    components: {
+        Banner,
+        CustomBar
+    }
+};
+</script>
+<style lang="less">
+.main {
+    padding: 16px;
+    .title {
+        font-size: 18px;
+        font-weight: bold;
+        color: #000000;
+        line-height: 28px;
+        padding-bottom: 5px;
+    }
+}
+.activity-info {
+    display: flex;
+    margin-top: 15px;
+    align-items: center;
+    .name {
+        font-size: 14px;
+        color: #bcc1cc;
+        line-height: 22px;
+        margin-right: 4px;
+    }
+
+    .text {
+        font-size: 14px;
+        color: #000000;
+        line-height: 22px;
+    }
+    .sessions {
+        display: flex;
+        .session-item {
+            height: 36px;
+            font-size: 14px;
+            color: #000000;
+            line-height: 36px;
+            padding: 0 10px;
+            border-radius: 4px;
+            border: 1px solid #cfd5e1;
+            margin-right: 12px;
+        }
+    }
+}
+
+.detail {
+    padding: 50px 0;
+    .html {
+        padding-top: 14px;
+    }
+}
+</style>

+ 9 - 1
src/pagesVendor/Detail.vue

@@ -51,7 +51,12 @@
                         <van-tab title="新闻资讯"> </van-tab>
                     </van-tabs>
                 </van-sticky>
-                <about v-if="active === 0" :info="vendorInfo" :showConnect="showConnect"></about>
+                <about
+                    v-if="active === 0"
+                    :info="vendorInfo"
+                    :showConnect="showConnect"
+                    @changeActive="changeActive"
+                ></about>
                 <product v-else-if="active === 1" :vendorInfo="vendorInfo" :fixedTop="searchTop"></product>
                 <news v-else-if="active === 2" :vendorInfo="vendorInfo"></news>
             </div>
@@ -122,6 +127,9 @@ export default {
             } else {
                 this.showConnect = true;
             }
+        },
+        changeActive(index) {
+            this.active = index;
         }
     },
     onLoad(options) {