home.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454
  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. return false;
  333. }
  334. this.curItem.isNeed = 1;
  335. this.collStatus = false;
  336. this.showSheet = true;
  337. that.showContact = false;
  338. if (uni.getStorageSync('userNo')) {
  339. let params = {};
  340. params = {
  341. fkBisNo: that.curItem.bisNo,
  342. userNo: uni.getStorageSync('userNo'),
  343. };
  344. request.post('/slbCollect/query', params).then(res => {
  345. if (res.success) {
  346. if (res.list && res.list.length > 0) {
  347. that.collStatus = true;
  348. that.collId = res.list[0].id;
  349. }
  350. }
  351. })
  352. }
  353. },
  354. linkTel() {
  355. if (!uni.getStorageSync('userNo')) {
  356. uni.showToast({
  357. title: '请登录'
  358. })
  359. uni.navigateTo({
  360. url: '/pages/login/login'
  361. })
  362. return false;
  363. }
  364. let that = this;
  365. let params = {};
  366. params.slbBisContact = JSON.stringify({
  367. fkBisNo: that.curItem.bisNo,
  368. bisType: '1',
  369. type: '1',
  370. company: that.curItem.company,
  371. companyNo: that.curItem.companyNo,
  372. userNo: uni.getStorageSync('userNo'),
  373. });
  374. request.post('/slbBisContact/add', params).then(res => {
  375. if (res.success) {
  376. that.showContact = true;
  377. that.curContact.company = that.curItem.company;
  378. that.curContact.contactMethod = res.resultMap.contactMethod;
  379. that.curContact.contactPerson = res.resultMap.contactPerson;
  380. } else {
  381. that.showContact = false;
  382. uni.showToast({
  383. title: res.msg,
  384. icon: 'none'
  385. })
  386. }
  387. })
  388. },
  389. addColl() {
  390. if (!uni.getStorageSync('userNo')) {
  391. uni.showToast({
  392. title: '请登录'
  393. })
  394. uni.navigateTo({
  395. url: '/pages/login/login'
  396. })
  397. return false;
  398. }
  399. let that = this;
  400. let params = {};
  401. params.slbCollect = JSON.stringify({
  402. fkBisNo: that.curItem.bisNo,
  403. bisType: '1',
  404. userNo: uni.getStorageSync('userNo'),
  405. });
  406. request.post('/slbCollect/add', params).then(res => {
  407. if (res.success) {
  408. that.$refs.toast.show({
  409. title: '信息已收藏,请在我的收藏里查看阅读',
  410. image: '',
  411. duration: 2000
  412. })
  413. that.showSheet = false;
  414. } else {
  415. uni.showToast({
  416. title: res.msg
  417. })
  418. }
  419. })
  420. },
  421. delColl() {
  422. let that = this;
  423. request.post('/slbCollect/del', {
  424. id: that.collId
  425. }).then(res => {
  426. if (res.success) {
  427. that.$refs.toast.show({
  428. title: '此需求信息将不会保存在我的收藏里',
  429. image: '',
  430. duration: 2000
  431. })
  432. that.showSheet = false;
  433. } else {
  434. uni.showToast({
  435. title: res.msg
  436. })
  437. }
  438. })
  439. },
  440. showImg(items, index) {
  441. let urls = [];
  442. for (let i = 0; i < items.length; i++) {
  443. urls.push(items[i].ftpUrl);
  444. }
  445. // 预览图片
  446. uni.previewImage({
  447. urls: urls,
  448. current: index,
  449. });
  450. },
  451. showValid(text){
  452. uni.showToast({
  453. title: '有效期:'+text,
  454. icon: 'none'
  455. })
  456. },
  457. addButton() {
  458. if (!uni.getStorageSync('userNo')) {
  459. uni.showToast({
  460. title: '请登录',
  461. icon:'none'
  462. })
  463. uni.navigateTo({
  464. url: '/pages/login/login'
  465. })
  466. return false;
  467. } else {
  468. uni.navigateTo({
  469. url: '/circlePages/circle'
  470. })
  471. }
  472. //未登录,去登录
  473. //已登录,去新增第一步
  474. },
  475. loadMore() {
  476. if (this.totalSize > this.content.length) {
  477. this.fetchData(this.curIndex + 1);
  478. }
  479. console.error('正在加载更多');
  480. },
  481. search() {
  482. this.fetchData();
  483. },
  484. cancel() {
  485. this.searchValue = '';
  486. this.fetchData();
  487. },
  488. clear() {
  489. this.searchValue = '';
  490. this.fetchData();
  491. },
  492. showTel(tel){
  493. uni.makePhoneCall({
  494. phoneNumber: tel,
  495. });
  496. },
  497. showDetail(item){
  498. uni.navigateTo({
  499. url: '/pages/index/detail/detail?id='+item.bisNo+'&isNeed=1'
  500. })
  501. }
  502. }
  503. }
  504. </script>
  505. <style lang="scss" scoped>
  506. .index {
  507. max-height: 100vh;
  508. }
  509. /* 底部安全边距 start*/
  510. .tn-tabbar-height {
  511. min-height: 120rpx;
  512. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  513. height: calc(140rpx + constant(safe-area-inset-bottom));
  514. }
  515. /* 轮播视觉差 start */
  516. .card-swiper {
  517. height: 330rpx !important;
  518. }
  519. .card-swiper swiper-item {
  520. width: 750rpx !important;
  521. left: 0rpx;
  522. box-sizing: border-box;
  523. padding: 40rpx 30rpx 30rpx 30rpx;
  524. overflow: initial;
  525. }
  526. .card-swiper swiper-item .swiper-item {
  527. width: 100%;
  528. display: block;
  529. height: 100%;
  530. border-radius: 15rpx;
  531. transform: scale(1);
  532. transition: all 0.2s ease-in 0s;
  533. // overflow: hidden;
  534. }
  535. .card-swiper swiper-item.cur .swiper-item {
  536. transform: none;
  537. transition: all 0.2s ease-in 0s;
  538. }
  539. .card-swiper swiper-item .swiper-item-text {
  540. margin-top: -160rpx;
  541. text-align: center;
  542. width: 100%;
  543. display: block;
  544. height: 50%;
  545. border-radius: 10rpx;
  546. transform: translate(100rpx, -60rpx) scale(0.9, 0.9);
  547. transition: all 0.6s ease 0s;
  548. overflow: hidden;
  549. }
  550. .card-swiper swiper-item.cur .swiper-item-text {
  551. margin-top: -220rpx;
  552. width: 100%;
  553. transform: translate(0rpx, 0rpx) scale(0.9, 0.9);
  554. transition: all 0.6s ease 0s;
  555. }
  556. .image-banner {
  557. border: 1rpx solid #F8F7F8;
  558. display: flex;
  559. align-items: center;
  560. justify-content: center;
  561. }
  562. .image-banner image {
  563. width: 100%;
  564. height: 100%;
  565. }
  566. /* 轮播指示点 start*/
  567. .indication {
  568. z-index: 9999;
  569. width: 100%;
  570. height: 36rpx;
  571. position: absolute;
  572. display: flex;
  573. flex-direction: row;
  574. align-items: center;
  575. justify-content: center;
  576. }
  577. .spot {
  578. background-color: #FFFFFF;
  579. opacity: 0.6;
  580. width: 10rpx;
  581. height: 10rpx;
  582. border-radius: 20rpx;
  583. top: -70rpx;
  584. margin: 0 8rpx !important;
  585. position: relative;
  586. }
  587. .spot.active {
  588. opacity: 1;
  589. width: 30rpx;
  590. background-color: #FFFFFF;
  591. }
  592. /* 图标容器12 start */
  593. .tn-three {
  594. position: absolute;
  595. top: 50%;
  596. right: 50%;
  597. bottom: 50%;
  598. left: 50%;
  599. transform: translate(-38rpx, -20rpx) rotateX(20deg) rotateY(10deg) rotateZ(-20deg);
  600. text-shadow: -1rpx 2rpx 0 #f0f0f0, -2rpx 4rpx 0 #f0f0f0, -10rpx 20rpx 30rpx rgba(0, 0, 0, 0.2);
  601. }
  602. .icon12 {
  603. &__item {
  604. width: 30%;
  605. background-color: #FFFFFF;
  606. border-radius: 10rpx;
  607. padding: 30rpx;
  608. margin: 20rpx 10rpx;
  609. transform: scale(1);
  610. transition: transform 0.3s linear;
  611. transform-origin: center center;
  612. &--icon {
  613. width: 100rpx;
  614. height: 100rpx;
  615. font-size: 60rpx;
  616. border-radius: 50%;
  617. margin-bottom: 18rpx;
  618. position: relative;
  619. z-index: 1;
  620. &::after {
  621. content: " ";
  622. position: absolute;
  623. z-index: -1;
  624. width: 100%;
  625. height: 100%;
  626. left: 0;
  627. bottom: 0;
  628. border-radius: inherit;
  629. opacity: 1;
  630. transform: scale(1, 1);
  631. background-size: 100% 100%;
  632. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg6.png);
  633. }
  634. }
  635. }
  636. }
  637. /* 自定义导航栏内容 start */
  638. .custom-nav {
  639. height: 100%;
  640. &__back {
  641. margin: auto 5rpx;
  642. font-size: 40rpx;
  643. margin-right: 10rpx;
  644. margin-left: 30rpx;
  645. flex-basis: 5%;
  646. }
  647. &__search {
  648. flex-basis: 70%;
  649. width: 100%;
  650. height: 100%;
  651. &__box {
  652. width: 100%;
  653. height: 70%;
  654. padding: 10rpx 0;
  655. margin: 0 30rpx;
  656. border-radius: 60rpx 60rpx 0 60rpx;
  657. font-size: 24rpx;
  658. }
  659. &__icon {
  660. padding-right: 10rpx;
  661. margin-left: 20rpx;
  662. font-size: 30rpx;
  663. }
  664. &__text {
  665. // color: #AAAAAA;
  666. }
  667. }
  668. }
  669. .logo-image {
  670. width: 65rpx;
  671. height: 65rpx;
  672. position: relative;
  673. border: 1rpx solid #F8F7F8;
  674. border-radius: 50%;
  675. }
  676. .logo-pic {
  677. background-size: cover;
  678. background-repeat: no-repeat;
  679. // background-attachment:fixed;
  680. background-position: top;
  681. border-radius: 50%;
  682. }
  683. /* 自定义导航栏内容 end */
  684. /* 热门图片 start*/
  685. .image-tuniao1 {
  686. padding: 165rpx 0rpx;
  687. font-size: 40rpx;
  688. font-weight: 300;
  689. position: relative;
  690. }
  691. .image-tuniao2 {
  692. padding: 75rpx 0rpx;
  693. font-size: 40rpx;
  694. font-weight: 300;
  695. position: relative;
  696. }
  697. .image-tuniao3 {
  698. padding: 90rpx 0rpx;
  699. font-size: 40rpx;
  700. font-weight: 300;
  701. position: relative;
  702. }
  703. .image-pic {
  704. border: 1rpx solid #F8F7F8;
  705. background-size: cover;
  706. background-repeat: no-repeat;
  707. // background-attachment:fixed;
  708. background-position: top;
  709. border-radius: 10rpx;
  710. }
  711. /* 文章内容 start*/
  712. .tn-blogger-content {
  713. &__wrap {
  714. margin: 30rpx;
  715. }
  716. &__info {
  717. &__btn {
  718. margin-right: -12rpx;
  719. opacity: 0.5;
  720. }
  721. }
  722. &__label {
  723. &__item {
  724. color: #1D2541;
  725. background-color: #F3F2F7;
  726. border-radius: 10rpx;
  727. font-size: 22rpx;
  728. padding: 5rpx 15rpx;
  729. margin: 5rpx 0 0 18rpx;
  730. &--prefix {
  731. font-size: 24rpx;
  732. color: #1D2541;
  733. padding-right: 10rpx;
  734. }
  735. }
  736. &__desc {
  737. line-height: 55rpx;
  738. }
  739. }
  740. &__main-image {
  741. border: 1rpx solid #F8F7F8;
  742. border-radius: 16rpx;
  743. &--1 {
  744. max-width: 690rpx;
  745. min-width: 690rpx;
  746. max-height: 400rpx;
  747. min-height: 400rpx;
  748. }
  749. &--2 {
  750. max-width: 260rpx;
  751. max-height: 260rpx;
  752. }
  753. &--3 {
  754. height: 212rpx;
  755. width: 100%;
  756. }
  757. }
  758. &__count-icon {
  759. font-size: 40rpx;
  760. padding-right: 5rpx;
  761. }
  762. }
  763. .image-wallpaper {
  764. padding: 160rpx 0rpx;
  765. font-size: 40rpx;
  766. font-weight: 300;
  767. position: relative;
  768. }
  769. .image-pic {
  770. background-size: cover;
  771. background-repeat: no-repeat;
  772. // background-attachment:fixed;
  773. background-position: top;
  774. border-radius: 10rpx;
  775. }
  776. /* 文章内容 end*/
  777. .circle {
  778. max-height: 100vh;
  779. }
  780. /* 底部安全边距 start*/
  781. .tn-tabbar-height {
  782. min-height: 120rpx;
  783. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  784. height: calc(140rpx + constant(safe-area-inset-bottom));
  785. }
  786. /* 自定义导航栏内容 start */
  787. .custom-nav {
  788. height: 100%;
  789. &__back {
  790. margin: auto 5rpx;
  791. font-size: 40rpx;
  792. margin-right: 10rpx;
  793. margin-left: 30rpx;
  794. flex-basis: 5%;
  795. }
  796. &__search {
  797. flex-basis: 60%;
  798. width: 100%;
  799. height: 100%;
  800. &__box {
  801. width: 100%;
  802. height: 70%;
  803. padding: 10rpx 0;
  804. margin: 0 30rpx;
  805. border-radius: 60rpx 60rpx 0 60rpx;
  806. font-size: 24rpx;
  807. }
  808. &__icon {
  809. padding-right: 10rpx;
  810. margin-left: 20rpx;
  811. font-size: 30rpx;
  812. }
  813. &__text {
  814. color: #AAAAAA;
  815. }
  816. }
  817. }
  818. .logo-image {
  819. width: 60rpx;
  820. height: 60rpx;
  821. position: relative;
  822. margin-top: -15rpx;
  823. }
  824. .logo-pic {
  825. background-size: cover;
  826. background-repeat: no-repeat;
  827. // background-attachment:fixed;
  828. background-position: top;
  829. border-radius: 50%;
  830. }
  831. /* 自定义导航栏内容 end */
  832. /* 博主头像 start*/
  833. .image-circle {
  834. // padding: 95rpx;
  835. width: 190rpx;
  836. height: 190rpx;
  837. font-size: 40rpx;
  838. font-weight: 300;
  839. position: relative;
  840. }
  841. .image-pic {
  842. border: 1rpx solid #F8F7F8;
  843. background-size: cover;
  844. background-repeat: no-repeat;
  845. // background-attachment:fixed;
  846. background-position: top;
  847. border-radius: 10rpx;
  848. }
  849. .tn-color-cat {
  850. color: #1D2541;
  851. }
  852. .tn-bg-cat {
  853. background-color: #1D2541;
  854. }
  855. /* 文章内容 start*/
  856. .blogger {
  857. &__item {
  858. padding: 30rpx;
  859. }
  860. &__author {
  861. &__btn {
  862. margin-right: -12rpx;
  863. opacity: 0.5;
  864. }
  865. }
  866. &__desc {
  867. line-height: 30rpx;
  868. &__label {
  869. color: #1D2541;
  870. background-color: #F3F2F7;
  871. border-radius: 10rpx;
  872. font-size: 22rpx;
  873. padding: 5rpx 15rpx;
  874. margin: 5rpx 18rpx 0 0;
  875. &--prefix {
  876. font-size: 24rpx;
  877. color: #1D2541;
  878. padding-right: 10rpx;
  879. }
  880. }
  881. &__content {
  882. line-height: 50rpx;
  883. }
  884. }
  885. &__content {
  886. margin-top: 18rpx;
  887. padding-right: 18rpx;
  888. &__data {
  889. line-height: 46rpx;
  890. text-align: justify;
  891. overflow: hidden;
  892. transition: all 0.25s ease-in-out;
  893. }
  894. &__status {
  895. margin-top: 10rpx;
  896. font-size: 26rpx;
  897. color: #82B2FF;
  898. }
  899. }
  900. &__main-image {
  901. border: 1rpx solid #F8F7F8;
  902. border-radius: 16rpx;
  903. &--1 {
  904. max-width: 80%;
  905. max-height: 300rpx;
  906. }
  907. &--2 {
  908. max-width: 260rpx;
  909. max-height: 260rpx;
  910. }
  911. &--3 {
  912. height: 212rpx;
  913. width: 100%;
  914. }
  915. }
  916. &__count-icon {
  917. font-size: 40rpx;
  918. padding-right: 5rpx;
  919. }
  920. &__ad {
  921. width: 100%;
  922. height: 500rpx;
  923. transform: translate3d(0px, 0px, 0px) !important;
  924. ::v-deep .uni-swiper-slide-frame {
  925. transform: translate3d(0px, 0px, 0px) !important;
  926. }
  927. .uni-swiper-slide-frame {
  928. transform: translate3d(0px, 0px, 0px) !important;
  929. }
  930. &__item {
  931. position: absolute;
  932. width: 100%;
  933. height: 100%;
  934. transform-origin: left center;
  935. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  936. transition: transform 0.25s ease-in-out;
  937. z-index: 1;
  938. &--0 {
  939. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  940. z-index: 4;
  941. }
  942. &--1 {
  943. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  944. z-index: 3;
  945. }
  946. &--2 {
  947. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  948. z-index: 2;
  949. }
  950. }
  951. &__content {
  952. border-radius: 40rpx;
  953. width: 640rpx;
  954. height: 500rpx;
  955. overflow: hidden;
  956. }
  957. &__image {
  958. width: 100%;
  959. height: 100%;
  960. }
  961. }
  962. }
  963. /* 文章内容 end*/
  964. /* 间隔线 start*/
  965. .tn-strip-bottom {
  966. width: 100%;
  967. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  968. }
  969. /* 间隔线 end*/
  970. /* 广告内容 start */
  971. .ad-image {
  972. width: 80rpx;
  973. height: 80rpx;
  974. position: relative;
  975. }
  976. .ad-pic {
  977. background-size: cover;
  978. background-repeat: no-repeat;
  979. // background-attachment:fixed;
  980. background-position: top;
  981. border-radius: 20%;
  982. }
  983. /* 自定义导航栏内容 end */
  984. /* 全屏轮播 start*/
  985. .card-swiper {
  986. height: 100vh !important;
  987. }
  988. .card-swiper swiper-item {
  989. width: 750rpx !important;
  990. left: 0rpx;
  991. box-sizing: border-box;
  992. overflow: initial;
  993. }
  994. .card-swiper swiper-item .swiper-item {
  995. width: 100%;
  996. display: block;
  997. height: 100vh;
  998. border-radius: 0rpx;
  999. transform: scale(1);
  1000. transition: all 0.2s ease-in 0s;
  1001. overflow: hidden;
  1002. }
  1003. .card-swiper swiper-item.cur .swiper-item {
  1004. transform: none;
  1005. transition: all 0.2s ease-in 0s;
  1006. }
  1007. .card-swiper swiper-item .swiper-item-png {
  1008. margin-top: -50vh;
  1009. width: 100%;
  1010. display: block;
  1011. border-radius: 0rpx;
  1012. transform: translate(1040rpx, 20rpx) scale(0.5, 0.5);
  1013. transition: all 0.6s ease 0s;
  1014. // overflow: hidden;
  1015. }
  1016. .card-swiper swiper-item.cur .swiper-item-png {
  1017. margin-top: -100vh;
  1018. width: 900rpx;
  1019. transform: translate(-80rpx, 0rpx) scale(1, 1);
  1020. transition: all 0.6s ease 0s;
  1021. }
  1022. .image-banner {
  1023. display: flex;
  1024. align-items: center;
  1025. justify-content: center;
  1026. }
  1027. .image-banner image {
  1028. width: 100%;
  1029. }
  1030. /* 轮播指示点 start*/
  1031. .indication {
  1032. z-index: 9999;
  1033. width: 100%;
  1034. height: 36rpx;
  1035. position: fixed;
  1036. // display:flex;
  1037. display: block;
  1038. flex-direction: row;
  1039. align-items: center;
  1040. justify-content: center;
  1041. }
  1042. .spot {
  1043. background-color: #000;
  1044. opacity: 0.3;
  1045. width: 10rpx;
  1046. height: 10rpx;
  1047. border-radius: 20rpx;
  1048. margin: 20rpx 0 !important;
  1049. left: 95vw;
  1050. top: -60vh;
  1051. position: relative;
  1052. }
  1053. .spot.active {
  1054. opacity: 0.6;
  1055. height: 30rpx;
  1056. background-color: #000;
  1057. }
  1058. /* 资讯主图 start*/
  1059. .image-article {
  1060. border-radius: 8rpx;
  1061. border: 1rpx solid #F8F7F8;
  1062. width: 200rpx;
  1063. height: 200rpx;
  1064. position: relative;
  1065. }
  1066. .image-pic {
  1067. background-size: cover;
  1068. background-repeat: no-repeat;
  1069. // background-attachment:fixed;
  1070. background-position: top;
  1071. border-radius: 10rpx;
  1072. }
  1073. .article-shadow {
  1074. border-radius: 15rpx;
  1075. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  1076. }
  1077. /* 文字截取*/
  1078. .clamp-text-1 {
  1079. -webkit-line-clamp: 1;
  1080. display: -webkit-box;
  1081. -webkit-box-orient: vertical;
  1082. text-overflow: ellipsis;
  1083. overflow: hidden;
  1084. }
  1085. .clamp-text-2 {
  1086. -webkit-line-clamp: 2;
  1087. display: -webkit-box;
  1088. -webkit-box-orient: vertical;
  1089. text-overflow: ellipsis;
  1090. overflow: hidden;
  1091. }
  1092. /* 标签内容 start*/
  1093. .tn-tag-content {
  1094. &__item {
  1095. display: inline-block;
  1096. line-height: 35rpx;
  1097. color: #1D2541;
  1098. background-color: #F3F2F7;
  1099. border-radius: 10rpx;
  1100. font-size: 22rpx;
  1101. padding: 5rpx 15rpx;
  1102. &--prefix {
  1103. padding-right: 10rpx;
  1104. }
  1105. }
  1106. }
  1107. /* 图标容器9 start */
  1108. .icon9 {
  1109. &__item {
  1110. width: 30%;
  1111. background-color: #FFFFFF;
  1112. border-radius: 10rpx;
  1113. padding: 30rpx;
  1114. margin: 20rpx 10rpx;
  1115. transform: scale(1);
  1116. transition: transform 0.3s linear;
  1117. transform-origin: center center;
  1118. &--icon {
  1119. width: 110rpx;
  1120. height: 110rpx;
  1121. font-size: 65rpx;
  1122. border-radius: 50%;
  1123. margin: 20rpx 40rpx;
  1124. position: relative;
  1125. z-index: 1;
  1126. &::after {
  1127. content: " ";
  1128. position: absolute;
  1129. z-index: -1;
  1130. width: 100%;
  1131. height: 100%;
  1132. left: 0;
  1133. bottom: 0;
  1134. border-radius: inherit;
  1135. opacity: 1;
  1136. transform: scale(1, 1);
  1137. background-size: 100% 100%;
  1138. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png);
  1139. }
  1140. }
  1141. }
  1142. }
  1143. /* 悬浮 */
  1144. .tnxuanfu {
  1145. animation: suspension 3s ease-in-out infinite;
  1146. }
  1147. @keyframes suspension {
  1148. 0%,
  1149. 100% {
  1150. transform: translateY(0);
  1151. }
  1152. 50% {
  1153. transform: translateY(-0.8rem);
  1154. }
  1155. }
  1156. /* 悬浮按钮 */
  1157. .button-shop {
  1158. width: 90rpx;
  1159. height: 90rpx;
  1160. display: flex;
  1161. flex-direction: row;
  1162. position: fixed;
  1163. /* bottom:200rpx;
  1164. right: 20rpx; */
  1165. left: 5rpx;
  1166. top: 5rpx;
  1167. z-index: 1001;
  1168. border-radius: 100px;
  1169. opacity: 0.9;
  1170. }
  1171. /* 按钮 */
  1172. .edit {
  1173. bottom: 300rpx;
  1174. right: 75rpx;
  1175. position: fixed;
  1176. z-index: 9999;
  1177. }
  1178. .pa,
  1179. .pa0 {
  1180. position: absolute
  1181. }
  1182. .pa0 {
  1183. left: 0;
  1184. top: 0
  1185. }
  1186. .bg0 {
  1187. width: 100rpx;
  1188. height: 100rpx;
  1189. top: 50%;
  1190. left: 50%;
  1191. transform: translate(-50%, -50%);
  1192. }
  1193. .bg1 {
  1194. width: 100%;
  1195. height: 100%;
  1196. }
  1197. .hx-box {
  1198. top: 50%;
  1199. left: 50%;
  1200. width: 100rpx;
  1201. height: 100rpx;
  1202. transform-style: preserve-3d;
  1203. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  1204. }
  1205. .hx-box .pr {
  1206. width: 100rpx;
  1207. height: 100rpx;
  1208. transform-style: preserve-3d;
  1209. animation: hxz 20s linear infinite;
  1210. }
  1211. @keyframes hxz {
  1212. 0% {
  1213. transform: rotateX(0deg);
  1214. }
  1215. 100% {
  1216. transform: rotateX(-360deg);
  1217. }
  1218. }
  1219. .hx-box .pr .pa0 {
  1220. width: 100rpx;
  1221. height: 100rpx;
  1222. /* border: 4px solid #5ec0ff; */
  1223. border-radius: 1000px;
  1224. }
  1225. .hx-box .pr .pa0 .span {
  1226. display: block;
  1227. width: 100%;
  1228. height: 100%;
  1229. background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc4.png) no-repeat center center;
  1230. background-size: 100% 100%;
  1231. animation: hx 4s linear infinite;
  1232. }
  1233. @keyframes hx {
  1234. to {
  1235. transform: rotate(360deg);
  1236. }
  1237. }
  1238. .hx-k1 {
  1239. transform: rotateX(-60deg) rotateZ(-60deg)
  1240. }
  1241. .hx-k2 {
  1242. transform: rotateX(-30deg) rotateZ(-30deg)
  1243. }
  1244. .hx-k3 {
  1245. transform: rotateX(0deg) rotateZ(0deg)
  1246. }
  1247. .hx-k4 {
  1248. transform: rotateX(30deg) rotateZ(30deg)
  1249. }
  1250. .hx-k5 {
  1251. transform: rotateX(60deg) rotateZ(60deg)
  1252. }
  1253. .hx-k6 {
  1254. transform: rotateX(90deg) rotateZ(90deg)
  1255. }
  1256. /deep/ .tn-toast {
  1257. background-color: #000c !important;
  1258. }
  1259. .bg-content{
  1260. color: #fff;
  1261. background-image: url(./../../static/bg.png);
  1262. background-size: cover;
  1263. }
  1264. </style>