index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <template>
  2. <view style="background-color: #f7f7f7;">
  3. <view class="discovery tn-safe-area-inset-bottom" >
  4. <tn-nav-bar customBack>
  5. <view slot="back" class='tn-custom-nav-bar__back' >
  6. <image style="width: 30px;height: 28px;margin-left:4px" @click="reFetchData()" src="../../static/logo.png"></image>
  7. </view>
  8. <view slot="default" style="display: flex;">
  9. <view style="flex:1;">
  10. <text :style="{fontSize:(wxFontSize)+'px'}">速立保</text>
  11. </view>
  12. </view>
  13. </tn-nav-bar>
  14. <view :style="{paddingTop: vuex_custom_bar_height + 'px'}" >
  15. <view style="width: 100%;padding-bottom: 0;background-color: #fff;">
  16. <view style="display: flex;width: 100%;">
  17. <view style="flex:1; margin:16px; text-align: center;border-radius: 47px;" class="bg-slogan">
  18. <text style="margin-top:12px;color:#fff;font-size:17px;margin: 16px;font-weight: 600;" :style="{fontSize:(fontSize)+'px'}">生物制药产业国际产品供需平台</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view style="padding: 16px;color:#333;font-weight: 600;" :style="{fontSize:(fontSize-1)+'px'}">
  23. 优质入驻企业
  24. </view>
  25. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" v-if="!hideComps">
  26. <swiper-item v-for="(item,index) of companyList" :key="item.id" style="position:relative">
  27. <text class="tn-icon-close" @click="closeComps" style="position: absolute;right: 0px;color: #fff;background: #00000066;border-top-right-radius: 0;padding: 4px;font-size: 13px;border-bottom-left-radius: 8px;"></text>
  28. <image :src="item.picUrl?item.picUrl:'../../static/tu/needbg.png'" @click="showImgs(index,companyList)" mode="aspectFill" style="width: 100%;height: 100%;"></image>
  29. </swiper-item>
  30. </swiper>
  31. <view v-if="hideComps" style="height: 200px;display: flex;align-items: center;justify-content: center;color: #2196f36e;">
  32. <text @click="showComps()">〈恢复展示〉</text>
  33. </view>
  34. <view style="padding: 16px;color:#333;font-weight: 600;" :style="{fontSize:(fontSize-1)+'px'}">
  35. 优质供应
  36. </view>
  37. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" v-if="!hideProds">
  38. <swiper-item v-for="(item,index) of prodList" :key="item.id">
  39. <text class="tn-icon-close" @click="closeProds" style="position: absolute;right: 0px;color: #fff;background: #00000066;border-top-right-radius: 0;padding: 4px;font-size: 13px;border-bottom-left-radius: 8px;"></text>
  40. <image :src="item.picUrl?item.picUrl:'../../static/tu/needbg.png'" @click="showImgs(index,prodList)" style="width: 100%;height: 100%;" mode="aspectFill"></image>
  41. </swiper-item>
  42. </swiper>
  43. <view v-if="hideProds" style="height: 200px;display: flex;align-items: center;justify-content: center;color: #2196f36e;">
  44. <text @click="showProds()">〈恢复展示〉</text>
  45. </view>
  46. <!-- <image style="width: 180px;height: 150px" src="../../static/logo.png"></image>
  47. <view style="margin-top:24px"><text style="font-size:30px;">生物制药产业</text></view>
  48. <view><text style="font-size:30px">国际产品展示中心</text></view>
  49. <view style="margin-top:24px"><text style="font-size:20px;">生物制药产业国际产品供需平台</text></view> -->
  50. <view style="display: flex;margin-top:32px;margin: 24px 16px;">
  51. <view style="flex: 1;padding: 0 0 0 16px;" class="bg01" @click="showAdd">
  52. <image src="../../static/tu/needi.png" style="width: 36px;height: 36px; vertical-align: middle;margin-top: -6px;margin-right: 8px;"></image>
  53. <text style="line-height: 72px;font-size: 18px;font-weight: 600;" :style="{fontSize:(fontSize+1)+'px'}">我要什么</text>
  54. </view>
  55. <view style="flex: 1;padding: 0 0 0 16px;" class="bg02" @click="showAdd2">
  56. <image src="../../static/tu/sharei.png" style="width: 36px;height: 36px; vertical-align: middle;margin-top: -6px;margin-right: 8px;"></image>
  57. <text style="line-height: 72px;font-size: 18px;font-weight: 600;" :style="{fontSize:(fontSize+1)+'px'}">我有什么</text>
  58. </view>
  59. </view>
  60. <view class='tn-tabbar-height'></view>
  61. </view>
  62. <view class="edit tnxuanfu" @tap="showLandscape">
  63. <view class="bg0 pa">
  64. <view class="bg1" style="background-size: cover;border-radius: 50%;background-image: url(https://oss.lx-device.com/userFeedback/1741316243096Hwk.gif);">
  65. </view>
  66. </view>
  67. <view class="hx-box pa">
  68. <view class="pr">
  69. <view class="hx-k1 pa0">
  70. <view class="span"></view>
  71. </view>
  72. <view class="hx-k2 pa0">
  73. <view class="span"></view>
  74. </view>
  75. <view class="hx-k3 pa0">
  76. <view class="span"></view>
  77. </view>
  78. <view class="hx-k4 pa0">
  79. <view class="span"></view>
  80. </view>
  81. <view class="hx-k5 pa0">
  82. <view class="span"></view>
  83. </view>
  84. <view class="hx-k6 pa0">
  85. <view class="span"></view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <Auth ref="authRef"></Auth>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import Auth from '../index/autoLogin.vue'
  96. import Home from '../home/home.vue'
  97. import Comm from '../comm/comm.vue'
  98. import Mine from '../mine/mine.vue'
  99. import request from '../../utils/request'
  100. export default {
  101. components: {
  102. Auth,
  103. Home,
  104. Comm,
  105. Mine
  106. },
  107. data() {
  108. return {
  109. indicatorDots: true,
  110. autoplay: false,
  111. companyList:[],
  112. prodList:[],
  113. hideComps: false,
  114. hideProds: false,
  115. fontSize:17
  116. }
  117. },
  118. onReady() {
  119. const appBaseInfo = wx.getAppBaseInfo();
  120. this.fontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
  121. },
  122. onShow(options){
  123. if(uni.getStorageSync('nextPage')&&uni.getStorageSync('userNo')){
  124. let nextPage = uni.getStorageSync('nextPage')
  125. uni.removeStorageSync('nextPage');
  126. uni.navigateTo({
  127. url: nextPage
  128. })
  129. }else{
  130. uni.removeStorageSync('nextPage')
  131. }
  132. if (wx.canIUse('getUpdateManager')) {
  133. const updateManager = wx.getUpdateManager();
  134. updateManager && updateManager.onCheckForUpdate((res) => {
  135. if (res.hasUpdate) {
  136. updateManager.onUpdateReady(() => {
  137. uni.showModal({
  138. title: '更新提示',
  139. content: '新版本已经准备好,是否重启应用?',
  140. success: (res) => {
  141. if (res.confirm) {
  142. uni.clearStorageSync() // 更新完成后刷新storage的数据
  143. updateManager.applyUpdate()
  144. }
  145. }
  146. })
  147. })
  148. updateManager.onUpdateFailed(() => {
  149. uni.reLaunch({
  150. url:'/pages/index/index'
  151. })
  152. })
  153. } else {
  154. //没有更新
  155. }
  156. })
  157. }
  158. this.$nextTick(() => {
  159. this.loadData()
  160. this.loadData2()
  161. })
  162. },
  163. methods: {
  164. //关闭banner1
  165. closeComps(){
  166. this.hideComps = true;
  167. },
  168. //关闭banner2
  169. closeProds(){
  170. this.hideProds = true;
  171. },
  172. //显示banner2
  173. showProds(){
  174. this.hideProds = false;
  175. },
  176. //显示banner1
  177. showComps(){
  178. this.hideComps = false;
  179. },
  180. fetchData(){
  181. this.loadData()
  182. this.loadData2()
  183. },
  184. loadData() {
  185. let that = this;
  186. request.post('/slbTopad/premiumCompanies', {
  187. }).then(res => {
  188. if (res&&res.success) {
  189. let dataList = res.list||[];
  190. let newList = [];
  191. for(let i=0;i<dataList.length;i++){
  192. if(dataList[i].showFlag=='是'){
  193. newList.push(dataList[i]);
  194. }
  195. }
  196. that.companyList = newList;
  197. }
  198. })
  199. },
  200. loadData2() {
  201. let that = this;
  202. request.post('/slbTopad/premiumShareCompanies', {
  203. }).then(res => {
  204. if (res&&res.success) {
  205. let dataList = res.list||[];
  206. let newList = [];
  207. for(let i=0;i<dataList.length;i++){
  208. if(dataList[i].showFlag=='是'){
  209. newList.push(dataList[i]);
  210. }
  211. }
  212. that.prodList = newList;
  213. }
  214. })
  215. },
  216. showImgs(index, list){
  217. let urls = [];
  218. for(let i=0;i<list.length;i++){
  219. urls.push(list[i].picUrl);
  220. }
  221. // 预览图片
  222. uni.previewImage({
  223. urls: urls,
  224. current: index,
  225. });
  226. },
  227. showLandscape(){
  228. uni.navigateTo({
  229. url:'/pages/index/aichat'
  230. })
  231. },
  232. showAdd(){
  233. if(uni.getStorageSync('userNo')){
  234. uni.navigateTo({
  235. url:'/circlePages/circle'
  236. })
  237. }else{
  238. uni.setStorageSync('nextPage','/circlePages/circle');
  239. uni.navigateTo({
  240. url:'/pages/login/login'
  241. })
  242. }
  243. },
  244. showAdd2(){
  245. if(uni.getStorageSync('userNo')){
  246. uni.navigateTo({
  247. url:'/circlePages/addShare'
  248. })
  249. }else{
  250. uni.setStorageSync('nextPage','/circlePages/addShare');
  251. uni.navigateTo({
  252. url:'/pages/login/login'
  253. })
  254. }
  255. }
  256. }
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .swiper-item {
  261. text-align: center;
  262. }
  263. .swiper{
  264. height: 200px;
  265. }
  266. .bg01{
  267. color: #fff;
  268. background-image: url(./../../static/tu/needbg.png);
  269. background-size: cover;
  270. height: 72px;
  271. border-radius: 20px;
  272. margin-right: 16px;
  273. }
  274. .bg02{
  275. color: #fff;
  276. background-image: url(./../../static/tu/sharebg.png);
  277. background-size: cover;
  278. height: 72px;
  279. border-radius: 20px;
  280. }
  281. .bg-slogan{
  282. color: #fff;
  283. background-image: url(./../../static/tu/slogan-min.png);
  284. background-size: cover;
  285. line-height: 40px;
  286. background-repeat: no-repeat;
  287. }
  288. /* 底部安全边距 start*/
  289. .tn-tabbar-height {
  290. min-height: 120rpx;
  291. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  292. height: calc(140rpx + constant(safe-area-inset-bottom));
  293. }
  294. /* 悬浮 */
  295. .tnxuanfu {
  296. animation: suspension 3s ease-in-out infinite;
  297. }
  298. @keyframes suspension {
  299. 0%,
  300. 100% {
  301. transform: translateY(-0.8rem);
  302. }
  303. 50% {
  304. transform: translateY(-0.8rem);
  305. }
  306. }
  307. /* 悬浮按钮 */
  308. .button-shop {
  309. width: 90rpx;
  310. height: 90rpx;
  311. display: flex;
  312. flex-direction: row;
  313. position: fixed;
  314. /* bottom:200rpx;
  315. right: 20rpx; */
  316. left: 5rpx;
  317. top: 5rpx;
  318. z-index: 1001;
  319. border-radius: 100px;
  320. opacity: 0.9;
  321. }
  322. /* 按钮 */
  323. .edit {
  324. bottom: 300rpx;
  325. right: 75rpx;
  326. position: fixed;
  327. z-index: 9999;
  328. }
  329. .pa,
  330. .pa0 {
  331. position: absolute
  332. }
  333. .pa0 {
  334. left: 0;
  335. top: 0
  336. }
  337. .bg0 {
  338. width: 100rpx;
  339. height: 100rpx;
  340. top: 50%;
  341. left: 50%;
  342. transform: translate(-50%, -50%);
  343. border-radius: 50%;
  344. font-size: 32px;
  345. color: #fff;
  346. text-align: center;
  347. line-height: 50px;
  348. }
  349. .bg1 {
  350. width: 100%;
  351. height: 100%;
  352. }
  353. .hx-box {
  354. top: 50%;
  355. left: 50%;
  356. width: 100rpx;
  357. height: 100rpx;
  358. transform-style: preserve-3d;
  359. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  360. }
  361. .hx-box .pr {
  362. width: 100rpx;
  363. height: 100rpx;
  364. transform-style: preserve-3d;
  365. animation: hxz 20s linear infinite;
  366. }
  367. @keyframes hxz {
  368. 0% {
  369. transform: rotateX(0deg);
  370. }
  371. 100% {
  372. transform: rotateX(-360deg);
  373. }
  374. }
  375. .hx-box .pr .pa0 {
  376. width: 100rpx;
  377. height: 100rpx;
  378. /* border: 4px solid #5ec0ff; */
  379. border-radius: 1000px;
  380. }
  381. @keyframes hx {
  382. to {
  383. transform: rotate(360deg);
  384. }
  385. }
  386. .hx-k1 {
  387. transform: rotateX(-60deg) rotateZ(-60deg)
  388. }
  389. .hx-k2 {
  390. transform: rotateX(-30deg) rotateZ(-30deg)
  391. }
  392. .hx-k3 {
  393. transform: rotateX(0deg) rotateZ(0deg)
  394. }
  395. .hx-k4 {
  396. transform: rotateX(30deg) rotateZ(30deg)
  397. }
  398. .hx-k5 {
  399. transform: rotateX(60deg) rotateZ(60deg)
  400. }
  401. .hx-k6 {
  402. transform: rotateX(90deg) rotateZ(90deg)
  403. }
  404. </style>