notify.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="notify-container">
  3. <view class="notify-title">通知设置</view>
  4. <view class="notify-list">
  5. <view class="notify-item">
  6. <view class="item-label">消息推送</view>
  7. <switch class="item-switch" :checked="notifyPush" @change="val=>notifyPush=val.detail.value" color="#409EFF" />
  8. </view>
  9. <view class="divider"></view>
  10. <view class="notify-item">
  11. <view class="item-label">声音提醒</view>
  12. <switch class="item-switch" :checked="sound" @change="val=>sound=val.detail.value" color="#409EFF" />
  13. </view>
  14. <view class="divider"></view>
  15. <view class="notify-item">
  16. <view class="item-label">系统通知</view>
  17. <switch class="item-switch" :checked="sysNotify" @change="val=>sysNotify=val.detail.value" color="#409EFF" />
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. notifyPush: true,
  27. sound: true,
  28. sysNotify: false
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. .notify-container {
  35. min-height: 100vh;
  36. background: #f7f8fa;
  37. padding: 0 0 120rpx 0;
  38. }
  39. .notify-title {
  40. text-align: center;
  41. font-size: 36rpx;
  42. font-weight: bold;
  43. color: #222;
  44. padding: 48rpx 0 32rpx 0;
  45. background: #f7f8fa;
  46. }
  47. .notify-list {
  48. background: #fff;
  49. border-radius: 20rpx;
  50. margin: 0 24rpx;
  51. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
  52. overflow: hidden;
  53. }
  54. .notify-item {
  55. display: flex;
  56. align-items: center;
  57. justify-content: space-between;
  58. padding: 32rpx 32rpx;
  59. background: #fff;
  60. }
  61. .item-label {
  62. font-size: 30rpx;
  63. color: #333;
  64. }
  65. .item-switch {
  66. transform: scale(0.9);
  67. }
  68. .divider {
  69. height: 1rpx;
  70. background: #f0f0f0;
  71. margin: 0 32rpx;
  72. }
  73. </style>