zhaoxiaohai 3 years ago
parent
commit
7aa347e53a

+ 40 - 0
pages/annunciate/annunciateList/index.js

@@ -0,0 +1,40 @@
+// pages/annunciate/annunciateList/index.js
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        list: {
+            type: Array
+        },
+        ftype: {
+            type: Number,
+            value: 0
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        /* 跳转详情 */
+        toDetails(e) {
+            const {
+                index
+            } = e.currentTarget.dataset;
+            wx.navigateTo({
+                url: '/pages/annunciate/details?id=' + this.data.list[index].tnoticeid + '&type=' + this.data.ftype,
+            })
+        },
+    }
+})

+ 0 - 0
pages/portal/annunciateList/index.json → pages/annunciate/annunciateList/index.json


+ 21 - 0
pages/annunciate/annunciateList/index.wxml

@@ -0,0 +1,21 @@
+<view class="ann-box" wx:for="{{list}}" data-index="{{index}}" catchtap="toDetails">
+        <view class="ann-img">
+            <image wx:if="{{item.attinfos[0].fobsurl}}" src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
+            <image src="/static/tacitly-approve/MRproduct.png" mode="aspectFill"></image>
+        </view>
+        <view class="ann-text">
+            <view class="ann-text-title  u-line-1">{{item.ftitle}}</view>
+            <view class="ann-text-center u-line-2">{{item.fsummary}}</view>
+            <view class="ann-text-bottom u-line-1" style="margin-top: 22rpx;">
+                <view class="userMsg">
+                    <view class="img">
+                        <image wx:if="{{item.headportraiturl}}" src="{{item.headportraiturl}}"></image>
+                        <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
+                    </view>
+                    <view class="u-line-1" style="max-width: 160rpx; padding-top: 3rpx;">{{item.fbrand!=null?item.fbrand:'匿名用户'}}</view>
+                    <view style="margin-left: 8rpx; padding-top: 3rpx;">{{item.checkdate}}</view>
+                </view>
+                <view>{{item.freadcount}}次浏览</view>
+            </view>
+        </view>
+    </view>

+ 0 - 0
pages/portal/annunciateList/index.wxss → pages/annunciate/annunciateList/index.wxss


+ 1 - 1
pages/annunciate/details.js

