parent
c83c98b598
commit
0bc8344505
|
@ -2,35 +2,41 @@
|
||||||
<view>
|
<view>
|
||||||
<view class='return-list pad30' v-if="orderList.length">
|
<view class='return-list pad30' v-if="orderList.length">
|
||||||
<view class='goodWrapper borRadius14' v-for="(item,index) in orderList" :key="index" @click='goOrderDetails(item.orderId)'>
|
<view class='goodWrapper borRadius14' v-for="(item,index) in orderList" :key="index" @click='goOrderDetails(item.orderId)'>
|
||||||
<view class='iconfont icon-tuikuanzhong powder' v-if="item.refundStatus==1 || item.refundStatus==3"></view>
|
<!-- 根据状态,展示 icon -->
|
||||||
<view class='iconfont icon-yituikuan' v-if="item.refundStatus==2"></view>
|
<!-- TODO 芋艿:需要优化下 icon,目前没展示出来 -->
|
||||||
<view class='orderNum'>订单号:{{item.orderId}}</view>
|
<view class='iconfont icon-shenqingzhong powder' v-if="[10].includes(item.status)" />
|
||||||
<view class='item acea-row row-between-wrapper' v-for="(items,index) in item.orderInfoList" :key="index">
|
<view class='iconfont icon-daituihuo1 powder' v-if="[20, 30].includes(item.status)"></view>
|
||||||
|
<view class='iconfont icon-tuikuanzhong powder' v-if="[40].includes(item.status)"></view>
|
||||||
|
<view class='iconfont icon-yituikuan' v-if="[50].includes(item.status)"></view>
|
||||||
|
<view class='iconfont icon-yijujue' v-if="[61, 62, 63].includes(item.status)"></view>
|
||||||
|
<!-- 展示信息 -->
|
||||||
|
<view class='orderNum'>订单号:{{ item.no }}</view>
|
||||||
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view class='pictrue'>
|
<view class='pictrue'>
|
||||||
<image :src='items.image'></image>
|
<image :src='item.picUrl'></image>
|
||||||
</view>
|
</view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='acea-row row-between-wrapper'>
|
<view class='acea-row row-between-wrapper'>
|
||||||
<view class='name line1'>{{items.storeName}}</view>
|
<view class='name line1'>{{ item.spuName }}</view>
|
||||||
<view class='num'>x {{items.cartNum}}</view>
|
<view class='num'>x {{ item.count }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='attr line1' v-if="items.suk">{{items.suk}}</view>
|
<view class='attr line1' v-if="item.properties">
|
||||||
<view class='attr line1' v-else>{{items.storeName}}</view>
|
<text v-for="property in item.properties" style="padding-left: 2px">{{property.valueName}}</text>
|
||||||
<view class='money'>¥{{items.price}}</view>
|
</view>
|
||||||
|
<view class='money'>
|
||||||
|
¥ {{ (item.refundPrice / 100.0).toFixed(2) }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='totalSum'>共{{item.totalNum || 0}}件商品,总金额 <text class='font-color price'>¥{{item.payPrice}}</text></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 底部,加载中 -->
|
||||||
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length">
|
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length">
|
||||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
<text class='loading iconfont icon-jiazai' :hidden='!loading' /> {{loadTitle}}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="orderList.length == 0">
|
<view v-if="orderList.length === 0">
|
||||||
<emptyPage title="暂无订单~"></emptyPage>
|
<emptyPage title="暂无订单~"></emptyPage>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef MP -->
|
|
||||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
|
||||||
<!-- #endif -->
|
|
||||||
<home></home>
|
<home></home>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -38,25 +44,13 @@
|
||||||
<script>
|
<script>
|
||||||
import home from '@/components/home';
|
import home from '@/components/home';
|
||||||
import emptyPage from '@/components/emptyPage.vue'
|
import emptyPage from '@/components/emptyPage.vue'
|
||||||
import {
|
import { toLogin } from '@/libs/login.js';
|
||||||
getOrderList
|
import { mapGetters } from "vuex";
|
||||||
} from '@/api/order.js';
|
import * as AfterSaleApi from '@/api/trade/afterSale.js';
|
||||||
import {
|
|
||||||
toLogin
|
|
||||||
} from '@/libs/login.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
// #ifdef MP
|
|
||||||
import authorize from '@/components/Authorize';
|
|
||||||
// #endif
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
emptyPage,
|
emptyPage,
|
||||||
home,
|
home
|
||||||
// #ifdef MP
|
|
||||||
authorize
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -64,7 +58,6 @@
|
||||||
loadend: false,
|
loadend: false,
|
||||||
loadTitle: '加载更多', //提示语
|
loadTitle: '加载更多', //提示语
|
||||||
orderList: [], //订单数组
|
orderList: [], //订单数组
|
||||||
orderStatus: -3, //订单状态
|
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
isAuto: false, //没有授权的不会自动授权
|
isAuto: false, //没有授权的不会自动授权
|
||||||
|
@ -73,9 +66,9 @@
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin']),
|
computed: mapGetters(['isLogin']),
|
||||||
watch:{
|
watch:{
|
||||||
isLogin:{
|
isLogin: {
|
||||||
handler:function(newV,oldV){
|
handler: function(newV, oldV) {
|
||||||
if(newV){
|
if ( newV) {
|
||||||
this.getOrderList();
|
this.getOrderList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -83,11 +76,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (this.isLogin) {
|
if (!this.isLogin) {
|
||||||
this.getOrderList();
|
toLogin();
|
||||||
} else {
|
return;
|
||||||
toLogin();
|
|
||||||
}
|
}
|
||||||
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
|
@ -99,17 +92,16 @@
|
||||||
onLoadFun() {
|
onLoadFun() {
|
||||||
this.getOrderList();
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
// 授权关闭
|
|
||||||
authColse: function(e) {
|
|
||||||
this.isShowAuth = e
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* 去订单详情
|
* 去订单详情
|
||||||
*/
|
*/
|
||||||
goOrderDetails: function(order_id) {
|
goOrderDetails: function(order_id) {
|
||||||
if (!order_id) return that.$util.Tips({
|
if (!order_id) {
|
||||||
title: '缺少订单号无法查看订单详情'
|
return that.$util.Tips({
|
||||||
});
|
title: '缺少订单号无法查看订单详情'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// TODO 芋艿:跳转到详情
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/order_details/index?order_id=' + order_id + '&isReturen=1'
|
url: '/pages/order_details/index?order_id=' + order_id + '&isReturen=1'
|
||||||
})
|
})
|
||||||
|
@ -119,33 +111,31 @@
|
||||||
* 获取订单列表
|
* 获取订单列表
|
||||||
*/
|
*/
|
||||||
getOrderList: function() {
|
getOrderList: function() {
|
||||||
let that = this;
|
if (this.loadend || this.loading) {
|
||||||
if (that.loadend) return;
|
return;
|
||||||
if (that.loading) return;
|
}
|
||||||
that.loading = true;
|
this.loading = true;
|
||||||
that.loadTitle = "";
|
this.loadTitle = "";
|
||||||
getOrderList({
|
AfterSaleApi.getAfterSalePage({
|
||||||
type: that.orderStatus,
|
pageNo: this.page,
|
||||||
page: that.page,
|
pageSize: this.limit,
|
||||||
limit: that.limit,
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let list = res.data.list || [];
|
let list = res.data.list || [];
|
||||||
let loadend = list.length < that.limit;
|
let loadend = list.length < this.limit;
|
||||||
that.orderList = that.$util.SplitArray(list, that.orderList);
|
this.orderList = this.$util.SplitArray(list, this.orderList);
|
||||||
that.$set(that,'orderList',that.orderList);
|
this.$set(this,'orderList', this.orderList);
|
||||||
that.loadend = loadend;
|
this.loadend = loadend;
|
||||||
that.loading = false;
|
this.loading = false;
|
||||||
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
|
this.loadTitle = loadend ? "我也是有底线的" : '加载更多';
|
||||||
that.page = that.page + 1;
|
this.page = this.page + 1;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
that.loading = false;
|
this.loading = false;
|
||||||
that.loadTitle = "加载更多";
|
this.loadTitle = "加载更多";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.return-list .goodWrapper {
|
.return-list .goodWrapper {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* @font-face {
|
/* @font-face {
|
||||||
font-family: "iconfont";
|
font-family: "iconfont";
|
||||||
src: url('iconfont.woff2?t=1620706240621') format('woff2'),
|
src: url('iconfont.woff2?t=1620706240621') format('woff2'),
|
||||||
url('iconfont.woff?t=1620706240621') format('woff'),
|
url('iconfont.woff?t=1620706240621') format('woff'),
|
||||||
url('iconfont.ttf?t=1620706240621') format('truetype');
|
url('iconfont.ttf?t=1620706240621') format('truetype');
|
||||||
|
@ -19,6 +19,14 @@
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-shenqingzhong:before {
|
||||||
|
content: "\e756";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-daituihuo1:before {
|
||||||
|
content: "\e752";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-yijujue:before {
|
.icon-yijujue:before {
|
||||||
content: "\e741";
|
content: "\e741";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue