You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news3/shopOrder.vue

1035 lines
22 KiB

11 months ago
<template>
<view>
<view class="head-info">
<!-- 搜索 -->
<view class="searchContent">
<u-search bg-color="#fafafa" :is-scroll="true" height="120" font-size="32" :current="curTab"
bar-width="56" bar-height="6" active-color="#3B3B3B" :show-bar='true' :duration="0.2"
@search="getListAfter" action-text='筛选' @custom="getListAfter" placeholder="输入订单编号/收件人名字/电话/商品名称"
v-model="keyword">
</u-search>
11 months ago
</view>
</view>
<!-- 分类列表 -->
<view class="container">
<view class="classify-list">
<view class="list" v-for="(item,index) in classList" :class="{'action':classifyShow==item.id}"
@click="onClassify(item,index)" :key="index">
11 months ago
<text>{{item.name}}</text>
10 months ago
<text class="line" v-show="classifyShow==item.id"></text>
11 months ago
</view>
</view>
</view>
<view class="shopContent">
<view class="shopItem" v-if="goodsList.length>0" v-for="(item,index) in goodsList" :key="index">
11 months ago
<view class="orderInfo">
10 months ago
<text>订单号{{item.order_no}}</text>
<text class="statusText" style="color: #626262;font-weight: 700;">{{item.state_text}}</text>
11 months ago
</view>
<view class="shopItemInfo" v-for="(p,i) in item.goods" :key="i"
@click="goJump('/pages/news3/shopOrderDetails',item,0)">
10 months ago
<image :src="p.goods_image"></image>
<view class="priceName">
<view class="title">{{p.goods_name}}</view>
<view class="priceCon">
<text class="num">x{{p.total_num}}</text>
<view class="priceText">
<text style="font-size: 26upx;">¥</text>
<text>{{p.total_price}}</text>
</view>
11 months ago
</view>
</view>
</view>
<view class="totalNum">
<text>含运费¥{{item.express_price}}</text>
11 months ago
<text>共计</text>
<text>¥{{item.pay_price}}</text>
11 months ago
</view>
<view class="remark">
<view class="remarkTitle">
收件人姓名 {{item.address?item.address.name:''}} {{item.address?item.address.phone:''}}
11 months ago
</view>
<view class="remarkContent">
{{item.remark}}
</view>
</view>
<view class="btnGroup">
<view class="btn info"
10 months ago
v-show="!item.order_refund_id&& item.order_status==10&&item.pay_status==20&&item.delivery_status==30"
@click="goJump('/pages/news3/updateAddr',item,0)">修改地址</view>
<view class="btn primary" v-show="!item.order_refund_id&&item.order_status==10&&item.pay_status==10"
@click="goJump('/pages/news3/updatePrice',item)">修改价格</view>
<view class="btn primary"
v-show="!item.order_refund_id&&item.order_status==10&&item.pay_status==20&&item.delivery_status==30"
@click="goJump('/pages/news3/sendOutGoods',item,2)">发货</view>
<view class="btn info" v-show="item.audit_status==0" @click="refuseOrder(item,20)">拒绝</view>
<view class="btn primary" v-show="item.audit_status==0" @click="refuseOrder(item,10)">同意</view>
<view class="btn info" @click="onDelete(item)"
v-show="(!item.order_refund_id&&item.order_status==30&&item.pay_status==20&&item.delivery_status==20)||(!item.order_refund_id&&item.order_status==20&&item.pay_status==10&&item.delivery_status==10)">
删除订单</view>
<view class="btn info" @click="refundAfter(item)" v-show="item.state_text=='receipt'">转至售后</view>
<view class="btn primary"
v-show="!item.order_refund_id&&item.order_status==10&&item.pay_status==20&&item.delivery_status==20"
@click="goJump('/pages/news3/sendOutGoods',item,1)">修改物流</view>
11 months ago
</view>
</view>
<u-empty text="暂无数据显示哦~" v-else mode="list"></u-empty>
11 months ago
</view>
<u-popup v-model="show" mode="bottom" border-radius="10" :closeable="true">
<view class="filterContent">
<view class="filterTitle">
订单筛选
</view>
<view class="filterItem">
<view class="filterItemContent">
<view class="itemTitle">
下单时间
</view>
<view class="timeContainer">
10 months ago
<view class="selectTime" @click="onTime()">
{{startTime?startTime:'起始时间'}}
</view>
11 months ago
<text>-</text>
10 months ago
<view class="selectTime" @click="onTime()">
{{endTime?endTime:'终止时间'}}
</view>
11 months ago
</view>
</view>
<view class="filterItemContent">
<view class="itemTitle">
订单来源
11 months ago
</view>
<view class="selectContainer">
<view @click="setResourceIndex(index)"
:class="sourceIndex==index?'selectItem active':'selectItem'"
v-for="(item,index) in selectList" :key="item.id">
11 months ago
{{item.name}}
</view>
</view>
</view>
<view class="filterItemContent">
<view class="itemTitle">
支付方式
</view>
<view class="selectContainer">
<view @click="setpayIndex(index)" :class="payIndex==index?'selectItem active':'selectItem'"
v-for="(item,index) in payList" :key="item.id">
11 months ago
{{item.name}}
</view>
</view>
</view>
</view>
<view class="btnGroup">
<view class="resetBtn" @click="reset">
11 months ago
重置
</view>
<view class="confrim" @click="sureOrder">
11 months ago
确定
</view>
</view>
</view>
</u-popup>
<u-calendar v-model="timeShow" mode="range" @change="getTime" range-color='#F34A40' range-bg-color='#FFBDBA'
active-bg-color='#F34A40'></u-calendar>
11 months ago
<u-popup v-model="afterSale" width="80%" border-radius="10" :closeable="true" mode="center">
<view class="afterSales">
<view class="filterTitle">
{{audit_status==20?'拒绝':'同意'}}转移至售后
11 months ago
</view>
<view class="filterItem c">
<!-- <view class="itemTitle">
上传照片 <text style="color:#FF5042">*</text><text>最多可传5张图片</text>
11 months ago
</view>
<u-upload :action="action" :header="header" @on-uploaded="refundSuccess" @on-remove="refundRemove"
width="180" height="180" :file-list="transferList" :custom-btn="true" max-count="5">
<template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image :src="$picUrl+'/static/news/icon-upload.png'"></image>
<view class="1">上传图片</view>
</view>
</template>
</u-upload> -->
11 months ago
<view class="filterItemContent">
<view class="itemTitle">
备注
</view>
<u-input v-model="refund_notes" placeholder="请输入您的留言" type="textarea" :auto-height="true" />
11 months ago
</view>
</view>
<!-- :style="{'opacity': refund_image_id?1:0.6 }" -->
<view class="submit" @click="submitRefund()">
11 months ago
确定
</view>
</view>
</u-popup>
<u-modal v-model="deleteShow" :show-cancel-button="true" :closable='false' @cancel="deleteShow=false"
@confirm="handleOk" title="确认删除订单?" confirm-color="#F55349">
<view class="slot-content order-modal">
<view class="content">删除之后订单无法恢复无法处理您的售后问题 请慎重考虑</view>
<view class="desc" @click="toggleImage()">
<image v-if="isToggle" src="/static/invoice/select.png"></image>
<image v-else src="/static/invoice/select-on.png"></image>删除后将拼单信息设置为匿名
</view>
</view>
</u-modal>
11 months ago
</view>
</template>
<script>
10 months ago
import * as newFunApi from '@/api/newFun'
import Config from '@/core/config'
export default {
data() {
return {
classifyShow: 'all',
classList: [{
10 months ago
id: 'all',
11 months ago
name: '全部',
10 months ago
}, {
id: 'pay',
name: '待付款',
}, {
10 months ago
id: 'delivery',
11 months ago
name: '待发货',
}, {
10 months ago
id: 'receipt',
10 months ago
name: '待收货',
}, {
10 months ago
id: 'complete',
11 months ago
name: '已完成',
}, {
10 months ago
id: 'refund',
name: '售后订单',
}, {
10 months ago
id: 'apply_cancel',
name: '待取消',
}, {
10 months ago
id: 'cancel',
name: '已取消',
}, ],
goodsList: [],
show: false,
timeShow: false,
afterSale: false,
deleteShow: false,
isToggle: false,
selectList: [{
id: 1,
name: '普通订单',
val: 10
},
{
id: 2,
name: '砍价订单',
val: 20
},
{
id: 3,
name: '秒杀订单',
val: 30
},
],
payList: [{
id: 1,
name: '微信支付',
val: 'wechat'
},
{
id: 2,
name: '支付宝支付',
val: 'alipay'
},
{
id: 3,
name: '余额支付',
val: ' balance'
},
],
sourceIndex: 0,
payIndex: 0,
startTime: null,
endTime: null,
pageNum: 1,
keyword: "",
total: 1,
pageNum: 1,
action: '',
header: '',
refund_image_id: '',
refund_notes: '',
itemInfor: '',
audit_status: 20,
audit_notes: '',
10 months ago
}
},
onReady() {
this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "")
this.header = {
'Storeid': uni.getStorageSync('Store').storeInfo.store_id,
'Access-Token': uni.getStorageSync('AccessToken'),
'platform': "MP-WEIXIN",
}
10 months ago
this.getList()
},
10 months ago
onLoad() {
11 months ago
},
methods: {
reset() {
this.startTime = '';
this.endTime = '';
this.sourceIndex = 0;
this.payIndex = 0;
},
getTime(e) {
this.startTime = e.startDate;
this.endTime = e.endDate;
},
onTime(index) {
this.timeShow = true
},
sureOrder() {
this.pageNum = 1
this.goodsList = [];
this.getList()
this.show = false;
},
async getList() {
uni.showLoading({
title: "加载中"
})
let {
status,
message,
data
} = await newFunApi.shopOrderList({
dataType: this.classifyShow,
page: this.pageNum,
searchValue: this.keyword,
payMethod: this.payIndex > 0 ? this.payList[this.payIndex].val : '',
orderSource: this.sourceIndex > 0 ? this.selectList[this.sourceIndex].val : '',
betweenTime: this.endTime ? [this.startTime, this.endTime].join(',') : ''
});
if (status == 200) {
uni.hideLoading();
this.goodsList = this.goodsList.concat(data.list.data)
this.total = data.list.total
}
},
goJump(path, value, index) {
uni.navigateTo({
url: path + '?item=' + JSON.stringify(value) + '&source=' + index,
})
},
getListAfter() {
this.show = true
},
onClassify(item, index) {
this.pageNum = 1
this.classifyShow = item.id;
this.goodsList = [];
this.getList()
},
setResourceIndex(index) {
this.sourceIndex = index;
},
setpayIndex(index) {
this.payIndex = index;
},
refundAfter(item) {
this.itemInfor = item
this.afterSale = true
},
// 删除订单
onDelete(item) {
this.itemInfor = item
this.deleteShow = true
},
toggleImage() {
this.isToggle = !this.isToggle
},
handleOk() {
let orderId = this.itemInfor.order_id
const app = this
newFunApi.oderDelete({
orderId: orderId
})
.then(result => {
uni.showToast({
title: result.message
})
// 显示成功信
app.deleteShow = false
app.pageNum = 1
app.goodsList = [];
app.getList()
})
},
//接受上传返回的数据
refundSuccess(list) {
if (list.length > 0) {
const {
response
} = list[0];
if (response.status == 200) {
uni.showToast({
title: "上传成功"
})
this.refund_image_id = this.handleRemove('', list);
}
}
},
refundRemove(file, fileList) {
this.refund_image_id = this.handleRemove(file, fileList);
},
handleRemove: function(file, fileList) {
let idList = []
fileList.forEach(item => {
idList.push(item.response.data.fileInfo.file_id)
});
return idList.join(',')
},
// 同意拒绝
refuseOrder(item, status) {
this.itemInfor = item;
this.audit_status = status;
this.afterSale = true
},
async submitRefund() {
let params = {
"orderId": this.itemInfor.order_id,
10 months ago
"orderRefundId":this.itemInfor.order_refund_id,
"form": {
"audit_status": this.audit_status,
"refund_notes": this.refund_notes,
'refuse_desc': this.audit_notes,
'address_id': this.itemInfor.address ? this.itemInfor.address.order_address_id : '',
}
}
let {
status,
message,
data
} = await newFunApi.audit(params);
if (status == 200) {
this.afterSale = false
uni.hideLoading();
this.pageNum = 1
this.goodsList = [];
this.getList()
}
},
11 months ago
},
onReachBottom() {
if (this.goodsList.length <= this.total) {
this.pageNum++;
this.getList();
}
11 months ago
},
};
11 months ago
</script>
<style scoped lang="scss">
::v-deep .u-btn--primary {
background-color: #FC3E27 !important;
border-color: #FC3E27;
}
::v-deep .u-mask-zoom,
::v-deep .u-drawer {
z-index: 10 !important;
}
::v-deep .u-mode-center-box {
z-index: 11 !important;
}
::v-deep .u-empty {
padding: 100rpx 0;
}
::v-deep .u-content {
height: 62rpx !important;
line-height: 62rpx !important;
background-color: #fff !important;
width: 608rpx !important;
}
::v-deep .u-action-active {
margin-left: 0 !important;
color: #616161;
}
page {
background-color: #F7F8FA;
min-height: 100%;
}
.selectTime {
width: 288rpx;
height: 70rpx;
background: #F3F3F3;
border-radius: 44rpx;
text-align: center;
line-height: 70rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #A1A1A1;
font-style: normal;
text-transform: none;
}
.order-modal {
padding: 50rpx;
11 months ago
position: relative;
.content {
font-size: 28rpx;
font-weight: 400;
line-height: 50rpx;
color: #4C4C4C;
11 months ago
}
.desc {
11 months ago
display: flex;
align-items: center;
font-size: 24rpx;
font-weight: 400;
color: #9F9F9F;
11 months ago
justify-content: center;
margin-top: 20rpx;
image {
width: 28rpx;
height: 28rpx;
margin-right: 20rpx;
11 months ago
}
}
}
.head-info {
padding: 28upx 36upx;
.searchContent {
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
::v-deep .uni-input-placeholder {
margin-left: 5upx;
z-index: 10;
}
.search {
position: absolute;
top: 20upx;
left: 26upx;
z-index: 9;
}
::v-deep .u-input {
flex: 1;
margin-right: 10upx;
background: #FFFFFF !important;
}
::v-deep .uni-input-input {
background: #FFFFFF !important;
border-radius: 30px 30px 30px 30px;
opacity: 1;
padding-left: 20upx;
width: calc(100% - 80upx);
}
.filter {
display: flex;
width: 100upx;
flex-direction: column;
align-items: center;
justify-content: center;
image {
width: 34upx;
height: auto;
}
text {
font-size: 24upx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #616161;
}
}
11 months ago
}
}
.container {
11 months ago
background-color: #fff;
}
.classify-list {
white-space: nowrap;
width: 100%;
height: 100rpx;
overflow-x: auto;
overflow-y: hidden;
.list {
position: relative;
display: inline-block;
width: 18%;
height: 100%;
line-height: 100rpx;
text-align: center;
text {
font-size: 28rpx;
color: #3B3B3B;
}
.line {
position: absolute;
left: 50%;
bottom: 10rpx;
// width: 60%;
// height: 8rpx;
background: linear-gradient(to right, #f8f893, #fe9d00);
// border-radius: 10rpx;
transform: translate(-50%, 0);
width: 60upx;
height: 8upx;
background: #FF6257;
border-radius: 29px 29px 29px 29px;
opacity: 1;
11 months ago
}
}
.action {
text {
font-size: 32rpx;
opacity: 1;
11 months ago
}
}
}
.shopContent {
.shopItem {
margin-bottom: 14upx;
padding: 36upx;
background-color: #fff;
.orderInfo {
11 months ago
display: flex;
align-items: center;
11 months ago
justify-content: space-between;
text {
font-size: 28upx;
color: #707070;
}
}
.shopItemInfo {
display: flex;
margin-top: 40upx;
align-items: center;
image {
width: 180upx;
height: 180upx;
flex-shrink: 0;
}
.priceName {
margin-left: 40upx;
.title {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
}
.priceCon {
flex: 1;
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-top: 30rpx;
.num {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #1E1E1E;
}
.priceText {
display: flex;
align-items: center;
text {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #F21A1C;
font-weight: bold;
}
}
}
}
.totalNum {
text-align: right;
margin-top: 70upx;
text:first-child {
font-size: 24upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #B7B7B7;
}
text:nth-child(2) {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #3B3B3B;
margin: 0 10upx;
}
text:nth-child(3) {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #F21A1C;
}
}
.remark {
background: #F8F8F8;
border-radius: 0px 0px 0px 0px;
opacity: 1;
padding: 20upx;
margin-top: 20upx;
.remarkTitle {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #3B3B3B;
}
.remarkContent {
11 months ago
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #939393;
margin-top: 8upx;
}
}
.btnGroup {
display: flex;
margin-top: 28upx;
flex-wrap: wrap;
justify-content: flex-end;
.btn {
width: 180upx;
height: 56upx;
background: #FFFFFF;
border-radius: 50px 50px 50px 50px;
opacity: 1;
font-size: 14px;
line-height: 56upx;
text-align: center;
margin-left: 12upx;
}
.info {
border: 1px solid #9F9F9F;
color: #8B8B8B;
}
.primary {
border: 1px solid #F63116;
color: #F83F11;
11 months ago
}
}
}
}
.filterContent {
padding: 32upx;
.filterTitle {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
text-align: center;
}
.filterItem {
.filterItemContent {
margin-top: 40upx;
.itemTitle {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
margin-bottom: 20upx;
}
.timeContainer {
11 months ago
display: flex;
align-items: center;
justify-content: center;
::v-deep .uni-input-wrapper {
background: #F3F3F3;
border-radius: 22px 22px 22px 22px;
opacity: 1;
text-align: center;
}
::v-deep .u-input__right-icon {
display: none;
}
text {
margin: 16upx;
}
}
.selectContainer {
display: flex;
.selectItem {
flex: 1;
margin: 0 10upx;
height: 70upx;
line-height: 66upx;
text-align: center;
background: #F3F3F3;
border-radius: 22px 22px 22px 22px;
opacity: 1;
font-size: 28upx;
11 months ago
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #A1A1A1;
}
.active {
border: 1px solid #F83F11;
11 months ago
color: #F21A1C;
background-color: #fff;
11 months ago
}
}
}
}
.btnGroup {
display: flex;
justify-content: center;
margin-top: 100upx;
padding-bottom: 60upx;
.resetBtn {
width: 216upx;
height: 70upx;
line-height: 66upx;
background: #DBDBDB;
border-radius: 22px 22px 22px 22px;
opacity: 1;
11 months ago
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #585858;
text-align: center;
11 months ago
}
.confrim {
width: 216upx;
height: 70upx;
text-align: center;
background: linear-gradient(180deg, #FD5D06 0%, #F3211A 100%);
border-radius: 50px 50px 50px 50px;
opacity: 1;
line-height: 66upx;
11 months ago
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-left: 24upx;
11 months ago
}
}
}
.afterSales {
padding: 0 32rpx 32rpx 32upx;
.c {
overflow: hidden;
.slot-btn {
width: 180rpx;
height: 180rpx;
background: #F6F6F6;
border-radius: 10rpx;
border: 1px solid #C0C0C0;
11 months ago
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: #6D6D6D;
.l {
line-height: 30rpx;
}
image {
width: 50rpx;
height: 50rpx;
display: block;
margin: 0 auto;
margin-top: 30rpx;
}
11 months ago
}
.itemTitle {
height: 104rpx;
line-height: 104rpx;
11 months ago
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
::v-deep .u-input {
height: 160upx;
background: #F7F8FA;
border-radius: 3px 3px 3px 3px;
11 months ago
opacity: 1;
11 months ago
}
::v-deep .u-input__textarea {
padding: 20upx;
11 months ago
}
text {
11 months ago
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #B5B5B5;
11 months ago
}
}
.filterTitle {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
text-align: center;
height: 104rpx;
line-height: 104rpx;
border-bottom: 1rpx solid #EAEAEA;
11 months ago
}
}
.filterTitle {
font-size: 32upx;
11 months ago
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
11 months ago
text-align: center;
height: 104rpx;
line-height: 104rpx;
border-bottom: 1rpx solid #EAEAEA;
11 months ago
}
.filterItem {
.filterItemContent {
.itemTitle {
height: 104rpx;
line-height: 104rpx;
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
text {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #B5B5B5;
}
}
}
::v-deep .u-input {
height: 160upx;
background: #F7F8FA;
border-radius: 3px 3px 3px 3px;
opacity: 1;
}
::v-deep .u-input__textarea {
padding: 20upx;
}
}
.submit {
width: 100%;
height: 100rpx;
background: #FF6257;
border-radius: 6px 6px 6px 6px;
11 months ago
opacity: 1;
line-height: 100rpx;
11 months ago
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-top: 40upx;
text-align: center;
11 months ago
}
}
</style>