home.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  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;word-break: break-all;" :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. },
  203. onShow() {
  204. this.$nextTick(() => {
  205. this.fetchData();
  206. })
  207. },
  208. methods: {
  209. // 瀑布流导航页面滚动到底部
  210. tabbarPageScrollLower(e) {
  211. this.loadMore();
  212. },
  213. onPulling(e) {
  214. console.log("onpulling", e);
  215. if(e.detail.deltaY<0){
  216. return
  217. }
  218. this.triggered = true
  219. },
  220. onRefresh(){
  221. if (this._freshing) return;
  222. this._freshing = true;
  223. this.reFetchData();
  224. setTimeout(() => {
  225. this.triggered = false;
  226. this._freshing = false;
  227. }, 1000)
  228. },
  229. onRestore() {
  230. this.triggered = false; // 需要重置
  231. },
  232. addLog(shareData){
  233. const that = this;
  234. let params= {
  235. bisNo:shareData.bisNo,
  236. bisType:'1',
  237. userNo:uni.getStorageSync('userNo')
  238. };
  239. request.post('/slbForward/add',{slbForward:JSON.stringify(params)},{headers: {'Content-Type': 'application/json'},
  240. }).then(res=>{
  241. })
  242. },
  243. sleep(time) {
  244. return new Promise((resolve) => setTimeout(resolve, time));
  245. },
  246. onShareAppMessage: function(option) {
  247. if(option.from=="button"){
  248. this.hideSheet();
  249. this.shareData=option.target.dataset.coupon;
  250. this.addLog(this.shareData);
  251. const promise = new Promise(async (resolve) => {
  252. await this.sleep(500);
  253. resolve({
  254. // title: `速立保`,
  255. path: `/pages/index/detail/detail?id=`+this.shareData.bisNo+'&isNeed=1',
  256. // imageUrl: url,
  257. });
  258. });
  259. // 默认参数
  260. return {
  261. // title: `速立保`,
  262. path: `/pages/index/detail/detail?id=`+this.shareData.bisNo+'&isNeed=1',
  263. promise,
  264. };
  265. }else{
  266. return {
  267. // title: '速立保',
  268. path: '/pages/index/index',
  269. };
  270. }
  271. },
  272. clickLink(url,fileName) {
  273. // uni.navigateTo({
  274. // url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
  275. // })
  276. uni.downloadFile({
  277. url: url,
  278. filePath: wx.env.USER_DATA_PATH + "/" + fileName,
  279. success: function (res) {
  280. const filePath = res.filePath
  281. uni.openDocument({
  282. filePath: filePath,
  283. showMenu: true,
  284. success: function (res) {
  285. console.log('打开文档成功')
  286. },
  287. fail: function(){
  288. uni.navigateTo({
  289. url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
  290. })
  291. }
  292. })
  293. }
  294. })
  295. },
  296. isImage(fileName) {
  297. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  298. const extension = fileName.split('.').pop().toLowerCase();
  299. return imageExtensions.includes(extension);
  300. },
  301. reFetchData() {
  302. this.loading = true;
  303. uni.showToast({
  304. title: '正在刷新...',
  305. icon: 'none'
  306. });
  307. this.content = [];
  308. this.fetchData();
  309. },
  310. fetchData(curIndex = 1) {
  311. let that = this;
  312. that.showEmpty = false;
  313. this.curIndex = curIndex;
  314. request.post('/slbResourceDemand/query', {
  315. index: curIndex,
  316. limit: 10,
  317. content: that.searchValue,
  318. }).then(res => {
  319. that.loading = false;
  320. uni.hideToast();
  321. if (res&&res.success) {
  322. that.totalSize = res.total || 0;
  323. let newList = res.list || [];
  324. for (let i = 0; i < newList.length; i++) {
  325. newList[i].imgList = [];
  326. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  327. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  328. newList[i].imgList.push(newList[i].fileDetailList[j]);
  329. }
  330. }
  331. }
  332. if (curIndex == 1) {
  333. that.content = newList || [];
  334. } else {
  335. that.content = that.content.concat(newList || []);
  336. }
  337. }
  338. that.showEmpty = true;
  339. })
  340. },
  341. // 跳转
  342. tn(e) {
  343. uni.navigateTo({
  344. url: e,
  345. });
  346. },
  347. hideSheet(){
  348. this.curItem = {}
  349. this.showSheet = false;
  350. },
  351. showActionSheet(item) {
  352. let that = this;
  353. if(!this.curItem.id){
  354. this.curItem = item;
  355. }else{
  356. if(this.curItem.id!=item.id){
  357. this.curItem = item;
  358. }else{
  359. this.curItem = {}
  360. this.showSheet = false;
  361. return false;
  362. }
  363. }
  364. this.curItem.isNeed = 1;
  365. this.collStatus = false;
  366. this.showSheet = true;
  367. that.showContact = false;
  368. if (uni.getStorageSync('userNo')) {
  369. let params = {};
  370. params = {
  371. fkBisNo: that.curItem.bisNo,
  372. userNo: uni.getStorageSync('userNo'),
  373. };
  374. request.post('/slbCollect/query', params).then(res => {
  375. if (res.success) {
  376. if (res.list && res.list.length > 0) {
  377. that.collStatus = true;
  378. that.collId = res.list[0].id;
  379. }
  380. }
  381. })
  382. }
  383. },
  384. linkTel() {
  385. if (!uni.getStorageSync('userNo')) {
  386. uni.showToast({
  387. title: '请登录',
  388. icon:'none'
  389. })
  390. uni.navigateTo({
  391. url: '/pages/login/login'
  392. })
  393. return false;
  394. }
  395. let that = this;
  396. let params = {};
  397. params.slbBisContact = JSON.stringify({
  398. fkBisNo: that.curItem.bisNo,
  399. bisType: '1',
  400. type: '1',
  401. company: that.curItem.company,
  402. companyNo: that.curItem.companyNo,
  403. userNo: uni.getStorageSync('userNo'),
  404. });
  405. request.post('/slbBisContact/add', params).then(res => {
  406. if (res.success) {
  407. that.showContact = true;
  408. that.curContact.company = that.curItem.company;
  409. that.curContact.contactMethod = res.resultMap.contactMethod;
  410. that.curContact.contactPerson = res.resultMap.contactPerson;
  411. } else {
  412. that.showContact = false;
  413. uni.showToast({
  414. title: res.msg,
  415. icon: 'none'
  416. })
  417. }
  418. })
  419. },
  420. addColl() {
  421. if (!uni.getStorageSync('userNo')) {
  422. uni.showToast({
  423. title: '请登录',
  424. icon:'none'
  425. })
  426. uni.navigateTo({
  427. url: '/pages/login/login'
  428. })
  429. return false;
  430. }
  431. let that = this;
  432. let params = {};
  433. params.slbCollect = JSON.stringify({
  434. fkBisNo: that.curItem.bisNo,
  435. bisType: '1',
  436. userNo: uni.getStorageSync('userNo'),
  437. });
  438. request.post('/slbCollect/add', params).then(res => {
  439. if (res.success) {
  440. that.curItem = {}
  441. that.showSheet = false;
  442. uni.showToast({
  443. title: '信息已收藏,请在我的收藏里查看阅读',
  444. icon:'none',
  445. duration: 2000
  446. });
  447. } else {
  448. uni.showToast({
  449. title: res.msg,
  450. icon:'none'
  451. })
  452. }
  453. })
  454. },
  455. delColl() {
  456. let that = this;
  457. request.post('/slbCollect/del', {
  458. id: that.collId
  459. }).then(res => {
  460. if (res.success) {
  461. that.curItem = {}
  462. that.showSheet = false;
  463. wx.showToast({
  464. title: '此需求信息将不会保存在我的收藏里',
  465. icon:'none',
  466. duration: 2000
  467. });
  468. } else {
  469. uni.showToast({
  470. title: res.msg,
  471. icon:'none'
  472. })
  473. }
  474. })
  475. },
  476. showImg(items, index) {
  477. let urls = [];
  478. for (let i = 0; i < items.length; i++) {
  479. urls.push(items[i].ftpUrl);
  480. }
  481. // 预览图片
  482. uni.previewImage({
  483. urls: urls,
  484. current: index,
  485. });
  486. },
  487. showValid(text){
  488. uni.showToast({
  489. title: '有效期:'+text,
  490. icon: 'none'
  491. })
  492. },
  493. addButton() {
  494. if (!uni.getStorageSync('userNo')) {
  495. uni.showToast({
  496. title: '请登录',
  497. icon:'none'
  498. })
  499. uni.navigateTo({
  500. url: '/pages/login/login'
  501. })
  502. return false;
  503. } else {
  504. uni.navigateTo({
  505. url: '/circlePages/circle'
  506. })
  507. }
  508. //未登录,去登录
  509. //已登录,去新增第一步
  510. },
  511. loadMore() {
  512. if (this.totalSize > this.content.length) {
  513. this.fetchData(this.curIndex + 1);
  514. }
  515. console.error('正在加载更多');
  516. },
  517. search() {
  518. this.fetchData();
  519. },
  520. cancel() {
  521. this.searchValue = '';
  522. this.fetchData();
  523. },
  524. clear() {
  525. this.searchValue = '';
  526. this.fetchData();
  527. },
  528. showTel(tel){
  529. uni.makePhoneCall({
  530. phoneNumber: tel,
  531. });
  532. },
  533. showDetail(item){
  534. uni.navigateTo({
  535. url: '/pages/index/detail/detail?id='+item.bisNo+'&isNeed=1'
  536. })
  537. }
  538. }
  539. }
  540. </script>
  541. <style lang="scss" scoped>
  542. .index {
  543. max-height: 100vh;
  544. }
  545. /* 底部安全边距 start*/
  546. .tn-tabbar-height {
  547. min-height: 120rpx;
  548. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  549. height: calc(140rpx + constant(safe-area-inset-bottom));
  550. }
  551. /* 自定义导航栏内容 start */
  552. .custom-nav {
  553. height: 100%;
  554. &__back {
  555. margin: auto 5rpx;
  556. font-size: 40rpx;
  557. margin-right: 10rpx;
  558. margin-left: 30rpx;
  559. flex-basis: 5%;
  560. }
  561. &__search {
  562. flex-basis: 70%;
  563. width: 100%;
  564. height: 100%;
  565. &__box {
  566. width: 100%;
  567. height: 70%;
  568. padding: 10rpx 0;
  569. margin: 0 30rpx;
  570. border-radius: 60rpx 60rpx 0 60rpx;
  571. font-size: 24rpx;
  572. }
  573. &__icon {
  574. padding-right: 10rpx;
  575. margin-left: 20rpx;
  576. font-size: 30rpx;
  577. }
  578. &__text {
  579. // color: #AAAAAA;
  580. }
  581. }
  582. }
  583. /* 自定义导航栏内容 end */
  584. /* 文章内容 start*/
  585. .tn-blogger-content {
  586. &__wrap {
  587. margin: 30rpx;
  588. }
  589. &__info {
  590. &__btn {
  591. margin-right: -12rpx;
  592. opacity: 0.5;
  593. }
  594. }
  595. &__label {
  596. &__item {
  597. color: #1D2541;
  598. background-color: #F3F2F7;
  599. border-radius: 10rpx;
  600. font-size: 22rpx;
  601. padding: 5rpx 15rpx;
  602. margin: 5rpx 0 0 18rpx;
  603. &--prefix {
  604. font-size: 24rpx;
  605. color: #1D2541;
  606. padding-right: 10rpx;
  607. }
  608. }
  609. &__desc {
  610. line-height: 55rpx;
  611. }
  612. }
  613. &__main-image {
  614. border: 1rpx solid #F8F7F8;
  615. border-radius: 16rpx;
  616. &--1 {
  617. max-width: 690rpx;
  618. min-width: 690rpx;
  619. max-height: 400rpx;
  620. min-height: 400rpx;
  621. }
  622. &--2 {
  623. max-width: 260rpx;
  624. max-height: 260rpx;
  625. }
  626. &--3 {
  627. height: 212rpx;
  628. width: 100%;
  629. }
  630. }
  631. &__count-icon {
  632. font-size: 40rpx;
  633. padding-right: 5rpx;
  634. }
  635. }
  636. /* 自定义导航栏内容 start */
  637. .custom-nav {
  638. height: 100%;
  639. &__back {
  640. margin: auto 5rpx;
  641. font-size: 40rpx;
  642. margin-right: 10rpx;
  643. margin-left: 30rpx;
  644. flex-basis: 5%;
  645. }
  646. &__search {
  647. flex-basis: 60%;
  648. width: 100%;
  649. height: 100%;
  650. &__box {
  651. width: 100%;
  652. height: 70%;
  653. padding: 10rpx 0;
  654. margin: 0 30rpx;
  655. border-radius: 60rpx 60rpx 0 60rpx;
  656. font-size: 24rpx;
  657. }
  658. &__icon {
  659. padding-right: 10rpx;
  660. margin-left: 20rpx;
  661. font-size: 30rpx;
  662. }
  663. &__text {
  664. color: #AAAAAA;
  665. }
  666. }
  667. }
  668. /* 文章内容 start*/
  669. .blogger {
  670. &__item {
  671. padding: 30rpx;
  672. }
  673. &__author {
  674. &__btn {
  675. margin-right: -12rpx;
  676. opacity: 0.5;
  677. }
  678. }
  679. &__desc {
  680. line-height: 30rpx;
  681. &__label {
  682. color: #1D2541;
  683. background-color: #F3F2F7;
  684. border-radius: 10rpx;
  685. font-size: 22rpx;
  686. padding: 5rpx 15rpx;
  687. margin: 5rpx 18rpx 0 0;
  688. &--prefix {
  689. font-size: 24rpx;
  690. color: #1D2541;
  691. padding-right: 10rpx;
  692. }
  693. }
  694. &__content {
  695. line-height: 50rpx;
  696. }
  697. }
  698. &__content {
  699. margin-top: 18rpx;
  700. padding-right: 18rpx;
  701. &__data {
  702. line-height: 46rpx;
  703. text-align: justify;
  704. overflow: hidden;
  705. transition: all 0.25s ease-in-out;
  706. }
  707. &__status {
  708. margin-top: 10rpx;
  709. font-size: 26rpx;
  710. color: #82B2FF;
  711. }
  712. }
  713. &__main-image {
  714. border: 1rpx solid #F8F7F8;
  715. border-radius: 16rpx;
  716. &--1 {
  717. max-width: 80%;
  718. max-height: 300rpx;
  719. }
  720. &--2 {
  721. max-width: 260rpx;
  722. max-height: 260rpx;
  723. }
  724. &--3 {
  725. height: 212rpx;
  726. width: 100%;
  727. }
  728. }
  729. &__count-icon {
  730. font-size: 40rpx;
  731. padding-right: 5rpx;
  732. }
  733. &__ad {
  734. width: 100%;
  735. height: 500rpx;
  736. transform: translate3d(0px, 0px, 0px) !important;
  737. ::v-deep .uni-swiper-slide-frame {
  738. transform: translate3d(0px, 0px, 0px) !important;
  739. }
  740. .uni-swiper-slide-frame {
  741. transform: translate3d(0px, 0px, 0px) !important;
  742. }
  743. &__item {
  744. position: absolute;
  745. width: 100%;
  746. height: 100%;
  747. transform-origin: left center;
  748. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  749. transition: transform 0.25s ease-in-out;
  750. z-index: 1;
  751. &--0 {
  752. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  753. z-index: 4;
  754. }
  755. &--1 {
  756. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  757. z-index: 3;
  758. }
  759. &--2 {
  760. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  761. z-index: 2;
  762. }
  763. }
  764. &__content {
  765. border-radius: 40rpx;
  766. width: 640rpx;
  767. height: 500rpx;
  768. overflow: hidden;
  769. }
  770. &__image {
  771. width: 100%;
  772. height: 100%;
  773. }
  774. }
  775. }
  776. /* 文章内容 end*/
  777. </style>