comm.vue 31 KB

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