newResources.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="container new-resources">
  3. <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
  4. <view class="content-box">
  5. <van-icon name="arrow-left" size="20px" @click="goHandler" />
  6. <text>买方研选新资源</text>
  7. </view>
  8. </view>
  9. <image class="img-bg" :src="imgList.HbImg"> </image>
  10. <image @click="goPage" class="img-btn" :style="{ width: '368rpx', bottom: '15%' }" :src="imgList.ButtonImg"> </image>
  11. <Loading />
  12. </view>
  13. </template>
  14. <script>
  15. import { Research } from "@/config/api.js";
  16. export default {
  17. data() {
  18. return {
  19. navBarStyle: {
  20. height: 60 + "px",
  21. paddingTop: 40 + "px",
  22. paddingBottom: "4px",
  23. },
  24. imgList: {},
  25. };
  26. },
  27. methods: {
  28. initNavBar() {
  29. let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  30. this.navBarStyle = {
  31. height: menuButtonInfo.height + menuButtonInfo.top + 8 + "px",
  32. paddingTop: menuButtonInfo.top - 4 + "px",
  33. paddingBottom: "4px",
  34. };
  35. },
  36. // 获取图片
  37. async getImageList() {
  38. const res = await Research.researchHB();
  39. if (res.Ret === 200) {
  40. this.imgList = res.Data;
  41. }
  42. },
  43. // 点击返回
  44. goHandler() {
  45. uni.navigateBack({
  46. fail() {
  47. uni.switchTab({
  48. url: "/pages/index/index",
  49. });
  50. },
  51. });
  52. },
  53. goPage() {
  54. uni.switchTab({
  55. url: "/pages/purchaser/purchaser",
  56. });
  57. },
  58. },
  59. onLoad() {
  60. this.getImageList();
  61. this.initNavBar();
  62. },
  63. onShareAppMessage() {
  64. return {
  65. title: "买方研选新资源",
  66. path: "/pages-purchaser/newResources/newResources",
  67. };
  68. },
  69. };
  70. </script>
  71. <style scoped lang="scss">
  72. .new-resources {
  73. position: relative;
  74. width: 100%;
  75. height: 100vh;
  76. .nav-bar-wrap {
  77. position: fixed;
  78. background: rgba(0, 0, 0, 0.62);
  79. width: 100%;
  80. display: flex;
  81. align-items: center;
  82. z-index: 9;
  83. .content-box {
  84. position: relative;
  85. display: flex;
  86. align-items: center;
  87. width: 100%;
  88. justify-content: center;
  89. color: #fff;
  90. font-size: 34rpx;
  91. /deep/ .van-icon-arrow-left {
  92. position: absolute;
  93. left: 39rpx;
  94. top: 50%;
  95. transform: translateY(-50%);
  96. z-index: 99;
  97. }
  98. }
  99. }
  100. .img-bg {
  101. width: 100%;
  102. height: 100vh;
  103. }
  104. .img-btn {
  105. position: absolute;
  106. height: 82rpx;
  107. left: 50%;
  108. transform: translateX(-50%);
  109. z-index: 99;
  110. bottom: 232rpx;
  111. }
  112. }
  113. </style>