consumer.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <p class="z">{{list.stock*1}}</p>
  5. <p class="c">我的资产</p>
  6. <view class="left">
  7. <div></div>
  8. <p>*资产市值:{{list.stock*list.stock_price}}</p>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {getUserInfo} from '@/api/user.js'
  15. export default {
  16. data() {
  17. return {
  18. list: {
  19. stock:0,
  20. stock_price:0,
  21. }
  22. };
  23. },
  24. onShow() {
  25. this.getUserInfo()
  26. },
  27. methods: {
  28. async getUserInfo() {
  29. const res = await getUserInfo()
  30. console.log('123', res)
  31. this.list = res.data
  32. }
  33. },
  34. };
  35. </script>
  36. <style lang="scss">
  37. .box{
  38. margin-top: 162rpx;
  39. margin-left: 30rpx;
  40. background-image: url("../../static/img/tjr.png");
  41. width: 690rpx;
  42. height: 315rpx;
  43. border-radius: 20rpx;
  44. overflow: hidden;
  45. }
  46. .z{
  47. margin-top: 99rpx;
  48. margin-left: 283rpx;
  49. height: 40rpx;
  50. font-size: 53rpx;
  51. font-family: PingFang SC;
  52. font-weight: bold;
  53. color: #6E4019;
  54. line-height: 40rpx;
  55. }
  56. .c {
  57. margin-top: 25rpx;
  58. margin-left: 293rpx;
  59. height: 25rpx;
  60. font-size: 26rpx;
  61. font-family: PingFang SC;
  62. font-weight: 500;
  63. color: #6E4019;
  64. line-height: 40rpx;
  65. }
  66. div {
  67. margin-top: 63rpx;
  68. margin-left: 43rpx;
  69. border-bottom: 1px solid #E3C5A8;
  70. width: 604rpx;
  71. }
  72. p{
  73. margin-left: 56rpx;
  74. // margin-bottom: 22rpx;
  75. margin-top: 16rpx;
  76. height: 25rpx;
  77. font-size: 26rpx;
  78. font-family: PingFang SC;
  79. font-weight: bold;
  80. color: #6E4019;
  81. line-height: 40rpx;
  82. }
  83. </style>