home.vue 33 KB

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