Browse Source

添加需求

潘超林 4 months ago
parent
commit
fbcedfe4e6

+ 2 - 0
TUIKit/components/TUIContact/contact-list/index.vue

@@ -197,6 +197,8 @@ const chat = () => {
 };
 
 onMounted(() => {
+  console.log('触发----------------------');
+  
   TUIStore.watch(StoreName.APP, {
     enabledCustomerServicePlugin: onCustomerServiceCommercialPluginUpdated,
   });

+ 10 - 18
TUIKit/components/TUIContact/index.vue

@@ -3,7 +3,7 @@
   <div v-else-if="isShowContactList" :class="['tui-contact', !isPC && 'tui-contact-h5']">
     <div :class="['tui-contact-left', !isPC && 'tui-contact-h5-left']">
       <!-- <ContactSearch /> -->
-      <ContactList
+      <ContactList v-if="contact"
         :class="['tui-contact-left-list', !isPC && 'tui-contact-h5-left-list']"
       />
     </div>
@@ -28,23 +28,7 @@ import ContactList from "./contact-list/index.vue";
 import ContactInfo from "./contact-info/index.vue";
 import { onLoad, onShow, onPullDownRefresh } from "@dcloudio/uni-app";
 const emits = defineEmits(["switchConversation"]);
-const dataList = ref([
-  {
-    text: "测试一",
-    iconSrc:
-      "https://i-1.lanrentuku.com/2020/9/15/752b7419-0de1-4515-8d2c-63e7b7df007c.png?imageView2/2/w/500",
-  },
-  {
-    text: "测试二",
-    iconSrc: "https://bpic.51yuansu.com/pic2/cover/00/38/01/58122c53d1ca5_610.jpg",
-  },
-  {
-    text: "测试三",
-    iconSrc:
-      "https://i-1.lanrentuku.com/2020/10/27/73be0f11-4027-4e5c-8f8f-be31fa4d2834.png?imageView2/2/w/500",
-  },
-]);
-
+const contact=ref(true)
 const props = defineProps({
   // web/h5 single page application display format, uniapp please ignore
   displayType: {
@@ -62,7 +46,15 @@ const isShowContactInfo = ref(true);
 watchEffect(() => {
   isShowContactList.value = props?.displayType !== "selectFriend";
 });
+onPullDownRefresh(() => {
+  contact.value=false
+  setTimeout(() => {
+    contact.value=true
+    uni.stopPullDownRefresh();
+  }, 200);
+
 
+});
 TUIStore.watch(StoreName.CUSTOM, {
   isShowSelectFriendComponent: (data: any) => {
     if (!isUniFrameWork && props?.displayType === "selectFriend") {

+ 2 - 1
pages.json

@@ -32,7 +32,8 @@
       "style": {
         "navigationBarTitleText": "消息",
         "navigationStyle": "custom",
-        "autoBackButton": true
+        "autoBackButton": true,
+        "enablePullDownRefresh": true
       }
     },
     {

+ 13 - 0
pages/group/black-list.vue

@@ -15,6 +15,19 @@
         </view>
       </view>
     </template>
+    <div
+      v-if="contactListMap.blackList.list.length < 1"
+      style="
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        height: 90vh;
+        justify-content: center;
+      "
+    >
+      <img src="@/static/empaty.jpg" style="width: 200px; height: 150px" />
+      <span style="margin-top: 20px"> 暂无黑名单~</span>
+    </div>
     <view v-if="isShowContactInfo">
       <view class="item">
         <view>

+ 14 - 1
pages/group/chat.vue

@@ -1,6 +1,6 @@
 <template>
   <view>
-    <template>
+    <template v-if="contactListMap.groupList.list.length>0">
       <view
         class="item"
         v-for="(item, index) in contactListMap.groupList.list"
@@ -15,6 +15,19 @@
         </view>
       </view>
     </template>
+    <div
+      v-else
+      style="
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        height: 90vh;
+        justify-content: center;
+      "
+    >
+      <img src="@/static/empaty.jpg" style="width: 200px; height: 150px" />
+      <span style="margin-top: 20px"> 暂无群聊~</span>
+    </div>
   </view>
 </template>
 

+ 13 - 0
pages/group/person.vue

@@ -37,6 +37,19 @@
         </view>
       </view>
     </template>
+    <div
+      v-else
+      style="
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        height: 90vh;
+        justify-content: center;
+      "
+    >
+      <img src="@/static/empaty.jpg" style="width: 200px; height: 150px" />
+      <span style="margin-top: 20px"> 暂无新增联系人~</span>
+    </div>
   </view>
 </template>
 

BIN
static/empaty.jpg


+ 15 - 4
uni_modules/liu-indexed-list/components/liu-indexed-list/liu-indexed-list.vue

@@ -27,18 +27,29 @@
           <image
             :style="'border-radius:50%'"
             class="left-item-card-img img-info"
-            :src="mess.avatar"
+            :src="
+              mess.avatar
+                ? mess.avatar
+                : 'https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'
+            "
             v-if="mess.avatar"
             @click.stop="preview(mess.avatar)"
           ></image>
+
           <view :style="'border-radius:' + radius" class="left-item-card-img" v-else>
-            {{ (mess.nick && mess.nick.slice(0, 1)) || "" }}
+            <!-- {{ (mess.nick && mess.nick.slice(0, 1)) || "" }} -->
+            <image
+              :style="'border-radius:50%'"
+              class="left-item-card-img img-info"
+              src="https://bucket.sxdirectpurchase.com/wx/static/img/ImAvatar.png"
+              @click.stop="preview(mess.avatar)"
+            ></image>
           </view>
           <view
             class="left-item-card-info"
             :style="inx < item.length - 1 ? 'border-bottom: solid #F4F4F4 1rpx;' : ''"
           >
-            <view class="left-item-card-name">{{ mess.nick || "" }}</view>
+            <view class="left-item-card-name">{{ mess.nick || mess.userID }}</view>
             <view class="left-item-card-phone" v-if="mess[phoneKey]">{{
               mess[phoneKey]
             }}</view>
@@ -278,7 +289,7 @@ export default {
           width: 80rpx;
           min-width: 80rpx;
           height: 80rpx;
-          background-color: #cfcfcf;
+          // background-color: #cfcfcf;
           display: flex;
           align-items: center;
           justify-content: center;