123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <view class="page_container">
- <custom-nav-bar title="消息通知" />
- <view class="info_wrap">
- <setting-item
- @switch="changeNotify"
- :loading="loadingState.message"
- :switchValue="newMessageNotify"
- title="新消息通知"
- :is_switch="true"
- />
- <setting-item
- v-show="newMessageNotify"
- @click="toNotificationDetails"
- title="消息通知设置"
- />
- </view>
- </view>
- </template>
- <script>
- import CustomNavBar from "../../../components/CustomNavBar/index.vue";
- import MyAvatar from "../../../components/MyAvatar/index.vue";
- import SettingItem from "../../../components/SettingItem/index.vue";
- export default {
- components: {
- CustomNavBar,
- MyAvatar,
- SettingItem,
- },
- data() {
- return {
- newMessageNotify: true,
- loadingState: {
- message: false,
- },
- };
- },
- onLoad() {
- const disableNotify =
- uni.getStorageSync(
- `${this.$store.getters.storeCurrentUserID}_DisableNotify`,
- ) ?? false;
- this.newMessageNotify = !disableNotify;
- },
- methods: {
- toNotificationDetails() {
- uni.navigateTo({
- url: "/pages_im/pages/profile/notificationDetails/index",
- });
- },
- changeNotify(value) {
- this.loadingState.message = true;
- uni.setStorageSync(
- `${this.$store.getters.storeCurrentUserID}_DisableNotify`,
- !value,
- );
- this.newMessageNotify = value;
- this.loadingState.message = false;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .page_container {
- background-color: #f8f8f8;
- .info_wrap {
- background-color: #fff;
- margin-top: 24rpx;
- }
- }
- </style>
|