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.

user - back.vue 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <view class="wrapper">
  3. <image
  4. :src="`${$imgUrl}user/bg-user.png`"
  5. class="bg-head"
  6. mode="widthFix"
  7. ></image>
  8. <view class="bar" :style="{ top: top, height: height, lineHeight: height }"
  9. >九州ETC</view
  10. >
  11. <view class="content" :style="{ top: margin + 'px' }">
  12. <view class="head" :style="{ marinTop: margin + 'px' }">
  13. <view class="avatar">
  14. <image
  15. :src="`${$imgUrl}user/icon-avatar.png`"
  16. :class="!state.data.opId ? 'unlogin' : ''"
  17. ></image>
  18. <view
  19. v-if="!state.data.opId"
  20. class="name"
  21. @click="$util.navTo('/login/login')"
  22. >
  23. <view class="nickname">登录/注册</view>
  24. </view>
  25. <view v-else class="name">
  26. <!-- <view class="nickname">林晨曦</view> -->
  27. <view class="user-id">
  28. <view class="phone">{{ mobile }}</view>
  29. <view
  30. @click="
  31. $util.navTo('/personal-center/setting/change-phone', true)
  32. "
  33. class="btn-change" style="display: none;"
  34. >
  35. 更换</view
  36. >
  37. </view>
  38. </view>
  39. </view>
  40. <view
  41. class="setting"
  42. @click="$util.navTo('/personal-center/setting/setting', true)"
  43. >
  44. <image :src="`${$imgUrl}user/icon-setting.png`"></image>
  45. <text>设置</text>
  46. </view>
  47. </view>
  48. <view class="menu">
  49. <view class="item" style="display: none">
  50. <view class="item-tit">
  51. <image
  52. :src="`${$imgUrl}user/icon-cny.png`"
  53. class="icon icon-1"
  54. ></image>
  55. <text>账户余额</text>
  56. </view>
  57. <view class="amount">
  58. <text class="cny">¥</text>
  59. <text class="value">0.00</text>
  60. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  61. </view>
  62. </view>
  63. <view
  64. class="item"
  65. @click="navTo('/personal-center/change-password', true)"
  66. >
  67. <view class="item-tit">
  68. <image
  69. :src="`${$imgUrl}user/icon-lock.png`"
  70. class="icon icon-1"
  71. ></image>
  72. <text>修改密码</text>
  73. </view>
  74. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  75. </view>
  76. <view
  77. class="item"
  78. @click="navTo('/personal-center/progress-query/my-etc', true)"
  79. style="display: none"
  80. >
  81. <view class="item-tit">
  82. <image
  83. :src="`${$imgUrl}user/icon-ETC.png`"
  84. class="icon icon-2"
  85. ></image>
  86. <text>我的ETC</text>
  87. </view>
  88. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  89. </view>
  90. <view
  91. class="item"
  92. @click="
  93. navTo(
  94. '/personal-center/setting/personal-information/corrections',
  95. true
  96. )
  97. "
  98. >
  99. <view class="item-tit">
  100. <image
  101. :src="`${$imgUrl}user/icon-user.png`"
  102. class="icon icon-2"
  103. ></image>
  104. <text>用户信息管理</text>
  105. </view>
  106. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  107. </view>
  108. <view
  109. class="item"
  110. @click="
  111. navTo('/personal-center/setting/car-information/corrections', true)
  112. "
  113. >
  114. <view class="item-tit">
  115. <image
  116. :src="`${$imgUrl}user/icon-car.png`"
  117. class="icon icon-2"
  118. ></image>
  119. <text>车辆信息管理</text>
  120. </view>
  121. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  122. </view>
  123. <view
  124. class="item"
  125. @click="navTo('/personal-center/setting/addressManager', true)"
  126. >
  127. <view class="item-tit">
  128. <image
  129. :src="`${$imgUrl}user/icon-address.png`"
  130. class="icon icon-2"
  131. ></image>
  132. <text>收货地址管理</text>
  133. </view>
  134. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  135. </view>
  136. <view
  137. class="item"
  138. @click="navTo('/personal-center/setting/bank-card/bank-card', true)"
  139. style="display: none"
  140. >
  141. <view class="item-tit">
  142. <image
  143. :src="`${$imgUrl}user/icon-card.png`"
  144. class="icon icon-2"
  145. ></image>
  146. <text>绑定银行卡</text>
  147. </view>
  148. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </template>
  154. <script lang="ts" setup>
  155. import { reactive } from "vue";
  156. import { msg, navTo } from "@/utils/utils";
  157. import { onMounted, ref } from "vue";
  158. import { getItem, StorageKeys } from "@/utils/storage";
  159. import { onLoad, onShow } from "@dcloudio/uni-app";
  160. const height = ref(null);
  161. const top = ref(null);
  162. const margin = ref(null);
  163. const mobile = ref(null);
  164. const state = reactive({
  165. data: {
  166. opId: "",
  167. },
  168. });
  169. onMounted(() => {
  170. const res = uni.getMenuButtonBoundingClientRect();
  171. height.value = res.height + "px";
  172. top.value = res.top + "px";
  173. margin.value = res.height + res.top;
  174. });
  175. onLoad((option: any) => {
  176. state.data.opId = getItem(StorageKeys.OpenId);
  177. mobile.value = getItem("mobile");
  178. });
  179. onShow((option: any) => {
  180. state.data.opId = getItem(StorageKeys.OpenId);
  181. });
  182. </script>
  183. <style scoped>
  184. .unlogin {
  185. filter: grayscale(100%);
  186. opacity: 0.7;
  187. }
  188. page {
  189. background: #ffffff;
  190. }
  191. .wrapper {
  192. position: relative;
  193. background: #fff;
  194. }
  195. .bar {
  196. width: 100%;
  197. position: fixed;
  198. text-align: center;
  199. font-size: 32rpx;
  200. font-weight: bold;
  201. }
  202. .bg-head {
  203. width: 100%;
  204. position: absolute;
  205. z-index: -99;
  206. top: 0;
  207. left: 0;
  208. }
  209. .content {
  210. position: absolute;
  211. display: flex;
  212. flex-direction: column;
  213. width: 100%;
  214. }
  215. .head {
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. width: 100%;
  220. box-sizing: border-box;
  221. padding: 40rpx 0 46rpx;
  222. }
  223. .head .avatar {
  224. display: flex;
  225. align-items: center;
  226. }
  227. .head .avatar image {
  228. width: 120rpx;
  229. height: 120rpx;
  230. border-radius: 80rpx;
  231. border: 12rpx solid rgba(255, 255, 255, 0.5);
  232. margin: 0 20rpx 0 30rpx;
  233. }
  234. .head .setting {
  235. display: flex;
  236. align-items: center;
  237. background: rgba(255, 255, 255, 0.7);
  238. height: 60rpx;
  239. border-radius: 30rpx 0 0 30rpx;
  240. padding: 0 30rpx 0 20rpx;
  241. color: #00b38b;
  242. }
  243. .head .setting image {
  244. width: 40rpx;
  245. height: 40rpx;
  246. margin-right: 6rpx;
  247. }
  248. .head .nickname {
  249. font-size: 42rpx;
  250. color: #ffffff;
  251. }
  252. .head .user-id {
  253. font-size: 26rpx;
  254. color: #ffffff;
  255. padding-top: 30rpx;
  256. display: flex;
  257. align-items: center;
  258. }
  259. .head .btn-change {
  260. font-size: 22rpx;
  261. height: 40rpx;
  262. padding: 0 20rpx;
  263. border: 1px solid #fff;
  264. box-sizing: border-box;
  265. border-radius: 20rpx;
  266. margin-left: 16rpx;
  267. }
  268. .menu {
  269. background: #ffffff;
  270. border-radius: 30rpx 30rpx 0 0;
  271. padding: 0 30rpx;
  272. }
  273. .menu .arrow {
  274. width: 18rpx;
  275. height: 32rpx;
  276. }
  277. .menu .icon {
  278. width: 48rpx;
  279. height: 48rpx;
  280. margin-right: 20rpx;
  281. }
  282. .menu .item {
  283. display: flex;
  284. justify-content: space-between;
  285. align-items: center;
  286. border-bottom: 1px solid #dcdcdc;
  287. padding: 20rpx 0;
  288. }
  289. .menu .item:first-child {
  290. margin-top: 10rpx;
  291. }
  292. .menu .item-tit {
  293. display: flex;
  294. align-items: center;
  295. font-size: 28rpx;
  296. color: #333;
  297. }
  298. .amount {
  299. display: flex;
  300. justify-content: space-between;
  301. align-items: center;
  302. }
  303. .amount .cny {
  304. font-size: 28rpx;
  305. }
  306. .amount .value {
  307. font-size: 32rpx;
  308. color: #333;
  309. padding-right: 24rpx;
  310. }
  311. </style>