Browse Source

type:add 增加针对幸运大转盘抽奖模块

laosan2382995021@163.com 3 năm trước cách đây
mục cha
commit
d538ead771
86 tập tin đã thay đổi với 1734 bổ sung164 xóa
  1. 27 0
      package-lock.json
  2. 1 0
      package.json
  3. 17 0
      src/components/flat-list/mixins/on.ts
  4. 39 19
      src/pages/talking/components/room-broadcast/src/main.vue
  5. 9 1
      src/pages/talking/components/room-gift/components/room-gift-item/data/number.ts
  6. 2 5
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/fetch.ts
  7. 13 2
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/giveGift.ts
  8. 2 1
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/index.ts
  9. 69 0
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/knapsack.ts
  10. 6 0
      src/pages/talking/components/room-gift/components/room-gift-item/mixins/select.ts
  11. 9 5
      src/pages/talking/components/room-gift/components/room-gift-item/style.scss
  12. 2 1
      src/pages/talking/components/room-ranking/components/room-chat/components/const.ts
  13. 3 3
      src/pages/talking/components/room-ranking/components/room-chat/components/room-chat-entry/src/main.vue
  14. 10 1
      src/pages/talking/components/room-ranking/components/room-chat/components/room-chat-message/src/main.vue
  15. 27 5
      src/pages/talking/components/room-ranking/components/room-ranking-list/mixins/handle.ts
  16. 10 0
      src/pages/talking/components/room-ranking/components/room-ranking-list/props.ts
  17. 4 2
      src/pages/talking/components/room-ranking/data/tab.ts
  18. 58 0
      src/pages/talking/components/room-ranking/mixins/handle.ts
  19. 3 0
      src/pages/talking/components/room-ranking/mixins/index.ts
  20. 7 1
      src/pages/talking/components/room-ranking/src/main.vue
  21. 2 2
      src/pages/talking/components/room-wheat/src/main.vue
  22. BIN
      src/pages/talking/images/turntable.png
  23. 3 1
      src/pages/talking/mixins/index.ts
  24. 2 2
      src/pages/talking/mixins/micro.ts
  25. 22 5
      src/pages/talking/mixins/socket.ts
  26. 38 0
      src/pages/talking/mixins/turntable.ts
  27. 6 0
      src/pages/talking/mixins/utils.ts
  28. 13 5
      src/pages/talking/mixins/wheat.ts
  29. 4 1
      src/pages/talking/src/main.vue
  30. 11 1
      src/pages/talking/style.scss
  31. 3 0
      src/popup/popup-award-pool/index.ts
  32. 40 0
      src/popup/popup-award-pool/mixins/handle.ts
  33. 6 0
      src/popup/popup-award-pool/mixins/index.ts
  34. 10 0
      src/popup/popup-award-pool/props.ts
  35. 60 0
      src/popup/popup-award-pool/src/main.vue
  36. 45 0
      src/popup/popup-award-pool/style.scss
  37. 5 1
      src/popup/popup-export/components.ts
  38. 13 1
      src/popup/popup-export/const/index.ts
  39. 2 0
      src/popup/popup-export/global.ts
  40. 2 2
      src/popup/popup-gift-introduce/style.scss
  41. 45 0
      src/popup/popup-login/components/forget/data/input.ts
  42. 3 0
      src/popup/popup-login/components/forget/index.ts
  43. 4 0
      src/popup/popup-login/components/forget/mixins/index.ts
  44. 10 0
      src/popup/popup-login/components/forget/props.ts
  45. 119 0
      src/popup/popup-login/components/forget/src/main.vue
  46. 9 0
      src/popup/popup-login/components/forget/style.scss
  47. 8 0
      src/popup/popup-login/components/login/const/loginType.ts
  48. 15 3
      src/popup/popup-login/components/login/data/input.ts
  49. 79 0
      src/popup/popup-login/components/login/mixins/handle.ts
  50. 5 0
      src/popup/popup-login/components/login/mixins/index.ts
  51. 35 80
      src/popup/popup-login/components/login/src/main.vue
  52. 13 4
      src/popup/popup-login/components/login/style.scss
  53. 1 1
      src/popup/popup-login/mixins/handle.ts
  54. 4 1
      src/popup/popup-login/src/main.vue
  55. 4 1
      src/popup/popup-message/const/type.ts
  56. 5 0
      src/popup/popup-message/data/type.ts
  57. 8 2
      src/popup/popup-message/mixins/handle.ts
  58. 3 0
      src/popup/popup-prize-record/index.ts
  59. 20 0
      src/popup/popup-prize-record/mixins/handle.ts
  60. 6 0
      src/popup/popup-prize-record/mixins/index.ts
  61. 10 0
      src/popup/popup-prize-record/props.ts
  62. 58 0
      src/popup/popup-prize-record/src/main.vue
  63. 48 0
      src/popup/popup-prize-record/style.scss
  64. 3 0
      src/popup/popup-prize/index.ts
  65. 28 0
      src/popup/popup-prize/mixins/handle.ts
  66. 6 0
      src/popup/popup-prize/mixins/index.ts
  67. 10 0
      src/popup/popup-prize/props.ts
  68. 56 0
      src/popup/popup-prize/src/main.vue
  69. 0 0
      src/popup/popup-prize/style.scss
  70. 32 0
      src/popup/popup-turntable/data/control.ts
  71. 11 0
      src/popup/popup-turntable/data/number.ts
  72. BIN
      src/popup/popup-turntable/images/background.png
  73. BIN
      src/popup/popup-turntable/images/button.png
  74. BIN
      src/popup/popup-turntable/images/luck.png
  75. BIN
      src/popup/popup-turntable/images/title.png
  76. 3 0
      src/popup/popup-turntable/index.ts
  77. 13 0
      src/popup/popup-turntable/mixins/control.ts
  78. 166 0
      src/popup/popup-turntable/mixins/handle.ts
  79. 6 0
      src/popup/popup-turntable/mixins/index.ts
  80. 8 0
      src/popup/popup-turntable/props.ts
  81. 107 0
      src/popup/popup-turntable/src/main.vue
  82. 123 0
      src/popup/popup-turntable/style.scss
  83. 11 1
      src/utils/control/integral/index.ts
  84. 2 1
      src/utils/request/instructions/plugins/instructions.ts
  85. 22 2
      src/utils/socket/agoraRTM/agoraRTMIM.ts
  86. 10 1
      src/utils/socket/agoraRTM/const/channel.ts

+ 27 - 0
package-lock.json

@@ -18,6 +18,7 @@
         "swiper": "^5.4.5",
         "vue": "^3.0.0",
         "vue-class-component": "^8.0.0-0",
+        "vue-luck-draw": "^3.4.5",
         "vue-navigation": "^1.1.4",
         "vue-router": "^4.0.0-0",
         "vuex": "^4.0.0-0"
@@ -8659,6 +8660,11 @@
         "yallist": "^3.0.2"
       }
     },
+    "node_modules/lucky-canvas": {
+      "version": "1.5.4",
+      "resolved": "https://registry.npmjs.org/lucky-canvas/-/lucky-canvas-1.5.4.tgz",
+      "integrity": "sha512-rwO2hiGfkTKvQwlYKmr/N8KVF3s78wWGvkoaopqO6Zcr2kO8JlVqGvHf995WPYCFd66Jyr58kRLsLUr9KXXvmQ=="
+    },
     "node_modules/magic-string": {
       "version": "0.25.7",
       "resolved": "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.7.tgz",
@@ -15067,6 +15073,14 @@
       "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=",
       "dev": true
     },
+    "node_modules/vue-luck-draw": {
+      "version": "3.4.5",
+      "resolved": "https://registry.npmjs.org/vue-luck-draw/-/vue-luck-draw-3.4.5.tgz",
+      "integrity": "sha512-LkGYSWn8oCy6doPXWkxhYb/wrJjtmH0tzZ83HXp1l1c5ZWqE7d693CW0k6Cm6/7wmUzYs9DzvVuWYzWvlMg+hQ==",
+      "dependencies": {
+        "lucky-canvas": "^1.5.3"
+      }
+    },
     "node_modules/vue-navigation": {
       "version": "1.1.4",
       "resolved": "https://registry.npmjs.org/vue-navigation/-/vue-navigation-1.1.4.tgz",
@@ -23652,6 +23666,11 @@
         "yallist": "^3.0.2"
       }
     },
+    "lucky-canvas": {
+      "version": "1.5.4",
+      "resolved": "https://registry.npmjs.org/lucky-canvas/-/lucky-canvas-1.5.4.tgz",
+      "integrity": "sha512-rwO2hiGfkTKvQwlYKmr/N8KVF3s78wWGvkoaopqO6Zcr2kO8JlVqGvHf995WPYCFd66Jyr58kRLsLUr9KXXvmQ=="
+    },
     "magic-string": {
       "version": "0.25.7",
       "resolved": "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.7.tgz",
@@ -28824,6 +28843,14 @@
         }
       }
     },
