|
@@ -1,4 +1,5 @@
|
|
|
<template>
|
|
|
+ <!-- #ifdef H5 -->
|
|
|
<view>
|
|
|
<zj-page-layout
|
|
|
:hasFooter="false"
|
|
@@ -11,8 +12,8 @@
|
|
|
<u-tabs
|
|
|
:scrollable="false"
|
|
|
:list="tabList"
|
|
|
- :current="curTab"
|
|
|
- @click="changeTab"
|
|
|
+ :current="tabCurrent"
|
|
|
+ @click="clickTab"
|
|
|
lineColor="#01C30B"
|
|
|
:activeStyle="{
|
|
|
color: '#01C30B'
|
|
@@ -26,32 +27,34 @@
|
|
|
</template>
|
|
|
|
|
|
<view class="common-order-list">
|
|
|
- <view class="item" @tap="$navPage(`/pages/mine/myBuy/detail`)">
|
|
|
+ <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
|
|
|
<view class="top">
|
|
|
<image src="@/static/common/logo.png"></image>
|
|
|
<view class="user">
|
|
|
- <view class="name">李海</view>
|
|
|
- <view class="time">21小时前发布</view>
|
|
|
+ <view class="name">{{item.userName}}</view>
|
|
|
+ <view class="time">{{item.goodsCreateTime}}</view>
|
|
|
</view>
|
|
|
- <view class="status">待付款</view>
|
|
|
+ <view class="status">{{item.status | statusFilter}}</view>
|
|
|
</view>
|
|
|
<view class="goods">
|
|
|
- <image src="@/static/user/other_book.png"></image>
|
|
|
+ <image :src="imageUrl + item.goodsPicUrl"></image>
|
|
|
<view class="main">
|
|
|
- <view class="name">商品名称</view>
|
|
|
- <view class="des">商品描述</view>
|
|
|
- <view class="price"><text>¥18.00</text>x2</view>
|
|
|
+ <view class="name">{{item.title}}</view>
|
|
|
+ <view class="des">{{item.content}}</view>
|
|
|
+ <view class="price"><text>{{item.amount | priceFilter2}}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="bottom">
|
|
|
- <view class="left-location"><text class="iconfont icon-dingwei"></text>天河区棠下</view>
|
|
|
+ <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
|
|
|
<view class="right-btn" @tap.stop>
|
|
|
- <u-button text="确认发货" shape="circle" @click="openDeliver()"></u-button>
|
|
|
+ <u-button text="确认发货" shape="circle" @click="openDeliver(item.id)"></u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <Loading :loadStatus="loadStatus" :dataList="dataList" />
|
|
|
+
|
|
|
</zj-page-layout>
|
|
|
|
|
|
<zj-dialog-deliver
|
|
@@ -60,9 +63,14 @@
|
|
|
@close="isShowDeliverDialog = false">
|
|
|
</zj-dialog-deliver>
|
|
|
</view>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifndef H5 -->
|
|
|
+ <web-view :src="webViewHref('/pages/mine/myIssue/list')"></web-view>
|
|
|
+ <!-- #endif -->
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script>
|
|
|
+ // #ifdef H5
|
|
|
import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
|
|
|
|
|
|
export default {
|
|
@@ -70,33 +78,63 @@
|
|
|
zjDialogDeliver
|
|
|
},
|
|
|
|
|
|
+ filters: {
|
|
|
+ statusFilter(val) {
|
|
|
+ const MAP = {
|
|
|
+ 1: '上架中',
|
|
|
+ 2: '已转让',
|
|
|
+ 0: '已下架',
|
|
|
+ 3: '已冻结',
|
|
|
+ 4: '已卖出',
|
|
|
+ }
|
|
|
+ return MAP[val];
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
data() {
|
|
|
return {
|
|
|
- imgUrl: this.$imageUrl,
|
|
|
+ imageUrl: this.$imageUrl,
|
|
|
tabList: [
|
|
|
- {name: '我发布的', value: 1},
|
|
|
- {name: '已卖出', value: 2},
|
|
|
- {name: '已下架', value: 3},
|
|
|
+ {name: '我发布的', value: 0},
|
|
|
+ {name: '已卖出', value: 1},
|
|
|
+ {name: '已下架', value: 2},
|
|
|
],
|
|
|
- curTab: 0,
|
|
|
+ tabCurrent: 0,
|
|
|
dataList: [],
|
|
|
pageNum: 1,
|
|
|
+ loadStatus: 0,
|
|
|
refresherTriggered: false,
|
|
|
|
|
|
isShowDeliverDialog: false,
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- async onLoad() {
|
|
|
- // await this.getList()
|
|
|
+ async onLoad({tab}) {
|
|
|
+ this.tabCurrent = tab ? Number(tab) : 0;
|
|
|
+ await this.getList();
|
|
|
+
|
|
|
+ uni.$on('refreshMyIssueList', () => {
|
|
|
+ this.refreshLish();
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ onUnload() {
|
|
|
+ uni.$off('refreshMyIssueList');
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
//获取列表数据
|
|
|
async getList() {
|
|
|
- this.$api.post('/xxx/xxxlist', {
|
|
|
+ const statusMap = {
|
|
|
+ 0: 1,
|
|
|
+ 1: 4,
|
|
|
+ 2: 0
|
|
|
+ }
|
|
|
+ this.$api.get('/goods/list', {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: 10,
|
|
|
+ status: statusMap[this.tabCurrent],
|
|
|
+ userId: this.$store.state.user.userId
|
|
|
}).then(res => {
|
|
|
this.loadStatus = 0;
|
|
|
let list = res.data.records;
|
|
@@ -122,18 +160,43 @@
|
|
|
// 触发下拉刷新
|
|
|
refresherrefresh(e) {
|
|
|
this.refresherTriggered = true;
|
|
|
- this.dataList = [];
|
|
|
- this.pageNum = 1;
|
|
|
- this.getList();
|
|
|
+ this.refreshLish();
|
|
|
},
|
|
|
|
|
|
- openDeliver() {
|
|
|
- this.$refs.deliverDialog.setValue();
|
|
|
+ refreshLish() {
|
|
|
+ this.dataList = [];
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ clickTab(item) {
|
|
|
+ this.tabCurrent = item.value;
|
|
|
+ this.refreshLish();
|
|
|
+ },
|
|
|
+
|
|
|
+ toDetail(id) {
|
|
|
+ this.$navToPage({
|
|
|
+ url: `/pages/goods/detail?id=${id}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ openDeliver(id) {
|
|
|
+ this.$refs.deliverDialog.setValue(id);
|
|
|
this.isShowDeliverDialog = true;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ // #endif
|
|
|
+ // #ifndef H5
|
|
|
+ import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ zjDialogDeliver
|
|
|
+ },
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|