Browse Source

修改图片公共连接

wangfumin 3 tháng trước cách đây
mục cha
commit
b53fe3bfd6

+ 3 - 2
pages/collection/index.js

@@ -1,6 +1,6 @@
 // pages/collection/index.js
 const { museumApi } = require('../../utils/api.js');
-const { navigateToWebview } = require('../../utils/util.js');
+const { navigateToWebview, urlImg } = require('../../utils/util.js');
 
 Page({
   /**
@@ -20,7 +20,8 @@ Page({
       { id: '2', name: '铁器、其他金属器' },
       { id: '3', name: '文物、宣传品' },
       { id: '4', name: '其他' },
-    ]
+    ],
+    urlImg: urlImg
   },
 
   /**

+ 1 - 1
pages/collection/index.wxml

@@ -33,7 +33,7 @@
     <view class="collection-list">
       <view class="collection-item" wx:for="{{artifactList}}" wx:key="artifactId" bindtap="goCollectDetail" data-item="{{item}}">
         <view class="item-image-container">
-          <image class="item-image" src="{{item.img}}" mode="aspectFill"></image>
+          <image class="item-image" src="{{urlImg + item.img}}" mode="aspectFill"></image>
           <view class="view-button">
             <text>查看</text>
             <text class="arrow">→</text>

+ 3 - 2
pages/exhibition/index.js

@@ -1,6 +1,6 @@
 // pages/exhibition/index.js
 const { museumApi } = require('../../utils/api.js');
-const { navigateToWebview } = require('../../utils/util.js');
+const { navigateToWebview, urlImg } = require('../../utils/util.js');
 
 Page({
   /**
@@ -13,7 +13,8 @@ Page({
     loading: false, // 加载状态
     hasMore: true, // 是否还有更多数据
     currentPage: 1, // 当前页码
-    pageSize: 10 // 每页数量
+    pageSize: 10, // 每页数量
+    urlImg: urlImg
   },
 
   /**

+ 1 - 1
pages/exhibition/index.wxml

@@ -33,7 +33,7 @@
   <!-- 展览列表 -->
   <view class="exhibition-list">
     <view class="exhibition-item" wx:for="{{exhibitionList}}" wx:key="exhibitId" bindtap="onExhibitionTap" data-item="{{item}}">
-      <image class="exhibition-image" src="{{item.img}}" mode="aspectFill"></image>
+      <image class="exhibition-image" src="{{urlImg + item.img}}" mode="aspectFill"></image>
       <view class="exhibition-content">
         <text class="exhibition-title">{{item.title || '记忆与传承的艺术史'}}</text>
       </view>

+ 1 - 1
pages/index/news/news.wxml

@@ -15,7 +15,7 @@
     <view class="scroll-wrapper">
       <view class="all-item" wx:for="{{newsList}}" wx:key="informationId">
         <view class="exhibition-item" bindtap="viewNews" data-item="{{item}}">
-          <image src="{{urlImg + item.indexImg}}" class="exhibition-img" mode="aspectFill"></image>
+          <image src="{{urlImg + item.infoImg}}" class="exhibition-img" mode="aspectFill"></image>
           <image src="https://klmybwg.4dage.com/mini/wxImg/indexPage/Frame.png" class="bg-img" mode="aspectFit"></image>
           <view class="exhibition-info">
             <view class="exhibition-title">{{ item.title || '暂无标题' }}</view>

+ 1 - 6
pages/user/map/index.wxss

@@ -187,11 +187,6 @@ p {
   color: #584735;
 }
 
-image {
-  max-width: 100%;
-  height: 100rpx;
-  margin: 20rpx 0;
-}
 
 .map-button {
   position: fixed;
@@ -217,7 +212,7 @@ image {
   position: absolute;
   top: 50%;
   left: 50%;
-  transform: translate(-50%, -50%);
+  transform: translate(-50%, -78%);
   display: flex;
   justify-content: center;
   align-items: center;

+ 1 - 1
project.private.config.json

@@ -3,7 +3,7 @@
   "projectname": "karamay_wx",
   "setting": {
     "compileHotReLoad": true,
-    "urlCheck": false,
+    "urlCheck": true,
     "coverView": true,
     "lazyloadPlaceholderEnable": false,
     "skylineRenderEnable": false,

+ 3 - 2
utils/wxParse/wxParse.js

@@ -56,10 +56,11 @@ function wxParseImgTap(e) {
   var that = this;
   var nowImgUrl = e.target.dataset.src;
   var tagFrom = e.target.dataset.from;
+  console.log(that.data[tagFrom], 8888)
   if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
     wx.previewImage({
-      current: nowImgUrl, // 当前显示图片的http链接
-      urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
+      current: 'https://klmybwg.4dage.com' + nowImgUrl, // 当前显示图片的http链接
+      urls: ['https://klmybwg.4dage.com' + nowImgUrl] // 需要预览的图片http链接列表
     })
   }
 }

+ 2 - 2
utils/wxParse/wxParse.wxml

@@ -13,12 +13,12 @@
 <template name="wxParseVideo">
   <!--增加video标签支持,并循环添加-->
   <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}">
-    <video class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{item.attr.src}}"></video>
+    <video class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{'https://klmybwg.4dage.com' + item.attr.src}}"></video>
   </view>
 </template>
 
 <template name="wxParseImg">
-  <image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{'https://klmybwg.4dage.com' + item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" mode="widthFix" style="width:{{item.width}}px;"
+  <image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{'https://klmybwg.4dage.com' + item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" mode="widthFix" style="width:100%;"
   />
 </template>
 

+ 1 - 1
utils/wxParse/wxParse.wxss

@@ -27,7 +27,7 @@ view{
     padding: 0;
 }
 /*//标题 */
-.wxParse-div{margin: 0;padding: 0;}
+.wxParse-div{width:100%;margin: 0;padding: 0;}
 .wxParse-h1{ font-size:2em; margin: .67em 0 }
 .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
 .wxParse-h3{ font-size:1.17em; margin: .83em 0 }