comm.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298
  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 :showHeight="120" openText="查看全部">
  112. <rich-text :nodes="scope.prodDesc"></rich-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. if (uni.getStorageSync('searchProdValue')) {
  443. that.searchProdValue = uni.getStorageSync('searchProdValue');
  444. }
  445. if (uni.getStorageSync('searchProdValue2')) {
  446. that.searchProdValue2 = uni.getStorageSync('searchProdValue2');
  447. }
  448. request.post('/slbResourceShare/query', {
  449. type: that.currentTab == 1 ? '2' : '1',
  450. index: curIndex,
  451. content: that.currentTab == 1 ? (that.searchProdValue2 ? that.searchProdValue2.split('/')[1]:'') : undefined,
  452. prodSpec: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[2] :
  453. '') : undefined,
  454. prodName: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[0] :
  455. '') : undefined,
  456. brand: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[1] :
  457. '') : that.currentTab == 1 ?(that.searchProdValue2 ? that.searchProdValue2.split('/')[0]:''): undefined,
  458. }).then(res => {
  459. that.loading = false;
  460. if (res && res.success) {
  461. that.totalSize = res.total || 0;
  462. let newList = res.list || [];
  463. for (let i = 0; i < newList.length; i++) {
  464. newList[i].imgList = [];
  465. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  466. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  467. newList[i].imgList.push(newList[i].fileDetailList[j]);
  468. }
  469. }
  470. }
  471. if (curIndex == 1) {
  472. that.content = newList || [];
  473. } else {
  474. that.content = that.content.concat(newList || []);
  475. }
  476. }
  477. that.showEmpty = true;
  478. console.warn(res);
  479. })
  480. // let contentRect = {}
  481. // const query = uni.createSelectorQuery().in(this)
  482. // // 筛选出存在内容的数据
  483. // this.content.forEach((item, index) => {
  484. // if (item?.content) {
  485. // query.select(`#blogger__content--${index}`).boundingClientRect()
  486. // contentRect[index] = item
  487. // }
  488. // })
  489. // // 获取所有内容的宽高信息
  490. // query.exec(res => {
  491. // if (!res) {
  492. // setTimeout(() => {
  493. // this.fetchData()
  494. // }, 10)
  495. // return
  496. // }
  497. // // console.log(res);
  498. // res.map((item) => {
  499. // // console.log(item.height, this.contentHideShowHeight);
  500. // // 获取对应的标号
  501. // const id = item.id
  502. // const idIndex = /blogger__content--(\d)/.exec(id)[1]
  503. // let contentItem = this.content[idIndex]
  504. // contentItem.hideContent = item.height > this.contentHideShowHeight
  505. // contentItem.showAllContent = false
  506. // contentItem.contentContainerHeight = item.height
  507. // contentItem.contentContainerInit = true
  508. // this.$set(this.content, idIndex, contentItem)
  509. // // console.log(/blogger__content--(\d)/.exec(id)[1]);
  510. // })
  511. // })
  512. },
  513. showActionSheet(item) {
  514. let that = this;
  515. this.curItem = item;
  516. this.collStatus = false;
  517. this.showSheet = true;
  518. that.showContact = false;
  519. if (uni.getStorageSync('userNo')) {
  520. let params = {};
  521. params = {
  522. fkBisNo: that.curItem.bisNo,
  523. userNo: uni.getStorageSync('userNo'),
  524. };
  525. request.post('/slbCollect/query', params).then(res => {
  526. if (res.success) {
  527. if (res.list && res.list.length > 0) {
  528. that.collStatus = true;
  529. that.collId = res.list[0].id;
  530. }
  531. }
  532. })
  533. }
  534. },
  535. linkTel() {
  536. if (!uni.getStorageSync('userNo')) {
  537. uni.showToast({
  538. title: '请登录'
  539. })
  540. uni.navigateTo({
  541. url: '/pages/login/login'
  542. })
  543. return false;
  544. }
  545. let that = this;
  546. let params = {};
  547. params.slbBisContact = JSON.stringify({
  548. fkBisNo: that.curItem.bisNo,
  549. bisType: '2',
  550. type: '1',
  551. userNo: uni.getStorageSync('userNo'),
  552. });
  553. request.post('/slbBisContact/add', params).then(res => {
  554. if (res.success) {
  555. that.showContact = true;
  556. that.curContact.company = that.curItem.company;
  557. that.curContact.contactMethod = res.resultMap.contactMethod;
  558. that.curContact.contactPerson = res.resultMap.contactPerson;
  559. } else {
  560. that.showContact = false;
  561. uni.showToast({
  562. title: res.msg,
  563. icon: 'none'
  564. })
  565. }
  566. })
  567. },
  568. addColl() {
  569. if (!uni.getStorageSync('userNo')) {
  570. uni.showToast({
  571. title: '请登录'
  572. })
  573. uni.navigateTo({
  574. url: '/pages/login/login'
  575. })
  576. return false;
  577. }
  578. let that = this;
  579. let params = {};
  580. params.slbCollect = JSON.stringify({
  581. fkBisNo: that.curItem.bisNo,
  582. bisType: '2',
  583. userNo: uni.getStorageSync('userNo'),
  584. });
  585. request.post('/slbCollect/add', params).then(res => {
  586. if (res.success) {
  587. uni.showToast({
  588. title: '信息已收藏,请在我的收藏里查看阅读',
  589. duration: 2000,
  590. icon: 'none'
  591. });
  592. that.showSheet = false;
  593. } else {
  594. uni.showToast({
  595. title: res.msg
  596. })
  597. }
  598. })
  599. },
  600. delColl() {
  601. let that = this;
  602. request.post('/slbCollect/del', {
  603. id: that.collId
  604. }).then(res => {
  605. if (res.success) {
  606. uni.showToast({
  607. title: '取消成功'
  608. })
  609. that.showSheet = false;
  610. } else {
  611. uni.showToast({
  612. title: res.msg
  613. })
  614. }
  615. })
  616. },
  617. search() {
  618. this.fetchData();
  619. },
  620. searchProd() {
  621. this.searchProdValue = '';
  622. this.fetchData();
  623. },
  624. cancel() {
  625. this.searchValue = '';
  626. this.fetchData();
  627. },
  628. clear() {
  629. this.searchValue = '';
  630. this.fetchData();
  631. },
  632. clearProd() {
  633. this.searchProdValue = '';
  634. uni.removeStorageSync('searchProdValue');
  635. this.fetchData();
  636. },
  637. clearProd2() {
  638. this.searchProdValue2 = '';
  639. uni.removeStorageSync('searchProdValue2');
  640. this.fetchData();
  641. }
  642. }
  643. }
  644. </script>
  645. <style lang="scss" scoped>
  646. .circle {
  647. max-height: 100vh;
  648. }
  649. /* 底部安全边距 start*/
  650. .tn-tabbar-height {
  651. min-height: 120rpx;
  652. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  653. height: calc(140rpx + constant(safe-area-inset-bottom));
  654. }
  655. /* 自定义导航栏内容 start */
  656. .custom-nav {
  657. height: 100%;
  658. &__back {
  659. margin: auto 5rpx;
  660. font-size: 40rpx;
  661. margin-right: 10rpx;
  662. margin-left: 30rpx;
  663. flex-basis: 5%;
  664. }
  665. &__search {
  666. flex-basis: 60%;
  667. width: 100%;
  668. height: 100%;
  669. &__box {
  670. width: 100%;
  671. height: 70%;
  672. padding: 10rpx 0;
  673. margin: 0 30rpx;
  674. border-radius: 60rpx 60rpx 0 60rpx;
  675. font-size: 24rpx;
  676. }
  677. &__icon {
  678. padding-right: 10rpx;
  679. margin-left: 20rpx;
  680. font-size: 30rpx;
  681. }
  682. &__text {
  683. color: #AAAAAA;
  684. }
  685. }
  686. }
  687. .logo-image {
  688. width: 60rpx;
  689. height: 60rpx;
  690. position: relative;
  691. margin-top: -15rpx;
  692. }
  693. .logo-pic {
  694. background-size: cover;
  695. background-repeat: no-repeat;
  696. // background-attachment:fixed;
  697. background-position: top;
  698. border-radius: 50%;
  699. }
  700. /* 自定义导航栏内容 end */
  701. /* 博主头像 start*/
  702. .image-circle {
  703. // padding: 95rpx;
  704. width: 190rpx;
  705. height: 190rpx;
  706. font-size: 40rpx;
  707. font-weight: 300;
  708. position: relative;
  709. }
  710. .image-pic {
  711. border: 1rpx solid #F8F7F8;
  712. background-size: cover;
  713. background-repeat: no-repeat;
  714. // background-attachment:fixed;
  715. background-position: top;
  716. border-radius: 10rpx;
  717. }
  718. .tn-color-cat {
  719. color: #1D2541;
  720. }
  721. .tn-bg-cat {
  722. background-color: #1D2541;
  723. }
  724. /* 文章内容 start*/
  725. .blogger {
  726. &__item {
  727. padding: 30rpx;
  728. }
  729. &__author {
  730. &__btn {
  731. margin-right: -12rpx;
  732. opacity: 0.5;
  733. }
  734. }
  735. &__desc {
  736. line-height: 30rpx;
  737. &__label {
  738. color: #1D2541;
  739. background-color: #F3F2F7;
  740. border-radius: 10rpx;
  741. font-size: 22rpx;
  742. padding: 5rpx 15rpx;
  743. margin: 5rpx 18rpx 0 0;
  744. &--prefix {
  745. font-size: 24rpx;
  746. color: #1D2541;
  747. padding-right: 10rpx;
  748. }
  749. }
  750. &__content {
  751. line-height: 50rpx;
  752. }
  753. }
  754. &__content {
  755. margin-top: 18rpx;
  756. padding-right: 18rpx;
  757. &__data {
  758. line-height: 46rpx;
  759. text-align: justify;
  760. overflow: hidden;
  761. transition: all 0.25s ease-in-out;
  762. }
  763. &__status {
  764. margin-top: 10rpx;
  765. font-size: 26rpx;
  766. color: #82B2FF;
  767. }
  768. }
  769. &__main-image {
  770. border: 1rpx solid #F8F7F8;
  771. border-radius: 16rpx;
  772. &--1 {
  773. max-width: 80%;
  774. max-height: 300rpx;
  775. }
  776. &--2 {
  777. max-width: 260rpx;
  778. max-height: 260rpx;
  779. }
  780. &--3 {
  781. height: 212rpx;
  782. width: 100%;
  783. }
  784. }
  785. &__count-icon {
  786. font-size: 40rpx;
  787. padding-right: 5rpx;
  788. }
  789. &__ad {
  790. width: 100%;
  791. height: 500rpx;
  792. transform: translate3d(0px, 0px, 0px) !important;
  793. ::v-deep .uni-swiper-slide-frame {
  794. transform: translate3d(0px, 0px, 0px) !important;
  795. }
  796. .uni-swiper-slide-frame {
  797. transform: translate3d(0px, 0px, 0px) !important;
  798. }
  799. &__item {
  800. position: absolute;
  801. width: 100%;
  802. height: 100%;
  803. transform-origin: left center;
  804. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  805. transition: transform 0.25s ease-in-out;
  806. z-index: 1;
  807. &--0 {
  808. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  809. z-index: 4;
  810. }
  811. &--1 {
  812. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  813. z-index: 3;
  814. }
  815. &--2 {
  816. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  817. z-index: 2;
  818. }
  819. }
  820. &__content {
  821. border-radius: 40rpx;
  822. width: 640rpx;
  823. height: 500rpx;
  824. overflow: hidden;
  825. }
  826. &__image {
  827. width: 100%;
  828. height: 100%;
  829. }
  830. }
  831. }
  832. /* 文章内容 end*/
  833. /* 间隔线 start*/
  834. .tn-strip-bottom {
  835. width: 100%;
  836. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  837. }
  838. /* 间隔线 end*/
  839. /* 广告内容 start */
  840. .ad-image {
  841. width: 80rpx;
  842. height: 80rpx;
  843. position: relative;
  844. }
  845. .ad-pic {
  846. background-size: cover;
  847. background-repeat: no-repeat;
  848. // background-attachment:fixed;
  849. background-position: top;
  850. border-radius: 20%;
  851. }
  852. /* 自定义导航栏内容 end */
  853. /* 全屏轮播 start*/
  854. .card-swiper {
  855. height: 100vh !important;
  856. }
  857. .card-swiper swiper-item {
  858. width: 750rpx !important;
  859. left: 0rpx;
  860. box-sizing: border-box;
  861. overflow: initial;
  862. }
  863. .card-swiper swiper-item .swiper-item {
  864. width: 100%;
  865. display: block;
  866. height: 100vh;
  867. border-radius: 0rpx;
  868. transform: scale(1);
  869. transition: all 0.2s ease-in 0s;
  870. overflow: hidden;
  871. }
  872. .card-swiper swiper-item.cur .swiper-item {
  873. transform: none;
  874. transition: all 0.2s ease-in 0s;
  875. }
  876. .card-swiper swiper-item .swiper-item-png {
  877. margin-top: -50vh;
  878. width: 100%;
  879. display: block;
  880. border-radius: 0rpx;
  881. transform: translate(1040rpx, 20rpx) scale(0.5, 0.5);
  882. transition: all 0.6s ease 0s;
  883. // overflow: hidden;
  884. }
  885. .card-swiper swiper-item.cur .swiper-item-png {
  886. margin-top: -100vh;
  887. width: 900rpx;
  888. transform: translate(-80rpx, 0rpx) scale(1, 1);
  889. transition: all 0.6s ease 0s;
  890. }
  891. .image-banner {
  892. display: flex;
  893. align-items: center;
  894. justify-content: center;
  895. }
  896. .image-banner image {
  897. width: 100%;
  898. }
  899. /* 轮播指示点 start*/
  900. .indication {
  901. z-index: 9999;
  902. width: 100%;
  903. height: 36rpx;
  904. position: fixed;
  905. // display:flex;
  906. display: block;
  907. flex-direction: row;
  908. align-items: center;
  909. justify-content: center;
  910. }
  911. .spot {
  912. background-color: #000;
  913. opacity: 0.3;
  914. width: 10rpx;
  915. height: 10rpx;
  916. border-radius: 20rpx;
  917. margin: 20rpx 0 !important;
  918. left: 95vw;
  919. top: -60vh;
  920. position: relative;
  921. }
  922. .spot.active {
  923. opacity: 0.6;
  924. height: 30rpx;
  925. background-color: #000;
  926. }
  927. /* 资讯主图 start*/
  928. .image-article {
  929. border-radius: 8rpx;
  930. border: 1rpx solid #F8F7F8;
  931. width: 200rpx;
  932. height: 200rpx;
  933. position: relative;
  934. }
  935. .image-pic {
  936. background-size: cover;
  937. background-repeat: no-repeat;
  938. // background-attachment:fixed;
  939. background-position: top;
  940. border-radius: 10rpx;
  941. }
  942. .article-shadow {
  943. border-radius: 15rpx;
  944. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  945. }
  946. /* 文字截取*/
  947. .clamp-text-1 {
  948. -webkit-line-clamp: 1;
  949. display: -webkit-box;
  950. -webkit-box-orient: vertical;
  951. text-overflow: ellipsis;
  952. overflow: hidden;
  953. }
  954. .clamp-text-2 {
  955. -webkit-line-clamp: 2;
  956. display: -webkit-box;
  957. -webkit-box-orient: vertical;
  958. text-overflow: ellipsis;
  959. overflow: hidden;
  960. }
  961. /* 标签内容 start*/
  962. .tn-tag-content {
  963. &__item {
  964. display: inline-block;
  965. line-height: 35rpx;
  966. color: #1D2541;
  967. background-color: #F3F2F7;
  968. border-radius: 10rpx;
  969. font-size: 22rpx;
  970. padding: 5rpx 15rpx;
  971. &--prefix {
  972. padding-right: 10rpx;
  973. }
  974. }
  975. }
  976. /* 图标容器9 start */
  977. .icon9 {
  978. &__item {
  979. width: 30%;
  980. background-color: #FFFFFF;
  981. border-radius: 10rpx;
  982. padding: 30rpx;
  983. margin: 20rpx 10rpx;
  984. transform: scale(1);
  985. transition: transform 0.3s linear;
  986. transform-origin: center center;
  987. &--icon {
  988. width: 110rpx;
  989. height: 110rpx;
  990. font-size: 65rpx;
  991. border-radius: 50%;
  992. margin: 20rpx 40rpx;
  993. position: relative;
  994. z-index: 1;
  995. &::after {
  996. content: " ";
  997. position: absolute;
  998. z-index: -1;
  999. width: 100%;
  1000. height: 100%;
  1001. left: 0;
  1002. bottom: 0;
  1003. border-radius: inherit;
  1004. opacity: 1;
  1005. transform: scale(1, 1);
  1006. background-size: 100% 100%;
  1007. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png);
  1008. }
  1009. }
  1010. }
  1011. }
  1012. /* 悬浮 */
  1013. .tnxuanfu {
  1014. animation: suspension 3s ease-in-out infinite;
  1015. }
  1016. @keyframes suspension {
  1017. 0%,
  1018. 100% {
  1019. transform: translateY(0);
  1020. }
  1021. 50% {
  1022. transform: translateY(-0.8rem);
  1023. }
  1024. }
  1025. /* 悬浮按钮 */
  1026. .button-shop {
  1027. width: 90rpx;
  1028. height: 90rpx;
  1029. display: flex;
  1030. flex-direction: row;
  1031. position: fixed;
  1032. /* bottom:200rpx;
  1033. right: 20rpx; */
  1034. left: 5rpx;
  1035. top: 5rpx;
  1036. z-index: 1001;
  1037. border-radius: 100px;
  1038. opacity: 0.9;
  1039. }
  1040. /* 按钮 */
  1041. .edit {
  1042. bottom: 300rpx;
  1043. right: 75rpx;
  1044. position: fixed;
  1045. z-index: 9999;
  1046. }
  1047. .pa,
  1048. .pa0 {
  1049. position: absolute
  1050. }
  1051. .pa0 {
  1052. left: 0;
  1053. top: 0
  1054. }
  1055. .bg0 {
  1056. width: 100rpx;
  1057. height: 100rpx;
  1058. top: 50%;
  1059. left: 50%;
  1060. transform: translate(-50%, -50%);
  1061. }
  1062. .bg1 {
  1063. width: 100%;
  1064. height: 100%;
  1065. }
  1066. .hx-box {
  1067. top: 50%;
  1068. left: 50%;
  1069. width: 100rpx;
  1070. height: 100rpx;
  1071. transform-style: preserve-3d;
  1072. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  1073. }
  1074. .hx-box .pr {
  1075. width: 100rpx;
  1076. height: 100rpx;
  1077. transform-style: preserve-3d;
  1078. animation: hxz 20s linear infinite;
  1079. }
  1080. @keyframes hxz {
  1081. 0% {
  1082. transform: rotateX(0deg);
  1083. }
  1084. 100% {
  1085. transform: rotateX(-360deg);
  1086. }
  1087. }
  1088. .hx-box .pr .pa0 {
  1089. width: 100rpx;
  1090. height: 100rpx;
  1091. /* border: 4px solid #5ec0ff; */
  1092. border-radius: 1000px;
  1093. }
  1094. .hx-box .pr .pa0 .span {
  1095. display: block;
  1096. width: 100%;
  1097. height: 100%;
  1098. background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc4.png) no-repeat center center;
  1099. background-size: 100% 100%;
  1100. animation: hx 4s linear infinite;
  1101. }
  1102. @keyframes hx {
  1103. to {
  1104. transform: rotate(360deg);
  1105. }
  1106. }
  1107. .hx-k1 {
  1108. transform: rotateX(-60deg) rotateZ(-60deg)
  1109. }
  1110. .hx-k2 {
  1111. transform: rotateX(-30deg) rotateZ(-30deg)
  1112. }
  1113. .hx-k3 {
  1114. transform: rotateX(0deg) rotateZ(0deg)
  1115. }
  1116. .hx-k4 {
  1117. transform: rotateX(30deg) rotateZ(30deg)
  1118. }
  1119. .hx-k5 {
  1120. transform: rotateX(60deg) rotateZ(60deg)
  1121. }
  1122. .hx-k6 {
  1123. transform: rotateX(90deg) rotateZ(90deg)
  1124. }
  1125. /deep/ .basic-table-header {
  1126. background-color: #edeeee;
  1127. }
  1128. .bg-content{
  1129. color: #fff;
  1130. background-image: url(./../../static/bg.png);
  1131. background-size: cover;
  1132. }
  1133. </style>