This commit is contained in:
2026-06-18 14:33:50 +08:00
commit 0e43ccec72
248 changed files with 30329 additions and 0 deletions

1
dist/pages/chat/index.js vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[947],{5053:function(e,a,n){var t=n(8870),s=n(1212),c=n(467),r=n(5544),o=n(6540),i=n(758),l=n.n(i),u=n(118),h=n(374),d=n(3401),v=n(7745),m=n(9672),_=n(4848);function p(){var e=(0,h.v)(),a=e.statusBarHeight,n=e.safeBottom,t=(0,i.useRouter)(),p=t.params.conversationId||"",f=t.params.targetUserId||"",x=decodeURIComponent(t.params.title||"\u804a\u5929"),b=(0,o.useState)(p),S=(0,r.A)(b,2),j=S[0],w=S[1],N=(0,o.useState)(null),I=(0,r.A)(N,2),A=I[0],g=I[1],k=(0,o.useState)([]),y=(0,r.A)(k,2),U=y[0],B=y[1],C=(0,o.useState)(""),E=(0,r.A)(C,2),M=E[0],T=E[1],Y=(0,o.useState)(!1),z=(0,r.A)(Y,2),R=z[0],D=z[1],H=(0,o.useState)(0),J=(0,r.A)(H,2),K=J[0],O=J[1],G=(0,o.useRef)(null),P=function(){var e=(0,c.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,(0,m.fG)({conversationId:j||void 0,targetUserId:j?void 0:f||void 0});case 1:a=e.v,a.conversationId&&a.conversationId!==j&&w(a.conversationId),a.peer&&g(a.peer),B(a.messages),O(function(e){return e+1e5});case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)(function(){P()},[]),(0,i.useDidShow)(function(){G.current=setInterval(P,5e3)}),(0,i.useDidHide)(function(){G.current&&clearInterval(G.current)}),(0,o.useEffect)(function(){return function(){G.current&&clearInterval(G.current)}},[]);var W=function(){var e=(0,c.A)((0,s.A)().m(function e(){var a,n;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(a=M.trim(),a&&!R){e.n=1;break}return e.a(2);case 1:return D(!0),T(""),e.p=2,e.n=3,(0,m._z)(a,{conversationId:j||void 0,toUserId:j?void 0:f||void 0});case 3:return n=e.v,n.conversationId&&w(n.conversationId),e.n=4,P();case 4:e.n=6;break;case 5:e.p=5,e.v,l().showToast({title:"\u53d1\u9001\u5931\u8d25",icon:"none"}),T(a);case 6:return e.p=6,D(!1),e.f(6);case 7:return e.a(2)}},e,null,[[2,5,6,7]])}));return function(){return e.apply(this,arguments)}}(),q=(null===A||void 0===A?void 0:A.name)||x;return(0,_.jsxs)(u.Ss,{className:"chat",children:[(0,_.jsx)(u.Ss,{className:"chat__nav",style:{paddingTop:"".concat(a,"px")},children:(0,_.jsxs)(u.Ss,{className:"chat__nav-row",children:[(0,_.jsx)(u.Ss,{className:"chat__back",onClick:function(){return l().navigateBack()},children:(0,_.jsx)(d.A,{name:"chev",size:22,className:"chat__back-icon"})}),(0,_.jsx)(u.EY,{className:"chat__title",children:q}),(0,_.jsx)(u.Ss,{className:"chat__nav-spacer"})]})}),(0,_.jsx)(u.BM,{scrollY:!0,className:"chat__scroll",scrollTop:K,scrollWithAnimation:!0,enhanced:!0,showScrollbar:!1,children:(0,_.jsx)(u.Ss,{className:"chat__list",children:0===U.length?(0,_.jsx)(u.EY,{className:"chat__empty",children:"\u8fd8\u6ca1\u6709\u6d88\u606f\uff0c\u6253\u4e2a\u62db\u547c\u5427 \ud83d\udc4b"}):U.map(function(e){return(0,_.jsxs)(u.Ss,{className:"chat__row ".concat(e.fromMe?"chat__row--me":""),children:[e.fromMe?null:(0,_.jsx)(v.A,{avatarKey:null===A||void 0===A?void 0:A.avatarKey,avatarUrl:null===A||void 0===A?void 0:A.avatarUrl,size:"sm"}),(0,_.jsxs)(u.Ss,{className:"chat__bubble-wrap",children:[(0,_.jsx)(u.Ss,{className:"chat__bubble ".concat(e.fromMe?"chat__bubble--me":""),children:e.content}),(0,_.jsx)(u.EY,{className:"chat__time",children:e.timeText})]})]},e._id)})})}),(0,_.jsxs)(u.Ss,{className:"chat__input-bar",style:{paddingBottom:"".concat(Math.max(12,n),"px")},children:[(0,_.jsx)(u.pd,{className:"chat__input",value:M,placeholder:"\u53d1\u6d88\u606f\u2026",placeholderClass:"chat__input-ph",confirmType:"send",onInput:function(e){return T(e.detail.value)},onConfirm:W}),(0,_.jsx)(u.Ss,{className:"chat__send ".concat(M.trim()?"":"chat__send--disabled"),onClick:W,children:"\u53d1\u9001"})]})]})}var f={},x=(0,t.eU)(p,"pages/chat/index",{root:{cn:[]}},f||{});p&&p.behaviors&&(x.behaviors=(x.behaviors||[]).concat(p.behaviors));Page(x)}},function(e){var a=function(a){return e(e.s=a)};e.O(0,[907,96,76],function(){return a(5053)});e.O()}]);

