comm.vue 33 KB

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