浏览代码

与后端联调完善农业云H5之“政策法规”列表展示、详情信息预览等功能

张启 4 年之前
父节点
当前提交
d64d89fca4
共有 3 个文件被更改,包括 16 次插入5 次删除
  1. 2 0
      main.js
  2. 14 5
      pages/regulations/index.vue
  3. 二进制
      static/agrcloud-images/agrcloud-empty-img.png

+ 2 - 0
main.js

@@ -1,6 +1,7 @@
 import Vue from 'vue';
 import App from './App';
 import store from './agrcloud-store';
+import indexConfig from '@/agrcloud-config/index.config';
 
 Vue.config.productionTip = false;
 
@@ -31,6 +32,7 @@ const msgbox = (title, icon = 'none', duration = 1500, mask = false) => {
 
 // 挂载全局vue属性
 Vue.prototype.$msgbox = msgbox;
+Vue.prototype.baseApiUrl = indexConfig.baseUrl;
 
 const app = new Vue({
   ...App,

+ 14 - 5
pages/regulations/index.vue

@@ -25,11 +25,20 @@
                 </view>
                 <view class="container-right">
                   <view class="right-content">
-                    <image
-                      src="../../static/test-images/test-image-01.png"
-                      mode="scaleToFill"
-                      class="right-content-image"
-                    />
+                    <template v-if="regulationsItem.artImage">
+                      <image
+                        :src="baseApiUrl + regulationsItem.artImage"
+                        mode="scaleToFill"
+                        class="right-content-image"
+                      />
+                    </template>
+                    <template v-else>
+                      <image
+                        src="@/static/agrcloud-images/agrcloud-empty-img.png"
+                        mode="scaleToFill"
+                        class="right-content-image"
+                      />
+                    </template>
                   </view>
                 </view>
                 <view style="clear: both;"></view>

二进制
static/agrcloud-images/agrcloud-empty-img.png