comm.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307
  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">
  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" @click="showBrand('品牌:'+item.brand)">{{ 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" @click="showBrand('个人发布')">个人</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. }else{
  460. that.searchProdValue = ''
  461. }
  462. if (uni.getStorageSync('searchProdValue2')) {
  463. that.searchProdValue2 = uni.getStorageSync('searchProdValue2');
  464. }else{
  465. that.searchProdValue2 = ''
  466. }
  467. request.post('/slbResourceShare/query', {
  468. type: that.currentTab == 1 ? '2' : '1',
  469. index: curIndex,
  470. content: that.currentTab == 1 ? (that.searchProdValue2 ? that.searchProdValue2.split('/')[1]:'') : undefined,
  471. prodSpec: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[2] :
  472. '') : undefined,
  473. prodName: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[0] :
  474. '') : undefined,
  475. brand: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[1] :
  476. '') : that.currentTab == 1 ?(that.searchProdValue2 ? that.searchProdValue2.split('/')[0]:''): undefined,
  477. }).then(res => {
  478. that.loading = false;
  479. if (res && res.success) {
  480. that.totalSize = res.total || 0;
  481. let newList = res.list || [];
  482. for (let i = 0; i < newList.length; i++) {
  483. newList[i].imgList = [];
  484. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  485. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  486. newList[i].imgList.push(newList[i].fileDetailList[j]);
  487. }
  488. }
  489. for(let k = 0;newList[i].shareExt&&k<newList[i].shareExt.length;k++){
  490. newList[i].shareExt[k].fontSize= this.wxFontSize;
  491. }
  492. }
  493. if (curIndex == 1) {
  494. that.content = newList || [];
  495. } else {
  496. that.content = that.content.concat(newList || []);
  497. }
  498. }
  499. that.showEmpty = true;
  500. console.warn(res);
  501. })
  502. },
  503. showActionSheet(item) {
  504. let that = this;
  505. if(!this.curItem.id){
  506. this.curItem = item;
  507. }else{
  508. this.curItem = {}
  509. this.showSheet = false;
  510. return false;
  511. }
  512. this.collStatus = false;
  513. this.showSheet = true;
  514. that.showContact = false;
  515. if (uni.getStorageSync('userNo')) {
  516. let params = {};
  517. params = {
  518. fkBisNo: that.curItem.bisNo,
  519. userNo: uni.getStorageSync('userNo'),
  520. };
  521. request.post('/slbCollect/query', params).then(res => {
  522. if (res.success) {
  523. if (res.list && res.list.length > 0) {
  524. that.collStatus = true;
  525. that.collId = res.list[0].id;
  526. }
  527. }
  528. })
  529. }
  530. },
  531. linkTel() {
  532. if (!uni.getStorageSync('userNo')) {
  533. uni.showToast({
  534. title: '请登录',
  535. icon:'none'
  536. })
  537. uni.navigateTo({
  538. url: '/pages/login/login'
  539. })
  540. return false;
  541. }
  542. let that = this;
  543. let params = {};
  544. params.slbBisContact = JSON.stringify({
  545. fkBisNo: that.curItem.bisNo,
  546. bisType: '2',
  547. type: '1',
  548. company: that.curItem.company,
  549. companyNo: that.curItem.companyNo,
  550. userNo: uni.getStorageSync('userNo'),
  551. });
  552. request.post('/slbBisContact/add', params).then(res => {
  553. if (res.success) {
  554. that.showContact = true;
  555. that.curContact.company = that.curItem.company;
  556. that.curContact.contactMethod = res.resultMap.contactMethod;
  557. that.curContact.contactPerson = res.resultMap.contactPerson;
  558. } else {
  559. that.showContact = false;
  560. uni.showToast({
  561. title: res.msg,
  562. icon: 'none'
  563. })
  564. }
  565. })
  566. },
  567. showBrand(text){
  568. uni.showToast({
  569. title: text,
  570. icon: 'none'
  571. })
  572. },
  573. addColl() {
  574. if (!uni.getStorageSync('userNo')) {
  575. uni.showToast({
  576. title: '请登录',
  577. icon:'none'
  578. })
  579. uni.navigateTo({
  580. url: '/pages/login/login'
  581. })
  582. return false;
  583. }
  584. let that = this;
  585. let params = {};
  586. params.slbCollect = JSON.stringify({
  587. fkBisNo: that.curItem.bisNo,
  588. bisType: '2',
  589. userNo: uni.getStorageSync('userNo'),
  590. });
  591. request.post('/slbCollect/add', params).then(res => {
  592. if (res.success) {
  593. that.showSheet = false;
  594. that.curItem = {};
  595. uni.showToast({
  596. title: '信息已收藏,请在我的收藏里查看阅读',
  597. icon: 'none',
  598. duration: 2000
  599. })
  600. } else {
  601. uni.showToast({
  602. title: res.msg,
  603. icon:'none'
  604. })
  605. }
  606. })
  607. },
  608. delColl() {
  609. let that = this;
  610. request.post('/slbCollect/del', {
  611. id: that.collId
  612. }).then(res => {
  613. if (res.success) {
  614. that.showSheet = false;
  615. that.curItem = {};
  616. uni.showToast({
  617. title: '此供应信息将不会保存在我的收藏里',
  618. icon: 'none',
  619. duration: 2000
  620. })
  621. } else {
  622. uni.showToast({
  623. title: res.msg,
  624. icon:'none'
  625. })
  626. }
  627. })
  628. },
  629. search() {
  630. this.fetchData();
  631. },
  632. searchProd() {
  633. this.searchProdValue = '';
  634. this.fetchData();
  635. },
  636. cancel() {
  637. this.searchValue = '';
  638. this.fetchData();
  639. },
  640. clear() {
  641. this.searchValue = '';
  642. this.fetchData();
  643. },
  644. clearProd() {
  645. this.searchProdValue = '';
  646. uni.removeStorageSync('searchProdValue');
  647. this.fetchData();
  648. },
  649. clearProd2() {
  650. this.searchProdValue2 = '';
  651. uni.removeStorageSync('searchProdValue2');
  652. this.fetchData();
  653. },
  654. showTel(tel){
  655. uni.makePhoneCall({
  656. phoneNumber: tel,
  657. });
  658. },
  659. }
  660. }
  661. </script>
  662. <style lang="scss" scoped>
  663. .circle {
  664. max-height: 100vh;
  665. }
  666. /* 底部安全边距 start*/
  667. .tn-tabbar-height {
  668. min-height: 120rpx;
  669. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  670. height: calc(140rpx + constant(safe-area-inset-bottom));
  671. }
  672. /* 自定义导航栏内容 start */
  673. .custom-nav {
  674. height: 100%;
  675. &__back {
  676. margin: auto 5rpx;
  677. font-size: 40rpx;
  678. margin-right: 10rpx;
  679. margin-left: 30rpx;
  680. flex-basis: 5%;
  681. }
  682. &__search {
  683. flex-basis: 60%;
  684. width: 100%;
  685. height: 100%;
  686. &__box {
  687. width: 100%;
  688. height: 70%;
  689. padding: 10rpx 0;
  690. margin: 0 30rpx;
  691. border-radius: 60rpx 60rpx 0 60rpx;
  692. font-size: 24rpx;
  693. }
  694. &__icon {
  695. padding-right: 10rpx;
  696. margin-left: 20rpx;
  697. font-size: 30rpx;
  698. }
  699. &__text {
  700. color: #AAAAAA;
  701. }
  702. }
  703. }
  704. .logo-image {
  705. width: 60rpx;
  706. height: 60rpx;
  707. position: relative;
  708. margin-top: -15rpx;
  709. }
  710. .logo-pic {
  711. background-size: cover;
  712. background-repeat: no-repeat;
  713. // background-attachment:fixed;
  714. background-position: top;
  715. border-radius: 50%;
  716. }
  717. /* 自定义导航栏内容 end */
  718. /* 博主头像 start*/
  719. .image-circle {
  720. // padding: 95rpx;
  721. width: 190rpx;
  722. height: 190rpx;
  723. font-size: 40rpx;
  724. font-weight: 300;
  725. position: relative;
  726. }
  727. .image-pic {
  728. border: 1rpx solid #F8F7F8;
  729. background-size: cover;
  730. background-repeat: no-repeat;
  731. // background-attachment:fixed;
  732. background-position: top;
  733. border-radius: 10rpx;
  734. }
  735. .tn-color-cat {
  736. color: #1D2541;
  737. }
  738. .tn-bg-cat {
  739. background-color: #1D2541;
  740. }
  741. /* 文章内容 start*/
  742. .blogger {
  743. &__item {
  744. padding: 30rpx;
  745. }
  746. &__author {
  747. &__btn {
  748. margin-right: -12rpx;
  749. opacity: 0.5;
  750. }
  751. }
  752. &__desc {
  753. line-height: 30rpx;
  754. &__label {
  755. color: #1D2541;
  756. background-color: #F3F2F7;
  757. border-radius: 10rpx;
  758. font-size: 22rpx;
  759. padding: 5rpx 15rpx;
  760. margin: 5rpx 18rpx 0 0;
  761. &--prefix {
  762. font-size: 24rpx;
  763. color: #1D2541;
  764. padding-right: 10rpx;
  765. }
  766. }
  767. &__content {
  768. line-height: 50rpx;
  769. }
  770. }
  771. &__content {
  772. margin-top: 18rpx;
  773. padding-right: 18rpx;
  774. &__data {
  775. line-height: 46rpx;
  776. text-align: justify;
  777. overflow: hidden;
  778. transition: all 0.25s ease-in-out;
  779. }
  780. &__status {
  781. margin-top: 10rpx;
  782. font-size: 26rpx;
  783. color: #82B2FF;
  784. }
  785. }
  786. &__main-image {
  787. border: 1rpx solid #F8F7F8;
  788. border-radius: 16rpx;
  789. &--1 {
  790. max-width: 80%;
  791. max-height: 300rpx;
  792. }
  793. &--2 {
  794. max-width: 260rpx;
  795. max-height: 260rpx;
  796. }
  797. &--3 {
  798. height: 212rpx;
  799. width: 100%;
  800. }
  801. }
  802. &__count-icon {
  803. font-size: 40rpx;
  804. padding-right: 5rpx;
  805. }
  806. &__ad {
  807. width: 100%;
  808. height: 500rpx;
  809. transform: translate3d(0px, 0px, 0px) !important;
  810. ::v-deep .uni-swiper-slide-frame {
  811. transform: translate3d(0px, 0px, 0px) !important;
  812. }
  813. .uni-swiper-slide-frame {
  814. transform: translate3d(0px, 0px, 0px) !important;
  815. }
  816. &__item {
  817. position: absolute;
  818. width: 100%;
  819. height: 100%;
  820. transform-origin: left center;
  821. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  822. transition: transform 0.25s ease-in-out;
  823. z-index: 1;
  824. &--0 {
  825. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  826. z-index: 4;
  827. }
  828. &--1 {
  829. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  830. z-index: 3;
  831. }
  832. &--2 {
  833. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  834. z-index: 2;
  835. }
  836. }
  837. &__content {
  838. border-radius: 40rpx;
  839. width: 640rpx;
  840. height: 500rpx;
  841. overflow: hidden;
  842. }
  843. &__image {
  844. width: 100%;
  845. height: 100%;
  846. }
  847. }
  848. }
  849. /* 文章内容 end*/
  850. /* 间隔线 start*/
  851. .tn-strip-bottom {
  852. width: 100%;
  853. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  854. }
  855. /* 间隔线 end*/
  856. /* 广告内容 start */
  857. .ad-image {
  858. width: 80rpx;
  859. height: 80rpx;
  860. position: relative;
  861. }
  862. .ad-pic {
  863. background-size: cover;
  864. background-repeat: no-repeat;
  865. // background-attachment:fixed;
  866. background-position: top;
  867. border-radius: 20%;
  868. }
  869. /* 自定义导航栏内容 end */
  870. /* 全屏轮播 start*/
  871. .card-swiper {
  872. height: 100vh !important;
  873. }
  874. .card-swiper swiper-item {
  875. width: 750rpx !important;
  876. left: 0rpx;
  877. box-sizing: border-box;
  878. overflow: initial;
  879. }
  880. .card-swiper swiper-item .swiper-item {
  881. width: 100%;
  882. display: block;
  883. height: 100vh;
  884. border-radius: 0rpx;
  885. transform: scale(1);
  886. transition: all 0.2s ease-in 0s;
  887. overflow: hidden;
  888. }
  889. .card-swiper swiper-item.cur .swiper-item {
  890. transform: none;
  891. transition: all 0.2s ease-in 0s;
  892. }
  893. .card-swiper swiper-item .swiper-item-png {
  894. margin-top: -50vh;
  895. width: 100%;
  896. display: block;
  897. border-radius: 0rpx;
  898. transform: translate(1040rpx, 20rpx) scale(0.5, 0.5);
  899. transition: all 0.6s ease 0s;
  900. // overflow: hidden;
  901. }
  902. .card-swiper swiper-item.cur .swiper-item-png {
  903. margin-top: -100vh;
  904. width: 900rpx;
  905. transform: translate(-80rpx, 0rpx) scale(1, 1);
  906. transition: all 0.6s ease 0s;
  907. }
  908. .image-banner {
  909. display: flex;
  910. align-items: center;
  911. justify-content: center;
  912. }
  913. .image-banner image {
  914. width: 100%;
  915. }
  916. /* 轮播指示点 start*/
  917. .indication {
  918. z-index: 9999;
  919. width: 100%;
  920. height: 36rpx;
  921. position: fixed;
  922. // display:flex;
  923. display: block;
  924. flex-direction: row;
  925. align-items: center;
  926. justify-content: center;
  927. }
  928. .spot {
  929. background-color: #000;
  930. opacity: 0.3;
  931. width: 10rpx;
  932. height: 10rpx;
  933. border-radius: 20rpx;
  934. margin: 20rpx 0 !important;
  935. left: 95vw;
  936. top: -60vh;
  937. position: relative;
  938. }
  939. .spot.active {
  940. opacity: 0.6;
  941. height: 30rpx;
  942. background-color: #000;
  943. }
  944. /* 资讯主图 start*/
  945. .image-article {
  946. border-radius: 8rpx;
  947. border: 1rpx solid #F8F7F8;
  948. width: 200rpx;
  949. height: 200rpx;
  950. position: relative;
  951. }
  952. .image-pic {
  953. background-size: cover;
  954. background-repeat: no-repeat;
  955. // background-attachment:fixed;
  956. background-position: top;
  957. border-radius: 10rpx;
  958. }
  959. .article-shadow {
  960. border-radius: 15rpx;
  961. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  962. }
  963. /* 文字截取*/
  964. .clamp-text-1 {
  965. -webkit-line-clamp: 1;
  966. display: -webkit-box;
  967. -webkit-box-orient: vertical;
  968. text-overflow: ellipsis;
  969. overflow: hidden;
  970. }
  971. .clamp-text-2 {
  972. -webkit-line-clamp: 2;
  973. display: -webkit-box;
  974. -webkit-box-orient: vertical;
  975. text-overflow: ellipsis;
  976. overflow: hidden;
  977. }
  978. /* 标签内容 start*/
  979. .tn-tag-content {
  980. &__item {
  981. display: inline-block;
  982. line-height: 35rpx;
  983. color: #1D2541;
  984. background-color: #F3F2F7;
  985. border-radius: 10rpx;
  986. font-size: 22rpx;
  987. padding: 5rpx 15rpx;
  988. &--prefix {
  989. padding-right: 10rpx;
  990. }
  991. }
  992. }
  993. /* 图标容器9 start */
  994. .icon9 {
  995. &__item {
  996. width: 30%;
  997. background-color: #FFFFFF;
  998. border-radius: 10rpx;
  999. padding: 30rpx;
  1000. margin: 20rpx 10rpx;
  1001. transform: scale(1);
  1002. transition: transform 0.3s linear;
  1003. transform-origin: center center;
  1004. &--icon {
  1005. width: 110rpx;
  1006. height: 110rpx;
  1007. font-size: 65rpx;
  1008. border-radius: 50%;
  1009. margin: 20rpx 40rpx;
  1010. position: relative;
  1011. z-index: 1;
  1012. &::after {
  1013. content: " ";
  1014. position: absolute;
  1015. z-index: -1;
  1016. width: 100%;
  1017. height: 100%;
  1018. left: 0;
  1019. bottom: 0;
  1020. border-radius: inherit;
  1021. opacity: 1;
  1022. transform: scale(1, 1);
  1023. background-size: 100% 100%;
  1024. background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png);
  1025. }
  1026. }
  1027. }
  1028. }
  1029. /* 悬浮 */
  1030. .tnxuanfu {
  1031. animation: suspension 3s ease-in-out infinite;
  1032. }
  1033. @keyframes suspension {
  1034. 0%,
  1035. 100% {
  1036. transform: translateY(0);
  1037. }
  1038. 50% {
  1039. transform: translateY(-0.8rem);
  1040. }
  1041. }
  1042. /* 悬浮按钮 */
  1043. .button-shop {
  1044. width: 90rpx;
  1045. height: 90rpx;
  1046. display: flex;
  1047. flex-direction: row;
  1048. position: fixed;
  1049. /* bottom:200rpx;
  1050. right: 20rpx; */
  1051. left: 5rpx;
  1052. top: 5rpx;
  1053. z-index: 1001;
  1054. border-radius: 100px;
  1055. opacity: 0.9;
  1056. }
  1057. /* 按钮 */
  1058. .edit {
  1059. bottom: 300rpx;
  1060. right: 75rpx;
  1061. position: fixed;
  1062. z-index: 9999;
  1063. }
  1064. .pa,
  1065. .pa0 {
  1066. position: absolute
  1067. }
  1068. .pa0 {
  1069. left: 0;
  1070. top: 0
  1071. }
  1072. .bg0 {
  1073. width: 100rpx;
  1074. height: 100rpx;
  1075. top: 50%;
  1076. left: 50%;
  1077. transform: translate(-50%, -50%);
  1078. }
  1079. .bg1 {
  1080. width: 100%;
  1081. height: 100%;
  1082. }
  1083. .hx-box {
  1084. top: 50%;
  1085. left: 50%;
  1086. width: 100rpx;
  1087. height: 100rpx;
  1088. transform-style: preserve-3d;
  1089. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  1090. }
  1091. .hx-box .pr {
  1092. width: 100rpx;
  1093. height: 100rpx;
  1094. transform-style: preserve-3d;
  1095. animation: hxz 20s linear infinite;
  1096. }
  1097. @keyframes hxz {
  1098. 0% {
  1099. transform: rotateX(0deg);
  1100. }
  1101. 100% {
  1102. transform: rotateX(-360deg);
  1103. }
  1104. }
  1105. .hx-box .pr .pa0 {
  1106. width: 100rpx;
  1107. height: 100rpx;
  1108. /* border: 4px solid #5ec0ff; */
  1109. border-radius: 1000px;
  1110. }
  1111. .hx-box .pr .pa0 .span {
  1112. display: block;
  1113. width: 100%;
  1114. height: 100%;
  1115. background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc4.png) no-repeat center center;
  1116. background-size: 100% 100%;
  1117. animation: hx 4s linear infinite;
  1118. }
  1119. @keyframes hx {
  1120. to {
  1121. transform: rotate(360deg);
  1122. }
  1123. }
  1124. .hx-k1 {
  1125. transform: rotateX(-60deg) rotateZ(-60deg)
  1126. }
  1127. .hx-k2 {
  1128. transform: rotateX(-30deg) rotateZ(-30deg)
  1129. }
  1130. .hx-k3 {
  1131. transform: rotateX(0deg) rotateZ(0deg)
  1132. }
  1133. .hx-k4 {
  1134. transform: rotateX(30deg) rotateZ(30deg)
  1135. }
  1136. .hx-k5 {
  1137. transform: rotateX(60deg) rotateZ(60deg)
  1138. }
  1139. .hx-k6 {
  1140. transform: rotateX(90deg) rotateZ(90deg)
  1141. }
  1142. /deep/ .basic-table-header {
  1143. background-color: #edeeee;
  1144. }
  1145. .bg-content{
  1146. color: #fff;
  1147. background-image: url(./../../static/bg.png);
  1148. background-size: cover;
  1149. }
  1150. </style>