parent
06ab086b9b
commit
455ad609ea
@ -1,263 +1,340 @@ |
|||||||
<template> |
<template> |
||||||
<view class="container" :style="appThemeStyle"> |
<view class="container" :style="appThemeStyle"> |
||||||
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" |
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" |
||||||
@up="upCallback"> |
@down="downCallback" :up="upOption" @up="upCallback"> |
||||||
|
|
||||||
<!-- tab栏 --> |
<!-- tab栏 --> |
||||||
<u-tabs :list="tabs" :is-scroll="false" :current="curTab" :active-color="appTheme.mainBg" :duration="0.2" @change="onChangeTab" /> |
<!-- <u-tabs :list="tabs" :is-scroll="false" :current="curTab" :active-color="appTheme.mainBg" :duration="0.2" |
||||||
|
@change="onChangeTab" /> --> |
||||||
<!-- 退款/售后单 --> |
<view class="container"> |
||||||
<view class="widget-list"> |
<view class="classify-list"> |
||||||
<view class="widget-detail" v-if="list.data.length>0" v-for="(item, index) in list.data" :key="index"> |
<view class="list" v-for="(item,index) in tabs" :class="{'action':curTab==index}" |
||||||
<view class="row-block dis-flex flex-y-center"> |
@click="onChangeTab(index)" :key="index"> |
||||||
<view class="flex-box">{{ item.create_time }}</view> |
<text>{{item.name}}</text> |
||||||
<view class="flex-box t-r"> |
<text class="line" v-show="curTab==index"></text> |
||||||
<text class="col-m">{{ item.state_text }}</text> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="detail-goods row-block dis-flex" @click.stop="handleTargetDetail(item.order_refund_id)"> |
<!-- 退款/售后单 --> |
||||||
<view class="goods-image"> |
<view class="widget-list"> |
||||||
<image class="image" :src="item.orderGoods.goods_image" mode="aspectFit"></image> |
<view class="widget-detail" v-if="list.data.length>0" v-for="(item, index) in list.data" :key="index"> |
||||||
</view> |
<view class="row-block dis-flex flex-y-center"> |
||||||
<view class="goods-right flex-box"> |
<view class="flex-box">{{ item.create_time }}</view> |
||||||
<view class="goods-name"> |
<view class="flex-box t-r"> |
||||||
<text class="twoline-hide">{{ item.orderGoods.goods_name }}</text> |
<text class="col-m">{{ item.state_text }}</text> |
||||||
</view> |
</view> |
||||||
<view class="goods-props clearfix"> |
</view> |
||||||
<view class="goods-props-item" v-for="(props, idx) in item.orderGoods.goods_props" :key="idx"> |
<view class="detail-goods row-block dis-flex" |
||||||
<text>{{ props.value.name }}</text> |
@click.stop="handleTargetDetail(item.order_refund_id)"> |
||||||
</view> |
<view class="goods-image"> |
||||||
</view> |
<image class="image" :src="item.orderGoods.goods_image" mode="aspectFit"></image> |
||||||
<view class="goods-num t-r"> |
</view> |
||||||
<text class="f-26 col-8">×{{ item.orderGoods.total_num }}</text> |
<view class="goods-right flex-box"> |
||||||
</view> |
<view class="goods-name"> |
||||||
</view> |
<text class="twoline-hide">{{ item.orderGoods.goods_name }}</text> |
||||||
</view> |
</view> |
||||||
<view class="detail-order row-block"> |
<view class="goods-props clearfix"> |
||||||
<view class="item dis-flex flex-x-end flex-y-center"> |
<view class="goods-props-item" v-for="(props, idx) in item.orderGoods.goods_props" |
||||||
<text class="">付款金额:</text> |
:key="idx"> |
||||||
<text class="col-m">¥{{ item.orderGoods.total_pay_price }}</text> |
<text>{{ props.value.name }}</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="detail-operate row-block dis-flex flex-x-end flex-y-center"> |
<view class="goods-num t-r"> |
||||||
<view class="detail-btn btn-detail" @click.stop="handleTargetDetail(item.order_refund_id)">查看详情</view> |
<text class="f-26 col-8">×{{ item.orderGoods.total_num }}</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<u-empty text="暂无数据显示哦~" v-else mode="list"></u-empty> |
</view> |
||||||
</view> |
<view class="detail-order row-block"> |
||||||
|
<view class="item dis-flex flex-x-end flex-y-center"> |
||||||
</mescroll-body> |
<text class="">付款金额:</text> |
||||||
|
<text class="col-m">¥{{ item.orderGoods.total_pay_price }}</text> |
||||||
</view> |
</view> |
||||||
|
</view> |
||||||
|
<view class="detail-operate row-block dis-flex flex-x-end flex-y-center"> |
||||||
|
<view class="detail-btn btn-detail" @click.stop="handleTargetDetail(item.order_refund_id)">查看详情 |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<u-empty text="暂无数据显示哦~" v-else mode="list"></u-empty> |
||||||
|
</view> |
||||||
|
|
||||||
|
</mescroll-body> |
||||||
|
|
||||||
|
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins' |
import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins' |
||||||
import { getEmptyPaginateObj, getMoreListData } from '@/core/app' |
import { |
||||||
import * as RefundApi from '@/api/refund' |
getEmptyPaginateObj, |
||||||
|
getMoreListData |
||||||
// 每页记录数量 |
} from '@/core/app' |
||||||
const pageSize = 15 |
import * as RefundApi from '@/api/refund' |
||||||
|
|
||||||
// tab栏数据 |
// 每页记录数量 |
||||||
const tabs = [{ |
const pageSize = 15 |
||||||
name: '全部', |
|
||||||
value: -1 |
// tab栏数据 |
||||||
}, { |
const tabs = [{ |
||||||
name: '待处理', |
name: '全部', |
||||||
value: 0 |
value: -1 |
||||||
}] |
}, { |
||||||
|
name: '待处理', |
||||||
export default { |
value: 0 |
||||||
mixins: [MescrollMixin], |
}] |
||||||
data() { |
|
||||||
return { |
export default { |
||||||
// 订单列表数据 |
mixins: [MescrollMixin], |
||||||
list: getEmptyPaginateObj(), |
data() { |
||||||
// tabs栏数据 |
return { |
||||||
tabs, |
// 订单列表数据 |
||||||
// 当前标签索引 |
list: getEmptyPaginateObj(), |
||||||
curTab: 0, |
// tabs栏数据 |
||||||
// 上拉加载配置 |
tabs, |
||||||
upOption: { |
// 当前标签索引 |
||||||
// 首次自动执行 |
curTab: 0, |
||||||
auto: true, |
// 上拉加载配置 |
||||||
// 每页数据的数量; 默认10 |
upOption: { |
||||||
page: { size: pageSize }, |
// 首次自动执行 |
||||||
// 数量要大于2条才显示无更多数据 |
auto: true, |
||||||
noMoreSize: 2, |
// 每页数据的数量; 默认10 |
||||||
// 空布局 |
page: { |
||||||
empty: { |
size: pageSize |
||||||
tip: '亲,暂无售后单记录' |
}, |
||||||
} |
// 数量要大于2条才显示无更多数据 |
||||||
}, |
noMoreSize: 2, |
||||||
// 控制首次触发onShow事件时不刷新列表 |
// 空布局 |
||||||
canReset: false, |
empty: { |
||||||
} |
tip: '亲,暂无售后单记录' |
||||||
}, |
} |
||||||
|
}, |
||||||
/** |
// 控制首次触发onShow事件时不刷新列表 |
||||||
* 生命周期函数--监听页面加载 |
canReset: false, |
||||||
*/ |
} |
||||||
onLoad(options) { |
}, |
||||||
|
onUnload() { |
||||||
}, |
uni.switchTab({ |
||||||
|
url: '/pages/user/index' // targetTab 为目标 tab 页的路径 |
||||||
/** |
}) |
||||||
* 生命周期函数--监听页面显示 |
}, |
||||||
*/ |
/** |
||||||
onShow() { |
* 生命周期函数--监听页面加载 |
||||||
this.canReset && this.onRefreshList() |
*/ |
||||||
this.canReset = true |
onLoad(options) { |
||||||
}, |
|
||||||
|
}, |
||||||
methods: { |
|
||||||
|
/** |
||||||
/** |
* 生命周期函数--监听页面显示 |
||||||
* 上拉加载的回调 (页面初始化时也会执行一次) |
*/ |
||||||
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 |
onShow() { |
||||||
* @param {Object} page |
this.canReset && this.onRefreshList() |
||||||
*/ |
this.canReset = true |
||||||
upCallback(page) { |
}, |
||||||
const app = this |
|
||||||
// 设置列表数据 |
methods: { |
||||||
app.getRefundList(page.num) |
|
||||||
.then(list => { |
/** |
||||||
const curPageLen = list.data.length |
* 上拉加载的回调 (页面初始化时也会执行一次) |
||||||
const totalSize = list.data.total |
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 |
||||||
app.mescroll.endBySize(curPageLen, totalSize) |
* @param {Object} page |
||||||
}) |
*/ |
||||||
.catch(() => app.mescroll.endErr()) |
upCallback(page) { |
||||||
}, |
const app = this |
||||||
|
// 设置列表数据 |
||||||
// 获取退款/售后单列表 |
app.getRefundList(page.num) |
||||||
getRefundList(pageNo = 1) { |
.then(list => { |
||||||
const app = this |
const curPageLen = list.data.length |
||||||
return new Promise((resolve, reject) => { |
const totalSize = list.data.total |
||||||
RefundApi.list({ state: app.getTabValue(), page: pageNo }, { load: false }) |
app.mescroll.endBySize(curPageLen, totalSize) |
||||||
.then(result => { |
}) |
||||||
// 合并新数据 |
.catch(() => app.mescroll.endErr()) |
||||||
const newList = result.data.list |
}, |
||||||
app.list.data = getMoreListData(newList, app.list, pageNo) |
|
||||||
resolve(newList) |
// 获取退款/售后单列表 |
||||||
}) |
getRefundList(pageNo = 1) { |
||||||
}) |
const app = this |
||||||
}, |
return new Promise((resolve, reject) => { |
||||||
|
RefundApi.list({ |
||||||
// 切换标签项 |
state: app.getTabValue(), |
||||||
onChangeTab(index) { |
page: pageNo |
||||||
const app = this |
}, { |
||||||
// 设置当前选中的标签 |
load: false |
||||||
app.curTab = index |
}) |
||||||
// 刷新售后单列表 |
.then(result => { |
||||||
app.onRefreshList() |
// 合并新数据 |
||||||
}, |
const newList = result.data.list |
||||||
|
app.list.data = getMoreListData(newList, app.list, pageNo) |
||||||
// 刷新订单列表 |
resolve(newList) |
||||||
onRefreshList() { |
}) |
||||||
this.list = getEmptyPaginateObj() |
}) |
||||||
setTimeout(() => { |
}, |
||||||
this.mescroll.resetUpScroll() |
|
||||||
}, 120) |
// 切换标签项 |
||||||
}, |
onChangeTab(index) { |
||||||
|
console.log(index) |
||||||
// 获取当前标签项的值 |
const app = this |
||||||
getTabValue() { |
// 设置当前选中的标签 |
||||||
return this.tabs[this.curTab].value |
app.curTab = index |
||||||
}, |
// 刷新售后单列表 |
||||||
|
app.onRefreshList() |
||||||
// 跳转到售后单详情页 |
}, |
||||||
handleTargetDetail(orderRefundId) { |
|
||||||
this.$navTo('pages/refund/detail', { orderRefundId }) |
// 刷新订单列表 |
||||||
}, |
onRefreshList() { |
||||||
|
this.list = getEmptyPaginateObj() |
||||||
} |
setTimeout(() => { |
||||||
} |
this.mescroll.resetUpScroll() |
||||||
|
}, 120) |
||||||
|
}, |
||||||
|
|
||||||
|
// 获取当前标签项的值 |
||||||
|
getTabValue() { |
||||||
|
return this.tabs[this.curTab].value |
||||||
|
}, |
||||||
|
|
||||||
|
// 跳转到售后单详情页 |
||||||
|
handleTargetDetail(orderRefundId) { |
||||||
|
this.$navTo('pages/refund/detail', { |
||||||
|
orderRefundId |
||||||
|
}) |
||||||
|
}, |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||||
::v-deep .u-empty { |
::v-deep .u-empty { |
||||||
padding: 100rpx 0; |
padding: 100rpx 0; |
||||||
} |
} |
||||||
.widget-detail { |
|
||||||
box-sizing: border-box; |
.classify-list { |
||||||
background: #fff; |
white-space: nowrap; |
||||||
margin: 20rpx 20rpx 0 20rpx; |
width: 100%; |
||||||
border-radius: 24rpx; |
height: 100rpx; |
||||||
|
overflow-x: auto; |
||||||
.row-block { |
overflow-y: hidden; |
||||||
padding: 0 20rpx; |
|
||||||
min-height: 70rpx; |
.list { |
||||||
} |
position: relative; |
||||||
|
display: inline-block; |
||||||
.detail-goods { |
width: 50%; |
||||||
padding: 20rpx; |
height: 100%; |
||||||
|
line-height: 100rpx; |
||||||
.goods-image { |
text-align: center; |
||||||
margin-right: 20rpx; |
|
||||||
|
text { |
||||||
.image { |
font-size: 28rpx; |
||||||
display: block; |
color: #3B3B3B; |
||||||
width: 200rpx; |
|
||||||
height: 200rpx; |
} |
||||||
} |
|
||||||
} |
.line { |
||||||
|
position: absolute; |
||||||
.goods-right { |
left: 50%; |
||||||
padding: 15rpx 0; |
bottom: 10rpx; |
||||||
} |
// width: 60%; |
||||||
|
// height: 8rpx; |
||||||
.goods-name { |
background: linear-gradient(to right, #f8f893, #fe9d00); |
||||||
margin-bottom: 10rpx; |
// border-radius: 10rpx; |
||||||
} |
transform: translate(-50%, 0); |
||||||
|
|
||||||
|
width: 60upx; |
||||||
.goods-props { |
height: 8upx; |
||||||
margin-top: 14rpx; |
background: #FF6257; |
||||||
height: 40rpx; |
border-radius: 29px 29px 29px 29px; |
||||||
color: #ababab; |
opacity: 1; |
||||||
font-size: 24rpx; |
} |
||||||
overflow: hidden; |
} |
||||||
|
|
||||||
.goods-props-item { |
.action { |
||||||
display: inline-block; |
text { |
||||||
margin-right: 14rpx; |
font-size: 32rpx; |
||||||
padding: 4rpx 16rpx; |
opacity: 1; |
||||||
border-radius: 12rpx; |
} |
||||||
background-color: #F5F5F5; |
} |
||||||
width: auto; |
} |
||||||
} |
|
||||||
} |
.widget-detail { |
||||||
|
box-sizing: border-box; |
||||||
} |
background: #fff; |
||||||
|
margin: 20rpx 20rpx 0 20rpx; |
||||||
.detail-operate { |
border-radius: 24rpx; |
||||||
padding-bottom: 20rpx; |
|
||||||
|
.row-block { |
||||||
.detail-btn { |
padding: 0 20rpx; |
||||||
border-radius: 4px; |
min-height: 70rpx; |
||||||
border: 1rpx solid #ccc; |
} |
||||||
padding: 8rpx 20rpx; |
|
||||||
font-size: 28rpx; |
.detail-goods { |
||||||
color: #555; |
padding: 20rpx; |
||||||
margin-left: 10rpx; |
|
||||||
} |
.goods-image { |
||||||
} |
margin-right: 20rpx; |
||||||
|
|
||||||
.detail-order { |
.image { |
||||||
padding: 10rpx 20rpx; |
display: block; |
||||||
font-size: 28rpx; |
width: 200rpx; |
||||||
height: 50rpx; |
height: 200rpx; |
||||||
display: flex; |
} |
||||||
align-items: center; |
} |
||||||
|
|
||||||
.item { |
.goods-right { |
||||||
margin-bottom: 10rpx; |
padding: 15rpx 0; |
||||||
|
} |
||||||
&:last-child { |
|
||||||
margin-bottom: 0; |
.goods-name { |
||||||
} |
margin-bottom: 10rpx; |
||||||
} |
} |
||||||
} |
|
||||||
} |
|
||||||
|
.goods-props { |
||||||
|
margin-top: 14rpx; |
||||||
|
height: 40rpx; |
||||||
|
color: #ababab; |
||||||
|
font-size: 24rpx; |
||||||
|
overflow: hidden; |
||||||
|
|
||||||
|
.goods-props-item { |
||||||
|
display: inline-block; |
||||||
|
margin-right: 14rpx; |
||||||
|
padding: 4rpx 16rpx; |
||||||
|
border-radius: 12rpx; |
||||||
|
background-color: #F5F5F5; |
||||||
|
width: auto; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
.detail-operate { |
||||||
|
padding-bottom: 20rpx; |
||||||
|
|
||||||
|
.detail-btn { |
||||||
|
border-radius: 4px; |
||||||
|
border: 1rpx solid #ccc; |
||||||
|
padding: 8rpx 20rpx; |
||||||
|
font-size: 28rpx; |
||||||
|
color: #555; |
||||||
|
margin-left: 10rpx; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.detail-order { |
||||||
|
padding: 10rpx 20rpx; |
||||||
|
font-size: 28rpx; |
||||||
|
height: 50rpx; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
|
||||||
|
.item { |
||||||
|
margin-bottom: 10rpx; |
||||||
|
|
||||||
|
&:last-child { |
||||||
|
margin-bottom: 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue