艺易修小程序24.08.21
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

210 lines
3.8 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <view class="">
  3. <uni-nav-bar dark :fixed="true" background-color="#00aaff" :border="false" status-bar title="个人中心" />
  4. <view class="content">
  5. <view class="topBox">
  6. <view class="users">
  7. <view class="u-top" v-if="userInfo.id">
  8. <image class="img"
  9. :src="userInfo.headImage || '/static/center/logo.png'"
  10. mode="widthFix"></image>
  11. <view class="tit">
  12. {{ userInfo.name || '文韵飞扬' }}
  13. </view>
  14. </view>
  15. <!-- <view class="u-top" v-else>
  16. <image class="img"
  17. src="https://tennis-oss.xzaiyp.top/2024-09-03/05f052bb-2c66-4886-8ad0-09703269690d.jpg"
  18. mode="widthFix"></image>
  19. <view class="tit">
  20. 登录 / 注册
  21. </view>
  22. </view> -->
  23. </view>
  24. </view>
  25. <view class="lists">
  26. <uni-list>
  27. <uni-list-item v-if="userInfo.isDai == '0'" :show-extra-icon="true" :extra-icon="extraIcon1"
  28. showArrow title="我的报修" clickable @click="clickList" />
  29. <uni-list-item v-if="userInfo.isDai == '1'" :show-extra-icon="true" :extra-icon="extraIcon2" showArrow title="我的维修单" clickable
  30. @click="toOrder" />
  31. <uni-list-item :show-extra-icon="true" :extra-icon="extraIcon3" showArrow title="退出登录" clickable
  32. @click="logout" />
  33. </uni-list>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. mapState,
  41. } from 'vuex'
  42. export default {
  43. name: 'Center',
  44. computed: {
  45. ...mapState(['userInfo']),
  46. },
  47. data() {
  48. return {
  49. queryParams: {
  50. pageNo: 1,
  51. pageSize: 10
  52. },
  53. orderList: [],
  54. extraIcon1: {
  55. color: '#666666',
  56. size: '22',
  57. type: 'auth'
  58. },
  59. extraIcon2: {
  60. color: '#666666',
  61. size: '22',
  62. type: 'info'
  63. },
  64. extraIcon3: {
  65. color: '#666666',
  66. size: '22',
  67. type: 'closeempty'
  68. }
  69. }
  70. },
  71. onShow() {
  72. //用户没有登录
  73. if (!this.userInfo.id) {
  74. this.logout()
  75. }
  76. },
  77. methods: {
  78. clickList() {
  79. uni.navigateTo({
  80. url: '/pages/repairList/repairList'
  81. })
  82. },
  83. //退出登录
  84. logout() {
  85. uni.reLaunch({
  86. url: '/pages/login/studentLogin'
  87. })
  88. uni.removeStorageSync('token');
  89. uni.removeStorageSync('userInfo');
  90. this.$store.commit('setUserInfo', {})
  91. },
  92. //跳转指派给我的维修单
  93. toOrder() {
  94. uni.navigateTo({
  95. url: '/pages/order/order'
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style scoped>
  102. .content {
  103. background: #F1F5F8;
  104. min-height: 100vh;
  105. }
  106. /* 弧形背景 */
  107. .topBox {
  108. width: 100%;
  109. position: relative;
  110. z-index: 1;
  111. overflow: hidden;
  112. padding: 20rpx 20rpx 20rpx;
  113. box-sizing: border-box;
  114. }
  115. .topBox::after {
  116. content: "";
  117. width: 140%;
  118. height: 100px;
  119. position: absolute;
  120. left: -20%;
  121. top: 0;
  122. z-index: -1;
  123. border-radius: 0 0 30% 50%;
  124. /* background: #00aaff; */
  125. }
  126. .txt {
  127. color: #fff;
  128. font-size: 30rpx;
  129. }
  130. .set-right .uni-icons {
  131. margin-right: 10rpx;
  132. }
  133. .users {
  134. display: flex;
  135. align-items: center;
  136. margin-top: 0rpx;
  137. padding: 0rpx 30rpx;
  138. box-sizing: border-box;
  139. height: 200rpx;
  140. background-color: #fff;
  141. box-shadow: 1px 10rpx 20rpx #ececec;
  142. border-radius: 12rpx;
  143. }
  144. .u-top {
  145. display: flex;
  146. justify-content: flex-start;
  147. align-items: center;
  148. }
  149. .users .u-top .img {
  150. width: 130rpx;
  151. height: 130rpx;
  152. border-radius: 50%;
  153. margin-right: 20rpx;
  154. }
  155. .u-top .tit {
  156. font-size: 30rpx;
  157. font-weight: 700;
  158. color: #333;
  159. }
  160. .u-item {
  161. text-align: center;
  162. }
  163. .u-item .u-tit {
  164. color: #757575;
  165. font-size: 26rpx;
  166. margin-top: 10rpx;
  167. }
  168. .u-item .num {
  169. color: #000000;
  170. font-size: 33rpx;
  171. font-weight: 700;
  172. }
  173. .bottomBox {
  174. padding: 20rpx;
  175. box-sizing: border-box;
  176. }
  177. .listBox {
  178. margin: -10rpx auto 0;
  179. padding: 20rpx;
  180. box-sizing: border-box;
  181. border-radius: 20rpx;
  182. }
  183. .lists {
  184. width: calc(100% - 40rpx);
  185. box-sizing: border-box;
  186. margin: 20rpx auto;
  187. border-radius: 20rpx;
  188. overflow: hidden;
  189. }
  190. </style>