Browse Source

首页添加通告

zhaoxiaohai 3 years ago
parent
commit
903fa6cb74

+ 2 - 2
pages/portal/index.wxml

@@ -60,7 +60,7 @@
         <view class="new-product-title">
             <view></view> 窗帘布新品 <view></view>
         </view>
-        <swiper class="new-product-swiper" autoplay circular current='{{newProductIndex1}}' indicator-dots indicator-color='rgba(216,216,216,.58)' indicator-active-color='#57C7D3' bindchange='newProduct1'>
+        <swiper class="new-product-swiper" circular current='{{newProductIndex1}}' indicator-dots indicator-color='rgba(216,216,216,.58)' indicator-active-color='#57C7D3' bindchange='newProduct1'>
             <swiper-item wx:key="index" wx:for="{{newProduct1}}">
                 <image src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
             </swiper-item>
@@ -71,7 +71,7 @@
         <view class="new-product-title">
             <view></view> 沙发布新品 <view></view>
         </view>
-        <swiper class="new-product-swiper" autoplay circular current='{{newProductIndex2}}' indicator-dots indicator-color='rgba(216,216,216,.58)' indicator-active-color='#57C7D3' bindchange='newProduct2'>
+        <swiper class="new-product-swiper" circular current='{{newProductIndex2}}' indicator-dots indicator-color='rgba(216,216,216,.58)' indicator-active-color='#57C7D3' bindchange='newProduct2'>
             <swiper-item wx:key="index" wx:for="{{newProduct2}}">
                 <image src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
             </swiper-item>

+ 38 - 0
pages/tabbar-pages/home/index.js

@@ -72,8 +72,21 @@ Page({
             wx.navigateTo({
                 url: '/pages/businessPartner/index',
             })
+        } else if (detail == '通告') {
+            wx.navigateTo({
+                url: '/pages/annunciate/index',
+            })
         }
     },
+    /* 跳转详情 */
+    toDetails(e) {
+        const {
+            index
+        } = e.currentTarget.dataset;
+        wx.navigateTo({
+            url: '/pages/annunciate/details?id=' + this.data.annunciateList[index].tnoticeid + '&type=0',
+        })
+    },
     /**
      * 生命周期函数--监听页面加载
      */
@@ -150,6 +163,31 @@ Page({
                 partnerList
             })
         })
+        /* 获取通告 */
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.notice.notice",
+            "method": "query_noticeList",
+            "content": {
+                "getdatafromdbanyway": true,
+                "pageNumber": 1,
+                "pageSize": 8,
+                "where": {
+                    "condition": "",
+                    "ftype": ""
+                }
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            let list = handleList.annunciateCheckdate(res.data),
+                data = handleList.imageType(list, 'cover');
+            this.setData({
+                annunciateList: data
+            })
+        })
         /* 获取轮播图 */
         const bannerList = wx.getStorageSync('bannerDataList').filter(value => value.flocation == 'home_head');
         this.setData({

+ 29 - 2
pages/tabbar-pages/home/index.wxml

@@ -18,6 +18,33 @@
     </view>
 </My_DisplayBox>
 
+<My_DisplayBox title="通告" bind:getExhibitionTitle="getExhibitionTitle">
+    <!-- 标题前图片 -->
+    <image slot="display-box-img" class="display-title_image" src="/static/icon-02.png" mode="aspectFit"></image>
+    <!-- 列表展示区 -->
+    <view class="ann-box" wx:for="{{annunciateList}}" style="margin-top: {{index==0?0:28}}rpx;" 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>
+</My_DisplayBox>
+
 <My_DisplayBox title="最新供需" bind:getExhibitionTitle="getExhibitionTitle">
     <!-- 标题前图片 -->
     <image slot="display-box-img" class="display-title_image" src="/static/icon-03.png" mode="aspectFit"></image>
@@ -26,12 +53,12 @@
     <!-- 列表展示区 -->
     <view slot="display-box-showList">
         <My_DisplayItem wx:for="{{productList}}" content="{{item}}" padTop="{{index==0?'0':'20'}}" borTop="{{index==0?'0':'2'}}" anonymity="true">
-            <!-- <view class="display-box-showList-button-box" slot="button">
+            <view class="display-box-showList-button-box" slot="button">
                 <van-button custom-class="display-box-showList-button" catchtap="contact" color="linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%)"></van-button>
                 <view class="display-box-showList-button-text">
                     一键联系
                 </view>
-            </view> -->
+            </view>
         </My_DisplayItem>
     </view>
 </My_DisplayBox>

+ 85 - 0
pages/tabbar-pages/home/index.wxss

@@ -60,4 +60,89 @@
 .businessPartnerBanner>swiper-item {
     width: 100%;
     height: 300rpx;
+}
+
+/* 盒子 */
+.ann-box {
+    display: flex;
+    width: 662rpx;
+    height: 162rpx;
+    padding-bottom: 30rpx;
+    border-bottom: 1px solid rgba(151, 151, 151, .1);
+    margin-top: 28rpx;
+}
+
+.ann-img {
+    width: 162rpx;
+    height: 162rpx;
+    border-radius: 10rpx;
+    overflow: hidden;
+    flex-shrink: 0;
+    margin-right: 20rpx;
+}
+
+.ann-img>image {
+    width: 100% !important;
+    height: 100% !important;
+}
+
+.ann-text {
+    flex: 1;
+    height: 100%;
+}
+
+.ann-text>view {
+    max-width: 480rpx;
+}
+
+.ann-text-title {
+    font-family: PingFangSC-Medium, PingFang SC;
+    height: 40rpx;
+    font-size: 28rpx;
+    font-weight: 550;
+    color: #000000;
+    line-height: 40rpx;
+}
+
+.ann-text-center {
+    width: 480rpx;
+    height: 54rpx;
+    font-size: 24rpx;
+    color: #333333;
+    line-height: 27rpx;
+    opacity: .7;
+    margin-top: 10rpx;
+    white-space: pre-line;
+}
+
+.ann-text-bottom {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    height: 28rpx;
+    font-size: 20rpx;
+    color: #333333;
+    line-height: 28rpx;
+    opacity: .7;
+    margin-top: 16rpx;
+}
+
+
+.userMsg {
+    display: flex;
+    align-items: center;
+    height: 28rpx;
+    line-height: 28rpx;
+}
+
+.userMsg>.img {
+    width: 28rpx;
+    height: 28rpx;
+    margin-right: 8rpx;
+}
+
+.userMsg>.img image {
+    width: 100%;
+    height: 100%;
+    border-radius: 50%;
 }