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