index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  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)"
  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. //把时间转换为月日
  271. getMonthOrDay(time) {
  272. let date = new Date(time) // 获取时间
  273. // var year = date.getFullYear() // 获取年
  274. let month = date.getMonth() + 1 // 获取月
  275. let strDate = date.getDate() // 获取日
  276. return month + '月' + strDate + '日'
  277. },
  278. // 开启订阅消息
  279. openMsg() {
  280. console.log('订阅消息')
  281. var that = this
  282. uni.getSetting({
  283. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  284. success(ret) {
  285. console.log(ret.subscriptionsSetting.itemSettings, '*************************************')
  286. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  287. if (ret.subscriptionsSetting.itemSettings) {
  288. uni.setStorageSync('sendMsg', true)
  289. uni.openSetting({ // 打开设置页
  290. success(rea) {
  291. console.log(rea.authSetting)
  292. }
  293. });
  294. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  295. uni.setStorageSync('sendMsg', false)
  296. uni.showModal({
  297. title: '提示',
  298. content: '为了更好的体验,请绑定消息推送',
  299. confirmText: '确定',
  300. cancelText: '取消',
  301. confirmColor: '#016BF6',
  302. success: function(res) {
  303. if (res.confirm) {
  304. wx.requestSubscribeMessage({
  305. tmplIds: that.arr,
  306. success(re) {
  307. console.log(JSON.stringify(re),
  308. '++++++++++++++')
  309. var datas = JSON.stringify(re);
  310. if (datas.indexOf("accept") != -1) {
  311. console.log(re)
  312. // uni.setStorageSync('sendMsg', true)
  313. }
  314. },
  315. fail: (res) => {
  316. console.log(res)
  317. }
  318. })
  319. // uni.setStorageSync('sendMsg', true)
  320. console.log('确认')
  321. that.showModal = false
  322. } else if (res.cancel) {
  323. console.log('取消')
  324. // uni.setStorageSync('sendMsg', false)
  325. that.showModal = true
  326. }
  327. }
  328. })
  329. }
  330. }
  331. })
  332. },
  333. getweiduMsg() {
  334. this.$Request.get("/app/chats/userCount").then(res => {
  335. uni.stopPullDownRefresh()
  336. if (res.code == 0) {
  337. this.userCount = res.data
  338. }
  339. });
  340. },
  341. //在线客服
  342. goChat() {
  343. // uni.navigateTo({
  344. // url:'/my/setting/chat'
  345. // })
  346. // #ifdef MP-WEIXIN
  347. if (uni.getStorageSync('sendMsg')) {
  348. // console.log('授权+1')
  349. wx.requestSubscribeMessage({
  350. tmplIds: this.arr,
  351. success(re) {
  352. // console.log(JSON.stringify(re), 111111111111)
  353. var datas = JSON.stringify(re);
  354. if (datas.indexOf("accept") != -1) {
  355. // console.log(re)
  356. }
  357. },
  358. fail: (res) => {
  359. // console.log(res)
  360. }
  361. })
  362. }
  363. // #endif
  364. let that = this
  365. if (uni.getStorageSync('userType') == 1) { //用户端
  366. // #ifdef MP-WEIXIN
  367. wx.openCustomerServiceChat({
  368. extInfo: {
  369. url: that.$queue.getData('kefu')
  370. },
  371. corpId: that.$queue.getData('kefuAppid'),
  372. success(res) {
  373. console.log(res)
  374. },
  375. })
  376. // #endif
  377. // #ifdef H5
  378. window.location.href = that.$queue.getData('kefu');
  379. // #endif
  380. // #ifdef APP
  381. let kefu = that.$queue.getData('kefu')
  382. console.log(kefu)
  383. plus.runtime.openURL(kefu, function(res) {});
  384. // #endif
  385. } else { //企业端
  386. // #ifdef MP-WEIXIN
  387. wx.openCustomerServiceChat({
  388. extInfo: {
  389. url: that.$queue.getData('kefuq')
  390. },
  391. corpId: that.$queue.getData('kefuAppidq'),
  392. success(res) {
  393. console.log(res)
  394. },
  395. })
  396. // #endif
  397. // #ifdef H5
  398. window.location.href = that.$queue.getData('kefuq');
  399. // #endif
  400. // #ifdef APP
  401. let kefu = that.$queue.getData('kefuq')
  402. console.log(kefu)
  403. plus.runtime.openURL(kefu, function(res) {});
  404. // #endif
  405. }
  406. },
  407. getChatList() {
  408. this.$Request.get("/app/chat/selectChatConversationPage", {
  409. page: this.page,
  410. limit: this.limit
  411. }).then(res => {
  412. uni.stopPullDownRefresh()
  413. if (res.code == 0) {
  414. this.chatList = res.data.list
  415. }
  416. });
  417. },
  418. getMsgList() {
  419. this.$Request.get("/app/message/selectMessageByUserIdLimit1").then(res => {
  420. uni.stopPullDownRefresh()
  421. if (res.code == 0) {
  422. this.msgList = res.data.list
  423. }
  424. });
  425. },
  426. goIM(e) {
  427. // #ifdef MP-WEIXIN
  428. if (uni.getStorageSync('sendMsg')) {
  429. // console.log('授权+1')
  430. wx.requestSubscribeMessage({
  431. tmplIds: this.arr,
  432. success(re) {
  433. // console.log(JSON.stringify(re), 111111111111)
  434. var datas = JSON.stringify(re);
  435. if (datas.indexOf("accept") != -1) {
  436. // console.log(re)
  437. }
  438. },
  439. fail: (res) => {
  440. // console.log(res)
  441. }
  442. })
  443. }
  444. // #endif
  445. let userId = '';
  446. let userType = uni.getStorageSync('userType')
  447. console.log(e, 'aaaaaaaaa')
  448. if (userType == 2) { //当前登录用户为企业
  449. userId = e.userId
  450. } else { //当前登录用户为用户
  451. userId = e.focusedUserId
  452. }
  453. if (uni.getStorageSync('userType') == 1) {
  454. uni.navigateTo({
  455. url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId +
  456. '&postPushId=' + e.postPushId + '&resumesId=' + e.resumesId
  457. })
  458. } else {
  459. uni.navigateTo({
  460. url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId +
  461. '&resumesId=' + e.resumesId + '&postPushId=' + e.postPushId
  462. })
  463. }
  464. },
  465. goMsg() {
  466. // #ifdef MP-WEIXIN
  467. if (uni.getStorageSync('sendMsg')) {
  468. // console.log('授权+1')
  469. wx.requestSubscribeMessage({
  470. tmplIds: this.arr,
  471. success(re) {
  472. // console.log(JSON.stringify(re), 111111111111)
  473. var datas = JSON.stringify(re);
  474. if (datas.indexOf("accept") != -1) {
  475. // console.log(re)
  476. }
  477. },
  478. fail: (res) => {
  479. // console.log(res)
  480. }
  481. })
  482. }
  483. // #endif
  484. uni.navigateTo({
  485. url: '/pages/msg/message'
  486. })
  487. },
  488. // 显示设置弹窗
  489. showSettingsModal() {
  490. this.showSettings = true
  491. },
  492. // 切换通知开关
  493. toggleNotification() {
  494. // 开关状态已经通过v-model自动更新,这里可以添加其他逻辑
  495. console.log('通知开关状态:', this.notificationEnabled)
  496. },
  497. // 招呼语设置
  498. goGreetingSettings() {
  499. uni.navigateTo({
  500. url: '/pages/msg/addmsg'
  501. })
  502. },
  503. // 常用语设置
  504. goCommonPhrases() {
  505. uni.navigateTo({
  506. url: '/pages/msg/addmsg'
  507. })
  508. },
  509. // 搜索功能
  510. goSearch() {
  511. uni.navigateTo({
  512. url: '/pages/msg/search'
  513. })
  514. }
  515. }
  516. }
  517. </script>
  518. <style lang="scss">
  519. .msg-box {
  520. // padding-top: 80rpx;
  521. .chat-title {
  522. background: linear-gradient(180deg, rgba(13, 39, 247, 1) 0%, rgb(191, 194, 201) 100%);
  523. -webkit-background-clip: text;
  524. background-clip: text;
  525. -webkit-text-fill-color: transparent;
  526. color: transparent;
  527. font-family: DM Sans;
  528. font-size: 42rpx;
  529. font-weight: 500;
  530. line-height: 28px;
  531. letter-spacing: 0%;
  532. text-align: left;
  533. margin: 20rpx 0 20rpx 20rpx;
  534. }
  535. .margin-top-sm {
  536. margin-top: 0 !important;
  537. }
  538. .nav-header {
  539. height: 80rpx;
  540. display: flex;
  541. align-items: center;
  542. justify-content: space-between;
  543. padding: 0 20rpx;
  544. }
  545. .nav-left {
  546. width: 60rpx;
  547. display: flex;
  548. justify-content: flex-start;
  549. }
  550. .nav-center {
  551. flex: 1;
  552. display: flex;
  553. justify-content: center;
  554. }
  555. .nav-title {
  556. font-size: 36rpx;
  557. font-weight: 600;
  558. color: #333333;
  559. }
  560. .nav-right {
  561. width: 60rpx;
  562. display: flex;
  563. justify-content: flex-end;
  564. align-items: center;
  565. }
  566. .bg {
  567. background: #FFFFFF;
  568. }
  569. .userNameleng {
  570. // width: 80%;
  571. flex: 1;
  572. overflow: hidden;
  573. white-space: nowrap;
  574. text-overflow: ellipsis;
  575. -o-text-overflow: ellipsis;
  576. }
  577. .avatar-container {
  578. position: relative;
  579. display: inline-block;
  580. }
  581. .online-dot {
  582. position: absolute;
  583. bottom: 2rpx;
  584. right: 2rpx;
  585. width: 20rpx;
  586. height: 20rpx;
  587. background-color: #00FF00;
  588. border-radius: 50%;
  589. border: 2rpx solid #FFFFFF;
  590. }
  591. }
  592. // 设置弹窗样式
  593. .settings-modal {
  594. background: #FFFFFF;
  595. border-radius: 20rpx 20rpx 0 0;
  596. padding: 0 30rpx 40rpx 30rpx;
  597. min-width: 100%;
  598. .modal-drag-bar {
  599. width: 60rpx;
  600. height: 8rpx;
  601. background: #E5E5E5;
  602. border-radius: 4rpx;
  603. margin: 20rpx auto 30rpx auto;
  604. }
  605. .modal-title {
  606. margin: 0 auto;
  607. color: rgba(34, 37, 42, 1);
  608. font-family: DM Sans;
  609. font-size: 36rpx;
  610. font-weight: 500;
  611. line-height: 23px;
  612. letter-spacing: 0px;
  613. text-align: center;
  614. padding-bottom: 20rpx;
  615. border-bottom: 1rpx solid rgba(219, 218, 218, 1);
  616. }
  617. .setting-item {
  618. display: flex;
  619. align-items: center;
  620. justify-content: space-between;
  621. padding: 12rpx 32rpx;
  622. margin-bottom: 30rpx;
  623. border: 1px solid rgba(227, 231, 236, 1);
  624. border-radius: 6px;
  625. &:active {
  626. background-color: #F8F8F8;
  627. }
  628. &.setting-item-first {
  629. border: none;
  630. padding: 40rpx 32rpx;
  631. }
  632. .setting-left {
  633. display: flex;
  634. flex-direction: column;
  635. align-items: flex-start;
  636. flex: 1;
  637. .setting-title-row {
  638. display: flex;
  639. align-items: center;
  640. justify-content: flex-start;
  641. width: 100%;
  642. margin-bottom: 16rpx;
  643. .setting-label {
  644. color: rgba(21, 22, 26, 1);
  645. font-family: DM Sans;
  646. font-size: 32rpx;
  647. font-weight: 600;
  648. line-height: 26px;
  649. letter-spacing: 0%;
  650. text-align: left;
  651. margin-right: 16rpx;
  652. }
  653. .setting-desc {
  654. color: rgba(153, 153, 153, 1);
  655. font-family: DM Sans;
  656. font-size: 22rpx;
  657. font-weight: 400;
  658. line-height: 13px;
  659. letter-spacing: 0%;
  660. text-align: left;
  661. }
  662. }
  663. .switch-status {
  664. font-size: 32rpx;
  665. &.status-on {
  666. color: #007AFF;
  667. }
  668. &.status-off {
  669. color: #999999;
  670. }
  671. }
  672. }
  673. .setting-right {
  674. display: flex;
  675. align-items: center;
  676. justify-content: flex-end;
  677. .u-switch {
  678. margin-top: 20rpx;
  679. transform: scale(1.2); // 放大开关到1.5倍
  680. }
  681. .setting-desc {
  682. color: rgba(153, 153, 153, 1);
  683. font-family: DM Sans;
  684. font-size: 22rpx;
  685. font-weight: 400;
  686. line-height: 13px;
  687. letter-spacing: 0%;
  688. text-align: left;
  689. margin-right: 16rpx;
  690. }
  691. }
  692. }
  693. }
  694. </style>