|
|
@ -12,13 +12,22 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 占位 -->
|
|
|
|
<!-- 占位 -->
|
|
|
|
<view :style="{height: 35+statusBarHeight+toBarHeight+'px'}"></view>
|
|
|
|
<view :style="{height: 35+statusBarHeight+toBarHeight+'px'}"></view>
|
|
|
|
|
|
|
|
<scroll-view scroll-y="true" style="height: calc(100vh - 90px)"
|
|
|
|
|
|
|
|
@scrolltolower="handleLoadMore">
|
|
|
|
<view class="list_box">
|
|
|
|
<view class="list_box">
|
|
|
|
<view v-for="(item, index) in orderList" :key="index" class="lists">
|
|
|
|
<view v-for="(item, index) in orderList" :key="index" class="lists">
|
|
|
|
<view class="type">
|
|
|
|
<view class="type">
|
|
|
|
<text class="order_id">订单编号:{{item.id}}</text>
|
|
|
|
<text class="order_id" @tap="jumpDetails(item)">订单编号:{{item.id}}</text>
|
|
|
|
|
|
|
|
<view class="flex flex-direction">
|
|
|
|
<text class="order_type">
|
|
|
|
<text class="order_type">
|
|
|
|
{{ item.state | setStatus }}
|
|
|
|
{{ item.state | setStatus }}
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
<text class="order-time" v-if="item.time != 0">{{ item.time }}</text>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view v-for="(row, index2) in item.orderDetailList" :key="index2" class="top"
|
|
|
|
<view v-for="(row, index2) in item.orderDetailList" :key="index2" class="top"
|
|
|
|
@tap="jumpDetails(item)">
|
|
|
|
@tap="jumpDetails(item)">
|
|
|
@ -38,16 +47,19 @@
|
|
|
|
<view class="address">总计:<text style="color: #FF1929;font-size: 36upx;">¥{{item.totalAmount}}</text> </view>
|
|
|
|
<view class="address">总计:<text style="color: #FF1929;font-size: 36upx;">¥{{item.totalAmount}}</text> </view>
|
|
|
|
<!-- <view class="address">店铺地址:北京市海淀区苏家坨乡前沙涧村</view> -->
|
|
|
|
<!-- <view class="address">店铺地址:北京市海淀区苏家坨乡前沙涧村</view> -->
|
|
|
|
<view class="btns">
|
|
|
|
<view class="btns">
|
|
|
|
<block v-if="item.state == 0">
|
|
|
|
<block v-if="item.state == 0 || item.state == 6">
|
|
|
|
<!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)">去付款</view> -->
|
|
|
|
<!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)">去付款</view> -->
|
|
|
|
<view class="pay shouhou" @tap="cencalOrder(item)">取消订单</view>
|
|
|
|
<view class="pay shouhou" @tap="cencalOrder(item)">取消订单</view>
|
|
|
|
</block>
|
|
|
|
</block>
|
|
|
|
<block v-if="item.state == 1">
|
|
|
|
<block v-if="item.state == 1">
|
|
|
|
<!-- <view class="pay shouhou" @tap="onRefund(item)">取消订单</view> -->
|
|
|
|
<!-- <view class="pay shouhou" @tap="onRefund(item)">取消订单</view> -->
|
|
|
|
|
|
|
|
<view class="pay shouhou" @tap="onConfirmOrder(item)" >确认提货</view>
|
|
|
|
</block>
|
|
|
|
</block>
|
|
|
|
<block v-if="item.state == 2">
|
|
|
|
<block v-if="item.state == 2">
|
|
|
|
<view class="pay" @tap="onConfirmOrder(item)" :style="'color:#fff;background:' + colors+ ';border-color:' + colors">确认收货</view>
|
|
|
|
<!-- <view class="pay" @tap="onConfirmOrder(item)" :style="'color:#fff;background:' + colors+ ';border-color:' + colors">确认收货</view> -->
|
|
|
|
<!-- <view class="pay shouhou" @tap="onRefund(item)">申请退款</view> -->
|
|
|
|
<!-- <view class="pay shouhou" @tap="onRefund(item)">申请退款</view> -->
|
|
|
|
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">订单评价</view>
|
|
|
|
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">申请售后</view>
|
|
|
|
</block>
|
|
|
|
</block>
|
|
|
|
<block v-if="item.state == 3">
|
|
|
|
<block v-if="item.state == 3">
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">订单评价</view>
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">订单评价</view>
|
|
|
@ -58,9 +70,10 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="nodata" v-if="orderList.length >= 3">—— 到底啦 ——</view>
|
|
|
|
<view class="nodata" v-if="isNoMore">—— 到底啦 ——</view>
|
|
|
|
<nodata :colors="colors" title="暂无订单信息" v-if="orderList.length == 0"></nodata>
|
|
|
|
<nodata :colors="colors" title="暂无订单信息" v-if="orderList.length == 0"></nodata>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<loading v-if="isShow == true"></loading>
|
|
|
|
<loading v-if="isShow == true"></loading>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
@ -75,6 +88,7 @@
|
|
|
|
import { ORDER_NAVS } from '@/config/order.js'
|
|
|
|
import { ORDER_NAVS } from '@/config/order.js'
|
|
|
|
import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
const app = getApp();
|
|
|
|
const app = getApp();
|
|
|
|
|
|
|
|
let timer = null
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -85,26 +99,24 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
orderList: [],
|
|
|
|
orderList: [],
|
|
|
|
isShow: true,
|
|
|
|
isShow: true,
|
|
|
|
colors: "",
|
|
|
|
colors: "",
|
|
|
|
themeObj: app.globalData.themeObj
|
|
|
|
themeObj: app.globalData.themeObj,
|
|
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
|
|
isNoMore: false
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
filters: {
|
|
|
|
filters: {
|
|
|
|
setStatus(value) {
|
|
|
|
setStatus(value) {
|
|
|
|
if (value == 0) {
|
|
|
|
const textObj = {
|
|
|
|
return '待付款'
|
|
|
|
6: '待确认',
|
|
|
|
} else if (value == 1) {
|
|
|
|
0: '待付款',
|
|
|
|
return '待发货'
|
|
|
|
1: '待提货',
|
|
|
|
} else if (value == 2) {
|
|
|
|
2: '已提货',
|
|
|
|
return '待收货'
|
|
|
|
3: '已提货',
|
|
|
|
} else if (value == 3) {
|
|
|
|
4: '退换货',
|
|
|
|
return '已收货'
|
|
|
|
5: '已取消'
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (value == 4) {
|
|
|
|
|
|
|
|
return '退换'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (value == 5) {
|
|
|
|
|
|
|
|
return '已取消'
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return textObj[value] || '未知'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
@ -118,15 +130,11 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
onLoad: function(options) {
|
|
|
|
onLoad: function(options) {
|
|
|
|
|
|
|
|
|
|
|
|
if (options.tabIndex) {
|
|
|
|
if (options.tabIndex) {
|
|
|
|
this.setData({
|
|
|
|
this.active = Number(options.tabIndex)
|
|
|
|
active: Number(options.tabIndex)
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
|
|
|
|
colors: app.globalData.newColor
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.setData({
|
|
|
|
this.setData({
|
|
|
|
isShow: false
|
|
|
|
isShow: false
|
|
|
@ -144,7 +152,8 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
onShow: function() {
|
|
|
|
onShow: function() {
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
|
|
|
|
|
|
|
|
// this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -172,18 +181,26 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function() {},
|
|
|
|
onShareAppMessage: function() {},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
handleLoadMore() {
|
|
|
|
|
|
|
|
if (this.isNoMore) return
|
|
|
|
|
|
|
|
this.pageNo++
|
|
|
|
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
|
|
|
|
},
|
|
|
|
onConfirmOrder(item) {
|
|
|
|
onConfirmOrder(item) {
|
|
|
|
uni.showModal({
|
|
|
|
uni.showModal({
|
|
|
|
title:'是否确认收货?',
|
|
|
|
title:'是否确认提货?',
|
|
|
|
confirmColor:this.colors,
|
|
|
|
confirmColor: this.themeObj.color,
|
|
|
|
success: (res) => {
|
|
|
|
success: (res) => {
|
|
|
|
if(res.confirm){
|
|
|
|
if(res.confirm){
|
|
|
|
item.state = 3
|
|
|
|
item.state = 2
|
|
|
|
editOrder(item).then(res => {
|
|
|
|
editOrder(item).then(res => {
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
icon: 'none',
|
|
|
|
title: '操作成功'
|
|
|
|
title: '操作成功'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
this.orderList = []
|
|
|
|
|
|
|
|
this.isNoMore = false
|
|
|
|
|
|
|
|
this.pageNo = 1
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -191,45 +208,97 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 0待付款 1待发货 2已发货 3已收货 4 退换 . -1全部
|
|
|
|
// 0待付款 -1待确认 1待发货 2已提货 3完成订单 4 退换 . -1全部
|
|
|
|
getOrderList(val = -1) {
|
|
|
|
getOrderList(val = -2) {
|
|
|
|
let s = [
|
|
|
|
let s = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
"rule": "eq",
|
|
|
|
"rule": "eq",
|
|
|
|
"type": "int",
|
|
|
|
"type": "string",
|
|
|
|
"dictCode": "",
|
|
|
|
"dictCode": "",
|
|
|
|
"val": getUserInfo().id,
|
|
|
|
"val": getUserInfo().id,
|
|
|
|
"field": "userId"
|
|
|
|
"field": "userId"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
s = val !== -1 ? [...s, {
|
|
|
|
const stateQuery = {
|
|
|
|
"rule": "eq",
|
|
|
|
"rule": "eq",
|
|
|
|
"type": "string",
|
|
|
|
"type": "int",
|
|
|
|
"dictCode": "",
|
|
|
|
"dictCode": "orderState",
|
|
|
|
"val": val,
|
|
|
|
"val": val,
|
|
|
|
"field": "state"
|
|
|
|
"field": "state"
|
|
|
|
}] : s
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (val !== -2) {
|
|
|
|
|
|
|
|
stateQuery.val = val === 2 ? '2,3,4' : val
|
|
|
|
|
|
|
|
stateQuery.rule = val === 2 ? 'in' : 'eq'
|
|
|
|
|
|
|
|
s = [...s, stateQuery]
|
|
|
|
|
|
|
|
}
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
pageNo:1,
|
|
|
|
pageNo: this.pageNo,
|
|
|
|
pageSize: 100,
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
superQueryParams: s,
|
|
|
|
superQueryParams: s,
|
|
|
|
superQueryMatchType: 'and',
|
|
|
|
superQueryMatchType: 'and',
|
|
|
|
"column": "createTime",
|
|
|
|
"column": "createTime",
|
|
|
|
order: "desc",
|
|
|
|
order: "desc",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uni.showLoading()
|
|
|
|
params.superQueryParams = encodeURI(JSON.stringify(s))
|
|
|
|
params.superQueryParams = encodeURI(JSON.stringify(s))
|
|
|
|
|
|
|
|
clearInterval(timer)
|
|
|
|
getOrderList(params).then(res => {
|
|
|
|
getOrderList(params).then(res => {
|
|
|
|
const result = res.result.records
|
|
|
|
const result = [...this.orderList, ...res.result.records]
|
|
|
|
this.orderList = result
|
|
|
|
this.isNoMore = res.result.records.length < this.pageSize
|
|
|
|
|
|
|
|
if (val == 0 || val == -2) {
|
|
|
|
|
|
|
|
this.time(result)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.orderList = Object.freeze(result)
|
|
|
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
uni.hideLoading()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
time (arr) {
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timer = setInterval(() => {
|
|
|
|
|
|
|
|
const list = arr.map((v, i) => {
|
|
|
|
|
|
|
|
if (v.state !== 0) {
|
|
|
|
|
|
|
|
v.time = 0
|
|
|
|
|
|
|
|
return v
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var nowDate = new Date();
|
|
|
|
|
|
|
|
const endTime = new Date(v.createTime).getTime() + 48 * 60 * 60 * 1000
|
|
|
|
|
|
|
|
var seconds = parseInt((endTime - nowDate) / 1000);
|
|
|
|
|
|
|
|
if (seconds <= 0) {
|
|
|
|
|
|
|
|
this.handlerCancelOrder(v, 'time')
|
|
|
|
|
|
|
|
return v;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var hours = Math.floor(seconds / (60 * 60));
|
|
|
|
|
|
|
|
if (hours < 10) hours = "0" + hours;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
seconds = seconds % (60 * 60);
|
|
|
|
|
|
|
|
var mins = Math.floor(seconds / 60);
|
|
|
|
|
|
|
|
if (mins < 10) mins = "0" + mins;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
seconds = seconds % 60;
|
|
|
|
|
|
|
|
if (seconds < 10) seconds = "0" + seconds;
|
|
|
|
|
|
|
|
v.time = hours + ":" + mins + ":" + seconds
|
|
|
|
|
|
|
|
return v
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.orderList = Object.freeze(list)
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
setTabs(item, index) {
|
|
|
|
setTabs(item, index) {
|
|
|
|
this.setData({
|
|
|
|
this.setData({
|
|
|
|
active: index
|
|
|
|
active: index
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.orderList = []
|
|
|
|
|
|
|
|
this.isNoMore = false
|
|
|
|
|
|
|
|
this.pageNo = 1
|
|
|
|
this.getOrderList(item.id)
|
|
|
|
this.getOrderList(item.id)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -239,22 +308,29 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
url: '/pages/views/order/orderDetails?status='+ 3
|
|
|
|
url: '/pages/views/order/orderDetails?status='+ 3
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cencalOrder(item) {
|
|
|
|
handlerCancelOrder(item, type = 'init') {
|
|
|
|
//取消订单
|
|
|
|
|
|
|
|
uni.showModal({
|
|
|
|
|
|
|
|
title:'确认要取消该订单吗?',
|
|
|
|
|
|
|
|
confirmColor:this.colors,
|
|
|
|
|
|
|
|
success: (res) => {
|
|
|
|
|
|
|
|
if(res.confirm){
|
|
|
|
|
|
|
|
item.state = 5
|
|
|
|
item.state = 5
|
|
|
|
editOrder(item).then(res => {
|
|
|
|
editOrder(item).then(res => {
|
|
|
|
|
|
|
|
if (type === 'init') {
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
icon: 'none',
|
|
|
|
title: '操作成功'
|
|
|
|
title: '操作成功'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.orderList = []
|
|
|
|
|
|
|
|
this.isNoMore = false
|
|
|
|
|
|
|
|
this.pageNo = 1
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
this.getOrderList(ORDER_NAVS[this.active].id)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
console.log('取消成功')
|
|
|
|
},
|
|
|
|
|
|
|
|
cencalOrder(item) {
|
|
|
|
|
|
|
|
//取消订单
|
|
|
|
|
|
|
|
uni.showModal({
|
|
|
|
|
|
|
|
title:'确认要取消该订单吗?',
|
|
|
|
|
|
|
|
confirmColor:this.colors,
|
|
|
|
|
|
|
|
success: (res) => {
|
|
|
|
|
|
|
|
if(res.confirm){
|
|
|
|
|
|
|
|
this.handlerCancelOrder(item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -323,7 +399,7 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
.type {
|
|
|
|
.type {
|
|
|
|
height: 50upx;
|
|
|
|
height: 50upx;
|
|
|
|
font-size: 26upx;
|
|
|
|
font-size: 26upx;
|
|
|
|
line-height: 50upx;
|
|
|
|
// line-height: 50upx;
|
|
|
|
font-weight: bold;
|
|
|
|
font-weight: bold;
|
|
|
|
text-align: right;
|
|
|
|
text-align: right;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
@ -335,6 +411,10 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
color: #999;
|
|
|
|
color: #999;
|
|
|
|
font-size: 24upx;
|
|
|
|
font-size: 24upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.type .order-time {
|
|
|
|
|
|
|
|
color: brown;
|
|
|
|
|
|
|
|
font-size: 24upx;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.lists .top {
|
|
|
|
.lists .top {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|