laosan2382995021@163.com 3 yıl önce
ebeveyn
işleme
5d38c85960
60 değiştirilmiş dosya ile 802 ekleme ve 236 silme
  1. 4 1
      public/index.html
  2. 5 2
      src/components/flat-list/mixins/handle.ts
  3. 5 1
      src/components/flat-list/mixins/on.ts
  4. 3 0
      src/components/swiper/src/main.vue
  5. 8 3
      src/config/config.ts
  6. 6 3
      src/layout/layout-chat/mixins/handle.ts
  7. 5 1
      src/layout/layout-chat/style.scss
  8. 2 2
      src/mixins/trigger/index.ts
  9. 66 0
      src/pages/talking/components/room-gift/components/room-gift-item/data/type.ts
  10. 18 0
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/config.ts
  11. 42 0
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/fetch.ts
  12. 9 1
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/gift.ts
  13. 44 16
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/giveGift.ts
  14. 3 1
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/index.ts
  15. 0 4
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/select.ts
  16. 7 0
      src/pages/talking/components/room-gift/components/room-gift-item/props.ts
  17. 118 114
      src/pages/talking/components/room-gift/components/room-gift-item/src/main.vue
  18. 8 0
      src/pages/talking/components/room-gift/components/room-gift-item/style.scss
  19. 10 6
      src/pages/talking/components/room-gift/data/tab.ts
  20. 4 2
      src/pages/talking/components/room-gift/src/main.vue
  21. 14 2
      src/pages/talking/components/room-ranking/components/room-chat/components/room-chat-message/src/main.vue
  22. 8 3
      src/pages/talking/components/room-ranking/components/room-chat/data/control.ts
  23. 2 1
      src/pages/talking/components/room-ranking/components/room-chat/mixins/index.ts
  24. 30 2
      src/pages/talking/components/room-ranking/components/room-chat/mixins/message.ts
  25. 7 1
      src/pages/talking/components/room-ranking/components/room-chat/src/main.vue
  26. 9 1
      src/pages/talking/components/room-ranking/components/room-chat/style.scss
  27. 116 0
      src/pages/talking/components/room-wheat/mixins/follow.ts
  28. 2 1
      src/pages/talking/components/room-wheat/mixins/index.ts
  29. 8 1
      src/pages/talking/components/room-wheat/src/main.vue
  30. 1 1
      src/pages/talking/components/room-wheat/style.scss
  31. 12 0
      src/pages/talking/const/roomGiftType.ts
  32. 0 1
      src/pages/talking/mixins/handle.ts
  33. 3 0
      src/popup/popup-chat/components/chat-content/components/chat-emoji/index.ts
  34. 37 0
      src/popup/popup-chat/components/chat-content/components/chat-emoji/mixins/handle.ts
  35. 3 0
      src/popup/popup-chat/components/chat-content/components/chat-emoji/mixins/index.ts
  36. 8 0
      src/popup/popup-chat/components/chat-content/components/chat-emoji/props.ts
  37. 40 0
      src/popup/popup-chat/components/chat-content/components/chat-emoji/src/main.vue
  38. 19 0
      src/popup/popup-chat/components/chat-content/components/chat-emoji/style.scss
  39. 6 5
      src/popup/popup-chat/components/chat-content/data/message-control.ts
  40. 18 13
      src/popup/popup-chat/components/chat-content/mixins/gift.ts
  41. 14 0
      src/popup/popup-chat/components/chat-content/mixins/handle.ts
  42. 6 2
      src/popup/popup-chat/components/chat-content/src/main.vue
  43. 1 1
      src/popup/popup-chat/components/chat-list/mixins/handle.ts
  44. 4 4
      src/popup/popup-detail/components/game/src/main.vue
  45. 4 1
      src/popup/popup-detail/components/game/style.scss
  46. 7 7
      src/popup/popup-detail/data/tab.ts
  47. 4 4
      src/popup/popup-detail/mixins/handle.ts
  48. 2 2
      src/popup/popup-detail/src/main.vue
  49. 6 1
      src/popup/popup-gift-bubble/mixins/handle.ts
  50. 8 1
      src/store/modules/chat.ts
  51. 8 0
      src/store/modules/user.ts
  52. 2 0
      src/types/config.d.ts
  53. 1 14
      src/utils/control/personal-detail/index.ts
  54. 2 2
      src/utils/request/config.ts
  55. 4 0
      src/views/view-footer/data/control.ts
  56. 2 2
      src/views/view-friends/data/config.ts
  57. 10 0
      src/views/view-friends/mixins/handle.ts
  58. 3 2
      src/views/view-friends/src/main.vue
  59. 2 2
      src/views/view-header/mixins/login.ts
  60. 2 2
      src/views/view-menu/components/view-message/data/config.ts

+ 4 - 1
public/index.html

@@ -7,6 +7,8 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <link rel="stylesheet" type="text/css" href="./font/font.css" />
     <title>巧鱼</title>
+      <!-- 压缩版 -->
+      <script src="https://cdn.ronghub.com/RongEmoji-2.2.7.min.js"></script>
 
       <script>
           var inputContent = {
@@ -84,4 +86,5 @@
     <!-- built files will be auto injected -->
   </body>
   <script src="./js/WebAudioRecorder.min.js"></script>
-</html>
+
+</html>

+ 5 - 2
src/components/flat-list/mixins/handle.ts

@@ -98,14 +98,14 @@ export default <LibMixins>{
                 }
             }
 
-
-
             if (replace) {
                 this.data = data;
             } else {
                 this.data.push(...data);
             }
 
+            return this.$emit('changeData',this.data);
+
         },
 
         pagingLoading(){
@@ -148,6 +148,9 @@ export default <LibMixins>{
             ) {
                 // 重置分页
                 this.config.page = 1;
+                if (this.indexes) {
+                    this.dataIndexes = [];
+                }
                 this.hasPaging = true;
             }
 

+ 5 - 1
src/components/flat-list/mixins/on.ts

@@ -29,6 +29,8 @@ export default <LibMixins>{
                 this.data.splice(id,1);
                 this.indexes && this.dataIndexes.splice(id,1);
 
+                this.$emit('changeData',this.data);
+
                 if (this.data.length <= 0) {
                     return this.reload(FlatListReload.start);
                 } else if (this.hasPaging && this.data.length < this.pageSize) {
@@ -56,6 +58,7 @@ export default <LibMixins>{
 
                     this.data.unshift(item);
                     this.indexes && this.dataIndexes.unshift(id);
+                    return this.$emit('changeData',this.data);
                 }
             }
         },
@@ -68,6 +71,7 @@ export default <LibMixins>{
                     if (this.indexes && this.dataIndexes.indexOf(id) >= 0) return;
                     this.data.push(item);
                     this.indexes && this.dataIndexes.push(id);
+                    return this.$emit('changeData',this.data);
                 }
             }
         },
@@ -86,4 +90,4 @@ export default <LibMixins>{
     }
 
 
-}
+}

+ 3 - 0
src/components/swiper/src/main.vue

