艺易修小程序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.

209 lines
3.8 KiB

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