Переглянути джерело

提交代码~

release/210823_需求对对碰
王饶冀 3 роки тому
джерело
коміт
a195faec0b
4 змінених файлів з 15 додано та 13 видалено
  1. 1
    0
      app.js
  2. 1
    1
      components/listItem/listItem.wxml
  3. 4
    6
      pages/index/index.js
  4. 9
    6
      pages/index/index.wxml

+ 1
- 0
app.js Переглянути файл

this.globalData.businessCommunicationCustomer = businessCommunicationCustomer; this.globalData.businessCommunicationCustomer = businessCommunicationCustomer;
this.globalData.customerId = businessCommunicationCustomer.customerId; this.globalData.customerId = businessCommunicationCustomer.customerId;
} }
console.log(`初始化拿到的缓存`,this.globalData)
} }
} }
}) })

+ 1
- 1
components/listItem/listItem.wxml Переглянути файл

<image class="browse-img" src="/images/home/browse-icon.png" /> <image class="browse-img" src="/images/home/browse-icon.png" />
{{ item.pageView || 0}}浏览量 {{ item.pageView || 0}}浏览量
</view> </view>
<view class="fl list-collect-view" wx:if="{{ pageStatus == 'detatil' }}" bindtap="productCollect">
<view class="fl list-collect-view" wx:if="{{ pageStatus == 'detatil' && app.globalData.customerId != item.globalData }}" bindtap="productCollect">
<image class="collect-img" src="/images/home/is-collect.png" wx:if="{{ isCollect }}" /> <image class="collect-img" src="/images/home/is-collect.png" wx:if="{{ isCollect }}" />
<image class="collect-img" src="/images/home/not-collect.png" wx:else /> <image class="collect-img" src="/images/home/not-collect.png" wx:else />
收藏 收藏

+ 4
- 6
pages/index/index.js Переглянути файл

}, },
{ {
text: "我关注的", text: "我关注的",
value: "my1"
value: "my"
}, },
{ {
text: "工商类", text: "工商类",
}, },
// 点击搜索 // 点击搜索
toSearch(e) { toSearch(e) {
console.log(this.data.keyword)
this.setData({ this.setData({
listData: [], listData: [],
onRefresh: true, onRefresh: true,
// tab切换 // tab切换
tabChange(e) { tabChange(e) {
let dataset = e.currentTarget.dataset; let dataset = e.currentTarget.dataset;
// if(dataset.value == 'my1'){
// console.log(this.selectComponent('#shouquan'));
// return
// }
// 如果实在加载中点击无效 // 如果实在加载中点击无效
if (this.data.listLoading) { if (this.data.listLoading) {
return return
if (type == 'all') { if (type == 'all') {
type = ""; type = "";
} }
if(currentTab == 'my' ){
type = app.globalData.businessCommunicationCustomer.attentionTypeIds;
}
$request.get('/businessCommunicationDemand/getDemandByKeywordOrType.action', $request.get('/businessCommunicationDemand/getDemandByKeywordOrType.action',
{ page, size, keyword, type, isInterest: 0 } { page, size, keyword, type, isInterest: 0 }
).then(res => { ).then(res => {

+ 9
- 6
pages/index/index.wxml Переглянути файл

<view wx:else> <view wx:else>
<view class="not-data" wx:if="{{ listData.length < 1 }}"> <view class="not-data" wx:if="{{ listData.length < 1 }}">
<image class="not-data-img" src="/images/home/not-data.png" /> <image class="not-data-img" src="/images/home/not-data.png" />
<view class="not-info" wx:if="{{ currentTab == 'all ' }}">
抱歉,暂无任何需求
</view>
<view class="not-info" wx:else>
抱歉,暂无任何需求
<view class="not-info" wx:if="{{ currentTab == 'all' }}">抱歉,暂无任何需求</view>
<view class="not-info" wx:elif="{{ currentTab == 'my' }}">
<view>您尚未设置关注类型喜好</view>
<view style="margin-bottom: 10rpx;">设置后将为您进行需求推荐~</view>
<van-button class="set-attention-btn" color="#5e73e5" round bind:click="setAttention">
设置关注类型喜好
</van-button>
</view> </view>
<view class="not-info" wx:else>抱歉,暂无任何需求</view>
</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"/>
<listItem item="{{ item }}" bind:getItem="goDetails" />
</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>

Завантаження…
Відмінити
Зберегти