Commit e7481759 by 高淑倩

add: 我的订单滚动

parent 9b7e1c95
......@@ -116,6 +116,12 @@ a {
.clear:after {
clear: both; }
.clearfix::after {
content: '';
display: block;
clear: both; }
/*字体*/
.fs-10 {
font-size: 10px; }
......
......@@ -10,10 +10,10 @@ wxService.page({
* 页面的初始数据
*/
data: {
swiperItem:[
swiperItem: [
{
type:'1',
name:'全部'
type: '1',
name: '全部'
},
{
type: '2',
......@@ -32,12 +32,25 @@ wxService.page({
name: '退款/售后'
}
],
currentIndex:1,
currentIndex: 1,
pageNo: 1,
pageSize:5,
pageSize: 5,
noMoreFlag: false,
orderList: null,
totalPages: 0
totalPages: 0,
subImgs: [{
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}, {
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}, {
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}, {
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}, {
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}, {
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}]
},
/**
......@@ -51,9 +64,9 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.initOrderList(this.data.pageNo,this.data.pageSize)
this.initOrderList(this.data.pageNo, this.data.pageSize)
},
initOrderList(pageNo,pageSize) {
initOrderList(pageNo, pageSize) {
if (this.data.noMoreFlag) { // 没有更多数据了,不调用接口
return false
}
......@@ -64,11 +77,11 @@ wxService.page({
})
wxService.post(`/sale/order/list?pageNo=${pageNo}&pageSize=${pageSize}`).then(res => {
if (res) {
const { result,data } = res.data
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
orderList: this.data.pageNo == 1? [...data.content]: [...this.data.orderList,...data.content],
orderList: this.data.pageNo == 1 ? [...data.content] : [...this.data.orderList, ...data.content],
totalPages: data.totalPages
})
}
......@@ -76,7 +89,7 @@ wxService.page({
})
},
//点击切换tab
switchTab(e){
switchTab(e) {
this.setData({
currentIndex: e.currentTarget.dataset.type
})
......@@ -97,8 +110,8 @@ wxService.page({
if (this.data.pageNo < this.data.totalPages) {
this.setData({
pageNo: this.data.pageNo + 1,
},()=> {
this.initOrderList(this.data.pageNo, this.data.pageSize,)
}, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize)
})
} else {
this.setData({
......
......@@ -11,7 +11,6 @@
{{item.name}}
</view>
</view>
<scroll-view scroll-y="true">
<view class="order-content">
<block
wx:for="{{orderList}}"
......@@ -28,11 +27,15 @@
<text class="order-status">待付款</text>
</view>
<view class="pro-list">
<image class="pro-img" />
<image class="pro-img" />
<image class="pro-img" />
<image class="pro-img" />
<text class="pro-img-dot">...</text>
<scroll-view scroll-x="true">
<view class="uploadWrap" scroll-x="true">
<block wx:for='{{subImgs}}' wx:for-item="sub" wx:key="s" >
<view class="upload_Item">
<image class="upload_Item_img" src="{{sub.listUrl}}" bindtap='goProDetail' data-id='{{sub.goodsId}}'></image>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="pro-number">
<text class="total-pro">共5件商品</text>
......@@ -51,7 +54,6 @@
</view>
</block>
</view>
</scroll-view>
</view>
<view class="no-bottom">
<no-more wx:if="{{noMoreFlag}}"/>
......
......@@ -13,6 +13,7 @@ scroll-view{
background-color: #ffffff;
color: #000000;
position:fixed;
top: 0;
z-index:1;
justify-content: space-between;
padding: 24rpx 85rpx 0;
......@@ -56,19 +57,6 @@ scroll-view{
}
.pro-list{
margin-top: 16rpx;
display: flex;
justify-content: space-between;
}
.pro-img{
width: 140rpx;
height: 140rpx;
border:1px solid red;
vertical-align: middle;
}
.pro-img-dot{
display: inline-block;
vertical-align: middle;
line-height: 144rpx;
}
.pro-number{
margin-top: 28rpx;
......@@ -103,6 +91,27 @@ scroll-view{
.no-bottom {
margin: 50rpx 0;
}
.sub-imgs{
margin: 25rpx 0;
padding-left: 24rpx;
}
.uploadWrap{
height: 140rpx;
width:100%;
display: flex;
display: -webkit-box;
flex-direction: column;
}
.upload_Item{
width: 140rpx;
height: 140rpx;
flex: 1;
padding: 0rpx 15rpx 15rpx 0;
}
.upload_Item:last-child{
padding-right: 20rpx;
}
.upload_Item_img{
width: 140rpx;
height: 140rpx;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment