discovery.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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,index) 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'" @click="showImgs(index,companyList)" mode="aspectFill" 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,index) 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'" @click="showImgs(index,prodList)" style="width: 100%;height: 100%;" mode="aspectFill"></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. showImgs(index, list){
  96. let urls = [];
  97. for(let i=0;i<list.length;i++){
  98. urls.push(list[i].picUrl);
  99. }
  100. // 预览图片
  101. uni.previewImage({
  102. urls: urls,
  103. current: index,
  104. });
  105. },
  106. showAdd(){
  107. if(uni.getStorageSync('userNo')){
  108. uni.navigateTo({
  109. url:'/circlePages/circle'
  110. })
  111. }else{
  112. uni.navigateTo({
  113. url:'/pages/login/login'
  114. })
  115. }
  116. },
  117. showAdd2(){
  118. if(uni.getStorageSync('userNo')){
  119. uni.navigateTo({
  120. url:'/circlePages/addShare'
  121. })
  122. }else{
  123. uni.navigateTo({
  124. url:'/pages/login/login'
  125. })
  126. }
  127. }
  128. }
  129. }
  130. </script>
  131. <style>
  132. .swiper-item {
  133. text-align: center;
  134. }
  135. .swiper{
  136. height: 200px;
  137. }
  138. .bg01{
  139. color: #fff;
  140. background-image: url(./../../static/bg01.png);
  141. background-size: cover;
  142. height: 72px;
  143. border-radius: 20px;
  144. margin-right: 16px;
  145. }
  146. .bg02{
  147. color: #fff;
  148. background-image: url(./../../static/bg02.png);
  149. background-size: cover;
  150. height: 72px;
  151. border-radius: 20px;
  152. }
  153. /* 底部安全边距 start*/
  154. .tn-tabbar-height {
  155. min-height: 120rpx;
  156. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  157. height: calc(140rpx + constant(safe-area-inset-bottom));
  158. }
  159. </style>