home.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469
  1. <template>
  2. <view class="index tn-safe-area-inset-bottom">
  3. <view class="">
  4. <uv-sticky bgColor="#ffffff">
  5. <uni-search-bar radius="15" placeholder="搜索" @confirm="search" v-model="searchValue" @blur="search"
  6. @cancel="cancel" @clear="clear" cancelButton="auto" clearButton="auto"
  7. style="border-bottom: 1rpx solid #f1f1f1cc;">
  8. </uni-search-bar></uv-sticky>
  9. <!-- 图文信息 -->
  10. <block v-for="(item,index) in content" :key="item.id" >
  11. <view class="blogger__item">
  12. <view class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center">
  13. <view class="justify__author__info" @click="tn('')">
  14. <view class="tn-flex tn-flex-row-center">
  15. <view class="tn-flex tn-flex-row-center tn-flex-col-center">
  16. <!-- <view class="">
  17. <tn-avatar class="" shape="circle" :src="item.userAvatar" size="lg">
  18. </tn-avatar>
  19. </view> -->
  20. <view class="tn-padding-right tn-text-ellipsis">
  21. <view class="tn-padding-right tn-color-grey tn-text-lg">
  22. {{ item.company }}
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view v-if="item.validDate"
  29. class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
  30. <text class="" style="background: #3F51B542;font-size: 12px;
  31. padding: 8px;
  32. color: #0000FF;
  33. border-radius: 24px;
  34. border-top-right-radius: 0;" @click="showValid(item.validDate)">{{item.validDate}}</text>
  35. </view>
  36. </view>
  37. <view
  38. class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left"
  39. @click="tn('')">
  40. <!-- <view v-for="(label_item,label_index) in item.label" :key="label_index"
  41. class="blogger__desc__label tn-float-left tn-margin-right">
  42. <text class="blogger__desc__label--prefix tn-icon-topics-fill"></text>
  43. <text class="tn-text-df">{{ label_item }}</text>
  44. </view> -->
  45. <!-- 不用限制长度了,因为发布的时候限制长度了-->
  46. <text
  47. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df">{{ item.content }}</text>
  48. </view>
  49. <block v-if="item.imgList">
  50. <view v-if="[1,2,4].indexOf(item.imgList.length) != -1" class="tn-padding-top-xs"
  51. @click="tn('')">
  52. <image v-for="(image_item,image_index) in item.imgList" :key="image_index"
  53. class="blogger__main-image" :class="{
  54. 'blogger__main-image--1 tn-margin-bottom-sm': item.imgList.length === 1,
  55. 'blogger__main-image--2 tn-margin-right-sm tn-margin-bottom-sm': item.imgList.length === 2 || item.imgList.length === 4
  56. }" :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  57. </view>
  58. <view v-else class="tn-padding-top-xs">
  59. <tn-grid hoverClass="none" :col="3">
  60. <block v-for="(image_item,image_index) in item.imgList" :key="image_index">
  61. <!-- #ifndef MP-WEIXIN -->
  62. <tn-grid-item style="width: 30%;margin: 10rpx;">
  63. <image class="blogger__main-image blogger__main-image--3"
  64. :src="image_item.ftpUrl" mode="aspectFill"
  65. @click="showImg(item.imgList,image_index)"></image>
  66. </tn-grid-item>
  67. <!-- #endif-->
  68. <!-- #ifdef MP-WEIXIN -->
  69. <tn-grid-item style="width: 30%;margin: 10rpx;">
  70. <image class="blogger__main-image blogger__main-image--3"
  71. :src="image_item.ftpUrl" mode="aspectFill"
  72. @click="showImg(item.imgList,image_index)"></image>
  73. </tn-grid-item>
  74. <!-- #endif-->
  75. </block>
  76. </tn-grid>
  77. </view>
  78. </block>
  79. <view v-for="file in item.fileDetailList" style="margin-bottom: 4px;" :key="file.id" v-if="!isImage(file.fileName)">
  80. <view>
  81. <text class="tn-icon-link"></text>
  82. <view style="display: inline-block;margin-left:8px" @click="clickLink(file.ftpUrl,file.fileName)">
  83. {{file.fileName}}</view>
  84. </view>
  85. </view>
  86. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-top-xs">
  87. <view class="justify-content-item tn-color-gray tn-text-center">
  88. <view class="tn-padding-right tn-padding-top-xs tn-color-gray">
  89. {{ item.createTime|formatDate }}
  90. </view>
  91. </view>
  92. <view class="justify-content-item tn-flex tn-flex-col-center" style="position: relative;">
  93. <text class="tn-icon-more-vertical tn-color-gray tn-text-bold tn-text-xxl"
  94. @click="showActionSheet(item)"></text>
  95. <view v-if="curItem.id==item.id&&showSheet" class="pop-dia" style="position: absolute;
  96. background: #ddd;
  97. display: block;
  98. right: 10px;
  99. top: 24px;border-radius: 16px;z-index: 900;border-top-right-radius: 0">
  100. <text class="tn-icon-close" style="float: right;padding:8px;color:#333" @click="hideSheet()"></text>
  101. <view class="content" style="padding: 24px 36px;font-size: 16px;line-height: 24px; width: calc(100vw - 52px);"
  102. v-if="!showContact">
  103. <button @click="linkTel()" style="border-radius:30px;color:#fff;background-color: #1d60b1;"><text
  104. class="tn-icon-service" style="margin-right: 12px;"></text> 联系需方</button>
  105. <!-- <view>联系我们帮助对接</view> -->
  106. <button v-if="!collStatus" @click="addColl"
  107. style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
  108. class="tn-icon-star" style="margin-right: 12px;"></text>
  109. 收&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;藏</button>
  110. <button v-if="collStatus" @click="delColl"
  111. style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
  112. class="tn-icon-star-fill" style="margin-right: 12px;"></text> 取消收藏</button>
  113. <button open-type="share"
  114. style="margin-top:10px;border-radius:30px;" type="default" plain="true" :data-coupon="curItem"><text
  115. class="tn-icon-send" style="margin-right: 12px;"></text>
  116. 转&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</button>
  117. </view>
  118. <view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 52px);line-height: 24px; border-radius: 16px;
  119. border-top-right-radius: 0;"
  120. v-if="showContact">
  121. <view><text style="font-size: 20px;font-weight: bold;" v-if="curContact.company">{{curContact.company}}</text></view>
  122. <view style="margin-top:20px;
  123. font-weight: bold;
  124. font-size: 20px;"><text class="tn-icon-my-formal"></text><text style="margin-left: 6px;">{{curContact.contactPerson}}</text> </view>
  125. <view style="margin-top:20px;font-size: 20px;font-weight: bold;" @click="showTel(curContact.contactMethod)"><text class="tn-icon-tel"></text>
  126. <text style="margin-left: 4px;">{{curContact.contactMethod}}</text> </view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. <!-- 边距间隔 -->
  133. <view class="tn-strip-bottom" v-if="index != content.length - 1"></view>
  134. </block>
  135. <view v-if="showEmpty&&content.length==0" style="margin-top: 32vh;">
  136. <tn-empty mode="list"></tn-empty>
  137. </view>
  138. <!-- 结尾 -->
  139. <view v-if="content.length==totalSize&&totalSize!=0" style="background-color: #f1f1f1cc;padding: 16px 0;" :style="{paddingTop:showSheet?'216px':'16px'}">
  140. <tn-load-more status="nomore" :loadText="loadText"></tn-load-more>
  141. </view>
  142. </view>
  143. <view class='tn-tabbar-height' :style="{marginTop: vuex_custom_bar_height + 'px'}"></view>
  144. <!-- <view v-if="curItem.id" style="position: fixed;background-color: red;width: 100vw;height: 100%;top:0"><view>1234</view></view> -->
  145. <tn-popup v-model="showSheet2" mode="center" closeBtn="true" borderRadius="16">
  146. <view class="content" style="padding: 24px 36px;font-size: 16px;line-height: 24px; width: 320px;"
  147. v-if="!showContact">
  148. <button @click="linkTel()" style="border-radius:30px;color:#fff;background-color: #1d60b1;"><text
  149. class="tn-icon-service" style="margin-right: 12px;"></text> 联系需方</button>
  150. <!-- <view>联系我们帮助对接</view> -->
  151. <button v-if="!collStatus" @click="addColl"
  152. style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
  153. class="tn-icon-star" style="margin-right: 12px;"></text>
  154. 收&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;藏</button>
  155. <button v-if="collStatus" @click="delColl"
  156. style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
  157. class="tn-icon-star-fill" style="margin-right: 12px;"></text> 取消收藏</button>
  158. <button open-type="share"
  159. style="margin-top:10px;border-radius:30px;" type="default" plain="true" :data-coupon="curItem"><text
  160. class="tn-icon-send" style="margin-right: 12px;"></text>
  161. 转&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</button>
  162. </view>
  163. <view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width:320px;line-height: 24px;"
  164. v-if="showContact">
  165. <view><text style="font-size: 20px;font-weight: bold;" v-if="curContact.company">{{curContact.company}}</text></view>
  166. <view style="margin-top:20px;
  167. font-weight: bold;
  168. font-size: 20px;"><text class="tn-icon-my-formal"></text><text style="margin-left: 6px;">{{curContact.contactPerson}}</text> </view>
  169. <view style="margin-top:20px;font-size: 20px;font-weight: bold;" @click="showTel(curContact.contactMethod)"><text class="tn-icon-tel"></text>
  170. <text style="margin-left: 4px;">{{curContact.contactMethod}}</text> </view>
  171. </view>
  172. </tn-popup>
  173. <tn-toast ref="toast"></tn-toast>
  174. </view>
  175. </template>
  176. <script>
  177. import request from '../../utils/request'
  178. export default {
  179. name: 'Index',
  180. data() {
  181. return {
  182. loading: false,
  183. loadText: {
  184. loadmore: '下拉加载',
  185. loading: '快速加载中...',
  186. nomore: '恭喜你,已阅读完所有需求信息哦!'
  187. },
  188. showContact: false,
  189. curContact: {},
  190. totalSize: 0,
  191. curIndex: 1,
  192. showSheet: false,
  193. curItem: {},
  194. userNo: '',
  195. searchValue: '',
  196. collStatus: '',
  197. cardCur: 0,
  198. collId: '',
  199. isAndroid: true,
  200. content: [],
  201. showEmpty:false,
  202. }
  203. },
  204. filters: {
  205. formatDate(value) {
  206. if (!value) return '';
  207. const date = new Date(value);
  208. const today = new Date();
  209. const yesterday = new Date(today); // 昨天的日期
  210. yesterday.setDate(yesterday.getDate() - 1); // 将昨天的日期设置为前一天
  211. if (date.getFullYear() == today.getFullYear() && date.getMonth() == today.getMonth() && date.getDate() ==
  212. today.getDate()) {
  213. return '今天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  214. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  215. }
  216. if (date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date
  217. .getDate() == yesterday.getDate()) {
  218. return '昨天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  219. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  220. }
  221. return date.toLocaleDateString() + ' ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  222. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  223. },
  224. },
  225. created() {
  226. const systemInfo = uni.getSystemInfoSync()
  227. if (systemInfo.system.toLocaleLowerCase().includes('ios')) {
  228. this.isAndroid = false
  229. } else {
  230. this.isAndroid = true
  231. }
  232. // const accountInfo = uni.getAccountInfoSync();
  233. // if(accountInfo&&accountInfo.miniProgram.envVersion&&accountInfo.miniProgram.version){
  234. //正式上线版本
  235. this.fetchData();
  236. // }
  237. },
  238. onReachBottom() {
  239. console.warn(12345);
  240. },
  241. methods: {
  242. // cardSwiper
  243. cardSwiper(e) {
  244. this.cardCur = e.detail.current
  245. },
  246. clickLink(url,fileName) {
  247. // uni.navigateTo({
  248. // url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
  249. // })
  250. uni.downloadFile({
  251. url: url,
  252. filePath: wx.env.USER_DATA_PATH + "/" + fileName,
  253. success: function (res) {
  254. const filePath = res.filePath
  255. uni.openDocument({
  256. filePath: filePath,
  257. showMenu: true,
  258. success: function (res) {
  259. console.log('打开文档成功')
  260. },
  261. fail: function(){
  262. uni.navigateTo({
  263. url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
  264. })
  265. }
  266. })
  267. }
  268. })
  269. // uni.navigateTo({
  270. // url: '/pages/webview/web-view?url=' + url,
  271. // })
  272. },
  273. isImage(fileName) {
  274. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  275. const extension = fileName.split('.').pop().toLowerCase();
  276. return imageExtensions.includes(extension);
  277. },
  278. reFetchData() {
  279. this.loading = true;
  280. uni.showToast({
  281. title: '正在刷新...',
  282. icon: 'none'
  283. });
  284. this.fetchData();
  285. },
  286. fetchData(curIndex = 1) {
  287. let that = this;
  288. that.showEmpty = false;
  289. this.curIndex = curIndex;
  290. request.post('/slbResourceDemand/query', {
  291. index: curIndex,
  292. limit: 10,
  293. content: that.searchValue,
  294. }).then(res => {
  295. that.loading = false;
  296. if (res&&res.success) {
  297. that.totalSize = res.total || 0;
  298. let newList = res.list || [];
  299. for (let i = 0; i < newList.length; i++) {
  300. newList[i].imgList = [];
  301. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  302. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  303. newList[i].imgList.push(newList[i].fileDetailList[j]);
  304. }
  305. }
  306. }
  307. if (curIndex == 1) {
  308. that.content = newList || [];
  309. } else {
  310. that.content = that.content.concat(newList || []);
  311. }
  312. }
  313. that.showEmpty = true;
  314. })
  315. },
  316. // 跳转
  317. tn(e) {
  318. uni.navigateTo({
  319. url: e,
  320. });
  321. },
  322. hideSheet(){
  323. this.curItem = {}
  324. this.showSheet = false;
  325. },
  326. showActionSheet(item) {
  327. let that = this;
  328. if(!this.curItem.id){
  329. this.curItem = item;
  330. }else{
  331. this.curItem = {}
  332. this.showSheet = false;
  333. return false;
  334. }
  335. this.curItem.isNeed = 1;
  336. this.collStatus = false;
  337. this.showSheet = true;
  338. that.showContact = false;
  339. if (uni.getStorageSync('userNo')) {
  340. let params = {};
  341. params = {
  342. fkBisNo: that.curItem.bisNo,
  343. userNo: uni.getStorageSync('userNo'),
  344. };
  345. request.post('/slbCollect/query', params).then(res => {
  346. if (res.success) {
  347. if (res.list && res.list.length > 0) {
  348. that.collStatus = true;
  349. that.collId = res.list[0].id;
  350. }
  351. }
  352. })
  353. }
  354. },
  355. linkTel() {
  356. if (!uni.getStorageSync('userNo')) {
  357. uni.showToast({
  358. title: '请登录',
  359. icon:'none'
  360. })
  361. uni.navigateTo({
  362. url: '/pages/login/login'
  363. })
  364. return false;
  365. }
  366. let that = this;
  367. let params = {};
  368. params.slbBisContact = JSON.stringify({
  369. fkBisNo: that.curItem.bisNo,
  370. bisType: '1',
  371. type: '1',
  372. company: that.curItem.company,
  373. companyNo: that.curItem.companyNo,
  374. userNo: uni.getStorageSync('userNo'),
  375. });
  376. request.post('/slbBisContact/add', params).then(res => {
  377. if (res.success) {
  378. that.showContact = true;
  379. that.curContact.company = that.curItem.company;
  380. that.curContact.contactMethod = res.resultMap.contactMethod;
  381. that.curContact.contactPerson = res.resultMap.contactPerson;
  382. } else {
  383. that.showContact = false;
  384. uni.showToast({
  385. title: res.msg,
  386. icon: 'none'
  387. })
  388. }
  389. })
  390. },
  391. addColl() {
  392. if (!uni.getStorageSync('userNo')) {
  393. uni.showToast({
  394. title: '请登录',
  395. icon:'none'
  396. })
  397. uni.navigateTo({
  398. url: '/pages/login/login'
  399. })
  400. return false;
  401. }
  402. let that = this;
  403. let params = {};
  404. params.slbCollect = JSON.stringify({
  405. fkBisNo: that.curItem.bisNo,
  406. bisType: '1',
  407. userNo: uni.getStorageSync('userNo'),
  408. });
  409. request.post('/slbCollect/add', params).then(res => {
  410. if (res.success) {
  411. that.curItem = {}
  412. that.showSheet = false;
  413. uni.showToast({
  414. title: '信息已收藏,请在我的收藏里查看阅读',
  415. icon:'none',
  416. duration: 2000
  417. });
  418. } else {
  419. uni.showToast({
  420. title: res.msg,
  421. icon:'none'
  422. })
  423. }
  424. })
  425. },
  426. delColl() {
  427. let that = this;
  428. request.post('/slbCollect/del', {
  429. id: that.collId
  430. }).then(res => {
  431. if (res.success) {
  432. that.curItem = {}
  433. that.showSheet = false;
  434. wx.showToast({
  435. title: '此需求信息将不会保存在我的收藏里',
  436. icon:'none',
  437. duration: 2000
  438. });
  439. } else {
  440. uni.showToast({
  441. title: res.msg,
  442. icon:'none'
  443. })
  444. }
  445. })
  446. },
  447. showImg(items, index) {
  448. let urls = [];
  449. for (let i = 0; i < items.length; i++) {
  450. urls.push(items[i].ftpUrl);
  451. }
  452. // 预览图片
  453. uni.previewImage({
  454. urls: urls,
  455. current: index,
  456. });
  457. },
  458. showValid(text){
  459. uni.showToast({
  460. title: '有效期:'+text,
  461. icon: 'none'
  462. })
  463. },
  464. addButton() {
  465. if (!uni.getStorageSync('userNo')) {
  466. uni.showToast({
  467. title: '请登录',
  468. icon:'none'
  469. })
  470. uni.navigateTo({
  471. url: '/pages/login/login'
  472. })
  473. return false;
  474. } else {
  475. uni.navigateTo({
  476. url: '/circlePages/circle'
  477. })
  478. }
  479. //未登录,去登录
  480. //已登录,去新增第一步
  481. },
  482. loadMore() {
  483. if (this.totalSize > this.content.length) {
  484. this.fetchData(this.curIndex + 1);
  485. }
  486. console.error('正在加载更多');
  487. },
  488. search() {
  489. this.fetchData();
  490. },
  491. cancel() {
  492. this.searchValue = '';
  493. this.fetchData();
  494. },
  495. clear() {
  496. this.searchValue = '';
  497. this.fetchData();
  498. },
  499. showTel(tel){
  500. uni.makePhoneCall({
  501. phoneNumber: tel,
  502. });
  503. },
  504. showDetail(item){
  505. uni.navigateTo({
  506. url: '/pages/index/detail/detail?id='+item.bisNo+'&isNeed=1'
  507. })
  508. }
  509. }
  510. }
  511. </script>
  512. <style lang="scss" scoped>
  513. .index {
  514. max-height: 100vh;
  515. }
  516. /* 底部安全边距 start*/
  517. .tn-tabbar-height {
  518. min-height: 120rpx;
  519. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  520. height: calc(140rpx + constant(safe-area-inset-bottom));
  521. }
  522. /* 轮播视觉差 start */
  523. .card-swiper {
  524. height: 330rpx !important;
  525. }
  526. .card-swiper swiper-item {
  527. width: 750rpx !important;
  528. left: 0rpx;
  529. box-sizing: border-box;
  530. padding: 40rpx 30rpx 30rpx 30rpx;
  531. overflow: initial;
  532. }
  533. .card-swiper swiper-item .swiper-item {
  534. width: 100%;
  535. display: block;
  536. height: 100%;
  537. border-radius: 15rpx;
  538. transform: scale(1);
  539. transition: all 0.2s ease-in 0s;
  540. // overflow: hidden;
  541. }
  542. .card-swiper swiper-item.cur .swiper-item {
  543. transform: none;
  544. transition: all 0.2s ease-in 0s;
  545. }
  546. .card-swiper swiper-item .swiper-item-text {
  547. margin-top: -160rpx;
  548. text-align: center;
  549. width: 100%;
  550. display: block;
  551. height: 50%;
  552. border-radius: 10rpx;
  553. transform: translate(100rpx, -60rpx) scale(0.9, 0.9);
  554. transition: all 0.6s ease 0s;
  555. overflow: hidden;
  556. }
  557. .card-swiper swiper-item.cur .swiper-item-text {
  558. margin-top: -220rpx;
  559. width: 100%;
  560. transform: translate(0rpx, 0rpx) scale(0.9, 0.9);
  561. transition: all 0.6s ease 0s;
  562. }
  563. .image-banner {
  564. border: 1rpx solid #F8F7F8;
  565. display: flex;
  566. align-items: center;
  567. justify-content: center;
  568. }
  569. .image-banner image {
  570. width: 100%;
  571. height: 100%;
  572. }
  573. /* 轮播指示点 start*/
  574. .indication {
  575. z-index: 9999;
  576. width: 100%;
  577. height: 36rpx;
  578. position: absolute;
  579. display: flex;
  580. flex-direction: row;
  581. align-items: center;
  582. justify-content: center;
  583. }
  584. .spot {
  585. background-color: #FFFFFF;
  586. opacity: 0.6;
  587. width: 10rpx;
  588. height: 10rpx;
  589. border-radius: 20rpx;
  590. top: -70rpx;
  591. margin: 0 8rpx !important;
  592. position: relative;
  593. }
  594. .spot.active {
  595. opacity: 1;
  596. width: 30rpx;
  597. background-color: #FFFFFF;
  598. }
  599. /* 图标容器12 start */
  600. .tn-three {
  601. position: absolute;
  602. top: 50%;
  603. right: 50%;
  604. bottom: 50%;
  605. left: 50%;
  606. transform: translate(-38rpx, -20rpx) rotateX(20deg) rotateY(10deg) rotateZ(-20deg);
  607. text-shadow: -1rpx 2rpx 0 #f0f0f0, -2rpx 4rpx 0 #f0f0f0, -10rpx 20rpx 30rpx rgba(0, 0, 0, 0.2);
  608. }
  609. .icon12 {
  610. &__item {
  611. width: 30%;
  612. background-color: #FFFFFF;
  613. border-radius: 10rpx;
  614. padding: 30rpx;
  615. margin: 20rpx 10rpx;
  616. transform: scale(1);
  617. transition: transform 0.3s linear;
  618. transform-origin: center center;
  619. &--icon {
  620. width: 100rpx;
  621. height: 100rpx;
  622. font-size: 60rpx;
  623. border-radius: 50%;
  624. margin-bottom: 18rpx;
  625. position: relative;
  626. z-index: 1;
  627. &::after {
  628. content: " ";
  629. position: absolute;
  630. z-index: -1;
  631. width: 100%;
  632. height: 100%;
  633. left: 0;
  634. bottom: 0;
  635. border-radius: inherit;
  636. opacity: 1;
  637. transform: scale(1, 1);
  638. background-size: 100% 100%;
  639. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg6.png);
  640. }
  641. }
  642. }
  643. }
  644. /* 自定义导航栏内容 start */
  645. .custom-nav {
  646. height: 100%;
  647. &__back {
  648. margin: auto 5rpx;
  649. font-size: 40rpx;
  650. margin-right: 10rpx;
  651. margin-left: 30rpx;
  652. flex-basis: 5%;
  653. }
  654. &__search {
  655. flex-basis: 70%;
  656. width: 100%;
  657. height: 100%;
  658. &__box {
  659. width: 100%;
  660. height: 70%;
  661. padding: 10rpx 0;
  662. margin: 0 30rpx;
  663. border-radius: 60rpx 60rpx 0 60rpx;
  664. font-size: 24rpx;
  665. }
  666. &__icon {
  667. padding-right: 10rpx;
  668. margin-left: 20rpx;
  669. font-size: 30rpx;
  670. }
  671. &__text {
  672. // color: #AAAAAA;
  673. }
  674. }
  675. }
  676. .logo-image {
  677. width: 65rpx;
  678. height: 65rpx;
  679. position: relative;
  680. border: 1rpx solid #F8F7F8;
  681. border-radius: 50%;
  682. }
  683. .logo-pic {
  684. background-size: cover;
  685. background-repeat: no-repeat;
  686. // background-attachment:fixed;
  687. background-position: top;
  688. border-radius: 50%;
  689. }
  690. /* 自定义导航栏内容 end */
  691. /* 热门图片 start*/
  692. .image-tuniao1 {
  693. padding: 165rpx 0rpx;
  694. font-size: 40rpx;
  695. font-weight: 300;
  696. position: relative;
  697. }
  698. .image-tuniao2 {
  699. padding: 75rpx 0rpx;
  700. font-size: 40rpx;
  701. font-weight: 300;
  702. position: relative;
  703. }
  704. .image-tuniao3 {
  705. padding: 90rpx 0rpx;
  706. font-size: 40rpx;
  707. font-weight: 300;
  708. position: relative;
  709. }
  710. .image-pic {
  711. border: 1rpx solid #F8F7F8;
  712. background-size: cover;
  713. background-repeat: no-repeat;
  714. // background-attachment:fixed;
  715. background-position: top;
  716. border-radius: 10rpx;
  717. }
  718. /* 文章内容 start*/
  719. .tn-blogger-content {
  720. &__wrap {
  721. margin: 30rpx;
  722. }
  723. &__info {
  724. &__btn {
  725. margin-right: -12rpx;
  726. opacity: 0.5;
  727. }
  728. }
  729. &__label {
  730. &__item {
  731. color: #1D2541;
  732. background-color: #F3F2F7;
  733. border-radius: 10rpx;
  734. font-size: 22rpx;
  735. padding: 5rpx 15rpx;
  736. margin: 5rpx 0 0 18rpx;
  737. &--prefix {
  738. font-size: 24rpx;
  739. color: #1D2541;
  740. padding-right: 10rpx;
  741. }
  742. }
  743. &__desc {
  744. line-height: 55rpx;
  745. }
  746. }
  747. &__main-image {
  748. border: 1rpx solid #F8F7F8;
  749. border-radius: 16rpx;
  750. &--1 {
  751. max-width: 690rpx;
  752. min-width: 690rpx;
  753. max-height: 400rpx;
  754. min-height: 400rpx;
  755. }
  756. &--2 {
  757. max-width: 260rpx;
  758. max-height: 260rpx;
  759. }
  760. &--3 {
  761. height: 212rpx;
  762. width: 100%;
  763. }
  764. }
  765. &__count-icon {
  766. font-size: 40rpx;
  767. padding-right: 5rpx;
  768. }
  769. }
  770. .image-wallpaper {
  771. padding: 160rpx 0rpx;
  772. font-size: 40rpx;
  773. font-weight: 300;
  774. position: relative;
  775. }
  776. .image-pic {
  777. background-size: cover;
  778. background-repeat: no-repeat;
  779. // background-attachment:fixed;
  780. background-position: top;
  781. border-radius: 10rpx;
  782. }
  783. /* 文章内容 end*/
  784. .circle {
  785. max-height: 100vh;
  786. }
  787. /* 底部安全边距 start*/
  788. .tn-tabbar-height {
  789. min-height: 120rpx;
  790. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  791. height: calc(140rpx + constant(safe-area-inset-bottom));
  792. }
  793. /* 自定义导航栏内容 start */
  794. .custom-nav {
  795. height: 100%;
  796. &__back {
  797. margin: auto 5rpx;
  798. font-size: 40rpx;
  799. margin-right: 10rpx;
  800. margin-left: 30rpx;
  801. flex-basis: 5%;
  802. }
  803. &__search {
  804. flex-basis: 60%;
  805. width: 100%;
  806. height: 100%;
  807. &__box {
  808. width: 100%;
  809. height: 70%;
  810. padding: 10rpx 0;
  811. margin: 0 30rpx;
  812. border-radius: 60rpx 60rpx 0 60rpx;
  813. font-size: 24rpx;
  814. }
  815. &__icon {
  816. padding-right: 10rpx;
  817. margin-left: 20rpx;
  818. font-size: 30rpx;
  819. }
  820. &__text {
  821. color: #AAAAAA;
  822. }
  823. }
  824. }
  825. .logo-image {
  826. width: 60rpx;
  827. height: 60rpx;
  828. position: relative;
  829. margin-top: -15rpx;
  830. }
  831. .logo-pic {
  832. background-size: cover;
  833. background-repeat: no-repeat;
  834. // background-attachment:fixed;
  835. background-position: top;
  836. border-radius: 50%;
  837. }
  838. /* 自定义导航栏内容 end */
  839. /* 博主头像 start*/
  840. .image-circle {
  841. // padding: 95rpx;
  842. width: 190rpx;
  843. height: 190rpx;
  844. font-size: 40rpx;
  845. font-weight: 300;
  846. position: relative;
  847. }
  848. .image-pic {
  849. border: 1rpx solid #F8F7F8;
  850. background-size: cover;
  851. background-repeat: no-repeat;
  852. // background-attachment:fixed;
  853. background-position: top;
  854. border-radius: 10rpx;
  855. }
  856. .tn-color-cat {
  857. color: #1D2541;
  858. }
  859. .tn-bg-cat {
  860. background-color: #1D2541;
  861. }
  862. /* 文章内容 start*/
  863. .blogger {
  864. &__item {
  865. padding: 30rpx;
  866. }
  867. &__author {
  868. &__btn {
  869. margin-right: -12rpx;
  870. opacity: 0.5;
  871. }
  872. }
  873. &__desc {
  874. line-height: 30rpx;
  875. &__label {
  876. color: #1D2541;
  877. background-color: #F3F2F7;
  878. border-radius: 10rpx;
  879. font-size: 22rpx;
  880. padding: 5rpx 15rpx;
  881. margin: 5rpx 18rpx 0 0;
  882. &--prefix {
  883. font-size: 24rpx;
  884. color: #1D2541;
  885. padding-right: 10rpx;
  886. }
  887. }
  888. &__content {
  889. line-height: 50rpx;
  890. }
  891. }
  892. &__content {
  893. margin-top: 18rpx;
  894. padding-right: 18rpx;
  895. &__data {
  896. line-height: 46rpx;
  897. text-align: justify;
  898. overflow: hidden;
  899. transition: all 0.25s ease-in-out;
  900. }
  901. &__status {
  902. margin-top: 10rpx;
  903. font-size: 26rpx;
  904. color: #82B2FF;
  905. }
  906. }
  907. &__main-image {
  908. border: 1rpx solid #F8F7F8;
  909. border-radius: 16rpx;
  910. &--1 {
  911. max-width: 80%;
  912. max-height: 300rpx;
  913. }
  914. &--2 {
  915. max-width: 260rpx;
  916. max-height: 260rpx;
  917. }
  918. &--3 {
  919. height: 212rpx;
  920. width: 100%;
  921. }
  922. }
  923. &__count-icon {
  924. font-size: 40rpx;
  925. padding-right: 5rpx;
  926. }
  927. &__ad {
  928. width: 100%;
  929. height: 500rpx;
  930. transform: translate3d(0px, 0px, 0px) !important;
  931. ::v-deep .uni-swiper-slide-frame {
  932. transform: translate3d(0px, 0px, 0px) !important;
  933. }
  934. .uni-swiper-slide-frame {
  935. transform: translate3d(0px, 0px, 0px) !important;
  936. }
  937. &__item {
  938. position: absolute;
  939. width: 100%;
  940. height: 100%;
  941. transform-origin: left center;
  942. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  943. transition: transform 0.25s ease-in-out;
  944. z-index: 1;
  945. &--0 {
  946. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  947. z-index: 4;
  948. }
  949. &--1 {
  950. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  951. z-index: 3;
  952. }
  953. &--2 {
  954. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  955. z-index: 2;
  956. }
  957. }
  958. &__content {
  959. border-radius: 40rpx;
  960. width: 640rpx;
  961. height: 500rpx;
  962. overflow: hidden;
  963. }
  964. &__image {
  965. width: 100%;
  966. height: 100%;
  967. }
  968. }
  969. }
  970. /* 文章内容 end*/
  971. /* 间隔线 start*/
  972. .tn-strip-bottom {
  973. width: 100%;
  974. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  975. }
  976. /* 间隔线 end*/
  977. /* 广告内容 start */
  978. .ad-image {
  979. width: 80rpx;
  980. height: 80rpx;
  981. position: relative;
  982. }
  983. .ad-pic {
  984. background-size: cover;
  985. background-repeat: no-repeat;
  986. // background-attachment:fixed;
  987. background-position: top;
  988. border-radius: 20%;
  989. }
  990. /* 自定义导航栏内容 end */
  991. /* 全屏轮播 start*/
  992. .card-swiper {
  993. height: 100vh !important;
  994. }
  995. .card-swiper swiper-item {
  996. width: 750rpx !important;
  997. left: 0rpx;
  998. box-sizing: border-box;
  999. overflow: initial;
  1000. }
  1001. .card-swiper swiper-item .swiper-item {
  1002. width: 100%;
  1003. display: block;
  1004. height: 100vh;
  1005. border-radius: 0rpx;
  1006. transform: scale(1);
  1007. transition: all 0.2s ease-in 0s;
  1008. overflow: hidden;
  1009. }
  1010. .card-swiper swiper-item.cur .swiper-item {
  1011. transform: none;
  1012. transition: all 0.2s ease-in 0s;
  1013. }
  1014. .card-swiper swiper-item .swiper-item-png {
  1015. margin-top: -50vh;
  1016. width: 100%;
  1017. display: block;
  1018. border-radius: 0rpx;
  1019. transform: translate(1040rpx, 20rpx) scale(0.5, 0.5);
  1020. transition: all 0.6s ease 0s;
  1021. // overflow: hidden;
  1022. }
  1023. .card-swiper swiper-item.cur .swiper-item-png {
  1024. margin-top: -100vh;
  1025. width: 900rpx;
  1026. transform: translate(-80rpx, 0rpx) scale(1, 1);
  1027. transition: all 0.6s ease 0s;
  1028. }
  1029. .image-banner {
  1030. display: flex;
  1031. align-items: center;
  1032. justify-content: center;
  1033. }
  1034. .image-banner image {
  1035. width: 100%;
  1036. }
  1037. /* 轮播指示点 start*/
  1038. .indication {
  1039. z-index: 9999;
  1040. width: 100%;
  1041. height: 36rpx;
  1042. position: fixed;
  1043. // display:flex;
  1044. display: block;
  1045. flex-direction: row;
  1046. align-items: center;
  1047. justify-content: center;
  1048. }
  1049. .spot {
  1050. background-color: #000;
  1051. opacity: 0.3;
  1052. width: 10rpx;
  1053. height: 10rpx;
  1054. border-radius: 20rpx;
  1055. margin: 20rpx 0 !important;
  1056. left: 95vw;
  1057. top: -60vh;
  1058. position: relative;
  1059. }
  1060. .spot.active {
  1061. opacity: 0.6;
  1062. height: 30rpx;
  1063. background-color: #000;
  1064. }
  1065. /* 资讯主图 start*/
  1066. .image-article {
  1067. border-radius: 8rpx;
  1068. border: 1rpx solid #F8F7F8;
  1069. width: 200rpx;
  1070. height: 200rpx;
  1071. position: relative;
  1072. }
  1073. .image-pic {
  1074. background-size: cover;
  1075. background-repeat: no-repeat;
  1076. // background-attachment:fixed;
  1077. background-position: top;
  1078. border-radius: 10rpx;
  1079. }
  1080. .article-shadow {
  1081. border-radius: 15rpx;
  1082. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  1083. }
  1084. /* 文字截取*/
  1085. .clamp-text-1 {
  1086. -webkit-line-clamp: 1;
  1087. display: -webkit-box;
  1088. -webkit-box-orient: vertical;
  1089. text-overflow: ellipsis;
  1090. overflow: hidden;
  1091. }
  1092. .clamp-text-2 {
  1093. -webkit-line-clamp: 2;
  1094. display: -webkit-box;
  1095. -webkit-box-orient: vertical;
  1096. text-overflow: ellipsis;
  1097. overflow: hidden;
  1098. }
  1099. /* 标签内容 start*/
  1100. .tn-tag-content {
  1101. &__item {
  1102. display: inline-block;
  1103. line-height: 35rpx;
  1104. color: #1D2541;
  1105. background-color: #F3F2F7;
  1106. border-radius: 10rpx;
  1107. font-size: 22rpx;
  1108. padding: 5rpx 15rpx;
  1109. &--prefix {
  1110. padding-right: 10rpx;
  1111. }
  1112. }
  1113. }
  1114. /* 图标容器9 start */
  1115. .icon9 {
  1116. &__item {
  1117. width: 30%;
  1118. background-color: #FFFFFF;
  1119. border-radius: 10rpx;
  1120. padding: 30rpx;
  1121. margin: 20rpx 10rpx;
  1122. transform: scale(1);
  1123. transition: transform 0.3s linear;
  1124. transform-origin: center center;
  1125. &--icon {
  1126. width: 110rpx;
  1127. height: 110rpx;
  1128. font-size: 65rpx;
  1129. border-radius: 50%;
  1130. margin: 20rpx 40rpx;
  1131. position: relative;
  1132. z-index: 1;
  1133. &::after {
  1134. content: " ";
  1135. position: absolute;
  1136. z-index: -1;
  1137. width: 100%;
  1138. height: 100%;
  1139. left: 0;
  1140. bottom: 0;
  1141. border-radius: inherit;
  1142. opacity: 1;
  1143. transform: scale(1, 1);
  1144. background-size: 100% 100%;
  1145. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png);
  1146. }
  1147. }
  1148. }
  1149. }
  1150. /* 悬浮 */
  1151. .tnxuanfu {
  1152. animation: suspension 3s ease-in-out infinite;
  1153. }
  1154. @keyframes suspension {
  1155. 0%,
  1156. 100% {
  1157. transform: translateY(0);
  1158. }
  1159. 50% {
  1160. transform: translateY(-0.8rem);
  1161. }
  1162. }
  1163. /* 悬浮按钮 */
  1164. .button-shop {
  1165. width: 90rpx;
  1166. height: 90rpx;
  1167. display: flex;
  1168. flex-direction: row;
  1169. position: fixed;
  1170. /* bottom:200rpx;
  1171. right: 20rpx; */
  1172. left: 5rpx;
  1173. top: 5rpx;
  1174. z-index: 1001;
  1175. border-radius: 100px;
  1176. opacity: 0.9;
  1177. }
  1178. /* 按钮 */
  1179. .edit {
  1180. bottom: 300rpx;
  1181. right: 75rpx;
  1182. position: fixed;
  1183. z-index: 9999;
  1184. }
  1185. .pa,
  1186. .pa0 {
  1187. position: absolute
  1188. }
  1189. .pa0 {
  1190. left: 0;
  1191. top: 0
  1192. }
  1193. .bg0 {
  1194. width: 100rpx;
  1195. height: 100rpx;
  1196. top: 50%;
  1197. left: 50%;
  1198. transform: translate(-50%, -50%);
  1199. }
  1200. .bg1 {
  1201. width: 100%;
  1202. height: 100%;
  1203. }
  1204. .hx-box {
  1205. top: 50%;
  1206. left: 50%;
  1207. width: 100rpx;
  1208. height: 100rpx;
  1209. transform-style: preserve-3d;
  1210. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  1211. }
  1212. .hx-box .pr {
  1213. width: 100rpx;
  1214. height: 100rpx;
  1215. transform-style: preserve-3d;
  1216. animation: hxz 20s linear infinite;
  1217. }
  1218. @keyframes hxz {
  1219. 0% {
  1220. transform: rotateX(0deg);
  1221. }
  1222. 100% {
  1223. transform: rotateX(-360deg);
  1224. }
  1225. }
  1226. .hx-box .pr .pa0 {
  1227. width: 100rpx;
  1228. height: 100rpx;
  1229. /* border: 4px solid #5ec0ff; */
  1230. border-radius: 1000px;
  1231. }
  1232. .hx-box .pr .pa0 .span {
  1233. display: block;
  1234. width: 100%;
  1235. height: 100%;
  1236. background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc4.png) no-repeat center center;
  1237. background-size: 100% 100%;
  1238. animation: hx 4s linear infinite;
  1239. }
  1240. @keyframes hx {
  1241. to {
  1242. transform: rotate(360deg);
  1243. }
  1244. }
  1245. .hx-k1 {
  1246. transform: rotateX(-60deg) rotateZ(-60deg)
  1247. }
  1248. .hx-k2 {
  1249. transform: rotateX(-30deg) rotateZ(-30deg)
  1250. }
  1251. .hx-k3 {
  1252. transform: rotateX(0deg) rotateZ(0deg)
  1253. }
  1254. .hx-k4 {
  1255. transform: rotateX(30deg) rotateZ(30deg)
  1256. }
  1257. .hx-k5 {
  1258. transform: rotateX(60deg) rotateZ(60deg)
  1259. }
  1260. .hx-k6 {
  1261. transform: rotateX(90deg) rotateZ(90deg)
  1262. }
  1263. /deep/ .tn-toast {
  1264. background-color: #000c !important;
  1265. }
  1266. .bg-content{
  1267. color: #fff;
  1268. background-image: url(./../../static/bg.png);
  1269. background-size: cover;
  1270. }
  1271. </style>