Authored by 邱骏

求购调价

@@ -38,10 +38,14 @@ export default { @@ -38,10 +38,14 @@ export default {
38 if (!setTitle) { 38 if (!setTitle) {
39 return this.title; 39 return this.title;
40 } 40 }
41 - if (this.title) {  
42 - setTitle(this.title);  
43 - this.$xianyu.setXianyuTitle({ title: this.title });  
44 - } 41 +
  42 + setTimeout(() => {
  43 + if (this.title) {
  44 + setTitle(this.title);
  45 + this.$xianyu.setXianyuTitle({ title: this.title });
  46 + }
  47 + }, 100);
  48 +
45 this.setTitle = setTitle; 49 this.setTitle = setTitle;
46 }, 50 },
47 computed: { 51 computed: {
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 @scroll="scrollHandler" 9 @scroll="scrollHandler"
10 :options="options" 10 :options="options"
11 @pulling-up="onPullingUp" 11 @pulling-up="onPullingUp"
12 - @pulling-down="onPullingDown"  
13 :data="productList.list"> 12 :data="productList.list">
14 <div class="channel-body" ref="body"> 13 <div class="channel-body" ref="body">
15 <div ref="topSource" class="channel-html"> 14 <div ref="topSource" class="channel-html">
@@ -57,9 +56,9 @@ export default { @@ -57,9 +56,9 @@ export default {
57 scrollbar: true, 56 scrollbar: true,
58 pullUpLoad: true, 57 pullUpLoad: true,
59 // pullDownRefresh: true, 58 // pullDownRefresh: true,
60 - pullDownRefresh: {  
61 - txt: '刷新成功',  
62 - } 59 + // pullDownRefresh: {
  60 + // txt: '刷新成功',
  61 + // }
63 }, 62 },
64 scrollEvents: ['scroll'], 63 scrollEvents: ['scroll'],
65 scrollY: 0, 64 scrollY: 0,
@@ -217,12 +216,12 @@ export default { @@ -217,12 +216,12 @@ export default {
217 } 216 }
218 }, 217 },
219 218
220 - onPullingDown() {  
221 - let params = this.searchParams; 219 + // onPullingDown() {
  220 + // let params = this.searchParams;
222 221
223 - params.isReset = true;  
224 - this.fetchList(params);  
225 - }, 222 + // params.isReset = true;
  223 + // this.fetchList(params);
  224 + // },
