discovery.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="discovery tn-safe-area-inset-bottom" style="max-height: 100vh">
  3. <view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  4. <view style="width: 100%;padding-bottom: 0;">
  5. <view style="display: flex;width: 100%;background: linear-gradient(0deg, #fff, #f8f8f">
  6. <view style="margin:16px">
  7. <image style="width: 56px; height: 50px; margin-right: 12px;" :mode="fit"
  8. src="../../static/logo.png"></image>
  9. </view>
  10. <view style="margin:16px 0;margin-left: -8px;">
  11. <view style="font-weight: bold;font-size: 22px;">速立保</view>
  12. <text style="margin-top:12px;color:#888;font-size:15px">生物制药产业一站式产品资源供需平台</text>
  13. </view>
  14. </view>
  15. </view>
  16. <view style="padding: 0px 0 4px 16px;font-weight: bold;">
  17. 优质入驻企业 ▼
  18. </view>
  19. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" >
  20. <swiper-item v-for="item of companyList" :key="item.id" style="position:relative">
  21. <!-- <view style="position: absolute;bottom: 28px;right: 16px;color: #ffffff75;" class="swiper-item uni-bg-red">{{item.company}}</view> -->
  22. <image :src="item.picUrl?item.picUrl:'../../static/bg.png'" style="width: 100%;height: 100%;"></image>
  23. </swiper-item>
  24. </swiper>
  25. <view style="padding: 16px 0 4px 16px;font-weight: bold;">
  26. 优质供应 ▼
  27. </view>
  28. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" >
  29. <swiper-item v-for="item of prodList" :key="item.id">
  30. <!-- <view style="position: absolute;bottom: 28px;right: 16px;color: #ffffff75;" class="swiper-item uni-bg-red">{{item.company}}</view> -->
  31. <image :src="item.picUrl?item.picUrl:'../../static/bg.png'" style="width: 100%;height: 100%;"></image>
  32. </swiper-item>
  33. </swiper>
  34. <!-- <image style="width: 180px;height: 150px" src="../../static/logo.png"></image>
  35. <view style="margin-top:24px"><text style="font-size:30px;">生物制药产业</text></view>
  36. <view><text style="font-size:30px">国际产品展示中心</text></view>
  37. <view style="margin-top:24px"><text style="font-size:20px;">生物制药产业一站式产品资源供需平台</text></view> -->
  38. <view style="display: flex;margin-top:32px;margin: 24px;">
  39. <view style="flex: 1;padding: 0 16px;" class="bg01" @click="showAdd">
  40. <text style="font-size: 32px;margin-right: 10px;vertical-align: sub;" class="tn-icon-email-fill" ></text>
  41. <text style="line-height: 72px;font-size: 18px;">我要什么</text>
  42. </view>
  43. <view style="flex: 1;padding: 0 16px;" class="bg02" @click="showAdd2">
  44. <text style="font-size: 32px;margin-right: 10px;vertical-align: sub;" class="tn-icon-paperbag-fill" ></text>
  45. <text style="line-height: 72px;font-size: 18px;">我有什么</text>
  46. </view>
  47. </view>
  48. <view class='tn-tabbar-height'></view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import request from '../../utils/request'
  54. export default {
  55. data() {
  56. return {
  57. indicatorDots: true,
  58. autoplay: false,
  59. companyList:[],
  60. prodList:[]
  61. }
  62. },
  63. onLoad(){
  64. this.loadData();
  65. },
  66. onReady() {
  67. this.$nextTick(() => {
  68. this.loadData()
  69. this.loadData2()
  70. })
  71. },
  72. methods: {
  73. fetchData(){
  74. this.loadData()
  75. this.loadData2()
  76. },
  77. loadData() {
  78. let that = this;
  79. request.post('/slbTopad/premiumCompanies', {
  80. }).then(res => {
  81. if (res&&res.success) {
  82. that.companyList = res.list||[]
  83. }
  84. })
  85. },
  86. loadData2() {
  87. let that = this;
  88. request.post('/slbTopad/premiumShareCompanies', {
  89. }).then(res => {
  90. if (res&&res.success) {
  91. that.prodList = res.list||[]
  92. }
  93. })
  94. },
  95. showAdd(){
  96. if(uni.getStorageSync('userNo')){
  97. uni.navigateTo({
  98. url:'/circlePages/circle'
  99. })
  100. }else{
  101. uni.navigateTo({
  102. url:'/pages/login/login'
  103. })
  104. }
  105. },
  106. showAdd2(){
  107. if(uni.getStorageSync('userNo')){
  108. uni.navigateTo({
  109. url:'/circlePages/addShare'
  110. })
  111. }else{
  112. uni.navigateTo({
  113. url:'/pages/login/login'
  114. })
  115. }
  116. }
  117. }
  118. }
  119. </script>
  120. <style>
  121. .swiper-item {
  122. text-align: center;
  123. }
  124. .swiper{
  125. height: 200px;
  126. }
  127. .bg01{
  128. color: #fff;
  129. background-image: url(./../../static/bg01.png);
  130. background-size: cover;
  131. height: 72px;
  132. border-radius: 20px;
  133. margin-right: 16px;
  134. }
  135. .bg02{
  136. color: #fff;
  137. background-image: url(./../../static/bg02.png);
  138. background-size: cover;
  139. height: 72px;
  140. border-radius: 20px;
  141. }
  142. /* 底部安全边距 start*/
  143. .tn-tabbar-height {
  144. min-height: 120rpx;
  145. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  146. height: calc(140rpx + constant(safe-area-inset-bottom));
  147. }
  148. </style>