index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. <template>
  2. <view class="msg-box" :style="{ paddingTop: BarHeight + 'px' }">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-header">
  5. <view class="nav-left" @click="goSearch">
  6. <u-icon name="search" color="rgba(56, 58, 63, 1)" size="40"></u-icon>
  7. </view>
  8. <view class="nav-center">
  9. <text class="nav-title">消息</text>
  10. </view>
  11. <view class="nav-right">
  12. <u-icon name="bell" color="rgba(56, 58, 63, 1)" size="40" style="margin-right: 20rpx;"></u-icon>
  13. <u-icon name="setting" color="rgba(56, 58, 63, 1)" size="40" @click="showSettingsModal"></u-icon>
  14. </view>
  15. </view>
  16. <view class="chat-title">聊天</view>
  17. <view v-if="msgList.length" class="margin-topW">
  18. <view class="flex padding-tb radius padding-lr-sm bg" @click="goMsg" v-for="(item,index) in msgList"
  19. :key='index'>
  20. <view>
  21. <image style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
  22. src="../../static/images/msg/msg.png"></image>
  23. </view>
  24. <view class="flex-sub margin-left-sm">
  25. <view class="flex justify-between">
  26. <view class="text-white">{{item.title?item.title: '系统消息'}}</view>
  27. <view v-if="messageCount>0"
  28. style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
  29. {{messageCount}}
  30. </view>
  31. </view>
  32. <view>
  33. <view class="text-grey">{{item.content}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- <view class="margin-topW">
  39. <view class="flex padding-tb radius padding-lr-sm bg" @click="goChat">
  40. <view>
  41. <image style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
  42. src="../../static/images/msg/msgs.png"></image>
  43. </view>
  44. <view class="flex-sub margin-left-sm">
  45. <view class="flex justify-between">
  46. <view class="text-white">在线客服</view>
  47. <view v-if="userCount>0"
  48. style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
  49. {{userCount}}
  50. </view>
  51. </view>
  52. <view>
  53. <view class="text-grey">联系在线客服</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view> -->
  58. <view v-if="chatList.length" class="margin-top-sm content ">
  59. <view class="radius padding-lr-sm bg" style="margin-top: 4rpx;" @click="goIM(item)" @longpress="confirmDelete(item)"
  60. v-for="(item,index) in chatList" :key='index'>
  61. <view class="flex padding-tb ">
  62. <view class="avatar-container">
  63. <u-image shape="circle" width='80rpx' height="80rpx" :src="item.avatar"></u-image>
  64. <!-- <view class="online-dot"></view> -->
  65. </view>
  66. <view class="flex-sub margin-left-sm" style="overflow: hidden;">
  67. <view class="flex justify-between align-center">
  68. <view class="text-white flex align-center" style="flex: 1;overflow: hidden;">
  69. <view class="text-white" style="font-size: 30rpx;">
  70. {{item.userName}}
  71. </view>
  72. <text class="text-grey userNameleng" style="font-size: 26rpx;margin-left: 10rpx;">
  73. <text v-if="item.companyName">{{item.companyName}} |</text>
  74. {{item.stationName}}
  75. </text>
  76. </view>
  77. <view class="text-grey" style="flex-shrink: 0;margin-left: 10rpx;">
  78. {{item.messageTime?getMonthOrDay(item.messageTime):''}}</view>
  79. </view>
  80. <view class="flex justify-between" style="margin-top: 10rpx;">
  81. <view class="text-grey" v-if="item.messageType == 1">{{item.content}}</view>
  82. <view class="text-grey" v-else-if="item.messageType == 10">简历已发送</view>
  83. <view class="text-grey" v-else-if="item.messageType == 18">位置</view>
  84. <view class="text-grey" v-else-if="item.messageType == 9">简历请求</view>
  85. <view class="text-grey" v-else-if="item.messageType == 6">微信请求</view>
  86. <view class="text-grey" v-else-if="item.messageType == 5">手机号请求</view>
  87. <view class="text-grey" v-else-if="item.messageType == 2">[图片]</view>
  88. <view class="text-grey" v-else-if="item.messageType == 3">[语音]</view>
  89. <view class="text-grey" v-else-if="item.messageType == 7">[交换手机]</view>
  90. <view class="text-grey" v-else-if="item.messageType == 8">[交换微信]</view>
  91. <view class="text-grey" v-else-if="item.messageType == 12">{{item.content}}已拒绝</view>
  92. <view class="text-grey" v-else-if="item.messageType == 4"><image class="chat-listitem-text"
  93. v-if="item.content && item.messageType === 4"
  94. :src="ossUrl +item.content"
  95. style="height: 40rpx;width: 40rpx;"></image></view>
  96. <view class="text-grey" v-else-if="item.messageType == 20">[视频通话]</view>
  97. <view class="text-grey" v-else-if="item.messageType == 21">[语音通话]</view>
  98. <view class="text-grey" v-else-if="item.messageType == 99">[面试邀约]</view>
  99. <view class="text-grey" v-else-if="item.messageType == 98">[{{item.content}}]</view>
  100. <view class="text-grey" v-else-if="item.messageType == 96 || item.messageType == 97">[{{item.content}}]</view>
  101. <view class="text-grey" v-else>[其他消息类型]</view>
  102. <view v-if="item.contentCount"
  103. style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
  104. {{item.contentCount}}
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- <view class="flex padding-tb" v-else>
  110. <view>
  111. <u-image shape="circle" width='80rpx' height="80rpx" :src="item.avatar"></u-image>
  112. </view>
  113. <view class="flex-sub margin-left-sm">
  114. <view class="flex justify-between">
  115. <view class="text-white">{{item.userName}}</view>
  116. <view class="text-grey">{{item.messageTime?item.messageTime:''}}</view>
  117. </view>
  118. <view class="flex justify-between">
  119. <view class="text-grey" v-if="item.messageType == 1">{{item.content}}</view>
  120. <view class="text-grey" v-else-if="item.messageType == 18">位置</view>
  121. <view class="text-grey" v-else-if="item.messageType == 9">简历请求</view>
  122. <view class="text-grey" v-else-if="item.messageType == 6">微信请求</view>
  123. <view class="text-grey" v-else-if="item.messageType == 5">手机号请求</view>
  124. <view class="text-grey" v-else>[图片]</view>
  125. <view v-if="item.contentCount"
  126. style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
  127. {{item.contentCount}}
  128. </view>
  129. </view>
  130. </view>
  131. </view> -->
  132. </view>
  133. </view>
  134. <empty v-if="!chatList.length" content='暂无消息'></empty>
  135. <!-- 消息设置弹窗 -->
  136. <u-popup v-model="showSettings" mode="bottom" :mask-close-able="true" border-radius="20">
  137. <view class="settings-modal">
  138. <view class="modal-drag-bar"></view>
  139. <view class="modal-title">消息设置</view>
  140. <!-- 消息通知开关 -->
  141. <view class="setting-item setting-item-first">
  142. <view class="setting-left">
  143. <view class="setting-title-row">
  144. <view class="setting-label">消息通知开关</view>
  145. <view class="setting-desc">关闭后将不再向你推送消息通知</view>
  146. </view>
  147. <view class="switch-status" :class="{ 'status-on': notificationEnabled, 'status-off': !notificationEnabled }">
  148. {{ notificationEnabled ? 'On' : 'Off' }}
  149. </view>
  150. </view>
  151. <view class="setting-right">
  152. <u-switch v-model="notificationEnabled" active-color="#007AFF" @change="toggleNotification"></u-switch>
  153. </view>
  154. </view>
  155. <!-- 招呼语设置 -->
  156. <view class="setting-item" @click="goGreetingSettings">
  157. <view class="setting-left">
  158. <view class="setting-label">招呼语设置</view>
  159. </view>
  160. <view class="setting-right">
  161. <view class="setting-desc">设置后,沟通时可自动发送设置的招呼语</view>
  162. <u-icon name="arrow-right" color="rgba(29, 33, 41, 1)" size="24"></u-icon>
  163. </view>
  164. </view>
  165. <!-- 常用语设置 -->
  166. <view class="setting-item" @click="goCommonPhrases">
  167. <view class="setting-left">
  168. <view class="setting-label">常用语设置</view>
  169. </view>
  170. <view class="setting-right">
  171. <u-icon name="arrow-right" color="rgba(29, 33, 41, 1)" size="24"></u-icon>
  172. </view>
  173. </view>
  174. </view>
  175. </u-popup>
  176. </view>
  177. </template>
  178. <script>
  179. import empty from '../../components/empty.vue'
  180. import configData from '../../common/config.js'
  181. export default {
  182. components: {
  183. empty
  184. },
  185. data() {
  186. return {
  187. BarHeight:'',
  188. page: 1,
  189. limit: 100,
  190. chatList: [],
  191. userId: '',
  192. msgList: [],
  193. time: '',
  194. messageCount: 0,
  195. userCount: 0,
  196. arr: [],
  197. showModal: true,
  198. showSettings: false, // 控制设置弹窗显示
  199. notificationEnabled: true, // 消息通知开关状态
  200. ossUrl:configData.ossUrl
  201. }
  202. },
  203. onLoad() {
  204. if (uni.getStorageSync('userId')) {
  205. this.getChatList()
  206. }
  207. },
  208. //下拉刷新
  209. onPullDownRefresh() {
  210. let that = this
  211. if (uni.getStorageSync('token')) {
  212. that.getweiduMsg();
  213. that.getChatList()
  214. that.getMsgList()
  215. that.$nextTick(function() {
  216. that.messageCount = uni.getStorageSync('messageCount')
  217. })
  218. }
  219. },
  220. onShow() {
  221. // #ifdef APP-PLUS
  222. let systemInfo = uni.getSystemInfoSync();
  223. this.BarHeight = systemInfo.statusBarHeight;
  224. // #endif
  225. let that = this
  226. that.userId = uni.getStorageSync('userId')
  227. if (that.userId) {
  228. that.time = setInterval(function() {
  229. that.getweiduMsg();
  230. that.getChatList()
  231. that.getMsgList()
  232. that.$nextTick(function() {
  233. that.messageCount = uni.getStorageSync('messageCount')
  234. })
  235. }, 3000)
  236. this.$Request.getT('/app/common/type/310').then(res => { //消息未读提醒
  237. if (res.code == 0) {
  238. if (res.data && res.data.value) {
  239. this.arr.push(res.data.value)
  240. }
  241. }
  242. })
  243. this.$Request.getT('/app/common/type/337').then(res => { //预约成功通知(通用)
  244. if (res.code == 0) {
  245. if (res.data && res.data.value) {
  246. this.arr.push(res.data.value)
  247. }
  248. }
  249. })
  250. this.$Request.getT('/app/common/type/338').then(res => { //订单状态通知
  251. if (res.code == 0) {
  252. if (res.data && res.data.value) {
  253. this.arr.push(res.data.value)
  254. }
  255. }
  256. })
  257. // #ifdef MP-WEIXIN
  258. if (this.showModal) {
  259. this.openMsg()
  260. }
  261. // #endif
  262. } else {
  263. that.chatList = []
  264. that.msgList = []
  265. }
  266. },
  267. onHide() {
  268. clearInterval(this.time)
  269. },
  270. methods: {
  271. confirmDelete(item){
  272. uni.showModal({
  273. title: '提示',
  274. content: '是否删除这条消息?',
  275. cancelText: '取消',
  276. confirmText: '删除',
  277. success: (res) => {
  278. if (res.confirm) {
  279. this.$Request.get(`/app/chat/deleteConversation?chatConversationId=${item.chatConversationId}`).then(res => {
  280. if(res.code == 0){
  281. uni.showToast({
  282. title: res.msg,
  283. icon: 'none'
  284. })
  285. }else{
  286. uni.showToast({
  287. title: res.msg || '删除失败',
  288. icon: 'none'
  289. })
  290. }
  291. });
  292. }
  293. }
  294. });
  295. },
  296. //把时间转换为月日
  297. getMonthOrDay(data) {
  298. // 1️⃣ 手动解析字符串,避免 iOS 时区问题
  299. let timePublish;
  300. if (typeof data === 'string') {
  301. // 格式:2026-01-05 18:46:39
  302. const parts = data.split(/[- :]/);
  303. // 注意:月份从 0 开始
  304. timePublish = new Date(parts[0], parts[1] - 1, parts[2], parts[3] || 0, parts[4] || 0, parts[5] || 0);
  305. } else {
  306. timePublish = new Date(data);
  307. }
  308. const timeNow = new Date();
  309. const publishYear = timePublish.getFullYear();
  310. const publishMonth = timePublish.getMonth() + 1;
  311. const publishDate = timePublish.getDate();
  312. const publishHour = timePublish.getHours().toString().padStart(2, '0');
  313. const publishMinute = timePublish.getMinutes().toString().padStart(2, '0');
  314. const oneDay = 1000 * 60 * 60 * 24;
  315. // 用本地时间差计算天数
  316. const diffDays = Math.floor((timeNow.setHours(0, 0, 0, 0) - timePublish.setHours(0, 0, 0, 0)) / oneDay);
  317. const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  318. const weekStr = weekDays[timePublish.getDay()];
  319. const sameYear = publishYear === timeNow.getFullYear();
  320. let result = '';
  321. if (diffDays === 0) {
  322. result = `${publishHour}:${publishMinute}`;
  323. } else if (diffDays === 1) {
  324. result = `昨天 ${publishHour}:${publishMinute}`;
  325. } else if (diffDays < 7) {
  326. result = `${weekStr} ${publishHour}:${publishMinute}`;
  327. } else if (sameYear) {
  328. result = `${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
  329. } else {
  330. result = `${publishYear}年${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
  331. }
  332. return result;
  333. },
  334. // 开启订阅消息
  335. openMsg() {
  336. console.log('订阅消息')
  337. var that = this
  338. uni.getSetting({
  339. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  340. success(ret) {
  341. console.log(ret.subscriptionsSetting.itemSettings, '*************************************')
  342. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  343. if (ret.subscriptionsSetting.itemSettings) {
  344. uni.setStorageSync('sendMsg', true)
  345. uni.openSetting({ // 打开设置页
  346. success(rea) {
  347. console.log(rea.authSetting)
  348. }
  349. });
  350. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  351. uni.setStorageSync('sendMsg', false)
  352. uni.showModal({
  353. title: '提示',
  354. content: '为了更好的体验,请绑定消息推送',
  355. confirmText: '确定',
  356. cancelText: '取消',
  357. confirmColor: '#016BF6',
  358. success: function(res) {
  359. if (res.confirm) {
  360. wx.requestSubscribeMessage({
  361. tmplIds: that.arr,
  362. success(re) {
  363. console.log(JSON.stringify(re),
  364. '++++++++++++++')
  365. var datas = JSON.stringify(re);
  366. if (datas.indexOf("accept") != -1) {
  367. console.log(re)
  368. // uni.setStorageSync('sendMsg', true)
  369. }
  370. },
  371. fail: (res) => {
  372. console.log(res)
  373. }
  374. })
  375. // uni.setStorageSync('sendMsg', true)
  376. console.log('确认')
  377. that.showModal = false
  378. } else if (res.cancel) {
  379. console.log('取消')
  380. // uni.setStorageSync('sendMsg', false)
  381. that.showModal = true
  382. }
  383. }
  384. })
  385. }
  386. }
  387. })
  388. },
  389. getweiduMsg() {
  390. this.$Request.get("/app/chats/userCount").then(res => {
  391. uni.stopPullDownRefresh()
  392. if (res.code == 0) {
  393. this.userCount = res.data
  394. }
  395. });
  396. },
  397. //在线客服
  398. goChat() {
  399. // uni.navigateTo({
  400. // url:'/my/setting/chat'
  401. // })
  402. // #ifdef MP-WEIXIN
  403. if (uni.getStorageSync('sendMsg')) {
  404. // console.log('授权+1')
  405. wx.requestSubscribeMessage({
  406. tmplIds: this.arr,
  407. success(re) {
  408. // console.log(JSON.stringify(re), 111111111111)
  409. var datas = JSON.stringify(re);
  410. if (datas.indexOf("accept") != -1) {
  411. // console.log(re)
  412. }
  413. },
  414. fail: (res) => {
  415. // console.log(res)
  416. }
  417. })
  418. }
  419. // #endif
  420. let that = this
  421. if (uni.getStorageSync('userType') == 1) { //用户端
  422. // #ifdef MP-WEIXIN
  423. wx.openCustomerServiceChat({
  424. extInfo: {
  425. url: that.$queue.getData('kefu')
  426. },
  427. corpId: that.$queue.getData('kefuAppid'),
  428. success(res) {
  429. console.log(res)
  430. },
  431. })
  432. // #endif
  433. // #ifdef H5
  434. window.location.href = that.$queue.getData('kefu');
  435. // #endif
  436. // #ifdef APP
  437. let kefu = that.$queue.getData('kefu')
  438. console.log(kefu)
  439. plus.runtime.openURL(kefu, function(res) {});
  440. // #endif
  441. } else { //企业端
  442. // #ifdef MP-WEIXIN
  443. wx.openCustomerServiceChat({
  444. extInfo: {
  445. url: that.$queue.getData('kefuq')
  446. },
  447. corpId: that.$queue.getData('kefuAppidq'),
  448. success(res) {
  449. console.log(res)
  450. },
  451. })
  452. // #endif
  453. // #ifdef H5
  454. window.location.href = that.$queue.getData('kefuq');
  455. // #endif
  456. // #ifdef APP
  457. let kefu = that.$queue.getData('kefuq')
  458. console.log(kefu)
  459. plus.runtime.openURL(kefu, function(res) {});
  460. // #endif
  461. }
  462. },
  463. getChatList() {
  464. this.$Request.get("/app/chat/selectChatConversationPage", {
  465. page: this.page,
  466. limit: this.limit
  467. }).then(res => {
  468. uni.stopPullDownRefresh()
  469. if (res.code == 0) {
  470. this.chatList = res.data.list
  471. }
  472. });
  473. },
  474. getMsgList() {
  475. this.$Request.get("/app/message/selectMessageByUserIdLimit1").then(res => {
  476. uni.stopPullDownRefresh()
  477. if (res.code == 0) {
  478. this.msgList = res.data.list
  479. }
  480. });
  481. },
  482. goIM(e) {
  483. // #ifdef MP-WEIXIN
  484. if (uni.getStorageSync('sendMsg')) {
  485. // console.log('授权+1')
  486. wx.requestSubscribeMessage({
  487. tmplIds: this.arr,
  488. success(re) {
  489. // console.log(JSON.stringify(re), 111111111111)
  490. var datas = JSON.stringify(re);
  491. if (datas.indexOf("accept") != -1) {
  492. // console.log(re)
  493. }
  494. },
  495. fail: (res) => {
  496. // console.log(res)
  497. }
  498. })
  499. }
  500. // #endif
  501. let userId = '';
  502. let userType = uni.getStorageSync('userType')
  503. console.log(e, 'aaaaaaaaa')
  504. if (userType == 2) { //当前登录用户为企业
  505. userId = e.userId
  506. } else { //当前登录用户为用户
  507. userId = e.focusedUserId
  508. }
  509. if (uni.getStorageSync('userType') == 1) {
  510. uni.navigateTo({
  511. url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId +
  512. '&postPushId=' + e.postPushId + '&resumesId=' + e.resumesId
  513. })
  514. } else {
  515. uni.navigateTo({
  516. url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId +
  517. '&resumesId=' + e.resumesId + '&postPushId=' + e.postPushId
  518. })
  519. }
  520. },
  521. goMsg() {
  522. // #ifdef MP-WEIXIN
  523. if (uni.getStorageSync('sendMsg')) {
  524. // console.log('授权+1')
  525. wx.requestSubscribeMessage({
  526. tmplIds: this.arr,
  527. success(re) {
  528. // console.log(JSON.stringify(re), 111111111111)
  529. var datas = JSON.stringify(re);
  530. if (datas.indexOf("accept") != -1) {
  531. // console.log(re)
  532. }
  533. },
  534. fail: (res) => {
  535. // console.log(res)
  536. }
  537. })
  538. }
  539. // #endif
  540. uni.navigateTo({
  541. url: '/pages/msg/message'
  542. })
  543. },
  544. // 显示设置弹窗
  545. showSettingsModal() {
  546. this.showSettings = true
  547. },
  548. // 切换通知开关
  549. toggleNotification() {
  550. // 开关状态已经通过v-model自动更新,这里可以添加其他逻辑
  551. console.log('通知开关状态:', this.notificationEnabled)
  552. },
  553. // 招呼语设置
  554. goGreetingSettings() {
  555. uni.navigateTo({
  556. url: '/pages/msg/addmsg'
  557. })
  558. },
  559. // 常用语设置
  560. goCommonPhrases() {
  561. uni.navigateTo({
  562. url: '/pages/msg/addmsg'
  563. })
  564. },
  565. // 搜索功能
  566. goSearch() {
  567. uni.navigateTo({
  568. url: '/pages/msg/search'
  569. })
  570. }
  571. }
  572. }
  573. </script>
  574. <style lang="scss">
  575. .msg-box {
  576. // padding-top: 80rpx;
  577. .chat-title {
  578. background: linear-gradient(180deg, rgba(13, 39, 247, 1) 0%, rgb(191, 194, 201) 100%);
  579. -webkit-background-clip: text;
  580. background-clip: text;
  581. -webkit-text-fill-color: transparent;
  582. color: transparent;
  583. font-family: DM Sans;
  584. font-size: 42rpx;
  585. font-weight: 500;
  586. line-height: 28px;
  587. letter-spacing: 0%;
  588. text-align: left;
  589. margin: 20rpx 0 20rpx 20rpx;
  590. }
  591. .margin-top-sm {
  592. margin-top: 0 !important;
  593. }
  594. .nav-header {
  595. height: 80rpx;
  596. display: flex;
  597. align-items: center;
  598. justify-content: space-between;
  599. padding: 0 20rpx;
  600. }
  601. .nav-left {
  602. width: 60rpx;
  603. display: flex;
  604. justify-content: flex-start;
  605. }
  606. .nav-center {
  607. flex: 1;
  608. display: flex;
  609. justify-content: center;
  610. }
  611. .nav-title {
  612. font-size: 36rpx;
  613. font-weight: 600;
  614. color: #333333;
  615. }
  616. .nav-right {
  617. width: 60rpx;
  618. display: flex;
  619. justify-content: flex-end;
  620. align-items: center;
  621. }
  622. .bg {
  623. background: #FFFFFF;
  624. }
  625. .userNameleng {
  626. // width: 80%;
  627. flex: 1;
  628. overflow: hidden;
  629. white-space: nowrap;
  630. text-overflow: ellipsis;
  631. -o-text-overflow: ellipsis;
  632. }
  633. .avatar-container {
  634. position: relative;
  635. display: inline-block;
  636. }
  637. .online-dot {
  638. position: absolute;
  639. bottom: 2rpx;
  640. right: 2rpx;
  641. width: 20rpx;
  642. height: 20rpx;
  643. background-color: #00FF00;
  644. border-radius: 50%;
  645. border: 2rpx solid #FFFFFF;
  646. }
  647. }
  648. // 设置弹窗样式
  649. .settings-modal {
  650. background: #FFFFFF;
  651. border-radius: 20rpx 20rpx 0 0;
  652. padding: 0 30rpx 40rpx 30rpx;
  653. min-width: 100%;
  654. .modal-drag-bar {
  655. width: 60rpx;
  656. height: 8rpx;
  657. background: #E5E5E5;
  658. border-radius: 4rpx;
  659. margin: 20rpx auto 30rpx auto;
  660. }
  661. .modal-title {
  662. margin: 0 auto;
  663. color: rgba(34, 37, 42, 1);
  664. font-family: DM Sans;
  665. font-size: 36rpx;
  666. font-weight: 500;
  667. line-height: 23px;
  668. letter-spacing: 0px;
  669. text-align: center;
  670. padding-bottom: 20rpx;
  671. border-bottom: 1rpx solid rgba(219, 218, 218, 1);
  672. }
  673. .setting-item {
  674. display: flex;
  675. align-items: center;
  676. justify-content: space-between;
  677. padding: 12rpx 32rpx;
  678. margin-bottom: 30rpx;
  679. border: 1px solid rgba(227, 231, 236, 1);
  680. border-radius: 6px;
  681. &:active {
  682. background-color: #F8F8F8;
  683. }
  684. &.setting-item-first {
  685. border: none;
  686. padding: 40rpx 32rpx;
  687. }
  688. .setting-left {
  689. display: flex;
  690. flex-direction: column;
  691. align-items: flex-start;
  692. flex: 1;
  693. .setting-title-row {
  694. display: flex;
  695. align-items: center;
  696. justify-content: flex-start;
  697. width: 100%;
  698. margin-bottom: 16rpx;
  699. .setting-label {
  700. color: rgba(21, 22, 26, 1);
  701. font-family: DM Sans;
  702. font-size: 32rpx;
  703. font-weight: 600;
  704. line-height: 26px;
  705. letter-spacing: 0%;
  706. text-align: left;
  707. margin-right: 16rpx;
  708. }
  709. .setting-desc {
  710. color: rgba(153, 153, 153, 1);
  711. font-family: DM Sans;
  712. font-size: 22rpx;
  713. font-weight: 400;
  714. line-height: 13px;
  715. letter-spacing: 0%;
  716. text-align: left;
  717. }
  718. }
  719. .switch-status {
  720. font-size: 32rpx;
  721. &.status-on {
  722. color: #007AFF;
  723. }
  724. &.status-off {
  725. color: #999999;
  726. }
  727. }
  728. }
  729. .setting-right {
  730. display: flex;
  731. align-items: center;
  732. justify-content: flex-end;
  733. .u-switch {
  734. margin-top: 20rpx;
  735. transform: scale(1.2); // 放大开关到1.5倍
  736. }
  737. .setting-desc {
  738. color: rgba(153, 153, 153, 1);
  739. font-family: DM Sans;
  740. font-size: 22rpx;
  741. font-weight: 400;
  742. line-height: 13px;
  743. letter-spacing: 0%;
  744. text-align: left;
  745. margin-right: 16rpx;
  746. }
  747. }
  748. }
  749. }
  750. </style>