index.vue 20 KB

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