index.vue 23 KB

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