Browse Source

商品详情

GXL 1 year ago
parent
commit
446180e617

+ 4 - 23
src/views/navigation.vue

@@ -253,18 +253,7 @@ export default {
             //左上轮播图
             leftTopPics: [],
             //右上跳转模块
-            rightTopLink: [
-                { name: "市场1", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场2", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场3", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场4", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场5", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场6", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场7", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场8", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场9", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-                { name: "市场10", icon: "https://hzl.willalp.com:9000/willalpbucket/2.png" },
-            ],
+            rightTopLink: [],
             //左上机构咨询
             leftTopOne: [],
             //左下角平台咨询
@@ -275,12 +264,6 @@ export default {
             rightMiddle: undefined,
             leftBottom: undefined,
             rightBottom: undefined,
-            // dataList: [
-            //     { title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
-            //     { title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
-            //     { title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
-            //     { title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
-            // ],
             dataList2: [
                 { tag: "党政要闻", title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
                 { tag: "党政要闻", title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
@@ -289,11 +272,7 @@ export default {
                 { tag: "党政要闻", title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
                 { tag: "党政要闻", title: "这是标题这是标题", createTime: "2024-09-07 15:23:22" },
             ],
-            ptzxList: [
-                { coverPic: "https://ts.willalp.com:9002/willalpbucket/微信图片_2024032809233720240328092531.png", title: "清明放假通知", sketch: "放假时间:4月4-6日放假,共3天。4月7日(星期日)上班。" },
-                { coverPic: "https://ts.willalp.com:9002/willalpbucket/微信图片_2024032809233720240328092531.png", title: "清明放假通知", sketch: "放假时间:4月4-6日放假,共3天。4月7日(星期日)上班。" },
-                { coverPic: "https://ts.willalp.com:9002/willalpbucket/微信图片_2024032809233720240328092531.png", title: "清明放假通知", sketch: "放假时间:4月4-6日放假,共3天。4月7日(星期日)上班。" }
-            ],
+            ptzxList: [],
         };
     },
     beforeCreate() {
@@ -374,6 +353,7 @@ export default {
             this.detail1 = undefined;
             this.detailTitle1 = "机构资讯详情";
             this.detail1 = this.leftTopOne[index].link;
+            //控制富文本图片大小
             this.detail1 = this.detail1.replace('<img', '<img style="max-width:100%;height:100%"');
             this.openDetail1 = true;
         },
@@ -390,6 +370,7 @@ export default {
             this.detailTitle1 = "平台资讯详情";
             getPlatformInfo(id).then(res => {
                 this.detail1 = res.data.content;
+                //控制富文本图片大小
                 this.detail1 = this.detail1.replace('<img', '<img style="max-width:100%;height:100%"');
                 this.openDetail1 = true;
             })

+ 27 - 10
src/views/supplier/goodsDetail/components/picListChange.vue

@@ -12,7 +12,7 @@
         <img src="./photo/left.png" alt="" style="width: 4%;margin:0;cursor: pointer;" @click="gePre()">
       </div>
       <div class="center">
-        <div class="picBottomDiv" v-for="(item, index) in showList"
+        <div class="picBottomDiv" v-for="(item, index) in getPic()"
           :style="{ 'border': index == currentIndex ? '2px #3CAAF6 solid' : '' }">
           <img class="picBottomList" :src="item" :key="index" alt="">
         </div>
@@ -31,8 +31,11 @@ export default {
   props: {
     picList: {
       type: Array,
-      default: [],
     },
+    // showList:{
+    //   type: Array,
+    //   default: [],
+    // }
   },
   data() {
     return {
@@ -42,9 +45,14 @@ export default {
     };
   },
   methods: {
+    getPic() {
+      this.spliceShowList();
+      return this.showList;
+    },
     /** 更改轮播图展示图片 */
     changePic(index) {
-      this.currentIndex = index;
+      this.currentIndex = index
+      //轮播展示图片只显示4张
       if (index < 4) {
         this.showList = this.picList.slice(0, 4);
       } else {
@@ -60,18 +68,27 @@ export default {
     goNext() {
       this.$refs.carousel.next();
     },
+    spliceShowList() {
+      if (this.picList.length > 4) {
+        this.showList = this.picList.slice(0, 4);
+      } else {
+        this.showList = this.picList;
+      }
+    },
+  },
+  watch: {
   },
-  watch: {},
   computed: {},
   components: {},
+  beforeCreate() {
+   
+  },
   created() {
-    if (this.picList.length > 4) {
-      this.showList = this.picList.slice(0, 4);
-    } else {
-      this.showList = this.picList;
-    }
+
+  },
+  mounted() {
+    
   },
-  mounted() { },
 };
 </script>
 

+ 9 - 9
src/views/supplier/goodsDetail/detail.vue

@@ -123,15 +123,15 @@ export default {
     },
     data() {
         return {
-            goodsDetail: {name:"商品名称"},
+            goodsDetail: { name: "商品名称" },
             bottomChoice: '1',
             picList: [
-                { id: "1", picture: "https://ts.willalp.com:9002/willalpbucket/微信图片_2024032809233720240328092531.png" },
-                { id: "2", picture: "http://60.188.249.11:9002/willalpbucket/fm0220240407170915.jpg" },
-                { id: "3", picture: "http://60.188.249.11:9002/willalpbucket/lunbo320240402180418.png" },
-                { id: "4", picture: "http://60.188.249.11:9002/willalpbucket/lunbo120240402180243.png" },
-                { id: "5", picture: "http://60.188.249.11:9002/willalpbucket/lunbo420240403110118.png" },
-                { id: "6", picture: "http://60.188.249.11:9002/willalpbucket/%E5%85%B3%E5%BF%83%E5%85%B3%E7%88%B120240403110925.png" },
+                "https://ts.willalp.com:9002/willalpbucket/微信图片_2024032809233720240328092531.png",
+                "http://60.188.249.11:9002/willalpbucket/fm0220240407170915.jpg",
+                "http://60.188.249.11:9002/willalpbucket/lunbo320240402180418.png",
+                "http://60.188.249.11:9002/willalpbucket/lunbo120240402180243.png",
+                "http://60.188.249.11:9002/willalpbucket/lunbo420240403110118.png",
+                "http://60.188.249.11:9002/willalpbucket/%E5%85%B3%E5%BF%83%E5%85%B3%E7%88%B120240403110925.png",
             ],
         }
     },
@@ -145,7 +145,7 @@ export default {
     },
     methods: {
         getDetail() {
-            this.goodsDetail = {name:"商品名称"};
+            this.goodsDetail = { name: "商品名称" };
             getGoodsDetail(this.id).then((response) => {
                 this.goodsDetail = response.data;
                 if (typeof this.goodsDetail.platPrice == 'number') {
@@ -160,7 +160,7 @@ export default {
                 if (this.goodsDetail.picture) {
                     this.goodsDetail.picture = this.goodsDetail.picture.split(",")
                 }
-                console.log(this.goodsDetail)
+                console.log(">>>>>>>>>>>>", this.goodsDetail)
             });
         },
     }