fix conflict
Showing
21 changed files
with
260 additions
and
180 deletions
@@ -68,7 +68,7 @@ | @@ -68,7 +68,7 @@ | ||
68 | checked="model.is_default" | 68 | checked="model.is_default" |
69 | v-model="model.is_default" | 69 | v-model="model.is_default" |
70 | ></Radio> | 70 | ></Radio> |
71 | - <div v-if="isUpdate" class="del-address" @click="delAddress">删除地址</div> | 71 | + <div v-if="isUpdate && !isSeller" class="del-address" @click="delAddress">删除地址</div> |
72 | </div> | 72 | </div> |
73 | </div> | 73 | </div> |
74 | <div :class="submitClass" @touchend="onSubmit">确 认</div> | 74 | <div :class="submitClass" @touchend="onSubmit">确 认</div> |
@@ -116,6 +116,7 @@ export default { | @@ -116,6 +116,7 @@ export default { | ||
116 | }, | 116 | }, |
117 | isShowProvince: false, | 117 | isShowProvince: false, |
118 | isUpdate: false, | 118 | isUpdate: false, |
119 | + isSeller: false, | ||
119 | updateMobileNum: '', | 120 | updateMobileNum: '', |
120 | isMobileNumEdit: false, | 121 | isMobileNumEdit: false, |
121 | title: '', | 122 | title: '', |
@@ -317,8 +318,10 @@ export default { | @@ -317,8 +318,10 @@ export default { | ||
317 | activated() { | 318 | activated() { |
318 | let addressInfo = this.updateAddressInfo; | 319 | let addressInfo = this.updateAddressInfo; |
319 | 320 | ||
320 | - this.isUpdate = | ||
321 | - addressInfo.isUpdate && this.$route.query.fromPage !== 'OrderSellConfirm'; | 321 | + //判断是否是出售订单,出售订单不显示“删除地址” |
322 | + this.isSeller = this.$route.query.fromPage === 'OrderSellConfirm' ? true : false; | ||
323 | + | ||
324 | + this.isUpdate = addressInfo.isUpdate; | ||
322 | this.orderCode = addressInfo.orderCode; | 325 | this.orderCode = addressInfo.orderCode; |
323 | this.title = addressInfo.isUpdate ? '编辑地址' : '添加地址'; | 326 | this.title = addressInfo.isUpdate ? '编辑地址' : '添加地址'; |
324 | 327 |
@@ -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,72 @@ export default { | @@ -30,38 +29,72 @@ 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: { |
35 | + threshold: 100, | ||
36 | + txt: { | ||
37 | + txt: '加载中...', | ||
38 | + noMore: '~ 已经到底啦 ~' | ||
39 | + } | ||
40 | + } | ||
41 | + }, | ||
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, | ||
35 | }, | 54 | }, |
36 | - msg: '消息', | ||
37 | }; | 55 | }; |
38 | }, | 56 | }, |
39 | - computed: { | ||
40 | - ...mapState(['newsList']), | ||
41 | - }, | ||
42 | activated() { | 57 | activated() { |
43 | - let params = { | ||
44 | - type: '', | ||
45 | - isPage: true | ||
46 | - }; | ||
47 | - this.fetchNewsList(params); | ||
48 | - this.fetchNewsTabList(); | 58 | + this.fetchList(); |
59 | + this.fetchTabList(); | ||
60 | + }, | ||
61 | + mounted() { | ||
62 | + | ||
49 | }, | 63 | }, |
50 | created() { | 64 | created() { |
51 | - | 65 | + |
52 | }, | 66 | }, |
53 | methods: { | 67 | methods: { |
54 | ...mapActions(['fetchNewsList', 'fetchNewsTabList']), | 68 | ...mapActions(['fetchNewsList', 'fetchNewsTabList']), |
69 | + | ||
70 | + async fetchList() { | ||
71 | + let result = await this.fetchNewsList({ ...this.params }); | ||
72 | + if (result.code && result.code == 200) { | ||
73 | + if (!this.newsList.isMoreData) return; | ||
74 | + this.newsList.list = this.newsList.list.concat(result.data.list); | ||
75 | + this.params.page = this.params.page + 1; | ||
76 | + this.newsList.page = result.data.page; | ||
77 | + this.newsList.totalPage = result.data.totalPage; | ||
78 | + if (this.newsList.page < this.newsList.totalPage) { | ||
79 | + this.newsList.isMoreData = true; | ||
80 | + } else { | ||
81 | + this.newsList.isMoreData = false; | ||
82 | + } | ||
83 | + } | ||
84 | + }, | ||
85 | + | ||
86 | + async fetchTabList() { | ||
87 | + let result = await this.fetchNewsTabList(); | ||
88 | + if (result.code && result.code == 200) { | ||
89 | + this.newsList.tabList = result.data; | ||
90 | + } | ||
91 | + }, | ||
55 | async onPullingUp() { | 92 | async onPullingUp() { |
56 | if (!this.newsList.isMoreData) { | 93 | if (!this.newsList.isMoreData) { |
57 | - this.$refs.scroll.forceUpdate(); | ||
58 | - return false | 94 | + this.$refs.scroll.forceUpdate() |
95 | + return; | ||
59 | } | 96 | } |
60 | - let params = { | ||
61 | - type: '', | ||
62 | - isPage: false | ||
63 | - }; | ||
64 | - await this.fetchNewsList(params); | 97 | + this.fetchList(this.params); |
65 | this.$refs.scroll.forceUpdate(); | 98 | this.$refs.scroll.forceUpdate(); |
66 | }, | 99 | }, |
67 | }, | 100 | }, |
@@ -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,67 @@ export default { | @@ -28,38 +28,67 @@ export default { | ||
28 | data() { | 28 | data() { |
29 | return { | 29 | return { |
30 | options: { | 30 | options: { |
31 | - pullUpLoad: true | 31 | + pullUpLoad: { |
32 | + threshold: 100, | ||
33 | + txt: { | ||
34 | + more: '加载中...', | ||
35 | + noMore: '~ 已经到底啦 ~' | ||
36 | + } | ||
37 | + } | ||
32 | }, | 38 | }, |
33 | title: '', | 39 | title: '', |
34 | type: '', | 40 | type: '', |
41 | + newsList: { | ||
42 | + list: [], | ||
43 | + tabList: [], | ||
44 | + page: 0, | ||
45 | + totalPage: 0, | ||
46 | + isMoreData: true, | ||
47 | + }, | ||
48 | + params: { | ||
49 | + type: '', | ||
50 | + isResetPage: true, | ||
51 | + page: 1, | ||
52 | + limit: 10, | ||
53 | + }, | ||
35 | } | 54 | } |
36 | }, | 55 | }, |
37 | computed: { | 56 | computed: { |
38 | - ...mapState(['newsList','newsDeatilList']), | 57 | + |
39 | }, | 58 | }, |
40 | activated() { | 59 | activated() { |
41 | - let params = { | ||
42 | - type: this.type, | ||
43 | - isPage: true | ||
44 | - } | ||
45 | - this.fetchNewsList(params); | 60 | + this.fetchList(this.params); |
46 | }, | 61 | }, |
47 | created() { | 62 | created() { |
63 | + // this.fetchList(this.params); | ||
48 | this.title = this.$route.query.description; | 64 | this.title = this.$route.query.description; |
49 | - this.type = this.$route.query.type; | 65 | + this.params.type = this.$route.query.type; |
50 | }, | 66 | }, |
51 | methods: { | 67 | methods: { |
52 | ...mapActions(['fetchNewsList']), | 68 | ...mapActions(['fetchNewsList']), |
69 | + | ||
70 | + async fetchList() { | ||
71 | + let result = await this.fetchNewsList({ ...this.params }); | ||
72 | + if (result.code && result.code == 200) { | ||
73 | + if (!this.newsList.isMoreData) return; | ||
74 | + this.newsList.list = result.data.totalPage == 0 ? this.newsList.list : this.newsList.list.concat(result.data.list); | ||
75 | + this.params.page = this.params.page + 1; | ||
76 | + this.newsList.page = result.data.page; | ||
77 | + this.newsList.totalPage = result.data.totalPage; | ||
78 | + if (this.newsList.page < this.newsList.totalPage) { | ||
79 | + this.newsList.isMoreData = true; | ||
80 | + } else { | ||
81 | + this.newsList.isMoreData = false; | ||
82 | + } | ||
83 | + } | ||
84 | + }, | ||
85 | + | ||
53 | async onPullingUp() { | 86 | 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); | 87 | + if (!this.newsList.isMoreData) { |
88 | + this.$refs.scroll.forceUpdate() | ||
89 | + return; | ||
90 | + } | ||
91 | + this.fetchList(this.params); | ||
63 | this.$refs.scroll.forceUpdate(); | 92 | this.$refs.scroll.forceUpdate(); |
64 | } | 93 | } |
65 | }, | 94 | }, |
@@ -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 | }; |
@@ -43,7 +43,7 @@ import { createNamespacedHelpers } from "vuex"; | @@ -43,7 +43,7 @@ import { createNamespacedHelpers } from "vuex"; | ||
43 | import InputUfo from "../price-change/components/input-ufo"; | 43 | import InputUfo from "../price-change/components/input-ufo"; |
44 | import { debounce } from "lodash"; | 44 | import { debounce } from "lodash"; |
45 | 45 | ||
46 | -const { mapActions, mapMutations } = createNamespacedHelpers("order/orderList"); | 46 | +const { mapActions } = createNamespacedHelpers("order/orderList"); |
47 | export default { | 47 | export default { |
48 | components: { InputUfo }, | 48 | components: { InputUfo }, |
49 | props: { | 49 | props: { |
@@ -58,6 +58,10 @@ export default { | @@ -58,6 +58,10 @@ export default { | ||
58 | orderCode: { | 58 | orderCode: { |
59 | type: Number, | 59 | type: Number, |
60 | default: 0 | 60 | default: 0 |
61 | + }, | ||
62 | + onChangePrice: { | ||
63 | + type: Function, | ||
64 | + default: () => {} | ||
61 | } | 65 | } |
62 | }, | 66 | }, |
63 | data() { | 67 | data() { |
@@ -81,8 +85,7 @@ export default { | @@ -81,8 +85,7 @@ export default { | ||
81 | this.inputChange = debounce(this.onChange.bind(this), 500); | 85 | this.inputChange = debounce(this.onChange.bind(this), 500); |
82 | }, | 86 | }, |
83 | methods: { | 87 | methods: { |
84 | - ...mapActions(["computeChangePrice", "changePrice"]), | ||
85 | - ...mapMutations(["setChangePrice"]), | 88 | + ...mapActions(["computeChangePrice"]), |
86 | async onChange(price) { | 89 | async onChange(price) { |
87 | if (this.checkPrice(price)) { | 90 | if (this.checkPrice(price)) { |
88 | const res = await this.computeChangePrice({ | 91 | const res = await this.computeChangePrice({ |
@@ -91,13 +94,13 @@ export default { | @@ -91,13 +94,13 @@ export default { | ||
91 | }); | 94 | }); |
92 | if (typeof res === "string") { | 95 | if (typeof res === "string") { |
93 | this.errorTip = res; | 96 | this.errorTip = res; |
94 | - this.setChangePrice(0); | 97 | + this.onChangePrice(0); |
95 | } else { | 98 | } else { |
96 | this.computePrice = res; | 99 | this.computePrice = res; |
97 | - this.setChangePrice(price); | 100 | + this.onChangePrice(price); |
98 | } | 101 | } |
99 | } else { | 102 | } else { |
100 | - this.setChangePrice(0); | 103 | + this.onChangePrice(0); |
101 | } | 104 | } |
102 | }, | 105 | }, |
103 | checkPrice(price) { | 106 | checkPrice(price) { |
@@ -135,7 +135,7 @@ export default { | @@ -135,7 +135,7 @@ export default { | ||
135 | this.$router.push({ | 135 | this.$router.push({ |
136 | name: 'addressEdit', | 136 | name: 'addressEdit', |
137 | query: { | 137 | query: { |
138 | - fromPage: 'order-list' | 138 | + fromPage: 'OrderList' |
139 | } | 139 | } |
140 | }); | 140 | }); |
141 | break; | 141 | break; |
@@ -5,13 +5,14 @@ import { createNamespacedHelpers } from 'vuex'; | @@ -5,13 +5,14 @@ import { createNamespacedHelpers } from 'vuex'; | ||
5 | import DialogConfirmInfo from '../components/dialog-confirm-info'; | 5 | import DialogConfirmInfo from '../components/dialog-confirm-info'; |
6 | import DialogChangeBidPrice from '../components/dialog-change-bid-price'; | 6 | import DialogChangeBidPrice from '../components/dialog-change-bid-price'; |
7 | 7 | ||
8 | -const { mapActions, mapMutations, mapState } = createNamespacedHelpers( | ||
9 | - 'order/orderList', | ||
10 | -); | 8 | +const { mapActions, mapMutations } = createNamespacedHelpers('order/orderList'); |
11 | 9 | ||
12 | export default { | 10 | export default { |
13 | - computed: { | ||
14 | - ...mapState(['changePrice']), | 11 | + data() { |
12 | + return { | ||
13 | + // 求购调价 | ||
14 | + changePrice: 0, | ||
15 | + }; | ||
15 | }, | 16 | }, |
16 | methods: { | 17 | methods: { |
17 | ...mapActions([ | 18 | ...mapActions([ |
@@ -199,7 +200,7 @@ export default { | @@ -199,7 +200,7 @@ export default { | ||
199 | if (!this.changePrice) { | 200 | if (!this.changePrice) { |
200 | return; | 201 | return; |
201 | } | 202 | } |
202 | - const isOk = await this.confirmChangePrice({ | 203 | + const { isOk, errMsg = '' } = await this.confirmChangePrice({ |
203 | price: this.changePrice, | 204 | price: this.changePrice, |
204 | orderCode, | 205 | orderCode, |
205 | }); | 206 | }); |
@@ -211,6 +212,13 @@ export default { | @@ -211,6 +212,13 @@ export default { | ||
211 | this.resetData(); | 212 | this.resetData(); |
212 | this.fetchData(this.$route.params); | 213 | this.fetchData(this.$route.params); |
213 | } | 214 | } |
215 | + } else { | ||
216 | + if (errMsg) { | ||
217 | + this.$createToast({ | ||
218 | + type: 'alert', | ||
219 | + txt: errMsg, | ||
220 | + }); | ||
221 | + } | ||
214 | } | 222 | } |
215 | }, | 223 | }, |
216 | }, | 224 | }, |
@@ -221,6 +229,7 @@ export default { | @@ -221,6 +229,7 @@ export default { | ||
221 | computePriceInfo, | 229 | computePriceInfo, |
222 | goodsInfo, | 230 | goodsInfo, |
223 | orderCode, | 231 | orderCode, |
232 | + onChangePrice: v => (this.changePrice = v), | ||
224 | }, | 233 | }, |
225 | slot: 'content', | 234 | slot: 'content', |
226 | }), | 235 | }), |
@@ -13,7 +13,7 @@ export default { | @@ -13,7 +13,7 @@ export default { | ||
13 | methods: { | 13 | methods: { |
14 | ...mapActions(['cancelTradeConfirmInfo', 'cancelTrade']), | 14 | ...mapActions(['cancelTradeConfirmInfo', 'cancelTrade']), |
15 | ...inSaleMapMutations(['filterInSaleOrderList']), | 15 | ...inSaleMapMutations(['filterInSaleOrderList']), |
16 | - async onSaleOrderAction({ action, order, isDetail = false } = {}) { | 16 | + async onInSaleOrderAction({ action, order, isDetail = false } = {}) { |
17 | const { owner = ownType.SELL } = this.$route.params; | 17 | const { owner = ownType.SELL } = this.$route.params; |
18 | const { orderCode, earnestMoney = 0 } = order; | 18 | const { orderCode, earnestMoney = 0 } = order; |
19 | 19 |
@@ -25,12 +25,8 @@ | @@ -25,12 +25,8 @@ | ||
25 | <!-- 商品信息 --> | 25 | <!-- 商品信息 --> |
26 | <order-item-info class="item-wrapper" /> | 26 | <order-item-info class="item-wrapper" /> |
27 | <!-- 鉴定视频 --> | 27 | <!-- 鉴定视频 --> |
28 | - <div | ||
29 | - class="video-img" | ||
30 | - v-if="orderDetail.appraiseVideoUrl" | ||
31 | - @click="() => onVideoHandler()" | ||
32 | - ></div> | ||
33 | - <div ref="videoWrapper" class="video-wrapper"> | 28 | + <div class="video-img" v-if="orderDetail.appraiseVideoUrl" @click="() => onVideoHandler()"></div> |
29 | + <div class="video-wrapper"> | ||
34 | <VideoPlayer | 30 | <VideoPlayer |
35 | ref="videoPlayer" | 31 | ref="videoPlayer" |
36 | class="video-player" | 32 | class="video-player" |
@@ -97,17 +93,6 @@ | @@ -97,17 +93,6 @@ | ||
97 | </p> | 93 | </p> |
98 | </div> | 94 | </div> |
99 | </div> | 95 | </div> |
100 | - <!-- 操作 --> | ||
101 | - <!-- <detail-footer> | ||
102 | - <template #tip="{orderDetail, statusDetail}"> | ||
103 | - <div v-if="statusDetail.status === 0"> | ||
104 | - <p class="real-pay-price"> | ||
105 | - ¥{{ orderDetail.priceInfo.realPayPrice }} | ||
106 | - </p> | ||
107 | - <p>实付金额</p> | ||
108 | - </div> | ||
109 | - </template> | ||
110 | - </detail-footer>--> | ||
111 | 96 | ||
112 | <div v-if="actionList.length > 0" class="footer-wrapper"> | 97 | <div v-if="actionList.length > 0" class="footer-wrapper"> |
113 | <div v-if="statusDetail.status === 0"> | 98 | <div v-if="statusDetail.status === 0"> |
@@ -139,7 +124,7 @@ import DetailFooter from "./components//detail-footer"; | @@ -139,7 +124,7 @@ import DetailFooter from "./components//detail-footer"; | ||
139 | import OrderActions from "../components/order-actions"; | 124 | import OrderActions from "../components/order-actions"; |
140 | import VideoPlayer from "../order-list/components/video-player"; | 125 | import VideoPlayer from "../order-list/components/video-player"; |
141 | 126 | ||
142 | -import orderBuyActionMixin from "../mixin/order-buy"; | 127 | +import orderActionMixin from "../mixin/order-action"; |
143 | 128 | ||
144 | const STORE_PATH = "order/orderDetail"; | 129 | const STORE_PATH = "order/orderDetail"; |
145 | 130 | ||
@@ -148,7 +133,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | @@ -148,7 +133,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | ||
148 | ); | 133 | ); |
149 | 134 | ||
150 | export default { | 135 | export default { |
151 | - mixins: [orderBuyActionMixin], | 136 | + mixins: [orderActionMixin], |
152 | components: { | 137 | components: { |
153 | AddressInfo, | 138 | AddressInfo, |
154 | OrderItemInfo, | 139 | OrderItemInfo, |
@@ -226,12 +211,13 @@ export default { | @@ -226,12 +211,13 @@ export default { | ||
226 | } | 211 | } |
227 | 212 | ||
228 | .video-img { | 213 | .video-img { |
214 | + display: block; | ||
229 | margin-top: 40px; | 215 | margin-top: 40px; |
230 | - margin-left: -15px; | ||
231 | - width: calc(100% + 20px); | 216 | + width: 100%; |
232 | height: 378px; | 217 | height: 378px; |
233 | - background: url("~statics/image/order/video-big@3x.png"); | 218 | + background: url("~statics/image/order/video-big@3x.png") no-repeat; |
234 | background-size: cover; | 219 | background-size: cover; |
220 | + background-position: center; | ||
235 | } | 221 | } |
236 | 222 | ||
237 | .video-wrapper { | 223 | .video-wrapper { |
@@ -240,7 +226,7 @@ export default { | @@ -240,7 +226,7 @@ export default { | ||
240 | 226 | ||
241 | .video-player { | 227 | .video-player { |
242 | display: block; | 228 | display: block; |
243 | - height: 30px; | 229 | + height: 40px; |
244 | opacity: 0; | 230 | opacity: 0; |
245 | } | 231 | } |
246 | 232 |
@@ -79,7 +79,11 @@ | @@ -79,7 +79,11 @@ | ||
79 | :order="orderDetail" | 79 | :order="orderDetail" |
80 | @on-action=" | 80 | @on-action=" |
81 | action => { | 81 | action => { |
82 | - onSaleOrderAction({ action, order: orderDetail, isDetail: true }); | 82 | + onInSaleOrderAction({ |
83 | + action, | ||
84 | + order: orderDetail, | ||
85 | + isDetail: true | ||
86 | + }); | ||
83 | onAction({ action, order: orderDetail, isDetail: true }); | 87 | onAction({ action, order: orderDetail, isDetail: true }); |
84 | } | 88 | } |
85 | " | 89 | " |
@@ -101,8 +105,8 @@ import DetailFooter from "./components//detail-footer"; | @@ -101,8 +105,8 @@ import DetailFooter from "./components//detail-footer"; | ||
101 | 105 | ||
102 | import OrderActions from "../components/order-actions"; | 106 | import OrderActions from "../components/order-actions"; |
103 | 107 | ||
104 | -import orderBuyActionMixin from "../mixin/order-buy"; | ||
105 | -import orderSellActionMixin from "../mixin/order-sell"; | 108 | +import orderActionMixin from "../mixin/order-action"; |
109 | +import orderInSaleActionMixin from "../mixin/order-in-sale-action"; | ||
106 | 110 | ||
107 | import PlatformFeeInfo from "../components/platform-fee-info"; | 111 | import PlatformFeeInfo from "../components/platform-fee-info"; |
108 | 112 | ||
@@ -113,7 +117,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | @@ -113,7 +117,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | ||
113 | ); | 117 | ); |
114 | 118 | ||
115 | export default { | 119 | export default { |
116 | - mixins: [orderBuyActionMixin, orderSellActionMixin], | 120 | + mixins: [orderActionMixin, orderInSaleActionMixin], |
117 | components: { | 121 | components: { |
118 | AddressInfo, | 122 | AddressInfo, |
119 | OrderItemInfo, | 123 | OrderItemInfo, |
@@ -130,19 +130,26 @@ export default { | @@ -130,19 +130,26 @@ export default { | ||
130 | } | 130 | } |
131 | }, | 131 | }, |
132 | methods: { | 132 | methods: { |
133 | - parentHandleclick() { | ||
134 | - this.showVideo = true; | 133 | + async parentHandleclick() { |
134 | + // await this.delay(1000); | ||
135 | this.player.play(); | 135 | this.player.play(); |
136 | + | ||
136 | const timeId = setTimeout(() => { | 137 | const timeId = setTimeout(() => { |
137 | this.player.requestFullscreen(); | 138 | this.player.requestFullscreen(); |
138 | clearTimeout(timeId); | 139 | clearTimeout(timeId); |
139 | }); | 140 | }); |
140 | }, | 141 | }, |
142 | + delay(ns) { | ||
143 | + return new Promise(resolve => { | ||
144 | + setTimeout(resolve, ns); | ||
145 | + }); | ||
146 | + }, | ||
141 | showPlayer() { | 147 | showPlayer() { |
142 | if (this.showVideo || !this.source) { | 148 | if (this.showVideo || !this.source) { |
143 | return; | 149 | return; |
144 | } | 150 | } |
145 | 151 | ||
152 | + this.showVideo = true; | ||
146 | this.$nextTick(() => { | 153 | this.$nextTick(() => { |
147 | this.initPlayer(); | 154 | this.initPlayer(); |
148 | }); | 155 | }); |
@@ -187,14 +194,6 @@ export default { | @@ -187,14 +194,6 @@ export default { | ||
187 | this.voiceBtn.removeClass(noVioceClass); | 194 | this.voiceBtn.removeClass(noVioceClass); |
188 | } | 195 | } |
189 | }); | 196 | }); |
190 | - | ||
191 | - // setTimeout(() => { | ||
192 | - // this.$yoho.getNetStatus({}, res => { | ||
193 | - // if (res && +res.wifi === 1) { | ||
194 | - // this.player.autoplay("muted"); | ||
195 | - // } | ||
196 | - // }); | ||
197 | - // }, 1000); | ||
198 | }, | 197 | }, |
199 | getTime() { | 198 | getTime() { |
200 | return new Date().getTime(); | 199 | return new Date().getTime(); |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | <div class="content-wrapper"> | 3 | <div class="content-wrapper"> |
4 | <scroll | 4 | <scroll |
5 | @pulling-up="fetchData" | 5 | @pulling-up="fetchData" |
6 | + @pulling-down="onRefresh" | ||
6 | :options="options" | 7 | :options="options" |
7 | :data="orderList" | 8 | :data="orderList" |
8 | class="order-list-scroll-wrap" | 9 | class="order-list-scroll-wrap" |
@@ -17,7 +18,7 @@ | @@ -17,7 +18,7 @@ | ||
17 | <order-actions | 18 | <order-actions |
18 | class="actions" | 19 | class="actions" |
19 | :order="order" | 20 | :order="order" |
20 | - @on-action="action => onSaleOrderAction({ action, order })" | 21 | + @on-action="action => onInSaleOrderAction({ action, order })" |
21 | /> | 22 | /> |
22 | </div> | 23 | </div> |
23 | </li> | 24 | </li> |
@@ -43,7 +44,7 @@ import EmptyList from "components//ufo-no-item"; | @@ -43,7 +44,7 @@ import EmptyList from "components//ufo-no-item"; | ||
43 | import OrderActions from "../components/order-actions"; | 44 | import OrderActions from "../components/order-actions"; |
44 | import CountDown from "../components/count-down"; | 45 | import CountDown from "../components/count-down"; |
45 | 46 | ||
46 | -import orderSellActionMixin from "../mixin/order-sell"; | 47 | +import orderInSaleActionMixin from "../mixin/order-in-sale-action"; |
47 | 48 | ||
48 | const IN_SALE_STORE_PATH = "order/inSaleOrderList"; | 49 | const IN_SALE_STORE_PATH = "order/inSaleOrderList"; |
49 | 50 | ||
@@ -56,7 +57,7 @@ const { | @@ -56,7 +57,7 @@ const { | ||
56 | 57 | ||
57 | export default { | 58 | export default { |
58 | // 订单操作 | 59 | // 订单操作 |
59 | - mixins: [orderSellActionMixin], | 60 | + mixins: [orderInSaleActionMixin], |
60 | components: { | 61 | components: { |
61 | Scroll, | 62 | Scroll, |
62 | OrderItem, | 63 | OrderItem, |
@@ -88,6 +89,11 @@ export default { | @@ -88,6 +89,11 @@ export default { | ||
88 | }, | 89 | }, |
89 | methods: { | 90 | methods: { |
90 | ...mapActions(["fetchEntryOrderList", "fetchNotEntryOrderList"]), | 91 | ...mapActions(["fetchEntryOrderList", "fetchNotEntryOrderList"]), |
92 | + ...mapMutations(["resetData"]), | ||
93 | + onRefresh() { | ||
94 | + this.resetData(); | ||
95 | + this.fetchData(); | ||
96 | + }, | ||
91 | fetchData() { | 97 | fetchData() { |
92 | if (this.isFetchEntryOrder) { | 98 | if (this.isFetchEntryOrder) { |
93 | this.fetchEntryOrderList(); | 99 | this.fetchEntryOrderList(); |
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | <div class="content-wrapper"> | 4 | <div class="content-wrapper"> |
5 | <scroll | 5 | <scroll |
6 | @pulling-up="fetchData" | 6 | @pulling-up="fetchData" |
7 | + @pulling-down="onRefresh" | ||
7 | :options="options" | 8 | :options="options" |
8 | :data="orderList" | 9 | :data="orderList" |
9 | class="order-list-scroll-wrap" | 10 | class="order-list-scroll-wrap" |
@@ -23,13 +24,13 @@ | @@ -23,13 +24,13 @@ | ||
23 | @on-action=" | 24 | @on-action=" |
24 | action => { | 25 | action => { |
25 | onAction({ action, order }); | 26 | onAction({ action, order }); |
26 | - onSaleOrderAction({ action, order }); | 27 | + onInSaleOrderAction({ action, order }); |
27 | } | 28 | } |
28 | " | 29 | " |
29 | @on-video="params => onVideoHandle(params)" | 30 | @on-video="params => onVideoHandle(params)" |
30 | /> | 31 | /> |
31 | </div> | 32 | </div> |
32 | - <div ref="videoWrapper" class="video-wrapper"> | 33 | + <div class="video-wrapper"> |
33 | <VideoPlayer | 34 | <VideoPlayer |
34 | :ref="order.orderCode" | 35 | :ref="order.orderCode" |
35 | class="video-player" | 36 | class="video-player" |
@@ -41,6 +42,7 @@ | @@ -41,6 +42,7 @@ | ||
41 | </scroll> | 42 | </scroll> |
42 | 43 | ||
43 | <empty-list | 44 | <empty-list |
45 | + @touch.prevent | ||
44 | class="empty-wrapper" | 46 | class="empty-wrapper" |
45 | tip="这里什么都没有..." | 47 | tip="这里什么都没有..." |
46 | v-show="isShowEmpty" | 48 | v-show="isShowEmpty" |
@@ -63,16 +65,18 @@ import EmptyList from "components//ufo-no-item"; | @@ -63,16 +65,18 @@ import EmptyList from "components//ufo-no-item"; | ||
63 | import OrderActions from "../components/order-actions"; | 65 | import OrderActions from "../components/order-actions"; |
64 | import CountDown from "../components/count-down"; | 66 | import CountDown from "../components/count-down"; |
65 | 67 | ||
66 | -import orderBuyActionMixin from "../mixin/order-buy"; | ||
67 | -import orderSellActionMixin from "../mixin/order-sell"; | 68 | +import orderActionMixin from "../mixin/order-action"; |
69 | +import orderInSaleActionMixin from "../mixin/order-in-sale-action"; | ||
68 | 70 | ||
69 | const STORE_PATH = "order/orderList"; | 71 | const STORE_PATH = "order/orderList"; |
70 | 72 | ||
71 | -const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH); | 73 | +const { mapActions, mapState, mapMutations } = createNamespacedHelpers( |
74 | + STORE_PATH | ||
75 | +); | ||
72 | 76 | ||
73 | export default { | 77 | export default { |
74 | // 订单操作 | 78 | // 订单操作 |
75 | - mixins: [orderBuyActionMixin, orderSellActionMixin], | 79 | + mixins: [orderActionMixin, orderInSaleActionMixin], |
76 | components: { | 80 | components: { |
77 | Scroll, | 81 | Scroll, |
78 | OrderItem, | 82 | OrderItem, |
@@ -105,9 +109,14 @@ export default { | @@ -105,9 +109,14 @@ export default { | ||
105 | 109 | ||
106 | methods: { | 110 | methods: { |
107 | ...mapActions(["fetchOrderList", "confirmReceipt"]), | 111 | ...mapActions(["fetchOrderList", "confirmReceipt"]), |
112 | + ...mapMutations(["resetData"]), | ||
108 | fetchData() { | 113 | fetchData() { |
109 | this.fetchOrderList(this.$route.params); | 114 | this.fetchOrderList(this.$route.params); |
110 | }, | 115 | }, |
116 | + onRefresh() { | ||
117 | + this.resetData(); | ||
118 | + this.fetchData(); | ||
119 | + }, | ||
111 | onVideoHandle({ videoUrl, orderCode }) { | 120 | onVideoHandle({ videoUrl, orderCode }) { |
112 | if (!videoUrl) { | 121 | if (!videoUrl) { |
113 | return; | 122 | return; |
@@ -117,15 +126,6 @@ export default { | @@ -117,15 +126,6 @@ export default { | ||
117 | $video.parentHandleclick(); | 126 | $video.parentHandleclick(); |
118 | } | 127 | } |
119 | } | 128 | } |
120 | - }, | ||
121 | - | ||
122 | - mounted() { | ||
123 | - if (this.$yoho.isAndroid) { | ||
124 | - this.$refs.videoWrapper.forEach($vnode => { | ||
125 | - $vnode.style.position = "absolute"; | ||
126 | - $vnode.style.top = "-1000px"; | ||
127 | - }); | ||
128 | - } | ||
129 | } | 129 | } |
130 | }; | 130 | }; |
131 | </script> | 131 | </script> |
@@ -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', |
@@ -6,8 +6,7 @@ | @@ -6,8 +6,7 @@ | ||
6 | :hasBorderRadius="false" | 6 | :hasBorderRadius="false" |
7 | :emulateMask="true"> | 7 | :emulateMask="true"> |
8 | <div class="buy-sheet"> | 8 | <div class="buy-sheet"> |
9 | - <!-- 临时链接示例 --> | ||
10 | - <a class="header" href="http://m.yohobuy.com">求购<i class="cubeic-question"></i></a> | 9 | + <a class="header" href="https://activity.yoho.cn/feature/6761.html?share_id=9467&title=UFO求购功能说明">求购<i class="cubeic-question"></i></a> |
11 | <div class="title"> | 10 | <div class="title"> |
12 | <div class="title-thumbnail"> | 11 | <div class="title-thumbnail"> |
13 | <square-img :src="imageUrl" :width="300" :height="300"/> | 12 | <square-img :src="imageUrl" :width="300" :height="300"/> |
@@ -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 | }, |
@@ -10,9 +10,6 @@ const initailData = () => ({ | @@ -10,9 +10,6 @@ const initailData = () => ({ | ||
10 | currentStatus: null, | 10 | currentStatus: null, |
11 | routeParamStatus: null, | 11 | routeParamStatus: null, |
12 | isShowEmpty: false, | 12 | isShowEmpty: false, |
13 | - | ||
14 | - // 求购调价 | ||
15 | - changePrice: 0, | ||
16 | }); | 13 | }); |
17 | 14 | ||
18 | export default function() { | 15 | export default function() { |
@@ -52,17 +49,16 @@ export default function() { | @@ -52,17 +49,16 @@ export default function() { | ||
52 | state.pagetotal = 0; | 49 | state.pagetotal = 0; |
53 | state.pullUpLoad = true; | 50 | state.pullUpLoad = true; |
54 | }, | 51 | }, |
55 | - setChangePrice(state, price) { | ||
56 | - state.changePrice = price; | ||
57 | - }, | ||
58 | resetData(state) { | 52 | resetData(state) { |
59 | const s = initailData(); | 53 | const s = initailData(); |
54 | + const keyList = Object.keys(s); | ||
55 | + const keyBlackList = ['currentStatus', 'routeParamStatus']; | ||
60 | 56 | ||
61 | - Object.keys(s).forEach(key => { | ||
62 | - if (key !== 'currentStatus') { | 57 | + for (const key of keyList) { |
58 | + if (!keyBlackList.includes(key)) { | ||
63 | state[key] = s[key]; | 59 | state[key] = s[key]; |
64 | } | 60 | } |
65 | - }); | 61 | + } |
66 | }, | 62 | }, |
67 | }, | 63 | }, |
68 | actions: { | 64 | actions: { |
@@ -178,16 +174,17 @@ export default function() { | @@ -178,16 +174,17 @@ export default function() { | ||
178 | }, | 174 | }, |
179 | 175 | ||
180 | // 买家调价 | 176 | // 买家调价 |
181 | - async confirmChangePrice({ commit }, { orderCode, price }) { | 177 | + async confirmChangePrice(_, { orderCode, price }) { |
182 | const res = await this.$api.post('/api/order/buyerask/changeprice', { | 178 | const res = await this.$api.post('/api/order/buyerask/changeprice', { |
183 | orderCode: `${orderCode}`, | 179 | orderCode: `${orderCode}`, |
184 | price: +price, | 180 | price: +price, |
185 | }); | 181 | }); |
186 | 182 | ||
187 | - if (res.code) { | ||
188 | - commit('setChangePrice', 0); | 183 | + if (res.code === 200) { |
184 | + return { errMsg: '', isOk: true }; | ||
185 | + } else { | ||
186 | + return { errMsg: res.message, isOk: false }; | ||
189 | } | 187 | } |
190 | - return res.code === 200 ? res.data : null; | ||
191 | }, | 188 | }, |
192 | }, | 189 | }, |
193 | getters: {}, | 190 | getters: {}, |
@@ -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 | }, |
@@ -47,7 +47,7 @@ module.exports = (req, res, next) => { | @@ -47,7 +47,7 @@ module.exports = (req, res, next) => { | ||
47 | // Todo 删除 600032996 调价: 500031170 购买: 600043484 | 47 | // Todo 删除 600032996 调价: 500031170 购买: 600043484 |
48 | // 入住商家 50000638 | 48 | // 入住商家 50000638 |
49 | // 梅 500031928 | 49 | // 梅 500031928 |
50 | - req.user.uid = 500031928; | 50 | + // req.user.uid = 500031928; |
51 | 51 | ||
52 | res.locals.isLogin = Boolean(req.user.uid); // 用户是否登录 | 52 | res.locals.isLogin = Boolean(req.user.uid); // 用户是否登录 |
53 | if (_.get(req, 'user.appSessionType') === 'miniapp') { | 53 | if (_.get(req, 'user.appSessionType') === 'miniapp') { |
1 | { | 1 | { |
2 | "name": "xianyu-ufo-app-web", | 2 | "name": "xianyu-ufo-app-web", |
3 | - "version": "0.0.2-beta-23", | 3 | + "version": "0.0.2-beta-25", |
4 | "private": true, | 4 | "private": true, |
5 | "description": "Xianyu Project With Express", | 5 | "description": "Xianyu Project With Express", |
6 | "repository": { | 6 | "repository": { |
-
Please register or login to post a comment