comm.vue 31 KB

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