index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view>
  3. <u-navbar leftIconSize="0" :placeholder="true" bgColor="#E96737">
  4. <view class="u-nav-slot" slot="left">
  5. <text>我的</text>
  6. </view>
  7. </u-navbar>
  8. <view class="user">
  9. <view class="user-ava">
  10. <view class="user-ava-img">
  11. <image :src="avatar" mode="aspectFill"></image>
  12. </view>
  13. <view class="user-ava-info">
  14. <view>{{ userInfo.nickName }}</view>
  15. <view>{{ userInfo.userName }}</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="account">
  20. <view class="flex account-action">
  21. <view>账户明细</view>
  22. <view class="flex account-action-icon" @click="toAccountDatail">
  23. <text>明细</text>
  24. <u-icon name="arrow-right" color="#E96737" size="16"></u-icon>
  25. </view>
  26. </view>
  27. <view class="flex account-info">
  28. <view class="account-info-amt">¥{{ $numberFormat(info.money) }}</view>
  29. <button type="default" @click="toWithdraw">提现</button>
  30. </view>
  31. <view class="account-details">
  32. <view class="account-details-item">
  33. <text>冻结金额:</text>
  34. <text>¥{{ $numberFormat(info.frozenMoney) }}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="action">
  39. <u-cell-group :border="false">
  40. <u-cell icon="coupon" title="我的地址" :isLink="true" :url="'/pages/address/index'"></u-cell>
  41. <u-cell icon="order" title="我的订单" :isLink="true" :border="false" :url="'/pages/order/index'"></u-cell>
  42. </u-cell-group>
  43. </view>
  44. <view class="cancel">
  45. <u-cell icon="close-circle" title="注销登录" :isLink="true" :border="false" @click="logout"></u-cell>
  46. </view>
  47. <custom-tab-bar :activeValue="'user'" />
  48. </view>
  49. </template>
  50. <script>
  51. import env from '../../config/env.js'
  52. import $http from '@/utils/request.js'
  53. import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
  54. export default {
  55. components: {
  56. CustomTabBar,
  57. },
  58. data() {
  59. return {
  60. userInfo: {},
  61. avatar: '',
  62. certifyStatus: {},
  63. info: {},
  64. };
  65. },
  66. onShow() {
  67. },
  68. methods: {
  69. toAccountDatail() {
  70. uni.navigateTo({
  71. url: '/pages/account/detail'
  72. })
  73. },
  74. toWithdraw() {
  75. uni.navigateTo({
  76. url: '/pages/account/withdraw'
  77. })
  78. },
  79. logout() {
  80. uni.showModal({
  81. title: '注销登录',
  82. content: '确定要注销登录吗?',
  83. success(res) {
  84. if (res.confirm) {
  85. uni.clearStorage({
  86. success: () => {
  87. wx.reLaunch({
  88. url: '/pages/login/entry',
  89. })
  90. }
  91. })
  92. }
  93. }
  94. })
  95. },
  96. },
  97. created() {
  98. this.userInfo = getApp().globalData.userInfo
  99. this.avatar = env.filePublic + getApp().globalData.userInfo.avatar
  100. console.log(getApp().globalData);
  101. },
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. /deep/ .u-cell__body {
  106. padding: 20rpx 0;
  107. }
  108. </style>
  109. <style lang="scss" scoped>
  110. .u-nav-slot text {
  111. color: #FFFFFF;
  112. font-size: 32rpx;
  113. }
  114. .user {
  115. display: flex;
  116. align-items: center;
  117. height: 340rpx;
  118. padding: 0 36rpx;
  119. background-color: $uni-bg-color;
  120. &-ava {
  121. display: flex;
  122. height: 144rpx;
  123. margin-top: -30rpx;
  124. &-img {
  125. width: 144rpx;
  126. height: 144rpx;
  127. border-radius: 150rpx;
  128. background-color: #FFF;
  129. border: 3rpx solid #FFF;
  130. margin-bottom: 32rpx;
  131. box-shadow: 0 0 24rpx #FFFFFF32;
  132. overflow: hidden;
  133. image {
  134. width: 144rpx;
  135. height: 144rpx;
  136. }
  137. }
  138. &-info {
  139. flex: 1;
  140. padding: 0 32rpx;
  141. color: #FFF;
  142. height: 144rpx;
  143. display: flex;
  144. flex-direction: column;
  145. justify-content: center;
  146. view:nth-child(1) {
  147. margin-bottom: 10rpx;
  148. }
  149. }
  150. }
  151. }
  152. .account {
  153. margin: 0 20rpx;
  154. padding: 30rpx;
  155. background-color: #FFFFFF;
  156. border-radius: 10rpx;
  157. margin-top: -60rpx;
  158. margin-bottom: 20rpx;
  159. &-action {
  160. justify-content: space-between;
  161. margin-bottom: 40rpx;
  162. &-icon {
  163. text {
  164. color: $uni-text-color;
  165. margin-right: 10rpx;
  166. font-size: 28rpx;
  167. }
  168. }
  169. }
  170. &-info {
  171. justify-content: space-between;
  172. margin-bottom: 30rpx;
  173. &-amt {
  174. font-size: 40rpx;
  175. font-weight: bold;
  176. }
  177. button {
  178. width: 144rpx;
  179. height: 48rpx;
  180. line-height: 48rpx;
  181. font-size: 28rpx;
  182. border-radius: 30rpx;
  183. background-color: rgba(235, 112, 9, 100);
  184. color: rgba(255, 255, 255, 100);
  185. margin: 0;
  186. }
  187. }
  188. &-details {
  189. display: flex;
  190. font-size: 28rpx;
  191. &-item {
  192. margin-right: 40rpx;
  193. }
  194. }
  195. }
  196. .action {
  197. margin: 0 20rpx;
  198. padding: 10rpx 20rpx;
  199. background-color: #FFFFFF;
  200. border-radius: 10rpx;
  201. margin-bottom: 40rpx;
  202. }
  203. .cancel {
  204. margin: 0 20rpx;
  205. padding: 10rpx 20rpx;
  206. background-color: #FFFFFF;
  207. border-radius: 10rpx;
  208. }
  209. </style>