Commit e7481759 by 高淑倩

add: 我的订单滚动

parent 9b7e1c95
...@@ -116,6 +116,12 @@ a { ...@@ -116,6 +116,12 @@ a {
.clear:after { .clear:after {
clear: both; } clear: both; }
.clearfix::after {
content: '';
display: block;
clear: both; }
/*字体*/ /*字体*/
.fs-10 { .fs-10 {
font-size: 10px; } font-size: 10px; }
......
...@@ -10,10 +10,10 @@ wxService.page({ ...@@ -10,10 +10,10 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
swiperItem:[ swiperItem: [
{ {
type:'1', type: '1',
name:'全部' name: '全部'
}, },
{ {
type: '2', type: '2',
...@@ -32,12 +32,25 @@ wxService.page({ ...@@ -32,12 +32,25 @@ wxService.page({
name: '退款/售后' name: '退款/售后'
} }
], ],
currentIndex:1, currentIndex: 1,
pageNo: 1, pageNo: 1,
pageSize:5, pageSize: 5,
noMoreFlag: false, noMoreFlag: false,
orderList: null, 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({ ...@@ -51,9 +64,9 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { 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) { // 没有更多数据了,不调用接口 if (this.data.noMoreFlag) { // 没有更多数据了,不调用接口
return false return false
} }
...@@ -64,11 +77,11 @@ wxService.page({ ...@@ -64,11 +77,11 @@ wxService.page({
}) })
wxService.post(`/sale/order/list?pageNo=${pageNo}&pageSize=${pageSize}`).then(res => { wxService.post(`/sale/order/list?pageNo=${pageNo}&pageSize=${pageSize}`).then(res => {
if (res) { if (res) {
const { result,data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
this.setData({ 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 totalPages: data.totalPages
}) })
} }
...@@ -76,7 +89,7 @@ wxService.page({ ...@@ -76,7 +89,7 @@ wxService.page({
}) })
}, },
//点击切换tab //点击切换tab
switchTab(e){ switchTab(e) {
this.setData({ this.setData({
currentIndex: e.currentTarget.dataset.type currentIndex: e.currentTarget.dataset.type
}) })
...@@ -97,8 +110,8 @@ wxService.page({ ...@@ -97,8 +110,8 @@ wxService.page({
if (this.data.pageNo < this.data.totalPages) { if (this.data.pageNo < this.data.totalPages) {
this.setData({ this.setData({
pageNo: this.data.pageNo + 1, pageNo: this.data.pageNo + 1,
},()=> { }, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize,) this.initOrderList(this.data.pageNo, this.data.pageSize)
}) })
} else { } else {
this.setData({ this.setData({
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
<scroll-view scroll-y="true">
<view class="order-content"> <view class="order-content">
<block <block
wx:for="{{orderList}}" wx:for="{{orderList}}"
...@@ -28,11 +27,15 @@ ...@@ -28,11 +27,15 @@
<text class="order-status">待付款</text> <text class="order-status">待付款</text>
</view> </view>
<view class="pro-list"> <view class="pro-list">
<image class="pro-img" /> <scroll-view scroll-x="true">
<image class="pro-img" /> <view class="uploadWrap" scroll-x="true">
<image class="pro-img" /> <block wx:for='{{subImgs}}' wx:for-item="sub" wx:key="s" >
<image class="pro-img" /> <view class="upload_Item">
<text class="pro-img-dot">...</text> <image class="upload_Item_img" src="{{sub.listUrl}}" bindtap='goProDetail' data-id='{{sub.goodsId}}'></image>
</view>
</block>
</view>
</scroll-view>
</view> </view>
<view class="pro-number"> <view class="pro-number">
<text class="total-pro">共5件商品</text> <text class="total-pro">共5件商品</text>
...@@ -51,7 +54,6 @@ ...@@ -51,7 +54,6 @@
</view> </view>
</block> </block>
</view> </view>
</scroll-view>
</view> </view>
<view class="no-bottom"> <view class="no-bottom">
<no-more wx:if="{{noMoreFlag}}"/> <no-more wx:if="{{noMoreFlag}}"/>
......
...@@ -13,6 +13,7 @@ scroll-view{ ...@@ -13,6 +13,7 @@ scroll-view{
background-color: #ffffff; background-color: #ffffff;
color: #000000; color: #000000;
position:fixed; position:fixed;
top: 0;
z-index:1; z-index:1;
justify-content: space-between; justify-content: space-between;
padding: 24rpx 85rpx 0; padding: 24rpx 85rpx 0;
...@@ -56,19 +57,6 @@ scroll-view{ ...@@ -56,19 +57,6 @@ scroll-view{
} }
.pro-list{ .pro-list{
margin-top: 16rpx; 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{ .pro-number{
margin-top: 28rpx; margin-top: 28rpx;
...@@ -103,6 +91,27 @@ scroll-view{ ...@@ -103,6 +91,27 @@ scroll-view{
.no-bottom { .no-bottom {
margin: 50rpx 0; 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