home.vue 33 KB

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