Browse Source

供需广场

zhaoxiaohai 3 years ago
parent
commit
ab8bc1407b

+ 15 - 0
components/My_SupplyAndDemandItemBox/index.js

@@ -15,6 +15,9 @@ Component({
         time: {
             type: String
         },
+        content: {
+            type: String
+        },
         imageList: {
             type: Array,
             value: []
@@ -22,6 +25,18 @@ Component({
         stopOnShow: {
             type: Function
         },
+        type: {
+            type: String
+        }
+    },
+    lifetimes: {
+        attached: function () {
+            // 在组件实例进入页面节点树时执行
+
+        },
+        detached: function () {
+            // 在组件实例被从页面节点树移除时执行
+        },
     },
 
     /**

+ 15 - 4
components/My_SupplyAndDemandItemBox/index.wxml

@@ -2,14 +2,25 @@
     <slot name='myState'></slot>
     <!-- 标题,按钮 -->
     <view class="title-and-but">
-        <view class="supply-and-demand-title u-line-1">{{title}}</view>
+        <view style="margin-left: -12rpx;" class="supply-and-demand-title u-line-1">{{title}}</view>
     </view>
+    <view class="content u-line-1" wx:if="{{content}}">{{content}}</view>
     <!-- 时间,内容 -->
     <view class="time-content">
-        <view class="supply-and-demand-time">{{time}}</view>
-        <view class="supply-and-demand-content">
-            <image wx:for="{{imageList}}" wx:if="{{index<3}}" src="{{item.fobsurl}}" mode="aspectFill" data-index="{{index}}" catchtap="previewImage"></image>
+        <view class="supply-and-demand-content" wx:if="{{imageList.length>=1}}">
+            <image wx:if="{{index<3}}" wx:for="{{imageList}}" src="{{item.fobsurl}}" mode="aspectFill" data-index="{{index}}" catchtap="previewImage"></image>
+        </view>
+        <view class="supply-and-demand-content" wx:else>
+            <image wx:if="{{type=='摄影摄像'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-01.png" mode="aspectFit"></image>
+            <image wx:elif="{{type=='产品策划'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-02.png" mode="aspectFit"></image>
+            <image wx:elif="{{type=='平面设计'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-03.png" mode="aspectFit"></image>
+            <image wx:elif="{{type=='寻找面料'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-04.png" mode="aspectFit"></image>
+            <image wx:elif="{{type=='商业培训'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-05.png" mode="aspectFit"></image>
+            <image wx:elif="{{type=='寻找主播'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-06.png" mode="aspectFit"></image>
+            <image wx:elif="{{type=='面料设计'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-07.png" mode="aspectFit"></image>
+            <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/tacitly-approve/MRproduct.png" mode="aspectFit"></image>
         </view>
+        <view class="supply-and-demand-time">{{time}}</view>
     </view>
     <!-- 数据,按钮 -->
     <view>

+ 15 - 6
components/My_SupplyAndDemandItemBox/index.wxss

@@ -34,9 +34,9 @@
     display: flex;
     justify-content: space-between;
     align-items: flex-end;
-    height: 95rpx;
+    height: 110rpx;
     width: 100%;
-    margin-top: 6rpx;
+    margin-top: 10rpx;
     border-bottom: 1px solid rgba(151, 151, 151, .2);
     padding-bottom: 10rpx;
     box-sizing: border-box;
@@ -45,7 +45,7 @@
 .supply-and-demand-time {
     font-size: 24rpx;
     color: rgba(0, 0, 0, .4);
-    margin-left: 16rpx;
+    margin-right: 14rpx;
 }
 
 .supply-and-demand-content {
@@ -53,8 +53,17 @@
 }
 
 .supply-and-demand-content>image {
-    width: 108rpx;
-    height: 84rpx;
-    border-radius: 8rpx;
+    width: 100rpx;
+    height: 100rpx;
+    border-radius: 10rpx;
     margin-left: 10rpx;
+}
+
+.content {
+    padding-left: 14rpx;
+    font-size: 24rpx;
+    color: rgba(0, 0, 0, .6);
+    height: 34rpx;
+    line-height: 34rpx;
+    margin-top: 8rpx;
 }

+ 5 - 5
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -20,17 +20,17 @@
                 </view>
             </view>
             <!-- 列表 -->
-            <My_SupplyAndDemandItemBox data-index="{{index}}" bindtap="jumpForDetails" wx:for="{{productList}}" title="【{{item.ftype}}】{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" bindstopOnShow="stopOnShow">
+            <My_SupplyAndDemandItemBox data-index="{{index}}" bindtap="jumpForDetails" wx:for="{{productList}}" title="[{{item.ftype}}]{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" type='{{item.ftype}}' content="{{item.fcontent}}" bindstopOnShow="stopOnShow">
                 <!-- 内容信息插槽 -->
                 <view slot="dataAndBut">
                     <view class="dataAndBut">
                         <view class="dataAndBut_data">
                             浏览次数:{{item.freadtimes}}次 意向沟通人数:{{item.fcommunicationtimes}}次
                         </view>
-                        <!-- <view class="dataAndBut_but">
+                        <view class="dataAndBut_but">
                             <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" catchtap="contact">一键联系</van-button>
                             <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut" catchtap="stop">{{item.fstatus}}</van-button>
-                        </view> -->
+                        </view>
                     </view>
                 </view>
             </My_SupplyAndDemandItemBox>
@@ -56,7 +56,7 @@
                 </view>
             </view>
             <!-- 列表 -->
-            <My_SupplyAndDemandItemBox wx:for="{{productList}}" title="【{{item.ftype}}】{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" bindtap="jumpForDetails" bindstopOnShow="stopOnShow">
+            <My_SupplyAndDemandItemBox wx:for="{{productList}}" title="【{{item.ftype}}】{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" bindtap="jumpForDetails" type='{{item.ftype}}' content="{{item.fcontent}}" bindstopOnShow="stopOnShow">
                 <!-- 我的需求左上状态插槽 -->
                 <view slot="myState" class="myState">
                     <view class="myShowState {{item.fstatus=='正在对接'?'myNoSoldOut':''}} {{item.fstatus=='待对接'?'myNoSoldOut':''}}">
@@ -98,7 +98,7 @@
 </van-action-sheet>
 <!-- 右侧吸附固定按钮 -->
 <view class="fixedButton" catchtap="postDemand">
-    <van-button custom-class="custom-fixedButton" color="linear-gradient(180deg, #FFE274 0%, #FF8700 100%)">
+    <van-button custom-class="custom-fixedButton" color="#FFB600">
     </van-button>
     <view class="fixedButtonText">
         <image src="/static/icon-01.png"></image>

+ 5 - 5
pages/tabbar-pages/supplyAndDemand/particulars.wxml

@@ -10,10 +10,10 @@
                 </view>
                 <view class="header-userMessage-textMsg">{{particulars.createby}} {{particulars.checkdate}}</view>
             </view>
-            <!-- <view class="but-box">
+            <view class="but-box">
                 <van-button wx:if="{{particulars.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut details-custom-slotBut">一键联系</van-button>
                 <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut details-custom-slotBut">{{particulars.fstatus}}</van-button>
-            </view> -->
+            </view>
         </view>
     </view>
     <scroll-view scroll-y style="flex: 1; height: 1px;">
@@ -27,15 +27,15 @@
         <!-- 更多推荐 -->
         <My_CenterTheTitle title='其他推荐'></My_CenterTheTitle>
         <!-- 列表 -->
-        <My_SupplyAndDemandItemBox wx:for="{{recommendationList}}" title="【{{item.ftype}}】{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" bindtap="jumpForDetails">
+        <My_SupplyAndDemandItemBox wx:for="{{recommendationList}}" title="【{{item.ftype}}】{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" type='{{item.ftype}}' content="{{item.fcontent}}" bindtap="jumpForDetails">
             <!-- 内容信息插槽 -->
             <view slot="dataAndBut">
                 <view class="dataAndBut">
                     <view class="dataAndBut_data">
                         浏览次数:{{item.freadtimes}}次 意向沟通人数:{{item.fcommunicationtimes}}次
                     </view>
-                    <!-- <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" catchtap="contact">一键联系</van-button>
-                    <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut" catchtap="stop">{{item.fstatus}}</van-button> -->
+                    <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" catchtap="contact">一键联系</van-button>
+                    <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut" catchtap="stop">{{item.fstatus}}</van-button>
                 </view>
             </view>
         </My_SupplyAndDemandItemBox>