index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <Theme>
  3. <view class="wrap">
  4. <Navbar title="设置" fixed border>
  5. <template #right>
  6. <navMenu :options="{ icon: 'icon-home', text: '主页' }" />
  7. </template>
  8. </Navbar>
  9. <view class="content">
  10. <view class="lists" v-for="(item, index) in lists" :key="index">
  11. <view
  12. class="_list"
  13. v-for="(val, num) in item"
  14. :key="num"
  15. @click="handleTo(val.url)"
  16. >
  17. <template v-if="index === 0 && num === 0">
  18. <view class="_list_left">
  19. <up-image
  20. :src="userInfo.userimg"
  21. shape="circle"
  22. width="120rpx"
  23. height="120rpx"
  24. >
  25. <template #error>
  26. <image
  27. class="userInfo_avatar"
  28. src="@/static/avatar.png"
  29. ></image>
  30. </template>
  31. </up-image>
  32. <view class="user_info">
  33. <view class="user_name"> {{ userInfo.realname }}</view>
  34. <view class="user_id">
  35. <trans _t="ID" />: {{ userInfo.newid }}
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <template v-else>
  41. <view class="_list_text">
  42. <trans :_t="val.text" />
  43. </view>
  44. </template>
  45. <i class="icon-font icon-left"></i>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="logout_btn-box">
  50. <DeleteAccount></DeleteAccount>
  51. </view>
  52. </view>
  53. <SimpleAgreementModal ref="agreementModal" />
  54. </Theme>
  55. </template>
  56. <script setup>
  57. import DeleteAccount from "./compoments/deleteAccount.vue";
  58. import Navbar from "@/components/navbar";
  59. import navMenu from "@/components/nav_menu";
  60. import { computed, ref } from "vue";
  61. import { useUserStore } from "@/store";
  62. import SimpleAgreementModal from "@/components/simpleAgreementModal";
  63. const useUser = useUserStore();
  64. const userInfo = computed(() => useUser.getuserInfo);
  65. const agreementModal = ref(null);
  66. const lists = [
  67. [
  68. {
  69. text: "用户信息",
  70. url: "/pages/user/edit_user",
  71. },
  72. {
  73. text: "收件地址",
  74. url: "/pages/address/index",
  75. },
  76. {
  77. text: "账户安全",
  78. url: "/pages/setting/account-safety",
  79. },{
  80. text: "语言/币种",
  81. url: "/pages/setting/language_currency",
  82. },
  83. {
  84. text: "关于vavabuy",
  85. url: "about",
  86. },
  87. {
  88. text: "隐私政策",
  89. url: "private",
  90. },
  91. {
  92. text: "服务条款",
  93. url: "agree",
  94. },
  95. ],
  96. ];
  97. const handleTo = (url) => {
  98. if (url.includes("/")) {
  99. uni.navigateTo({ url });
  100. } else {
  101. agreementModal.value && agreementModal.value.open(url);
  102. }
  103. };
  104. </script>
  105. <style lang="less" scoped>
  106. @import url("@/style.less");
  107. .wrap {
  108. background: var(--bg);
  109. min-height: 100vh;
  110. .content {
  111. .lists {
  112. background: var(--light);
  113. border-radius: 16rpx;
  114. margin: 24rpx;
  115. padding: 32rpx 12rpx 32rpx 24rpx;
  116. ._list {
  117. .flex_position(space-between);
  118. margin-top: 40rpx;
  119. ._list_left {
  120. .ver();
  121. .userInfo_avatar {
  122. width: 120rpx;
  123. height: 120rpx;
  124. }
  125. .user_info {
  126. .hor();
  127. flex-direction: column;
  128. margin-left: 24rpx;
  129. color: var(--text);
  130. .user_name {
  131. .size();
  132. font-weight: 700;
  133. line-height: 60rpx;
  134. }
  135. .user_id {
  136. .size(24rpx);
  137. line-height: 40rpx;
  138. }
  139. }
  140. }
  141. .icon-left {
  142. color: var(--text-01);
  143. transform: rotate(180deg);
  144. .size();
  145. }
  146. ._list_text {
  147. flex: 1;
  148. .size(28rpx);
  149. font-weight: 500;
  150. line-height: 60rpx;
  151. }
  152. }
  153. ._list:first-child {
  154. margin-top: 0;
  155. }
  156. }
  157. }
  158. }
  159. .logout_btn-box {
  160. /* position: fixed;
  161. bottom: 30rpx;
  162. left: 50%;
  163. transform: translateX(-50%);
  164. width: calc(100% - 60rpx);
  165. max-width: 1536rpx; */
  166. width: calc(100% - 60rpx);
  167. margin: auto;
  168. }
  169. </style>