|
@@ -1,6 +1,52 @@
|
|
<template>
|
|
<template>
|
|
<mobile-frame>
|
|
<mobile-frame>
|
|
- 售后列表
|
|
|
|
|
|
+ <view class="main">
|
|
|
|
+ <view class="one">
|
|
|
|
+ <input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索商品">
|
|
|
|
+ </view>
|
|
|
|
+ <view class="two">
|
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
|
|
+ <view class="list-scroll-view">
|
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
|
+ <view class="list_1">
|
|
|
|
+ <view class="shopname">
|
|
|
|
+ <text class="iconfont icon-shangdian"></text>
|
|
|
|
+ <text>{{item.shop.name}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="type">
|
|
|
|
+ {{item.type=='0'?'退款':item.type=='1'?'换货':'维修'}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list_2">
|
|
|
|
+ <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''" mode="">
|
|
|
|
+ </image>
|
|
|
|
+ <view class="other">
|
|
|
|
+ <view class="name">
|
|
|
|
+ {{item.goods.goods.name||'暂无'}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ 商品规格:<text>{{item.goods.name||'暂无'}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ 退款:<text>¥{{item.result.money||'暂无'}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ 申请时间:<text>{{item.apply_time||'暂无'}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ 售后描述:<text>{{item.desc||'暂无'}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="btn">
|
|
|
|
+ <button type="default" size="mini" @click="toCancel(item)">取消售后</button>
|
|
|
|
+ <button v-if="item.type!='0'" type="default" size="mini" @click="toRevise(item)">维护信息</button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</mobile-frame>
|
|
</mobile-frame>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -8,16 +54,219 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
|
|
+ user: {},
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ skip: 0,
|
|
|
|
+ limit: 5,
|
|
|
|
+ page: 0
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- onShow: function() {},
|
|
|
|
|
|
+ onShow: function() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.clearPage();
|
|
|
|
+ that.watchLogin();
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+ // 维护信息
|
|
|
|
+ toRevise(e) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesMy/order/detail?id=${e.id||e._id}`
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 取消售后
|
|
|
|
+ toCancel(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确定删除售后申请吗?',
|
|
|
|
+ success: async function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ const arr = await that.$api(`/afterSale/${e._id}`, 'DELETE');
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '删除售后成功',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ that.clearPage();
|
|
|
|
+ that.search();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: arr.errmsg,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 监听用户是否登录
|
|
|
|
+ watchLogin() {
|
|
|
|
+ const that = this;
|
|
|
|
+ uni.getStorage({
|
|
|
|
+ key: 'token',
|
|
|
|
+ success: function(res) {
|
|
|
|
+ let user = that.$jwt(res.data);
|
|
|
|
+ if (user) that.$set(that, `user`, user);
|
|
|
|
+ that.search();
|
|
|
|
+ },
|
|
|
|
+ fail: function(err) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pages/login/index`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 查询列表
|
|
|
|
+ async search() {
|
|
|
|
+ const that = this;
|
|
|
|
+ let user = that.user;
|
|
|
|
+ const arr = await that.$api(`/afterSale`, 'GET', {
|
|
|
|
+ customer: user._id
|
|
|
|
+ });
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ let list = [...that.list, ...arr.data];
|
|
|
|
+ that.$set(that, `list`, list)
|
|
|
|
+ that.$set(that, `total`, arr.total)
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: arr.errmsg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 分页
|
|
|
|
+ toPage(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ let list = that.list;
|
|
|
|
+ let limit = that.limit;
|
|
|
|
+ if (that.total > list.length) {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中',
|
|
|
|
+ mask: true
|
|
|
|
+ })
|
|
|
|
+ let page = that.page + 1;
|
|
|
|
+ that.$set(that, `page`, page)
|
|
|
|
+ let skip = page * limit;
|
|
|
|
+ that.$set(that, `skip`, skip)
|
|
|
|
+ that.search();
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ } else uni.showToast({
|
|
|
|
+ title: '没有更多数据了'
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 清空列表
|
|
|
|
+ clearPage() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.$set(that, `list`, [])
|
|
|
|
+ that.$set(that, `skip`, 0)
|
|
|
|
+ that.$set(that, `limit`, 5)
|
|
|
|
+ that.$set(that, `page`, 0)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
|
+ .main {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ width: 100vw;
|
|
|
|
+ height: 100vh;
|
|
|
|
+
|
|
|
|
+ .one {
|
|
|
|
+ border-bottom: 1px solid var(--f85Color);
|
|
|
|
+ padding: 2vw;
|
|
|
|
+
|
|
|
|
+ input {
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ background-color: var(--f1Color);
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .two {
|
|
|
|
+ position: relative;
|
|
|
|
+ flex-grow: 1;
|
|
|
|
+ background-color: var(--f9Color);
|
|
|
|
+
|
|
|
|
+ .list {
|
|
|
|
+ margin: 2vw;
|
|
|
|
+ background-color: var(--fffColor);
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ width: 92vw;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+
|
|
|
|
+ .list_1 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ font-size: var(--font16Size);
|
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
|
+
|
|
|
|
+ .shopname {
|
|
|
|
+ text {
|
|
|
|
+ margin: 0 0 0 1vw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .type {
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .list_2 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ .image {
|
|
|
|
+ width: 25vw;
|
|
|
|
+ height: 25vw;
|
|
|
|
+ margin: 0 2vw 1vw 0;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ .other {
|
|
|
|
+ flex-grow: 1;
|
|
|
|
+
|
|
|
|
+ .name {
|
|
|
|
+ font-size: var(--font16Size);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .other_1 {
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+
|
|
|
|
+ text {
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .btn {
|
|
|
|
+ text-align: right;
|
|
|
|
+
|
|
|
|
+ button {
|
|
|
|
+ margin: 2vw 0 0 2vw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .list:nth-child(2n) {
|
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .scroll-view {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+
|
|
|
|
+ .list-scroll-view {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|