123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950 |
- <template>
- <view class="circle tn-safe-area-inset-bottom" style="background: #f7f7f7;min-height: 100vh;">
- <tn-nav-bar customBack>
- <view slot="back" class='tn-custom-nav-bar__back'>
- <image style="width: 28px;height: 28px;margin-left:4px" @click="reFetchData()" src="../../static/tu/reload.png"></image>
- <image style="width: 28px;height: 28px;margin-left:12px" @click="addButton()" src="../../static/tu/add.png"></image>
- </view>
-
- <view slot="default" style="display: flex;">
- <view style="flex:1;">
- <text :style="{fontSize:(wxFontSize)+'px'}">我有什么</text>
- </view>
- </view>
- </tn-nav-bar>
- <scroll-view class="custom-tabbar-page" style="height: 100vh;" :style="{paddingTop: vuex_custom_bar_height + 'px'}" scroll-y :refresher-enabled="true" :refresher-triggered="triggered" lower-threshold="60" @refresherrestore="onRestore" @refresherrefresh="onRefresh" @refresherpulling="onPulling" enable-back-to-top @scrolltolower="tabbarPageScrollLower">
-
-
- <!-- 发现 -->
- <view class="" v-if="current==0" >
-
- <uv-sticky bgColor="#f7f7f7">
- <view style="width: 100%;" v-if="currentTab==0">
- <view style="display: flex; padding: 16px;">
- <view
- style="flex:1;background-color: #fff;border-radius: 18px;color: #999;line-height: 36px;"
- @click="showSearch">
- <view>
- <image src="../../static/tu/search.png" style="width: 26px;height: 26px;vertical-align: middle; margin-left:8px; margin-right: 12px;margin-top: -2px;"></image>
- <text :style="{fontSize:(wxFontSize-2)+'px'}" v-if="!searchProdValue">产品名称/品牌/产品型号</text>
- <text :style="{fontSize:(wxFontSize-2)+'px'}" v-if="searchProdValue">{{searchProdValue}}</text>
- </view>
- </view>
- <view v-if="searchProdValue" @click="clearProd" style="line-height: 36px;margin-left: 10px;color: #333;" :style="{fontSize:(wxFontSize-2)+'px'}">取消
- </view>
- </view>
- </view>
- <view style="width: 100%;" v-if="currentTab==1">
- <view style="display: flex; padding: 16px;">
- <view
- style="flex:1;background-color: #fff;border-radius: 18px;color: #999;line-height: 36px;"
- @click="showSearch2">
- <view>
- <image src="../../static/tu/search.png" style="width: 26px;height: 26px;vertical-align: middle; margin-left:8px;margin-right: 12px;margin-top: -2px;"></image>
- <text v-if="!searchProdValue2" :style="{fontSize:(wxFontSize-2)+'px'}">品牌/服务内容</text>
- <text v-if="searchProdValue2" :style="{fontSize:(wxFontSize-2)+'px'}">{{searchProdValue2}}</text>
- </view>
- </view>
- <view v-if="searchProdValue2" @click="clearProd2" style="line-height: 36px;margin-left: 10px;color: #333;" :style="{fontSize:(wxFontSize-2)+'px'}">取消
- </view>
- </view>
- </view>
-
- <tn-tabs-swiper :list="tabList" :isScroll="false" :fontSize="(wxFontSize+12)" :barWidth="wxFontSize+50" :current="currentTab" name="tab-name" activeColor="#005DA6" inactiveColor="#333"
- @change="changeTab">
- </tn-tabs-swiper>
- </uv-sticky>
-
- <view class="tn-flex tn-flex-direction-column tn-margin-top-sm ">
- <!-- 图文信息 -->
- <block v-for="(item,index) in content" :key="item.id">
- <view class="blogger__item" style="border-radius: 12px;margin: 0px 16px 12px 16px; background-color: #fff;" :key="index">
- <view class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center">
- <view class="justify__author__info">
- <view class="tn-flex tn-flex-row-center">
- <view class="tn-flex tn-flex-row-center tn-flex-col-center">
- <view class="" style="width: 5px;height: 5px;background: #E18730;border-radius: 50%;margin-right: 4px;">
- </view>
- <view class="tn-padding-right">
- <view class="tn-text-lg" style="color:#333;font-weight: 600;" :style="{fontSize:(wxFontSize)+'px'}">
- {{ item.company||(item.contactNickName||item.contactPerson) }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view
- class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left"
- >
- <tn-tag margin="-4px 4px 0 0" backgroundColor="#005da61a" v-if="item.brand"
- fontColor="#005DA6" shape="circle" :fontSize="wxFontSize+8" @click="showBrand('品牌:'+item.brand)">{{ item.brand }}</tn-tag>
- <tn-tag margin="-4px 4px 0 0" backgroundColor="#005da61a" v-if="!item.company"
- fontColor="#005DA6" shape="circle" :fontSize="wxFontSize+8" @click="showBrand('个人发布')">个人</tn-tag>
- </view>
- <view style="border-radius: 0px 0px 0px 0px;width:calc(100% + 32px);margin-left:-16px;border-bottom: 1px solid #E6E6E6;"></view>
- <view v-if="item.content" style="padding: 12px 12px 5px 5px;">
- <text
- class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df" style="color:#747E87" :style="{fontSize:(wxFontSize-2)+'px'}">{{ item.content }}</text>
- </view>
-
-
- <!-- 内容太多疲劳了-->
- <view v-if="item.shareExt&&item.shareExt.length>0" :id="`blogger__content--${index}`">
-
- <view v-for="(sitem,index) in item.shareExt" :key="sitem.id">
- <view style="padding: 12px 0 8px 5px;color:#005DA6;" :style="{fontSize:(wxFontSize-3)+'px'}">
- {{sitem.prodName}}
- </view>
- <view style="padding: 0px 8px 0 5px;color:#333;display: flex;" :style="{fontSize:(wxFontSize-3)+'px'}">
- <text style="color: #777;white-space: nowrap;">产品型号:</text>{{sitem.prodSpec}}
- </view>
- <view v-if="sitem.prodDesc" style="padding: 8px 8px 0 5px;color:#333;display: flex;" :style="{fontSize:(wxFontSize-3)+'px'}">
- <text style="color: #777;white-space: nowrap;">产品介绍:</text><text>{{sitem.prodDesc}}</text>
- </view>
- </view>
-
- </view>
- <block v-if="item.imgList&&item.imgList.length>0">
- <view v-if="[1,2,4].indexOf(item.imgList.length) != -1" class="tn-padding-top-xs">
- <image v-for="(image_item,image_index) in item.imgList" :key="image_index"
- class="blogger__main-image" :class="{
- 'blogger__main-image--1 tn-margin-bottom-sm': item.imgList.length === 1,
- 'blogger__main-image--2 tn-margin-right-sm tn-margin-bottom-sm': item.imgList.length === 2 || item.imgList.length === 4
- }" :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
- </view>
- <view v-else class="tn-padding-top-xs" @click="tn('')">
- <tn-grid hoverClass="none" :col="3">
- <block v-for="(image_item,image_index) in item.imgList" :key="image_index">
- <!-- #ifndef MP-WEIXIN -->
- <tn-grid-item style="width: 30%;margin: 10rpx;">
- <image class="blogger__main-image blogger__main-image--3"
- :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
- </tn-grid-item>
- <!-- #endif-->
- <!-- #ifdef MP-WEIXIN -->
- <tn-grid-item style="width: 30%;margin: 10rpx;">
- <image class="blogger__main-image blogger__main-image--3"
- :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
- </tn-grid-item>
- <!-- #endif-->
- </block>
- </tn-grid>
- </view>
- </block>
-
- <view v-for="(file,fIndex) in item.fileDetailList" :style="{marginTop:item.imgList&&item.imgList.length==0&&fIndex==0?'8px':'0'}" style="background-color:#005da60d ;margin-bottom: 4px;padding: 4px 8px;border-radius: 4px;" :key="file.id" v-if="!isImage(file.fileName)" @click="clickLink(file.ftpUrl,file.fileName)">
- <view>
- <image src="../../static/tu/link.png" style="width: 18px;height: 18px;vertical-align: bottom;"></image>
- <view style="display: inline;margin-left:8px;color:#005DA6;" :style="{fontSize:(wxFontSize-3)+'px'}">
- {{file.fileName}}</view>
- </view>
- </view>
- <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-top-xs">
- <view class="justify-content-item tn-color-gray tn-text-center">
- <view class="tn-padding-right tn-padding-top-xs" :style="{fontSize:(wxFontSize-3)+'px',color:'#777'}">
- {{ item.createTime|formatDate }}
- </view>
- </view>
-
- <view class="justify-content-item tn-flex tn-flex-col-center" style="position: relative">
- <image style="width: 30px;height:30px;" @click="showActionSheet(item)" src="../../static/tu/more.png"></image>
-
- <view v-if="curItem.id==item.id&&showSheet" class="pop-dia" style="position: absolute;background: #E4F1FB;display: block;right: 10px;top: 24px;border-radius: 6px;z-index: 900;">
-
- <view class="content" style="padding: 8px;font-size: 16px;line-height: 24px; width: 180px;border-radius: 6px;"
- v-if="!showContact">
- <button @click="linkTel()" style="border: none;border-radius: 0;color: #333333;background-color: #E4F1FB;border-bottom: 1px solid rgb(0 93 166 / 0.2);">
- <image src="../../static/tu/call.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: middle;"> 联系供方</button>
- <!-- <view>联系我们帮助对接</view> -->
- <button v-if="!collStatus" @click="addColl"
- 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">
- <image src="../../static/tu/coll.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: sub;">
- 收 藏</button>
- <button v-if="collStatus" @click="delColl"
- 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">
- <image src="../../static/tu/coll.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: sub;"> 取消收藏</button>
- <button open-type="share"
- style="border: none;border-radius: 0;color: #333333;background-color: #E4F1FB;" type="default" plain="true" :data-coupon="curItem">
- <image src="../../static/tu/share.png" style="width: 26px;height: 26px;margin-right:10px;vertical-align: sub;">
- 转 发</button>
- </view>
- <view class="content " style="position: relative;background: linear-gradient( 180deg, #DAECFA 0%, #FFFFFF 27%, #FFFFFF 100%);padding: 24px 40px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 80px);line-height: 24px;border-radius: 12px;"
- v-if="showContact">
- <view><text style="font-size: 19px;font-weight: bold;color: #333;" v-if="curContact.company">{{curContact.company}}</text></view>
- <view style="margin-top:10px;font-size: 17px;text-align: center;color:#333">
- <image src="../../static/tu/person.png" style="width: 24px;height: 24px;vertical-align: sub;">
- <text style="margin-left: 6px;">{{curContact.contactPerson}}</text> </view>
- <view style="margin-top:10px;font-size: 17px;text-align: center;color:#333" @click="showTel(curContact.contactMethod)">
- <image src="../../static/tu/tel.png" style="width: 24px;height: 24px;vertical-align: middle;">
- <text style="margin-left: 4px;">{{curContact.contactMethod}}</text>
- </view>
-
- <image src="../../static/tu/close.png" style="width: 40px;height: 40px;position: absolute; left: calc(50vw - 60px);bottom: -64px;" @click="hideSheet()"></image>
- </view>
- <view style="position: fixed;top: 0;left: 0;height: 100000vh;width: 100%;background: rgb(0 0 0 / 0.5);z-index: -1;" @click="hideSheet()" v-if="showContact"></view>
- </view>
- </view>
- </view>
- </view>
- </block>
- <view v-if="showEmpty&&content.length==0" style="margin-top: 32vh;">
- <tn-empty mode="list"></tn-empty>
- </view>
- <!-- 结尾 -->
- <view v-if="content.length==totalSize&&totalSize!=0&¤tTab==0" style="background-color: #f7f7f7;padding: 16px 0;" :style="{paddingTop:showSheet?'166px':'16px'}">
- <tn-load-more status="nomore" :loadText="loadText" :fontSize="(wxFontSize+11)"></tn-load-more>
- </view>
- <view v-if="content.length==totalSize&&totalSize!=0&¤tTab==1" style="background-color: #f7f7f7;padding: 16px 0;" :style="{paddingTop:showSheet?'166px':'16px'}">
- <tn-load-more status="nomore" :loadText="loadText2" :fontSize="(wxFontSize+11)"></tn-load-more>
- </view>
-
- </view>
- <!-- <view class='tn-tabbar-height'></view> -->
- </view>
-
- </scroll-view>
-
- </view>
- </template>
- <script>
- import request from '../../utils/request'
- export default {
- name: 'Circle',
- data() {
- return {
- loading: false,
- searchProdValue: '',
- searchProdValue2:'',
- tabList: [{
- 'tab-name': '产品'
- }, {
- 'tab-name': '服务'
- }],
- loadText: {
- loadmore: '下拉加载',
- loading: '快速加载中...',
- nomore: '恭喜你,已阅读完所有供应信息哦!'
- },
- loadText2: {
- loadmore: '下拉加载',
- loading: '快速加载中...',
- nomore: '恭喜你,已阅读完所有供应信息哦!'
- },
- currentTab: 0,
- showEmpty: false,
- showSheet: false,
- curItem: {},
- collId: '',
- showContact: false,
- curContact: {},
- current: 0,
- collStatus: '',
- searchValue: '',
- content: [],
- totalSize: 0,
- curIndex: 1,
- wxFontSize:17,
- triggered: false,
- _freshing: false,
- shareData:{}
- }
- },
- onReady() {
- const appBaseInfo = wx.getAppBaseInfo();
- this.wxFontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
-
- this.$nextTick(() => {
- this.fetchData()
- })
- },
- onShow() {
- this.fetchData()
- },
- onHide() {
- this.adAutoplay = false
- },
- filters: {
- formatDate(value) {
- if (!value) return '';
- const date = new Date(value);
- const today = new Date();
- const yesterday = new Date(today); // 昨天的日期
- yesterday.setDate(yesterday.getDate() - 1); // 将昨天的日期设置为前一天
- if (date.getFullYear() == today.getFullYear() && date.getMonth() == today.getMonth() && date.getDate() ==
- today.getDate()) {
- return '今天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
- .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
- }
- if (date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date
- .getDate() == yesterday.getDate()) {
- return '昨天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
- .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
- }
- return date.toLocaleDateString() + ' ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
- .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
- },
- },
- methods: {
- // 瀑布流导航页面滚动到底部
- tabbarPageScrollLower(e) {
- this.loadMore();
- },
- onPulling(e) {
- console.log("onpulling", e);
- if(e.detail.deltaY<0){
- return
- }
- this.triggered = true
- },
- onRefresh(){
- if (this._freshing) return;
- this._freshing = true;
- this.reFetchData();
- setTimeout(() => {
- this.triggered = false;
- this._freshing = false;
- }, 2000)
- },
- onRestore() {
- this.triggered = false; // 需要重置
- },
- addLog(shareData){
- const that = this;
- let params= {
- bisNo:shareData.bisNo,
- bisType:'2',
- userNo:uni.getStorageSync('userNo')
- };
-
- request.post('/slbForward/add',{slbForward:JSON.stringify(params)},{
- headers: {
- 'Content-Type': 'application/json', // 默认值
- },
- }).then(res=>{
-
- })
- },
- sleep(time) {
- return new Promise((resolve) => setTimeout(resolve, time));
- },
- onShareAppMessage: function(option) {
- if(option.from=="button"){
-
- this.hideSheet();
- this.shareData=option.target.dataset.coupon;
- this.addLog(this.shareData);
- const promise = new Promise(async (resolve) => {
-
- await this.sleep(500);
- resolve({
- // title: `速立保`,
- path: `/pages/index/detail/detail?id=`+this.shareData.bisNo+'&isNeed=0',
- // imageUrl: url,
- });
- });
- // 默认参数
- return {
- // title: `速立保`,
- path: `/pages/index/detail/detail?id=`+this.shareData.bisNo+'&isNeed=0',
- promise,
- };
-
- }else{
- return {
- // title: '速立保',
- path: '/pages/index/index',
- };
- }
- },
- showSearch(item) {
-
- // 或者可以直接设置body的tabindex属性为-1,然后移除焦点
- // 注意:这种方式可能会导致一些浏览器的兼容性问题
- uni.navigateTo({
- url: '/pages/comm/search'
- })
- },
- showDetail(item){
- uni.navigateTo({
- url: '/pages/index/detail/detail?id='+item.bisNo+'&isNeed=0'
- })
- },
- showSearch2(item) {
- // 或者可以直接设置body的tabindex属性为-1,然后移除焦点
- // 注意:这种方式可能会导致一些浏览器的兼容性问题
- uni.navigateTo({
- url: '/pages/comm/search2'
- })
- },
- isImage(fileName) {
- const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
- const extension = fileName.split('.').pop().toLowerCase();
- return imageExtensions.includes(extension);
- },
- addButton() {
- if (!uni.getStorageSync('userNo')) {
- uni.showToast({
- title: '请登录',
- icon:'none'
- })
- uni.navigateTo({
- url: '/pages/login/login'
- })
- return false;
- } else {
- uni.navigateTo({
- url: '/circlePages/addShare'
- })
- }
- },
- showImg(items, index) {
- let urls = [];
- for (let i = 0; i < items.length; i++) {
- urls.push(items[i].ftpUrl);
- }
- // wx.chooseMessageFile({
- // count: 3, //默认100
- // type:'file',
- // extension:['.pdf','.doc'],
- // success: function (res) {
- // console.error(JSON.stringify(res));
- // }
- // });
- // 预览图片
- uni.previewImage({
- urls: urls,
- current: index,
- });
- },
- clickLink(url,fileName) {
- // uni.navigateTo({
- // url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
- // })
- uni.downloadFile({
- url: url,
- filePath: wx.env.USER_DATA_PATH + "/" + fileName,
- success: function (res) {
- const filePath = res.filePath
- uni.openDocument({
- filePath: filePath,
- showMenu: true,
- success: function (res) {
- console.log('打开文档成功')
- },
- fail: function(){
- uni.navigateTo({
- url:'/pages/webview/web-view?url='+encodeURIComponent('https://slb-m.lx-device.com/webview?title='+fileName+'&url='+ url),
- })
- }
- })
- }
- })
- // uni.navigateTo({
- // url: '/pages/webview/web-view?url=' + url,
- // })
- },
- // tab选项卡切换
- tabChange(index) {
- this.current = index
- },
- // 跳转
- tn(e) {
- uni.navigateTo({
- url: e,
- });
- },
- // 震动跳转
- navEdit(e) {
- wx.vibrateLong();
- uni.navigateTo({
- url: '/circlePages/edit'
- })
- },
- // 震动跳转
- navCreate(e) {
- wx.vibrateLong();
- uni.navigateTo({
- url: '/circlePages/create'
- })
- },
- // 震动跳转
- navBuild(e) {
- wx.vibrateLong();
- uni.navigateTo({
- url: '/circlePages/build'
- })
- },
- reFetchData() {
- this.loading = true;
- uni.showToast({
- title: '正在刷新...',
- icon: 'none'
- });
- this.fetchData();
- },
- hideSheet(){
- this.curItem = {};
- this.showSheet = false;
- },
- loadMore() {
- if (this.totalSize > this.content.length) {
- this.fetchData(this.curIndex + 1);
- }
- console.error('正在加载更多');
- },
- changeTab(index) {
- this.currentTab = index;
- this.content = [];
- this.fetchData();
- },
- // 获取内容容器的信息
- fetchData(curIndex = 1) {
- let that = this;
- that.showEmpty = false;
- this.curIndex = curIndex;
- if (uni.getStorageSync('searchProdValue')) {
- that.searchProdValue = uni.getStorageSync('searchProdValue');
- }else{
- that.searchProdValue = ''
- }
- if (uni.getStorageSync('searchProdValue2')) {
- that.searchProdValue2 = uni.getStorageSync('searchProdValue2');
- }else{
- that.searchProdValue2 = ''
- }
- request.post('/slbResourceShare/query', {
- type: that.currentTab == 1 ? '2' : '1',
- index: curIndex,
- content: that.currentTab == 1 ? (that.searchProdValue2 ? that.searchProdValue2.split('/')[1]:'') : undefined,
-
- prodSpec: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[2] :
- '') : undefined,
- prodName: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[0] :
- '') : undefined,
- brand: that.currentTab == 0 ? (that.searchProdValue ? that.searchProdValue.split('/')[1] :
- '') : that.currentTab == 1 ?(that.searchProdValue2 ? that.searchProdValue2.split('/')[0]:''): undefined,
- }).then(res => {
- that.loading = false;
- if (res && res.success) {
- that.totalSize = res.total || 0;
- let newList = res.list || [];
- for (let i = 0; i < newList.length; i++) {
- newList[i].imgList = [];
- for (let j = 0; j < newList[i].fileDetailList.length; j++) {
- if (that.isImage(newList[i].fileDetailList[j].fileName)) {
- newList[i].imgList.push(newList[i].fileDetailList[j]);
- }
- }
- for(let k = 0;newList[i].shareExt&&k<newList[i].shareExt.length;k++){
- newList[i].shareExt[k].fontSize= this.wxFontSize;
- }
- }
- if (curIndex == 1) {
- that.content = newList || [];
- } else {
- that.content = that.content.concat(newList || []);
- }
- }
- that.showEmpty = true;
- console.warn(res);
- })
- },
- showActionSheet(item) {
- let that = this;
- if(!this.curItem.id){
- this.curItem = item;
- }else{
- this.curItem = {}
- this.showSheet = false;
- return false;
- }
- this.collStatus = false;
- this.showSheet = true;
- that.showContact = false;
- if (uni.getStorageSync('userNo')) {
- let params = {};
- params = {
- fkBisNo: that.curItem.bisNo,
- userNo: uni.getStorageSync('userNo'),
- };
- request.post('/slbCollect/query', params).then(res => {
- if (res.success) {
- if (res.list && res.list.length > 0) {
- that.collStatus = true;
- that.collId = res.list[0].id;
- }
- }
- })
- }
- },
- linkTel() {
- if (!uni.getStorageSync('userNo')) {
- uni.showToast({
- title: '请登录',
- icon:'none'
- })
- uni.navigateTo({
- url: '/pages/login/login'
- })
- return false;
- }
- let that = this;
- let params = {};
- params.slbBisContact = JSON.stringify({
- fkBisNo: that.curItem.bisNo,
- bisType: '2',
- type: '1',
- company: that.curItem.company,
- companyNo: that.curItem.companyNo,
- userNo: uni.getStorageSync('userNo'),
- });
- request.post('/slbBisContact/add', params).then(res => {
- if (res.success) {
- that.showContact = true;
- that.curContact.company = that.curItem.company;
- that.curContact.contactMethod = res.resultMap.contactMethod;
- that.curContact.contactPerson = res.resultMap.contactPerson;
- } else {
- that.showContact = false;
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- })
- },
- showBrand(text){
- uni.showToast({
- title: text,
- icon: 'none'
- })
- },
- addColl() {
- if (!uni.getStorageSync('userNo')) {
- uni.showToast({
- title: '请登录',
- icon:'none'
- })
- uni.navigateTo({
- url: '/pages/login/login'
- })
- return false;
- }
- let that = this;
- let params = {};
- params.slbCollect = JSON.stringify({
- fkBisNo: that.curItem.bisNo,
- bisType: '2',
- userNo: uni.getStorageSync('userNo'),
- });
- request.post('/slbCollect/add', params).then(res => {
- if (res.success) {
- that.showSheet = false;
- that.curItem = {};
- uni.showToast({
- title: '信息已收藏,请在我的收藏里查看阅读',
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: res.msg,
- icon:'none'
- })
- }
- })
- },
- delColl() {
- let that = this;
- request.post('/slbCollect/del', {
- id: that.collId
- }).then(res => {
- if (res.success) {
- that.showSheet = false;
- that.curItem = {};
- uni.showToast({
- title: '此供应信息将不会保存在我的收藏里',
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: res.msg,
- icon:'none'
- })
- }
- })
- },
-
- search() {
- this.fetchData();
- },
- searchProd() {
- this.searchProdValue = '';
- this.fetchData();
- },
- cancel() {
- this.searchValue = '';
- this.fetchData();
- },
- clear() {
- this.searchValue = '';
- this.fetchData();
- },
- clearProd() {
- this.searchProdValue = '';
- uni.removeStorageSync('searchProdValue');
- this.fetchData();
- },
- clearProd2() {
- this.searchProdValue2 = '';
- uni.removeStorageSync('searchProdValue2');
- this.fetchData();
- },
- showTel(tel){
- uni.makePhoneCall({
- phoneNumber: tel,
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .circle {
- max-height: 100vh;
- }
- /* 底部安全边距 start*/
- .tn-tabbar-height {
- min-height: 120rpx;
- height: calc(140rpx + env(safe-area-inset-bottom) / 2);
- height: calc(140rpx + constant(safe-area-inset-bottom));
- }
- /* 自定义导航栏内容 start */
- .custom-nav {
- height: 100%;
- &__back {
- margin: auto 5rpx;
- font-size: 40rpx;
- margin-right: 10rpx;
- margin-left: 30rpx;
- flex-basis: 5%;
- }
- &__search {
- flex-basis: 60%;
- width: 100%;
- height: 100%;
- &__box {
- width: 100%;
- height: 70%;
- padding: 10rpx 0;
- margin: 0 30rpx;
- border-radius: 60rpx 60rpx 0 60rpx;
- font-size: 24rpx;
- }
- &__icon {
- padding-right: 10rpx;
- margin-left: 20rpx;
- font-size: 30rpx;
- }
- &__text {
- color: #AAAAAA;
- }
- }
- }
- /* 自定义导航栏内容 end */
- /* 文章内容 start*/
- .blogger {
- &__item {
- padding: 30rpx;
- }
- &__author {
- &__btn {
- margin-right: -12rpx;
- opacity: 0.5;
- }
- }
- &__desc {
- line-height: 30rpx;
- &__label {
- color: #1D2541;
- background-color: #F3F2F7;
- border-radius: 10rpx;
- font-size: 22rpx;
- padding: 5rpx 15rpx;
- margin: 5rpx 18rpx 0 0;
- &--prefix {
- font-size: 24rpx;
- color: #1D2541;
- padding-right: 10rpx;
- }
- }
- &__content {
- line-height: 50rpx;
- }
- }
- &__content {
- margin-top: 18rpx;
- padding-right: 18rpx;
- &__data {
- line-height: 46rpx;
- text-align: justify;
- overflow: hidden;
- transition: all 0.25s ease-in-out;
- }
- &__status {
- margin-top: 10rpx;
- font-size: 26rpx;
- color: #82B2FF;
- }
- }
- &__main-image {
- border: 1rpx solid #F8F7F8;
- border-radius: 16rpx;
- &--1 {
- max-width: 80%;
- max-height: 300rpx;
- }
- &--2 {
- max-width: 260rpx;
- max-height: 260rpx;
- }
- &--3 {
- height: 212rpx;
- width: 100%;
- }
- }
- &__count-icon {
- font-size: 40rpx;
- padding-right: 5rpx;
- }
- &__ad {
- width: 100%;
- height: 500rpx;
- transform: translate3d(0px, 0px, 0px) !important;
- ::v-deep .uni-swiper-slide-frame {
- transform: translate3d(0px, 0px, 0px) !important;
- }
- .uni-swiper-slide-frame {
- transform: translate3d(0px, 0px, 0px) !important;
- }
- &__item {
- position: absolute;
- width: 100%;
- height: 100%;
- transform-origin: left center;
- transform: translate3d(100%, 0px, 0px) scale(1) !important;
- transition: transform 0.25s ease-in-out;
- z-index: 1;
- &--0 {
- transform: translate3d(0%, 0px, 0px) scale(1) !important;
- z-index: 4;
- }
- &--1 {
- transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
- z-index: 3;
- }
- &--2 {
- transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
- z-index: 2;
- }
- }
- &__content {
- border-radius: 40rpx;
- width: 640rpx;
- height: 500rpx;
- overflow: hidden;
- }
- &__image {
- width: 100%;
- height: 100%;
- }
- }
- }
- /* 文章内容 end*/
- /* 自定义导航栏内容 end */
-
- /* 标签内容 start*/
- .tn-tag-content {
- &__item {
- display: inline-block;
- line-height: 35rpx;
- color: #1D2541;
- background-color: #F3F2F7;
- border-radius: 10rpx;
- font-size: 22rpx;
- padding: 5rpx 15rpx;
- &--prefix {
- padding-right: 10rpx;
- }
- }
- }
- </style>
|