水滴兑换模块开发完成
This commit is contained in:
115
pages/water/waterOrder/waterOrder.js
Normal file
115
pages/water/waterOrder/waterOrder.js
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
data: {
|
||||
listType : '', // 订单状态
|
||||
listArr : '', // 订单列表
|
||||
listsArr : [], // 订单列表
|
||||
page : {}, // 分页信息
|
||||
lodingStats : false,// 加载状态
|
||||
},
|
||||
|
||||
onLoad(options) {},
|
||||
|
||||
onShow() {
|
||||
// 获取订单状态栏
|
||||
this.tabInfo()
|
||||
|
||||
// 获取订单列表
|
||||
this.listInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单状态栏
|
||||
*/
|
||||
tabInfo() {
|
||||
wx.$api.recruit.tabList().then(res => {
|
||||
this.setData({
|
||||
listArr: res.data
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
wx.$api.recruit.orderList({
|
||||
status: this.data.listType,
|
||||
page : page || 1
|
||||
}).then(res => {
|
||||
let listArr = this.data.listsArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data.data)
|
||||
this.setData({
|
||||
listsArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 状态筛选
|
||||
*/
|
||||
onTabs(val){
|
||||
if(this.data.listType === val) return
|
||||
this.setData({
|
||||
listType: val.currentTarget.dataset.type
|
||||
})
|
||||
|
||||
// 获取订单列表
|
||||
this.listInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单签收
|
||||
*/
|
||||
signClick(e) {
|
||||
wx.showModal({
|
||||
title : '提示',
|
||||
content : '是否签收',
|
||||
success : res=> {
|
||||
if (res.confirm) {
|
||||
wx.$api.recruit.orderSign(e.currentTarget.dataset.order_no).then(res => {
|
||||
wx.showToast({
|
||||
title:'签收成功',
|
||||
icon:'none'
|
||||
})
|
||||
|
||||
// 获取订单列表
|
||||
this.listInfo()
|
||||
}).catch(err => {})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
// 获取订单列表
|
||||
this.listInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
// 获取订单列表
|
||||
this.listInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/water/waterOrder/waterOrder.json
Normal file
4
pages/water/waterOrder/waterOrder.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "水滴兑换订单"
|
||||
}
|
||||
55
pages/water/waterOrder/waterOrder.wxml
Normal file
55
pages/water/waterOrder/waterOrder.wxml
Normal file
@@ -0,0 +1,55 @@
|
||||
<view class="header">
|
||||
<view class="tabs">
|
||||
<view class="tabs-item {{listType == item.status ? 'show' : ''}}" bindtap="onTabs" data-type="{{item.status}}" wx:for="{{listArr}}" wx:key="listArr">{{item.status_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list" wx:if="{{listsArr.length > 0}}">
|
||||
<view class="list-item" wx:for="{{listsArr}}" wx:key="listsArr">
|
||||
<view class="list-top">
|
||||
<view class="list-top-no">订单状态</view>
|
||||
<view class="list-top-status">{{item.status_text}}</view>
|
||||
</view>
|
||||
<view class="list-goods">
|
||||
<image class="list-goods-img" mode="aspectFill" src="{{item.goods.cover}}"></image>
|
||||
<view class="list-goods-cont">
|
||||
<view class="nowrap list-goods-name">{{item.goods.name}}</view>
|
||||
<view class="list-goods-text">
|
||||
<text>规格 99ml</text>x 1
|
||||
</view>
|
||||
<view class="list-goods-parice">
|
||||
¥<text>{{item.goods.price.vip}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-total">
|
||||
<view class="list-total-price">{{item.water_number}}</view><text>水滴</text>
|
||||
</view>
|
||||
<view class="list-tips">
|
||||
<view class="list-tips-left">
|
||||
<image class="list-tips-img" src="https://cdn.shuiganying.com/images/2023/04/04/d4543817b05d3aaac04dfb85ff9f8f8c.png"></image>收货城市
|
||||
</view>
|
||||
<view class="nowrap list-tips-right">{{item.express.full_address}}</view>
|
||||
</view>
|
||||
<view class="list-operate">
|
||||
<view class="list-more"></view>
|
||||
<view class="list-btn">
|
||||
<view bindtap="signClick" data-order_no="{{item.exchange_id}}" class="list-btn-labor" wx:if="{{item.can_sign}}">签收订单</view>
|
||||
<navigator hover-class="none" url="/pages/water/details/details?order_no={{item.exchange_id}}" class="list-btn-labor grey">查看详情</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/imgs/text_null.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
176
pages/water/waterOrder/waterOrder.wxss
Normal file
176
pages/water/waterOrder/waterOrder.wxss
Normal file
@@ -0,0 +1,176 @@
|
||||
page {
|
||||
background-color: #f7faff;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
height: 100rpx;
|
||||
background-color: #f7faff;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 30rpx 10rpx;
|
||||
font-size: 30rpx;
|
||||
color: #3c3d3e;
|
||||
}
|
||||
|
||||
.tabs-item.show {
|
||||
color: #3b7cff;
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
.list {
|
||||
padding: 20rpx 30rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 4rpx 30rpx 2rpx rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
.list-top {
|
||||
display: flex;
|
||||
margin-bottom: 30rpx;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.list-top-no {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.list-top-status {
|
||||
color: #ff8100;
|
||||
}
|
||||
|
||||
.list-goods {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.list-goods-img {
|
||||
width: 184rpx;
|
||||
height: 184rpx;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.list-goods-cont {
|
||||
width: calc(100% - 214rpx);
|
||||
}
|
||||
|
||||
.list-goods-name {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.list-goods-text {
|
||||
line-height: 90rpx;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.list-goods-text text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.list-goods-parice {
|
||||
text-align: right;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list-goods-parice text {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.list-total {
|
||||
text-align: right;
|
||||
margin-top: 30rpx;
|
||||
font-size: 32rpx;
|
||||
color: #3b7cff;
|
||||
}
|
||||
|
||||
.list-total.active {
|
||||
color: #3b7cff;
|
||||
}
|
||||
|
||||
.list-total text {
|
||||
font-size: 26rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
.list-total-price {
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
font-size: 38rpx;
|
||||
}
|
||||
|
||||
.list-tips {
|
||||
background-color: #f7faff;
|
||||
display: flex;
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin: 30rpx 0 40rpx;
|
||||
border-radius: 10rpx;
|
||||
line-height: 44rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list-tips-left {
|
||||
display: flex;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.list-tips-img {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.list-tips-right {
|
||||
color: #707070;
|
||||
width: calc(100% - 210rpx);
|
||||
}
|
||||
|
||||
.list-operate {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.list-more {
|
||||
flex: 1;
|
||||
line-height: 56rpx;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.list-btn {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.list-btn-labor {
|
||||
border: 2rpx solid #ff8100;
|
||||
color: #ff8100;
|
||||
border-radius: 80rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 25rpx;
|
||||
display: inline-block;
|
||||
font-size: 26rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.list-btn-labor.grey {
|
||||
color: grey;
|
||||
border-color: grey;
|
||||
}
|
||||
Reference in New Issue
Block a user