comm.vue 31 KB

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