comm.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288
  1. <template>
  2. <view class="circle tn-safe-area-inset-bottom">
  3. <tn-nav-bar customBack>
  4. <view slot="back" class='tn-custom-nav-bar__back' @click="reFetchData()">
  5. <text v-if="!loading" class="tn-icon-circle-arrow" style="font-size: 50rpx;"></text>
  6. <view style="margin-top:6px" v-if="loading" ><tn-loading :size="46"></tn-loading></view>
  7. </view>
  8. <view slot="default" style="display: flex;">
  9. <view style="flex:1;margin-left:25px">
  10. <text>我有什么</text>
  11. </view>
  12. <view>
  13. <text class="tn-icon-add-fill" style="font-size: 30px;margin-right: 4px;"
  14. @click="addButton()"></text>
  15. </view>
  16. </view>
  17. </tn-nav-bar>
  18. <!-- 发现 -->
  19. <view class="" v-if="current==0" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  20. <uv-sticky :offsetTop="vuex_custom_bar_height + 'px'" bgColor="#ffffff">
  21. <view style="width: 100%;" v-if="currentTab==0">
  22. <view style="display: flex; padding: 10px 12px;">
  23. <view
  24. style="flex:1;background-color: #f8f8f8;border-radius: 18px;color: #bbb;line-height: 35px;"
  25. @click="showSearch">
  26. <view>
  27. <uni-icons type="search" color="#bbbbbb" size="18" style="margin: 8px;"></uni-icons>
  28. <text v-if="!searchProdValue">产品名称/品牌/产品型号</text>
  29. <text v-if="searchProdValue">{{searchProdValue}}</text>
  30. </view>
  31. </view>
  32. <view v-if="searchProdValue" @click="clearProd" style="line-height: 36px;margin-left: 10px;">取消
  33. </view>
  34. </view>
  35. </view>
  36. <view style="width: 100%;" v-if="currentTab==1">
  37. <view style="display: flex; padding: 10px 12px;">
  38. <view
  39. style="flex:1;background-color: #f8f8f8;border-radius: 18px;color: #bbb;line-height: 35px;"
  40. @click="showSearch2">
  41. <view>
  42. <uni-icons type="search" color="#bbbbbb" size="18" style="margin: 8px;"></uni-icons>
  43. <text v-if="!searchProdValue2">品牌/服务内容</text>
  44. <text v-if="searchProdValue2">{{searchProdValue2}}</text>
  45. </view>
  46. </view>
  47. <view v-if="searchProdValue2" @click="clearProd2" style="line-height: 36px;margin-left: 10px;">取消
  48. </view>
  49. </view>
  50. </view>
  51. <!-- <uni-search-bar radius="15" placeholder="搜索" v-if="currentTab==1" @confirm="search"
  52. v-model="searchValue" @blur="search" @cancel="cancel" @clear="clear" cancelButton="auto"
  53. clearButton="auto">
  54. </uni-search-bar> -->
  55. <tn-tabs-swiper :list="tabList" :isScroll="false" :current="currentTab" name="tab-name"
  56. @change="changeTab" style="border-bottom: 1rpx solid #f1f1f1cc;">
  57. </tn-tabs-swiper>
  58. </uv-sticky>
  59. <view class="tn-flex tn-flex-direction-column tn-margin-top-sm ">
  60. <!-- 图文信息 -->
  61. <block v-for="(item,index) in content" :key="item.id">
  62. <view class="blogger__item" :key="index">
  63. <view class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center">
  64. <view class="justify__author__info" @click="tn('')">
  65. <view class="tn-flex tn-flex-row-center">
  66. <view class="tn-flex tn-flex-row-center tn-flex-col-center">
  67. <!-- <view class="">
  68. <tn-avatar
  69. class=""
  70. shape="circle"
  71. :src="item.userAvatar"
  72. size="lg">
  73. </tn-avatar>
  74. </view> -->
  75. <view class="tn-padding-right tn-text-ellipsis">
  76. <view class="tn-padding-right tn-color-grey tn-text-lg">
  77. {{ item.company||(item.contactNickName||item.contactPerson) }}
  78. </view>
  79. <!-- <view class="tn-padding-right tn-padding-left-sm tn-padding-top-xs tn-color-gray">{{ item.date }}</view> -->
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view v-if="1==0"
  85. class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
  86. <text class="" style="background: #3F51B542;font-size: 12px;
  87. padding: 8px;
  88. color: #0000FF;
  89. border-radius: 24px;
  90. border-top-right-radius: 0;">{{item.validDate}}</text>
  91. </view>
  92. </view>
  93. <view
  94. class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left"
  95. >
  96. <!-- 不用限制长度了,因为发布的时候限制长度了-->
  97. <tn-tag margin="-4px 4px 0 0" backgroundColor="#3a96d733" v-if="item.brand"
  98. fontColor="#3a96d7" shape="circle">{{ item.brand }}</tn-tag>
  99. <tn-tag margin="-4px 4px 0 0" backgroundColor="#3a96d733" v-if="!item.company"
  100. fontColor="#3a96d7" shape="circle">个人</tn-tag>
  101. <text v-if="item.content"
  102. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df">{{ item.content }}</text>
  103. </view>
  104. <!-- 内容太多疲劳了-->
  105. <view v-if="item.shareExt&&item.shareExt.length>0" class="blogger__content"
  106. :id="`blogger__content--${index}`">
  107. <basic-table header-row-class-name="basic-table-header" :columns="columns" :border="true"
  108. :stripe="true" :data="item.shareExt">
  109. </basic-table>
  110. </view>
  111. <block v-if="item.imgList">
  112. <view v-if="[1,2,4].indexOf(item.imgList.length) != -1" class="tn-padding-top-xs"
  113. >
  114. <image v-for="(image_item,image_index) in item.imgList" :key="image_index"
  115. class="blogger__main-image" :class="{
  116. 'blogger__main-image--1 tn-margin-bottom-sm': item.imgList.length === 1,
  117. 'blogger__main-image--2 tn-margin-right-sm tn-margin-bottom-sm': item.imgList.length === 2 || item.imgList.length === 4
  118. }" :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  119. </view>
  120. <view v-else class="tn-padding-top-xs" @click="tn('')">
  121. <tn-grid hoverClass="none" :col="3">
  122. <block v-for="(image_item,image_index) in item.imgList" :key="image_index">
  123. <!-- #ifndef MP-WEIXIN -->
  124. <tn-grid-item style="width: 30%;margin: 10rpx;">
  125. <image class="blogger__main-image blogger__main-image--3"
  126. :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  127. </tn-grid-item>
  128. <!-- #endif-->
  129. <!-- #ifdef MP-WEIXIN -->
  130. <tn-grid-item style="width: 30%;margin: 10rpx;">
  131. <image class="blogger__main-image blogger__main-image--3"
  132. :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  133. </tn-grid-item>
  134. <!-- #endif-->
  135. </block>
  136. </tn-grid>
  137. </view>
  138. </block>
  139. <view v-for="file in item.fileDetailList" :key="file.id" v-if="!isImage(file.fileName)">
  140. <view style="margin-top:10px">
  141. <text class="tn-icon-link"></text>
  142. <view style="display: inline-block;margin-left:8px; white-space: nowrap;
  143. text-overflow: ellipsis;
  144. width: 80%;" @click="clickLink(file.ftpUrl,file.fileName)">
  145. {{file.fileName}}</view>
  146. </view>
  147. </view>
  148. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-top-xs">
  149. <view class="justify-content-item tn-color-gray tn-text-center">
  150. <view class="tn-padding-right tn-padding-top-xs tn-color-gray">
  151. {{ item.createTime|formatDate }}
  152. </view>
  153. </view>
  154. <view class="justify-content-item tn-flex tn-flex-col-center">
  155. <text class="tn-icon-more-vertical tn-color-gray tn-text-bold tn-text-xxl"
  156. @click="showActionSheet(item)"></text>
  157. </view>
  158. </view>
  159. </view>
  160. <!-- 边距间隔 -->
  161. <view class="tn-strip-bottom" v-if="index != content.length - 1"></view>
  162. </block>
  163. <!-- 边距间隔 -->
  164. <!-- <view class="tn-strip-bottom"></view> -->
  165. <view v-if="showEmpty&&content.length==0" style="margin-top: 32vh;">
  166. <tn-empty mode="list"></tn-empty>
  167. </view>
  168. <!-- 广告 -->
  169. <!-- 结尾 -->
  170. <view v-if="content.length==totalSize&&totalSize!=0&&currentTab==0" style="background-color: #f1f1f1cc;padding: 16px 0;">
  171. <tn-load-more status="nomore" :loadText="loadText"></tn-load-more>
  172. </view>
  173. <view v-if="content.length==totalSize&&totalSize!=0&&currentTab==1" style="background-color: #f1f1f1cc;padding: 16px 0;">
  174. <tn-load-more status="nomore" :loadText="loadText2"></tn-load-more>
  175. </view>
  176. </view>
  177. <view class='tn-tabbar-height'></view>
  178. </view>
  179. <tn-popup v-model="showSheet" mode="center" closeBtn="true" borderRadius="16">
  180. <view class="content" style="padding: 24px 36px;font-size: 16px;line-height: 24px; width: 320px;"
  181. v-if="!showContact">
  182. <button @click="linkTel()" style="border-radius:30px;color:#fff;background-color: #1d60b1;"><text
  183. class="tn-icon-service" style="margin-right: 12px;"></text> 联系供方</button>
  184. <!-- <view>联系我们帮助对接</view> -->
  185. <button v-if="!collStatus" @click="addColl"
  186. style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
  187. class="tn-icon-star" style="margin-right: 12px;"></text>
  188. 收&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;藏</button>
  189. <button v-if="collStatus" @click="delColl"
  190. style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
  191. class="tn-icon-star-fill" style="margin-right: 12px;"></text> 取消收藏</button>
  192. <button open-type="share"
  193. style="margin-top:10px;border-radius:30px;" type="default" plain="true" :data-coupon="curItem"><text
  194. class="tn-icon-send" style="margin-right: 12px;"></text>
  195. 转&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</button>
  196. </view>
  197. <view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width:320px;line-height: 24px;"
  198. v-if="showContact">
  199. <view><text style="font-size: 20px;font-weight: bold;" v-if="curContact.company">{{curContact.company}}</text></view>
  200. <view style="margin-top:20px;
  201. font-weight: bold;
  202. font-size: 20px;"><text class="tn-icon-my-formal"></text><text style="margin-left: 6px;">{{curContact.contactPerson}}</text> </view>
  203. <view style="margin-top:20px;font-size: 20px;font-weight: bold;" @click="showTel(curContact.contactMethod)"><text class="tn-icon-tel"></text>
  204. <text style="margin-left: 4px;">{{curContact.contactMethod}}</text> </view>
  205. </view>
  206. </tn-popup>
  207. </view>
  208. </template>
  209. <script>
  210. import request from '../../utils/request'
  211. export default {
  212. name: 'Circle',
  213. data() {
  214. return {
  215. loading: false,
  216. searchProdValue: '',
  217. searchProdValue2:'',
  218. tabList: [{
  219. 'tab-name': '产品'
  220. }, {
  221. 'tab-name': '服务'
  222. }],
  223. loadText: {
  224. loadmore: '下拉加载',
  225. loading: '快速加载中...',
  226. nomore: '恭喜你,已阅读完所有供应信息哦!'
  227. },
  228. loadText2: {
  229. loadmore: '下拉加载',
  230. loading: '快速加载中...',
  231. nomore: '恭喜你,已阅读完所有供应信息哦!'
  232. },
  233. currentTab: 0,
  234. showEmpty: false,
  235. columns: [{
  236. fieldName: 'prodName',
  237. fieldDesc: '产品名称',
  238. }, {
  239. fieldName: 'prodSpec',
  240. fieldDesc: '规格型号',
  241. }, {
  242. fieldName: 'prodDesc',
  243. fieldDesc: '产品介绍',
  244. }],
  245. showSheet: false,
  246. curItem: {},
  247. collId: '',
  248. showContact: false,
  249. curContact: {},
  250. current: 0,
  251. collStatus: '',
  252. searchValue: '',
  253. // 内容默认隐藏显示的高度
  254. contentHideShowHeight: 0,
  255. content: [],
  256. totalSize: 0,
  257. curIndex: 1,
  258. }
  259. },
  260. onLoad() {
  261. this.initContentData()
  262. this.contentHideShowHeight = uni.upx2px(56) * 3
  263. },
  264. onReady() {
  265. this.$nextTick(() => {
  266. this.fetchData()
  267. })
  268. },
  269. onShow() {
  270. this.fetchData()
  271. },
  272. onHide() {
  273. this.adAutoplay = false
  274. },
  275. filters: {
  276. formatDate(value) {
  277. if (!value) return '';
  278. const date = new Date(value);
  279. const today = new Date();
  280. const yesterday = new Date(today); // 昨天的日期
  281. yesterday.setDate(yesterday.getDate() - 1); // 将昨天的日期设置为前一天
  282. if (date.getFullYear() == today.getFullYear() && date.getMonth() == today.getMonth() && date.getDate() ==
  283. today.getDate()) {
  284. return '今天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  285. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  286. }
  287. if (date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date
  288. .getDate() == yesterday.getDate()) {
  289. return '昨天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  290. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  291. }
  292. return date.toLocaleDateString() + ' ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  293. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  294. },
  295. },
  296. methods: {
  297. showSearch(item) {
  298. // 或者可以直接设置body的tabindex属性为-1,然后移除焦点
  299. // 注意:这种方式可能会导致一些浏览器的兼容性问题
  300. uni.navigateTo({
  301. url: '/pages/comm/search'
  302. })
  303. },
  304. showDetail(item){
  305. uni.navigateTo({
  306. url: '/pages/index/detail/detail?id='+item.bisNo+'&isNeed=0'
  307. })
  308. },
  309. showSearch2(item) {
  310. // 或者可以直接设置body的tabindex属性为-1,然后移除焦点
  311. // 注意:这种方式可能会导致一些浏览器的兼容性问题
  312. uni.navigateTo({
  313. url: '/pages/comm/search2'
  314. })
  315. },
  316. isImage(fileName) {
  317. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  318. const extension = fileName.split('.').pop().toLowerCase();
  319. return imageExtensions.includes(extension);
  320. },
  321. addButton() {
  322. if (!uni.getStorageSync('userNo')) {
  323. uni.showToast({
  324. title: '请登录'
  325. })
  326. uni.navigateTo({
  327. url: '/pages/login/login'
  328. })
  329. return false;
  330. } else {
  331. uni.navigateTo({
  332. url: '/circlePages/addShare'
  333. })
  334. }
  335. },
  336. showImg(items, index) {
  337. let urls = [];
  338. for (let i = 0; i < items.length; i++) {
  339. urls.push(items[i].ftpUrl);
  340. }
  341. // wx.chooseMessageFile({
  342. // count: 3, //默认100
  343. // type:'file',
  344. // extension:['.pdf','.doc'],
  345. // success: function (res) {
  346. // console.error(JSON.stringify(res));
  347. // }
  348. // });
  349. // 预览图片
  350. uni.previewImage({
  351. urls: urls,
  352. current: index,
  353. });
  354. },
  355. clickLink(url,fileName) {
  356. uni.navigateTo({
  357. url:'/pages/webview/web-view?url='+encodeURIComponent('http://slb-m.dev.ml1993.com/webview?title='+fileName+'&url='+ url),
  358. })
  359. // uni.navigateTo({
  360. // url: '/pages/webview/web-view?url=' + url,
  361. // })
  362. },
  363. // tab选项卡切换
  364. tabChange(index) {
  365. this.current = index
  366. },
  367. // 跳转
  368. tn(e) {
  369. uni.navigateTo({
  370. url: e,
  371. });
  372. },
  373. // 震动跳转
  374. navEdit(e) {
  375. wx.vibrateLong();
  376. uni.navigateTo({
  377. url: '/circlePages/edit'
  378. })
  379. },
  380. // 震动跳转
  381. navCreate(e) {
  382. wx.vibrateLong();
  383. uni.navigateTo({
  384. url: '/circlePages/create'
  385. })
  386. },
  387. // 震动跳转
  388. navBuild(e) {
  389. wx.vibrateLong();
  390. uni.navigateTo({
  391. url: '/circlePages/build'
  392. })
  393. },
  394. // 处理内容,给内容添加对应的标识信息
  395. initContentData() {
  396. this.content.forEach((item, index) => {
  397. // 是否需要隐藏内容
  398. item.hideContent = false
  399. // 显示所有内容
  400. item.showAllContent = false
  401. // 内容容器的实际高度
  402. item.contentContainerHeight = 0
  403. // 内容容器是否初始化完成
  404. item.contentContainerInit = false
  405. this.$set(this.content, index, item)
  406. })
  407. },
  408. reFetchData() {
  409. this.loading = true;
  410. uni.showToast({
  411. title: '正在刷新...',
  412. icon: 'none'
  413. });
  414. this.fetchData();
  415. },
  416. hideSheet(){
  417. this.showSheet = false;
  418. },
  419. loadMore() {
  420. if (this.totalSize > this.content.length) {
  421. this.fetchData(this.curIndex + 1);
  422. }
  423. console.error('正在加载更多');
  424. },
  425. changeTab(index) {
  426. this.currentTab = index;
  427. this.content = [];
  428. this.fetchData();
  429. },
  430. // 获取内容容器的信息
  431. fetchData(curIndex = 1) {
  432. let that = this;
  433. that.showEmpty = false;
  434. if (uni.getStorageSync('searchProdValue')) {
  435. that.searchProdValue = uni.getStorageSync('searchProdValue');
  436. }
  437. if (uni.getStorageSync('searchProdValue2')) {
  438. that.searchProdValue2 = uni.getStorageSync('searchProdValue2');
  439. }
  440. request.post('/slbResourceShare/query', {
  441. type: that.currentTab == 1 ? '2' : '1',
  442. index: curIndex,
  443. content: that.currentTab == 1 ? (that.searchProdValue2 ? that.searchProdValue2.split('/')[1]:'') : undefined,
  444. prodSpec: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[2] :
  445. '') : undefined,
  446. prodName: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[0] :
  447. '') : undefined,
  448. brand: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[1] :
  449. '') : that.currentTab == 1 ?(that.searchProdValue2 ? that.searchProdValue2.split('/')[0]:''): undefined,
  450. }).then(res => {
  451. that.loading = false;
  452. if (res && res.success) {
  453. that.totalSize = res.total || 0;
  454. let newList = res.list || [];
  455. for (let i = 0; i < newList.length; i++) {
  456. newList[i].imgList = [];
  457. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  458. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  459. newList[i].imgList.push(newList[i].fileDetailList[j]);
  460. }
  461. }
  462. }
  463. if (curIndex == 1) {
  464. that.content = newList || [];
  465. } else {
  466. that.content = that.content.concat(newList || []);
  467. }
  468. }
  469. that.showEmpty = true;
  470. console.warn(res);
  471. })
  472. // let contentRect = {}
  473. // const query = uni.createSelectorQuery().in(this)
  474. // // 筛选出存在内容的数据
  475. // this.content.forEach((item, index) => {
  476. // if (item?.content) {
  477. // query.select(`#blogger__content--${index}`).boundingClientRect()
  478. // contentRect[index] = item
  479. // }
  480. // })
  481. // // 获取所有内容的宽高信息
  482. // query.exec(res => {
  483. // if (!res) {
  484. // setTimeout(() => {
  485. // this.fetchData()
  486. // }, 10)
  487. // return
  488. // }
  489. // // console.log(res);
  490. // res.map((item) => {
  491. // // console.log(item.height, this.contentHideShowHeight);
  492. // // 获取对应的标号
  493. // const id = item.id
  494. // const idIndex = /blogger__content--(\d)/.exec(id)[1]
  495. // let contentItem = this.content[idIndex]
  496. // contentItem.hideContent = item.height > this.contentHideShowHeight
  497. // contentItem.showAllContent = false
  498. // contentItem.contentContainerHeight = item.height
  499. // contentItem.contentContainerInit = true
  500. // this.$set(this.content, idIndex, contentItem)
  501. // // console.log(/blogger__content--(\d)/.exec(id)[1]);
  502. // })
  503. // })
  504. },
  505. showActionSheet(item) {
  506. let that = this;
  507. this.curItem = item;
  508. this.collStatus = false;
  509. this.showSheet = true;
  510. that.showContact = false;
  511. if (uni.getStorageSync('userNo')) {
  512. let params = {};
  513. params = {
  514. fkBisNo: that.curItem.bisNo,
  515. userNo: uni.getStorageSync('userNo'),
  516. };
  517. request.post('/slbCollect/query', params).then(res => {
  518. if (res.success) {
  519. if (res.list && res.list.length > 0) {
  520. that.collStatus = true;
  521. that.collId = res.list[0].id;
  522. }
  523. }
  524. })
  525. }
  526. },
  527. linkTel() {
  528. if (!uni.getStorageSync('userNo')) {
  529. uni.showToast({
  530. title: '请登录'
  531. })
  532. uni.navigateTo({
  533. url: '/pages/login/login'
  534. })
  535. return false;
  536. }
  537. let that = this;
  538. let params = {};
  539. params.slbBisContact = JSON.stringify({
  540. fkBisNo: that.curItem.bisNo,
  541. bisType: '2',
  542. type: '1',
  543. userNo: uni.getStorageSync('userNo'),
  544. });
  545. request.post('/slbBisContact/add', params).then(res => {
  546. if (res.success) {
  547. that.showContact = true;
  548. that.curContact.company = that.curItem.company;
  549. that.curContact.contactMethod = res.resultMap.contactMethod;
  550. that.curContact.contactPerson = res.resultMap.contactPerson;
  551. } else {
  552. that.showContact = false;
  553. uni.showToast({
  554. title: res.msg,
  555. icon: 'none'
  556. })
  557. }
  558. })
  559. },
  560. addColl() {
  561. if (!uni.getStorageSync('userNo')) {
  562. uni.showToast({
  563. title: '请登录'
  564. })
  565. uni.navigateTo({
  566. url: '/pages/login/login'
  567. })
  568. return false;
  569. }
  570. let that = this;
  571. let params = {};
  572. params.slbCollect = JSON.stringify({
  573. fkBisNo: that.curItem.bisNo,
  574. bisType: '2',
  575. userNo: uni.getStorageSync('userNo'),
  576. });
  577. request.post('/slbCollect/add', params).then(res => {
  578. if (res.success) {
  579. uni.showToast({
  580. title: '信息已收藏,请在我的收藏里查看阅读',
  581. duration: 2000,
  582. icon: 'none'
  583. });
  584. that.showSheet = false;
  585. } else {
  586. uni.showToast({
  587. title: res.msg
  588. })
  589. }
  590. })
  591. },
  592. delColl() {
  593. let that = this;
  594. request.post('/slbCollect/del', {
  595. id: that.collId
  596. }).then(res => {
  597. if (res.success) {
  598. uni.showToast({
  599. title: '取消成功'
  600. })
  601. that.showSheet = false;
  602. } else {
  603. uni.showToast({
  604. title: res.msg
  605. })
  606. }
  607. })
  608. },
  609. search() {
  610. this.fetchData();
  611. },
  612. searchProd() {
  613. this.searchProdValue = '';
  614. this.fetchData();
  615. },
  616. cancel() {
  617. this.searchValue = '';
  618. this.fetchData();
  619. },
  620. clear() {
  621. this.searchValue = '';
  622. this.fetchData();
  623. },
  624. clearProd() {
  625. this.searchProdValue = '';
  626. uni.removeStorageSync('searchProdValue');
  627. this.fetchData();
  628. },
  629. clearProd2() {
  630. this.searchProdValue2 = '';
  631. uni.removeStorageSync('searchProdValue2');
  632. this.fetchData();
  633. }
  634. }
  635. }
  636. </script>
  637. <style lang="scss" scoped>
  638. .circle {
  639. max-height: 100vh;
  640. }
  641. /* 底部安全边距 start*/
  642. .tn-tabbar-height {
  643. min-height: 120rpx;
  644. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  645. height: calc(140rpx + constant(safe-area-inset-bottom));
  646. }
  647. /* 自定义导航栏内容 start */
  648. .custom-nav {
  649. height: 100%;
  650. &__back {
  651. margin: auto 5rpx;
  652. font-size: 40rpx;
  653. margin-right: 10rpx;
  654. margin-left: 30rpx;
  655. flex-basis: 5%;
  656. }
  657. &__search {
  658. flex-basis: 60%;
  659. width: 100%;
  660. height: 100%;
  661. &__box {
  662. width: 100%;
  663. height: 70%;
  664. padding: 10rpx 0;
  665. margin: 0 30rpx;
  666. border-radius: 60rpx 60rpx 0 60rpx;
  667. font-size: 24rpx;
  668. }
  669. &__icon {
  670. padding-right: 10rpx;
  671. margin-left: 20rpx;
  672. font-size: 30rpx;
  673. }
  674. &__text {
  675. color: #AAAAAA;
  676. }
  677. }
  678. }
  679. .logo-image {
  680. width: 60rpx;
  681. height: 60rpx;
  682. position: relative;
  683. margin-top: -15rpx;
  684. }
  685. .logo-pic {
  686. background-size: cover;
  687. background-repeat: no-repeat;
  688. // background-attachment:fixed;
  689. background-position: top;
  690. border-radius: 50%;
  691. }
  692. /* 自定义导航栏内容 end */
  693. /* 博主头像 start*/
  694. .image-circle {
  695. // padding: 95rpx;
  696. width: 190rpx;
  697. height: 190rpx;
  698. font-size: 40rpx;
  699. font-weight: 300;
  700. position: relative;
  701. }
  702. .image-pic {
  703. border: 1rpx solid #F8F7F8;
  704. background-size: cover;
  705. background-repeat: no-repeat;
  706. // background-attachment:fixed;
  707. background-position: top;
  708. border-radius: 10rpx;
  709. }
  710. .tn-color-cat {
  711. color: #1D2541;
  712. }
  713. .tn-bg-cat {
  714. background-color: #1D2541;
  715. }
  716. /* 文章内容 start*/
  717. .blogger {
  718. &__item {
  719. padding: 30rpx;
  720. }
  721. &__author {
  722. &__btn {
  723. margin-right: -12rpx;
  724. opacity: 0.5;
  725. }
  726. }
  727. &__desc {
  728. line-height: 30rpx;
  729. &__label {
  730. color: #1D2541;
  731. background-color: #F3F2F7;
  732. border-radius: 10rpx;
  733. font-size: 22rpx;
  734. padding: 5rpx 15rpx;
  735. margin: 5rpx 18rpx 0 0;
  736. &--prefix {
  737. font-size: 24rpx;
  738. color: #1D2541;
  739. padding-right: 10rpx;
  740. }
  741. }
  742. &__content {
  743. line-height: 50rpx;
  744. }
  745. }
  746. &__content {
  747. margin-top: 18rpx;
  748. padding-right: 18rpx;
  749. &__data {
  750. line-height: 46rpx;
  751. text-align: justify;
  752. overflow: hidden;
  753. transition: all 0.25s ease-in-out;
  754. }
  755. &__status {
  756. margin-top: 10rpx;
  757. font-size: 26rpx;
  758. color: #82B2FF;
  759. }
  760. }
  761. &__main-image {
  762. border: 1rpx solid #F8F7F8;
  763. border-radius: 16rpx;
  764. &--1 {
  765. max-width: 80%;
  766. max-height: 300rpx;
  767. }
  768. &--2 {
  769. max-width: 260rpx;
  770. max-height: 260rpx;
  771. }
  772. &--3 {
  773. height: 212rpx;
  774. width: 100%;
  775. }
  776. }
  777. &__count-icon {
  778. font-size: 40rpx;
  779. padding-right: 5rpx;
  780. }
  781. &__ad {
  782. width: 100%;
  783. height: 500rpx;
  784. transform: translate3d(0px, 0px, 0px) !important;
  785. ::v-deep .uni-swiper-slide-frame {
  786. transform: translate3d(0px, 0px, 0px) !important;
  787. }
  788. .uni-swiper-slide-frame {
  789. transform: translate3d(0px, 0px, 0px) !important;
  790. }
  791. &__item {
  792. position: absolute;
  793. width: 100%;
  794. height: 100%;
  795. transform-origin: left center;
  796. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  797. transition: transform 0.25s ease-in-out;
  798. z-index: 1;
  799. &--0 {
  800. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  801. z-index: 4;
  802. }
  803. &--1 {
  804. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  805. z-index: 3;
  806. }
  807. &--2 {
  808. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  809. z-index: 2;
  810. }
  811. }
  812. &__content {
  813. border-radius: 40rpx;
  814. width: 640rpx;
  815. height: 500rpx;
  816. overflow: hidden;
  817. }
  818. &__image {
  819. width: 100%;
  820. height: 100%;
  821. }
  822. }
  823. }
  824. /* 文章内容 end*/
  825. /* 间隔线 start*/
  826. .tn-strip-bottom {
  827. width: 100%;
  828. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  829. }
  830. /* 间隔线 end*/
  831. /* 广告内容 start */
  832. .ad-image {
  833. width: 80rpx;
  834. height: 80rpx;
  835. position: relative;
  836. }
  837. .ad-pic {
  838. background-size: cover;
  839. background-repeat: no-repeat;
  840. // background-attachment:fixed;
  841. background-position: top;
  842. border-radius: 20%;
  843. }
  844. /* 自定义导航栏内容 end */
  845. /* 全屏轮播 start*/
  846. .card-swiper {
  847. height: 100vh !important;
  848. }
  849. .card-swiper swiper-item {
  850. width: 750rpx !important;
  851. left: 0rpx;
  852. box-sizing: border-box;
  853. overflow: initial;
  854. }
  855. .card-swiper swiper-item .swiper-item {
  856. width: 100%;
  857. display: block;
  858. height: 100vh;
  859. border-radius: 0rpx;
  860. transform: scale(1);
  861. transition: all 0.2s ease-in 0s;
  862. overflow: hidden;
  863. }
  864. .card-swiper swiper-item.cur .swiper-item {
  865. transform: none;
  866. transition: all 0.2s ease-in 0s;
  867. }
  868. .card-swiper swiper-item .swiper-item-png {
  869. margin-top: -50vh;
  870. width: 100%;
  871. display: block;
  872. border-radius: 0rpx;
  873. transform: translate(1040rpx, 20rpx) scale(0.5, 0.5);
  874. transition: all 0.6s ease 0s;
  875. // overflow: hidden;
  876. }
  877. .card-swiper swiper-item.cur .swiper-item-png {
  878. margin-top: -100vh;
  879. width: 900rpx;
  880. transform: translate(-80rpx, 0rpx) scale(1, 1);
  881. transition: all 0.6s ease 0s;
  882. }
  883. .image-banner {
  884. display: flex;
  885. align-items: center;
  886. justify-content: center;
  887. }
  888. .image-banner image {
  889. width: 100%;
  890. }
  891. /* 轮播指示点 start*/
  892. .indication {
  893. z-index: 9999;
  894. width: 100%;
  895. height: 36rpx;
  896. position: fixed;
  897. // display:flex;
  898. display: block;
  899. flex-direction: row;
  900. align-items: center;
  901. justify-content: center;
  902. }
  903. .spot {
  904. background-color: #000;
  905. opacity: 0.3;
  906. width: 10rpx;
  907. height: 10rpx;
  908. border-radius: 20rpx;
  909. margin: 20rpx 0 !important;
  910. left: 95vw;
  911. top: -60vh;
  912. position: relative;
  913. }
  914. .spot.active {
  915. opacity: 0.6;
  916. height: 30rpx;
  917. background-color: #000;
  918. }
  919. /* 资讯主图 start*/
  920. .image-article {
  921. border-radius: 8rpx;
  922. border: 1rpx solid #F8F7F8;
  923. width: 200rpx;
  924. height: 200rpx;
  925. position: relative;
  926. }
  927. .image-pic {
  928. background-size: cover;
  929. background-repeat: no-repeat;
  930. // background-attachment:fixed;
  931. background-position: top;
  932. border-radius: 10rpx;
  933. }
  934. .article-shadow {
  935. border-radius: 15rpx;
  936. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  937. }
  938. /* 文字截取*/
  939. .clamp-text-1 {
  940. -webkit-line-clamp: 1;
  941. display: -webkit-box;
  942. -webkit-box-orient: vertical;
  943. text-overflow: ellipsis;
  944. overflow: hidden;
  945. }
  946. .clamp-text-2 {
  947. -webkit-line-clamp: 2;
  948. display: -webkit-box;
  949. -webkit-box-orient: vertical;
  950. text-overflow: ellipsis;
  951. overflow: hidden;
  952. }
  953. /* 标签内容 start*/
  954. .tn-tag-content {
  955. &__item {
  956. display: inline-block;
  957. line-height: 35rpx;
  958. color: #1D2541;
  959. background-color: #F3F2F7;
  960. border-radius: 10rpx;
  961. font-size: 22rpx;
  962. padding: 5rpx 15rpx;
  963. &--prefix {
  964. padding-right: 10rpx;
  965. }
  966. }
  967. }
  968. /* 图标容器9 start */
  969. .icon9 {
  970. &__item {
  971. width: 30%;
  972. background-color: #FFFFFF;
  973. border-radius: 10rpx;
  974. padding: 30rpx;
  975. margin: 20rpx 10rpx;
  976. transform: scale(1);
  977. transition: transform 0.3s linear;
  978. transform-origin: center center;
  979. &--icon {
  980. width: 110rpx;
  981. height: 110rpx;
  982. font-size: 65rpx;
  983. border-radius: 50%;
  984. margin: 20rpx 40rpx;
  985. position: relative;
  986. z-index: 1;
  987. &::after {
  988. content: " ";
  989. position: absolute;
  990. z-index: -1;
  991. width: 100%;
  992. height: 100%;
  993. left: 0;
  994. bottom: 0;
  995. border-radius: inherit;
  996. opacity: 1;
  997. transform: scale(1, 1);
  998. background-size: 100% 100%;
  999. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png);
  1000. }
  1001. }
  1002. }
  1003. }
  1004. /* 悬浮 */
  1005. .tnxuanfu {
  1006. animation: suspension 3s ease-in-out infinite;
  1007. }
  1008. @keyframes suspension {
  1009. 0%,
  1010. 100% {
  1011. transform: translateY(0);
  1012. }
  1013. 50% {
  1014. transform: translateY(-0.8rem);
  1015. }
  1016. }
  1017. /* 悬浮按钮 */
  1018. .button-shop {
  1019. width: 90rpx;
  1020. height: 90rpx;
  1021. display: flex;
  1022. flex-direction: row;
  1023. position: fixed;
  1024. /* bottom:200rpx;
  1025. right: 20rpx; */
  1026. left: 5rpx;
  1027. top: 5rpx;
  1028. z-index: 1001;
  1029. border-radius: 100px;
  1030. opacity: 0.9;
  1031. }
  1032. /* 按钮 */
  1033. .edit {
  1034. bottom: 300rpx;
  1035. right: 75rpx;
  1036. position: fixed;
  1037. z-index: 9999;
  1038. }
  1039. .pa,
  1040. .pa0 {
  1041. position: absolute
  1042. }
  1043. .pa0 {
  1044. left: 0;
  1045. top: 0
  1046. }
  1047. .bg0 {
  1048. width: 100rpx;
  1049. height: 100rpx;
  1050. top: 50%;
  1051. left: 50%;
  1052. transform: translate(-50%, -50%);
  1053. }
  1054. .bg1 {
  1055. width: 100%;
  1056. height: 100%;
  1057. }
  1058. .hx-box {
  1059. top: 50%;
  1060. left: 50%;
  1061. width: 100rpx;
  1062. height: 100rpx;
  1063. transform-style: preserve-3d;
  1064. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  1065. }
  1066. .hx-box .pr {
  1067. width: 100rpx;
  1068. height: 100rpx;
  1069. transform-style: preserve-3d;
  1070. animation: hxz 20s linear infinite;
  1071. }
  1072. @keyframes hxz {
  1073. 0% {
  1074. transform: rotateX(0deg);
  1075. }
  1076. 100% {
  1077. transform: rotateX(-360deg);
  1078. }
  1079. }
  1080. .hx-box .pr .pa0 {
  1081. width: 100rpx;
  1082. height: 100rpx;
  1083. /* border: 4px solid #5ec0ff; */
  1084. border-radius: 1000px;
  1085. }
  1086. .hx-box .pr .pa0 .span {
  1087. display: block;
  1088. width: 100%;
  1089. height: 100%;
  1090. background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc4.png) no-repeat center center;
  1091. background-size: 100% 100%;
  1092. animation: hx 4s linear infinite;
  1093. }
  1094. @keyframes hx {
  1095. to {
  1096. transform: rotate(360deg);
  1097. }
  1098. }
  1099. .hx-k1 {
  1100. transform: rotateX(-60deg) rotateZ(-60deg)
  1101. }
  1102. .hx-k2 {
  1103. transform: rotateX(-30deg) rotateZ(-30deg)
  1104. }
  1105. .hx-k3 {
  1106. transform: rotateX(0deg) rotateZ(0deg)
  1107. }
  1108. .hx-k4 {
  1109. transform: rotateX(30deg) rotateZ(30deg)
  1110. }
  1111. .hx-k5 {
  1112. transform: rotateX(60deg) rotateZ(60deg)
  1113. }
  1114. .hx-k6 {
  1115. transform: rotateX(90deg) rotateZ(90deg)
  1116. }
  1117. /deep/ .basic-table-header {
  1118. background-color: #edeeee;
  1119. }
  1120. .bg-content{
  1121. color: #fff;
  1122. background-image: url(./../../static/bg.png);
  1123. background-size: cover;
  1124. }
  1125. </style>