2 其他页面点击进入详情, 自己查看自己不显示推荐。自己查看别人的产品显示推荐! 3 调整首页tabbar间距 4 调整我的页面点击退出新加弹框 以及按钮相关样式。 5 调整 list块相关样式 6 修改tabbar选中颜色release/210823_需求对对碰
| white-space:nowrap; | white-space:nowrap; | ||||
| overflow:hidden; | overflow:hidden; | ||||
| text-overflow:ellipsis; | text-overflow:ellipsis; | ||||
| } | |||||
| } | |||||
| .my-tabbar .weui-bar__item_on .weui-tabbar__label{ | |||||
| color: #5e73e5!important; | |||||
| } |
| color: #827de5; | color: #827de5; | ||||
| border-radius: 16px; | border-radius: 16px; | ||||
| border: solid 1px #827de5; | border: solid 1px #827de5; | ||||
| width: 96rpx; | |||||
| height: 32rpx; | |||||
| line-height: 32rpx; | |||||
| font-size: 20rpx; | |||||
| width: 106rpx; | |||||
| height: 40rpx; | |||||
| line-height: 38rpx; | |||||
| font-size: 22rpx; | |||||
| text-align: center; | text-align: center; | ||||
| margin-top: 15rpx; | |||||
| margin-top: 12rpx; | |||||
| margin-left: 15rpx; | margin-left: 15rpx; | ||||
| box-sizing: border-box; | |||||
| } | } | ||||
| .list-home .home-img{ | .list-home .home-img{ | ||||
| width: 22rpx; | width: 22rpx; | ||||
| height: 23rpx; | height: 23rpx; | ||||
| position: relative; | position: relative; | ||||
| top: 2rpx; | |||||
| top: 3rpx; | |||||
| } | } | ||||
| /* 内容容器 */ | /* 内容容器 */ | ||||
| width: 24rpx; | width: 24rpx; | ||||
| height: 24rpx; | height: 24rpx; | ||||
| position: relative; | position: relative; | ||||
| top: 1rpx; | |||||
| top: 4rpx; | |||||
| } | } | ||||
| .list-foot-text-chat { | .list-foot-text-chat { | ||||
| height: 62rpx; | |||||
| width: 180rpx; | |||||
| height: 60rpx; | |||||
| width: 160rpx; | |||||
| background-color: #5e73e5; | background-color: #5e73e5; | ||||
| box-shadow: -1px 3px 12px 4px | box-shadow: -1px 3px 12px 4px | ||||
| rgba(62, 95, 179, 0.14); | rgba(62, 95, 179, 0.14); | ||||
| left: -10rpx; | left: -10rpx; | ||||
| } | } | ||||
| .list-collect-view .collect-img { | |||||
| width: 22rpx; | |||||
| height: 19rpx; | |||||
| } | |||||
| .list-collect-view { | .list-collect-view { | ||||
| color: #e16531; | color: #e16531; | ||||
| font-size: 22rpx; | font-size: 22rpx; | ||||
| } | |||||
| .list-collect-view .collect-img { | |||||
| width: 26rpx; | |||||
| height: 23rpx; | |||||
| position: relative; | position: relative; | ||||
| top: 1rpx; | |||||
| top: 4rpx; | |||||
| } | } | ||||
| .is-details-page .list-foot-text-lf{ | .is-details-page .list-foot-text-lf{ | ||||
| margin-right: 20rpx; | |||||
| margin-right: 16rpx; | |||||
| } | } | ||||
| /* 置顶 */ | /* 置顶 */ |
| return | return | ||||
| } | } | ||||
| } | } | ||||
| const url = e.detail.item.pagePath; | const url = e.detail.item.pagePath; | ||||
| // wx.redirectTo({ url }); | // wx.redirectTo({ url }); | ||||
| wx.navigateTo({ | wx.navigateTo({ |
| list="{{list}}" | list="{{list}}" | ||||
| bindchange="tabChange" | bindchange="tabChange" | ||||
| current="{{currentIndex}}" | current="{{currentIndex}}" | ||||
| ext-class="my-tabbar" | |||||
| /> | /> | ||||
| </view> | </view> |
| /* components/tabbar/tabbar.wxss */ | |||||
| /* components/tabbar/tabbar.wxss */ | |||||
| totalPageView: 0, | totalPageView: 0, | ||||
| // 是他人主业还是个人主业 | // 是他人主业还是个人主业 | ||||
| isOther: false, | isOther: false, | ||||
| // 登录用户ID | |||||
| loginCustomerId:"", | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer') || null; | |||||
| if (businessCommunicationCustomer) { | |||||
| this.setData({ | |||||
| loginCustomerId: businessCommunicationCustomer.customerId | |||||
| }) | |||||
| } | |||||
| const eventChannel = this.getOpenerEventChannel() | const eventChannel = this.getOpenerEventChannel() | ||||
| // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 | ||||
| eventChannel.on('customerid', data => { | eventChannel.on('customerid', data => { | ||||
| this.getListData(); | this.getListData(); | ||||
| }) | }) | ||||
| }, | }, | ||||
| // 进入详情 | |||||
| goDetails(e) { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + e.detail, | |||||
| }) | |||||
| }, | |||||
| saveHomeCollect() { | saveHomeCollect() { | ||||
| $request.post('/statisticsBusinessCommunicationDemand/saveHomeCollect.action', | $request.post('/statisticsBusinessCommunicationDemand/saveHomeCollect.action', | ||||
| { customerId: this.data.customerId } | { customerId: this.data.customerId } |
| </view> | </view> | ||||
| <view wx:else> | <view wx:else> | ||||
| <view class="list-view" wx:for="{{ listData }}" wx:key="*this"> | <view class="list-view" wx:for="{{ listData }}" wx:key="*this"> | ||||
| <listItem item="{{ item }}" bind:getItem="goDetails" pageStatus="homepage" isOther="{{ isOther }}" /> | |||||
| <listItem item="{{ item }}" bind:getItem="goDetails" pageStatus="homepage" isOther="{{ isOther }}" customerId="{{ loginCustomerId }}"/> | |||||
| </view> | </view> | ||||
| <view class="text-center" wx:if="{{ itemLoading }}"> | <view class="text-center" wx:if="{{ itemLoading }}"> | ||||
| <van-loading size="24px">加载中...</van-loading> | <van-loading size="24px">加载中...</van-loading> |
| pageLoading: true, | pageLoading: true, | ||||
| }) | }) | ||||
| } | } | ||||
| this.getListData(); | |||||
| if(this.data.currentData.customerId == this.data.userCustomerId){ | |||||
| this.setData({ | |||||
| pageLoading: false, | |||||
| }) | |||||
| }else{ | |||||
| this.getListData(); | |||||
| } | |||||
| }).catch(err => { | }).catch(err => { | ||||
| console.log(error, 'error appletLogin') | console.log(error, 'error appletLogin') | ||||
| }) | }) |
| <view class="list-view"> | <view class="list-view"> | ||||
| <listItem item="{{ currentData }}" pageStatus="detatil" isCollect="{{ isCollect }}" isShowCollect="{{ customerId != currentData.customerId }}" bind:changeCollect="changeCollect" customerId="{{ userCustomerId }}" /> | <listItem item="{{ currentData }}" pageStatus="detatil" isCollect="{{ isCollect }}" isShowCollect="{{ customerId != currentData.customerId }}" bind:changeCollect="changeCollect" customerId="{{ userCustomerId }}" /> | ||||
| </view> | </view> | ||||
| <view class="view-interested">你可能感兴趣的需求</view> | |||||
| <view class="not-data" wx:if="{{ listData.length < 1 }}"> | |||||
| <image class="not-data-img" src="/images/home/not-data.png" /> | |||||
| <view class="not-info">没有更多感兴趣的需求</view> | |||||
| </view> | |||||
| <view wx:else> | |||||
| <view class="list-view" wx:for="{{ listData }}" wx:key="*this"> | |||||
| <listItem item="{{ item }}" bind:getItem="goDetails" customerId="{{ userCustomerId }}" /> | |||||
| </view> | |||||
| <view class="text-center" wx:if="{{ itemLoading }}"> | |||||
| <van-loading size="24px">加载中...</van-loading> | |||||
| <view wx:if="{{ userCustomerId != currentData.customerId }}"> | |||||
| <view class="view-interested">你可能感兴趣的需求</view> | |||||
| <view class="not-data" wx:if="{{ listData.length < 1 }}"> | |||||
| <image class="not-data-img" src="/images/home/not-data.png" /> | |||||
| <view class="not-info">没有更多感兴趣的需求</view> | |||||
| </view> | </view> | ||||
| <view class="list-finished text-center" wx:if="{{ isFinished }}"> | |||||
| <image class="finished-img" src="/images/home/finished-icon.png" /> | |||||
| 没有更多啦~ | |||||
| <view wx:else> | |||||
| <view class="list-view" wx:for="{{ listData }}" wx:key="*this"> | |||||
| <listItem item="{{ item }}" bind:getItem="goDetails" customerId="{{ userCustomerId }}" /> | |||||
| </view> | |||||
| <view class="text-center" wx:if="{{ itemLoading }}"> | |||||
| <van-loading size="24px">加载中...</van-loading> | |||||
| </view> | |||||
| <view class="list-finished text-center" wx:if="{{ isFinished }}"> | |||||
| <image class="finished-img" src="/images/home/finished-icon.png" /> | |||||
| 没有更多啦~ | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> |
| }, | }, | ||||
| ], | ], | ||||
| moreTab: "gengduo", | moreTab: "gengduo", | ||||
| moreTitle: "更多", | |||||
| moreTitle: "更多分类", | |||||
| // list数据加载 | // list数据加载 | ||||
| // list块加载 | // list块加载 | ||||
| listLoading: true, | listLoading: true, | ||||
| } | } | ||||
| this.setData({ | this.setData({ | ||||
| currentTab: dataset.value, | currentTab: dataset.value, | ||||
| moreTitle: "更多", | |||||
| moreTitle: "更多分类", | |||||
| moreTab: "gengduo" | moreTab: "gengduo" | ||||
| }) | }) | ||||
| this.toSearch(); | this.toSearch(); | ||||
| }, | }, | ||||
| // 进入详情 | // 进入详情 | ||||
| goDetails(e) { | goDetails(e) { | ||||
| wx.reLaunch({ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + e.detail, | url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + e.detail, | ||||
| }) | }) | ||||
| }, | }, | ||||
| } | } | ||||
| this.setData({ | this.setData({ | ||||
| currentTab: 'my', | currentTab: 'my', | ||||
| moreTitle: "更多", | |||||
| moreTitle: "更多分类", | |||||
| moreTab: "gengduo" | moreTab: "gengduo" | ||||
| }) | }) | ||||
| let customerid = app.globalData.customerId; | let customerid = app.globalData.customerId; |
| } | } | ||||
| .search-view .set-attention { | .search-view .set-attention { | ||||
| margin-top: 14rpx; | |||||
| margin-top: -4rpx; | |||||
| padding-left: 40rpx; | padding-left: 40rpx; | ||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| color: #556fb5 !important; | color: #556fb5 !important; | ||||
| float: left; | float: left; | ||||
| box-sizing: border-box; | box-sizing: border-box; | ||||
| height: 70rpx; | height: 70rpx; | ||||
| padding: 0 13rpx; | |||||
| padding: 0 15rpx; | |||||
| } | } | ||||
| .tab-view .tab-span { | .tab-view .tab-span { |
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| onShow(){ | |||||
| this.setData({ | |||||
| currentIndex: 2 | |||||
| }) | |||||
| }, | |||||
| // 获取手机号授权 | // 获取手机号授权 | ||||
| getPhoneNumber(e) { | getPhoneNumber(e) { | ||||
| console.log(e); | console.log(e); |
| // 进入详情 | // 进入详情 | ||||
| goDetails(e) { | goDetails(e) { | ||||
| let value = e.currentTarget.dataset.value; | let value = e.currentTarget.dataset.value; | ||||
| wx.reLaunch({ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + value, | url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + value, | ||||
| }) | }) | ||||
| }, | }, | ||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| // 图片预览 | |||||
| viewImg(e){ | |||||
| }, | |||||
| }) | }) | ||||
| <image class='other-head-img' src='{{item.senderHeadPortrait}}'></image> | <image class='other-head-img' src='{{item.senderHeadPortrait}}'></image> | ||||
| <view class='other-record-content-triangle'></view> | <view class='other-record-content-triangle'></view> | ||||
| <view class='other-record-content'> | <view class='other-record-content'> | ||||
| <image class='content-img' src="{{ mangerUrl + item.content }}"></image> | |||||
| <image class='content-img' src="{{ mangerUrl + item.content }}" data-url="{{ mangerUrl + item.message }}" bindtap="viewImg"></image> | |||||
| <view class="msg-isRead left">{{ item.isRead ? '已读' : '未读' }}</view> | <view class="msg-isRead left">{{ item.isRead ? '已读' : '未读' }}</view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='own-record'> | <view class='own-record'> | ||||
| <view class='own-record-content'> | <view class='own-record-content'> | ||||
| <image class='content-img' src="{{ mangerUrl + item.content }}"></image> | |||||
| <image class='content-img' src="{{ mangerUrl + item.content }}" data-url="{{ mangerUrl + item.message }}" bindtap="viewImg"></image> | |||||
| <view class="msg-isRead right"> | <view class="msg-isRead right"> | ||||
| {{ item.isRead ? '已读' : '未读' }} | {{ item.isRead ? '已读' : '未读' }} | ||||
| </view> | </view> | ||||
| <image class='other-head-img' src='{{receivebaseInfo.avatar}}'></image> | <image class='other-head-img' src='{{receivebaseInfo.avatar}}'></image> | ||||
| <view class='other-record-content-triangle'></view> | <view class='other-record-content-triangle'></view> | ||||
| <view class='other-record-content'> | <view class='other-record-content'> | ||||
| <image class='content-img' src="{{ mangerUrl + item.message }}"></image> | |||||
| <image class='content-img' src="{{ mangerUrl + item.message }}" data-url="{{ mangerUrl + item.message }}" bindtap="viewImg"></image> | |||||
| <view class="msg-isRead left">{{ item.isRead ? '已读' : '未读' }}</view> | <view class="msg-isRead left">{{ item.isRead ? '已读' : '未读' }}</view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='own-record'> | <view class='own-record'> | ||||
| <view class='own-record-content'> | <view class='own-record-content'> | ||||
| <image class='content-img' src="{{ mangerUrl + item.message }}"></image> | |||||
| <image class='content-img' src="{{ mangerUrl + item.message }}" data-url="{{ mangerUrl + item.message }}" bindtap="viewImg"></image> | |||||
| <view class="msg-isRead right">{{ item.isRead ? '已读' : '未读' }}</view> | <view class="msg-isRead right">{{ item.isRead ? '已读' : '未读' }}</view> | ||||
| </view> | </view> | ||||
| <view class='own-record-content-triangle'></view> | <view class='own-record-content-triangle'></view> |
| } | } | ||||
| .msg-isRead.right { | .msg-isRead.right { | ||||
| left: -60rpx; | left: -60rpx; | ||||
| } | |||||
| .content-img { | |||||
| width: 450rpx; | |||||
| } | } |
| // 进入详情 | // 进入详情 | ||||
| goDetails(e) { | goDetails(e) { | ||||
| wx.reLaunch({ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + e.detail, | url: '/pages/index/components/listDetails/Details?businessCommunicationDemandId=' + e.detail, | ||||
| }) | }) | ||||
| }, | }, |
| if (app.globalData.businessCommunicationCustomer) { | if (app.globalData.businessCommunicationCustomer) { | ||||
| this.setData({ | this.setData({ | ||||
| user: app.globalData.businessCommunicationCustomer, | user: app.globalData.businessCommunicationCustomer, | ||||
| isLogin:true | |||||
| isLogin: true | |||||
| }) | }) | ||||
| console.log(`------------------当前登录用户-----------------------`) | console.log(`------------------当前登录用户-----------------------`) | ||||
| console.log(app.globalData.businessCommunicationCustomer); | console.log(app.globalData.businessCommunicationCustomer); | ||||
| console.log(`------------------当前登录用户-----------------------`) | console.log(`------------------当前登录用户-----------------------`) | ||||
| } | } | ||||
| }, | }, | ||||
| onShow(){ | |||||
| onShow() { | |||||
| this.setData({ | this.setData({ | ||||
| currentIndex: 3 | currentIndex: 3 | ||||
| }) | }) | ||||
| }) | }) | ||||
| }, | }, | ||||
| // 退出登录 | // 退出登录 | ||||
| exitLogin(){ | |||||
| wx.removeStorageSync('userInfo'); | |||||
| wx.removeStorageSync('businessCommunicationCustomer'); | |||||
| app.globalData.businessCommunicationCustomer = null; | |||||
| app.globalData.customerId = null; | |||||
| this.setData({ | |||||
| user:{}, | |||||
| isLogin:false | |||||
| exitLogin() { | |||||
| wx.showModal({ | |||||
| title: '提示', | |||||
| content: "是否确认退出账号?", | |||||
| confirmText: "确认", | |||||
| cancelText: "取消", | |||||
| success(res) { | |||||
| if (res.confirm) { | |||||
| wx.removeStorageSync('userInfo'); | |||||
| wx.removeStorageSync('businessCommunicationCustomer'); | |||||
| app.globalData.businessCommunicationCustomer = null; | |||||
| app.globalData.customerId = null; | |||||
| this.setData({ | |||||
| user: {}, | |||||
| isLogin: false | |||||
| }) | |||||
| } | |||||
| } | |||||
| }) | }) | ||||
| }, | }, | ||||
| /** | /** | ||||
| * 用户点击右上角分享给朋友 | * 用户点击右上角分享给朋友 | ||||
| */ | */ | ||||
| onShareAppMessage() { | |||||
| onShareAppMessage() { | |||||
| return { | return { | ||||
| title: "分享你一个需求交流平台!推荐你一起来关注~", | title: "分享你一个需求交流平台!推荐你一起来关注~", | ||||
| imageUrl: '/images/home/ShareApp-index.png', | imageUrl: '/images/home/ShareApp-index.png', |
| <view class="user-name-box fl" wx:else> | <view class="user-name-box fl" wx:else> | ||||
| <view class="user-name yichu fl">{{ user.nickName }}</view> | <view class="user-name yichu fl">{{ user.nickName }}</view> | ||||
| </view> | </view> | ||||
| <view class="user-address fl">{{ user.province + (user.city ? '·' + user.city : '') }}</view> | |||||
| <view class="user-address fl">{{ user.province + (user.city ? ' · ' + user.city : '') }}</view> | |||||
| <view class="show-home-page fl" bindtap="goRouterPage" data-code="homepage"> | <view class="show-home-page fl" bindtap="goRouterPage" data-code="homepage"> | ||||
| <image class="home-page-img" src="/images/home/home-page-icon.png" /> | <image class="home-page-img" src="/images/home/home-page-icon.png" /> | ||||
| 查 看 主 页 >> | |||||
| 查看主页 >> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="exit-view" bindtap="exitLogin"> | <view class="exit-view" bindtap="exitLogin"> |
| .content .li-view .my-attention-img{ | .content .li-view .my-attention-img{ | ||||
| width: 44rpx; | width: 44rpx; | ||||
| height: 41rpx; | height: 41rpx; | ||||
| top:7rpx; | |||||
| } | } | ||||
| .content .li-view .my-release-img{ | .content .li-view .my-release-img{ | ||||
| top: 10rpx; | |||||
| top: 13rpx; | |||||
| } | } | ||||
| .content .li-view .my-collect-img{ | .content .li-view .my-collect-img{ | ||||
| width: 41rpx; | width: 41rpx; | ||||
| height: 41rpx; | height: 41rpx; | ||||
| top: 9rpx; | |||||
| top: 10rpx; | |||||
| margin-left: 4rpx; | |||||
| left: 0rpx; | |||||
| } | } | ||||
| .content .li-view .my-attention-img{ | |||||
| top:10rpx; | |||||
| margin-left: 1rpx; | |||||
| } | |||||
| .content .li-view .my-contact-img{ | .content .li-view .my-contact-img{ | ||||
| width: 37rpx; | width: 37rpx; | ||||
| height: 35rpx; | height: 35rpx; | ||||
| top: 7rpx; | |||||
| margin-left: 10rpx; | |||||
| left: -5rpx; | |||||
| } | } | ||||
| .content .li-view .right-icon { | .content .li-view .right-icon { |
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad() { | onLoad() { | ||||
| const eventChannel = this.getOpenerEventChannel() | const eventChannel = this.getOpenerEventChannel() | ||||
| if (eventChannel.on) { | if (eventChannel.on) { | ||||
| // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |