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 - back.vue 8.0KB

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