center.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. <tabbar ></tabbar>
  57. </view>
  58. </template>
  59. <script>
  60. import * as API from '@/apis/pagejs/index.js'
  61. import componentLogin from '@/components/componentLogin.vue';
  62. import tabbar from '@/components/Tabbar.vue';
  63. export default {
  64. components: {
  65. componentLogin,tabbar
  66. },
  67. data() {
  68. return {
  69. isReady:false,
  70. userInfo:{},
  71. userInfoPlus:{
  72. whiteList:[],
  73. myAllList:[]
  74. },
  75. whiteNum:0,
  76. }
  77. },
  78. onLoad() {
  79. this.userInfo = this.jphelp.getPersonInfo()
  80. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  81. },
  82. onReady() {
  83. this.$refs.refLogin.findByOpenId()
  84. },
  85. onShow() {
  86. if(this.$refs.refLogin){
  87. this.$refs.refLogin.findByOpenId()
  88. }
  89. this.userInfo = this.jphelp.getPersonInfo()
  90. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  91. if(this.isReady){
  92. //this.getWhiteFloorlockList()
  93. }
  94. },
  95. methods: {
  96. gotoInformation(){
  97. if(this.jphelp.getPersonInfo().id){
  98. this.gotoUrl('pages/information/information',1)
  99. }else{
  100. this.$refs.refLogin.ashow()
  101. }
  102. },
  103. getWhiteFloorlockList(){
  104. uni.showLoading({
  105. title: "加载中",
  106. mask: true,
  107. })
  108. var obj={
  109. }
  110. API.whiteFloorlockList().then((res) => {
  111. this.whiteNum=res.data.recordsTotal
  112. uni.hideLoading();
  113. }).catch(error => {
  114. uni.hideLoading();
  115. uni.showToast({
  116. title: error,
  117. icon: "none"
  118. })
  119. })
  120. },
  121. findByOpenId(res){
  122. this.userInfo = this.jphelp.getPersonInfo()
  123. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  124. this.isReady=true;
  125. this.getWhiteFloorlockList()
  126. }
  127. }
  128. }
  129. </script>
  130. <style>
  131. page {
  132. background-color: rgba(242, 244, 246, 1);
  133. }
  134. </style>
  135. <style scoped lang="scss">
  136. /* styles.css */
  137. .body {
  138. padding: 32rpx;
  139. }
  140. .gradient-header {
  141. height: 0px;
  142. }
  143. .jpback {
  144. height: 268rpx;
  145. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 20%, rgba(121, 177, 255, 1) 100%);
  146. }
  147. .page-top {
  148. color: #fff;
  149. display: flex;
  150. justify-content: space-between;
  151. margin: 48rpx 0;
  152. .name {
  153. display: flex;
  154. align-items: flex-end;
  155. .photo {
  156. border-radius: 50px;
  157. background-color: rgba(229, 229, 229, 1);
  158. height: 100rpx;
  159. width: 100rpx;
  160. overflow: hidden;
  161. .img {
  162. width: 100%;
  163. height: 100%;
  164. }
  165. }
  166. .text {
  167. margin-left: 24rpx;
  168. .text1 {
  169. font-weight: bold;
  170. font-size: 40rpx;
  171. }
  172. .text2 {
  173. font-size: 32rpx;
  174. }
  175. }
  176. }
  177. .value {
  178. margin-top: 24rpx;
  179. font-size: 40rpx;
  180. font-weight: bold;
  181. color: #333333;
  182. }
  183. }
  184. .page {
  185. border-radius: 16rpx;
  186. background-color: rgba(255, 255, 255, 1);
  187. color: rgba(16, 16, 16, 1);
  188. padding:0 32rpx;
  189. margin-bottom: 32rpx;
  190. font-size: 32rpx;
  191. color: rgb(16, 16, 16);
  192. .page-main {
  193. display: flex;
  194. justify-content: space-around;
  195. align-items: center;
  196. padding:24rpx;
  197. .item {
  198. .name {
  199. font-size: 56rpx;
  200. color: #333333;
  201. font-weight: bold;
  202. }
  203. .value {
  204. color: rgba(146, 146, 176, 1);
  205. font-size: 32rpx;
  206. }
  207. display: flex;
  208. flex-direction: column;
  209. align-items: center;
  210. }
  211. .item2 {
  212. border-right: 1px solid rgba(187, 187, 187, 0.43);
  213. height: 70rpx;
  214. }
  215. }
  216. .page-content {
  217. .item:not(:last-child) {
  218. border-bottom:1px solid rgba(232,232,232,1);
  219. }
  220. .item {
  221. padding: 32rpx 0;
  222. display: flex;
  223. justify-content: space-between;
  224. align-items: center;
  225. .title {
  226. display: flex;
  227. justify-content: space-between;
  228. display: flex;
  229. align-items: center;
  230. color: rgba(51,51,51,1);
  231. .img {
  232. width: 32rpx;
  233. height: 32rpx;
  234. margin-right: 16rpx;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. </style>