home.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. <template>
  2. <view class="index tn-safe-area-inset-bottom" style="background: #f7f7f7;min-height: 100vh;">
  3. <tn-nav-bar customBack>
  4. <view slot="back" class='tn-custom-nav-bar__back' >
  5. <image style="width: 28px;height: 28px;margin-left:4px" @click="reFetchData()" src="../../static/tu/reload.png"></image>
  6. <image style="width: 28px;height: 28px;margin-left:12px" @click="addButton()" src="../../static/tu/add.png"></image>
  7. </view>
  8. <view slot="default" style="display: flex;">
  9. <view style="flex:1;">
  10. <text :style="{fontSize:(wxFontSize)+'px'}">我要什么</text>
  11. </view>
  12. </view>
  13. </tn-nav-bar>
  14. <scroll-view :style="{paddingTop: vuex_custom_bar_height + 'px'}" style="height: 100vh;" class="custom-tabbar-page" lower-threshold="60" scroll-y :refresher-enabled="true" :refresher-triggered="triggered" @refresherpulling="onPulling" @refresherrestore="onRestore" @refresherrefresh="onRefresh" enable-back-to-top @scrolltolower="tabbarPageScrollLower">
  15. <view >
  16. <uv-sticky bgColor="#ffffff">
  17. <uni-search-bar radius="15" placeholder="搜索" @confirm="search" v-model="searchValue" @blur="search"
  18. @cancel="cancel" @clear="clear" cancelButton="auto" bgColor="#fff" clearButton="auto" :fontSize="(wxFontSize-2)"
  19. style="background: #f7f7f7;">
  20. <template v-slot:searchIcon>
  21. <image src="../../static/tu/search.png" style="width: 26px;height: 26px"></image>
  22. </template>
  23. </uni-search-bar></uv-sticky>
  24. <!-- 图文信息 -->
  25. <block v-for="(item,index) in content" :key="item.id" >
  26. <view class="blogger__item" style="border-radius: 12px;margin: 12px 16px 12px 16px; background-color: #fff;" :style="{marginTop:index==0?'0':'12px'}">
  27. <view class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center">
  28. <view class="justify__author__info" @click="tn('')">
  29. <view class="tn-flex tn-flex-row-center">
  30. <view class="tn-flex tn-flex-row-center tn-flex-col-center">
  31. <view class="" style="width: 5px;height: 5px;background: #E18730;border-radius: 50%;margin-right: 4px;">
  32. </view>
  33. <view class="tn-padding-right">
  34. <view class="tn-padding-right tn-text-lg" style="color:#333;font-weight: 600;" :style="{fontSize:(wxFontSize)+'px'}">
  35. {{ item.company }}
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view v-if="item.validDate"
  42. class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
  43. <text class="" style="background: #E6E8F4;font-size: 12px;word-break: keep-all;padding: 8px;color: #8383F7;border-radius: 24px;border-top-right-radius: 0;" :style="{fontSize:(wxFontSize-6)+'px'}" @click="showValid(item.validDate)">{{item.validDate}}</text>
  44. </view>
  45. </view>
  46. <view style="margin-top: 20rpx;border-radius: 0px 0px 0px 0px;width:calc(100% + 32px);margin-left:-16px;border-bottom: 1px solid #E6E6E6;"></view>
  47. <view
  48. class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left"
  49. >
  50. <text
  51. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df" style="color:#747E87" :style="{fontSize:(wxFontSize-2)+'px'}">{{ item.content }}</text>
  52. </view>
  53. <block v-if="item.imgList&&item.imgList.length>0">
  54. <view v-if="[1,2,4].indexOf(item.imgList.length) != -1" class="tn-padding-top-xs">
  55. <image v-for="(image_item,image_index) in item.imgList" :key="image_index"
  56. class="blogger__main-image" :class="{
  57. 'blogger__main-image--1 tn-margin-bottom-sm': item.imgList.length === 1,
  58. 'blogger__main-image--2 tn-margin-right-sm tn-margin-bottom-sm': item.imgList.length === 2 || item.imgList.length === 4
  59. }" :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  60. </view>
  61. <view v-else class="tn-padding-top-xs">
  62. <tn-grid hoverClass="none" :col="3">
  63. <block v-for="(image_item,image_index) in item.imgList" :key="image_index">
  64. <!-- #ifndef MP-WEIXIN -->
  65. <tn-grid-item style="width: 30%;margin: 10rpx;">
  66. <image class="blogger__main-image blogger__main-image--3"
  67. :src="image_item.ftpUrl" mode="aspectFill"
  68. @click="showImg(item.imgList,image_index)"></image>
  69. </tn-grid-item>
  70. <!-- #endif-->
  71. <!-- #ifdef MP-WEIXIN -->
  72. <tn-grid-item style="width: 30%;margin: 10rpx;">
  73. <image class="blogger__main-image blogger__main-image--3"
  74. :src="image_item.ftpUrl" mode="aspectFill"
  75. @click="showImg(item.imgList,image_index)"></image>
  76. </tn-grid-item>
  77. <!-- #endif-->
  78. </block>
  79. </tn-grid>
  80. </view>
  81. </block>
  82. <view v-for="(file,fIndex) in item.fileDetailList" :style="{marginTop:item.imgList&&item.imgList.length==0&&fIndex==0?'8px':'0'}" style="background-color:#005da60d ;margin-bottom: 4px;padding: 4px 8px;border-radius: 4px;" :key="file.id" v-if="!isImage(file.fileName)" @click="clickLink(file.ftpUrl,file.fileName)">
  83. <view>
  84. <image src="../../static/tu/link.png" style="width: 18px;height: 18px;vertical-align: bottom;"></image>
  85. <view style="display: inline;margin-left:8px;color:#005DA6;" :style="{fontSize:(wxFontSize-3)+'px'}">
  86. {{file.fileName}}</view>
  87. </view>
  88. </view>
  89. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-top-xs">
  90. <view class="justify-content-item tn-color-gray tn-text-center">
  91. <view class="tn-padding-right tn-padding-top-xs tn-color-gray" :style="{fontSize:(wxFontSize-3)+'px',color:'#777'}">
  92. {{ item.createTime|formatDate }}
  93. </view>
  94. </view>
  95. <view class="justify-content-item tn-flex tn-flex-col-center" style="position: relative;">
  96. <image style="width: 30px;height:30px;" @click="showActionSheet(item)" src="../../static/tu/more.png"></image>
  97. <!-- <text class="tn-icon-more-vertical tn-text-bold tn-text-xxl" style="color: #005DA6;transform: rotate(90deg);"
  98. @click="showActionSheet(item)"></text> -->
  99. <view v-if="curItem.id==item.id&&showSheet" class="pop-dia" style="position: absolute;background: #E4F1FB;display: block;right: 10px;top: 24px;border-radius: 6px;z-index: 900;">
  100. <view class="content" style="padding: 8px;font-size: 16px;line-height: 24px; width: 180px;border-radius: 6px;z-index: -1;"
  101. v-if="!showContact">
  102. <button @click="linkTel()" style="border: none;border-radius: 0;color: #333333;background-color: #E4F1FB;border-bottom: 1px solid rgb(0 93 166 / 0.2);">
  103. <image src="../../static/tu/call.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: middle;"> 联系需方</button>
  104. <!-- <view>联系我们帮助对接</view> -->
  105. <button v-if="!collStatus" @click="addColl"
  106. style="border: none;border-radius: 0;color: #333333;background-color: #E4F1FB;border-bottom: 1px solid rgb(0 93 166 / 0.2);" type="default" plain="true">
  107. <image src="../../static/tu/coll.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: sub;">
  108. 收&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;藏</button>
  109. <button v-if="collStatus" @click="delColl"
  110. style="border: none;border-radius: 0;color: #333333;background-color: #E4F1FB;border-bottom: 1px solid rgb(0 93 166 / 0.2);" type="default" plain="true">
  111. <image src="../../static/tu/coll.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: sub;"> 取消收藏</button>
  112. <button open-type="share"
  113. style="border: none;border-radius: 0;color: #333333;background-color: #E4F1FB;" type="default" plain="true" :data-coupon="curItem">
  114. <image src="../../static/tu/share.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: sub;">
  115. 转&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</button>
  116. </view>
  117. <view class="content " style="position: relative;background: linear-gradient( 180deg, #DAECFA 0%, #FFFFFF 27%, #FFFFFF 100%);padding: 24px 40px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 80px);line-height: 24px;border-radius: 12px;"
  118. v-if="showContact">
  119. <view><text style="font-size: 19px;font-weight: bold;color: #333;" v-if="curContact.company">{{curContact.company}}</text></view>
  120. <view style="margin-top:10px;font-size: 17px;text-align: center;color:#333">
  121. <image src="../../static/tu/person.png" style="width: 24px;height: 24px;vertical-align: sub;">
  122. <text style="margin-left: 6px;">{{curContact.contactPerson}}</text> </view>
  123. <view style="margin-top:10px;font-size: 17px;text-align: center;color:#333" @click="showTel(curContact.contactMethod)">
  124. <image src="../../static/tu/tel.png" style="width: 24px;height: 24px;vertical-align: middle;">
  125. <text style="margin-left: 4px;">{{curContact.contactMethod}}</text>
  126. </view>
  127. <image src="../../static/tu/close.png" style="width: 40px;height: 40px;position: absolute; left: calc(50vw - 60px);bottom: -64px;" @click="hideSheet()"></image>
  128. </view>
  129. <view style="position: fixed;top: 0;left: 0;height: 100000vh;width: 100%;background: rgb(0 0 0 / 0.5);z-index: -1;" @click="hideSheet()" v-if="showContact"></view>
  130. </view>
  131. </view>
  132. </view>
  133. </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: #f7f7f7;padding: 16px 0;" :style="{paddingTop:showSheet?'166px':'16px'}">
  140. <tn-load-more status="nomore" :loadText="loadText" :fontSize="(wxFontSize+11)"></tn-load-more>
  141. </view>
  142. </view>
  143. </scroll-view>
  144. </view>
  145. </template>
  146. <script>
  147. import request from '../../utils/request'
  148. export default {
  149. name: 'Index',
  150. data() {
  151. return {
  152. loading: false,
  153. loadText: {
  154. loadmore: '下拉加载',
  155. loading: '快速加载中...',
  156. nomore: '恭喜你,已阅读完所有需求信息哦!'
  157. },
  158. showContact: false,
  159. curContact: {},
  160. totalSize: 0,
  161. curIndex: 1,
  162. showSheet: false,
  163. curItem: {},
  164. userNo: '',
  165. searchValue: '',
  166. collStatus: '',
  167. cardCur: 0,
  168. collId: '',
  169. isAndroid: true,
  170. content: [],
  171. showEmpty:false,
  172. wxFontSize:17,
  173. triggered: false,
  174. _freshing: false,
  175. shareData:{},
  176. }
  177. },
  178. filters: {
  179. formatDate(value) {
  180. if (!value) return '';
  181. const date = new Date(value);
  182. const today = new Date();
  183. const yesterday = new Date(today); // 昨天的日期
  184. yesterday.setDate(yesterday.getDate() - 1); // 将昨天的日期设置为前一天
  185. if (date.getFullYear() == today.getFullYear() && date.getMonth() == today.getMonth() && date.getDate() ==
  186. today.getDate()) {
  187. return '今天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  188. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  189. }
  190. if (date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date
  191. .getDate() == yesterday.getDate()) {
  192. return '昨天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  193. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  194. }
  195. return date.toLocaleDateString() + ' ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  196. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  197. },
  198. },
  199. created() {
  200. const appBaseInfo = wx.getAppBaseInfo();
  201. this.wxFontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
  202. this.fetchData();
  203. },
  204. methods: {
  205. // 瀑布流导航页面滚动到底部
  206. tabbarPageScrollLower(e) {
  207. this.loadMore();
  208. },
  209. onPulling(e) {
  210. console.log("onpulling", e);
  211. if(e.detail.deltaY<0){
  212. return
  213. }
  214. this.triggered = true
  215. },
  216. onRefresh(){
  217. if (this._freshing) return;
  218. this._freshing = true;
  219. this.reFetchData();
  220. setTimeout(() => {
  221. this.triggered = false;
  222. this._freshing = false;
  223. }, 2000)
  224. },
  225. onRestore() {
  226. this.triggered = false; // 需要重置
  227. },
  228. addLog(shareData){
  229. const that = this;
  230. let params= {
  231. bisNo:shareData.bisNo,
  232. bisType:'1',
  233. userNo:uni.getStorageSync('userNo')
  234. };
  235. request.post('/slbForward/add',{slbForward:JSON.stringify(params)},{headers: {'Content-Type': 'application/json'},
  236. }).then(res=>{
  237. })
  238. },
  239. sleep(time) {
  240. return new Promise((resolve) => setTimeout(resolve, time));
  241. },
  242. onShareAppMessage: function(option) {
  243. if(option.from=="button"){
  244. this.hideSheet();
  245. this.shareData=option.target.dataset.coupon;
  246. this.addLog(this.shareData);
  247. const promise = new Promise(async (resolve) => {
  248. await this.sleep(500);
  249. resolve({
  250. // title: `速立保`,
  251. path: `/pages/index/detail/detail?id=`+this.shareData.bisNo+'&isNeed=1',
  252. // imageUrl: url,
  253. });
  254. });
  255. // 默认参数
  256. return {
  257. // title: `速立保`,
  258. path: `/pages/index/detail/detail?id=`+this.shareData.bisNo+'&isNeed=1',
  259. promise,
  260. };
  261. }else{
  262. return {
  263. // title: '速立保',
  264. path: '/pages/index/index',
  265. };
  266. }
  267. },
  268. clickLink(url,fileName) {
  269. // uni.navigateTo({
  270. // url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
  271. // })
  272. uni.downloadFile({
  273. url: url,
  274. filePath: wx.env.USER_DATA_PATH + "/" + fileName,
  275. success: function (res) {
  276. const filePath = res.filePath
  277. uni.openDocument({
  278. filePath: filePath,
  279. showMenu: true,
  280. success: function (res) {
  281. console.log('打开文档成功')
  282. },
  283. fail: function(){
  284. uni.navigateTo({
  285. url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
  286. })
  287. }
  288. })
  289. }
  290. })
  291. },
  292. isImage(fileName) {
  293. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  294. const extension = fileName.split('.').pop().toLowerCase();
  295. return imageExtensions.includes(extension);
  296. },
  297. reFetchData() {
  298. this.loading = true;
  299. uni.showToast({
  300. title: '正在刷新...',
  301. icon: 'none'
  302. });
  303. this.fetchData();
  304. },
  305. fetchData(curIndex = 1) {
  306. let that = this;
  307. that.showEmpty = false;
  308. this.curIndex = curIndex;
  309. request.post('/slbResourceDemand/query', {
  310. index: curIndex,
  311. limit: 10,
  312. content: that.searchValue,
  313. }).then(res => {
  314. that.loading = false;
  315. if (res&&res.success) {
  316. that.totalSize = res.total || 0;
  317. let newList = res.list || [];
  318. for (let i = 0; i < newList.length; i++) {
  319. newList[i].imgList = [];
  320. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  321. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  322. newList[i].imgList.push(newList[i].fileDetailList[j]);
  323. }
  324. }
  325. }
  326. if (curIndex == 1) {
  327. that.content = newList || [];
  328. } else {
  329. that.content = that.content.concat(newList || []);
  330. }
  331. }
  332. that.showEmpty = true;
  333. })
  334. },
  335. // 跳转
  336. tn(e) {
  337. uni.navigateTo({
  338. url: e,
  339. });
  340. },
  341. hideSheet(){
  342. this.curItem = {}
  343. this.showSheet = false;
  344. },
  345. showActionSheet(item) {
  346. let that = this;
  347. if(!this.curItem.id){
  348. this.curItem = item;
  349. }else{
  350. if(this.curItem.id!=item.id){
  351. this.curItem = item;
  352. }else{
  353. this.curItem = {}
  354. this.showSheet = false;
  355. return false;
  356. }
  357. }
  358. this.curItem.isNeed = 1;
  359. this.collStatus = false;
  360. this.showSheet = true;
  361. that.showContact = false;
  362. if (uni.getStorageSync('userNo')) {
  363. let params = {};
  364. params = {
  365. fkBisNo: that.curItem.bisNo,
  366. userNo: uni.getStorageSync('userNo'),
  367. };
  368. request.post('/slbCollect/query', params).then(res => {
  369. if (res.success) {
  370. if (res.list && res.list.length > 0) {
  371. that.collStatus = true;
  372. that.collId = res.list[0].id;
  373. }
  374. }
  375. })
  376. }
  377. },
  378. linkTel() {
  379. if (!uni.getStorageSync('userNo')) {
  380. uni.showToast({
  381. title: '请登录',
  382. icon:'none'
  383. })
  384. uni.navigateTo({
  385. url: '/pages/login/login'
  386. })
  387. return false;
  388. }
  389. let that = this;
  390. let params = {};
  391. params.slbBisContact = JSON.stringify({
  392. fkBisNo: that.curItem.bisNo,
  393. bisType: '1',
  394. type: '1',
  395. company: that.curItem.company,
  396. companyNo: that.curItem.companyNo,
  397. userNo: uni.getStorageSync('userNo'),
  398. });
  399. request.post('/slbBisContact/add', params).then(res => {
  400. if (res.success) {
  401. that.showContact = true;
  402. that.curContact.company = that.curItem.company;
  403. that.curContact.contactMethod = res.resultMap.contactMethod;
  404. that.curContact.contactPerson = res.resultMap.contactPerson;
  405. } else {
  406. that.showContact = false;
  407. uni.showToast({
  408. title: res.msg,
  409. icon: 'none'
  410. })
  411. }
  412. })
  413. },
  414. addColl() {
  415. if (!uni.getStorageSync('userNo')) {
  416. uni.showToast({
  417. title: '请登录',
  418. icon:'none'
  419. })
  420. uni.navigateTo({
  421. url: '/pages/login/login'
  422. })
  423. return false;
  424. }
  425. let that = this;
  426. let params = {};
  427. params.slbCollect = JSON.stringify({
  428. fkBisNo: that.curItem.bisNo,
  429. bisType: '1',
  430. userNo: uni.getStorageSync('userNo'),
  431. });
  432. request.post('/slbCollect/add', params).then(res => {
  433. if (res.success) {
  434. that.curItem = {}
  435. that.showSheet = false;
  436. uni.showToast({
  437. title: '信息已收藏,请在我的收藏里查看阅读',
  438. icon:'none',
  439. duration: 2000
  440. });
  441. } else {
  442. uni.showToast({
  443. title: res.msg,
  444. icon:'none'
  445. })
  446. }
  447. })
  448. },
  449. delColl() {
  450. let that = this;
  451. request.post('/slbCollect/del', {
  452. id: that.collId
  453. }).then(res => {
  454. if (res.success) {
  455. that.curItem = {}
  456. that.showSheet = false;
  457. wx.showToast({
  458. title: '此需求信息将不会保存在我的收藏里',
  459. icon:'none',
  460. duration: 2000
  461. });
  462. } else {
  463. uni.showToast({
  464. title: res.msg,
  465. icon:'none'
  466. })
  467. }
  468. })
  469. },
  470. showImg(items, index) {
  471. let urls = [];
  472. for (let i = 0; i < items.length; i++) {
  473. urls.push(items[i].ftpUrl);
  474. }
  475. // 预览图片
  476. uni.previewImage({
  477. urls: urls,
  478. current: index,
  479. });
  480. },
  481. showValid(text){
  482. uni.showToast({
  483. title: '有效期:'+text,
  484. icon: 'none'
  485. })
  486. },
  487. addButton() {
  488. if (!uni.getStorageSync('userNo')) {
  489. uni.showToast({
  490. title: '请登录',
  491. icon:'none'
  492. })
  493. uni.navigateTo({
  494. url: '/pages/login/login'
  495. })
  496. return false;
  497. } else {
  498. uni.navigateTo({
  499. url: '/circlePages/circle'
  500. })
  501. }
  502. //未登录,去登录
  503. //已登录,去新增第一步
  504. },
  505. loadMore() {
  506. if (this.totalSize > this.content.length) {
  507. this.fetchData(this.curIndex + 1);
  508. }
  509. console.error('正在加载更多');
  510. },
  511. search() {
  512. this.fetchData();
  513. },
  514. cancel() {
  515. this.searchValue = '';
  516. this.fetchData();
  517. },
  518. clear() {
  519. this.searchValue = '';
  520. this.fetchData();
  521. },
  522. showTel(tel){
  523. uni.makePhoneCall({
  524. phoneNumber: tel,
  525. });
  526. },
  527. showDetail(item){
  528. uni.navigateTo({
  529. url: '/pages/index/detail/detail?id='+item.bisNo+'&isNeed=1'
  530. })
  531. }
  532. }
  533. }
  534. </script>
  535. <style lang="scss" scoped>
  536. .index {
  537. max-height: 100vh;
  538. }
  539. /* 底部安全边距 start*/
  540. .tn-tabbar-height {
  541. min-height: 120rpx;
  542. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  543. height: calc(140rpx + constant(safe-area-inset-bottom));
  544. }
  545. /* 自定义导航栏内容 start */
  546. .custom-nav {
  547. height: 100%;
  548. &__back {
  549. margin: auto 5rpx;
  550. font-size: 40rpx;
  551. margin-right: 10rpx;
  552. margin-left: 30rpx;
  553. flex-basis: 5%;
  554. }
  555. &__search {
  556. flex-basis: 70%;
  557. width: 100%;
  558. height: 100%;
  559. &__box {
  560. width: 100%;
  561. height: 70%;
  562. padding: 10rpx 0;
  563. margin: 0 30rpx;
  564. border-radius: 60rpx 60rpx 0 60rpx;
  565. font-size: 24rpx;
  566. }
  567. &__icon {
  568. padding-right: 10rpx;
  569. margin-left: 20rpx;
  570. font-size: 30rpx;
  571. }
  572. &__text {
  573. // color: #AAAAAA;
  574. }
  575. }
  576. }
  577. /* 自定义导航栏内容 end */
  578. /* 文章内容 start*/
  579. .tn-blogger-content {
  580. &__wrap {
  581. margin: 30rpx;
  582. }
  583. &__info {
  584. &__btn {
  585. margin-right: -12rpx;
  586. opacity: 0.5;
  587. }
  588. }
  589. &__label {
  590. &__item {
  591. color: #1D2541;
  592. background-color: #F3F2F7;
  593. border-radius: 10rpx;
  594. font-size: 22rpx;
  595. padding: 5rpx 15rpx;
  596. margin: 5rpx 0 0 18rpx;
  597. &--prefix {
  598. font-size: 24rpx;
  599. color: #1D2541;
  600. padding-right: 10rpx;
  601. }
  602. }
  603. &__desc {
  604. line-height: 55rpx;
  605. }
  606. }
  607. &__main-image {
  608. border: 1rpx solid #F8F7F8;
  609. border-radius: 16rpx;
  610. &--1 {
  611. max-width: 690rpx;
  612. min-width: 690rpx;
  613. max-height: 400rpx;
  614. min-height: 400rpx;
  615. }
  616. &--2 {
  617. max-width: 260rpx;
  618. max-height: 260rpx;
  619. }
  620. &--3 {
  621. height: 212rpx;
  622. width: 100%;
  623. }
  624. }
  625. &__count-icon {
  626. font-size: 40rpx;
  627. padding-right: 5rpx;
  628. }
  629. }
  630. /* 自定义导航栏内容 start */
  631. .custom-nav {
  632. height: 100%;
  633. &__back {
  634. margin: auto 5rpx;
  635. font-size: 40rpx;
  636. margin-right: 10rpx;
  637. margin-left: 30rpx;
  638. flex-basis: 5%;
  639. }
  640. &__search {
  641. flex-basis: 60%;
  642. width: 100%;
  643. height: 100%;
  644. &__box {
  645. width: 100%;
  646. height: 70%;
  647. padding: 10rpx 0;
  648. margin: 0 30rpx;
  649. border-radius: 60rpx 60rpx 0 60rpx;
  650. font-size: 24rpx;
  651. }
  652. &__icon {
  653. padding-right: 10rpx;
  654. margin-left: 20rpx;
  655. font-size: 30rpx;
  656. }
  657. &__text {
  658. color: #AAAAAA;
  659. }
  660. }
  661. }
  662. /* 文章内容 start*/
  663. .blogger {
  664. &__item {
  665. padding: 30rpx;
  666. }
  667. &__author {
  668. &__btn {
  669. margin-right: -12rpx;
  670. opacity: 0.5;
  671. }
  672. }
  673. &__desc {
  674. line-height: 30rpx;
  675. &__label {
  676. color: #1D2541;
  677. background-color: #F3F2F7;
  678. border-radius: 10rpx;
  679. font-size: 22rpx;
  680. padding: 5rpx 15rpx;
  681. margin: 5rpx 18rpx 0 0;
  682. &--prefix {
  683. font-size: 24rpx;
  684. color: #1D2541;
  685. padding-right: 10rpx;
  686. }
  687. }
  688. &__content {
  689. line-height: 50rpx;
  690. }
  691. }
  692. &__content {
  693. margin-top: 18rpx;
  694. padding-right: 18rpx;
  695. &__data {
  696. line-height: 46rpx;
  697. text-align: justify;
  698. overflow: hidden;
  699. transition: all 0.25s ease-in-out;
  700. }
  701. &__status {
  702. margin-top: 10rpx;
  703. font-size: 26rpx;
  704. color: #82B2FF;
  705. }
  706. }
  707. &__main-image {
  708. border: 1rpx solid #F8F7F8;
  709. border-radius: 16rpx;
  710. &--1 {
  711. max-width: 80%;
  712. max-height: 300rpx;
  713. }
  714. &--2 {
  715. max-width: 260rpx;
  716. max-height: 260rpx;
  717. }
  718. &--3 {
  719. height: 212rpx;
  720. width: 100%;
  721. }
  722. }
  723. &__count-icon {
  724. font-size: 40rpx;
  725. padding-right: 5rpx;
  726. }
  727. &__ad {
  728. width: 100%;
  729. height: 500rpx;
  730. transform: translate3d(0px, 0px, 0px) !important;
  731. ::v-deep .uni-swiper-slide-frame {
  732. transform: translate3d(0px, 0px, 0px) !important;
  733. }
  734. .uni-swiper-slide-frame {
  735. transform: translate3d(0px, 0px, 0px) !important;
  736. }
  737. &__item {
  738. position: absolute;
  739. width: 100%;
  740. height: 100%;
  741. transform-origin: left center;
  742. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  743. transition: transform 0.25s ease-in-out;
  744. z-index: 1;
  745. &--0 {
  746. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  747. z-index: 4;
  748. }
  749. &--1 {
  750. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  751. z-index: 3;
  752. }
  753. &--2 {
  754. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  755. z-index: 2;
  756. }
  757. }
  758. &__content {
  759. border-radius: 40rpx;
  760. width: 640rpx;
  761. height: 500rpx;
  762. overflow: hidden;
  763. }
  764. &__image {
  765. width: 100%;
  766. height: 100%;
  767. }
  768. }
  769. }
  770. /* 文章内容 end*/
  771. </style>