优化
This commit is contained in:
1
unpackage/dist/build/mp-weixin/components/ChatId.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/components/ChatId.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";exports.generateId=function(){const r=Math.random()>=.5;return`${String.fromCharCode(Math.floor(26*Math.random())+(r?65:97))}${Array.from({length:5},(()=>{const r=Math.random();return r<.3?String.fromCharCode(Math.floor(26*Math.random())+97):r<.6?String.fromCharCode(Math.floor(26*Math.random())+65):Math.floor(10*Math.random())})).join("")}${Date.now().toString(16).slice(-4)}`};
|
||||
@@ -1 +1 @@
|
||||
"use strict";exports.TimeFormatting=function(t){const e=new Date(1e3*t);e.getFullYear();const r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),g=String(e.getMinutes()).padStart(2,"0");return String(e.getSeconds()).padStart(2,"0"),`${r}-${n} ${a}:${g}`};
|
||||
"use strict";exports.TimeFormatting=function(t){const r=new Date(t);r.getFullYear();const e=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),a=String(r.getHours()).padStart(2,"0"),g=String(r.getMinutes()).padStart(2,"0");return String(r.getSeconds()).padStart(2,"0"),`${e}-${n} ${a}:${g}`};
|
||||
|
||||
@@ -1 +1 @@
|
||||
"use strict";const o=require("../../common/vendor.js");exports.getConversationList=function(o){return new Promise(((n,e)=>{o.im.latestConversations({onSuccess:function(o){console.log("获取会话列表成功",o),n(o.content)},onFailed:function(o){console.log("获取会话列表失败, code:"+o.code+" content:"+o.content)}})}))},exports.getConversationMessages=function(n,e,t){return new Promise(((c,s)=>{n.im.history({id:e,type:o.jo.IM_SCENE.PRIVATE,lastTimestamp:t,limit:30,onSuccess:function(o){console.log("获取消息列表成功",o),c(o.content)},onFailed:function(o){console.log("获取消息列表失败, code:"+o.code+" content:"+o.content)}})}))},exports.goEasylogin=function(o,n,e,t){console.log("`````````````````goEasylogin`````````````````",n,e,t),o.connect({id:n,data:{avatar:e,nickname:t},onSuccess:function(){console.log("IM连接成功")},onFailed:function(o){console.log("IM连接失败, code:"+o.code+",error:"+o.content)},onProgress:function(o){console.log("IM连接或自动重连中",o)}})},exports.goEasylogout=function(o){o.disconnect({onSuccess:function(){console.log("IM断开成功")},onFailed:function(o){console.log("IM断开失败, code:"+o.code+",error:"+o.content)}})},exports.sendMessage=function(n,e,t,c,s){return new Promise(((i,r)=>{var l=n.im;let a=l.createTextMessage({text:t,to:{type:o.jo.IM_SCENE.PRIVATE,id:e,data:{avatar:c,nickname:s}}});l.sendMessage({message:a,onSuccess:function(){console.log("发送消息成功",a),i(a)},onFailed:function(o){console.log("发送消息失败,code:"+o.code+" ,error "+o.content),r(o)}})}))};
|
||||
"use strict";const o=require("../../common/vendor.js");exports.conversationDelete=function(o,n){return new Promise(((e,t)=>{o.im.removeConversation({conversation:n,onSuccess:function(){e("删除会话成功")},onFailed:function(o){console.log(o)}})}))},exports.conversationTop=function(o,n,e){return new Promise(((t,s)=>{o.im.topConversation({conversation:n,top:e,onSuccess:function(){t("成功")},onFailed:function(o){console.log("失败:",o)}})}))},exports.getConversationList=function(o){return new Promise(((n,e)=>{o.im.latestConversations({onSuccess:function(o){console.log("获取会话列表成功",o),n(o.content)},onFailed:function(o){console.log("获取会话列表失败, code:"+o.code+" content:"+o.content)}})}))},exports.getConversationMessages=function(n,e,t){return new Promise(((s,c)=>{n.im.history({id:e,type:o.jo.IM_SCENE.PRIVATE,lastTimestamp:t,limit:30,onSuccess:function(o){console.log("获取消息列表成功",o),s(o.content)},onFailed:function(o){console.log("获取消息列表失败, code:"+o.code+" content:"+o.content)}})}))},exports.goEasylogin=function(o,n,e,t){console.log("`````````````````goEasylogin`````````````````",n,e,t),o.connect({id:n,data:{avatar:e,nickname:t},onSuccess:function(){console.log("IM连接成功")},onFailed:function(o){console.log("IM连接失败, code:"+o.code+",error:"+o.content)},onProgress:function(o){console.log("IM连接或自动重连中",o)}})},exports.goEasylogout=function(o){o.disconnect({onSuccess:function(){console.log("IM断开成功")},onFailed:function(o){console.log("IM断开失败, code:"+o.code+",error:"+o.content)}})},exports.messageRead=function(n,e){return new Promise(((t,s)=>{n.im.markMessageAsRead({id:e,type:o.jo.IM_SCENE.PRIVATE,onSuccess:function(){t()},onFailed:function(o){console.log("标记私聊已读失败",o)}})}))},exports.sendCustomMessage=function(n,e,t,s,c,i){return new Promise(((r,a)=>{var l=n.im,u=l.createCustomMessage({type:e,payload:s,to:{type:o.jo.IM_SCENE.PRIVATE,id:t,data:{avatar:c,nickname:i}}});l.sendMessage({message:u,onSuccess:function(){r(u)},onFailed:function(o){console.log("Failed to send message,code:"+o.code+",error"+o.content)}})}))},exports.sendMessage=function(n,e,t,s,c){return new Promise(((i,r)=>{var a=n.im;let l=a.createTextMessage({text:t,to:{type:o.jo.IM_SCENE.PRIVATE,id:e,data:{avatar:s,nickname:c}}});a.sendMessage({message:l,onSuccess:function(){i(l)},onFailed:function(o){console.log("发送消息失败,code:"+o.code+" ,error "+o.content),r(o)}})}))};
|
||||
|
||||
@@ -1 +1 @@
|
||||
"use strict";const e=require("../common/vendor.js"),t=require("./addPrefixToHeaderIcon.js");exports.request=function(n){const{url:r,data:a,method:o,header:s,userInfo:i}=n,g="http://120.26.251.180:8086/"+r;return new Promise(i?(n,r)=>{e.index.getStorage({key:"userinfo",success:i=>{i.data?i.data.nickName?e.index.request({url:g,data:a,method:o,header:s,success:function(e){console.log("请求成功",e),n(t.addPrefixToHeaderIcon(e.data))},fail:function(e){r(e)}}):(e.index.setStorageSync("lastPage",getCurrentPages()[getCurrentPages().length-1].route),e.index.reLaunch({url:"/pages/UserInformation/UserInformation"})):(e.index.setStorageSync("lastPage",getCurrentPages()[getCurrentPages().length-1].route),e.index.navigateTo({url:"/pages/login/login"}))},fail:function(t){e.index.setStorageSync("lastPage",getCurrentPages()[getCurrentPages().length-1].route),e.index.navigateTo({url:"/pages/login/login"}),r(t)}})}:(n,r)=>{e.index.request({url:g,data:a,method:o,header:s,success:function(e){console.log("请求成功",e),n(t.addPrefixToHeaderIcon(e.data))},fail:function(e){r(e)}})})};
|
||||
"use strict";const e=require("../common/vendor.js"),t=require("./addPrefixToHeaderIcon.js");exports.request=function(n){const{url:r,data:a,method:o,header:s,userInfo:i}=n,g="https://pk.zhukeping.com/"+r;return new Promise(i?(n,r)=>{e.index.getStorage({key:"userinfo",success:i=>{i.data?i.data.nickName?e.index.request({url:g,data:a,method:o,header:s,success:function(e){console.log("请求成功",e),n(t.addPrefixToHeaderIcon(e.data))},fail:function(e){r(e)}}):(e.index.setStorageSync("lastPage",getCurrentPages()[getCurrentPages().length-1].route),e.index.reLaunch({url:"/pages/UserInformation/UserInformation"})):(e.index.setStorageSync("lastPage",getCurrentPages()[getCurrentPages().length-1].route),e.index.navigateTo({url:"/pages/login/login"}))},fail:function(t){e.index.setStorageSync("lastPage",getCurrentPages()[getCurrentPages().length-1].route),e.index.navigateTo({url:"/pages/login/login"}),r(t)}})}:(n,r)=>{e.index.request({url:g,data:a,method:o,header:s,success:function(e){console.log("请求成功",e),n(t.addPrefixToHeaderIcon(e.data))},fail:function(e){r(e)}})})};
|
||||
|
||||
@@ -1 +1 @@
|
||||
"use strict";const e=require("../../common/vendor.js"),t=require("../VerifyLogin.js");Math||a();const a=()=>"../../pages/NewAddedPk/NewAddedPk2.js",s={__name:"tabBar",props:{tabIndex:Number,Unread:Number},setup(a){let s=e.ref(!1),n=e.reactive([{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Pk.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/PKClick.png",text:"PK",pagePath:"/pages/Home/Home",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forum.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forumclick.png",text:"站内信",pagePath:"/pages/Forum/Forum",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/jiahao.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/jiahao.png",text:"",pagePath:"/pages/c/c",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Message.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Messageclick.png",text:"消息",pagePath:"/pages/index/index",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mine.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mineclick.png",text:"我的",pagePath:"/pages/Mine/Mine",middleClass:""}]);e.onMounted((()=>{!function(){let e=n.length;if(e%2){s.value=!0;let t=Math.floor(e/2);n[t].middleClass="mid-button"}}()})),e.index.getSystemInfo({success:function(e){e.safeArea.top}});const o=e.ref();const c=()=>!1;function i(a,s){2===s?t.VerifyLogin().then((e=>{e&&o.value.open()})):4===s?t.VerifyLogin().then((t=>{t&&e.index.switchTab({url:"/pages/Mine/Mine",animationType:"none"})})):e.index.switchTab({url:a.pagePath})}return(t,l)=>({a:e.f(e.unref(n),((t,s,n)=>e.e({a:a.tabIndex==s?t.selectedIconPath:t.iconPath,b:3===s&&a.Unread>0},3===s&&a.Unread>0?{c:e.t(a.Unread>99?"99+":a.Unread)}:{},{d:e.t(t.text),e:a.tabIndex==s?"#1DD2F9":"#A7A3A3",f:e.n("list-item flex flex-column flex-middle "+t.middleClass),g:e.o((e=>i(t,s)),s),h:s}))),b:e.n(!0===e.unref(s)?"tab-list-middle":"tab-list-default"),c:e.o(c),d:e.sr(o,"b449a907-0",{k:"createModule"}),e:e.o(t.publishSuccesss)})}},n=e._export_sfc(s,[["__scopeId","data-v-b449a907"]]);wx.createComponent(n);
|
||||
"use strict";const e=require("../../common/vendor.js"),t=require("../VerifyLogin.js"),a=require("../goEasyTool/tool.js");Math||o();const o=()=>"../../pages/NewAddedPk/NewAddedPk2.js",s={__name:"tabBar",props:{tabIndex:Number},setup(o){const s=e.getCurrentInstance().appContext.config.globalProperties.$goeasy,n=e.ref(0);var c=s.im;function i(e){console.log("监听会话列表",e),n.value=e.unreadTotal}let l=e.ref(!1),d=e.reactive([{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Pk.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/PKClick.png",text:"PK",pagePath:"/pages/Home/Home",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forum.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forumclick.png",text:"站内信",pagePath:"/pages/Forum/Forum",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/jiahao.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/jiahao.png",text:"",pagePath:"/pages/c/c",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Message.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Messageclick.png",text:"消息",pagePath:"/pages/index/index",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mine.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mineclick.png",text:"我的",pagePath:"/pages/Mine/Mine",middleClass:""}]);e.onMounted((()=>{!function(){let e=d.length;if(e%2){l.value=!0;let t=Math.floor(e/2);d[t].middleClass="mid-button"}}(),setTimeout((()=>{a.getConversationList(s).then((e=>{n.value=e.unreadTotal})),c.on(e.jo.IM_EVENT.CONVERSATIONS_UPDATED,i)}),1e3)})),e.index.getSystemInfo({success:function(e){e.safeArea.top}});const h=e.ref();const u=()=>!1;function p(a,o){2===o?t.VerifyLogin().then((e=>{e&&h.value.open()})):4===o?t.VerifyLogin().then((t=>{t&&e.index.switchTab({url:"/pages/Mine/Mine",animationType:"none"})})):e.index.switchTab({url:a.pagePath})}return(t,a)=>({a:e.f(e.unref(d),((t,a,s)=>e.e({a:o.tabIndex==a?t.selectedIconPath:t.iconPath,b:3===a&&n.value>0},3===a&&n.value>0?{c:e.t(n.value>99?"99+":n.value)}:{},{d:e.t(t.text),e:o.tabIndex==a?"#1DD2F9":"#A7A3A3",f:e.n("list-item flex flex-column flex-middle "+t.middleClass),g:e.o((e=>p(t,a)),a),h:a}))),b:e.n(!0===e.unref(l)?"tab-list-middle":"tab-list-default"),c:e.o(u),d:e.sr(h,"99121d5c-0",{k:"createModule"}),e:e.o(t.publishSuccesss)})}},n=e._export_sfc(s,[["__scopeId","data-v-99121d5c"]]);wx.createComponent(n);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="tab-block data-v-b449a907"><view class="{{['tab-list', 'flex', 'flex-center', 'data-v-b449a907', b]}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="{{['data-v-b449a907', item.f]}}" bindtap="{{item.g}}"><view class="item-img-box data-v-b449a907"><image class="item-img data-v-b449a907" src="{{item.a}}"/><view wx:if="{{item.b}}" class="Unreadcss data-v-b449a907">{{item.c}}</view></view><view class="item-text font-20 data-v-b449a907" style="{{'color:' + item.e}}">{{item.d}}</view></view></view><view class="data-v-b449a907" catchtouchmove="{{c}}"></view><new-added-pk class="createModule r data-v-b449a907" u-r="createModule" bindpublishSuccess="{{e}}" u-i="b449a907-0" bind:__l="__l"></new-added-pk></view>
|
||||
<view class="tab-block data-v-99121d5c"><view class="{{['tab-list', 'flex', 'flex-center', 'data-v-99121d5c', b]}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="{{['data-v-99121d5c', item.f]}}" bindtap="{{item.g}}"><view class="item-img-box data-v-99121d5c"><image class="item-img data-v-99121d5c" src="{{item.a}}"/><view wx:if="{{item.b}}" class="Unreadcss data-v-99121d5c">{{item.c}}</view></view><view class="item-text font-20 data-v-99121d5c" style="{{'color:' + item.e}}">{{item.d}}</view></view></view><view class="data-v-99121d5c" catchtouchmove="{{c}}"></view><new-added-pk class="createModule r data-v-99121d5c" u-r="createModule" bindpublishSuccess="{{e}}" u-i="99121d5c-0" bind:__l="__l"></new-added-pk></view>
|
||||
@@ -1 +1 @@
|
||||
.flex.data-v-b449a907{display:flex;flex-flow:row wrap}.flex-center.data-v-b449a907{align-items:center;justify-content:center}.flex-column.data-v-b449a907{flex-direction:column;align-items:center}.flex-middle.data-v-b449a907{align-items:center}.font-20.data-v-b449a907{font-size:20rpx}.tab-block.data-v-b449a907{position:relative;position:fixed;bottom:0;z-index:2;background-size:contain;width:100vw;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.tab-block .tab-list.data-v-b449a907{height:100rpx;padding:0;z-index:0}.tab-block .createModule.data-v-b449a907{position:fixed;bottom:0;right:0;z-index:998;width:100vw}.tab-block .tab-list-default.data-v-b449a907{background-color:#fff;border-top:1px #dddddd solid}.tab-block .tab-list-middle.data-v-b449a907{position:relative;background-size:cover}.tab-block .list-item.data-v-b449a907{flex:1}.tab-block .list-item .item-img-box.data-v-b449a907{width:38rpx;height:38rpx;margin-bottom:9rpx;position:relative}.tab-block .list-item .item-img.data-v-b449a907{width:38rpx;height:38rpx;color:red}.tab-block .mid-button.data-v-b449a907{position:relative}.tab-block .mid-button .item-img-box.data-v-b449a907{width:150rpx;height:150rpx;margin-bottom:9rpx;position:absolute;z-index:10;top:-104rpx}.tab-block .mid-button .item-img.data-v-b449a907{width:150rpx;height:150rpx}.tab-block .mid-button .item-text.data-v-b449a907{font-size:20rpx;position:absolute;z-index:1002;bottom:-40rpx;color:#393a41}.tab-block .tab-bar.data-v-b449a907{height:30rpx;background-color:#fff}.Unreadcss.data-v-b449a907{position:absolute;background-color:red;margin-top:-65rpx;width:30rpx;height:30rpx;border-radius:50%;text-align:center;font-weight:700;font-size:18rpx;color:#fff;line-height:30rpx;margin-left:30rpx;z-index:1001}
|
||||
.flex.data-v-99121d5c{display:flex;flex-flow:row wrap}.flex-center.data-v-99121d5c{align-items:center;justify-content:center}.flex-column.data-v-99121d5c{flex-direction:column;align-items:center}.flex-middle.data-v-99121d5c{align-items:center}.font-20.data-v-99121d5c{font-size:20rpx}.tab-block.data-v-99121d5c{position:relative;position:fixed;bottom:0;z-index:2;background-size:contain;width:100vw;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.tab-block .tab-list.data-v-99121d5c{height:100rpx;padding:0;z-index:0}.tab-block .createModule.data-v-99121d5c{position:fixed;bottom:0;right:0;z-index:998;width:100vw}.tab-block .tab-list-default.data-v-99121d5c{background-color:#fff;border-top:1px #dddddd solid}.tab-block .tab-list-middle.data-v-99121d5c{position:relative;background-size:cover}.tab-block .list-item.data-v-99121d5c{flex:1}.tab-block .list-item .item-img-box.data-v-99121d5c{width:38rpx;height:38rpx;margin-bottom:9rpx;position:relative}.tab-block .list-item .item-img.data-v-99121d5c{width:38rpx;height:38rpx;color:red}.tab-block .mid-button.data-v-99121d5c{position:relative}.tab-block .mid-button .item-img-box.data-v-99121d5c{width:150rpx;height:150rpx;margin-bottom:9rpx;position:absolute;z-index:10;top:-104rpx}.tab-block .mid-button .item-img.data-v-99121d5c{width:150rpx;height:150rpx}.tab-block .mid-button .item-text.data-v-99121d5c{font-size:20rpx;position:absolute;z-index:1002;bottom:-40rpx;color:#393a41}.tab-block .tab-bar.data-v-99121d5c{height:30rpx;background-color:#fff}.Unreadcss.data-v-99121d5c{position:absolute;background-color:red;margin-top:-65rpx;width:30rpx;height:30rpx;border-radius:50%;text-align:center;font-weight:700;font-size:18rpx;color:#fff;line-height:30rpx;margin-left:30rpx;z-index:1001}
|
||||
|
||||
Reference in New Issue
Block a user