+    "vue-luck-draw": {
+      "version": "3.4.5",
+      "resolved": "https://registry.npmjs.org/vue-luck-draw/-/vue-luck-draw-3.4.5.tgz",
+      "integrity": "sha512-LkGYSWn8oCy6doPXWkxhYb/wrJjtmH0tzZ83HXp1l1c5ZWqE7d693CW0k6Cm6/7wmUzYs9DzvVuWYzWvlMg+hQ==",
+      "requires": {
+        "lucky-canvas": "^1.5.3"
+      }
+    },
     "vue-navigation": {
       "version": "1.1.4",
       "resolved": "https://registry.npmjs.org/vue-navigation/-/vue-navigation-1.1.4.tgz",

+ 1 - 0
package.json

@@ -18,6 +18,7 @@
     "swiper": "^5.4.5",
     "vue": "^3.0.0",
     "vue-class-component": "^8.0.0-0",
+    "vue-luck-draw": "^3.4.5",
     "vue-navigation": "^1.1.4",
     "vue-router": "^4.0.0-0",
     "vuex": "^4.0.0-0"

+ 17 - 0
src/components/flat-list/mixins/on.ts

@@ -8,6 +8,23 @@ export default <LibMixins>{
 
     methods:{
 
+        // 设置视图初始化模式为空
+        flat_set_no_start(){
+            if (this.start) {
+                this.start = false;
+            }
+        },
+
+        // 设置视图为空
+        flat_set_empty(){
+          if (!this.start) {
+              this.start = true;
+          }
+          if (this._status !== this.constStatus.none) {
+              this.setStatus(this.constStatus.none);
+          }
+        },
+
         // 当前是否正在执行状态
         flat_is_loading(){
             return this._status === this.constStatus.loading;

+ 39 - 19
src/pages/talking/components/room-broadcast/src/main.vue

@@ -1,25 +1,41 @@
 <template>
 <!--  v-show="triggerStatus"-->
   <div  class="room-broadcast-container absolute overflow">
-    <div class="room-broadcast row center room-broadcast-animate"
-      :style="{background:'url('+background+') no-repeat','animation-duration':queueDelayTime+'ms'}"
-      v-if="useQueueItem"
-         :key="useQueueItem._id"
-    >
-      <v-image class="room-broadcast-avatar" radius="50%" :src="useQueueItem.headimgurl"></v-image>
-      <span class="room-broadcast-crux">{{useQueueItem.nickName}}</span>
-      <span>在</span>
-      <div class="room-broadcast-home line-1">{{useQueueItem.roomInfo.name}}</div>
-      <div>赠送</div>
-      <span v-if="useQueueItem.userInfo && useQueueItem.userInfo.length > 1" class="room-broadcast-crux">全部麦序</span>
-      <div  v-else class="room-broadcast-crux room-broadcast-home line-1">
-        <span v-for="(cItem,cIndex) in useQueueItem.userInfo" :key="cItem.uid">{{cIndex!==0?',':''}}{{cItem.nickname}}</span>
+    <template  v-if="useQueueItem">
+      <div class="room-broadcast room-broadcast-animate"
+           :style="{background:'url('+(background[useQueueItem.roomInfoMessageType] || background.default)+') no-repeat','animation-duration':queueDelayTime+'ms'}"
+           :key="useQueueItem._id"
+      >
+        <section class="row center screen" v-if="AgoraRTMessage.gift === useQueueItem.roomInfoMessageType">
+          <v-image class="room-broadcast-avatar" radius="50%" :src="useQueueItem.headimgurl"></v-image>
+          <span class="room-broadcast-crux">{{useQueueItem.nickName}}</span>
+          <span>在</span>
+          <div class="room-broadcast-home line-1">{{useQueueItem.roomInfo.name}}</div>
+          <div>赠送</div>
+          <span v-if="useQueueItem.userInfo && useQueueItem.userInfo.length > 1" class="room-broadcast-crux">全部麦序</span>
+          <div  v-else class="room-broadcast-crux room-broadcast-home line-1">
+            <span v-for="(cItem,cIndex) in useQueueItem.userInfo" :key="cItem.uid">{{cIndex!==0?',':''}}{{cItem.nickname}}</span>
+          </div>
+          <span>{{useQueueItem.e_name}}</span>
+          <v-image :src="useQueueItem.show_img" class="room-broadcast-gift" mode="center" backgroundColor="transparent"></v-image>
+          <icon type="close" class="room-broadcast-close"></icon>
+          <span class="room-broadcast-number">{{useQueueItem.giftNum}}</span>
+        </section>
+        <section class="row center screen" v-else-if="AgoraRTMessage.luckDraw === useQueueItem.roomInfoMessageType">
+          <v-image class="room-broadcast-avatar" radius="50%" :src="useQueueItem.headimgurl"></v-image>
+          <span class="room-broadcast-crux">{{useQueueItem.nickName}}</span>
+          <span>在</span>
+          <div class="room-broadcast-home line-1">{{useQueueItem.roomInfo.name}}</div>
+          <div>幸运大转盘中抽中</div>
+          <span>{{useQueueItem.giftData.gift_name}}</span>
+          <v-image :src="useQueueItem.giftData.base_image" class="room-broadcast-gift" mode="center" backgroundColor="transparent"></v-image>
+          <icon type="close" class="room-broadcast-close"></icon>
+          <span class="room-broadcast-number">{{useQueueItem.giftData.open_num}}</span>
+        </section>
+
       </div>
-      <span>{{useQueueItem.e_name}}</span>
-      <v-image :src="useQueueItem.show_img" class="room-broadcast-gift" mode="center" backgroundColor="transparent"></v-image>
-      <icon type="close" class="room-broadcast-close"></icon>
-      <span class="room-broadcast-number">{{useQueueItem.giftNum}}</span>
-    </div>
+    </template>
+
   </div>
 </template>
 
@@ -29,11 +45,15 @@ import {
     vImage,
     icon
 } from '$components';
+import {AgoraRTMessage} from "$utils/socket/agoraRTM/const/channel";
 export default {
   name: "room-broadcast",
   data(){
     return {
-      background: require('../images/background.png')
+      background: {
+        default:require('../images/background.png'),
+      },
+      AgoraRTMessage
     }
   },
   mixins,

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

@@ -10,5 +10,13 @@ export default [
     {
         label: '十全十美',
         value:10
+    },
+    {
+        label:'山盟海誓',
+        value:520
+    },
+    {
+        label:'一生一世',
+        value:1314
     }
-]
+]

+ 2 - 5
src/pages/talking/components/room-gift/components/room-gift-item/mixins/fetch.ts

@@ -24,11 +24,8 @@ export default {
                 token:true
             }).then((data)=>{
                 data.data = data.data || {};
-
-                data.data.gifts_list.map((item)=>{
-                    item.num = 2;
-                })
-
+                // 创建礼物
+                this.createdGiftIds(data.data.user_pack || []);
                 return obj.success(data.data.user_pack || []);
             }).catch(obj.fail);
         },

+ 13 - 2
src/pages/talking/components/room-gift/components/room-gift-item/mixins/giveGift.ts

@@ -151,6 +151,10 @@ export default {
             }
         },
 
+        isGiftEmpty(){
+            return this.giftData[this.giftSelect] === undefined || this.giftData[this.giftSelect].num<=0;
+        },
+
         updateBanner(){
           nextTick(()=>{
              this.$refs.banner && this.$refs.banner.update();
@@ -163,9 +167,15 @@ export default {
                      }
                  }
 
-                 if (this.giftData[this.giftSelect] === undefined || this.giftData[this.giftSelect].num<=0) {
+                 if (this.isGiftEmpty()) {
                      this.giftSelect = 0;
-                     return this.$refs.fetch && this.$refs.fetch.reload(FlatListReload.start);
+
+                     this.$refs.fetch && this.$refs.fetch.flat_set_empty();
+                     // 3秒后向服务器同步礼物信息
+                     // this.requestGiftTime = setTimeout(()=>{
+                     //     return this.$refs.fetch && this.$refs.fetch.reload(FlatListReload.start);
+                     // },3000);
+
                  }
              }
 
@@ -195,6 +205,7 @@ export default {
 
     beforeUnmount() {
         this.giveChangeNumberThrottle && this.giveChangeNumberThrottle.destroy();
+        clearTimeout(this.requestGiftTime);
     }
 
 }

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

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

+ 69 - 0
src/pages/talking/components/room-gift/components/room-gift-item/mixins/knapsack.ts

@@ -0,0 +1,69 @@
+import {RoomGiftType} from "@/pages/talking/const/roomGiftType";
+import {AgoraRTMessage} from "$utils/socket/agoraRTM/const/channel";
+import {FlatListReload} from "$components/flat-list/const";
+
+export default {
+
+    inject:['getAgoraRTMIM'],
+
+    methods:{
+
+        createdGiftIds(data){
+            this.giftIds = {};
+            data.map((item,index)=>{
+                this.giftIds[item.gid] = index;
+            });
+        },
+
+        // 合并礼物模块
+        mergeGift(data=[]){
+            if (data && !this.isGiftEmpty()) {
+
+                let created = false;
+
+                data.map((item,index)=>{
+
+                    if (this.giftIds[item.gid] !== undefined) {
+                        let useItem = this.giftData[this.giftIds[item.gid]];
+
+                        // 增加数量
+                        useItem.num = (useItem.num || 0) + item.open_num;
+
+                    } else {
+                        this.giftData.push({
+                            ...item,
+                            num: item.open_num
+                        });
+                        created = true;
+                    }
+
+                });
+
+                created && this.createdGiftIds(this.giftData);
+            } else {
+                this.$refs.fetch && this.$refs.fetch.reload(FlatListReload.start);
+            }
+
+        }
+
+    },
+
+    created(){
+        this.giftIds = {};
+
+        if (this.giftType == RoomGiftType.knapsack) {
+
+            // 获取聊天对象
+            this.agoraRTMIM = this.getAgoraRTMIM();
+
+            this.agoraRTMIM.on(AgoraRTMessage.knapsackToMy,(data)=>this.mergeGift(data));
+
+        }
+
+    },
+
+    beforeUnmount() {
+        this.agoraRTMIM && this.agoraRTMIM.off(AgoraRTMessage.knapsackToMy);
+    }
+
+}

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

@@ -45,6 +45,12 @@ export default <LibMixins>{
                 this.triggerChangeGiveUserId(value);
             }
         }
+    },
+
+    created() {
+        if (this.giveUserNoHave) {
+            this.giveUserValue =this.giveUserId;
+        }
     }
 
 }

+ 9 - 5
src/pages/talking/components/room-gift/components/room-gift-item/style.scss

@@ -49,8 +49,8 @@
   margin-right: 0 !important;
 }
 .talking-gift-no-user{
-  top: 0;
-  left: 20px;
+  top: -1px;
+  left: 16px;
   width: 83px;
   bottom: 0;
   pointer-events: none;
@@ -99,7 +99,7 @@
   border: none !important;
   outline: none !important;
   box-shadow: none !important;
-  padding: 0 20px;
+  padding: 0 18px;
 }
 
 .talking-gift-select::v-deep .ant-select-arrow{
@@ -110,7 +110,7 @@
   color: #fff;
 }
 .talking-gift-select::v-deep .ant-select-selection-item{
-  padding-right: 22px;
+  padding-right: 20px;
 }
 
 .talking-gift-banner-active .talking-gift-title{
@@ -163,8 +163,12 @@
   right: 20px;
   pointer-events: none;
 }