226 }, 225 },
227 components: { 226 components: {
228 Swiper, 227 Swiper,
@@ -7,10 +7,9 @@ @@ -7,10 +7,9 @@
7 @pulling-up="onPullingUp" 7 @pulling-up="onPullingUp"
8 :data="newsList.list"> 8 :data="newsList.list">
9 <div class="news-content"> 9 <div class="news-content">
10 - <Tab  
11 - v-if="newsList.tabList.length > 0" :list="newsList.tabList"></Tab>  
12 - <List v-if="newsList.list.length > 0" :list="newsList && newsList.list || []"></List>  
13 - <UfoNoItem v-else :tip="`暂无数据`" style="margin-6op: 50px"></UfoNoItem> 10 + <Tab v-if="newsList.tabList.length > 0" :list="newsList.tabList || []"></Tab>
  11 + <List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
  12 + <UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
14 </div> 13 </div>
15 </Scroll> 14 </Scroll>
16 </div> 15 </div>
@@ -30,38 +29,74 @@ export default { @@ -30,38 +29,74 @@ export default {
30 props: ['hideHeader'], 29 props: ['hideHeader'],
31 data() { 30 data() {
32 return { 31 return {
  32 + msg: '消息',
33 options: { 33 options: {
34 - pullUpLoad: true 34 + pullUpLoad: true,
  35 + // pullUpLoad: {
  36 + // threshold: 100,
  37 + // txt: {
  38 + // txt: '加载中...',
  39 + // noMore: '~ 已经到底啦 ~',
  40 + // visible: false,
  41 + // }
  42 + // }
  43 + },
  44 + newsList: {
  45 + list: [],
  46 + tabList: [],
  47 + page: 0,
  48 + totalPage: 0,
  49 + isMoreData: true,
  50 + },
  51 + params: {
  52 + type: '',
  53 + isResetPage: true,
  54 + page: 1,
  55 + limit: 10,
35 }, 56 },
36 - msg: '消息',  
37 }; 57 };
38 }, 58 },
39 - computed: {  
40 - ...mapState(['newsList']),  
41 - },  
42 activated() { 59 activated() {
43 - let params = {  
44 - type: '',  
45 - isPage: true  
46 - };  
47 - this.fetchNewsList(params);  
48 - this.fetchNewsTabList(); 60 + this.fetchList();
  61 + this.fetchTabList();
  62 + },
  63 + mounted() {
  64 +
49 }, 65 },
50 created() { 66 created() {
51 - 67 +
52 }, 68 },
53 methods: { 69 methods: {
54 ...mapActions(['fetchNewsList', 'fetchNewsTabList']), 70 ...mapActions(['fetchNewsList', 'fetchNewsTabList']),
  71 +
  72 + async fetchList() {
  73 + let result = await this.fetchNewsList({ ...this.params });
  74 + if (result.code && result.code == 200) {
  75 + if (!this.newsList.isMoreData) return;
  76 + this.newsList.list = this.newsList.list.concat(result.data.list);
  77 + this.params.page = this.params.page + 1;
  78 + this.newsList.page = result.data.page;
  79 + this.newsList.totalPage = result.data.totalPage;
  80 + if (this.newsList.page < this.newsList.totalPage) {
  81 + this.newsList.isMoreData = true;
  82 + } else {
  83 + this.newsList.isMoreData = false;
  84 + }
  85 + }
  86 + },
  87 +
  88 + async fetchTabList() {
  89 + let result = await this.fetchNewsTabList();
  90 + if (result.code && result.code == 200) {
  91 + this.newsList.tabList = result.data;
  92 + }
  93 + },
55 async onPullingUp() { 94 async onPullingUp() {
56 if (!this.newsList.isMoreData) { 95 if (!this.newsList.isMoreData) {
57 - this.$refs.scroll.forceUpdate();  
58 - return false 96 + this.$refs.scroll.forceUpdate()
  97 + return;
59 } 98 }
60 - let params = {  
61 - type: '',  
62 - isPage: false  
63 - };  
64 - await this.fetchNewsList(params); 99 + this.fetchList(this.params);
65 this.$refs.scroll.forceUpdate(); 100 this.$refs.scroll.forceUpdate();
66 }, 101 },
67 }, 102 },
@@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
5 ref="scroll" 5 ref="scroll"
6 :options="options" 6 :options="options"
7 @pulling-up="onPullingUp" 7 @pulling-up="onPullingUp"
8 - :data="newsDeatilList.list"> 8 + :data="newsList.list">
9 <div class="news-content"> 9 <div class="news-content">
10 <Title :title="title"></Title> 10 <Title :title="title"></Title>
11 - <List v-if="newsDeatilList.list && newsDeatilList.list.length > 0" :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List> 11 + <List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
12 <UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem> 12 <UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
13 </div> 13 </div>
14 </Scroll> 14 </Scroll>
@@ -28,38 +28,68 @@ export default { @@ -28,38 +28,68 @@ export default {
28 data() { 28 data() {
29 return { 29 return {
30 options: { 30 options: {
31 - pullUpLoad: true 31 + pullUpLoad: true,
  32 + // pullUpLoad: {
  33 + // threshold: 100,
  34 + // txt: {
  35 + // more: '加载中...',
  36 + // noMore: '~ 已经到底啦 ~'
  37 + // }
  38 + // }
32 }, 39 },
33 title: '', 40 title: '',
34 type: '', 41 type: '',
  42 + newsList: {
  43 + list: [],
  44 + tabList: [],
  45 + page: 0,
  46 + totalPage: 0,
  47 + isMoreData: true,
  48 + },
  49 + params: {
  50 + type: '',
  51 + isResetPage: true,
  52 + page: 1,
  53 + limit: 10,
  54 + },
35 } 55 }
36 }, 56 },
37 computed: { 57 computed: {
38 - ...mapState(['newsList','newsDeatilList']), 58 +
39 }, 59 },
40 activated() { 60 activated() {
41 - let params = {  
42 - type: this.type,  
43 - isPage: true  
44 - }  
45 - this.fetchNewsList(params); 61 + this.fetchList(this.params);
46 }, 62 },
47 created() { 63 created() {
  64 + // this.fetchList(this.params);
48 this.title = this.$route.query.description; 65 this.title = this.$route.query.description;
49 - this.type = this.$route.query.type; 66 + this.params.type = this.$route.query.type;
50 }, 67 },
51 methods: { 68 methods: {
52 ...mapActions(['fetchNewsList']), 69 ...mapActions(['fetchNewsList']),
  70 +
  71 + async fetchList() {
  72 + let result = await this.fetchNewsList({ ...this.params });
  73 + if (result.code && result.code == 200) {
  74 + if (!this.newsList.isMoreData) return;
  75 + this.newsList.list = result.data.totalPage == 0 ? this.newsList.list : this.newsList.list.concat(result.data.list);
  76 + this.params.page = this.params.page + 1;
  77 + this.newsList.page = result.data.page;
  78 + this.newsList.totalPage = result.data.totalPage;
  79 + if (this.newsList.page < this.newsList.totalPage) {
  80 + this.newsList.isMoreData = true;
  81 + } else {
  82 + this.newsList.isMoreData = false;
  83 + }
  84 + }
  85 + },
  86 +
53 async onPullingUp() { 87 async onPullingUp() {
54 - if (!this.newsDeatilList.isMoreData ) {  
55 - this.$refs.scroll.forceUpdate();  
56 - return false  
57 - };  
58 - let params = {  
59 - type: this.type,  
60 - isPage: false  
61 - }  
62 - await this.fetchNewsList(params); 88 + if (!this.newsList.isMoreData) {
  89 + this.$refs.scroll.forceUpdate()
  90 + return;
  91 + }
  92 + this.fetchList(this.params);
63 this.$refs.scroll.forceUpdate(); 93 this.$refs.scroll.forceUpdate();
64 } 94 }
65 }, 95 },
@@ -65,20 +65,11 @@ export default { @@ -65,20 +65,11 @@ export default {
65 }; 65 };
66 }, 66 },
67 activated() { 67 activated() {
68 - let params = this.$route.query; 68 + let params = {...this.$route.query};
69 69
70 if (this.yoho.direction === 'forword') { 70 if (this.yoho.direction === 'forword') {
71 Object.assign(this.$data, this.$options.data()); 71 Object.assign(this.$data, this.$options.data());
72 } 72 }
73 - if (Object.keys(params).length && params.listType) {  
74 - this.listType = params.listType;  
75 - delete params.listType;  
76 - }  
77 - if (Object.keys(params).length && params.type) {  
78 - this.type = params.type;  
79 - } else {  
80 - params.type = 6;  
81 - }  
82 !params.order && (params.order = 'sale_desc'); 73 !params.order && (params.order = 'sale_desc');
83 this.fetchData(params); 74 this.fetchData(params);
84 }, 75 },
@@ -124,9 +115,11 @@ export default { @@ -124,9 +115,11 @@ export default {
124 }, 115 },
125 116
126 submit() { 117 submit() {
  118 + let routeParams = this.$route.query;
  119 +
127 this.copyFilterParams = {...this.filterParams}; 120 this.copyFilterParams = {...this.filterParams};
128 let params = { 121 let params = {
129 - sort: this.filterParams.sort.join(','), 122 + sort: this.filterParams.sort.join(',') || routeParams.sort,
130 brand: this.filterParams.brand.join(','), // 品牌id 123 brand: this.filterParams.brand.join(','), // 品牌id
131 gender: this.filterParams.gender.join(','), // 性别 124 gender: this.filterParams.gender.join(','), // 性别
132 size: this.filterParams.size.join(','), // 尺码id 125 size: this.filterParams.size.join(','), // 尺码id
@@ -139,6 +132,7 @@ export default { @@ -139,6 +132,7 @@ export default {
139 }); 132 });
140 params.isReset = true; 133 params.isReset = true;
141 this.$parent.fetchList(params); 134 this.$parent.fetchList(params);
  135 + this.$parent.$refs.scroll.scrollTo(0, 0, 300)
142 this.hide(); 136 this.hide();
143 }, 137 },
144 138
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <div class="search-img" @click="goSearch()"></div> 18 <div class="search-img" @click="goSearch()"></div>
19 </div> 19 </div>
20 </div> 20 </div>
21 - <Scroll class="product-list" v-show="!productList.isEmpty" 21 + <Scroll ref="scroll" class="product-list" v-show="!productList.isEmpty"
22 :options="scrollOptions" 22 :options="scrollOptions"
23 :data="productList.list" 23 :data="productList.list"
24 @pulling-up="onPullingUp"> 24 @pulling-up="onPullingUp">
@@ -57,11 +57,9 @@ export default { @@ -57,11 +57,9 @@ export default {
57 pullUpLoad: true 57 pullUpLoad: true
58 }, 58 },
59 fixed: false, 59 fixed: false,
60 - selectedType: 2, 60 + selectedType: 2, // tab类型高亮
61 priceDesc: true, 61 priceDesc: true,
62 arrowImage: '', 62 arrowImage: '',
63 - listType: 1,  
64 - type: 6,  
65 title: '', 63 title: '',
66 productList: { 64 productList: {
67 showErrorPage: false, 65 showErrorPage: false,
@@ -98,7 +96,7 @@ export default { @@ -98,7 +96,7 @@ export default {
98 Object.assign(this.$data, this.$options.data()); 96 Object.assign(this.$data, this.$options.data());
99 } 97 }
100 this.changeArrow(); 98 this.changeArrow();
101 - let params = this.$route.query; 99 + let params = {...this.$route.query};
102 100
103 if (params.title) { 101 if (params.title) {
104 this.title = params.title; 102 this.title = params.title;
@@ -106,13 +104,6 @@ export default { @@ -106,13 +104,6 @@ export default {
106 } else { 104 } else {
107 this.title = '商品列表'; 105 this.title = '商品列表';
108 } 106 }
109 - if (Object.keys(params).length && params.listType) {  
110 - this.listType = params.listType;  
111 - delete params.listType;  
112 - }  
113 - if (Object.keys(params).length && params.type) {  
114 - this.type = params.type;  
115 - }  
116 !params.order && (params.order = 'sale_desc'); 107 !params.order && (params.order = 'sale_desc');
117 this.fetchList({...params, isReset: true}); 108 this.fetchList({...params, isReset: true});
118 }, 109 },
@@ -183,38 +174,34 @@ export default { @@ -183,38 +174,34 @@ export default {
183 } 174 }
184 }, 175 },
185 176
186 - // 点击tab type, 0: 推荐, 1: 价格, 2: 人气, 3: 新品  
187 - pressType(type) {  
188 - if (type === this.selectedType && type !== 1) { 177 + // 点击tab flag, 0: 推荐, 1: 价格, 2: 人气, 3: 新品
  178 + pressType(flag) {
  179 + if (flag === this.selectedType && flag !== 1) {
189 return; 180 return;
190 } 181 }
191 let filterParams = this.$refs.filtrate.getParams(); 182 let filterParams = this.$refs.filtrate.getParams();
  183 + let {sort} = this.searchParams;
192 let params = { 184 let params = {
193 - type: this.type,  
194 - sort: filterParams.sort.join(','), 185 + sort: filterParams.sort.join(',') || sort,
195 brand: filterParams.brand.join(','), // 品牌id 186 brand: filterParams.brand.join(','), // 品牌id
196 gender: filterParams.gender.join(','), // 性别 187 gender: filterParams.gender.join(','), // 性别
197 size: filterParams.size.join(','), // 尺码id 188 size: filterParams.size.join(','), // 尺码id
198 }; 189 };
199 190
200 - if (this.listType === 4) {  
201 - delete params.type;  
202 - }  
203 -  
204 - this.selectedType = type;  
205 - if (type === 1) { 191 + this.selectedType = flag;
  192 + if (flag === 1) {
206 this.priceDesc = !this.priceDesc; 193 this.priceDesc = !this.priceDesc;
207 params.order = this.priceDesc ? 'p_desc' : 'p_asc'; 194 params.order = this.priceDesc ? 'p_desc' : 'p_asc';
208 - } else if (type === 2) { 195 + } else if (flag === 2) {
209 this.priceDesc = true; 196 this.priceDesc = true;
210 params.order = 'sale_desc'; 197 params.order = 'sale_desc';
211 - } else if (type === 3) { 198 + } else if (flag === 3) {
212 this.priceDesc = true; 199 this.priceDesc = true;
213 params.order = 'st_desc'; 200 params.order = 'st_desc';
214 } 201 }
215 - params.listType = this.listType;  
216 params.isReset = true; 202 params.isReset = true;
217 this.fetchList(params); 203 this.fetchList(params);
  204 + this.$refs.scroll.scrollTo(0, 0, 300)
218 this.changeArrow(); 205 this.changeArrow();
219 }, 206 },
220 goSearch() { 207 goSearch() {
@@ -28,10 +28,17 @@ export default { @@ -28,10 +28,17 @@ export default {
28 default() { 28 default() {
29 return false; 29 return false;
30 } 30 }
  31 + },
  32 + url: {
  33 + type: String,
  34 + default: ''
31 } 35 }
32 }, 36 },
33 methods: { 37 methods: {
34 onClick() { 38 onClick() {
  39 + if (this.url) {
  40 + this.$xianyu.goXianyuNewPage({url: this.url});
  41 + }
35 } 42 }
36 } 43 }
37 }; 44 };
@@ -185,7 +185,7 @@ export default { @@ -185,7 +185,7 @@ export default {
185 // footer高度120px 185 // footer高度120px
186 padding: 0 40px; 186 padding: 0 40px;
187 -webkit-box-orient: vertical; 187 -webkit-box-orient: vertical;
188 - height: calc(100vh - 210px); 188 + height: calc(100vh - 120px);
189 overflow-x: hidden; 189 overflow-x: hidden;
190 overflow-y: auto; 190 overflow-y: auto;
191 font-size: 24px; 191 font-size: 24px;
@@ -36,25 +36,29 @@ export default { @@ -36,25 +36,29 @@ export default {
36 components: { 36 components: {
37 Scroll 37 Scroll
38 }, 38 },
  39 + props: {
  40 + status: {
  41 + type: Number
  42 + },
  43 + owner: {
  44 + type: String
  45 + }
  46 + },
39 computed: { 47 computed: {
40 - ...mapState(["currentStatus", "routeParamStatus"]), 48 + ...mapState(["routeParamStatus"]),
41 statusList: function() { 49 statusList: function() {
42 - const { owner } = this.$route.params;  
43 - return owner === ownType.BUY 50 + return this.owner === ownType.BUY
44 ? buyerOrderStatusList 51 ? buyerOrderStatusList
45 : sellerOrderStatusList; 52 : sellerOrderStatusList;
46 - },  
47 - status() {  
48 - return this.currentStatus || this.routeParamStatus;  
49 } 53 }
50 }, 54 },
51 methods: { 55 methods: {
52 ...mapMutations(["setOrderStatus", "resetPartialData"]), 56 ...mapMutations(["setOrderStatus", "resetPartialData"]),
53 ...mapActions(["fetchOrderList"]), 57 ...mapActions(["fetchOrderList"]),
54 onHandleClick(status) { 58 onHandleClick(status) {
55 - this.setOrderStatus(status); 59 + this.$emit("change", status);
56 this.resetPartialData(); 60 this.resetPartialData();
57 - const { owner } = this.$route.params; 61 + const { owner } = this;
58 this.fetchOrderList({ owner, status }); 62 this.fetchOrderList({ owner, status });
59 } 63 }
60 } 64 }
@@ -122,7 +122,7 @@ export default { @@ -122,7 +122,7 @@ export default {
122 } 122 }
123 }, 123 },
124 mounted() { 124 mounted() {
125 - // this.showPlayer(); 125 + this.showPlayer();
126 }, 126 },
127 beforeDestroy() { 127 beforeDestroy() {
128 if (this.player) { 128 if (this.player) {
@@ -131,9 +131,7 @@ export default { @@ -131,9 +131,7 @@ export default {
131 }, 131 },
132 methods: { 132 methods: {
133 async parentHandleclick() { 133 async parentHandleclick() {
134 - this.showPlayer();  
135 -  
136 - await this.delay(1000); 134 + // await this.delay(1000);
137 this.player.play(); 135 this.player.play();
138 136
139 const timeId = setTimeout(() => { 137 const timeId = setTimeout(() => {
@@ -71,7 +71,12 @@ export default { @@ -71,7 +71,12 @@ export default {
71 options: function() { 71 options: function() {
72 return { 72 return {
73 pullUpLoad: this.pullUpLoad, 73 pullUpLoad: this.pullUpLoad,
74 - pullDownRefresh: true 74 + pullDownRefresh: this.isShowEmpty
  75 + ? false
  76 + : {
  77 + txt: "更新成功"
  78 + },
  79 + bounce: this.isShowEmpty ? false : true
75 }; 80 };
76 }, 81 },
77 isFetchEntryOrder() { 82 isFetchEntryOrder() {
1 <template> 1 <template>
2 <layout-app :title="$route.params.owner === 'sell' ? '我的出售' : '我的订单'"> 2 <layout-app :title="$route.params.owner === 'sell' ? '我的出售' : '我的订单'">
3 - <status-nav /> 3 + <status-nav @change="change" :owner="owner" :status="currentStatus" />
4 <div class="content-wrapper"> 4 <div class="content-wrapper">
5 <scroll 5 <scroll
6 @pulling-up="fetchData" 6 @pulling-up="fetchData"
@@ -87,29 +87,40 @@ export default { @@ -87,29 +87,40 @@ export default {
87 CountDown, 87 CountDown,
88 VideoPlayer 88 VideoPlayer
89 }, 89 },
  90 + data() {
  91 + const { status = 1, owner } = this.$route.params;
  92 + return {
  93 + currentStatus: +status,
  94 + owner
  95 + };
  96 + },
90 computed: { 97 computed: {
91 ...mapState(["orderList", "pullUpLoad", "isShowEmpty"]), 98 ...mapState(["orderList", "pullUpLoad", "isShowEmpty"]),
92 options: function() { 99 options: function() {
93 return { 100 return {
94 pullUpLoad: this.pullUpLoad, 101 pullUpLoad: this.pullUpLoad,
95 - pullDownRefresh: true 102 + bounce: this.isShowEmpty ? false : true,
  103 + pullDownRefresh: this.isShowEmpty
  104 + ? false
  105 + : {
  106 + txt: "更新成功"
  107 + }
96 }; 108 };
97 } 109 }
98 }, 110 },
99 -  
100 - // 获取订单数据  
101 - asyncData({ store, router }) {  
102 - const { status } = router.params;  
103 - store.commit(`${STORE_PATH}/resetData`);  
104 - store.commit(`${STORE_PATH}/setRouteParamStatus`, status);  
105 - return store.dispatch(`${STORE_PATH}/fetchOrderList`, router.params); 111 + activated() {
  112 + this.resetData();
  113 + this.fetchData();
106 }, 114 },
107 -  
108 methods: { 115 methods: {
109 ...mapActions(["fetchOrderList", "confirmReceipt"]), 116 ...mapActions(["fetchOrderList", "confirmReceipt"]),
110 ...mapMutations(["resetData"]), 117 ...mapMutations(["resetData"]),
  118 + change(status) {
  119 + this.currentStatus = status;
  120 + },
111 fetchData() { 121 fetchData() {
112 - this.fetchOrderList(this.$route.params); 122 + const { owner, currentStatus: status } = this;
  123 + this.fetchOrderList({ owner, status });
113 }, 124 },
114 onRefresh() { 125 onRefresh() {
115 this.resetData(); 126 this.resetData();
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 </span> 10 </span>
11 <span class="wordText">{{price}}</span> 11 <span class="wordText">{{price}}</span>
12 </div> 12 </div>
13 - <OrderMargin class="order-item order-margin" :data="computeTip" :hiddenIcon="hiddenIcon"></OrderMargin> 13 + <OrderMargin class="order-item order-margin" :data="computeTip" :url="url" :superSell="isEntry" ></OrderMargin>
14 <OrderFee class="order-item" :data="computeTip"></OrderFee> 14 <OrderFee class="order-item" :data="computeTip"></OrderFee>
15 <AddressInfo :data="addressInfo" class="order-item"></AddressInfo> 15 <AddressInfo :data="addressInfo" class="order-item"></AddressInfo>
16 </div> 16 </div>
@@ -32,7 +32,7 @@ import TitleComp from './components/confirm/title'; @@ -32,7 +32,7 @@ import TitleComp from './components/confirm/title';
32 import OrderMargin from './components/confirm/order-margin'; 32 import OrderMargin from './components/confirm/order-margin';
33 import OrderFee from './components/confirm/order-fee'; 33 import OrderFee from './components/confirm/order-fee';
34 import OrderAgree from './components/confirm/agree'; 34 import OrderAgree from './components/confirm/agree';
35 -import {get} from 'lodash' 35 +import {get} from 'lodash';
36 36
37 import { createNamespacedHelpers} from 'vuex'; 37 import { createNamespacedHelpers} from 'vuex';
38 const { mapState, mapActions, mapMutations, mapGetters} = createNamespacedHelpers( 38 const { mapState, mapActions, mapMutations, mapGetters} = createNamespacedHelpers(
@@ -61,7 +61,7 @@ export default { @@ -61,7 +61,7 @@ export default {
61 isAgreeTerms: false, 61 isAgreeTerms: false,
62 hiddenIcon: true, 62 hiddenIcon: true,
63 agreeDesc: '有货卖家协议', 63 agreeDesc: '有货卖家协议',
64 - url: `http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3187.html?title=卖家协议\"}}`, 64 + url: 'http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3187.html?title=卖家协议\"}}',
65 isEntry: false, 65 isEntry: false,
66 }; 66 };
67 }, 67 },
@@ -84,14 +84,14 @@ export default { @@ -84,14 +84,14 @@ export default {
84 }, 84 },
85 85
86 mounted() { 86 mounted() {
87 - this.isEntry = false 87 + this.isEntry = false;
88 this.fetchSellerEntryStatus({}) 88 this.fetchSellerEntryStatus({})
89 .then((res)=> { 89 .then((res)=> {
90 - console.log(res) 90 + console.log(res);
91 if (res) { 91 if (res) {
92 - this.isEntry = get(res, 'entrySellerType', 0) !== 0 92 + this.isEntry = get(res, 'entrySellerType', 0) !== 0;
93 } 93 }
94 - }) 94 + });
95 this.fetchSellerOrderCount({tabType: 'sell'});// 19268 95 this.fetchSellerOrderCount({tabType: 'sell'});// 19268
96 this.sellerCompute({price: this.price, skup: this.skup}); 96 this.sellerCompute({price: this.price, skup: this.skup});
97 97
@@ -101,7 +101,7 @@ export default { @@ -101,7 +101,7 @@ export default {
101 isShowTip(val) { 101 isShowTip(val) {
102 102
103 if (val) { 103 if (val) {
104 - this.showToast() 104 + this.showToast();
105 } 105 }
106 } 106 }
107 }, 107 },
@@ -123,7 +123,7 @@ export default { @@ -123,7 +123,7 @@ export default {
123 this.$createDialog({ 123 this.$createDialog({
124 type: 'confirm', 124 type: 'confirm',
125 title: '', 125 title: '',
126 - content: `确定以${this.price}出售此商品`, 126 + content: `确定以¥${this.price}立即出售此商品`,
127 confirmBtn: { 127 confirmBtn: {
128 text: '确定出售', 128 text: '确定出售',
129 active: true, 129 active: true,
@@ -138,14 +138,25 @@ export default { @@ -138,14 +138,25 @@ export default {
138 }, 138 },
139 onConfirm: () => { 139 onConfirm: () => {
140 this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id}) 140 this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
141 - .then(() => {  
142 - this.$createToast({  
143 - time: 1000,  
144 - type: 'txt',  
145 - txt: '出售成功'  
146 - }).show(); 141 + .then((res) => {
  142 +
  143 + if (res && res.code && res.code == 200) {
  144 + this.$createToast({
  145 + time: 1000,
  146 + type: 'txt',
  147 + txt: '出售成功'
  148 + }).show();
  149 +
  150 + this.$router.go(-1);
  151 + } else {
  152 + this.$createToast({
  153 + time: 1000,
  154 + type: 'txt',
  155 + txt: res.message
  156 + }).show();
  157 +
  158 + }
147 159
148 - this.$router.go(-1);  
149 }); 160 });
150 }, 161 },
151 onCancel: () => { 162 onCancel: () => {
@@ -188,7 +199,7 @@ export default { @@ -188,7 +199,7 @@ export default {
188 }, 199 },
189 200
190 showToast() { 201 showToast() {
191 - this.SELLER_ASK_SET_IS_SHOWTOAST(false) 202 + this.SELLER_ASK_SET_IS_SHOWTOAST(false);
192 this.$createToast({ 203 this.$createToast({
193 time: 1000, 204 time: 1000,
194 type: 'txt', 205 type: 'txt',
@@ -57,7 +57,6 @@ export default function() { @@ -57,7 +57,6 @@ export default function() {
57 console.log("resultresultresult"); 57 console.log("resultresultresult");
58 if (result.code === 200) { 58 if (result.code === 200) {
59 commit(Types.FETCH_CHANNEL, { list: result.data }); 59 commit(Types.FETCH_CHANNEL, { list: result.data });
60 -  
61 return result.data; 60 return result.data;
62 } 61 }
63 } 62 }
@@ -31,18 +31,16 @@ export default function() { @@ -31,18 +31,16 @@ export default function() {
31 }, 31 },
32 32
33 [Types.FETCH_NEWSDETAIL_LIST](state, { list }) { 33 [Types.FETCH_NEWSDETAIL_LIST](state, { list }) {
34 - console.log(list.page);  
35 - console.log("list.page");  
36 state.newsDeatilList.list = list.page > 1 ? state.newsDeatilList.list.concat(list.list) : list.list; 34 state.newsDeatilList.list = list.page > 1 ? state.newsDeatilList.list.concat(list.list) : list.list;
37 state.newsDeatilList.page = list.page; 35 state.newsDeatilList.page = list.page;
38 state.newsDeatilList.totalPage = list.totalPage; 36 state.newsDeatilList.totalPage = list.totalPage;
39 list.page < list.totalPage ? state.newsDeatilList.isMoreData = true : state.newsDeatilList.isMoreData = false; 37 list.page < list.totalPage ? state.newsDeatilList.isMoreData = true : state.newsDeatilList.isMoreData = false;
40 }, 38 },
41 39
42 - resPages(state, {page, isMoreData}) {  
43 - state.newsDeatilList.page = page;  
44 - state.newsDeatilList.isMoreData = isMoreData;  
45 - }, 40 + // resPages(state, {page, isMoreData}) {
  41 + // state.newsDeatilList.page = page;
  42 + // state.newsDeatilList.isMoreData = isMoreData;
  43 + // },
46 44
47 [Types.FETCH_NEWS_TAB_LIST](state, { list }) { 45 [Types.FETCH_NEWS_TAB_LIST](state, { list }) {
48 state.newsList.tabList = list; 46 state.newsList.tabList = list;
@@ -50,16 +48,8 @@ export default function() { @@ -50,16 +48,8 @@ export default function() {
50 }, 48 },
51 actions: { 49 actions: {
52 async fetchNewsList({ commit, state }, obj) { 50 async fetchNewsList({ commit, state }, obj) {
53 - console.log(obj)  
54 - console.log("objobj")  
55 - let type = obj && obj.type;  
56 - let page = type ? state.newsDeatilList.page + 1 : state.newsList.page + 1;  
57 - let limit = state.newsList.limit;  
58 - let isPage = obj && obj.isPage;  
59 -  
60 - if (isPage) {  
61 - page = 1;  
62 - } 51 + console.log(obj);
  52 + let { isResetPage, limit, page, totalPage, type } = obj;
63 const result = await this.$api.post('/api/ufo/home/newsList', { 53 const result = await this.$api.post('/api/ufo/home/newsList', {
64 page, type: type || '', limit 54 page, type: type || '', limit
65 }); 55 });
@@ -68,19 +58,19 @@ export default function() { @@ -68,19 +58,19 @@ export default function() {
68 result.data.list && result.data.list.map((res) => { 58 result.data.list && result.data.list.map((res) => {
69 res.createTime = moment(new Date(res.createTime * 1000)).format('YYYY.MM.DD HH:mm'); 59 res.createTime = moment(new Date(res.createTime * 1000)).format('YYYY.MM.DD HH:mm');
70 }); 60 });
71 - if (type) {  
72 - console.log('1');  
73 - commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});  
74 - } else {  
75 - console.log('2');  
76 - commit(Types.FETCH_NEWS_LIST, {list: result.data});  
77 - } 61 + // if (type) {
  62 + // commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
  63 + // } else {
  64 + // commit(Types.FETCH_NEWS_LIST, {list: result.data});
  65 + // }
  66 + return result;
78 } 67 }
79 }, 68 },
80 async fetchNewsTabList({ commit }) { 69 async fetchNewsTabList({ commit }) {
81 const result = await this.$api.post('/api/ufo/home/newsListTab', {}); 70 const result = await this.$api.post('/api/ufo/home/newsListTab', {});
82 if (result.code === 200) { 71 if (result.code === 200) {
83 commit(Types.FETCH_NEWS_TAB_LIST, {list: result.data}); 72 commit(Types.FETCH_NEWS_TAB_LIST, {list: result.data});
  73 + return result;
84 } 74 }
85 }, 75 },
86 }, 76 },
@@ -5,10 +5,6 @@ const initailData = () => ({ @@ -5,10 +5,6 @@ const initailData = () => ({
5 orderList: [], // 订单列表 5 orderList: [], // 订单列表
6 // scroll 组件参数,是否触发上拉事件 6 // scroll 组件参数,是否触发上拉事件
7 pullUpLoad: true, 7 pullUpLoad: true,
8 -  
9 - // 当前查询订单状态  
10 - currentStatus: null,  
11 - routeParamStatus: null,  
12 isShowEmpty: false, 8 isShowEmpty: false,
13 }); 9 });
14 10
@@ -37,12 +33,6 @@ export default function() { @@ -37,12 +33,6 @@ export default function() {
37 ); 33 );
38 state.isShowEmpty = state.orderList.length === 0; 34 state.isShowEmpty = state.orderList.length === 0;
39 }, 35 },
40 - setOrderStatus(state, currentStatus) {  
41 - state.currentStatus = +currentStatus;  
42 - },  
43 - setRouteParamStatus(state, status = 1) {  
44 - state.routeParamStatus = +status;  
45 - },  
46 resetPartialData(state) { 36 resetPartialData(state) {
47 state.page = 1; 37 state.page = 1;
48 state.orderList = []; 38 state.orderList = [];
@@ -51,14 +41,10 @@ export default function() { @@ -51,14 +41,10 @@ export default function() {
51 }, 41 },
52 resetData(state) { 42 resetData(state) {
53 const s = initailData(); 43 const s = initailData();
54 - const keyList = Object.keys(s);  
55 - const keyBlackList = ['currentStatus', 'routeParamStatus'];  
56 44
57 - for (const key of keyList) {  
58 - if (!keyBlackList.includes(key)) {  
59 - state[key] = s[key];  
60 - }  
61 - } 45 + Object.keys(s).forEach(key => {
  46 + state[key] = s[key];
  47 + });
62 }, 48 },
63 }, 49 },
64 actions: { 50 actions: {
@@ -74,14 +60,14 @@ export default function() { @@ -74,14 +60,14 @@ export default function() {
74 async fetchOrderList( 60 async fetchOrderList(
75 { 61 {
76 commit, 62 commit,
77 - state: { page, currentStatus, routeParamStatus }, 63 + state: { page },
78 }, 64 },
79 param = {}, 65 param = {},
80 ) { 66 ) {
81 - const { owner } = param; 67 + const { owner, status } = param;
82 const res = await this.$api.get('/api/order/list', { 68 const res = await this.$api.get('/api/order/list', {
83 tabType: owner, 69 tabType: owner,
84 - type: currentStatus || routeParamStatus || 1, 70 + type: status || 1, // 1表示我的订单全部
85 page, 71 page,
86 }); 72 });
87 73
@@ -182,7 +168,7 @@ export default function() { @@ -182,7 +168,7 @@ export default function() {
182 console.log(res); 168 console.log(res);
183 169
184 if (res.code === 200) { 170 if (res.code === 200) {
185 - return { errMsg: '', isOk: true }; 171 + return { errMsg: '', isOk: true , bidData: res.data};
186 } else { 172 } else {
187 return { errMsg: res.message, isOk: false }; 173 return { errMsg: res.message, isOk: false };
188 } 174 }
@@ -210,9 +210,14 @@ export default function() { @@ -210,9 +210,14 @@ export default function() {
210 } else { 210 } else {
211 commit(SELLER_ASK_PUBLISH_FAILURE, result.message); 211 commit(SELLER_ASK_PUBLISH_FAILURE, result.message);
212 } 212 }
  213 + return result;
213 }, error => { 214 }, error => {
214 console.log(error); 215 console.log(error);
215 commit(SELLER_ASK_PUBLISH_FAILURE, TIP); 216 commit(SELLER_ASK_PUBLISH_FAILURE, TIP);
  217 + return {
  218 + code: 400,
  219 + message: TIP
  220 + };
216 }); 221 });
217 } 222 }
218 }, 223 },
1 { 1 {
2 "name": "xianyu-ufo-app-web", 2 "name": "xianyu-ufo-app-web",
3 - "version": "0.0.2-beta-25", 3 + "version": "0.0.2-beta-26",
4 "private": true, 4 "private": true,
5 "description": "Xianyu Project With Express", 5 "description": "Xianyu Project With Express",
6 "repository": { 6 "repository": {