Merge remote-tracking branch 'origin/develop' into develop
Showing
6 changed files
with
76 additions
and
66 deletions
@@ -232,8 +232,8 @@ | @@ -232,8 +232,8 @@ | ||
232 | this.leftcurrent = index; | 232 | this.leftcurrent = index; |
233 | this.cateNavRightData = this.cateNavLeftData[index].sub; | 233 | this.cateNavRightData = this.cateNavLeftData[index].sub; |
234 | this.rightAll = { | 234 | this.rightAll = { |
235 | - sortId: categoryId, | ||
236 | - categoryName: categoryName | 235 | + sortId: categoryId ? categoryId : '', |
236 | + categoryName: categoryName ? categoryName : '' | ||
237 | }; | 237 | }; |
238 | }, | 238 | }, |
239 | 239 |
@@ -4,7 +4,8 @@ | @@ -4,7 +4,8 @@ | ||
4 | <li v-for="item in brandData" track-by="fav_id" id="li-{{item.fav_id}}" | 4 | <li v-for="item in brandData" track-by="fav_id" id="li-{{item.fav_id}}" |
5 | v-touch:panstart="panstart(item.fav_id)" | 5 | v-touch:panstart="panstart(item.fav_id)" |
6 | v-touch:panmove="panmove(item.fav_id)" | 6 | v-touch:panmove="panmove(item.fav_id)" |
7 | - v-touch:panend="panend(item.fav_id)"> | 7 | + v-touch:panend="panend(item.fav_id)" |
8 | + v-touch-options:pan="{direction:'horizontal', threshold: 100}"> | ||
8 | <div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn(item.fav_id)"> | 9 | <div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn(item.fav_id)"> |
9 | <span class="fav-del-span"><span class="icon icon-edit-del"></span></span> | 10 | <span class="fav-del-span"><span class="icon icon-edit-del"></span></span> |
10 | </div> | 11 | </div> |
@@ -135,25 +136,24 @@ | @@ -135,25 +136,24 @@ | ||
135 | }, | 136 | }, |
136 | panstart(id) { | 137 | panstart(id) { |
137 | event.preventDefault(); | 138 | event.preventDefault(); |
138 | - if (this.editmodel && this.pandata.id !== id) { | 139 | + if (this.pandata.id && this.pandata.id !== id) { |
140 | + $('#li-' + this.pandata.id).css('transform', 'translateX(0px)'); | ||
141 | + $('#del-' + this.pandata.id).addClass('hide'); | ||
139 | return false; | 142 | return false; |
140 | - } | 143 | + } else { |
144 | + this.pageX = event.targetTouches[0].pageX; | ||
145 | + var delBtn = $('#del-' + id); | ||
141 | 146 | ||
142 | - $('#del-' + id).removeClass('hide'); | ||
143 | - this.pageX = event.targetTouches[0].pageX; | ||
144 | - if (this.pandata.id !== id) { | ||
145 | - if (this.pandata.id !== undefined) { | ||
146 | - $('#li-' + this.pandata.id).css('transform', 'translateX(0px)'); | ||
147 | - $('#del-' + this.pandata.id).addClass('hide'); | 147 | + if (delBtn.hasClass('hide')) { |
148 | + delBtn.removeClass('hide'); | ||
149 | + this.pandata.objX = 0; | ||
150 | + this.pandata.id = id; | ||
148 | } | 151 | } |
149 | - | ||
150 | - this.pandata.objX = 0; | ||
151 | - this.pandata.id = id; | ||
152 | } | 152 | } |
153 | }, | 153 | }, |
154 | panmove(id) { | 154 | panmove(id) { |
155 | event.preventDefault(); | 155 | event.preventDefault(); |
156 | - if (this.editmodel && this.pandata.id !== id) { | 156 | + if (this.pandata.id && this.pandata.id !== id) { |
157 | return false; | 157 | return false; |
158 | } | 158 | } |
159 | 159 | ||
@@ -180,7 +180,8 @@ | @@ -180,7 +180,8 @@ | ||
180 | }, | 180 | }, |
181 | panend(id) { | 181 | panend(id) { |
182 | event.preventDefault(); | 182 | event.preventDefault(); |
183 | - if (this.editmodel && this.pandata.id !== id) { | 183 | + if (this.pandata.id && this.pandata.id !== id) { |
184 | + this.pandata = {}; | ||
184 | return false; | 185 | return false; |
185 | } | 186 | } |
186 | 187 | ||
@@ -196,9 +197,18 @@ | @@ -196,9 +197,18 @@ | ||
196 | } | 197 | } |
197 | li.css('transform', 'translateX(' + this.pandata.objX + 'px)'); | 198 | li.css('transform', 'translateX(' + this.pandata.objX + 'px)'); |
198 | 199 | ||
199 | - if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) { | 200 | + if (this.pandata.objX === 0) { |
200 | this.pandata = {}; | 201 | this.pandata = {}; |
201 | } | 202 | } |
203 | + }, | ||
204 | + updateNavBar() { | ||
205 | + const header = $.extend({}, interceptClick.defaultTitleMap[5]); | ||
206 | + | ||
207 | + header.defaultSelectedIndex = '1'; | ||
208 | + header.right.des = this.editmodel ? '完成' : '编辑'; | ||
209 | + return yoho.updateNavigationBar({ | ||
210 | + header: header | ||
211 | + }); | ||
202 | } | 212 | } |
203 | }, | 213 | }, |
204 | created() { | 214 | created() { |
@@ -209,14 +219,13 @@ | @@ -209,14 +219,13 @@ | ||
209 | 219 | ||
210 | this.hideDelBth(); | 220 | this.hideDelBth(); |
211 | this.editmodel = !this.editmodel; | 221 | this.editmodel = !this.editmodel; |
222 | + this.updateNavBar(); | ||
223 | + }); | ||
212 | 224 | ||
213 | - let header = $.extend({}, interceptClick.defaultTitleMap[5]); | ||
214 | - | ||
215 | - header.defaultSelectedIndex = '1'; | ||
216 | - header.right.des = this.editmodel ? '完成' : '编辑'; | ||
217 | - return yoho.updateNavigationBar({ | ||
218 | - header: header | ||
219 | - }); | 225 | + document.addEventListener('visibilitychange', () => { |
226 | + if (document.visibilityState === 'visible') { | ||
227 | + this.updateNavBar(); | ||
228 | + } | ||
220 | }); | 229 | }); |
221 | } | 230 | } |
222 | }; | 231 | }; |
1 | <template> | 1 | <template> |
2 | - <div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10"> | 2 | + <div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10" > |
3 | <ul class="fav-product-list"> | 3 | <ul class="fav-product-list"> |
4 | <li v-for="item in productData" track-by="fav_id" id="li-{{item.fav_id}}" | 4 | <li v-for="item in productData" track-by="fav_id" id="li-{{item.fav_id}}" |
5 | + v-touch-options:pan="{ direction: 'horizontal', threshold: 100}" | ||
5 | v-touch:panstart="panstart(item.fav_id)" | 6 | v-touch:panstart="panstart(item.fav_id)" |
6 | v-touch:panmove="panmove(item.fav_id)" | 7 | v-touch:panmove="panmove(item.fav_id)" |
7 | v-touch:panend="panend(item.fav_id)"> | 8 | v-touch:panend="panend(item.fav_id)"> |
@@ -54,8 +55,8 @@ | @@ -54,8 +55,8 @@ | ||
54 | page: 0, | 55 | page: 0, |
55 | pageX: 0, | 56 | pageX: 0, |
56 | currentX: 0, | 57 | currentX: 0, |
57 | - pandata: {}, | ||
58 | productData: [], | 58 | productData: [], |
59 | + pandata: {}, | ||
59 | keys: {} | 60 | keys: {} |
60 | }; | 61 | }; |
61 | }, | 62 | }, |
@@ -153,25 +154,24 @@ | @@ -153,25 +154,24 @@ | ||
153 | }, | 154 | }, |
154 | panstart(id) { | 155 | panstart(id) { |
155 | event.preventDefault(); | 156 | event.preventDefault(); |
156 | - if (this.editmodel && this.pandata.id !== id) { | 157 | + if (this.pandata.id && this.pandata.id !== id) { |
158 | + $('#li-' + this.pandata.id).css('transform', 'translateX(0px)'); | ||
159 | + $('#del-' + this.pandata.id).addClass('hide'); | ||
157 | return false; | 160 | return false; |
158 | - } | 161 | + } else { |
162 | + this.pageX = event.targetTouches[0].pageX; | ||
163 | + var delBtn = $('#del-' + id); | ||
159 | 164 | ||
160 | - $('#del-' + id).removeClass('hide'); | ||
161 | - this.pageX = event.targetTouches[0].pageX; | ||
162 | - if (this.pandata.id !== id) { | ||
163 | - if (this.pandata.id !== undefined) { | ||
164 | - $('#li-' + this.pandata.id).css('transform', 'translateX(0px)'); | ||
165 | - $('#del-' + this.pandata.id).addClass('hide'); | 165 | + if (delBtn.hasClass('hide')) { |
166 | + delBtn.removeClass('hide'); | ||
167 | + this.pandata.objX = 0; | ||
168 | + this.pandata.id = id; | ||
166 | } | 169 | } |
167 | - | ||
168 | - this.pandata.objX = 0; | ||
169 | - this.pandata.id = id; | ||
170 | } | 170 | } |
171 | }, | 171 | }, |
172 | panmove(id) { | 172 | panmove(id) { |
173 | event.preventDefault(); | 173 | event.preventDefault(); |
174 | - if (this.editmodel && this.pandata.id !== id) { | 174 | + if (this.pandata.id && this.pandata.id !== id) { |
175 | return false; | 175 | return false; |
176 | } | 176 | } |
177 | 177 | ||
@@ -198,7 +198,8 @@ | @@ -198,7 +198,8 @@ | ||
198 | }, | 198 | }, |
199 | panend(id) { | 199 | panend(id) { |
200 | event.preventDefault(); | 200 | event.preventDefault(); |
201 | - if (this.editmodel && this.pandata.id !== id) { | 201 | + if (this.pandata.id && this.pandata.id !== id) { |
202 | + this.pandata = {}; | ||
202 | return false; | 203 | return false; |
203 | } | 204 | } |
204 | 205 | ||
@@ -214,9 +215,18 @@ | @@ -214,9 +215,18 @@ | ||
214 | } | 215 | } |
215 | li.css('transform', 'translateX(' + this.pandata.objX + 'px)'); | 216 | li.css('transform', 'translateX(' + this.pandata.objX + 'px)'); |
216 | 217 | ||
217 | - if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) { | 218 | + if (this.pandata.objX === 0) { |
218 | this.pandata = {}; | 219 | this.pandata = {}; |
219 | } | 220 | } |
221 | + }, | ||
222 | + updateNavBar() { | ||
223 | + const header = $.extend({}, interceptClick.defaultTitleMap[5]); | ||
224 | + | ||
225 | + header.defaultSelectedIndex = '0'; | ||
226 | + header.right.des = this.editmodel ? '完成' : '编辑'; | ||
227 | + return yoho.updateNavigationBar({ | ||
228 | + header: header | ||
229 | + }); | ||
220 | } | 230 | } |
221 | }, | 231 | }, |
222 | created() { | 232 | created() { |
@@ -227,14 +237,13 @@ | @@ -227,14 +237,13 @@ | ||
227 | 237 | ||
228 | this.hideDelBth(); | 238 | this.hideDelBth(); |
229 | this.editmodel = !this.editmodel; | 239 | this.editmodel = !this.editmodel; |
240 | + this.updateNavBar(); | ||
241 | + }); | ||
230 | 242 | ||
231 | - let header = $.extend({}, interceptClick.defaultTitleMap[5]); | ||
232 | - | ||
233 | - header.defaultSelectedIndex = '0'; | ||
234 | - header.right.des = this.editmodel ? '完成' : '编辑'; | ||
235 | - return yoho.updateNavigationBar({ | ||
236 | - header: header | ||
237 | - }); | 243 | + document.addEventListener('visibilitychange', () => { |
244 | + if (document.visibilityState === 'visible') { | ||
245 | + this.updateNavBar(); | ||
246 | + } | ||
238 | }); | 247 | }); |
239 | } | 248 | } |
240 | }; | 249 | }; |
@@ -111,7 +111,7 @@ | @@ -111,7 +111,7 @@ | ||
111 | if (Number(this.order.status) === 0) { | 111 | if (Number(this.order.status) === 0) { |
112 | this.getCancelReason(); | 112 | this.getCancelReason(); |
113 | } | 113 | } |
114 | - } else { | 114 | + } else if (result.code !== 500) { |
115 | tip(result.message); | 115 | tip(result.message); |
116 | } | 116 | } |
117 | }).fail(() => { | 117 | }).fail(() => { |
@@ -126,7 +126,7 @@ | @@ -126,7 +126,7 @@ | ||
126 | }, (result) => { | 126 | }, (result) => { |
127 | if (result.code === 200) { | 127 | if (result.code === 200) { |
128 | location.reload(); | 128 | location.reload(); |
129 | - } else { | 129 | + } else if (result.code !== 500) { |
130 | tip(result.message); | 130 | tip(result.message); |
131 | } | 131 | } |
132 | }, () => { | 132 | }, () => { |
@@ -189,7 +189,7 @@ | @@ -189,7 +189,7 @@ | ||
189 | if (result.code === 200) { | 189 | if (result.code === 200) { |
190 | interceptClick.intercept('/me/order?type=1'); | 190 | interceptClick.intercept('/me/order?type=1'); |
191 | return false; | 191 | return false; |
192 | - } else { | 192 | + } else if (result.code !== 500) { |
193 | tip(result.message); | 193 | tip(result.message); |
194 | } | 194 | } |
195 | }).fail(() => { | 195 | }).fail(() => { |
@@ -207,7 +207,7 @@ | @@ -207,7 +207,7 @@ | ||
207 | }).then(result => { | 207 | }).then(result => { |
208 | if (result.code === 200) { | 208 | if (result.code === 200) { |
209 | location.reload(); | 209 | location.reload(); |
210 | - } else { | 210 | + } else if (result.code !== 500) { |
211 | tip(result.message); | 211 | tip(result.message); |
212 | } | 212 | } |
213 | }).fail(() => { | 213 | }).fail(() => { |
@@ -228,11 +228,7 @@ | @@ -228,11 +228,7 @@ | ||
228 | dropDown(elementId) { | 228 | dropDown(elementId) { |
229 | let dropdown = document.getElementById(elementId); | 229 | let dropdown = document.getElementById(elementId); |
230 | 230 | ||
231 | - try { | ||
232 | - this.showDropdown(dropdown); | ||
233 | - } catch(e) { | ||
234 | - console.log(e) | ||
235 | - } | 231 | + this.showDropdown(dropdown); |
236 | return false; | 232 | return false; |
237 | }, | 233 | }, |
238 | showDropdown(element) { | 234 | showDropdown(element) { |
@@ -122,7 +122,7 @@ | @@ -122,7 +122,7 @@ | ||
122 | }, (result) => { | 122 | }, (result) => { |
123 | if (result.code === 200) { | 123 | if (result.code === 200) { |
124 | location.reload(); | 124 | location.reload(); |
125 | - } else { | 125 | + } else if (result.code !== 500) { |
126 | tip(result.message); | 126 | tip(result.message); |
127 | } | 127 | } |
128 | }, () => { | 128 | }, () => { |
@@ -187,7 +187,7 @@ | @@ -187,7 +187,7 @@ | ||
187 | }).then(result => { | 187 | }).then(result => { |
188 | if (result.code === 200) { | 188 | if (result.code === 200) { |
189 | _that.orderList.splice(index, 1); | 189 | _that.orderList.splice(index, 1); |
190 | - } else { | 190 | + } else if (result.code !== 500) { |
191 | tip(result.message); | 191 | tip(result.message); |
192 | } | 192 | } |
193 | }).fail(() => { | 193 | }).fail(() => { |
@@ -205,7 +205,7 @@ | @@ -205,7 +205,7 @@ | ||
205 | }).then(result => { | 205 | }).then(result => { |
206 | if (result.code === 200) { | 206 | if (result.code === 200) { |
207 | location.reload(); | 207 | location.reload(); |
208 | - } else { | 208 | + } else if (result.code !== 500) { |
209 | tip(result.message); | 209 | tip(result.message); |
210 | } | 210 | } |
211 | }).fail(() => { | 211 | }).fail(() => { |
@@ -218,11 +218,7 @@ | @@ -218,11 +218,7 @@ | ||
218 | dropDown(elementId){ | 218 | dropDown(elementId){ |
219 | let dropdown = document.getElementById(elementId); | 219 | let dropdown = document.getElementById(elementId); |
220 | 220 | ||
221 | - try { | ||
222 | - this.showDropdown(dropdown); | ||
223 | - } catch(e) { | ||
224 | - console.log(e) | ||
225 | - } | 221 | + this.showDropdown(dropdown); |
226 | return false; | 222 | return false; |
227 | }, | 223 | }, |
228 | showDropdown(element) { | 224 | showDropdown(element) { |
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | 45 | ||
46 | .brand-intro-transition { | 46 | .brand-intro-transition { |
47 | transition: all 0.3s ease; | 47 | transition: all 0.3s ease; |
48 | - font-size: 16px; | 48 | + font-size: 20px; |
49 | line-height: 32px; | 49 | line-height: 32px; |
50 | width: 90%; | 50 | width: 90%; |
51 | height: 220px; | 51 | height: 220px; |
@@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
60 | .brand-short { | 60 | .brand-short { |
61 | height: 60px !important; | 61 | height: 60px !important; |
62 | display: -webkit-box !important; | 62 | display: -webkit-box !important; |
63 | - font-size: 16px; | 63 | + font-size: 20px; |
64 | line-height: 32px; | 64 | line-height: 32px; |
65 | width: 90%; | 65 | width: 90%; |
66 | text-overflow: ellipsis; | 66 | text-overflow: ellipsis; |
-
Please register or login to post a comment