Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

user.vue 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <navBar title="九州ETC" :scrollTop="scrollTop" :isBack="isBack"></navBar>
  3. <view class="wrapper">
  4. <image :src="`${$imgUrl}user/bg-user-2.png`" class="bg-head" mode="widthFix"></image>
  5. <!-- <view class="bar" :style="{ top: top, height: height, lineHeight: height }">我的-九州ETC</view> -->
  6. <view class="content" :style="{ top: margin + 'px' }">
  7. <view class="head" :style="{ marinTop: margin + 'px' }">
  8. <view class="avatar">
  9. <image :src="`${$imgUrl}user/icon-avatar.png`" :class="!state.data.opId ? 'unlogin' : ''"></image>
  10. <view v-if="!state.data.opId" class="name" @click="$util.navTo('/login/login')">
  11. <view class="nickname">登录/注册</view>
  12. </view>
  13. <view v-else class="name">
  14. <view class="nickname">林晨曦</view>
  15. <view class="user-id">
  16. <view class="phone">15885137270</view>
  17. <view @click="$util.navTo('/personal-center/setting/change-phone', true)"
  18. class="btn-change">已关联</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="setting" @click="$util.navTo('/personal-center/setting/setting', true)">
  23. <!-- <image :src="`${$imgUrl}user/icon-setting.png`"></image> -->
  24. <text>签到</text>
  25. </view>
  26. </view>
  27. <view class="panel-box">
  28. <view class="panel">
  29. <view class="panel-item">
  30. <view class="panel-text"><text class="num">2</text><text class="txt">辆</text></view>
  31. <text class="type">车辆</text>
  32. </view>
  33. <view class="panel-item">
  34. <text class="num">5</text>
  35. <text class="type">待办</text>
  36. </view>
  37. <view class="panel-item">
  38. <view class="panel-text"><text class="num">2</text><text class="txt">张</text></view>
  39. <text class="type">卡券</text>
  40. </view>
  41. <view class="panel-item">
  42. <view class="panel-text"><text class="num">2555</text><text class="txt">分</text></view>
  43. <text class="type">积分</text>
  44. </view>
  45. </view>
  46. <view class="notice">
  47. <image :src="`${$imgUrl}user/icon-tips.png`" class="icon-notice"></image>
  48. <view class="notice-content">您有一笔成功交易,点击查看详情</view>
  49. </view>
  50. </view>
  51. <view class="rights box">
  52. <view class="right-head">
  53. <view class="tit">我的权益</view>
  54. <view class="more">
  55. <text class="more-text">查看全部</text>
  56. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="rights box">
  61. <view class="right-head">
  62. <view class="tit">我的订单</view>
  63. <view class="more">
  64. <text class="more-text">查看全部</text>
  65. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="rights box">
  70. <view class="right-head">
  71. <view class="tit">本月通行</view>
  72. </view>
  73. </view>
  74. <view class="rights box">
  75. <view class="right-head">
  76. <view class="tit">我的车辆</view>
  77. <view class="more">
  78. <text class="more-text">查看全部</text>
  79. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="menu">
  84. <view class="item" @click="navTo('/personal-center/setting/bank-card/bank-card', true)">
  85. <view class="item-tit">
  86. <image :src="`${$imgUrl}user/icon-setting.png`" class="icon icon-2"></image>
  87. <text>设置与资料管理</text>
  88. </view>
  89. <view class="right-arrow">
  90. <view class="sub-tit">隐私、密码管理</view>
  91. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script lang="ts" setup>
  99. import { reactive } from "vue";
  100. import { msg, navTo } from "@/utils/utils";
  101. import { onMounted, ref } from "vue";
  102. import { getItem, StorageKeys } from "@/utils/storage";
  103. import navBar from "../../components/nav-bar/nav-bar2.vue";
  104. import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
  105. const height = ref(null);
  106. const top = ref(null);
  107. const margin = ref(null);
  108. const mobile = ref(null);
  109. const scrollTop = ref(0);
  110. const isBack = ref(false);
  111. const state = reactive({
  112. data: {
  113. opId: "",
  114. },
  115. });
  116. onMounted(() => {
  117. const res = uni.getMenuButtonBoundingClientRect();
  118. height.value = res.height + "px";
  119. top.value = res.top + "px";
  120. margin.value = res.height + res.top;
  121. });
  122. onLoad((option : any) => {
  123. state.data.opId = getItem(StorageKeys.OpenId);
  124. mobile.value = getItem("mobile");
  125. });
  126. //监听页面滚动
  127. onPageScroll((e) => {
  128. scrollTop.value = e.scrollTop;
  129. });
  130. onShow((option : any) => {
  131. state.data.opId = getItem(StorageKeys.OpenId);
  132. });
  133. </script>
  134. <style>
  135. page {
  136. background: #eef7f7;
  137. }
  138. </style>
  139. <style scoped>
  140. .unlogin {
  141. filter: grayscale(100%);
  142. opacity: 0.7;
  143. }
  144. .wrapper {
  145. position: relative;
  146. background: #fff;
  147. }
  148. .bar {
  149. width: 100%;
  150. position: fixed;
  151. text-align: center;
  152. font-size: 32rpx;
  153. font-weight: bold;
  154. }
  155. .bg-head {
  156. width: 100%;
  157. position: absolute;
  158. z-index: -99;
  159. top: 0;
  160. left: 0;
  161. }
  162. .content {
  163. position: absolute;
  164. display: flex;
  165. flex-direction: column;
  166. width: 100%;
  167. }
  168. .head {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. width: 100%;
  173. box-sizing: border-box;
  174. padding: 40rpx 0 46rpx;
  175. }
  176. .head .avatar {
  177. display: flex;
  178. align-items: center;
  179. }
  180. .head .avatar image {
  181. width: 120rpx;
  182. height: 120rpx;
  183. border-radius: 80rpx;
  184. border: 12rpx solid rgba(255, 255, 255, 0.5);
  185. margin: 0 20rpx 0 30rpx;
  186. }
  187. .head .setting {
  188. display: flex;
  189. align-items: center;
  190. background: rgba(0, 179, 139, .1);
  191. border:1px solid #fff;
  192. height: 60rpx;
  193. border-radius: 30rpx;
  194. padding: 0 34rpx;
  195. color: #fff;
  196. font-size: 28rpx;
  197. margin-right: 30rpx;
  198. }
  199. .head .setting image {
  200. width: 40rpx;
  201. height: 40rpx;
  202. margin-right: 6rpx;
  203. }
  204. .head .nickname {
  205. font-size: 36rpx;
  206. color: #000000;
  207. }
  208. .head .user-id {
  209. font-size: 26rpx;
  210. color: #000000;
  211. padding-top: 30rpx;
  212. display: flex;
  213. align-items: center;
  214. }
  215. .head .btn-change {
  216. font-size: 22rpx;
  217. height: 40rpx;
  218. padding: 0 20rpx;
  219. border: 1px solid #fff;
  220. color:#fff;
  221. box-sizing: border-box;
  222. border-radius: 20rpx;
  223. margin-left: 16rpx;
  224. background: rgba(0, 179, 139, .1);
  225. }
  226. .panel-box {
  227. display: flex;
  228. flex-direction: column;
  229. background: #fff;
  230. margin: 0 30rpx 30rpx;
  231. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  232. border-radius: 20rpx;
  233. padding: 30rpx 0;
  234. }
  235. .panel {
  236. display: flex;
  237. justify-content: space-evenly;
  238. padding: 30rpx 0;
  239. }
  240. .panel-item {
  241. display: flex;
  242. flex-direction: column;
  243. justify-content: center;
  244. align-items: center;
  245. font-size: 32rpx;
  246. }
  247. .panel-item .num {
  248. font-weight: bold;
  249. color: #454545;
  250. }
  251. .panel-item .txt {
  252. font-size: 26rpx;
  253. }
  254. .panel-item .type {
  255. color: #999;
  256. font-size: 26rpx;
  257. padding: 14rpx 0;
  258. }
  259. .panel-box .icon-notice {
  260. width: 48rpx;
  261. height: 48rpx;
  262. }
  263. .panel-box .notice {
  264. display: flex;
  265. font-size: 32rpx;
  266. margin: 0 30rpx;
  267. align-items: center;
  268. background: #f3f3f3;
  269. border-radius: 10rpx;
  270. padding: 0 14rpx;
  271. }
  272. .panel-box .notice .notice-content {
  273. height: 68rpx;
  274. line-height: 68rpx;
  275. padding: 0 12rpx;
  276. font-size: 28rpx;
  277. }
  278. .box .arrow {
  279. width: 18rpx;
  280. height: 32rpx;
  281. }
  282. .box {
  283. background: #ffffff;
  284. margin: 0 30rpx 30rpx;
  285. padding: 30rpx;
  286. border-radius: 20rpx;
  287. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223,223,223,0.8);
  288. }
  289. .box .more {
  290. display: flex;
  291. font-size: 30rpx;
  292. color: #808080;
  293. align-items: center;
  294. }
  295. .box .more .more-text {
  296. padding-right: 20rpx;
  297. }
  298. .box .right-head {
  299. display: flex;
  300. justify-content: space-between;
  301. }
  302. .box .right-head .tit {
  303. font-size: 32rpx;
  304. /* font-weight: bold; */
  305. }
  306. .menu {
  307. background: #ffffff;
  308. /* border-radius: 30rpx 30rpx 0 0; */
  309. padding: 0 30rpx;
  310. margin: 0 30rpx 30rpx;
  311. border-radius: 20rpx;
  312. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223,223,223,0.8);
  313. }
  314. .menu .arrow {
  315. width: 18rpx;
  316. height: 32rpx;
  317. }
  318. .menu .icon {
  319. width: 48rpx;
  320. height: 48rpx;
  321. margin-right: 10rpx;
  322. }
  323. .menu .item {
  324. display: flex;
  325. justify-content: space-between;
  326. align-items: center;
  327. /* border-bottom: 1px solid #dcdcdc; */
  328. padding: 20rpx 0;
  329. }
  330. .menu .item:first-child {
  331. margin-top: 10rpx;
  332. }
  333. .menu .item-tit {
  334. display: flex;
  335. align-items: center;
  336. font-size: 30rpx;
  337. color: #333;
  338. }
  339. .menu .right-arrow {
  340. font-size: 26rpx;
  341. color: #ccc;
  342. display: flex;
  343. justify-content: center;
  344. align-items: center;
  345. }
  346. .menu .sub-tit {
  347. padding-right: 20rpx;
  348. }
  349. .amount {
  350. display: flex;
  351. justify-content: space-between;
  352. align-items: center;
  353. }
  354. .amount .cny {
  355. font-size: 28rpx;
  356. }
  357. .amount .value {
  358. font-size: 32rpx;
  359. color: #333;
  360. padding-right: 24rpx;
  361. }
  362. </style>