center.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="jpmain ">
  3. <componentLogin ref="refLogin" :check="0" @findByOpenId="findByOpenId"></componentLogin>
  4. <view class="gradient-header">
  5. <view class="jpback">
  6. </view>
  7. </view>
  8. <view class="body">
  9. <view class="page-top" @click="gotoInformation" >
  10. <view class="name">
  11. <view class="photo">
  12. <img class="img" :src="userInfo.headImg" v-if="userInfo.headImg" alt="">
  13. </view>
  14. <view class="text">
  15. <view class="text1">{{userInfo.id?userInfo.nickName:'未登录'}}</view>
  16. <view class="text2">{{userInfo.id?userInfo.phone:'点击登录'}}</view>
  17. </view>
  18. </view>
  19. <view class="value">
  20. <u-icon name="arrow-right" size="24" color="#fff"></u-icon>
  21. </view>
  22. </view>
  23. <view class="page">
  24. <view class="page-content">
  25. <view class="item" @click="gotoUrl('pages/mylock/myLock',1)" >
  26. <view class="title">
  27. <img class="img" src="@/assets/img/center/icon1.svg" alt="">
  28. 我的地锁
  29. </view>
  30. <view class="goto">
  31. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  32. </view>
  33. </view>
  34. <view class="item"
  35. @click="gotoUrl('pages/information/parkingRecord',1)" >
  36. <view class="title">
  37. <img class="img" src="@/assets/img/center/icon2.svg" alt="">
  38. 停车记录
  39. </view>
  40. <view class="goto">
  41. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  42. </view>
  43. </view>
  44. <view class="item" v-if="0">
  45. <view class="title">
  46. <img class="img" src="@/assets/img/center/icon1.svg" alt="">
  47. 我的地锁
  48. </view>
  49. <view class="goto">
  50. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import * as API from '@/apis/pagejs/index.js'
  60. import componentLogin from '@/components/componentLogin.vue';
  61. export default {
  62. components: {
  63. componentLogin,
  64. },
  65. data() {
  66. return {
  67. isReady:false,
  68. userInfo:{},
  69. userInfoPlus:{
  70. whiteList:[],
  71. myAllList:[]
  72. },
  73. whiteNum:0,
  74. }
  75. },
  76. onLoad() {
  77. this.userInfo = this.jphelp.getPersonInfo()
  78. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  79. },
  80. onReady() {
  81. this.$refs.refLogin.findByOpenId()
  82. },
  83. onShow() {
  84. if(this.$refs.refLogin){
  85. this.$refs.refLogin.findByOpenId()
  86. }
  87. this.userInfo = this.jphelp.getPersonInfo()
  88. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  89. if(this.isReady){
  90. this.getWhiteFloorlockList()
  91. }
  92. },
  93. methods: {
  94. gotoInformation(){
  95. if(this.jphelp.getPersonInfo().id){
  96. this.gotoUrl('pages/information/information',1)
  97. }else{
  98. this.$refs.refLogin.ashow()
  99. }
  100. },
  101. getWhiteFloorlockList(){
  102. uni.showLoading({
  103. title: "加载中",
  104. mask: true,
  105. })
  106. var obj={
  107. }
  108. API.whiteFloorlockList().then((res) => {
  109. this.whiteNum=res.data.recordsTotal
  110. uni.hideLoading();
  111. }).catch(error => {
  112. uni.hideLoading();
  113. uni.showToast({
  114. title: error,
  115. icon: "none"
  116. })
  117. })
  118. },
  119. findByOpenId(res){
  120. this.userInfo = this.jphelp.getPersonInfo()
  121. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  122. this.isReady=true;
  123. this.getWhiteFloorlockList()
  124. }
  125. }
  126. }
  127. </script>
  128. <style>
  129. page {
  130. background-color: rgba(242, 244, 246, 1);
  131. }
  132. </style>
  133. <style scoped lang="scss">
  134. /* styles.css */
  135. .body {
  136. padding: 32rpx;
  137. }
  138. .gradient-header {
  139. height: 0px;
  140. }
  141. .jpback {
  142. height: 268rpx;
  143. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 20%, rgba(121, 177, 255, 1) 100%);
  144. }
  145. .page-top {
  146. color: #fff;
  147. display: flex;
  148. justify-content: space-between;
  149. margin: 48rpx 0;
  150. .name {
  151. display: flex;
  152. align-items: flex-end;
  153. .photo {
  154. border-radius: 50px;
  155. background-color: rgba(229, 229, 229, 1);
  156. height: 100rpx;
  157. width: 100rpx;
  158. overflow: hidden;
  159. .img {
  160. width: 100%;
  161. height: 100%;
  162. }
  163. }
  164. .text {
  165. margin-left: 24rpx;
  166. .text1 {
  167. font-weight: bold;
  168. font-size: 40rpx;
  169. }
  170. .text2 {
  171. font-size: 32rpx;
  172. }
  173. }
  174. }
  175. .value {
  176. margin-top: 24rpx;
  177. font-size: 40rpx;
  178. font-weight: bold;
  179. color: #333333;
  180. }
  181. }
  182. .page {
  183. border-radius: 16rpx;
  184. background-color: rgba(255, 255, 255, 1);
  185. color: rgba(16, 16, 16, 1);
  186. padding:0 32rpx;
  187. margin-bottom: 32rpx;
  188. font-size: 32rpx;
  189. color: rgb(16, 16, 16);
  190. .page-main {
  191. display: flex;
  192. justify-content: space-around;
  193. align-items: center;
  194. padding:24rpx;
  195. .item {
  196. .name {
  197. font-size: 56rpx;
  198. color: #333333;
  199. font-weight: bold;
  200. }
  201. .value {
  202. color: rgba(146, 146, 176, 1);
  203. font-size: 32rpx;
  204. }
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. }
  209. .item2 {
  210. border-right: 1px solid rgba(187, 187, 187, 0.43);
  211. height: 70rpx;
  212. }
  213. }
  214. .page-content {
  215. .item:not(:last-child) {
  216. border-bottom:1px solid rgba(232,232,232,1);
  217. }
  218. .item {
  219. padding: 32rpx 0;
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. .title {
  224. display: flex;
  225. justify-content: space-between;
  226. display: flex;
  227. align-items: center;
  228. color: rgba(51,51,51,1);
  229. .img {
  230. width: 32rpx;
  231. height: 32rpx;
  232. margin-right: 16rpx;
  233. }
  234. }
  235. }
  236. }
  237. }
  238. </style>