center.vue 6.6 KB

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