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.0KB

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