acdr-ui/dist/dev/mp-weixin/pages/settings/index.js.map

1 line
9.3 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"version":3,"file":"index.js","sources":["../../../../../src/pages/settings/index.vue","../../../../../uniPage:/cGFnZXMvc2V0dGluZ3MvaW5kZXgudnVl"],"sourcesContent":["<route lang=\"json5\" type=\"page\">\n{\n layout: 'default',\n style: {\n navigationBarTitleText: '设置',\n },\n}\n</route>\n<template>\n <view class=\"setting-root h-full p-5\">\n <!-- 用户头像 如果不存在头像就访问占位符函数imgUrl默认为占位符 -->\n <view class=\"flex items-center justify-center mb-6 pos-relative\">\n <wd-img\n v-if=\"sinfo.userAvatar != undefined\"\n :width=\"100\"\n :height=\"100\"\n round\n mode=\"aspectFill\"\n :src=\"sinfo.userAvatar ? imgUrl(sinfo.userAvatar) : imgUrl('')\"\n ></wd-img>\n <view\n @click=\"updateAvatar\"\n class=\"text-white pos-absolute bottom-[-10px] right-[33%] bg-[#ff7f50] rounded p-[2px]\"\n >\n 修改\n </view>\n </view>\n\n <!-- 国际化设置 -->\n <view class=\"card mb-4 p-4 bg-white rounded-lg shadow\">\n <view class=\"text-gray-800 text-lg mb-2\">国际化设置</view>\n <wd-picker\n :columns=\"languageOptions\"\n label=\"选择语言\"\n v-model=\"selectedLanguage\"\n @confirm=\"handleLanguageChange\"\n />\n </view>\n\n <!-- 账户设置 -->\n <view class=\"card mb-4 p-4 bg-white rounded-lg shadow\">\n <view class=\"wd-cell\" @click=\"showUserNamePopup = true\">\n <text class=\"text-gray-800\">账户名称</text>\n <text class=\"text-gray-400 ml-auto\">{{ sinfo.userName }}</text>\n <wd-icon name=\"right\" size=\"16\" class=\"ml-2\"></wd-icon>\n </view>\n <view class=\"wd-cell\" @click=\"goToBindPhone\">\n <text class=\"text-gray-800\">手机号绑定</text>\n <text class=\"text-gray-400 ml-auto\">{{ sinfo.phone }}</text>\n <wd-icon name=\"right\" size=\"16\" class=\"ml-2\"></wd-icon>\n </view>\n <view class=\"wd-cell\" @click=\"!sinfo.isAuth ? goToRealNameAuth() : toast('你已经实名了')\">\n <text class=\"text-gray-800\">实名认证</text>\n <text v-if=\"sinfo.isAuth\" class=\"text-gray-400 ml-auto\">已实名</text>\n <text v-else class=\"text-gray-400 ml-auto\">未实名</text>\n <wd-icon name=\"right\" size=\"16\" class=\"ml-2\"></wd-icon>\n </view>\n </view>\n\n <!-- 修改用户名的弹窗 -->\n <wd-popup v-model=\"showUserNamePopup\" position=\"center\" custom-style=\"padding: 20px;\">\n <view class=\"flex flex-col gap-3\">\n <view class=\"text-gray-800 mb-4\">修改用户名</view>\n <input v-model=\"newUserName\" type=\"text\" placeholder=\"请输入新的用户名\" />\n <view class=\"btn-group mt-4\">\n <button class=\"confirm-btn\" @click=\"updateUserName\">确认</button>\n <button class=\"cancel-btn\" @click=\"showUserNamePopup = false\">取消</button>\n </view>\n </view>\n </wd-popup>\n\n <!-- 退出登录按钮 -->\n <view class=\"card mb-4 p-4 bg-white rounded-lg shadow\">\n <button class=\"logout-button\" @click=\"logout\">退出登录</button>\n </view>\n </view>\n\n <LoadingAnimation v-model=\"loading\" />\n</template>\n\n<script setup lang=\"js\">\nimport { ref, computed } from 'vue'\nimport { useConfigStore } from '@/store/config'\nimport { useUserStore } from '@/store'\nimport { httpPost, httpGet } from '@/utils/http'\nimport LoadingAnimation from '@/components/LoadingAnimation.vue'\nimport { imgUrl, toast } from '@/utils/commUtils'\nimport { chooseImage } from '@/service/fileservice'\nimport { getUserInfo } from '@/service/userService'\n\nconst configStore = useConfigStore()\nconst userStore = useUserStore()\n\nconst languages = configStore.languages\nconst selectedLanguage = ref(languages['zh-Hans'])\n\nconst sinfo = ref({})\nconst showUserNamePopup = ref(false)\nconst newUserName = ref('')\n\nconst loading = ref(false)\n\nconst languageOptions = computed(() =>\n Object.entries(languages).map(([key, valu