+.talking-gift-number::v-deep .ant-select-selection-item .talking-select-value{
+  width: auto !important;
+  margin-right: 8px;
+}
 .talking-select-value {
-  width: 30px;
+  width: 35px;
 }
 .talking-gift-user{
   width: 130px;

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

@@ -13,6 +13,7 @@ let RoomChatType = {
     // 礼物或者普通消息
     [AgoraRTMessage.gift]: RoomMessageType.message,
     [AgoraRTMessage.chat]: RoomMessageType.message,
+    [AgoraRTMessage.luckDraw]: RoomMessageType.message,
     [AgoraRTMessage.system]: RoomMessageType.system,
     [AgoraRTMessage.joinHome]: RoomMessageType.entry
 }
@@ -20,4 +21,4 @@ let RoomChatType = {
 export {
     RoomMessageType,
     RoomChatType
-}
+}

+ 3 - 3
src/pages/talking/components/room-ranking/components/room-chat/components/room-chat-entry/src/main.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="row wrap room-chat-entry">
-    <div class="room-chat-name">{{item.nickName}}</div>
+    <div class="room-chat-name cursor-pointer" @click.stop="openUserInfo($event,item.userInfo)" >{{item.nickName}}</div>
     <div class="room-chat-introduce">{{item.message}}</div>
   </div>
 </template>
@@ -9,9 +9,9 @@
 import props from '../props';
 export default {
   name: "room-chat-entry",
-
+  inject:['openUserInfo'],
   props
 }
 </script>
 
-<style scoped lang="scss" src="../style.scss"></style>
+<style scoped lang="scss" src="../style.scss"></style>

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

@@ -1,7 +1,7 @@
 <template>
   <section>
     <header class="row aCenter room-chat-header">
-      <v-image class="room-chat-avatar" :src="item.headimgurl" radius="50%" :borderWidth="2" borderColor="#fff"></v-image>
+      <v-image @click.stop="openUserInfo($event,{uid:item.user_id,...item})" class="room-chat-avatar cursor-pointer" :src="item.headimgurl" radius="50%" :borderWidth="2" borderColor="#fff"></v-image>
       <div class="flex-1 room-chat-nickname">
         <div class="line-1">{{item.nickName}}</div>
       </div>
@@ -19,6 +19,13 @@
         {{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 row aCenter wrap" v-else-if="type=== AgoraRTMessage.luckDraw">
+        幸运大转盘中抽中了
+        {{item.giftData.gift_name}}
+        <icon type="close" class="room-chat-number"></icon>
+        {{item.giftData.open_num}}
+        <v-image :src="item.giftData.base_image" mode="center" background-color="transparent" class="room-chat-icon"></v-image>
+      </div>
       <div class="room-chat-message" v-else
       >{{message}}</div>
     </layout-chat-background>
@@ -43,6 +50,8 @@ export default {
     }
   },
 
+  inject:['openUserInfo'],
+
   computed:{
     message(){
       if (this.item.message) {

+ 27 - 5
src/pages/talking/components/room-ranking/components/room-ranking-list/mixins/handle.ts

@@ -1,4 +1,5 @@
 import {InstructionsCacheType} from "$utils/request";
+import tabData from "@/pages/talking/components/room-ranking/data/tab";
 
 export default <LibMixins>{
 
@@ -23,6 +24,11 @@ export default <LibMixins>{
     },
 
     methods:{
+
+        onShow(){
+            this.reloadRanking();
+        },
+
         fetch(updated:boolean=true){
             let time = this.time;
 
@@ -30,6 +36,7 @@ export default <LibMixins>{
                 this.firstLoadingObject[time] = true;
             }
 
+
             return this.$request({
                 url:'room/get_room_rank',
                 data:{
@@ -52,7 +59,7 @@ export default <LibMixins>{
                 if (data.isSuccess) {
                     data.data = data.data || {};
                     this.userRankObject[time] = data.data.list;
-
+                    this.noLoadingStatus[time] = true;
                     if (data.isCache) {
                         return this.fetch(true);
                     }
@@ -61,17 +68,32 @@ export default <LibMixins>{
             });
         },
 
+        updateRanking(){
+            this.noLoadingStatus = {};
+            if (this.select === this.index) {
+                this.reloadRanking(true);
+            }
+        },
+
+        reloadRanking(status:boolean=false){
+
+
+            if (!this.noLoadingStatus[this.time] && !this.loadingObject[this.time] || status) {
+
+                return this.fetch(status);
+            }
+        },
+
         switchType(){
             this.time = this.time === 1 ? 3 : 1;
-            if (this.userRankObject[this.time] === undefined && !this.loadingObject[this.time]) {
-                return this.fetch(false);
-            }
+            this.reloadRanking();
         }
     },
 
     mounted() {
         this.roomInfo = this.getRoomInfo();
+        this.noLoadingStatus = {};
         this.fetch(false);
     }
 
-}
+}

+ 10 - 0
src/pages/talking/components/room-ranking/components/room-ranking-list/props.ts

@@ -13,6 +13,16 @@ export default {
     valueKey:{
         type:String,
         default:'contribution_value'
+    },
+
+    select:{
+        type:Number,
+        default:0
+    },
+
+    index:{
+        type:Number,
+        default:0
     }
 
 }

+ 4 - 2
src/pages/talking/components/room-ranking/data/tab.ts

@@ -3,12 +3,14 @@ export default [
         label:'财富榜',
         slot:'0',
         type:'1',
-        valueKey:'rank_value'
+        valueKey:'rank_value',
+        ref:'wealth'
     },
     {
         label:'魅力榜',
         slot:'1',
         type:'2',
-        valueKey:'rank_value'
+        valueKey:'rank_value',
+        ref:'charm'
     }
 ]

+ 58 - 0
src/pages/talking/components/room-ranking/mixins/handle.ts

@@ -0,0 +1,58 @@
+import Throttle from '$utils/tool/throttle';
+export default {
+
+    data(){
+        return {
+            onShowValue:0
+        }
+    },
+
+    methods:{
+
+        changeTab(value){
+            let item = this.tabData[value];
+            if (item && this.$refs[item.ref]){
+                this.$refs[item.ref].onShow && this.$refs[item.ref].onShow();
+            }
+        },
+
+        updateRanking(){
+
+            this.tabData.map((item)=>{
+                if (item && this.$refs[item.ref]){
+                    this.$refs[item.ref].updateRanking && this.$refs[item.ref].updateRanking();
+                }
+            });
+        }
+
+    },
+
+    created() {
+
+        this.changeTabThrottle = new Throttle({
+            handle: this.changeTab,
+            call: this,
+            delay:500,
+            first:false
+        });
+
+        this.updateRankingThrottle = new Throttle({
+            handle: this.updateRanking,
+            type:'queueWait',
+            call: this,
+            delay:500,
+            mustDelay:1000,
+            first:false
+        });
+
+        this.changeTab = this.changeTabThrottle.supper;
+        this.updateRanking = this.updateRankingThrottle.supper;
+
+    },
+
+    beforeUnmount() {
+        this.changeTabThrottle && this.changeTabThrottle.destroy();
+        this.updateRankingThrottle && this.updateRankingThrottle.destroy();
+    }
+
+}

+ 3 - 0
src/pages/talking/components/room-ranking/mixins/index.ts

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

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

@@ -5,6 +5,8 @@
       :auto-height-fixed="true"
       class="room-ranking-auto-height"
       ref="tab"
+      @change="changeTab"
+      v-model="onShowValue"
     >
       <template v-slot:header="{data,trigger,select}">
         <header class="room-ranking-header-tab rowACenter relative">
@@ -36,6 +38,9 @@
         <room-ranking-list
           :key="'room-ranking-list-'+index"
           :type="item.type"
+          :ref="item.ref"
+          :index="index"
+          :select="onShowValue"
           :value-key="item.valueKey"
           v-model:value="rankingShowStatus"
         ></room-ranking-list>
@@ -56,6 +61,7 @@ import tabData from '../data/tab';
 import roomRankingList from '../components/room-ranking-list';
 import roomChat from '../components/room-chat';
 import props from '../props';
+import mixins from '../mixins';
 export default {
   name: "room-ranking",
   data(){
@@ -72,7 +78,7 @@ export default {
   },
 
   props,
-
+  mixins,
   components:{
     tab,
     roomRankingList,

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

@@ -1,6 +1,6 @@
 <template>
-  <section class="room-wheat-container">
-
+  <section class="room-wheat-container relative">
+    <slot></slot>
     <aside class="center">
       <header class="room-wheat-first">
         <aside v-if="!hostUser.mc_user_info || !hostUser.mc_user_info.uid" class="room-wheat-no-host rowACenter">

BIN
src/pages/talking/images/turntable.png


+ 3 - 1
src/pages/talking/mixins/index.ts

@@ -20,5 +20,7 @@ import gift from './gift';
 import number from './number';
 // 功能
 import controls from './controls';
+// 转盘
+import turntable from './turntable';
 
-export default [user,params,handle,wheat,agora,micro,utils,socket,gift,number,controls];
+export default [user,params,handle,wheat,agora,micro,utils,socket,gift,number,controls,turntable];

+ 2 - 2
src/pages/talking/mixins/micro.ts

@@ -248,8 +248,8 @@ export default <LibMixins>{
         },
 
         setMicroStatus(status){
-            if (this.wheat_status !== status) {
-                this.wheat_status = status;
+            if (this.use_wheat_status !== status) {
+                this.use_wheat_status = status;
             }
         }
 

+ 22 - 5
src/pages/talking/mixins/socket.ts

@@ -23,6 +23,18 @@ export default {
             }
         },
 
+        // 发送抽中将礼物消息
+        sendLuckGift(item){
+            if (item && this.socketItem) {
+                let resultData = this.agoraRTMIM.addUserInfo({});
+                resultData = this.agoraRTMIM.addLuckGift(resultData,item);
+                // 展示消息
+                this.socketItem.triggerPushMessage(AgoraRTMessage.luckDraw,resultData);
+                // 向其他人发送消息
+                this.agoraRTMIM.send(resultData,AgoraRTMessage.luckDraw);
+            }
+        },
+
         // 发送加入房间消息
         sendJoinRoom(message){
             if (message && this.socketItem) {
@@ -73,6 +85,9 @@ export default {
                         this.sendBroadCast(resultData);
                     }
 
+                    // 更新排行榜
+                    return this.updateRanking();
+
                 } else {
                     this.socketItem.triggerPushMessage(AgoraRTMessage.gift,resultData);
                 }
@@ -81,12 +96,12 @@ export default {
         },
 
         // 全服播报
-        sendBroadCast(data){
+        sendBroadCast(data,type=AgoraRTMessage.gift){
 
             if (config.globalRTMIM) {
-                let resultData = config.globalRTMIM.addGlobal(data,this.roomInfo);
+                let resultData = config.globalRTMIM.addGlobal(data,this.roomInfo,type);
 
-                return config.globalRTMIM.send(resultData,AgoraRTMessage.gift);
+                return config.globalRTMIM.send(resultData,AgoraRTMessage.globalBroadcast);
             }
 
         },
@@ -119,7 +134,6 @@ export default {
         // 监听收到礼物
         this.agoraRTMIM.on(AgoraRTMessage.gift,({data})=> {
 
-            console.log(data);
             // 获取礼物信息
             let gift = this.$store.state.gift && this.$store.state.gift.giftObjectData && this.$store.state.gift.giftObjectData[data.giftId];
             if (!gift) {
@@ -137,6 +151,9 @@ export default {
             let uid = (data.userInfo || []).map((item)=> item.uid);
 
             this.sendGiveUserGift(gift,uid, gift.gift_price * data.giftNum || 0);
+
+            // 更新排行榜
+            return this.updateRanking();
         });
 
         // 监听麦位信息
@@ -161,7 +178,7 @@ export default {
         });
 
         // 全服礼物播报
-        config.globalRTMIM && config.globalRTMIM.on(AgoraRTMessage.gift,({data})=>{
+        config.globalRTMIM && config.globalRTMIM.on(AgoraRTMessage.globalBroadcast,({data})=>{
             if (data.roomInfo && data.roomInfo.id !== this.roomInfo.rid) {
                 this.sendGiveBroadCastGift(data);
             }

+ 38 - 0
src/pages/talking/mixins/turntable.ts

@@ -0,0 +1,38 @@
+import popup, {PopupExportComponent} from "$utils/tool/popup";
+import {AgoraRTMessage} from "$utils/socket/agoraRTM/const/channel";
+
+export default {
+
+    methods:{
+
+        // 打开抽奖转盘
+        openTurntable(){
+            return popup.$open(PopupExportComponent.turntable,{
+                rid: this.$params.rid,
+                wheelEnd:(data)=>{
+
+                    data && this.agoraRTMIM.triggerListener(AgoraRTMessage.knapsackToMy,data);
+                    // 执行
+                    data && data.map((item)=>{
+
+                        // 如果展示公屏触发
+                        if (item.is_public_screen == 1) {
+                            // 展示公屏
+                            this.sendLuckGift(item);
+                        }
+
+                        // 全服公告
+                        if (item.is_public_server == 1) {
+                            this.sendBroadCast(this.agoraRTMIM.addLuckGift(this.agoraRTMIM.addUserInfo({}),item),AgoraRTMessage.luckDraw);
+                        }
+
+                    });
+
+                }
+            });
+
+        }
+
+    }
+
+}

+ 6 - 0
src/pages/talking/mixins/utils.ts

@@ -31,11 +31,17 @@ export default <LibMixins>{
 
         },
 
+        // 更新排行榜
+        updateRanking(){
+          return this.$refs.ranking && this.$refs.ranking.updateRanking();
+        },
+
         // 赠送礼物
         sendGiveUserGift(item:Record<string, any>,uid:Array<string | number>,integral:number,sendUid:number | undefined){
 
             // 执行增加魅力值
             if (integral) {
+                // 执行用户增加积分
                 uid.map((item)=>{
                     this.updateUserIntegral(item,integral);
                 });

+ 13 - 5
src/pages/talking/mixins/wheat.ts

@@ -2,17 +2,25 @@ import popup from "$utils/tool/popup";
 import {PopupExportComponent} from "$popup/popup-export/const";
 
 import user from '$config/user';
-
-import {RowWheat} from '../const';
-import {InstructionsCacheType, InstructionsMessageType} from "$utils/request";
-import {WheatUseStatus} from "@/pages/talking/const/wheat";
+import {InstructionsMessageType} from "$utils/request";
+import RowWheat, {WheatUseStatus} from "@/pages/talking/const/wheat";
 
 export default <LibMixins>{
 
     data(){
         return {
             // 当前进行排麦的状态
-            wheat_status: RowWheat.none
+            use_wheat_status: RowWheat.none
+        }
+    },
+
+    // 当前麦位信息状态
+    computed:{
+        wheat_status(){
+            if (this.use_wheat_status === RowWheat.wheat && !this.getMicroUserInfo(user.uid())) {
+                return  RowWheat.none;
+            }
+            return this.use_wheat_status;
         }
     },
 

+ 4 - 1
src/pages/talking/src/main.vue

@@ -17,7 +17,9 @@
               :info="roomInfo"
               :microInfo="microInfo"
               :admin="isAdmin"
-            ></room-wheat>
+            >
+              <img src="../images/turntable.png" @click="openTurntable" class="absolute talking-turntable cursor-pointer" />
+            </room-wheat>
             <div class="flex-1"></div>
             <room-gift :user-data="microUserInfo"
               :give-user-id="giveUserId"
@@ -26,6 +28,7 @@
           </section>
           <room-ranking
             :forbiddenWords="forbiddenWords"
+            ref="ranking"
           ></room-ranking>
         </section>
         <room-footer

+ 11 - 1
src/pages/talking/style.scss

@@ -17,4 +17,14 @@
   width: 776px;
 }
 
-/* 中间内容 */
+/* 中间内容 */
+
+/* 抽奖 */
+.talking-turntable{
+  width: 122px;
+  height: 96px;
+  right: 0;
+  bottom: 0;
+  z-index: 99;
+}
+/* 抽奖 */

+ 3 - 0
src/popup/popup-award-pool/index.ts

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

+ 40 - 0
src/popup/popup-award-pool/mixins/handle.ts

@@ -0,0 +1,40 @@
+import {InstructionsCacheType} from "$utils/request";
+import popup, {PopupExportComponent} from "$utils/tool/popup";
+import unit from "$utils/unit/unit";
+
+
+export default <LibMixins>{
+
+    methods:{
+        fetch(obj){
+
+            return this.$request({
+                url:'box/get_box_list',
+                cache:{
+                    type: InstructionsCacheType.memory
+                },
+                token:true
+            }).then((data)=>{
+                return obj.success(data.data);
+            }).catch(obj.fail);
+        },
+        openIntroduce(item,event){
+            return popup.$popup.open(PopupExportComponent.giftIntroduce,{
+                value:true,
+                x: event.clientX - event.offsetX + this.useOffsetWidth,
+                y: event.clientY - event.offsetY,
+                item
+            });
+        },
+        closeIntroduce(event){
+            return popup.$popup.open(PopupExportComponent.giftIntroduce,{
+                value:false
+            });
+        },
+    },
+
+    created(){
+        this.useOffsetWidth = unit.unitPx(30);
+    }
+
+}

+ 6 - 0
src/popup/popup-award-pool/mixins/index.ts

@@ -0,0 +1,6 @@
+import popup from "$mixins/popup";
+import handle from './handle';
+import pay from '$mixins/pay';
+import user from '$mixins/user';
+
+export default [popup,pay,handle,user];

+ 10 - 0
src/popup/popup-award-pool/props.ts

@@ -0,0 +1,10 @@
+import {ExportType} from "$popup/popup-message/const/type";
+
+export default {
+
+    type:{
+        type: Number,
+        default: ExportType.privacy
+    }
+
+}

+ 60 - 0
src/popup/popup-award-pool/src/main.vue

@@ -0,0 +1,60 @@
+<template>
+  <popup v-model:value="value" header-title="本期奖池" content-animate="scale" @close="$emit('destroy-popup')">
+    <section class="recharge-award-container relative">
+      <div @click="close" class="recharge-close-wrap cursor-pointer absolute animate-rotate-hover">
+        <icon type="close" class="recharge-close"></icon>
+      </div>
+      <section class="screen"
+               @mouseleave="closeIntroduce"
+      >
+        <flat-list
+            @fetch="fetch"
+            :paging="false"
+        >
+          <template v-slot:item="{item,index}">
+            <div class="award-gift-item"
+                 :class="{'award-gift-clear-margin':index<8}"
+            >
+              <div class="award-gift-image"
+                   @mouseover="openIntroduce(item,$event)"
+              >
+                <v-image class="screen" mode="center"
+                         background-color="transparent"
+                         :src="item.base_image"
+                ></v-image>
+              </div>
+              <div class="award-gift-name">{{item.gift_name}}</div>
+
+            </div>
+          </template>
+        </flat-list>
+      </section>
+
+
+    </section>
+  </popup>
+</template>
+
+<script>
+import {
+  Popup,
+  icon,
+  FlatList
+} from '$components';
+import mixins from '../mixins';
+import props from '../props';
+import VImage from "$components/v-image/lib/main";
+export default {
+  name: "popup-award-pool",
+  components:{
+    VImage,
+    Popup,
+    icon,
+    FlatList
+  },
+  mixins,
+  props
+}
+</script>
+
+<style scoped lang="scss" src="../style.scss"></style>

+ 45 - 0
src/popup/popup-award-pool/style.scss

@@ -0,0 +1,45 @@
+/* 本期奖池 */
+.recharge-award-container{
+  width: 670px;
+  height: 368px;
+  border: 4px solid #F191AC;
+  background-color: #342971;
+  border-radius: 10px;
+  padding: 60px 30px 30px;
+}
+/* 本期奖池 */
+
+/* 关闭按钮 */
+.recharge-close-wrap{
+  right: 20px;
+  top: 15px;
+}
+.recharge-close{
+  font-size: 18px;
+}
+/* 关闭按钮 */
+/* 视图 */
+.award-gift-item{
+  width: 60px;
+  margin-right: 15px;
+  margin-top: 30px;
+}
+.award-gift-clear-margin{
+  margin-top: 0;
+}
+.award-gift-image{
+  @include square(60px);
+  background-color: rgba(255,255,255,0.05);
+  border-radius: 5px;
+}
+.award-gift-name,.award-gift-number{
+  font-size: 16px;
+  line-height: 20px;
+  margin-top: 10px;
+  white-space: nowrap;
+  text-align: center;
+}
+.award-gift-number{
+  margin-top: 5px;
+}
+/* 视图 */

+ 5 - 1
src/popup/popup-export/components.ts

@@ -28,5 +28,9 @@ export default {
     [PopupExportComponent.ranking]: defineAsyncComponent(()=> import('$popup/popup-ranking')),
     [PopupExportComponent.report]: defineAsyncComponent(()=> import('$popup/popup-report')),
     [PopupExportComponent.comment]: defineAsyncComponent(()=> import('$popup/popup-comment')),
-    [PopupExportComponent.image]: defineAsyncComponent(()=> import('$popup/popup-image'))
+    [PopupExportComponent.image]: defineAsyncComponent(()=> import('$popup/popup-image')),
+    [PopupExportComponent.turntable]: defineAsyncComponent(()=> import('$popup/popup-turntable')),
+    [PopupExportComponent.award]: defineAsyncComponent(()=> import('$popup/popup-award-pool')),
+    [PopupExportComponent.prize]: defineAsyncComponent(()=> import('$popup/popup-prize')),
+    [PopupExportComponent.prizeRecord]: defineAsyncComponent(()=> import('$popup/popup-prize-record'))
 }

+ 13 - 1
src/popup/popup-export/const/index.ts

@@ -79,7 +79,19 @@ const enum PopupExportComponent {
     comment='popup-comment',
 
     // 图片
-    image='popup-image'
+    image='popup-image',
+
+    // 大转盘抽奖
+    turntable='popup-turntable',
+
+    // 本期奖池
+    award='popup-award-pool',
+
+    // 抽中的奖品列表
+    prize='popup-prize',
+
+    // 中奖记录
+    prizeRecord='popup-prize-record'
 
 }
 

+ 2 - 0
src/popup/popup-export/global.ts

@@ -24,6 +24,8 @@ export default {
                     app.config.globalProperties[key] = popup[key];
                 }
             }
+
+            // popup.$popup.open(PopupExportComponent.turntable);
             // popup.$popup.open(PopupExportComponent.image,{
             //     src:'https://www.antdv.com/components/rate-cn/',
             //     webview:true

+ 2 - 2
src/popup/popup-gift-introduce/style.scss

@@ -1,7 +1,7 @@
 /* 礼物介绍气泡 */
 .gift-introduce{
   width: 250px;
-  z-index: 999;
+  z-index: 99999;
   height: 100px;
   background-color: #1B1839;
   border-radius: 10px;
@@ -50,4 +50,4 @@
 .gift-introduce-charm{
   color: $main;
 }
-/* 礼物内容介绍 */
+/* 礼物内容介绍 */

+ 45 - 0
src/popup/popup-login/components/forget/data/input.ts

@@ -0,0 +1,45 @@
+import { VerificationType } from '$utils/verification';
+
+export default function(){
+
+    let password = {
+            placeholder:'请输入密码',
+            key:'password',
+            type:'password',
+            rules:{
+                [VerificationType.empty]:'',
+                [VerificationType.password]:'密码必须6-16位字母或者数字组成'
+            }
+    };
+
+    return [
+        {
+            placeholder:'请输入手机号',
+            key:'user_login',
+            rules:{
+                [VerificationType.empty]:'',
+                [VerificationType.mobile]:'手机号格式不正确'
+            }
+        },
+        {
+            placeholder:'请输入手机验证码',
+            code:'user_login',
+            codeType:'1',
+            key:'sms_code',
+            rules:'',
+        },
+        password,
+        {
+            placeholder:'请输入确认密码',
+            key:'password',
+            type:'password',
+            rules:{
+                [VerificationType.empty]:'',
+                [VerificationType.eq]:'两次密码不相符',
+            },
+            rulesOption:{
+              data: password
+            }
+        }
+    ] as LibDataArray
+}

+ 3 - 0
src/popup/popup-login/components/forget/index.ts

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

+ 4 - 0
src/popup/popup-login/components/forget/mixins/index.ts

@@ -0,0 +1,4 @@
+import time from '$mixins/time';
+import trigger from '$mixins/trigger';
+
+export default [time,trigger];

+ 10 - 0
src/popup/popup-login/components/forget/props.ts

@@ -0,0 +1,10 @@
+export default {
+
+    control:{
+        type:Array,
+        default:function () {
+            return [];
+        }
+    }
+
+}

+ 119 - 0
src/popup/popup-login/components/forget/src/main.vue

@@ -0,0 +1,119 @@
+<template>
+  <aside class="screen overflow">
+    <div class="login-icon-container overflow">
+      <div @click="$emit('close')" class="cursor-pointer login-close">
+        <icon type="close" class="login-close-icon"></icon>
+      </div>
+    </div>
+
+    <article class="login-content-padding">
+      <!--  标题内容介绍  -->
+      <header class="login-header">
+        <div class="login-header-title">修改密码</div>
+        <div class="login-header-info">暂不修改?<span @click="openModal('login')">立即登录</span></div>
+      </header>
+
+
+      <!--  输入内容  -->
+      <section class="login-section register-section">
+        <aside
+            v-for="(item,index) in inputData"
+            :key="'login-input-'+index"
+            class="login-input rowACenter"
+        >
+          <div class="flex-1 overflow">
+            <input :type="item.value ?  item.type : '' || 'text'"
+                   :placeholder="item.placeholder"
+                   class="screen login-input-target"
+                   v-model="item.value"
+                   autocomplete="off"
+                   disableautocomplete
+            />
+          </div>
+          <div v-if="item.code"
+               class="login-code cursor-pointer"
+               :class="{
+                    'button-active' : !timeFormat,
+                    'login-code-disabled': timeFormat
+                   }"
+               @click="triggerTimeDate(item,inputData)"
+          >{{ timeFormat || timeConfig.default }}</div>
+        </aside>
+      </section>
+
+      <!--  按钮  -->
+      <v-button class="login-button register-button"
+          @submit-verify="submitVerify"
+          @submit="submit"
+          success-text="修改成功"
+      >确认修改</v-button>
+
+      <!--  协议  -->
+      <div class="login-agreement">已阅读并同意以下协议<span v-for="(item,index) in control" @click="trigger(item,index)"><span style="color: #999">{{index===0?'':'和'}}</span>《{{item.label}}》</span></div>
+
+    </article>
+
+
+  </aside>
+</template>
+
+<script>
+import {
+  icon,
+  vButton
+} from '$components';
+import inputData from '../data/input';
+import mixins from '../mixins';
+import verification from "$utils/verification";
+import props from '../props';
+
+export default {
+  name: "forget",
+  data(){
+    return {
+      inputData: inputData(),
+    }
+  },
+
+  inject:['openModal','setLoginParams'],
+
+  methods:{
+    submitVerify:function (callback) {
+      return verification.verificationPromise(this.inputData,true).then(callback);
+    },
+    submit:function (obj) {
+
+      this.storageData = obj.data;
+
+      return this.$request({
+        url:'login/modify_user_password',
+        data:obj.data,
+        message: true
+      }).then((data)=>{
+
+        if (data.isSuccess) {
+          return this.toLogin();
+        }
+
+        return obj.none();
+      }).catch(obj.fail);
+    },
+    //跳转登录
+    toLogin(){
+
+      this.storageData && this.setLoginParams(this.storageData);
+
+      // 跳转 login 同时释放自身
+      return this.openModal('login',false);
+    }
+  },
+  components:{
+    icon,
+    vButton
+  },
+  mixins,
+  props
+}
+</script>
+
+<style scoped lang="scss" src="../style.scss"></style>

+ 9 - 0
src/popup/popup-login/components/forget/style.scss

@@ -0,0 +1,9 @@
+@import "../login/style.scss";
+
+.register-button{
+  margin-top: 30px;
+}
+
+.register-section{
+  margin-top: 40px;
+}

+ 8 - 0
src/popup/popup-login/components/login/const/loginType.ts

@@ -0,0 +1,8 @@
+enum LoginType {
+    password,
+    code
+}
+
+export {
+    LoginType
+}

+ 15 - 3
src/popup/popup-login/components/login/data/input.ts

@@ -1,5 +1,7 @@
 import { VerificationType } from '$utils/verification';
-
+import {
+    LoginType
+} from '../const/loginType';
 export default function(){
     return [
         {
@@ -14,7 +16,17 @@ export default function(){
             placeholder:'请输入密码',
             type:'password',
             key:'password',
-            rules:''
+            rules:'',
+            show:LoginType.password
+        },
+        {
+            placeholder:'请输入验证码',
+            code:'user_login',
+            codeType:'1',
+            key:'sms_code',
+            assignmentValue:false,
+            rules:'',
+            show:LoginType.code
         },
     ] as LibDataArray
-}
+}

+ 79 - 0
src/popup/popup-login/components/login/mixins/handle.ts

@@ -0,0 +1,79 @@
+import verification from "$utils/verification";
+import {InstructionsMessageType} from "$utils/request";
+import user from "$config/user";
+import socket from "$config/plugs/socket";
+import config from "$config/config";
+import popup from "$utils/tool/popup";
+import inputData from '../data/input';
+import {LoginType} from '../const/loginType';
+
+export default {
+
+    data() {
+        return {
+            inputData:inputData(),
+            loginType:LoginType.code,
+            loginTypeConst:LoginType
+        }
+    },
+
+    methods:{
+        submitVerify:function (callback) {
+
+            let verificationData = [];
+
+            this.inputData.map((item)=>{
+                if (item.show === undefined || item.show === this.loginType) {
+                    verificationData.push(item);
+                }
+            });
+
+            return verification.verificationPromise(verificationData,true).then(callback);
+        },
+        submit:function (obj) {
+            return this.$request({
+                url:this.loginType === LoginType.code ? 'login/sms_user_login':'login/user_login',
+                data:obj.data,
+                message: InstructionsMessageType.other
+            }).then((data)=>{
+
+                if (data.isSuccess) {
+
+                    user.user = data.data;
+                    socket.register(config);
+
+                    this.$request.getUserInfo().then((resultData)=>{
+                        this.$store.commit('setUserInfo',Object.assign({},data.data,resultData));
+
+                        popup.$toast(data.msg);
+                        return this.$emit('close');
+                    }).catch(obj.fail);
+                } else {
+                    return obj.none();
+                }
+
+            }).catch(obj.fail);
+        },
+        setLoginParams:function (data){
+
+            if (data) {
+                this.inputData.map((item)=>{
+                    if (item.assignmentValue !== false && item.value !== data[item.key]) {
+                        item.value = data[item.key];
+                    }
+                });
+            }
+
+        },
+
+        switchLoginType(){
+            this.loginType = this.loginType === LoginType.password ? LoginType.code : LoginType.password;
+        },
+
+        // loginSuccess:function () {
+        //   return this.$emit('close');
+        // }
+    },
+
+}
+

+ 5 - 0
src/popup/popup-login/components/login/mixins/index.ts

@@ -0,0 +1,5 @@
+import handle from './handle';
+import trigger from '$mixins/trigger';
+import time from '$mixins/time';
+
+export default [handle,time,trigger];

+ 35 - 80
src/popup/popup-login/components/login/src/main.vue

@@ -10,25 +10,43 @@
       <!--  标题内容介绍  -->
       <header class="login-header">
         <div class="login-header-title">欢迎登录</div>
-        <div class="login-header-info">还没有账号?<span @click="openModal('register')">立即注册</span></div>
+        <div class="login-header-introduce">这里有众多的小哥哥小姐姐陪你打游戏</div>
       </header>
 
       <!--  输入内容  -->
       <section class="login-section">
-        <aside
-            v-for="(item,index) in inputData"
-            :key="'login-input-'+index"
-            class="login-input rowACenter"
-        >
-          <div class="flex-1 overflow">
-            <input :type="item.type || 'text'"
-                   :placeholder="item.placeholder"
-                   class="screen login-input-target"
-                   v-model="item.value"
-            />
-          </div>
-        </aside>
+          <aside
+              :key="'login-input-'+index"
+              v-for="(item,index) in inputData"
+              class="login-input rowACenter"
+              v-show="item.show === undefined || item.show === loginType"
+          >
+            <div class="flex-1 overflow">
+              <input :type="item.type || 'text'"
+                     :placeholder="item.placeholder"
+                     class="screen login-input-target"
+                     v-model="item.value"
+                     autocomplete="off"
+                     disableautocomplete
+              />
+            </div>
+            <div v-if="item.code"
+                 class="login-code cursor-pointer"
+                 :class="{
+                    'button-active' : !timeFormat,
+                    'login-code-disabled': timeFormat
+                   }"
+                 @click="triggerTimeDate(item,inputData)"
+            >{{ timeFormat || timeConfig.default }}</div>
+          </aside>
       </section>
+      <article class="rowACenter login-control">
+        <div class="login-header-info flex-1"><span
+          class="cursor-pointer"
+          @click="switchLoginType"
+        >{{ loginType === loginTypeConst.password ?'验证码':'密码' }}登录</span></div>
+        <div class="login-header-info">还没有账号?<span @click="openModal('register')">立即注册</span>或<span @click="openModal('forget')">忘记密码</span></div>
+      </article>
 
       <!--  按钮  -->
       <v-button class="login-button"
@@ -52,83 +70,20 @@ import {
   icon,
   vButton
 } from '$components';
-import inputData from '../data/input';
-
-import verification from '$utils/verification';
 
 import props from '../props';
-
-import { InstructionsMessageType } from '$utils/request';
-
-import user from '$config/user';
-import popup from "$utils/tool/popup";
-import socket from "$config/plugs/socket";
-
-import trigger from '$mixins/trigger';
-import config from "$config/config";
-
+import mixins from '../mixins';
 export default {
   name: "login",
 
-  mixins:[trigger],
-  data(){
-    return {
-      inputData:inputData()
-    }
-  },
-
   inject:['openModal'],
 
-  methods:{
-    submitVerify:function (callback) {
-      return verification.verificationPromise(this.inputData,true).then(callback);
-    },
-    submit:function (obj) {
-      return this.$request({
-        url:'login/user_login',
-        data:obj.data,
-        message: InstructionsMessageType.other
-      }).then((data)=>{
-
-        if (data.isSuccess) {
-
-          user.user = data.data;
-          socket.register(config,true);
-
-          this.$request.getUserInfo().then((resultData)=>{
-             this.$store.commit('setUserInfo',Object.assign({},data.data,resultData));
-
-             popup.$toast(data.msg);
-             return this.$emit('close');
-          }).catch(obj.fail);
-        } else {
-          return obj.none();
-        }
-
-      }).catch(obj.fail);
-    },
-    setLoginParams:function (data){
-
-      if (data) {
-        this.inputData.map((item)=>{
-          if (item.value !== data[item.key]) {
-            item.value = data[item.key];
-          }
-        });
-      }
-
-    },
-
-    // loginSuccess:function () {
-    //   return this.$emit('close');
-    // }
-  },
-
   components:{
     icon,
     vButton
   },
-  props
+  props,
+  mixins
 }
 </script>
 

+ 13 - 4
src/popup/popup-login/components/login/style.scss

@@ -17,12 +17,18 @@
   font-weight: bold;
   font-size: 16px;
 }
-.login-header{
+.login-header,.login-header-info{
   font-size: 14px;
   color: #666;
   line-height: 18px;
   font-weight: 400;
-
+}
+.login-header-introduce{
+  font-size: 14px;
+  line-height: 18px;
+  color: #666;
+  margin-top: 10px;
+  font-weight: 400;
 }
 .login-header-title{
   font-size: 26px;
@@ -56,7 +62,7 @@
 }
 .login-button{
   width: 240px;
-  margin: 125px auto 0;
+  margin: 91px auto 0;
 }
 .login-agreement{
   text-align: center;
@@ -73,4 +79,7 @@
 .login-code-disabled{
   opacity: 0.7;
 }
-/* 登录内容模块 */
+.login-control{
+  margin-top: 17px;
+}
+/* 登录内容模块 */

+ 1 - 1
src/popup/popup-login/mixins/handle.ts

@@ -8,7 +8,7 @@ export default <LibMixins>{
             animate:false,
             drawModal:{},
             controlData,
-            useModals:['login','register'],
+            useModals:['login','register','forget'],
         }
     },
 

+ 4 - 1
src/popup/popup-login/src/main.vue

@@ -45,6 +45,8 @@ import login from '../components/login';
 
 import register from '../components/register';
 
+import forget from '../components/forget';
+
 export default {
   name: "popup-login",
 
@@ -55,7 +57,8 @@ export default {
   components:{
     Popup,
     login,
-    register
+    register,
+    forget
   }
 }
 </script>

+ 4 - 1
src/popup/popup-message/const/type.ts

@@ -25,7 +25,10 @@ enum ExportType {
     become,
 
     // 支付问题
-    payProblem
+    payProblem,
+
+    // 宝箱说明
+    boxMessage
 
 }
 

+ 5 - 0
src/popup/popup-message/data/type.ts

@@ -45,6 +45,11 @@ export default {
     [ExportType.payProblem]:{
         label:'支付问题',
         id:37
+    },
+
+    [ExportType.boxMessage]:{
+        label:'规则说明',
+        url:'box/get_box_note'
     }
 
 } as {[key in ExportType]:LibData}

+ 8 - 2
src/popup/popup-message/mixins/handle.ts

@@ -14,13 +14,19 @@ export default <LibMixins>{
     methods:{
         fetch(){
             return this.$request({
-                url:'page/page_show',
+                url:this.item.url || 'page/page_show',
                 data:{
                     id: this.item.id,
                 },
                 cache:true
             }).then((data)=>{
-                this.content = html.parseHtml((data.data || {}).content);
+
+                let content = data.data;
+                if (typeof content === 'object') {
+                    content = content.content;
+                }
+                content = html.replaceBr(content);
+                this.content = html.parseHtml(content);
             })
         }
     },

+ 3 - 0
src/popup/popup-prize-record/index.ts

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

+ 20 - 0
src/popup/popup-prize-record/mixins/handle.ts

@@ -0,0 +1,20 @@
+import {DateFormat} from "$utils/tool/date";
+
+export default <LibMixins>{
+
+    methods:{
+        fetch(obj){
+            return this.$request({
+                url:'box/get_user_box_gift_list',
+                page:obj.data,
+                token:true
+            }).then((data)=>{
+                return obj.success((data.data || []).map((item,index)=>{
+                    item.add_time = DateFormat(item.add_time,'YYYY-MM-DD hh:mm');
+                    return item;
+                }));
+            }).catch(obj.fail);
+        },
+    }
+
+}

+ 6 - 0
src/popup/popup-prize-record/mixins/index.ts

@@ -0,0 +1,6 @@
+import popup from "$mixins/popup";
+import handle from './handle';
+import pay from '$mixins/pay';
+import user from '$mixins/user';
+
+export default [popup,pay,handle,user];

+ 10 - 0
src/popup/popup-prize-record/props.ts

@@ -0,0 +1,10 @@
+import {ExportType} from "$popup/popup-message/const/type";
+
+export default {
+
+    type:{
+        type: Number,
+        default: ExportType.privacy
+    }
+
+}

+ 58 - 0
src/popup/popup-prize-record/src/main.vue

@@ -0,0 +1,58 @@
+<template>
+  <popup v-model:value="value" header-title="中奖记录" content-animate="scale" @close="$emit('destroy-popup')">
+    <section class="popup-prize-container relative">
+      <div @click="close" class="recharge-close-wrap cursor-pointer absolute animate-rotate-hover">
+        <icon type="close" class="recharge-close"></icon>
+      </div>
+      <flat-list
+        @fetch="fetch"
+      >
+        <template v-slot:item="{item,index}">
+          <aside class="prize-item rowACenter"
+            :key="'prize-item-'+index"
+          >
+            <v-image
+              :src="item.base_image"
+              class="prize-item-image"
+              background-color="rgba(255,255,255,0.05)"
+              mode="center"
+              :mergeSuccessColor="true"
+            ></v-image>
+            <div class="prize-item-modal">{{item.gift_name}}</div>
+            <div class="prize-item-modal rowACenter">
+              <icon type="close" class="prize-item-close"></icon>
+              {{item.num}}
+            </div>
+            <div class="flex-1"></div>
+            <span>{{item.add_time}}</span>
+          </aside>
+        </template>
+      </flat-list>
+
+    </section>
+  </popup>
+</template>
+
+<script>
+import {
+  Popup,
+  icon,
+  FlatList
+} from '$components';
+import mixins from '../mixins';
+import props from '../props';
+import VImage from "$components/v-image/lib/main";
+export default {
+  name: "popup-prize-record",
+  components:{
+    VImage,
+    Popup,
+    icon,
+    FlatList
+  },
+  mixins,
+  props
+}
+</script>
+
+<style scoped lang="scss" src="../style.scss"></style>

+ 48 - 0
src/popup/popup-prize-record/style.scss

@@ -0,0 +1,48 @@
+/* 本期奖池 */
+.popup-prize-container{
+  width: 670px;
+  height: 368px;
+  border: 4px solid #F191AC;
+  background-color: #342971;
+  border-radius: 10px;
+  padding: 40px 30px 20px;
+}
+/* 本期奖池 */
+
+/* 关闭按钮 */
+.recharge-close-wrap{
+  right: 20px;
+  top: 15px;
+}
+.recharge-close{
+  font-size: 18px;
+}
+/* 关闭按钮 */
+
+/* 视图 */
+.prize-item{
+ width: 100%;
+  margin-top: 20px;
+  font-size: 16px;
+  line-height: 20px;
+  font-weight: 400;
+}
+.prize-item:first-child{
+  margin-top: 0;
+}
+.prize-item-image{
+  @include square(53px);
+}
+.prize-item-modal{
+  width: 100px;
+  margin-left: 15px;
+}
+.prize-item-close{
+  font-size: 12px;
+  line-height: 22px;
+  transform: scale(0.8);
+  position: relative;
+  top: 1px;
+  font-weight: bold;
+}
+/* 视图 */

+ 3 - 0
src/popup/popup-prize/index.ts

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

+ 28 - 0
src/popup/popup-prize/mixins/handle.ts

@@ -0,0 +1,28 @@
+import {InstructionsCacheType} from "$utils/request";
+import popup, {PopupExportComponent} from "$utils/tool/popup";
+import unit from "$utils/unit/unit";
+
+export default {
+
+    methods:{
+
+        openIntroduce(item,event){
+            return popup.$popup.open(PopupExportComponent.giftIntroduce,{
+                value:true,
+                x: event.clientX - event.offsetX + this.useOffsetWidth,
+                y: event.clientY - event.offsetY,
+                item
+            });
+        },
+        closeIntroduce(event){
+            return popup.$popup.open(PopupExportComponent.giftIntroduce,{
+                value:false
+            });
+        },
+    },
+
+    created(){
+        this.useOffsetWidth = unit.unitPx(30);
+    }
+
+}

+ 6 - 0
src/popup/popup-prize/mixins/index.ts

@@ -0,0 +1,6 @@
+import popup from "$mixins/popup";
+import handle from './handle';
+import pay from '$mixins/pay';
+import user from '$mixins/user';
+
+export default [popup,pay,handle,user];

+ 10 - 0
src/popup/popup-prize/props.ts

@@ -0,0 +1,10 @@
+export default {
+
+    data:{
+        type:Array,
+        default:function () {
+            return [];
+        }
+    }
+
+}

+ 56 - 0
src/popup/popup-prize/src/main.vue

@@ -0,0 +1,56 @@
+<template>
+  <popup v-model:value="value" header-title="奖品一览" content-animate="scale" @close="$emit('destroy-popup')">
+    <section class="recharge-award-container relative">
+      <div @click="close" class="recharge-close-wrap cursor-pointer absolute animate-rotate-hover">
+        <icon type="close" class="recharge-close"></icon>
+      </div>
+      <scroll-view>
+        <section
+            @mouseleave="closeIntroduce"
+            class="row wrap"
+        >
+          <div class="award-gift-item"
+            v-for="(item,index) in data"
+               :class="{'award-gift-clear-margin':index<8}"
+          >
+            <div class="award-gift-image"
+                 @mouseover="openIntroduce(item,$event)"
+            >
+              <v-image class="screen" mode="center"
+                       background-color="transparent"
+                       :src="item.base_image"
+              ></v-image>
+            </div>
+            <div class="award-gift-name">{{item.gift_name}}</div>
+            <div class="award-gift-number">{{item.open_num}}</div>
+          </div>
+        </section>
+      </scroll-view>
+    </section>
+  </popup>
+</template>
+
+<script>
+import {
+  Popup,
+  icon,
+  scrollView
+} from '$components';
+import mixins from '../mixins';
+import props from '../props';
+import VImage from "$components/v-image/lib/main";
+export default {
+  name: "popup-prize",
+  components:{
+    VImage,
+    Popup,
+    icon,
+    scrollView
+  },
+  mixins,
+  props
+}
+</script>
+
+<style scoped lang="scss" src="../style.scss"></style>
+<style scoped lang="scss" src="../../popup-award-pool/style.scss"></style>

+ 0 - 0
src/popup/popup-prize/style.scss


+ 32 - 0
src/popup/popup-turntable/data/control.ts

@@ -0,0 +1,32 @@
+import {FunctionTrigger} from "$mixins/trigger/class";
+import popup, {PopupExportComponent} from "$utils/tool/popup";
+import {ExportType} from "$popup/popup-message/const/type";
+
+export default [
+    {
+        label:'本期奖池',
+        color:'#F89B4F',
+        borderImage:'linear-gradient(0deg, #FFB98E, #FFFFFF, #F6A5FF) 10 10',
+        trigger: new FunctionTrigger(function () {
+            return popup.$open(PopupExportComponent.award);
+        })
+    },
+    {
+        label: '中奖记录',
+        color:'linear-gradient(0deg, #2BAAE2 0%, #9AE0FF 100%)',
+        borderImage: 'linear-gradient(0deg, #FFB98E, #FFFFFF, #F6A5FF) 10 10',
+        trigger: new FunctionTrigger(function () {
+            return popup.$open(PopupExportComponent.prizeRecord);
+        })
+    },
+    {
+        label:'规则说明',
+        color:'linear-gradient(0deg, #BF3652 0%, #FF7FA0 100%)',
+        borderImage: 'linear-gradient(0deg, #FFB98E, #FFFFFF, #F6A5FF) 10 10',
+        trigger: new FunctionTrigger(function () {
+            return popup.$open(PopupExportComponent.message,{
+                type:ExportType.boxMessage
+            });
+        })
+    }
+]

+ 11 - 0
src/popup/popup-turntable/data/number.ts

@@ -0,0 +1,11 @@
+export default [
+    {
+        number:1
+    },
+    {
+        number:10
+    },
+    {
+        number:100
+    }
+]

BIN
src/popup/popup-turntable/images/background.png


BIN
src/popup/popup-turntable/images/button.png


BIN
src/popup/popup-turntable/images/luck.png


BIN
src/popup/popup-turntable/images/title.png


+ 3 - 0
src/popup/popup-turntable/index.ts

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

+ 13 - 0
src/popup/popup-turntable/mixins/control.ts

@@ -0,0 +1,13 @@
+import {PopupExportComponent} from "$popup/popup-export/const";
+import popup from "$utils/tool/popup";
+
+export default {
+
+    methods:{
+
+        openRecharge(){
+            return popup.$open(PopupExportComponent.recharge);
+        },
+    }
+
+}

+ 166 - 0
src/popup/popup-turntable/mixins/handle.ts

@@ -0,0 +1,166 @@
+import {InstructionsCacheType, InstructionsMessageType} from "$utils/request";
+import unit from "$utils/unit/unit";
+import controlData from '../data/control';
+import numberData from '../data/number';
+import userIntegral from '$utils/control/integral';
+import popup, {PopupExportComponent} from "$utils/tool/popup";
+
+export default <LibMixins>{
+
+    data(){
+      return {
+          wheelConfig:{
+              blocks: [
+                  { padding: '7px', background: '#d64737' },
+              ],
+              prizes: [
+
+              ],
+              buttons: [
+                  { radius: '30px', background: '#d33c2c' },
+                  { radius: '27px', background: '#fff', },
+                  { radius: '24px', background: '#f6c66f', pointer: true },
+                  {
+                      radius: '19px',
+                      background: '#ffdea0',
+                      imgs:[
+                          {
+                              src: require('../images/luck.png'),
+                              width: unit.unitPx(25),
+                              height: unit.unitPx(28.33),
+                              top:unit.unitPx(-14)
+                          }
+                      ]
+                      // fonts: [{ text: '开始', top: '-13px' }]
+                  }
+              ],
+              defaultConfig: {
+                  // gutter: '5px',
+                  offsetDegree:0,
+                  stopRange:0
+              }
+          },
+          loadingStatus:false,
+          controlData,
+          numberData,
+          background: require('../images/background.png'),
+          buttonBackground: require('../images/button.png'),
+          luckStatus:false
+      }
+    },
+
+    methods:{
+        startCallBack (number) {
+
+            if (this.luckStatus) return;
+
+            let integral = number * (this.$store.state.config.config.box_unit_price || 0);
+
+            // 查看用户余额是否足够支付
+            if (userIntegral.checkBalance(integral,true)) {
+                // 开启抽奖模块
+                this.luckStatus = true;
+                this.$refs.LuckyWheel.play();
+
+                // 默认减掉本次余额
+                userIntegral.reduceBalance(integral,false);
+
+                this.$request({
+                    url:'box/open_box',
+                    data:{
+                        rid:this.rid,
+                        open_num:number
+                    },
+                    next:({status}) => this.luckStatus =status,
+                    token:true,
+                    message:InstructionsMessageType.other,
+                    failMessage:true
+                }).then((data)=>{
+                    if(data.isSuccess) {
+                        this.luckStatus = true;
+                        data = data.data || {};
+                        this.storageGiftData = data.win_gift_list;
+
+                        userIntegral.updateUserIntegral(data.user_money);
+
+                        return this.$refs.LuckyWheel.stop(this.giftId[this.storageGiftData[0].gid]);
+                    } else {
+                        // 将余额加回来 防止出现问题
+                        userIntegral.plusBalance(integral,true);
+                        return this.$refs.LuckyWheel.stop(0);
+                    }
+                }).catch((e)=>{
+                    // 默认减掉本次余额
+                    userIntegral.plusBalance(integral,false);
+                    return this.$refs.LuckyWheel.stop(0);
+                });
+            }
+
+
+
+        },
+
+        wheelEnd(){
+
+            if (this.storageGiftData) {
+                let storageGiftData = this.storageGiftData;
+                this.storageGiftData = undefined;
+                this.luckStatus = false;
+                // 执行回调
+                this.$attrs.wheelEnd && this.$attrs.wheelEnd(storageGiftData);
+
+                // 打开抽中的奖品列表
+                return popup.$open(PopupExportComponent.prize,{
+                    data: storageGiftData
+                });
+
+            }
+        },
+
+        fetch(){
+
+            this.$request({
+                url:'box/get_box_list',
+                cache:{
+                    type: InstructionsCacheType.memory
+                },
+                message:InstructionsMessageType.other
+            }).then((data)=>{
+                if (data.isSuccess) {
+
+                    let colorCount = this.colors.length;
+                    this.wheelConfig.prizes = data.data.map((item,index)=>{
+                        this.giftId[item.gid] = index;
+                        let useIndex = index % colorCount;
+                        let size = unit.unitPx(35);
+                        return {
+                            background:this.colors[useIndex],
+                            item:item,
+                            imgs:[
+                                {
+                                    src:item.base_image,
+                                    top:'10%',
+                                    width:size,
+                                    height:size
+                                }
+                            ]
+                        }
+
+                    });
+
+                } else {
+                    return this.close();
+                }
+            })
+
+        }
+    },
+
+    created(){
+        this.colors = ['#f8d384','#f9e3bb'];
+        this.giftId = {};
+        this.fetch();
+        this.$store.dispatch('getConfigPromise');
+    }
+
+}

+ 6 - 0
src/popup/popup-turntable/mixins/index.ts

@@ -0,0 +1,6 @@
+import popup from "$mixins/popup";
+import control from './control';
+import handle from './handle';
+import trigger from '$mixins/trigger';
+
+export default [popup,handle,control,trigger];

+ 8 - 0
src/popup/popup-turntable/props.ts

@@ -0,0 +1,8 @@
+export default {
+
+    rid:{
+        type:Number,
+        default:12
+    }
+
+}

+ 107 - 0
src/popup/popup-turntable/src/main.vue

@@ -0,0 +1,107 @@
+<template>
+  <popup v-model:value="value" style="z-index: 999" content-animate="scale" @close="$emit('destroy-popup')">
+
+    <section class="relative">
+      <!--  标题    -->
+      <img src="../images/title.png" class="popup-wheel-title absolute" />
+      <section class="popup-wheel overflow ">
+        <div class="popup-wheel-container center">
+
+          <article class="popup-wheel-content relative row"
+                   :style="{background:'url('+background+') no-repeat'}"
+          >
+            <div @click="close" class="absolute popup-wheel-icon cursor-pointer animate-rotate-hover">
+              <icon type="close" class="popup-wheel-icon-target"></icon>
+            </div>
+
+            <div class="flex-1 relative">
+              <lucky-wheel
+                  class="lucky-wheel-container absolute"
+                  :blocks="wheelConfig.blocks"
+                  :prizes="wheelConfig.prizes"
+                  :buttons="wheelConfig.buttons"
+                  @end="wheelEnd"
+                  ref="LuckyWheel"
+                  :defaultConfig="wheelConfig.defaultConfig"
+              ></lucky-wheel>
+            </div>
+            <div class="popup-wheel-right">
+
+              <article class="popup-wheel-control row">
+                <div
+                    v-for="(item,index) in controlData"
+                    :key="'wheel-control-'+index"
+                    class="popup-wheel-control-item overflow"
+                >
+                  <aside
+                      :style="{
+                      'background': item.color
+                    }"
+                      @click="trigger(item,index)"
+                      class="screen cursor-pointer"
+                  >{{item.label}}</aside>
+                </div>
+
+              </article>
+
+              <div class="popup-wheel-number-group overflow">
+                <aside
+                  v-for="(item,index) in numberData"
+                  :key="'popup-wheel-'+index"
+                  class="popup-wheel-number rowACenter"
+                >
+                  <img src="@/assets/images/currency.png" class="popup-wheel-currency" />
+                  <div class="flex-1">
+                    <span class="relative">{{item.number * ($store.state.config.config.box_unit_price || 0)}}</span>
+                  </div>
+                  <div class="popup-wheel-button center"
+                       :class="{'cursor-pointer':!luckStatus}"
+                       @click="startCallBack(item.number)"
+                    :style="{background:'url('+buttonBackground+') no-repeat'}"
+                  >抽{{item.number}}次</div>
+                </aside>
+              </div>
+
+              <div class="rowCenter popup-wheel-money">
+                <img src="@/assets/images/currency.png" class="popup-wheel-currency" />
+                <span class="popup-wheel-money-span relative">{{$store.getters.integral}}</span>
+                <div class="popup-wheel-money-button rowCenter cursor-pointer" @click="openRecharge">去充值></div>
+              </div>
+
+            </div>
+
+          </article>
+
+
+        </div>
+      </section>
+    </section>
+
+  </popup>
+</template>
+
+<script>
+import {
+  Popup,
+  icon,
+  flatList
+} from '$components';
+import mixins from '../mixins';
+import props from '../props';
+import {
+  LuckyWheel
+} from 'vue-luck-draw/vue3';
+export default {
+  name: "popup-turntable",
+  components:{
+    Popup,
+    LuckyWheel,
+    icon,
+    flatList
+  },
+  mixins,
+  props
+}
+</script>
+
+<style scoped lang="scss" src="../style.scss"></style>

+ 123 - 0
src/popup/popup-turntable/style.scss

@@ -0,0 +1,123 @@
+.popup-wheel,.popup-wheel-content{
+  border-radius: 10px;
+}
+.popup-wheel-container{
+  width: 770px;
+  height: 495px;
+  background: #342971;
+  border: 10px solid;
+  border-image: linear-gradient(0deg, #3382EC, #B8D7FF, #636BF1) 10 10;
+  box-shadow: 0 0 6px 4px rgba(0, 0, 0, 0.5);
+}
+
+.popup-wheel-content{
+  width: 727px;
+  height: 460px;
+  border: 1px solid #C072A7;
+  background-size: 100% !important;
+}
+
+.popup-wheel-title{
+  width: 314px;
+  height: auto;
+  left: 50px;
+  top: -34px;
+  z-index: 999;
+}
+
+/* 关闭按钮 */
+.popup-wheel-icon{
+  right: 10px;
+  top: 6px;
+  z-index: 999;
+}
+.popup-wheel-icon-target{
+  font-size: 18px;
+  color: #C1BED5;
+}
+/* 关闭按钮 */
+
+
+/* 抽奖组件 */
+.lucky-wheel-container{
+  @include square(230px);
+  left: 69.5px;
+  top: 72px;
+}
+/* 抽奖组件 */
+
+/* 抽奖右侧 */
+.popup-wheel-right{
+  width: 350px;
+}
+.popup-wheel-control-item,.popup-wheel-control aside{
+  border-radius: 0 0 35px 35px;
+}
+.popup-wheel-control-item{
+  width: 70px;
+  height: 61px;
+  margin-right: 20px;
+}
+.popup-wheel-control aside{
+  border: 3px solid #fff;
+  border-top: none;
+  text-align: center;
+  padding-top: 20px;
+  font-size: 14px;
+  color: #fff;
+  font-weight: 400;
+  box-shadow: 0 -1px 4px 4px rgba(106, 0, 15, 0.33) inset;
+}
+.popup-wheel-number-group,.popup-wheel-number{
+  margin-top: 20px;
+}
+.popup-wheel-number{
+  width: 292px;
+  height: 70px;
+  background-color: rgba(255,255,255,0.1);
+  border-radius: 5px;
+  padding:  0 30px;
+  font-size: 18px;
+  color: #F8EBB6;
+  font-weight: 400;
+  line-height: 22px;
+}
+.popup-wheel-currency{
+  @include square(20px);
+  margin-right: 6px;
+}
+.popup-wheel-number span{
+  top: 1px;
+}
+.popup-wheel-button{
+  width: 126px;
+  height: 50px;
+  background-size: 100% !important;
+  font-size: 18px;
+  color: #F8EBB6;
+  font-weight: 400;
+  line-height: 22px;
+}
+.popup-wheel-money{
+  margin-top: 58px;
+}
+.popup-wheel-money-span{
+  font-size: 16px;
+  line-height: 20px;
+  color: #F8EBB6;
+  font-weight: 400;
+  top: 1px;
+}
+.popup-wheel-money-button{
+  width: 76px;
+  height: 30px;
+  box-shadow: 0 0 10px 0 rgba(120, 0, 86, 0.97);
+  background: linear-gradient(129deg, #FD6E25, #FFAF38);
+  border-radius: 15px;
+  margin-left: 15px;
+  font-size: 14px;
+  line-height: 18px;
+  color: #F8EBB6;
+  font-weight: 400;
+}
+/* 抽奖右侧 */

+ 11 - 1
src/utils/control/integral/index.ts

@@ -5,6 +5,16 @@ import store from '@/store/index';
 import Throttle from '$utils/tool/throttle';
 let result = {
 
+    // 更新用户余额
+    updateUserIntegral(integral:number) {
+        if (user.user && user.user.integral !== integral) {
+            // 设置用户余额
+            this.setUserInfo({
+                integral
+            });
+        }
+    },
+
     // 获取用户余额
     getUserBalance():number{
         if (user.user && user.user.integral) {
@@ -115,4 +125,4 @@ result.throttle = new Throttle({
 
 result.updateUserMoney = result.throttle.supper;
 
-export default result;
+export default result;

+ 2 - 1
src/utils/request/instructions/plugins/instructions.ts

@@ -84,6 +84,7 @@ export default instructions.pushConfig({
        let pagesOption = InConfig.getTargetConfig(requestData.mode,'pageOption');
        requestData.data[pagesOption.page] = requestData.page.page;
        requestData.data[pagesOption.pageSize] = requestData.page.pageSize;
+        requestData.data['limit'] = requestData.page.pageSize;
     },
 
     // 加载提示
@@ -174,4 +175,4 @@ export default instructions.pushConfig({
         zIndex:-10
     }
 
-});
+});

+ 22 - 2
src/utils/socket/agoraRTM/agoraRTMIM.ts

@@ -8,7 +8,6 @@ import {AgoraRTMIMStatus} from './const/status';
 
 import {AgoraRTMessage, AgoraRTPcMessage} from './const/channel';
 import user from '$config/user';
-import {ConnectionChangeReason} from "@/sdk/agora-rtm-sdk/agora-rtm-sdk";
 
 export {AgoraRTMessage,AgoraRTMIMStatus,AgoraRTPcMessage}
 
@@ -39,6 +38,8 @@ export default class AgoraRTMIM extends Notice {
                     };
                 }
 
+
+
                 this.triggerMessage(resultData,data,AgoraRTMessage.userMessage);
             });
 
@@ -126,6 +127,7 @@ export default class AgoraRTMIM extends Notice {
                 resultData = {};
             }
 
+
             this.triggerMessage(resultData,data);
         });
 
@@ -237,7 +239,7 @@ export default class AgoraRTMIM extends Notice {
     }
 
     // 追加全服消息
-    addGlobal(data,roomInfo){
+    addGlobal(data,roomInfo,type=AgoraRTMessage.gift){
         if (data) {
 
             data.roomInfo = {
@@ -245,12 +247,30 @@ export default class AgoraRTMIM extends Notice {
                 name: roomInfo.room_name
             }
 
+            data.roomInfoMessageType = type;
+
             return data;
         }  else {
             return data;
         }
     }
 
+    // 追加抽奖礼物消息
+    addLuckGift(data,giftData){
+
+        if (data) {
+
+            // 礼物
+            data.giftData = giftData;
+
+            return  data;
+
+        } else {
+            return data;
+        }
+
+    }
+
     // 追加礼物信息
     addGiftInfo(data,toGiftData){
 

+ 10 - 1
src/utils/socket/agoraRTM/const/channel.ts

@@ -18,6 +18,9 @@ enum AgoraRTMessage {
     // 聊天消息
     chat='1',
 
+    // 全服播报的消息
+    globalBroadcast='global-broadcast',
+
     // 麦位信息得到更新
     wheat='3',
 
@@ -27,6 +30,9 @@ enum AgoraRTMessage {
     // 加入房间
     joinHome='2',
 
+    // 抽奖
+    luckDraw='luck-draw',
+
     // 清空消息
     clearMessage='6',
 
@@ -64,7 +70,10 @@ enum AgoraRTMessage {
     order='nfgk184grdgdfggdfghfhrhuxiuPlayOrder',
 
     // 登录被顶下来
-    loginOut='REMOTE_LOGIN'
+    loginOut='REMOTE_LOGIN',
+
+    // 通知自己我的背包需要刷新
+    knapsackToMy='no-socket-knapsack'
 
 }