1
dist/pages/chat/index.json vendored Normal file
View File

@@ -0,0 +1 @@
{"usingComponents":{"comp":"../../comp"}}

2
dist/pages/chat/index.wxml vendored Normal file
View File

@@ -0,0 +1,2 @@
<import src="../../base.wxml"/>
<template is="taro_tmpl" data="{{root:root}}" />

1
dist/pages/chat/index.wxss vendored Normal file
View File

@@ -0,0 +1 @@
.chat{background:#14102b;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100vh}.chat__nav{-ms-flex-negative:0;background:#14102b;border-bottom:2rpx solid rgba(216,180,255,.06);flex-shrink:0}.chat__nav-row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100rpx;padding:0 24rpx}.chat__back{display:-ms-flexbox;display:flex;height:72rpx;width:72rpx;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;color:#f0e9ff;justify-content:center}.chat__back-icon{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.chat__title{color:#f0e9ff;-ms-flex:1;flex:1;font:700 32rpx/1 Space Grotesk,Inter,system-ui,sans-serif;text-align:center}.chat__nav-spacer{width:72rpx}.chat__scroll{-ms-flex:1;flex:1;min-height:0}.chat__list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28rpx;padding:32rpx}.chat__empty{color:#8a7aab;font:400 26rpx/1.6 Inter,system-ui,-apple-system,PingFang SC,Microsoft YaHei,sans-serif;padding:80rpx 0;text-align:center}.chat__row{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:16rpx;max-width:80%}.chat__row--me{-ms-flex-item-align:end;align-self:flex-end;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.chat__bubble-wrap{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8rpx}.chat__bubble{background:rgba(45,34,85,.6);border:2rpx solid rgba(216,180,255,.1);border-radius:28rpx;color:#f0e9ff;font:400 28rpx/1.5 Inter,system-ui,-apple-system,PingFang SC,Microsoft YaHei,sans-serif;padding:20rpx 26rpx;word-break:break-word}.chat__bubble--me{background:linear-gradient(135deg,#d8b4ff,#ffb3c8);border-color:transparent;color:#2a1d10}.chat__time{color:#8a7aab;font:400 20rpx/1 Inter,system-ui,-apple-system,PingFang SC,Microsoft YaHei,sans-serif;padding:0 8rpx}.chat__row--me .chat__time{text-align:right}.chat__input-bar{-ms-flex-negative:0;display:-ms-flexbox;display:flex;flex-shrink:0;-ms-flex-align:center;align-items:center;background:#14102b;border-top:2rpx solid rgba(216,180,255,.08);gap:20rpx;padding:20rpx 32rpx 24rpx}.chat__input{background:rgba(31,23,66,.68);border:2rpx solid rgba(216,180,255,.1);border-radius:19998rpx;-webkit-box-sizing:border-box;box-sizing:border-box;color:#f0e9ff;-ms-flex:1;flex:1;font:400 28rpx/80rpx Inter,system-ui,-apple-system,PingFang SC,Microsoft YaHei,sans-serif;height:80rpx;padding:0 28rpx}.chat__input-ph{color:#8a7aab}.chat__send{-ms-flex-negative:0;background:linear-gradient(135deg,#d8b4ff,#ffb3c8);border-radius:19998rpx;color:#2a1d10;flex-shrink:0;font:700 28rpx/80rpx Inter,system-ui,-apple-system,PingFang SC,Microsoft YaHei,sans-serif;height:80rpx;padding:0 36rpx}.chat__send--disabled{opacity:.5}