comm.vue 31 KB

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