Browse Source

供需搜索

zhaoxiaohai 3 years ago
parent
commit
b17ff6d8cc

+ 1 - 1
pages/chatRoom/dialogbox.wxml

@@ -23,7 +23,7 @@
     <view id="bottom" style="height: {{iosX?'102':'85'}}px;"></view>
 </scroll-view>
 <!-- 底部输入 -->
-<view class="input-box" style="bottom:{{keyboardHeight}}px;" wx:if="{{fimuserid==userid}}">
+<view class="input-box" style="bottom:{{keyboardHeight}}px;" wx:if="{{fimuserid==userid||fimdialogtype!='话题'}}">
     <!-- 普通输入框 -->
     <textarea class="input-text" bindfocus="textareaFocus" bindblur="sendMsg" adjust-position='{{false}}' bindconfirm='sendMsg' show-confirm-bar='{{false}}' confirm-type='send' confirm-hold='true' cursor-spacing='45' bindinput='sendInput' value='{{sendText}}' maxlength='-1' fixed='true' type="text" bindlinechange='linechange' bindkeyboardheightchange='keyboardheightchange'>
     <!-- 话题 -->

+ 2 - 2
pages/chatRoom/index.wxml

@@ -41,12 +41,12 @@
         <navigator url="#" wx:for="{{discussionGroupList}}" wx:key="index" data-item="{{item}}" bindtap="enterTheDialogue">
             <view class="msgImg">
                 <image wx:if="{{item.latestnews[0].message.sendfrom.headpic}}" src="{{item.latestnews[0].message.sendfrom.headpic}}"></image>
-                <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
+                <image wx:else src="/static/userCenter/group-img.png"></image>
             </view>
             <view class="borTop">
                 <view class="msgText">
                     <view class="title u-line-1">{{item.fimdialogname}}</view>
-                    <view class="msg u-line-1">{{item.latestnews[0].message.ftype=='file'?'[图片]':item.latestnews[0].message.data.fcontent}}</view>
+                    <view class="msg u-line-1">{{item.latestnews.length>=1?'[话题]':''}}</view>
                 </view>
                 <view class="msgCount">
                     <view class="time u-line-1">{{item.fjoindate}}</view>

+ 14 - 13
pages/tabbar-pages/supplyAndDemand/index.js

@@ -236,19 +236,18 @@ Page({
         });
     },
     /* 获取供需列表 */
-    getSupplyAndDemand(fstatus) {
+    getSupplyAndDemand(fstatus, condition = '') {
         const ftype = (this.data.ftype != '全部') ? this.data.ftype : "";
-        let condition = "",
-            where = {
-                "condition": condition, //模糊搜索
-                "ftype": ftype, //数据类型
-                "fissupply": 0, // 0需 1供
-                "fstatus": ""
-            };
+        let where = {
+            "condition": this.data.searchText, //模糊搜索
+            "ftype": ftype, //数据类型
+            "fissupply": 0, // 0需 1供
+            "fstatus": ""
+        };
         /* 暂时不分供需 */
         if (fstatus) {
             where = {
-                "condition": condition, //模糊搜索
+                "condition": this.data.searchText, //模糊搜索
                 "ftype": ftype, //数据类型
                 "fissupply": 0, // 0需 1供
                 "fstatus": "对接中"
@@ -354,14 +353,16 @@ Page({
         if (value == this.data.searchText) return this.setData({
             searchFocus: false,
         });
-        let searchText = "";
-        if (value != "") searchText = value;
         this.setData({
             searchFocus: false,
-            searchText
+            searchText:value
         })
         this.InitializeDataPaging();
-        this.myNeed();
+        if (this.data.active == 0) {
+            this.getSupplyAndDemand();
+        } else {
+            this.myNeed();
+        }
     },
     /* 初始化分页数据 */
     InitializeDataPaging() {

+ 8 - 1
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -7,6 +7,13 @@
     <van-tabs active="{{ active }}" bind:change="tabsChange" custom-class="tabs-custom-class" tab-active-class="tabs-active-class" ellipsis="{{false}}" line-width="30px" color="#4DC2D4" title-active-color="#4DC2D4" swipeable>
         <view style="height: 10rpx;"></view>
         <van-tab title="所有信息">
+            <!-- 搜索 -->
+            <view class="my-need-search">
+                <input class="my-need-search-input {{searchFocus?'my-need-search-inputfocus':''}}" confirm-type="search" placeholder="搜索关键字" type="text" bindfocus="needSearchFocus" bindblur="needSearchBlur" bindconfirm='needSearchBlur' />
+                <view class="my-need-search-but">
+                    <van-icon name="search" />
+                </view>
+            </view>
             <!-- 宫格 -->
             <view class="grid_box">
                 <view class="grid_item" wx:for="{{ftypeList}}" wx:key="index" data-type="{{item.ftype}}" bindtap="switchScreenType">
@@ -55,7 +62,7 @@
         <van-tab title="我的需求">
             <!-- 搜索 -->
             <view class="my-need-search">
-                <input class="my-need-search-input {{searchFocus?'my-need-search-inputfocus':''}}" confirm-type="search" placeholder="搜索关键字" type="text" bindfocus="needSearchFocus" bindblur="needSearchBlur" />
+                <input class="my-need-search-input {{searchFocus?'my-need-search-inputfocus':''}}" confirm-type="search" placeholder="搜索关键字" type="text" bindfocus="needSearchFocus" bindblur="needSearchBlur" bindconfirm='needSearchBlur' />
                 <view class="my-need-search-but">
                     <van-icon name="search" />
                 </view>

BIN
static/userCenter/group-img.png