ソースを参照

添加表情包和工具栏

wkw 1 週間 前
コミット
88793af28b

+ 2 - 2
.env

@@ -8,7 +8,7 @@ VITE_DEV_PATH='https://wallet.angeltokens.io'
 VITE_PRO_PATH='https://wallet.angeltokens.io'
 
 
-VITE_PRO_IM_PATH='http://192.168.0.59:8888'
-VITE_DEV_IM_PATH='http://192.168.0.59:8888'#https://nim.angeltokens.io
+VITE_PRO_IM_PATH='https://nim.angeltokens.io'
+VITE_DEV_IM_PATH='https://nim.angeltokens.io'#https://nim.angeltokens.io
 
 VITE_PRO_BACKEND_PATH='https://backend.angeltoken.net'

+ 1 - 1
package.json

@@ -7,7 +7,7 @@
     "dev": "vite --host",
     "updata": "node ./updataSetVersion.js",
     "s": "cross-env DAPP_BUILD=1 npx cap sync",
-    "a": "npx cap run android --live-reload --host=192.168.0.59 --port=5173",
+    "a": "npx cap run android --live-reload --host=192.168.0.70 --port=5173",
     "app": "npx cap run android --live-reload --host=192.168.0.70 --port=5173",
     "ios": "npx cap run ios --live-reload --host=192.168.0.59 --port=5173",
     "android": "npx cap add android && npm run icon && npx cap sync",

+ 84 - 37
src/views/im/chat/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="container"  :style="{height: `calc(100% - ${keyboardHeight}px)` }"> 
+  <div class="container" :style="{height: `calc(100% - ${currentBottomHeight}px)`}"> 
     <div class="chat-bg"></div>
     <div class="header-chat">
       <svg-icon class="page-icon" name="lf-arrow" @click="goBack" />
@@ -7,9 +7,9 @@
       <svg-icon class="page-icon" name="more" @click="goDetail" />
     </div>
     <div class="chat-list">
-      <div v-for="(item, index) in 2">
+      <div v-for="(item, index) in 1">
         <div class="chat-time">23:{{ 20 + index }}</div>
-        <div class="box" v-for="(text, i) in 10">
+        <div class="box" v-for="(text, i) in 3">
           <div class="list-item" :class="i % 2 === 0 ? '' : 'flex-reverse'">
             <van-image
               class="list-img"
@@ -60,62 +60,91 @@
           @focus="onFocus"
           placeholder="输入文本" 
         />
-        <svg-icon class="page-icon mr12" name="emoji" />
-        <svg-icon class="page-icon" name="add2" />
+        <svg-icon class="page-icon mr12" name="emoji" @click="toggleAppBox(1)"/>
+        <svg-icon class="page-icon" name="add2" @click="toggleAppBox(2)"/>
+      </div>
+      
+      <!-- 表情面板 -->
+      <div class="app-box" v-show="showEmoji" :style="{height: `${appBoxHeight}px`}">
+        😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍
+        
+      </div>
+      
+      <!-- 工具栏面板 -->
+      <div class="app-box" v-show="showTools" :style="{height: `${appBoxHeight}px`}">
+        <!-- 工具栏内容:可放按钮、图标等 -->
+        <div class="tool-btn">照片</div>
+        <div class="tool-btn">视频</div>
+        <div class="tool-btn">语音通话</div>
+        <div class="tool-btn">名片</div>
       </div>
     </div>
   </div>
 </template>
 
-<script setup> 
+<script setup>
+import { ref, computed } from "vue";
 import { useRouter } from "vue-router";
 import { Keyboard } from '@capacitor/keyboard';
-import { getmessage } from "@/api/path/im.api";
-import { useWalletStore } from "@/stores/modules/walletStore";
-const walletStore = useWalletStore();
-const router = useRouter();
-const route = useRoute();
 
+const router = useRouter();
 const text = ref("");
