Merge branch 'develop' of http://git.yoho.cn/fe/xianyu-ufo-app-web into develop
Showing
21 changed files
with
166 additions
and
65 deletions
@@ -54,9 +54,6 @@ export default { | @@ -54,9 +54,6 @@ export default { | ||
54 | data() { | 54 | data() { |
55 | return { | 55 | return { |
56 | options: { | 56 | options: { |
57 | - // bounce: { | ||
58 | - // top: false | ||
59 | - // }, | ||
60 | scrollbar: true, | 57 | scrollbar: true, |
61 | pullUpLoad: true, | 58 | pullUpLoad: true, |
62 | pullDownRefresh: true, | 59 | pullDownRefresh: true, |
@@ -90,7 +87,7 @@ export default { | @@ -90,7 +87,7 @@ export default { | ||
90 | searchParams: { | 87 | searchParams: { |
91 | type: 0, // type:0,推荐;1,热销;2,即将发售; 3,品类; 4,品牌;5,系列;6,搜索 7, 收藏 | 88 | type: 0, // type:0,推荐;1,热销;2,即将发售; 3,品类; 4,品牌;5,系列;6,搜索 7, 收藏 |
92 | order: '', // 指定排序 | 89 | order: '', // 指定排序 |
93 | - productPool: null, // 商品池id | 90 | + productPool: null, // 商品池idfetchList |
94 | sort: null, // 品类id | 91 | sort: null, // 品类id |
95 | brand: null, // 品牌id | 92 | brand: null, // 品牌id |
96 | series: null, // 系列id | 93 | series: null, // 系列id |
@@ -178,7 +175,7 @@ export default { | @@ -178,7 +175,7 @@ export default { | ||
178 | return; | 175 | return; |
179 | } | 176 | } |
180 | if (typeof params === 'object' && Object.keys(params)) { | 177 | if (typeof params === 'object' && Object.keys(params)) { |
181 | - searchParams ={...params}; | 178 | + searchParams = {...params}; |
182 | this.searchParams = searchParams; | 179 | this.searchParams = searchParams; |
183 | } | 180 | } |
184 | 181 | ||
@@ -198,7 +195,7 @@ export default { | @@ -198,7 +195,7 @@ export default { | ||
198 | 195 | ||
199 | if (result.code === 200) { | 196 | if (result.code === 200) { |
200 | 197 | ||
201 | - data.endReached = (data.page === data.page_total) && (data.page_size !== 1); | 198 | + data.endReached = (data.page === data.page_total) && (data.page_size !== 1) || !data.page_total; |
202 | } | 199 | } |
203 | 200 | ||
204 | if (typeof data === 'object' && Object.keys(data).length) { | 201 | if (typeof data === 'object' && Object.keys(data).length) { |
@@ -10,14 +10,9 @@ | @@ -10,14 +10,9 @@ | ||
10 | </template> | 10 | </template> |
11 | 11 | ||
12 | <script> | 12 | <script> |
13 | -import Vue from 'vue' | ||
14 | import { Style, ScrollNavBar } from 'cube-ui'; | 13 | import { Style, ScrollNavBar } from 'cube-ui'; |
15 | -import { createNamespacedHelpers } from 'vuex'; | ||
16 | import queryString from 'query-string'; | 14 | import queryString from 'query-string'; |
17 | 15 | ||
18 | -// const { mapState, mapActions } = createNamespacedHelpers('list/channel'); | ||
19 | -const {mapState, mapActions} = createNamespacedHelpers('list'); | ||
20 | - | ||
21 | export default { | 16 | export default { |
22 | name: 'slide', | 17 | name: 'slide', |
23 | props: { | 18 | props: { |
@@ -28,39 +23,38 @@ export default { | @@ -28,39 +23,38 @@ export default { | ||
28 | current: { | 23 | current: { |
29 | type: Number, | 24 | type: Number, |
30 | default: true | 25 | default: true |
31 | - } | 26 | + }, |
32 | }, | 27 | }, |
33 | data() { | 28 | data() { |
34 | return { | 29 | return { |
35 | index: 0, | 30 | index: 0, |
36 | - // current: this.list[0].title, | 31 | + |
37 | labels: [], | 32 | labels: [], |
38 | - } | 33 | + }; |
39 | }, | 34 | }, |
40 | components: { | 35 | components: { |
41 | Style, | 36 | Style, |
42 | ScrollNavBar | 37 | ScrollNavBar |
43 | }, | 38 | }, |
44 | - computed: { | ||
45 | - ...mapState(['productList']), | ||
46 | - }, | ||
47 | mounted() { | 39 | mounted() { |
48 | - this.list.map((res) => { this.labels.push(res.title) }); | 40 | + this.list.map((res) => { |
41 | + this.labels.push(res.title); | ||
42 | + }); | ||
49 | }, | 43 | }, |
50 | created() { | 44 | created() { |
51 | 45 | ||
52 | }, | 46 | }, |
53 | methods: { | 47 | methods: { |
54 | - ...mapActions(['fetchProductList']), | ||
55 | changeHandler(cur) { | 48 | changeHandler(cur) { |
56 | let index = this.$refs[`getindex${cur}`].innerText; | 49 | let index = this.$refs[`getindex${cur}`].innerText; |
57 | - let url = this.list[index].url.split("?"); | 50 | + let url = this.list[index].url.split('?'); |
58 | let urlParams = queryString.parse(url[1]); | 51 | let urlParams = queryString.parse(url[1]); |
59 | let params = urlParams; | 52 | let params = urlParams; |
53 | + | ||
60 | params.isReset = true; | 54 | params.isReset = true; |
61 | - this.fetchProductList(params); | ||
62 | - this.$emit('transfer',index); | ||
63 | - console.log(params) | 55 | + console.log(this.$parent); |
56 | + this.$parent.$parent.$parent.fetchList && this.$parent.$parent.$parent.fetchList(params); | ||
57 | + this.$emit('transfer', index); | ||
64 | } | 58 | } |
65 | } | 59 | } |
66 | }; | 60 | }; |
@@ -54,7 +54,10 @@ export default { | @@ -54,7 +54,10 @@ export default { | ||
54 | methods: { | 54 | methods: { |
55 | ...mapActions(['fetchNewsList', 'fetchNewsTabList']), | 55 | ...mapActions(['fetchNewsList', 'fetchNewsTabList']), |
56 | async onPullingUp() { | 56 | async onPullingUp() { |
57 | - if (!this.newsList.isMoreData ) return false; | 57 | + if (!this.newsList.isMoreData) { |
58 | + this.$refs.scroll.forceUpdate(); | ||
59 | + return false | ||
60 | + } | ||
58 | let params = { | 61 | let params = { |
59 | type: '', | 62 | type: '', |
60 | isPage: false | 63 | isPage: false |
@@ -52,12 +52,16 @@ export default { | @@ -52,12 +52,16 @@ export default { | ||
52 | methods: { | 52 | methods: { |
53 | ...mapActions(['fetchNewsList']), | 53 | ...mapActions(['fetchNewsList']), |
54 | async onPullingUp() { | 54 | async onPullingUp() { |
55 | - if (!this.newsDeatilList.isMoreData ) return false; | 55 | + if (!this.newsDeatilList.isMoreData ) { |
56 | + this.$refs.scroll.forceUpdate(); | ||
57 | + return false | ||
58 | + }; | ||
56 | let params = { | 59 | let params = { |
57 | type: this.type, | 60 | type: this.type, |
58 | isPage: false | 61 | isPage: false |
59 | } | 62 | } |
60 | await this.fetchNewsList(params); | 63 | await this.fetchNewsList(params); |
64 | + this.$refs.scroll.forceUpdate(); | ||
61 | } | 65 | } |
62 | }, | 66 | }, |
63 | components: { | 67 | components: { |
@@ -156,7 +156,7 @@ export default { | @@ -156,7 +156,7 @@ export default { | ||
156 | 156 | ||
157 | if (result.code === 200) { | 157 | if (result.code === 200) { |
158 | 158 | ||
159 | - data.endReached = (data.page === data.page_total) && (data.page_size !== 1); | 159 | + data.endReached = (data.page === data.page_total) && (data.page_size !== 1) || !data.page_total; |
160 | } | 160 | } |
161 | 161 | ||
162 | if (typeof data === 'object' && Object.keys(data).length) { | 162 | if (typeof data === 'object' && Object.keys(data).length) { |
@@ -14,9 +14,15 @@ | @@ -14,9 +14,15 @@ | ||
14 | <div class="productPrice"> | 14 | <div class="productPrice"> |
15 | <span class="size">{{sizeInfo}}</span> | 15 | <span class="size">{{sizeInfo}}</span> |
16 | <div class="pricedetail"> | 16 | <div class="pricedetail"> |
17 | + <div> | ||
17 | <span class="priceTitle">最低售价: </span> | 18 | <span class="priceTitle">最低售价: </span> |
18 | <span class="price">{{originProductData.least_price || '-'}}</span> | 19 | <span class="price">{{originProductData.least_price || '-'}}</span> |
19 | </div> | 20 | </div> |
21 | + <div> | ||
22 | + <span class="priceTitle">最高求购价: </span> | ||
23 | + <span class="price">{{originProductData.bid_moster_price || '-'}}</span> | ||
24 | + </div> | ||
25 | + </div> | ||
20 | </div> | 26 | </div> |
21 | </div> | 27 | </div> |
22 | <div class="inputView"> | 28 | <div class="inputView"> |
@@ -97,7 +103,7 @@ export default { | @@ -97,7 +103,7 @@ export default { | ||
97 | return { | 103 | return { |
98 | inputPrice: '', | 104 | inputPrice: '', |
99 | isAgreeTerms: false, | 105 | isAgreeTerms: false, |
100 | - url: `http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}`, | 106 | + url: 'http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}', |
101 | agreeDesc: '有货买家协议' | 107 | agreeDesc: '有货买家协议' |
102 | }; | 108 | }; |
103 | }, | 109 | }, |
@@ -128,14 +134,24 @@ export default { | @@ -128,14 +134,24 @@ export default { | ||
128 | 134 | ||
129 | }, | 135 | }, |
130 | 136 | ||
137 | + beforeRouteEnter (to, from, next) { | ||
138 | + | ||
139 | + next(vm => { | ||
140 | + // 通过 `vm` 访问组件实例 | ||
141 | + vm.inputPrice = ''; | ||
142 | + vm.BUYER_ASK_RESET_DATA(); | ||
143 | + }); | ||
144 | + | ||
145 | + }, | ||
146 | + | ||
131 | mounted() { | 147 | mounted() { |
132 | - this.BUYER_ASK_RESET_DATA(); | 148 | + |
133 | this.BUYER_ASK_SET_STORAGEID(this.storageId); | 149 | this.BUYER_ASK_SET_STORAGEID(this.storageId); |
134 | this.fetchBuyerOrderCount({ tabType: 'buy'}); | 150 | this.fetchBuyerOrderCount({ tabType: 'buy'}); |
135 | this.fetchConfig(); | 151 | this.fetchConfig(); |
136 | - this.$on("addressinfo", function (address) { | ||
137 | - console.log(address) | ||
138 | - }) | 152 | + this.$on('addressinfo', function(address) { |
153 | + console.log(address); | ||
154 | + }); | ||
139 | }, | 155 | }, |
140 | 156 | ||
141 | watch: { | 157 | watch: { |
@@ -150,6 +166,14 @@ export default { | @@ -150,6 +166,14 @@ export default { | ||
150 | if (val) { | 166 | if (val) { |
151 | this.showDialog(); | 167 | this.showDialog(); |
152 | } | 168 | } |
169 | + }, | ||
170 | + | ||
171 | + addressInfo(val) { | ||
172 | + | ||
173 | + if (this.inputPrice && val) { | ||
174 | + this.computePrice(); | ||
175 | + } | ||
176 | + | ||
153 | } | 177 | } |
154 | }, | 178 | }, |
155 | 179 | ||
@@ -173,7 +197,7 @@ export default { | @@ -173,7 +197,7 @@ export default { | ||
173 | if (this.originProductData.least_price && this.originProductData.skup && this.originProductData.least_price <= this.inputPrice) { | 197 | if (this.originProductData.least_price && this.originProductData.skup && this.originProductData.least_price <= this.inputPrice) { |
174 | this.showBuyDialog(); | 198 | this.showBuyDialog(); |
175 | } else { | 199 | } else { |
176 | - this.buyerCompute({price: this.inputPrice, storage_id: this.storageId }); | 200 | + this.computePrice(); |
177 | } | 201 | } |
178 | }, 500, {leading: false, trailing: true}), | 202 | }, 500, {leading: false, trailing: true}), |
179 | 203 | ||
@@ -214,7 +238,7 @@ export default { | @@ -214,7 +238,7 @@ export default { | ||
214 | }); | 238 | }); |
215 | }, | 239 | }, |
216 | onCancel: () => { | 240 | onCancel: () => { |
217 | - this.buyerCompute({price: this.inputPrice, storage_id: this.storageId }); | 241 | + this.computePrice(); |
218 | } | 242 | } |
219 | }).show(); | 243 | }).show(); |
220 | }, | 244 | }, |
@@ -241,7 +265,7 @@ export default { | @@ -241,7 +265,7 @@ export default { | ||
241 | }, | 265 | }, |
242 | 266 | ||
243 | onConfirm: () => { | 267 | onConfirm: () => { |
244 | - this.publishProduct() | 268 | + this.publishProduct(); |
245 | }, | 269 | }, |
246 | 270 | ||
247 | onCancel: () => { | 271 | onCancel: () => { |
@@ -250,7 +274,7 @@ export default { | @@ -250,7 +274,7 @@ export default { | ||
250 | 274 | ||
251 | }).show(); | 275 | }).show(); |
252 | } else { | 276 | } else { |
253 | - this.publishProduct() | 277 | + this.publishProduct(); |
254 | } | 278 | } |
255 | 279 | ||
256 | }, | 280 | }, |
@@ -265,8 +289,17 @@ export default { | @@ -265,8 +289,17 @@ export default { | ||
265 | }); | 289 | }); |
266 | }, | 290 | }, |
267 | 291 | ||
292 | + computePrice() { | ||
293 | + if (!this.inputPrice) { | ||
294 | + console.log('inputPrice is null') | ||
295 | + return; | ||
296 | + } | ||
297 | + this.buyerCompute({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id || '' }); | ||
298 | + }, | ||
299 | + | ||
268 | payOrder() { | 300 | payOrder() { |
269 | let vm = this; | 301 | let vm = this; |
302 | + | ||
270 | this.$createOrderPayType({ | 303 | this.$createOrderPayType({ |
271 | price: get(this.publishresult, 'depositAmount', ''), | 304 | price: get(this.publishresult, 'depositAmount', ''), |
272 | desc: '保证金', | 305 | desc: '保证金', |
@@ -372,11 +405,8 @@ export default { | @@ -372,11 +405,8 @@ export default { | ||
372 | } | 405 | } |
373 | 406 | ||
374 | .pricedetail { | 407 | .pricedetail { |
375 | - display: flex; | ||
376 | - flex-direction: row; | ||
377 | height: 30*2px; | 408 | height: 30*2px; |
378 | margin-top: 5*2px; | 409 | margin-top: 5*2px; |
379 | - align-items: flex-end; | ||
380 | } | 410 | } |
381 | 411 | ||
382 | .priceTitle { | 412 | .priceTitle { |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <div class="product-price"> | 5 | <div class="product-price"> |
6 | <div class="product-price-wrapper"> | 6 | <div class="product-price-wrapper"> |
7 | <div class="price">{{data.colorName}},{{data.sizeName}}</div> | 7 | <div class="price">{{data.colorName}},{{data.sizeName}}</div> |
8 | - <div class="tip">最低售价:<span class="price2">¥{{data.goodPrice}}</span></div> | 8 | + <div class="tip">{{ priceType || '最低售价:'}} <span class="price2">¥{{data.goodPrice}}</span></div> |
9 | </div> | 9 | </div> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
@@ -20,6 +20,9 @@ export default { | @@ -20,6 +20,9 @@ export default { | ||
20 | default() { | 20 | default() { |
21 | return {}; | 21 | return {}; |
22 | } | 22 | } |
23 | + }, | ||
24 | + priceType: { | ||
25 | + type: String, | ||
23 | } | 26 | } |
24 | } | 27 | } |
25 | }; | 28 | }; |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <LayoutApp :show-back="true"> | 3 | <LayoutApp :show-back="true"> |
4 | <div class="body"> | 4 | <div class="body"> |
5 | <TitleComp txt="变现"></TitleComp> | 5 | <TitleComp txt="变现"></TitleComp> |
6 | - <ProductInfo :data="originProductData" class="product-info"></ProductInfo> | 6 | + <ProductInfo :data="originProductData" class="product-info" :priceType="'最高求购价'"></ProductInfo> |
7 | <div class="inputView"> | 7 | <div class="inputView"> |
8 | <span class="inputViewIcon"> | 8 | <span class="inputViewIcon"> |
9 | ¥ | 9 | ¥ |
@@ -73,6 +73,7 @@ export default { | @@ -73,6 +73,7 @@ export default { | ||
73 | this.$emit('hidden'); | 73 | this.$emit('hidden'); |
74 | }, | 74 | }, |
75 | shown() { | 75 | shown() { |
76 | + this.$emit('shown'); | ||
76 | if (this._shownCallback) { | 77 | if (this._shownCallback) { |
77 | this.$nextTick(() => { | 78 | this.$nextTick(() => { |
78 | this._shownCallback(); | 79 | this._shownCallback(); |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="activity-sheet"> | 3 | <div class="activity-sheet"> |
4 | <h3>活动详情</h3> | 4 | <h3>活动详情</h3> |
5 | <div class="list" > | 5 | <div class="list" > |
6 | - <cube-scroll ref="activityListScroll"> | 6 | + <cube-scroll ref="activityListScroll" :data="list"> |
7 | <ul> | 7 | <ul> |
8 | <li v-for="(item, idx) in list" :key="idx"> | 8 | <li v-for="(item, idx) in list" :key="idx"> |
9 | <div><span>{{item.promotionTypeStr}}</span> {{item.activityName}}</div> | 9 | <div><span>{{item.promotionTypeStr}}</span> {{item.activityName}}</div> |
1 | <template> | 1 | <template> |
2 | - <action-sheet @hidden="onHidden" position="right" ref="popup" | 2 | + <action-sheet position="right" ref="popup" |
3 | + @hidden="onHidden" | ||
4 | + @shown="onShown" | ||
3 | :panelStyle="{background: 'transparent', paddingLeft: '20%'}" | 5 | :panelStyle="{background: 'transparent', paddingLeft: '20%'}" |
4 | :hasBorderRadius="false" | 6 | :hasBorderRadius="false" |
5 | :emulateMask="true"> | 7 | :emulateMask="true"> |
@@ -14,7 +16,7 @@ | @@ -14,7 +16,7 @@ | ||
14 | <div>{{productDetail.product_name}} {{goodsName}}</div> | 16 | <div>{{productDetail.product_name}} {{goodsName}}</div> |
15 | </div> | 17 | </div> |
16 | <div class="size-list"> | 18 | <div class="size-list"> |
17 | - <cube-scroll> | 19 | + <cube-scroll ref="scroll" :data="sizeViewList"> |
18 | <ul> | 20 | <ul> |
19 | <li :class="['size-item', item.available ? '': 'disable']" v-for="(item, idx) in sizeViewList" :key="idx" @click="buy(item)"> | 21 | <li :class="['size-item', item.available ? '': 'disable']" v-for="(item, idx) in sizeViewList" :key="idx" @click="buy(item)"> |
20 | <div class="size"><span>{{item.name}}</span><span v-if="item.subName">{{item.subName}}</span></div> | 22 | <div class="size"><span>{{item.name}}</span><span v-if="item.subName">{{item.subName}}</span></div> |
@@ -74,6 +76,7 @@ export default { | @@ -74,6 +76,7 @@ export default { | ||
74 | available: info.storage_num > 0 && price !== '-', | 76 | available: info.storage_num > 0 && price !== '-', |
75 | skup: info.skup, | 77 | skup: info.skup, |
76 | least_price: info.least_price, | 78 | least_price: info.least_price, |
79 | + bid_moster_price: info.bid_moster_price, | ||
77 | }; | 80 | }; |
78 | }); | 81 | }); |
79 | }, | 82 | }, |
@@ -95,6 +98,12 @@ export default { | @@ -95,6 +98,12 @@ export default { | ||
95 | onHidden() { | 98 | onHidden() { |
96 | this.$emit('hidden'); | 99 | this.$emit('hidden'); |
97 | }, | 100 | }, |
101 | + onShown() { | ||
102 | + // refresh list | ||
103 | + if (this.$refs.scroll) { | ||
104 | + this.$refs.scroll.refresh(); | ||
105 | + } | ||
106 | + }, | ||
98 | buy(product) { | 107 | buy(product) { |
99 | this.$yoho.auth() | 108 | this.$yoho.auth() |
100 | .then(() => { | 109 | .then(() => { |
@@ -111,6 +120,7 @@ export default { | @@ -111,6 +120,7 @@ export default { | ||
111 | * storageId: number | 120 | * storageId: number |
112 | */ | 121 | */ |
113 | this.$store.commit('order/buyerAskOrder/BUYER_ASK_SET_PRODUCTINFO', { | 122 | this.$store.commit('order/buyerAskOrder/BUYER_ASK_SET_PRODUCTINFO', { |
123 | + bid_moster_price: get(product, 'bid_moster_price', '-'), | ||
114 | least_price: get(product, 'least_price', '-'), | 124 | least_price: get(product, 'least_price', '-'), |
115 | sizeName: product.name, | 125 | sizeName: product.name, |
116 | sizeId: get(data, 'sizeId', ''), | 126 | sizeId: get(data, 'sizeId', ''), |
1 | <template> | 1 | <template> |
2 | <div class="size-list"> | 2 | <div class="size-list"> |
3 | - <cube-scroll ref="sizeselectScroll"> | 3 | + <cube-scroll ref="sizeselectScroll" :data="viewList"> |
4 | <ul> | 4 | <ul> |
5 | <li v-for="(info, idx) in viewList" | 5 | <li v-for="(info, idx) in viewList" |
6 | :key="idx" | 6 | :key="idx" |
@@ -34,7 +34,7 @@ export default { | @@ -34,7 +34,7 @@ export default { | ||
34 | name: 'size-list', | 34 | name: 'size-list', |
35 | props: { | 35 | props: { |
36 | list: { | 36 | list: { |
37 | - type: Array, | 37 | + type: [Array, null], |
38 | required: true, | 38 | required: true, |
39 | }, | 39 | }, |
40 | addSize: { | 40 | addSize: { |
@@ -82,13 +82,6 @@ export default { | @@ -82,13 +82,6 @@ export default { | ||
82 | return this.list.map(this.simplePriceMap); | 82 | return this.list.map(this.simplePriceMap); |
83 | }, | 83 | }, |
84 | }, | 84 | }, |
85 | - mounted() { | ||
86 | - this.$watch('list', () => { | ||
87 | - this.refreshScroll(); | ||
88 | - }, { | ||
89 | - immediate: true, | ||
90 | - }); | ||
91 | - }, | ||
92 | methods: { | 85 | methods: { |
93 | priceMap(info) { | 86 | priceMap(info) { |
94 | let price; | 87 | let price; |
1 | <template> | 1 | <template> |
2 | - <action-sheet @hidden="onHidden" position="right" ref="popup"> | 2 | + <action-sheet @hidden="onHidden" @shown="onShown" position="right" ref="popup"> |
3 | <div class="buy-sheet"> | 3 | <div class="buy-sheet"> |
4 | <div class="header"> | 4 | <div class="header"> |
5 | <div class="back-wrapper flex" @touchend="onBack"> | 5 | <div class="back-wrapper flex" @touchend="onBack"> |
@@ -10,7 +10,8 @@ | @@ -10,7 +10,8 @@ | ||
10 | <h1>添加尺码</h1> | 10 | <h1>添加尺码</h1> |
11 | <h3>请选择希望添加的尺码</h3> | 11 | <h3>请选择希望添加的尺码</h3> |
12 | </div> | 12 | </div> |
13 | - <size-list :list="unusedSizeList" | 13 | + <size-list ref="sizeList" |
14 | + :list="unusedSizeList" | ||
14 | :multiple="true" | 15 | :multiple="true" |
15 | :simple-price="true" | 16 | :simple-price="true" |
16 | :selected="selected" | 17 | :selected="selected" |
@@ -71,6 +72,11 @@ export default { | @@ -71,6 +72,11 @@ export default { | ||
71 | onHidden() { | 72 | onHidden() { |
72 | this.$emit('hidden'); | 73 | this.$emit('hidden'); |
73 | }, | 74 | }, |
75 | + onShown() { | ||
76 | + if (this.$refs.sizeList) { | ||
77 | + this.$refs.sizeList.refreshScroll(); | ||
78 | + } | ||
79 | + }, | ||
74 | _requestSize() { | 80 | _requestSize() { |
75 | const sizeIds = this.selected.map(item => item.size_id).join(','); | 81 | const sizeIds = this.selected.map(item => item.size_id).join(','); |
76 | 82 |
1 | <template> | 1 | <template> |
2 | - <action-sheet @hidden="onHidden" ref="popup"> | 2 | + <action-sheet @hidden="onHidden" @shown="onShown" ref="popup"> |
3 | <div class="size-select-sheet"> | 3 | <div class="size-select-sheet"> |
4 | <div class="select-size"> | 4 | <div class="select-size"> |
5 | <div class="title" @click="hide">{{config.title}}<i class="cubeic-close"></i></div> | 5 | <div class="title" @click="hide">{{config.title}}<i class="cubeic-close"></i></div> |
@@ -19,7 +19,8 @@ | @@ -19,7 +19,8 @@ | ||
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | </div> | 21 | </div> |
22 | - <size-list class="select-content size-list" :list="list" | 22 | + <size-list class="select-content size-list" ref="sizeList" |
23 | + :list="list" | ||
23 | :addSize="canAddSize" | 24 | :addSize="canAddSize" |
24 | :selected="selectedSize" | 25 | :selected="selectedSize" |
25 | :config="config" | 26 | :config="config" |
@@ -146,6 +147,11 @@ export default { | @@ -146,6 +147,11 @@ export default { | ||
146 | onHidden() { | 147 | onHidden() { |
147 | this.$emit('hidden'); | 148 | this.$emit('hidden'); |
148 | }, | 149 | }, |
150 | + onShown() { | ||
151 | + if (this.$refs.sizeList) { | ||
152 | + this.$refs.sizeList.refreshScroll(); | ||
153 | + } | ||
154 | + }, | ||
149 | onSelectSize({selected: sizeInfo}) { | 155 | onSelectSize({selected: sizeInfo}) { |
150 | this.updateTradeInfo({ | 156 | this.updateTradeInfo({ |
151 | productId: this.product.product_id, | 157 | productId: this.product.product_id, |
@@ -186,8 +192,9 @@ export default { | @@ -186,8 +192,9 @@ export default { | ||
186 | goodImg: get(this.product, 'goods_list[0].image_list[0].image_url', ''), | 192 | goodImg: get(this.product, 'goods_list[0].image_list[0].image_url', ''), |
187 | colorName: get(this.product, 'goods_list[0].color_name', ''), | 193 | colorName: get(this.product, 'goods_list[0].color_name', ''), |
188 | sizeName: this.sizeName, | 194 | sizeName: this.sizeName, |
189 | - goodPrice: get(this.productDetail, 'least_price', 0), | ||
190 | - productId: this.product.product_id | 195 | + goodPrice: get(this.selectedSize, 'bid_moster_price', ''), |
196 | + productId: this.product.product_id, | ||
197 | + bid_moster_price: get(this.selectedSize, 'bid_moster_price', ''), | ||
191 | }); | 198 | }); |
192 | // 跳转变现 | 199 | // 跳转变现 |
193 | this.$router.push({ | 200 | this.$router.push({ |
@@ -6,10 +6,9 @@ | @@ -6,10 +6,9 @@ | ||
6 | </transition> | 6 | </transition> |
7 | </LayoutHeader> | 7 | </LayoutHeader> |
8 | <div class="layout-context fixscroll"> | 8 | <div class="layout-context fixscroll"> |
9 | - <cube-scroll | 9 | + <cube-scroll :data="imageList" |
10 | :scroll-events="['scroll']" | 10 | :scroll-events="['scroll']" |
11 | @scroll="handleScroll"> | 11 | @scroll="handleScroll"> |
12 | - | ||
13 | <div class="slide"> | 12 | <div class="slide"> |
14 | <cube-slide ref="slide" :data="imageList"> | 13 | <cube-slide ref="slide" :data="imageList"> |
15 | <cube-slide-item v-for="(item, index) in imageList" :key="index"> | 14 | <cube-slide-item v-for="(item, index) in imageList" :key="index"> |
@@ -21,7 +20,7 @@ | @@ -21,7 +20,7 @@ | ||
21 | <span class="dot" :class="{active: props.current === index}" v-for="(item, index) in props.dots">{{index + 1}}</span> | 20 | <span class="dot" :class="{active: props.current === index}" v-for="(item, index) in props.dots">{{index + 1}}</span> |
22 | </template> | 21 | </template> |
23 | </cube-slide> | 22 | </cube-slide> |
24 | - <div class="qiugou" @click="qiugou"></div> | 23 | + <div class="qiugou" v-if="isQiugouEnabled" @click="qiugou"></div> |
25 | </div> | 24 | </div> |
26 | 25 | ||
27 | <div class="info"> | 26 | <div class="info"> |
@@ -95,7 +94,7 @@ | @@ -95,7 +94,7 @@ | ||
95 | <script> | 94 | <script> |
96 | import { Button, Slide, Scroll, Popup } from 'cube-ui'; | 95 | import { Button, Slide, Scroll, Popup } from 'cube-ui'; |
97 | import { get } from 'lodash'; | 96 | import { get } from 'lodash'; |
98 | -import { createNamespacedHelpers } from 'vuex'; | 97 | +import { createNamespacedHelpers, mapGetters } from 'vuex'; |
99 | 98 | ||
100 | import ImgSize from '../../components/img-size'; | 99 | import ImgSize from '../../components/img-size'; |
101 | import { getImgUrl } from '../../common/utils'; | 100 | import { getImgUrl } from '../../common/utils'; |
@@ -152,6 +151,7 @@ export default { | @@ -152,6 +151,7 @@ export default { | ||
152 | }; | 151 | }; |
153 | }, | 152 | }, |
154 | computed: { | 153 | computed: { |
154 | + ...mapGetters(['isQiugouEnabled']), | ||
155 | productDec() { | 155 | productDec() { |
156 | const goods = get(this.productDetail, 'goods_list[0]', {}); | 156 | const goods = get(this.productDetail, 'goods_list[0]', {}); |
157 | 157 | ||
@@ -194,7 +194,9 @@ export default { | @@ -194,7 +194,9 @@ export default { | ||
194 | }, | 194 | }, |
195 | mounted() { | 195 | mounted() { |
196 | this.imageHideThreadhold = -window.innerWidth * 0.693; | 196 | this.imageHideThreadhold = -window.innerWidth * 0.693; |
197 | - | 197 | + if (this.isQiugouEnabled === null) { |
198 | + this.$store.dispatch('getSysConfigQiugou'); | ||
199 | + } | ||
198 | }, | 200 | }, |
199 | activated() { | 201 | activated() { |
200 | if (this.productId !== this.productDetail.product_id) { | 202 | if (this.productId !== this.productDetail.product_id) { |
@@ -292,11 +294,13 @@ export default { | @@ -292,11 +294,13 @@ export default { | ||
292 | type: 5, | 294 | type: 5, |
293 | }; | 295 | }; |
294 | 296 | ||
295 | - if (this.productDetail.seriesId) { | 297 | + if (this.productDetail.seriesId && this.productDetail.series_name) { |
296 | query.series = this.productDetail.seriesId; | 298 | query.series = this.productDetail.seriesId; |
299 | + query.title = this.productDetail.series_name; | ||
297 | } else { | 300 | } else { |
298 | query.type = 4; | 301 | query.type = 4; |
299 | query.brand = this.productDetail.brandId; | 302 | query.brand = this.productDetail.brandId; |
303 | + query.title = this.productDetail.brand_name; | ||
300 | } | 304 | } |
301 | 305 | ||
302 | this.$router.push({ | 306 | this.$router.push({ |
@@ -339,12 +339,13 @@ export default function() { | @@ -339,12 +339,13 @@ export default function() { | ||
339 | }); | 339 | }); |
340 | }, | 340 | }, |
341 | 341 | ||
342 | - buyerCompute({commit}, {price = 0, storage_id = 0, uid} = {}) { | 342 | + buyerCompute({commit}, {price = 0, storage_id = 0, uid, address_id = ''} = {}) { |
343 | commit(BUYER_ASK_COMPUTE_REQUEST); | 343 | commit(BUYER_ASK_COMPUTE_REQUEST); |
344 | this.$api.get('/api/order/buyeraskcompute', { | 344 | this.$api.get('/api/order/buyeraskcompute', { |
345 | uid, | 345 | uid, |
346 | price, | 346 | price, |
347 | storage_id, | 347 | storage_id, |
348 | + address_id, | ||
348 | }).then(result => { | 349 | }).then(result => { |
349 | 350 | ||
350 | if (result.code === 200) { | 351 | if (result.code === 200) { |
@@ -39,6 +39,11 @@ export default function(mergeState = {}) { | @@ -39,6 +39,11 @@ export default function(mergeState = {}) { | ||
39 | direction: 'forword', | 39 | direction: 'forword', |
40 | homePage: true, | 40 | homePage: true, |
41 | user: {}, | 41 | user: {}, |
42 | + | ||
43 | + // 系统配置 | ||
44 | + sysConfig: { | ||
45 | + enableQiugou: null, // 是否启用求购,默认不启用, null: 初始状态标识,需要请求api, false: 不启用, true: 启用 | ||
46 | + } | ||
42 | }, | 47 | }, |
43 | mergeState, | 48 | mergeState, |
44 | ), | 49 | ), |
@@ -133,11 +138,17 @@ export default function(mergeState = {}) { | @@ -133,11 +138,17 @@ export default function(mergeState = {}) { | ||
133 | [Types.SET_USER_SELLER_INFO](state, sellerInfo) { | 138 | [Types.SET_USER_SELLER_INFO](state, sellerInfo) { |
134 | state.user.sellerInfo = sellerInfo || {}; | 139 | state.user.sellerInfo = sellerInfo || {}; |
135 | }, | 140 | }, |
141 | + [Types.UPDATE_SYSTEM_CONFIG_QIUGOU](state, { enabled }) { | ||
142 | + state.sysConfig.enableQiugou = enabled; | ||
143 | + }, | ||
136 | }, | 144 | }, |
137 | getters: { | 145 | getters: { |
138 | getLogin(state) { | 146 | getLogin(state) { |
139 | return state.context.isLogin; | 147 | return state.context.isLogin; |
140 | }, | 148 | }, |
149 | + isQiugouEnabled(state) { | ||
150 | + return state.sysConfig.enableQiugou; | ||
151 | + }, | ||
141 | }, | 152 | }, |
142 | actions: { | 153 | actions: { |
143 | async fetchUserProfile({ commit }) { | 154 | async fetchUserProfile({ commit }) { |
@@ -216,6 +227,26 @@ export default function(mergeState = {}) { | @@ -216,6 +227,26 @@ export default function(mergeState = {}) { | ||
216 | // pass | 227 | // pass |
217 | } | 228 | } |
218 | }, | 229 | }, |
230 | + async getSysConfigQiugou({ commit, state }) { | ||
231 | + // /ufo-gateway/?method=ufo.resource.getConfigTypeContent&code=bid_switch_h5 | ||
232 | + // {"alg":"SALT_MD5","code":200,"data":"1","md5":"c13a1ace2c5883be18643551bd17ebcd","message":"操作成功"} | ||
233 | + // H5是否打开求购 1代表打开 | ||
234 | + let isEnabled = !!state.sysConfig.enableQiugou; | ||
235 | + | ||
236 | + if (state.sysConfig.enableQiugou === null) { | ||
237 | + const resp = await this.$api.get('/api/sys/config', { | ||
238 | + code: 'bid_switch_h5', | ||
239 | + }); | ||
240 | + | ||
241 | + if (resp.code === 200) { | ||
242 | + isEnabled = resp.data === '1'; | ||
243 | + } | ||
244 | + | ||
245 | + commit(Types.UPDATE_SYSTEM_CONFIG_QIUGOU, { enabled: isEnabled}); | ||
246 | + } | ||
247 | + | ||
248 | + return isEnabled; | ||
249 | + }, | ||
219 | }, | 250 | }, |
220 | }; | 251 | }; |
221 | } | 252 | } |
@@ -15,5 +15,7 @@ export const SET_STATUS_BAR_HEIGHT = 'SET_STATUS_BAR_HEIGHT'; | @@ -15,5 +15,7 @@ export const SET_STATUS_BAR_HEIGHT = 'SET_STATUS_BAR_HEIGHT'; | ||
15 | export const SET_STATUS_BAR_COLOR = 'SET_STATUS_BAR_COLOR'; | 15 | export const SET_STATUS_BAR_COLOR = 'SET_STATUS_BAR_COLOR'; |
16 | export const SET_ACTION_BAR_HEIGHT = 'SET_ACTION_BAR_HEIGHT'; | 16 | export const SET_ACTION_BAR_HEIGHT = 'SET_ACTION_BAR_HEIGHT'; |
17 | 17 | ||
18 | +export const UPDATE_SYSTEM_CONFIG_QIUGOU = 'UPDATE_SYSTEM_CONFIG_QIUGOU'; | ||
19 | + | ||
18 | export const FETCH_USER_INFO_FAILD = 'FETCH_USER_INFO_FAILD'; | 20 | export const FETCH_USER_INFO_FAILD = 'FETCH_USER_INFO_FAILD'; |
19 | export const FETCH_USER_INFO_SUCCESS = 'FETCH_USER_INFO_SUCCESS'; | 21 | export const FETCH_USER_INFO_SUCCESS = 'FETCH_USER_INFO_SUCCESS'; |
@@ -8,6 +8,7 @@ const buyerAskApi = require('./buyerask-api-map') | @@ -8,6 +8,7 @@ const buyerAskApi = require('./buyerask-api-map') | ||
8 | const orderListApi = require('./order-api-map'); | 8 | const orderListApi = require('./order-api-map'); |
9 | const categoryApi = require('./category-api-map'); | 9 | const categoryApi = require('./category-api-map'); |
10 | const sellerAskApi = require('./sellerask-api-map'); | 10 | const sellerAskApi = require('./sellerask-api-map'); |
11 | +const systemApi = require('./system-api-map'); | ||
11 | 12 | ||
12 | module.exports = { | 13 | module.exports = { |
13 | ...orderApi, | 14 | ...orderApi, |
@@ -20,4 +21,5 @@ module.exports = { | @@ -20,4 +21,5 @@ module.exports = { | ||
20 | ...orderListApi, | 21 | ...orderListApi, |
21 | ...categoryApi, | 22 | ...categoryApi, |
22 | ...sellerAskApi, | 23 | ...sellerAskApi, |
24 | + ...systemApi, | ||
23 | }; | 25 | }; |
config/system-api-map.js
0 → 100644
1 | +module.exports = { | ||
2 | + // 系统配置 | ||
3 | + // /ufo-gateway/?method=ufo.resource.getConfigTypeContent&code=bid_switch_h5 | ||
4 | + '/api/sys/config': { | ||
5 | + ufo: true, | ||
6 | + auth: false, | ||
7 | + api: 'ufo.resource.getConfigTypeContent', | ||
8 | + params: { | ||
9 | + code: {type: String} // bid_switch_h5 是否启用求购 | ||
10 | + }, | ||
11 | + } | ||
12 | +}; |
-
Please register or login to post a comment