Browse Source

样式优化

master
xpz2018 6 years ago
parent
commit
3f026c2e65
2 changed files with 20 additions and 10 deletions
  1. 18
      pages/mall/search-list/index.js
  2. 12
      pages/mall/search-list/index.wxml

18
pages/mall/search-list/index.js

@ -13,6 +13,7 @@ Page({
data: {
height: app.globalData.fragmentHeight,
CustomBar: app.globalData.CustomBar,
loading: false,
finished: false,
requesting: false,
rearchStringList: [],
@ -103,8 +104,11 @@ Page({
if (this.data.requesting || this.data.finished) {
return
}
if (this.data.form.pageNum == 1 && this.data.taskList.length == 0) {
this.setData({ loading: true })
}
this.data.requesting = true
wx.showLoading({ title: '搜索中', mask: true })
// wx.showLoading({ title: '搜索中', mask: true })
// /product/list产品列表
request.get('/bxe-mall/product/list', this.data.form).then(result => {
//成功回调
@ -124,7 +128,8 @@ Page({
[nowList]: respList,
total: result.data.total,
['form.pageNum']: (num + 1),
finished
finished,
loading: false
})
} else {
var strList = this.data.rearchStringList
@ -133,15 +138,16 @@ Page({
}
this.setData({
rearchStringList: strList,
focus: false
focus: false,
loading: false
})
}
wx.hideLoading()
// wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
// wx.hideLoading()
this.setData({ loading: false })
this.data.requesting = false
console.log()
var strList = this.data.rearchStringList
if(strList.indexOf(this.data.form.name) < 0){
strList.splice(0, 0, this.data.form.name)

12
pages/mall/search-list/index.wxml

@ -11,7 +11,7 @@
<text class="cuIcon-roundclose" hidden="{{form.name.length === 0}}" style="font-size: 17px" catchtouchstart="clearInput"></text>
</view>
<view class="action">
<wux-button outline type="stable" size="small" bind:click="startSearch">搜索</wux-button>
<wux-button outline type="stable" size="small" bind:click="startSearch">搜索</wux-button>
<!-- <button class="cu-btn line-black round" bindtap="startSearch">搜索</button> -->
</view>
</view>
@ -19,7 +19,7 @@
<view style="margin-top: 100rpx">
<view class="bg-white" wx:if="{{focus}}">
<view class="cu-form-group" style="min-height:80rpx" wx:if="{{rearchStringList.length}}">
<view class="action" style="color:black">搜索历史</view>
<view class="action" style="color:black">搜索历史</view>
<text class="cuIcon-delete" style="font-size: 17px" bindtap="clearHistory"></text>
</view>
<view class="flex flex-wrap" style="padding: 0rpx 20rpx 30rpx 20rpx" wx:if="{{rearchStringList.length}}">
@ -28,7 +28,11 @@
</view>
</view>
</view>
<view class="flex list-empty" wx:elif="{{!focus && !taskList.length}}" style="height:{{height}}rpx">
<view class="flex flex-column flex-center" wx:elif="{{loading}}" style="height:{{height}}rpx">
<view class="load-spinner text-gray" />
<view class="text-empty" style="margin-top:48rpx">加载中...</view>
</view>
<view class="flex list-empty" wx:elif="{{!taskList.length}}" style="height:{{height}}rpx">
<image class="img-empty" src="/assets/image/list_empty.png"></image>
<view class="text-empty">暂无数据</view>
</view>
@ -36,7 +40,7 @@
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex">
<view class="flex content" wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<wux-image width="{{120}}" height="{{120}}" wux-class="page-icon" src="{{item.litimgUrl}}" mode="{{aspectFill}}">
<text class="icon--refresher" slot="loading"></text>
<text class="icon--refresher" slot="loading"></text>
</wux-image>
<view style="flex:1;padding:16rpx">
<view class="flex flex-justify">

Loading…
Cancel
Save