-const keyboardHeight = ref(10);
+
+// 状态管理
+const keyboardHeight = ref(0);
+const showEmoji = ref(false);
+const showTools = ref(false);
+const appBoxHeight = ref(260); // 面板高度,可根据需要调整
+
+// 计算当前底部总高度
+const currentBottomHeight = computed(() => {
+  // 优先级:键盘 > 表情面板 > 工具面板 > 默认高度
+  if (keyboardHeight.value > 0) {
+    return keyboardHeight.value; // 只计算键盘高度
+  }
+  if (showEmoji.value || showTools.value) {
+    return appBoxHeight.value; // 只计算面板高度
+  }
+  return 0; // 默认底部间距
+});
+
+// 切换面板显示
+const toggleAppBox = async (type) => {
+  // 先隐藏键盘(如果正在显示)
+  await Keyboard.hide();
+  keyboardHeight.value = 0; // 立即重置键盘高度
   
-const goBack = () => {
-  router.push("im");
+  // 切换面板状态
+  if (type === 1) {
+    showEmoji.value = !showEmoji.value;
+    showTools.value = false;
+  } else {
+    showTools.value = !showTools.value;
+    showEmoji.value = false;
+  }
 };
-const goDetail = () => {
-  router.push("detail");
-};  
 
-const onFocus = () => { 
-  // 初始化
+const onFocus = () => {
+  // 隐藏所有面板
+  showEmoji.value = false;
+  showTools.value = false;
   setupKeyboardListeners();
-}
+};
 
-// 监听键盘事件
+// 键盘监听
 const setupKeyboardListeners = async () => {
-  // 获取键盘高度(仅在键盘显示时有效)
   Keyboard.addListener('keyboardWillShow', (info) => {
-    keyboardHeight.value = info.keyboardHeight
+    keyboardHeight.value = info.keyboardHeight;
   });
+  
   Keyboard.addListener('keyboardWillHide', () => {
-    console.log('键盘已隐藏'); 
-    keyboardHeight.value = 10;
+    keyboardHeight.value = 0;
   });
 };
-// 获取消息数据
-const getmessageList = async () => {
-  const res = await getmessage({messageType:1,uuid:walletStore.account,friendUsername:route.query.uuid});
-  console.log(res)
-}
 
-onMounted(()=>{
-  getmessageList();
-})
 onUnmounted(() => {
   Keyboard.removeAllListeners();
 });
-
-
 </script>
 
 <style lang="less" scoped>
@@ -134,8 +163,6 @@ onUnmounted(() => {
   flex-shrink: 0;
 }
 .container {
-  // :style="{height: handleFocus }"
-  // height:   calc(100% - 10px); 
   display: flex;
   flex-direction: column;
   .chat-bg {
@@ -293,4 +320,24 @@ onUnmounted(() => {
     }
   }
 }
+.app-box {
+  position: fixed;
+  bottom: 260px;
+  left: 0;
+  right: 0;
+  height: 260px;
+  background: white;
+  transition: transform 0.3s ease;
+  transform: translateY(100%);
+  background-color: yellow;
+  
+  &.visible {
+    transform: translateY(0);
+  }
+}
+
+.page-foot {
+  position: relative;
+  z-index: 10; /* 确保输入框在上层 */
+}
 </style>

+ 3 - 2
src/views/im/contactList/invitation/index.vue

@@ -33,11 +33,11 @@
                     </div>
                 </div>
             </div>
-           <div class="foot-page">
+           <!-- <div class="foot-page">
                 <van-button class="foot-btn" size="mini">上一页</van-button>
                 <div class="foot-total">1/1</div>
                 <van-button class="foot-btn" size="mini">下一页</van-button>
-           </div>
+           </div> -->
         </div>
         <!-- 同意好友弹框 -->
         <van-popup v-model:show="showAgree" :style="{ borderRadius:'25px' }">
@@ -84,6 +84,7 @@ const changeFun = async (val) => {
         let text = val == 2?'添加成功':'已拒绝'
         showToast(text);
     }
+    showAgree.value = false;
 }
 onMounted(()=>{
     getfriendRequest();

+ 1 - 1
src/views/im/index.vue

@@ -31,7 +31,7 @@
         <span>请输入关键词</span>
       </div>
       <div class="message-list">
-        <div class="list-item" v-for="(item,i) in list" :key="i" @click="goToChat(item.uuid)">
+        <div class="list-item" v-for="(item,i) in 1" :key="i" @click="goToChat(item.uuid)">
           <van-image class="item-img" round :src="item.avatar"/>
           <div class="item-content">
             <div class="item-top">

+ 8 - 4
src/views/wallet/index.vue

@@ -81,7 +81,7 @@
         />
         <div>{{ $t("wallet.Transfer") }}</div>
       </div>
-      <div class="box-cont" @click="goToDapp">
+      <div class="box-cont" @click="goToDapp(1)">
         <svg-icon
           class="box-cont-icon"
           style="width: 30px; height: 30px"
@@ -89,7 +89,7 @@
         />
         <div>{{ $t("wallet.Competition") }}</div>
       </div>
-      <div class="box-cont">
+      <div class="box-cont" @click="goToDapp(2)">
         <svg-icon
           class="box-cont-icon"
           style="width: 30px; height: 30px"
@@ -440,14 +440,18 @@ const gethotTokens = async () => {
   await walletStore.updateTokenVal();
 };
 // 跳转竞赛
-const goToDapp = () => {
+const goToDapp = (val) => {
   const dapp = cryptoEncode(
     JSON.stringify({
       address: walletStore.account,
       privateKey: walletStore.privateKey,
     })
   );
-  openDapp("https://accgame.angeltokens.io/", { dapp });
+  if(val == 1){
+    openDapp("https://accgame.angeltokens.io/", { dapp });
+  }else{
+    openDapp("https://backend.angeltoken.net/");
+  }
 };
 
 const formatAddress = (address) => {