comm.vue 28 KB

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