index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="container">
  3. <view class="back-btn" @click="backToBefore()">
  4. <u-icon name="arrow-left" color="#fff" size="20" customStyle="margin:0 auto"></u-icon>
  5. <text class="back-text">切换账号</text>
  6. </view>
  7. <view class="account-content">
  8. <view class="account-item" @click="goToPage('/pages/mine/change-account/index')"
  9. v-for="(item,index) in accountList" :key="index">
  10. <view class="avatar">
  11. <image src="@/static/images/profile.jpg"></image>
  12. </view>
  13. <view class="account-item-content">{{item.name}}</view>
  14. <view v-if="item.active" class="account-item-active">
  15. <u-icon name="checkbox-mark" color="#fff" size="14"></u-icon>
  16. </view>
  17. <view v-else class="account-item-icon"></view>
  18. </view>
  19. <view class="account-item">
  20. <view class="add-account-icon">
  21. <u-icon name="plus" color="#D8D8D8" size="14" customStyle="margin:0 auto"></u-icon>
  22. </view>
  23. <view class="add-account-description">
  24. 添加或注册新账号
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script setup>
  31. import {
  32. ref
  33. } from "vue";
  34. function backToBefore() {
  35. uni.navigateBack({})
  36. };
  37. let accountList = ref([{
  38. name: '17788889999',
  39. active: true
  40. }, {
  41. name: '13344445555',
  42. active: false
  43. }])
  44. </script>
  45. <style lang="scss" scoped>
  46. page {
  47. height: 100%;
  48. background-color: #EAF0FA;
  49. }
  50. .container {
  51. position: relative;
  52. width: 100%;
  53. height: 100%;
  54. background: linear-gradient(180deg, #1869F6 0%, #EAF0FA 64%, #EAF0FA 100%);
  55. .back-btn {
  56. position: absolute;
  57. top: 8%;
  58. left: 4%;
  59. display: flex;
  60. font-size: 40rpx;
  61. font-weight: 500;
  62. color: #FFF;
  63. .back-text {
  64. margin-left: 28rpx;
  65. }
  66. }
  67. }
  68. .account-content {
  69. position: absolute;
  70. top: 226rpx;
  71. left: 4%;
  72. width: 92%;
  73. min-height: 120rpx;
  74. padding: 19rpx 28rpx;
  75. box-sizing: border-box;
  76. background-color: #fff;
  77. border-radius: 40rpx;
  78. }
  79. .account-item {
  80. display: flex;
  81. align-items: center;
  82. justify-content: space-between;
  83. width: 100%;
  84. height: 80rpx;
  85. font-size: 32rpx;
  86. font-weight: 400;
  87. color: #9E9E9E;
  88. .avatar {
  89. display: flex;
  90. flex-direction: column;
  91. justify-content: center;
  92. flex: 1;
  93. height: 100%;
  94. line-height: 80rpx;
  95. text-align: center;
  96. image {
  97. width: 52rpx;
  98. height: 52rpx;
  99. border-radius: 50%;
  100. }
  101. }
  102. .account-item-content {
  103. flex: 6;
  104. text-align: right;
  105. font-size: 32rpx;
  106. color: #343437;
  107. }
  108. .account-item-icon {
  109. width: 32rpx;
  110. height: 32rpx;
  111. margin-left: 20rpx;
  112. border-radius: 50%;
  113. border: 2rpx solid #343437;
  114. }
  115. .account-item-active {
  116. width: 30rpx;
  117. height: 30rpx;
  118. margin-left: 20rpx;
  119. border-radius: 50%;
  120. background: #1869F6;
  121. }
  122. .add-account-icon {
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: center;
  126. width: 52rpx;
  127. height: 52rpx;
  128. line-height: 80rpx;
  129. text-align: center;
  130. background-color: #EDF0F4;
  131. border-radius: 50%;
  132. }
  133. .add-account-description {
  134. text-align: right;
  135. font-size: 28rpx;
  136. }
  137. }
  138. </style>