index.vue 20 KB

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