@@ -9,7 +9,7 @@ Page({
      * 页面的初始数据
      */
     data: {
-        pageType: {}, //类型 0 为广场进入 1为发布历史进入
+        pageType: {}, //类型 0 为广场进入 1为发布历史进入 2为门户进入
         tnoticeid: {}, //公告id
         msgObj: {}, //详情
         coverFiles: [], //封面

+ 2 - 1
pages/annunciate/index.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
-    "My_RoundedCornerButtonTabs": "/components/My_RoundedCornerButtonTabs/index"
+    "My_RoundedCornerButtonTabs": "/components/My_RoundedCornerButtonTabs/index",
+    "annunciateList": "./annunciateList/index"
   }
 }

+ 1 - 21
pages/annunciate/index.wxml

@@ -5,27 +5,7 @@
     <!-- 圆角按钮tabs -->
     <My_RoundedCornerButtonTabs list="{{roundedList}}" bind:tabsSelectedIitem="tabsSelectedIitem"></My_RoundedCornerButtonTabs>
     <!-- 列表展示区 -->
-    <view class="ann-box" wx:for="{{annunciateList}}" data-index="{{index}}" catchtap="toDetails">
-        <view class="ann-img">
-            <image wx:if="{{item.attinfos[0].fobsurl}}" src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
-            <image src="/static/tacitly-approve/MRproduct.png" mode="aspectFill"></image>
-        </view>
-        <view class="ann-text">
-            <view class="ann-text-title  u-line-1">{{item.ftitle}}</view>
-            <view class="ann-text-center u-line-2">{{item.fsummary}}</view>
-            <view class="ann-text-bottom u-line-1" style="margin-top: 22rpx;">
-                <view class="userMsg">
-                    <view class="img">
-                        <image wx:if="{{item.headportraiturl}}" src="{{item.headportraiturl}}"></image>
-                        <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
-                    </view>
-                    <view class="u-line-1" style="max-width: 160rpx; padding-top: 3rpx;">{{item.fbrand}}</view>
-                    <view style="margin-left: 8rpx; padding-top: 3rpx;">{{item.checkdate}}</view>
-                </view>
-                <view>{{item.freadcount}}次浏览</view>
-            </view>
-        </view>
-    </view>
+    <annunciateList list="{{annunciateList}}"></annunciateList>
     <My_pageReachBottom dummyStatus="{{annunciateList.length>=1}}" loadMore="{{pageNumber>=pageTotal}}"></My_pageReachBottom>
 </view>
 <!-- 历史发布 -->

+ 2 - 3
pages/annunciate/index.wxss

@@ -16,7 +16,7 @@
     height: 162rpx;
     padding-bottom: 30rpx;
     border-bottom: 1px solid rgba(151, 151, 151, .1);
-    margin-top: 28rpx;
+    margin: 28rpx auto 0;
 }
 
 .ann-img {
@@ -107,10 +107,9 @@
 }
 
 .userMsg {
+    height: 28rpx;
     display: flex;
     align-items: center;
-    height: 28rpx;
-    line-height: 28rpx;
 }
 
 .userMsg>.img {

+ 0 - 1
pages/portal/details.js

@@ -15,7 +15,6 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        console.log(options)
         //供需详情
         _Http.basic({
             "classname": "publicmethod.homepage.homepage",

+ 1 - 1
pages/portal/index.json

@@ -2,6 +2,6 @@
   "usingComponents": {
     "van-empty": "@vant/weapp/empty/index",
     "portalLice": "./portalLive/live",
-    "annunciateList": "./annunciateList/index"
+    "supplyanddemandList": "./supplyanddemandList/index"
   }
 }

+ 1 - 1
pages/portal/index.wxml

@@ -120,7 +120,7 @@
 </van-tabs>
 <!-- 列表展示区 -->
 <block wx:if="{{tabsActive!=0}}">
-    <annunciateList list='{{sadList}}'></annunciateList>
+    <supplyanddemandList list='{{sadList}}'></supplyanddemandList>
     <van-empty wx:if="{{1>sadList.length}}" description="暂无数据" />
 </block>
 <!-- 展厅照片 -->

+ 1 - 2
pages/portal/search.js

@@ -65,7 +65,6 @@ Page({
                     "ftype": ""
                 }
             }).then(res => {
-                console.log("搜索", res)
                 if (res.msg != '成功') return wx.showToast({
                     title: res.data,
                     icon: 'none'
@@ -73,7 +72,7 @@ Page({
                 let annunciateList = res.data.TNOTICE,
                     supplyanddemandList = res.data.tsupplyanddemand;
                 if (annunciateList.length != 0) annunciateList = processingData.annunciateCheckdate(annunciateList);
-                if (supplyanddemandList.length != 0) supplyanddemandList = processingData.checkdate(supplyanddemandList);
+                if (supplyanddemandList.length != 0) supplyanddemandList = processingData.annunciateCheckdate(supplyanddemandList);
                 this.setData({
                     annunciateList,
                     liveList: res.data.tlive,

+ 2 - 1
pages/portal/search.json

@@ -3,6 +3,7 @@
     "My_RoundedCornerButtonTabs": "../../components/My_RoundedCornerButtonTabs/index",
     "van-empty": "@vant/weapp/empty/index",
     "portalLice": "./portalLive/live",
-    "annunciateList": "./annunciateList/index"
+    "supplyanddemandList": "./supplyanddemandList/index",
+    "annunciateList": "/pages/annunciate/annunciateList/index"
   }
 }

+ 6 - 2
pages/portal/search.wxml

@@ -1,7 +1,7 @@
 <!-- 搜索框 -->
 <view class="search-box">
     <image src="/static/icon-09.png" />
-    <input type="text" placeholder="搜索关键字" placeholder-class="placeholder" confirm-type='search' bindblur='searchContent' bindconfirm='searchContent' />
+    <input type="text" placeholder="搜索关键字" placeholder-class="placeholder" confirm-type='search' bindconfirm='searchContent' />
 </view>
 <!-- tbas -->
 <view class="tabs">
@@ -13,7 +13,11 @@
 </view>
 <!-- 供需 -->
 <view hidden="{{ftype!=2}}">
-    <annunciateList list='{{supplyanddemandList}}'></annunciateList>
+    <supplyanddemandList list='{{supplyanddemandList}}'></supplyanddemandList>
+</view>
+<!-- 通告 -->
+<view hidden="{{ftype!=3}}">
+    <annunciateList list='{{annunciateList}}' ftype="2" />
 </view>
 <!-- 占位图 -->
 <van-empty wx:if="{{showPlaceholder}}" image="search" description="暂无内容" />

+ 0 - 1
pages/portal/annunciateList/index.js → pages/portal/supplyanddemandList/index.js

@@ -32,7 +32,6 @@ Component({
             wx.navigateTo({
                 url: '/pages/portal/details?tagentsid=' + data.tagentsid + '&tsupplyanddemandid=' + data.tsupplyanddemandid,
             })
-            console.log("报错")
         },
     }
 })

+ 4 - 0
pages/portal/supplyanddemandList/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 3 - 3
pages/portal/annunciateList/index.wxml → pages/portal/supplyanddemandList/index.wxml

@@ -16,14 +16,14 @@
         <view class="ann-text-title  u-line-1">[{{item.ftype}}]{{item.ftitle}}</view>
         <view class="ann-text-center u-line-2">{{item.fcontent}}</view>
         <view class="ann-text-bottom u-line-1" style="margin-top: 22rpx;">
-            <view class="userMsg">
+            <view class="userMsg" style="flex: 1;">
                 <view class="img">
                     <image wx:if="{{item.headportraiturl}}" src="{{item.headportraiturl}}"></image>
                     <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
                 </view>
-                <view class="u-line-1" style="max-width: 160rpx;  padding-top: 3rpx;">{{item.createby}}</view>
+                <view>{{item.createby}} {{item.checkdate}}</view>
             </view>
-            <view>{{item.checkdate}}</view>
+            <view style="flex-shrink: 0;">{{item.freadtimes}}次浏览</view>
         </view>
     </view>
 </view>

+ 1 - 0
pages/portal/supplyanddemandList/index.wxss

@@ -0,0 +1 @@
+@import "/pages/annunciate/index.wxss";