@@ -58,6 +58,9 @@ export default {
     slideTo(index,speed) {
       return this.swiper && this.swiper.slideTo(index,speed);
     },
+    update(){
+      return this.swiper && this.swiper.update();
+    },
     change(){
       if (this.swiper) {
         let index = this.swiper.realIndex;

+ 8 - 3
src/config/config.ts

@@ -2,17 +2,22 @@ export default <Config>{
 
     baseApiURL:'/api',
 
-    baseURL:'http://newqiaoyu.lanmaonet.com/',
-    // baseURL:'http://newqiaoyu.com/',
+    // baseURL:'http://newqiaoyu.lanmaonet.com/',
+    baseURL:'http://newqiaoyu.com/',
 
     app:undefined,
 
     useRoutesName:[],
 
+    emoji:[],
+
     register(vm){
         vm.$store.dispatch('initializationUserPromise');
         vm.$store.dispatch('initializationPayPromise');
-        vm.$store.dispatch('initializationGiftPromise');
+        // @ts-ignore
+        window.RongIMLib.RongIMEmoji.init();
+        // @ts-ignore
+        this.emoji = RongIMLib.RongIMEmoji.list;
         this.app = vm;
     }
 

+ 6 - 3
src/layout/layout-chat/mixins/handle.ts

@@ -21,9 +21,12 @@ export default <LibMixins>{
 
         message(){
             if (this.item.message) {
-                return this.item.message.replace(/[\n\r]/g,function () {
+                let message = this.item.message;
+
+                // @ts-ignore
+                return window.RongIMLib.RongIMEmoji.symbolToEmoji(message.replace(/[\n\r]/g,function () {
                     return '<br />';
-                });
+                }));
             } else {
                 return  '';
             }
@@ -32,4 +35,4 @@ export default <LibMixins>{
 
     }
 
-}
+}

+ 5 - 1
src/layout/layout-chat/style.scss

@@ -24,6 +24,10 @@
   font-size: 12px;
   line-height: 20px;
 }
+.layout-chat-message::v-deep .rong-emoji-content{
+  transform: scale(0.7);
+  //margin-left: -4PX;
+}
 .layout-chat-icon{
   fill: rgba(255,255,255,0.1);
   @include square(13px);
@@ -84,4 +88,4 @@
 .layout-chat-gift-name,.layout-chat-gift{
   margin-left: 5px;
 }
-/* 礼物 */
+/* 礼物 */

+ 2 - 2
src/mixins/trigger/index.ts

@@ -5,10 +5,10 @@ export default {
     methods:{
 
         /* 触发 */
-        trigger(item:LibData, index:number):void{
+        trigger(item:LibData, index:number,login:boolean=false):void{
             if (item.trigger) {
 
-                if (item.login && !user.verificationLogin()) return ;
+                if ((item.login || login) && !user.verificationLogin()) return ;
 
                 return item.trigger.trigger(item,index,this);
             }

+ 66 - 0
src/pages/talking/components/room-gift/components/room-gift-item/data/type.ts

@@ -0,0 +1,66 @@
+import {RoomGiftType} from "@/pages/talking/const/roomGiftType";
+import userIntegral from "$utils/control/integral";
+import popup from "$utils/tool/popup";
+import {nextTick} from "vue";
+
+export default {
+
+    [RoomGiftType.default]:{
+        fetch:'fetchDefault',
+
+        methods:{
+            // 校验是否有资格使用
+            check({integral}){
+                return userIntegral.checkBalance(integral,true);
+            },
+            // 减余额
+            reduce({integral}){
+                userIntegral.reduceBalance(integral,false);
+            },
+            // 增加余额
+            plus({integral}){
+                userIntegral.plusBalance(integral,false);
+            },
+            checkUpdate(data,vm,unique){
+                return vm.checkUpdateUserIntegral(unique);
+            }
+        }
+
+    },
+
+    [RoomGiftType.knapsack]:{
+        fetch:'fetchKnapsack',
+
+        methods:{
+            check({gift,number}){
+                let result= gift.num >= number;
+                if (!result) {
+                    popup.$toast('数量不足');
+                }
+                return result;
+            },
+            // 锁定数量
+            reduce({item,number,giveUserId},vm){
+                item.num -= (giveUserId.length * number);
+
+                if (item.num <= 0) {
+                    vm.updateBanner();
+                }
+
+            },
+            // 恢复数量
+            plus({item,number,giveUserId},vm){
+
+                let num = item.num;
+
+                item.num += (giveUserId.length * number);
+
+                if (num <= 0) {
+                    vm.updateBanner();
+                }
+            },
+
+        }
+    }
+
+}

+ 18 - 0
src/pages/talking/components/room-gift/components/room-gift-item/mixins/config.ts

@@ -0,0 +1,18 @@
+import unit from "$utils/unit/unit";
+import numberData from "../data/number";
+
+export default {
+
+    data(){
+        return {
+            swiperOption:{
+                slidesPerView:'auto',
+                spaceBetween:unit.unitPx(20),
+                threshold:unit.unitPx(10)
+            },
+
+            numberData
+        }
+    },
+
+}

+ 42 - 0
src/pages/talking/components/room-gift/components/room-gift-item/mixins/fetch.ts

@@ -0,0 +1,42 @@
+export default {
+
+    data(){
+      return {
+          giftData:[]
+      }
+    },
+
+    methods:{
+
+        fetch(obj){
+            return this[this.useGiftType.fetch](obj);
+        },
+
+        // 默认的请求
+        fetchDefault(obj){
+            this.$store.dispatch('initializationGiftPromise').then(obj.success).catch(obj.fail);
+        },
+
+        // 我的背包请求
+        fetchKnapsack(obj){
+            this.$request({
+                url:'room/get_gift_list',
+                token:true
+            }).then((data)=>{
+                data.data = data.data || {};
+
+                data.data.gifts_list.map((item)=>{
+                    item.num = 2;
+                })
+
+                return obj.success(data.data.user_pack || []);
+            }).catch(obj.fail);
+        },
+
+        changeData(data){
+            this.giftData = data;
+        }
+
+    }
+
+}

+ 9 - 1
src/pages/talking/components/room-gift/components/room-gift-item/mixins/gift.ts

@@ -1,6 +1,8 @@
 import popup from "$utils/tool/popup";
 import {PopupExportComponent} from "$popup/popup-export/const";
 import unit from "$utils/unit/unit";
+import type from '../data/type';
+import {RoomGiftType} from "@/pages/talking/const/roomGiftType";
 
 export default <LibMixins>{
 
@@ -11,6 +13,12 @@ export default <LibMixins>{
         }
     },
 
+    computed:{
+      useGiftType(){
+          return type[this.giftType] || type[RoomGiftType.default] || {};
+      }
+    },
+
     methods:{
 
         changeGiftSelect(index:number){
@@ -38,4 +46,4 @@ export default <LibMixins>{
 
     }
 
-}
+}

+ 44 - 16
src/pages/talking/components/room-gift/components/room-gift-item/mixins/giveGift.ts

@@ -4,6 +4,8 @@ import userIntegral from '$utils/control/integral';
 
 import Throttle from '$utils/tool/throttle';
 import {InstructionsMessageType} from "$utils/request";
+import {nextTick} from "vue";
+import {FlatListReload} from "$components/flat-list/const";
 
 export default {
 
@@ -57,24 +59,29 @@ export default {
             // 计算本次需要使用的积分
             let integral = giveUserId.length * (parseFloat(gift.gift_price) || 0) * this.number;
 
-            // 查看用户余额是否足够
-            if (userIntegral.checkBalance(integral,true)) {
+            let resultConfig = {
+                giveUserId,
+                integral,
+                number:this.number,
+                gift,
+                item:gift
+            };
+
+            // 查看用户是否可以赠送
+            if (this.useGiftType.methods.check(resultConfig)) {
                 gift = JSON.parse(JSON.stringify(gift));
                 if (this.$refs.banner && this.$refs.banner.swiper) {
                     gift.translate = this.$refs.banner.swiper.translate;
                 }
 
+                resultConfig.gift = gift;
+
                 // 赠送礼物
-                this.sendGiveUserGift(gift,giveUserId,giveUserId.length * (parseFloat(gift.gift_price) || 0));
-                this.sendGift({
-                    gift,
-                    number:this.number,
-                    giveUserId,
-                    integral
-                });
+                this.sendGiveUserGift(gift,giveUserId,this.number * (parseFloat(gift.gift_price) || 0));
+                this.sendGift(resultConfig);
 
                 // 减余额
-                userIntegral.reduceBalance(integral,false);
+                this.useGiftType.methods.reduce(resultConfig,this);
 
                 // 设置当前的标识符
                 let unique = new Date().getTime() + '-'+ Math.ceil(Math.random() * 10000);
@@ -87,7 +94,7 @@ export default {
                     data:{
                         to_uid_list: giveUserId.join(','),
                         num: this.number,
-                        pack:1,
+                        pack:this.giftType,
                         rid: this.roomInfo.rid,
                         gid: gift.gid
                     },
@@ -96,7 +103,6 @@ export default {
                     failMessage:true
                 }).then((data)=>{
                     if (data.isSuccess) {
-                        this.checkUpdateUserIntegral(unique);
                         this.sendGift({
                             gift,
                             number:this.number,
@@ -104,13 +110,14 @@ export default {
                             integral
                         },true);
                     } else {
-                        this.plusBalance(integral,false);
-                        this.checkUpdateUserIntegral(unique);
+                        this.useGiftType.methods.plus(resultConfig,this);
                     }
 
+                    this.useGiftType.methods.checkUpdate && this.useGiftType.methods.checkUpdate(resultConfig,this,unique);
+
                 }).catch(()=>{
-                    this.plusBalance(integral,false);
-                    this.checkUpdateUserIntegral(unique);
+                    this.useGiftType.methods.plus(resultConfig,this);
+                    this.useGiftType.methods.checkUpdate && this.useGiftType.methods.checkUpdate(resultConfig,this,unique);
                 });
 
                 /* 设置持续点击的动画 */
@@ -123,6 +130,27 @@ export default {
 
         },
 
+        updateBanner(){
+          nextTick(()=>{
+             this.$refs.banner && this.$refs.banner.update();
+
+             if (!this.giftData[this.giftSelect] || this.giftData[this.giftSelect].num <= 0) {
+                 for (let i=0,count=this.giftData.length;i<count;i++) {
+                     if (this.giftData[i].num > 0) {
+                         this.giftSelect = i;
+                         break;
+                     }
+                 }
+
+                 if (this.giftData[this.giftSelect] === undefined || this.giftData[this.giftSelect].num<=0) {
+                     this.giftSelect = 0;
+                     return this.$refs.fetch && this.$refs.fetch.reload(FlatListReload.start);
+                 }
+             }
+
+          });
+        },
+
         checkUpdateUserIntegral(unique){
             if (this.requestUnique === unique) {
                 this.requestUnique = null;

+ 3 - 1
src/pages/talking/components/room-gift/components/room-gift-item/mixins/index.ts

@@ -2,5 +2,7 @@ import handle from './handle';
 import select from './select';
 import gift from './gift';
 import giveGift from "./giveGift";
+import config from './config';
+import fetch from './fetch';
 
-export default [giveGift,handle,select,gift];
+export default [fetch,config,giveGift,handle,select,gift];

+ 0 - 4
src/pages/talking/components/room-gift/components/room-gift-item/mixins/select.ts

@@ -17,15 +17,11 @@ export default <LibMixins>{
         giveUserNoHave(){
             return this.giveUser && this.giveUser.uid && this.useUserIds.indexOf(this.giveUser.uid) < 0;
         },
-
         useUserIds(){
           return this.useUserData.map((item)=> item.uid);
         },
         useUserData(){
             return [...this.userData,...userAppendData];
-        },
-        giftData(){
-            return this.$store.state.gift.giftData;
         }
     },
 

+ 7 - 0
src/pages/talking/components/room-gift/components/room-gift-item/props.ts

@@ -1,3 +1,5 @@
+import {RoomGiftType} from "@/pages/talking/const/roomGiftType";
+
 export default {
 
     userData:{
@@ -17,6 +19,11 @@ export default {
         default:function (){
             return {}
         }
+    },
+
+    giftType:{
+        type:Number,
+        default: RoomGiftType.default
     }
 
 }

+ 118 - 114
src/pages/talking/components/room-gift/components/room-gift-item/src/main.vue

@@ -1,114 +1,127 @@
 <template>
-  <section class="screen talking-gift-container">
-
-    <section class="rowACenter talking-gift-list"
-             @mouseleave="closeIntroduce"
-    >
-      <div @click="bannerPrev" class="talking-gift-trigger center cursor-pointer">
-        <svg t="1623035534357" class="talking-gift-trigger-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3411" width="200" height="200"><path d="M670.6 861.6c-7.6 0-15.1-2.9-20.9-8.6L329.4 532.7c-11.6-11.5-11.6-30.3 0-41.8l320.2-320.2c5.8-5.8 13.3-8.6 20.9-8.6 7.5 0 15.1 2.9 20.9 8.6 11.5 11.5 11.5 30.2 0 41.8L392 511.8l299.4 299.4c11.5 11.6 11.5 30.3 0 41.8-5.7 5.7-13.3 8.6-20.8 8.6z" p-id="3412" fill="#ffffff"></path></svg>
-      </div>
-      <aside class="flex-1 overflow talking-gift-banner-margin">
-        <swiper
-            :swiperOption="swiperOption"
-            class="screen"
-            ref="banner"
+  <flat-list
+      @fetch="fetch"
+      :paging="false"
+      indexes="gid"
+      ref="fetch"
+      @changeData="changeData"
+  >
+    <template v-slot:layout>
+      <section class="screen talking-gift-container">
+        <section class="rowACenter talking-gift-list"
+                 @mouseleave="closeIntroduce"
         >
-          <swiper-item
-              v-for="(item,index) in giftData"
-              class="talking-gift-banner center cursor-pointer relative"
-              :class="{
-                'talking-gift-banner-active': index === giftSelect
-              }"
-              :key="'image-item-'+index"
-              @click="changeGiftSelect(index)"
-          >
-            <div class="absolute talking-gift-banner-container"
-              @mouseover="openIntroduce(item,$event)"
-            ></div>
-            <div class="talking-gift-image-warp center">
-              <v-image
-                  class="talking-gift-image"
-                  :id="index === giftSelect?'gift-active-'+item.gid:''"
-                  :src="item.base_image"
-                  backgroundColor="transparent"
-              ></v-image>
-            </div>
+          <div @click="bannerPrev" class="talking-gift-trigger center cursor-pointer">
+            <svg t="1623035534357" class="talking-gift-trigger-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3411" width="200" height="200"><path d="M670.6 861.6c-7.6 0-15.1-2.9-20.9-8.6L329.4 532.7c-11.6-11.5-11.6-30.3 0-41.8l320.2-320.2c5.8-5.8 13.3-8.6 20.9-8.6 7.5 0 15.1 2.9 20.9 8.6 11.5 11.5 11.5 30.2 0 41.8L392 511.8l299.4 299.4c11.5 11.6 11.5 30.3 0 41.8-5.7 5.7-13.3 8.6-20.8 8.6z" p-id="3412" fill="#ffffff"></path></svg>
+          </div>
+          <aside class="flex-1 overflow talking-gift-banner-margin">
+            <swiper
+                :swiperOption="swiperOption"
+                class="screen"
+                ref="banner"
+            >
+              <swiper-item
+                  v-for="(item,index) in giftData"
+                  class="talking-gift-banner center cursor-pointer relative"
+                  :class="{
+                    'talking-gift-banner-active': index === giftSelect,
+                    'talking-gift-none': item.num <= 0
+                  }"
+                  :key="'image-item-'+index"
+                  @click="changeGiftSelect(index)"
+              >
+                <div class="absolute talking-gift-banner-container"
+                     @mouseover="openIntroduce(item,$event)"
+                ></div>
+                <div class="talking-gift-image-warp center">
+                  <v-image
+                      class="talking-gift-image"
+                      :id="index === giftSelect?'gift-active-'+item.gid:''"
+                      :src="item.base_image"
+                      backgroundColor="transparent"
+                  >
+                    <layout-dot class="absolute talking-gift-dot" :value="item.num" :max="999"></layout-dot>
+                  </v-image>
+                </div>
 
-            <div class="talking-gift-title overflow">{{item.gift_name}}</div>
-          </swiper-item>
-        </swiper>
-      </aside>
-      <div @click="bannerNext" class="talking-gift-trigger center cursor-pointer">
-        <svg t="1623035654891" class="talking-gift-trigger-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1920" width="200" height="200"><path d="M671.5392 512L332.1344 172.544a32 32 0 0 1 45.2608-45.2096l358.4 358.4a37.12 37.12 0 0 1 0 52.5312l-358.4 358.4a32 32 0 0 1-45.2608-45.2608L671.5904 512z" fill="#ffffff" p-id="1921"></path></svg>
-      </div>
-    </section>
+                <div class="talking-gift-title overflow">{{item.gift_name}}</div>
+              </swiper-item>
+            </swiper>
+          </aside>
+          <div @click="bannerNext" class="talking-gift-trigger center cursor-pointer">
+            <svg t="1623035654891" class="talking-gift-trigger-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1920" width="200" height="200"><path d="M671.5392 512L332.1344 172.544a32 32 0 0 1 45.2608-45.2096l358.4 358.4a37.12 37.12 0 0 1 0 52.5312l-358.4 358.4a32 32 0 0 1-45.2608-45.2608L671.5904 512z" fill="#ffffff" p-id="1921"></path></svg>
+          </div>
+        </section>
 
-    <footer class="talking-gift-footer rowACenter">
-      <div class="talking-gift-footer-icon overflow center">
-        <v-image v-if="giftData[giftSelect]" backgroundColor="transparent" :src="giftData[giftSelect].base_image" class="talking-gift-give-icon"></v-image>
-      </div>
-      <div class="talking-gift-footer-margin">数量</div>
-      <div class="relative">
-        <a-select v-model:value="number" class="talking-gift-number talking-gift-select" dropdownClassName="talking-gift-dropdown">
-          <a-select-option
-              v-for="(item,index) in numberData"
-              :key="'options-'+item.pid"
-              :value="item.value"
-          >
-            <div class="rowACenter talking-gift-number-item">
-              <div class="talking-select-value">{{item.value}}</div>
-              <div class="talking-select-label">{{item.label}}</div>
+        <footer class="talking-gift-footer rowACenter">
+          <div class="talking-gift-footer-icon overflow center">
+            <v-image v-if="giftData[giftSelect]" backgroundColor="transparent" :src="giftData[giftSelect].base_image" class="talking-gift-give-icon"></v-image>
+          </div>
+          <div class="talking-gift-footer-margin">数量</div>
+          <div class="relative">
+            <a-select v-model:value="number" class="talking-gift-number talking-gift-select" dropdownClassName="talking-gift-dropdown">
+              <a-select-option
+                  v-for="(item,index) in numberData"
+                  :key="'options-'+item.pid"
+                  :value="item.value"
+              >
+                <div class="rowACenter talking-gift-number-item">
+                  <div class="talking-select-value">{{item.value}}</div>
+                  <div class="talking-select-label">{{item.label}}</div>
+                </div>
+              </a-select-option>
+            </a-select>
+            <div class="absolute talking-gift-select-modal jCenter aEnd">
+              <icon type="down" class="talking-gift-select-icon"></icon>
             </div>
-          </a-select-option>
-        </a-select>
-        <div class="absolute talking-gift-select-modal jCenter aEnd">
-          <icon type="down" class="talking-gift-select-icon"></icon>
-        </div>
-      </div>
-      <div class="talking-gift-footer-margin">给</div>
-      <div class="relative"
-           :class="{
+          </div>
+          <div class="talking-gift-footer-margin">给</div>
+          <div class="relative"
+               :class="{
             'talking-gift-not-user-select': giveUserNoHave
            }"
-      >
-        <a-select class="talking-gift-user talking-gift-select"
-                  dropdownClassName="talking-gift-dropdown"
-
-                  placeholder="送给TA"
-                  v-model:value="giveUserValue"
-        >
-          <a-select-option
-              v-for="(item,index) in useUserData"
-              :key="'options-'+item.uid"
-              :value="item.uid"
           >
-            <div class="rowACenter talking-gift-user-item">
-              <div v-if="item.custom" class="talking-gift-custom-avatar center">
-                <v-image mode="center" backgroundColor="transparent" :src="item.icon" class="gift-user-custom-icon" radius="50%"></v-image>
-              </div>
-              <v-image v-else :src="item.icon" class="talking-gift-user-icon" radius="50%"></v-image>
-              <div class="flex-1 talking-gift-select-margin">
-                <div class="talking-select-label line-1">{{item.label}}</div>
-              </div>
+            <a-select class="talking-gift-user talking-gift-select"
+                      dropdownClassName="talking-gift-dropdown"
+
+                      placeholder="送给TA"
+                      v-model:value="giveUserValue"
+            >
+              <a-select-option
+                  v-for="(item,index) in useUserData"
+                  :key="'options-'+item.uid"
+                  :value="item.uid"
+              >
+                <div class="rowACenter talking-gift-user-item">
+                  <div v-if="item.custom" class="talking-gift-custom-avatar center">
+                    <v-image mode="center" backgroundColor="transparent" :src="item.icon" class="gift-user-custom-icon" radius="50%"></v-image>
+                  </div>
+                  <v-image v-else :src="item.icon" class="talking-gift-user-icon" radius="50%"></v-image>
+                  <div class="flex-1 talking-gift-select-margin">
+                    <div class="talking-select-label line-1">{{item.label}}</div>
+                  </div>
+                </div>
+              </a-select-option>
+            </a-select>
+            <div class="absolute talking-gift-select-modal jCenter aEnd">
+              <icon type="down" class="talking-gift-select-icon"></icon>
+            </div>
+            <div class="talking-gift-no-user absolute jCenter" v-if="giveUserNoHave">
+              <div class="talking-select-label line-1">{{giveUser.nick_name}}</div>
             </div>
-          </a-select-option>
-        </a-select>
-        <div class="absolute talking-gift-select-modal jCenter aEnd">
-          <icon type="down" class="talking-gift-select-icon"></icon>
-        </div>
-        <div class="talking-gift-no-user absolute jCenter" v-if="giveUserNoHave">
-          <div class="talking-select-label line-1">{{giveUser.nick_name}}</div>
-        </div>
-      </div>
-      <!--  赠送  -->
-      <div @click="giveUserGift" class="room-gift-give cursor-pointer center">
-        <span v-if="pressNumber<1">赠送</span>
-        <div v-else :key="'give-'+pressNumber" class="row room-gift-give-count"><span class="iconfont icon-close room-gift-give-close"></span>{{pressNumber}}</div>
-      </div>
+          </div>
+          <!--  赠送  -->
+          <div @click="giveUserGift" class="room-gift-give cursor-pointer center">
+            <span v-if="pressNumber<1">赠送</span>
+            <div v-else :key="'give-'+pressNumber" class="row room-gift-give-count"><span class="iconfont icon-close room-gift-give-close"></span>{{pressNumber}}</div>
+          </div>
 
-    </footer>
+        </footer>
+
+      </section>
+    </template>
+  </flat-list>
 
-  </section>
 </template>
 
 <script>
@@ -118,36 +131,27 @@ import {
   vImage,
   icon
 } from '$components';
-import unit from "$utils/unit/unit";
 import mixins from '../mixins/index';
 import {Select} from "ant-design-vue";
-import numberData from '../data/number';
 import props from '../props';
+import FlatList from "$components/flat-list/src/main";
+import layoutDot from '$layout/layout-dot';
 export default {
   name: "room-gift-item",
 
-  data(){
-    return {
-      swiperOption:{
-        slidesPerView:'auto',
-        spaceBetween:unit.unitPx(20),
-        threshold:unit.unitPx(10)
-      },
-
-      numberData
-    }
-  },
   props,
 
   mixins,
 
   components:{
+    FlatList,
     swiper,
     swiperItem,
     vImage,
     [Select.name]:Select,
     [Select.Option.displayName]:Select.Option,
-    icon
+    icon,
+    layoutDot
   }
 }
 </script>

+ 8 - 0
src/pages/talking/components/room-gift/components/room-gift-item/style.scss

@@ -56,6 +56,14 @@
   pointer-events: none;
   //background-color: ;
 }
+.talking-gift-none{
+  display: none !important;
+}
+.talking-gift-dot{
+  right: 0;
+  top: auto;
+  bottom: 0;
+}
 /* 礼物模块 */
 
 /* 底部模块 */

+ 10 - 6
src/pages/talking/components/room-gift/data/tab.ts

@@ -1,11 +1,15 @@
+import {RoomGiftType} from "@/pages/talking/const/roomGiftType";
+
 export default [
     {
         label:'热门',
-        slot:'0'
+        slot:'0',
+        type: RoomGiftType.default
     },
-    // {
-    //     label:'我的背包',
-    //     align:'right',
-    //     slot:'1'
-    // }
+    {
+        label:'我的背包',
+        align:'right',
+        slot:'1',
+        type: RoomGiftType.knapsack
+    }
 ] as LibDataArray

+ 4 - 2
src/pages/talking/components/room-gift/src/main.vue

@@ -25,12 +25,14 @@
         v-for="(item,index) in tabData"
         v-slot:[item.slot]
       >
-        <room-gift-item
+        <component
+            :is="item.component || 'room-gift-item'"
           :key="'room-gift-item-'+index"
           :user-data="userData"
           :giveUserId="giveUserId"
           :give-user="giveUser"
-        ></room-gift-item>
+          :gift-type="item.type"
+        ></component>
       </template>
 
     </tab>

+ 14 - 2
src/pages/talking/components/room-ranking/components/room-chat/components/room-chat-message/src/main.vue

@@ -14,7 +14,7 @@
       {{item.giftNum}}
       <v-image :src="item.show_img" mode="center" background-color="transparent" class="room-chat-icon"></v-image>
     </div>
-    <div class="room-chat-message" v-else>{{item.message}}</div>
+    <div class="room-chat-message" v-else>{{message}}</div>
   </section>
 
 </template>
@@ -33,6 +33,18 @@ export default {
       AgoraRTMessage
     }
   },
+
+  computed:{
+    message(){
+      if (this.item.message) {
+        // @ts-ignore
+        return window.RongIMLib.RongIMEmoji.symbolToEmoji(this.item.message);
+      } else {
+        return '';
+      }
+    }
+  },
+
   components:{
     vImage,
     icon
@@ -41,4 +53,4 @@ export default {
 }
 </script>
 
-<style scoped lang="scss" src="../style.scss"></style>
+<style scoped lang="scss" src="../style.scss"></style>

+ 8 - 3
src/pages/talking/components/room-ranking/components/room-chat/data/control.ts

@@ -1,5 +1,10 @@
+import {FunctionTrigger} from "$mixins/trigger/class";
+
 export default [
-    // {
-    //     icon:require('../images/expression.png')
-    // }
+    {
+        icon:require('../images/expression.png'),
+        trigger: new FunctionTrigger(function (){
+            this.toggleEmoji();
+        })
+    }
 ]

+ 2 - 1
src/pages/talking/components/room-ranking/components/room-chat/mixins/index.ts

@@ -2,5 +2,6 @@ import shield from './shield';
 import message from './message';
 import scroll from './scroll';
 import user from '$mixins/user';
+import trigger from '$mixins/trigger';
 
-export default [shield,message,scroll,user];
+export default [shield,message,scroll,user,trigger];

+ 30 - 2
src/pages/talking/components/room-ranking/components/room-chat/mixins/message.ts

@@ -12,18 +12,46 @@ export default <LibMixins>{
           // 最大存储
           messageLength:100,
           // 消息
-          message:''
+          message:'',
+          // 表情模块
+          emojiModal:false
       }
     },
 
+    provide(){
+        return {
+            addMessage:(message:string)=> this.addMessage(message)
+        }
+    },
+
     methods:{
 
+        addMessage(useMessage:string){
+            let message = this.message + useMessage;
+
+            if (this.message !== message) {
+                this.message = message;
+            }
+        },
+
+        // 打开emoji
+        toggleEmoji(){
+            this.emojiModal = !this.emojiModal;
+        },
+
+        // 隐藏模块
+        hiddenModal(){
+            this.emojiModal = false;
+        },
+
         // 发送消息
         sendMessage(){
 
             if (verification.trigger[VerificationType.empty](this.message)) {
 
                 let resultData = this.agoraRTMIM.addUserInfo({});
+                // 隐藏模块
+                this.hiddenModal();
                 // 消息内容
                 resultData.message = this.message;
                 // 清空消息
@@ -85,4 +113,4 @@ export default <LibMixins>{
         delete this.messageCallback;
     }
 
-}
+}

+ 7 - 1
src/pages/talking/components/room-ranking/components/room-chat/src/main.vue

@@ -1,5 +1,5 @@
 <template>
-  <section class="screen flex room-chat-container">
+  <section class="screen flex room-chat-container relative" @click="hiddenModal">
     <div class="flex-1">
       <scroll-view
        scroll-type="none"
@@ -25,6 +25,7 @@
               v-for="(item,index) in controlData"
               class="room-chat-control-item cursor-pointer"
               :key="'control-'+index"
+              @click.stop="trigger(item,index)"
           >
             <v-image
                 :src="item.icon"
@@ -67,6 +68,8 @@
       </footer>
     </section>
 
+    <chat-emoji v-model:value="emojiModal" class="room-chat-chat-emoji"></chat-emoji>
+
   </section>
 </template>
 
@@ -83,6 +86,8 @@ import mixins from '../mixins';
 
 import components,{ RoomMessageType } from '../components';
 
+import chatEmoji from '$popup/popup-chat/components/chat-content/components/chat-emoji';
+
 export default {
   name: "room-chat",
 
@@ -100,6 +105,7 @@ export default {
     scrollView,
     vImage,
     radio,
+    chatEmoji,
     ...components
   }
 }

+ 9 - 1
src/pages/talking/components/room-ranking/components/room-chat/style.scss

@@ -73,4 +73,12 @@
   font-weight: 400;
   border-radius: 16px;
 }
-/* 消息内容 */
+/* 消息内容 */
+
+/* 表情 */
+.room-chat-chat-emoji{
+  bottom: 80px !important;
+  left: 10px !important;
+  width: 295px !important;
+}
+/* 表情 */

+ 116 - 0
src/pages/talking/components/room-wheat/mixins/follow.ts

@@ -0,0 +1,116 @@
+import {InstructionsCacheType} from "$utils/request";
+import socket from "$utils/socket";
+import {NoticeType} from "$utils/socket/const";
+import Throttle from '$utils/tool/throttle';
+import personalDetail from "$utils/control/personal-detail";
+
+
+export default {
+
+    data(){
+        return {
+            // 是否关注
+            follow:false,
+            // 是否处于加载中
+            loading:true
+        }
+    },
+
+    watch:{
+
+        hostUser(){
+            this.getUserInfo(this.hostUser);
+        }
+
+    },
+
+    inject:['getRoomInfo'],
+
+    methods:{
+
+        getUserInfo(){
+
+            if (this.user.uid !== this.hostUser.mc_user_info.uid && this.now_use_host_id !== this.hostUser.mc_user_info.uid) {
+                this.now_use_host_id = this.hostUser.mc_user_info.uid;
+                if (this.now_use_host_id) {
+                    this.loading = true;
+                    this.$request({
+                        url:'room/get_room_user_info',
+                        data:{
+                            rid: this.room_info.rid,
+                            uid: this.now_use_host_id
+                        },
+                        token:true,
+                        cache:{
+                            type: InstructionsCacheType.memory
+                        }
+                    }).then((data)=>{
+                        data = data.data || {};
+                        this.loading = false;
+                        this.follow = data.is_follow === 2;
+                    })
+                }
+            }
+
+        },
+        toggleFollow(){
+            this.follow = !this.follow;
+            personalDetail.updateCache({
+                uid: this.now_use_host_id,
+                status: this.follow ? 1 : 0
+            });
+
+            socket.triggerNotice(NoticeType.follow, {
+                uid: this.now_use_host_id,
+                status: this.follow ? 1 : 0,
+                followUserInfo:this.userInfo
+            });
+
+            // 设置是否关注
+            return this.triggerFollow();
+        },
+
+        triggerFollow(){
+            if(this.follow !== this._followStatus) {
+                this._followStatus = this.follow;
+                return this.$request({
+                    url:this._followStatus ? 'user/follow_user' : '/user/unfollow_user',
+                    data:{
+                        follow_uid: this.now_use_host_id
+                    },
+                    token:true
+                });
+            }
+        }
+
+    },
+
+    created() {
+        this.room_info = this.getRoomInfo();
+        this.Throttle = new Throttle({
+            delay:1000,
+            first:false,
+            call:this,
+            handle: this.triggerFollow
+        });
+
+        socket.on('talking-wheat',(params)=>{
+
+            if (params.uid) {
+                let status = !!params.status;
+                if (this.follow !== status) {
+                    this.follow = status;
+                }
+            }
+
+        },NoticeType.follow);
+
+        this.triggerFollow = this.Throttle.supper;
+    },
+
+    beforeUnmount() {
+        this.Throttle && this.Throttle.destroy();
+        socket.off('talking-wheat');
+    }
+
+}

+ 2 - 1
src/pages/talking/components/room-wheat/mixins/index.ts

@@ -1,2 +1,3 @@
 import user from '$mixins/user';
-export default [user];
+import follow from './follow';
+export default [user,follow];

+ 8 - 1
src/pages/talking/components/room-wheat/src/main.vue

@@ -25,7 +25,14 @@
             <div class="rowACenter">
               <div>{{hostUser.mc_user_info.nick_name}}</div>
               <div class="room-wheat-label center">主持</div>
-<!--              <img src="../images/follow.png" class="room-wheat-follow" />-->
+              <div v-show="!loading && hostUser.mc_user_info.uid !== user.uid" class="room-wheat-follow cursor-pointer" @click="toggleFollow">
+                <svg v-if="!follow" class="room-wheat-follow"
+                      viewBox="0 0 1201 1024" width="200" height="200">
+                  <path d="M903.62324902 526.69698945L548.15650859 882.26979013l-348.82030019-347.64185302c-93.17980107-93.20336982-96.00807393-247.83917959-6.16327735-337.69576055 91.30607051-91.22357901 239.99072344-92.01313828 331.55605195-1.75588594a32.99651455 32.99651455 0 0 0 46.25404278 0.10606026A234.36953086 234.36953086 0 0 1 734.30399023 128.34656387a32.99651455 32.99651455 0 0 0 32.85510118-33.19685069c-0.09427588-18.24235927-15.31981055-33.12614443-33.19685069-32.85510117a299.92653545 299.92653545 0 0 0-185.95892988 65.2977457C429.97006338 33.06912734 255.91344717 40.79973887 146.51821602 150.20675528c-113.5197958 113.5197958-112.41205576 306.9500792 1.69696318 426.53887646a43.6025373 43.6025373 0 0 0 5.46799395 5.89223496c0.81312803 0.75420615 1.63804131 1.43770518 2.46295458 2.09763545l368.73605303 367.59295986a32.99651455 32.99651455 0 0 0 46.67828467 0l378.74106826-378.87069727a33.02715411 33.02715411 0 0 0-46.7136378-46.70185253z" fill="#ffffff" p-id="2280"></path>
+                  <path d="M1085.03337412 221.10212393h-125.03322246V96.03354834a33.02597636 33.02597636 0 1 0-66.05195186 0v125.06857559H768.92676172a32.99651455 32.99651455 0 1 0 0 65.99302998h125.02143808v125.04500684a33.02597636 33.02597636 0 1 0 66.05195186-1e-8V287.09515391h125.03322246a32.99651455 32.99651455 0 0 0 0-65.99302998z" fill="#ffffff" p-id="2281"></path>
+                </svg>
+                <svg v-else t="1626661063039" class="room-wheat-follow" viewBox="0 0 1024 1024" p-id="2678" width="200" height="200"><path d="M511.35488 131.9936s238.19264-198.7584 450.56 40.96c0 0 140.17536 152.33024-10.24 378.88l-409.6 409.6s-22.20032 33.792-61.44 0l-430.08-430.08s-107.04896-188.5184 0-348.16c0 0 182.85568-267.70432 460.8-51.2z" p-id="2679" fill="#FF3C3C"></path><path d="M132.47488 387.9936a18.72896 18.72896 0 0 0 20.48-20.48s-6.33856-164.63872 163.84-163.84c0 0 20.48-4.32128 20.48-20.48s-20.48-20.48-20.48-20.48-204.46208-8.81664-204.8 204.8c0 0 2.95936 20.48 20.48 20.48z" fill="#FF3C3C" p-id="2680"></path></svg>
+              </div>
             </div>
             <section class="row">
               <div class="room-wheat-love rowACenter">

+ 1 - 1
src/pages/talking/components/room-wheat/style.scss

@@ -97,4 +97,4 @@
   text-align: center;
   margin-top: 12px;
 }
-/* 麦位 */
+/* 麦位 */

+ 12 - 0
src/pages/talking/const/roomGiftType.ts

@@ -0,0 +1,12 @@
+enum RoomGiftType {
+
+    default=1,
+
+    knapsack=2
+
+}
+
+
+export {
+    RoomGiftType
+}

+ 0 - 1
src/pages/talking/mixins/handle.ts

@@ -76,7 +76,6 @@ export default <LibMixins>{
                         message:InstructionsMessageType.other
                     }).then((data)=>{
 
-                        console.log(data);
                         if (data.isCache) {
                             this.fetchRoomInfo(true);
                         }

+ 3 - 0
src/popup/popup-chat/components/chat-content/components/chat-emoji/index.ts

@@ -0,0 +1,3 @@
+import main from './src/main.vue';
+
+export default main;

+ 37 - 0
src/popup/popup-chat/components/chat-content/components/chat-emoji/mixins/handle.ts

@@ -0,0 +1,37 @@
+export default {
+
+    data(){
+      return {
+          draw:false
+      }
+    },
+
+    inject:['addMessage'],
+
+    watch:{
+        value:{
+            handler(){
+
+                return this.changeValue(this.value);
+            },
+            immediate:true
+        }
+    },
+
+    methods:{
+        changeValue(value){
+            if (value !== this.vValue) {
+                this.vValue = value;
+
+                if (value && !this.draw) {
+                    this.draw = true;
+                }
+
+                if (this.value !== value) {
+                    return this.$emit('input',value);
+                }
+            }
+        }
+    },
+
+}

+ 3 - 0
src/popup/popup-chat/components/chat-content/components/chat-emoji/mixins/index.ts

@@ -0,0 +1,3 @@
+import handle from './handle';
+
+export default [handle];

+ 8 - 0
src/popup/popup-chat/components/chat-content/components/chat-emoji/props.ts

@@ -0,0 +1,8 @@
+export default {
+
+    value:{
+        type:Boolean,
+        default:false
+    }
+
+}

+ 40 - 0
src/popup/popup-chat/components/chat-content/components/chat-emoji/src/main.vue

@@ -0,0 +1,40 @@
+<template>
+  <section class="chat-emoji absolute" @click.stop v-if="draw" v-show="vValue">
+    <scroll-view>
+      <div class="row wrap chat-emoji-content">
+        <div v-for="(item,index) in emojiData"
+          :key="'chat-emoji-'+index"
+          class="chat-emoji-item center"
+             @click="addMessage(item.symbol+' ')"
+        >
+          <span class="cursor-pointer">{{item.emoji}}</span>
+        </div>
+      </div>
+    </scroll-view>
+
+  </section>
+</template>
+
+<script>
+import config from '$config/index';
+import {
+  scrollView
+} from '$components';
+import props from '../props';
+import mixins from '../mixins';
+export default {
+  name: "chat-emoji",
+  data(){
+    return {
+      emojiData: config.emoji
+    }
+  },
+  components:{
+    scrollView
+  },
+  props,
+  mixins
+}
+</script>
+
+<style scoped lang="scss" src="../style.scss"></style>

+ 19 - 0
src/popup/popup-chat/components/chat-content/components/chat-emoji/style.scss

@@ -0,0 +1,19 @@
+/* 容器 */
+.chat-emoji{
+  width: 335px;
+  height: 200px;
+  padding: 5px;
+  background-color: #fff;
+  border-radius: 10px;
+  bottom: 135px;
+  left: 20px;
+}
+.chat-emoji-item{
+  width: 40px;
+  margin-top: 8px;
+  font-size: 23px;
+}
+.chat-emoji-content{
+  margin-top: -8px;
+}
+/* 容器 */

+ 6 - 5
src/popup/popup-chat/components/chat-content/data/message-control.ts

@@ -1,15 +1,16 @@
 import {FunctionTrigger} from "$mixins/trigger/class";
 
 export default [
-    // {
-    //     icon:require('../images/expression.png')
-    // },
+    {
+        icon:require('../images/expression.png'),
+        trigger: new FunctionTrigger(function () {
+            return this.toggleEmoji();
+        })
+    },
     {
         icon:require('../images/gift.png'),
         trigger: new FunctionTrigger(function () {
-
             return this.toggleGift();
-
         })
     }
 ]

+ 18 - 13
src/popup/popup-chat/components/chat-content/mixins/gift.ts

@@ -4,26 +4,31 @@ export default {
 
     data(){
         return {
-            giftModal:false
+            giftModal:false,
+            emojiModal:false
         }
     },
 
     methods:{
         toggleGift(){
-
-            // if (this.giftModal) {
-            //      globalEvent.off('chat-content');
-            // } else {
-            //     console.log('点击1');
-            //     globalEvent.on('chat-content',()=>{
-            //         console.log('点击');
-            //         this.giftModal = false;
-            //     });
-            // }
-
             this.giftModal = !this.giftModal;
+            if (this.giftModal) {
+                this.emojiModal = false;
+            }
+        },
+
+        // 打开emoji
+        toggleEmoji(){
+            this.emojiModal = !this.emojiModal;
+            if (this.emojiModal) {
+                this.giftModal = false;
+            }
+        },
 
+        hiddenModal(){
+            this.giftModal = false;
+            this.emojiModal = false;
         }
     }
 
-}
+}

+ 14 - 0
src/popup/popup-chat/components/chat-content/mixins/handle.ts

@@ -23,6 +23,12 @@ export default <LibMixins>{
         }
     },
 
+    provide(){
+      return {
+          addMessage:(message:string)=> this.addMessage(message)
+      }
+    },
+
     watch:{
       uid:{
           handler(){
@@ -162,6 +168,14 @@ export default <LibMixins>{
 
         },
 
+        addMessage(useMessage:string){
+            let message = this.message + useMessage;
+
+            if (this.message !== message) {
+                this.message = message;
+            }
+        },
+
         sendMessage(){
 
             if (this.message && verification.trigger[VerificationType.empty](this.message)) {

+ 6 - 2
src/popup/popup-chat/components/chat-content/src/main.vue

@@ -1,5 +1,5 @@
 <template>
-  <section class="screen relative">
+  <section class="screen relative" @click="hiddenModal">
     <section class="screen flex">
       <header class="chat-content-header rowACenter">
         <div class="flex-1">
@@ -105,6 +105,8 @@
     </section>
     <!--  送礼物   -->
     <chat-gift v-model:value="giftModal" :user-info="nowUserInfo"></chat-gift>
+    <!--  表情  -->
+    <chat-emoji v-model:value="emojiModal"></chat-emoji>
   </section>
 </template>
 
@@ -118,6 +120,7 @@ import {
 } from '$components';
 import layoutChat from '$layout/layout-chat';
 import chatGift from '../components/chat-gift';
+import chatEmoji from '../components/chat-emoji';
 import props from '../props';
 import mixins from '../mixins';
 export default {
@@ -129,7 +132,8 @@ export default {
     scrollView,
     stepper,
     chatGift,
-    FlatList
+    FlatList,
+    chatEmoji
   },
   mixins,
   props

+ 1 - 1
src/popup/popup-chat/components/chat-list/mixins/handle.ts

@@ -35,7 +35,7 @@ export default <LibMixins>{
         // 获取粉丝列表
         get_fans(obj){
             return this.$request({
-                url:'user/get_user_fans_list',
+                url:'user/hx_get_user_fans_list',
                 page:obj.data,
                 entrust: followEntrust.getEntrust(EntrustType.fans),
                 token:true

+ 4 - 4
src/popup/popup-detail/components/game/src/main.vue

@@ -50,9 +50,9 @@
               </section>
               <div class="game-button center overflow cursor-pointer"
                    :class="{'game-reverse': item.reverse}"
-                v-for="(item,index) in buttonData"
-                :key="'button-game-'+index"
-                   @click="trigger(item,index)"
+                   v-for="(item,index) in buttonData"
+                   :key="'button-game-'+index"
+                   @click="trigger(item,index,true)"
               >{{item.label}}</div>
             </section>
 
@@ -167,4 +167,4 @@ export default {
 .game-describe-icon path{
   fill: #999 !important;
 }
-</style>
+</style>

+ 4 - 1
src/popup/popup-detail/components/game/style.scss

@@ -65,6 +65,9 @@
   color: #FF58E7;
   border: 1px solid #FF58E7;
 }
+.game-login-button{
+  background: $main-linear;
+}
 /* 按钮 */
 
 /* 音频 */
@@ -207,4 +210,4 @@ $animate:1s;
   margin-left: 5px;
   font-weight: bold;
 }
-/* tab分类 */
+/* tab分类 */

+ 7 - 7
src/popup/popup-detail/data/tab.ts

@@ -5,10 +5,10 @@ export default [
         slot:'1',
         component:'gift-banner'
     },
-    {
-        label:'冠名',
-        icon:require('../images/vip.png'),
-        slot:'2',
-        component:'gift-banner'
-    }
-]
+    // {
+    //     label:'冠名',
+    //     icon:require('../images/vip.png'),
+    //     slot:'2',
+    //     component:'gift-banner'
+    // }
+]

+ 4 - 4
src/popup/popup-detail/mixins/handle.ts

@@ -24,7 +24,7 @@ export default <LibMixins>{
             banner:0,
             game:0,
             tabData,
-            followStatus:1,
+            followStatus:false,
             followNum:0,
         }
     },
@@ -81,7 +81,7 @@ export default <LibMixins>{
         // 关注
         followUser(){
             // 设置当前的关注状态
-            this.followStatus = this.followStatus == 1 ? 0 : 1;
+            this.followStatus = this.followStatus ? 1 : 0;
 
             personalDetail.updateCache({
                 uid: this.option.uid,
@@ -117,7 +117,7 @@ export default <LibMixins>{
 
     created() {
 
-        this.followStatus = this.option.is_follow;
+        this.followStatus = this.option.is_follow === 2;
         this._followStatus = this.followStatus;
 
         let followNumber = this.followStatus ? this.option.fans_num -1 :this.option.fans_num;
@@ -148,4 +148,4 @@ export default <LibMixins>{
 
     }
 
-}
+}

+ 2 - 2
src/popup/popup-detail/src/main.vue

@@ -13,7 +13,7 @@
           </aside>
 
           <!-- 关注 -->
-          <div class="detail-follow-container overflow row">
+          <div v-if="$store.getters.isLogin" class="detail-follow-container overflow row">
             <div class="detail-follow-item detail-follow-number center">{{useFollowNum}}</div>
             <div @click="followUser" class="detail-follow-item detail-follow-span cursor-pointer rowCenter">
               <svg v-if="!followStatus" t="1623031446983" class="detail-follow-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2552" width="200" height="200"><path d="M753.266187 77.352518A270.218129 270.218129 0 0 0 512 230.510504 270.218129 270.218129 0 0 0 270.733813 77.352518C121.480288 77.352518 0 203.105612 0 357.663309c0 240.750504 257.841727 460.431655 498.444892 585.669065a29.467626 29.467626 0 0 0 27.110216 0c240.971511-125.23741 498.444892-344.918561 498.444892-585.669065 0-154.557698-121.480288-280.310791-270.733813-280.310791z" fill="#ffffff" p-id="2553"></path></svg>
@@ -215,4 +215,4 @@ export default {
 }
 </script>
 
-<style scoped lang="scss" src="../style.scss"></style>
+<style scoped lang="scss" src="../style.scss"></style>

+ 6 - 1
src/popup/popup-gift-bubble/mixins/handle.ts

@@ -1,6 +1,7 @@
 import unit from "$utils/unit/unit";
 import popup from "$utils/tool/popup";
 import {PopupExportComponent} from "$popup/popup-export/const";
+import user from "$config/user";
 
 export default <LibMixins>{
 
@@ -82,6 +83,7 @@ export default <LibMixins>{
         },
 
         openRecharge(){
+            if (!user.verificationLogin()) return;
             return popup.$popup.open(PopupExportComponent.recharge);
         },
 
@@ -96,6 +98,9 @@ export default <LibMixins>{
 
         // 触发打赏
         triggerReward(){
+
+            if (!user.verificationLogin()) return;
+
             if (this.stroageAttrs.reward) {
                 this.stroageAttrs.reward({
                     item:this.vItem,
@@ -106,4 +111,4 @@ export default <LibMixins>{
 
     },
 
-}
+}

+ 8 - 1
src/store/modules/chat.ts

@@ -49,7 +49,14 @@ export default <Module<any,any>>{
             state.chatUserObject = chatUserObject;
         },
 
-
+        clearSession(state){
+            if (state.chatSessionStatus) {
+                state.chatSessionStatus = false;
+                state.chatUserList = [];
+                state.chatUserObject = {};
+                state.chatCount = 0;
+            }
+        }
 
     },
 

+ 8 - 0
src/store/modules/user.ts

@@ -133,6 +133,14 @@ export default <Module<any,any>>{
 
     actions:{
 
+        outLogin({ commit }){
+            // 清除用户信息
+            commit('outLogin');
+            // 清除消息
+            commit('clearSession');
+
+        },
+
         initializationUserPromise({commit}){
 
             commit('initializationUser');

+ 2 - 0
src/types/config.d.ts

@@ -27,6 +27,8 @@ interface Config {
     // 模式
     configMode?: ConfigMode,
 
+    emoji?:Array,
+
     baseURL: string,
 
     baseApiURL: string,

+ 1 - 14
src/utils/control/personal-detail/index.ts

@@ -38,15 +38,12 @@ export default {
     openStatus: false,
 
     openDetail(resultItem:Record<string, any>,type:OpenType = OpenType.play){
-
+        if (!user.isLogin()) return  popup.$open(PopupExportComponent.login);
         if (type === OpenType.play) {
             return this.openDetailTarget(resultItem);
         } else if (type === OpenType.user) {
             return this.openUserContent(resultItem);
         } else if (type === OpenType.room) {
-
-            if (!user.isLogin()) return  popup.$open(PopupExportComponent.login);
-
             if (resultItem.is_need_password === 2){
                 return  this.verifyPassword(resultItem);
             } else {
@@ -102,16 +99,6 @@ export default {
 
     routerRoom(resultItem,password='',temporaryParams:Record<string, any>={}){
 
-        console.log({
-            rid:resultItem.rid,
-            tid:resultItem.tid,
-            room_number:resultItem.room_number,
-            room_name: resultItem.room_name,
-            room_cover: resultItem.room_cover,
-            password,
-            back:1
-        });
-
         return  globalConfig.app && globalConfig.app.$router.push(params.createParams({
             name:'talking',
             params:{

+ 2 - 2
src/utils/request/config.ts

@@ -5,8 +5,8 @@ import constName from './const';
 export default <LibRequestConfig>{
 
     [constName.mode.default] :{
-        baseURL:config.baseURL + config.baseApiURL,
-        // baseURL: config.baseApiURL,
+        // baseURL:config.baseURL + config.baseApiURL,
+        baseURL: config.baseApiURL,
 
         method:'POST',
 

+ 4 - 0
src/views/view-footer/data/control.ts

@@ -4,6 +4,7 @@ import popup from "$utils/tool/popup";
 import {PopupExportComponent} from "$popup/popup-export/const";
 
 import personalDetail, {OpenType} from '$utils/control/personal-detail';
+import user from "$config/user";
 
 export default <LibDataArray>[
     {
@@ -38,6 +39,9 @@ export default <LibDataArray>[
         label:'在线客服',
         icon:require('../images/service.png'),
         trigger: new FunctionTrigger(function (item){
+
+            if (!user.verificationLogin()) return ;
+
             return popup.$open(PopupExportComponent.chat);
         }),
     },

+ 2 - 2
src/views/view-friends/data/config.ts

@@ -7,7 +7,7 @@ export default {
     },
 
     [FriendsType.fans]:{
-        url:'user/get_user_fans_list',
+        url:'user/hx_get_user_fans_list',
     },
 
-}
+}

+ 10 - 0
src/views/view-friends/mixins/handle.ts

@@ -3,6 +3,7 @@ import socket from "$utils/socket";
 import {NoticeType} from "$utils/socket/const";
 import FriendsType from "$views/view-friends/const/type";
 import followEntrust, {EntrustType} from '$utils/request/entrust';
+import personDetail, {OpenType} from '$utils/control/personal-detail';
 
 export default <LibMixins>{
 
@@ -22,6 +23,15 @@ export default <LibMixins>{
             }).then((data)=>{
                 return obj.success(data.data);
             }).catch(obj.fail);
+        },
+
+        openDetail(item){
+
+            if (item.uid) {
+
+                return personDetail.openDetail(item,OpenType.user);
+            }
+
         }
     },
 

+ 3 - 2
src/views/view-friends/src/main.vue

@@ -7,8 +7,9 @@
         ref="flat"
     >
       <template v-slot:item="{item,index}">
-        <aside class="view-friends-item rowACenter"
+        <aside class="view-friends-item rowACenter cursor-pointer"
           :key="'view-friends-'+item.uid"
+               @click="openDetail(item)"
         >
           <v-image radius="50%" :src="item.head_pic" class="view-friends-avatar"></v-image>
           <div class="flex-1">
@@ -18,7 +19,7 @@
               :birthday="item.birthday"
             ></layout-sex>
           </div>
-<!--          <div class="view-friends-introduce">互相关注</div>-->
+          <div v-if="item.is_follow===2" class="view-friends-introduce">互相关注</div>
         </aside>
       </template>
 

+ 2 - 2
src/views/view-header/mixins/login.ts

@@ -16,10 +16,10 @@ export default <LibMixins>{
             return this.$confirm({
                 title:'您确定要退出登录吗',
                 confirm:()=>{
-                    return this.$store.commit('outLogin');
+                    return this.$store.dispatch('outLogin');
                 }
             });
         }
     }
 
-}
+}

+ 2 - 2
src/views/view-menu/components/view-message/data/config.ts

@@ -7,7 +7,7 @@ export default {
     },
 
     [FriendsType.fans]:{
-        url:'user/get_user_fans_list',
+        url:'user/hx_get_user_fans_list',
     },
 
-}
+}