Commit 2f61c3fc7c9a6ba75e15b6318f21b0188391b96d

Authored by zhiyangdu
1 parent d2006f60

筛选订单列表集合判断

src/pages/myGiftBox/myGiftBox.vue
... ... @@ -35,10 +35,7 @@
35 35 </van-tabs>
36 36 </div>
37 37 <!-- 筛选 -->
38   - <div
39   - @click="onScreen"
40   - class="screen_box"
41   - >
  38 + <div @click="onScreen" class="screen_box">
42 39 <div>筛选</div>
43 40 <img src="static/img/screen.png" alt="" />
44 41 </div>
... ... @@ -49,7 +46,8 @@
49 46 <!--内容-->
50 47 <div
51 48 class="item_box"
52   - :style="'padding-top: ' + ($parent.top.value + 80) + 'px'">
  49 + :style="'padding-top: ' + ($parent.top.value + 80) + 'px'"
  50 + >
53 51 <div
54 52 ref="boxx"
55 53 infinite-scroll-immediate-check="true"
... ... @@ -103,10 +101,14 @@
103 101 class="screenPopup"
104 102 v-model="popupShow"
105 103 position="right"
106   - :style="{ height: '100vh'}">
107   - <div :style="'padding-top: ' + ($parent.top.value + 15) + 'px'" class="screen_box">
  104 + :style="{ height: '100vh' }"
  105 + >
  106 + <div
  107 + :style="'padding-top: ' + ($parent.top.value + 15) + 'px'"
  108 + class="screen_box"
  109 + >
108 110 <!-- 标题 -->
109   - <div class="title">筛选订单</div >
  111 + <div class="title">筛选订单</div>
110 112 <!--按钮选中筛选-->
111 113 <div
112 114 v-for="(items, index) in screenList"
... ... @@ -119,10 +121,10 @@
119 121 class="btn"
120 122 :class="{ active: item.show }"
121 123 @click="changBtn(item)"
122   - v-for="(item, index) in items.tab_List"
  124 + v-for="(item, index) in items.state"
123 125 :key="index"
124 126 >
125   - {{ item.name }}
  127 + {{ item.title }}
126 128 </div>
127 129 </div>
128 130 </div>
... ... @@ -134,13 +136,14 @@
134 136 </div>
135 137 </van-popup>
136 138 <!-- 商品订单按钮 -->
137   - <div
138   - :style="'top: ' + ($parent.top.value + 151) + 'px'"
139   - @click="OrderLink"
140   - class="oredr_link_box">
141   - <div>商品订单</div>
142   - <van-icon class="icon" name="arrow" />
143   - </div>
  139 + <div
  140 + :style="'top: ' + ($parent.top.value + 151) + 'px'"
  141 + @click="OrderLink"
  142 + class="oredr_link_box"
  143 + >
  144 + <div>商品订单</div>
  145 + <van-icon class="icon" name="arrow" />
  146 + </div>
144 147 </div>
145 148 </template>
146 149  
... ... @@ -200,45 +203,7 @@ export default {
200 203 },
201 204 isLoading: false, //下拉刷新
202 205 popupShow: false, // 右侧筛选抽屉显示隐藏
203   - screenList: [
204   - { title: "支付", tab_List: [{ name: "未支付", status: 0 }] },
205   - {
206   - title: "分享",
207   - tab_List: [
208   - { name: "可分享", status: 0 },
209   - { name: "已领完", status: 1 }
210   - ]
211   - },
212   - {
213   - title: "填写地址",
214   - tab_List: [
215   - { name: "未填写地址", status: 0 },
216   - { name: "已填写地址", status: 1 }
217   - ]
218   - },
219   - {
220   - title: "待收货",
221   - tab_List: [
222   - { name: "已揽件", status: 0 },
223   - { name: "运输中", status: 1 },
224   - { name: "派送中", status: 2 }
225   - ]
226   - },
227   - {
228   - title: "已送达",
229   - tab_List: [
230   - { name: "已领取", status: 0 },
231   - { name: "已签收", status: 1 }
232   - ]
233   - },
234   - {
235   - title: "未领退货",
236   - tab_List: [
237   - { name: "退货中", status: 0 },
238   - { name: "已关闭", status: 1 }
239   - ]
240   - }
241   - ], // 筛选数据
  206 + screenList: null, // 筛选数据
242 207 checkBtnList: []
243 208 };
244 209 },
... ... @@ -257,6 +222,8 @@ export default {
257 222 this.cancelPayment();
258 223 // 是否禁用滑动webview(none隐藏,block显示)
259 224 // this.CNDSWebScrollEnabled();
  225 + // 获取筛选按钮集合
  226 + this.getGiftOrderLabel();
260 227 },
261 228 mounted() {
262 229 // 配合原生回调
... ... @@ -345,20 +312,20 @@ export default {
345 312 /**
346 313 * 筛选
347 314 */
348   - onScreen(){
  315 + onScreen() {
349 316 // 显示右侧抽屉
350   - this.popupShow = true
351   - if(this.active == 1){
352   - // 调用im是否显示隐藏1显示im聊天弹窗0不显示
  317 + this.popupShow = true;
  318 + if (this.active == 1) {
  319 + // 调用im是否显示隐藏1显示im聊天弹窗0不显示
353 320 this.setGiftBottomVisibleBySwitchTab(0);
354 321 }
355 322 },
356 323 /**
357 324 * 关闭筛选抽屉
358 325 */
359   - closePopup(){
360   - if(this.active == 1){
361   - // 调用im是否显示隐藏1显示im聊天弹窗0不显示
  326 + closePopup() {
  327 + if (this.active == 1) {
  328 + // 调用im是否显示隐藏1显示im聊天弹窗0不显示
362 329 this.setGiftBottomVisibleBySwitchTab(1);
363 330 }
364 331 },
... ... @@ -366,7 +333,7 @@ export default {
366 333 * 选中按钮事件
367 334 */
368 335 changBtn(item) {
369   - this.checkBtnList.push(item.status);
  336 + this.checkBtnList.push(item.statu);
370 337 if (item.show) {
371 338 this.$set(item, "show", false);
372 339 } else {
... ... @@ -377,9 +344,9 @@ export default {
377 344 * 重置
378 345 */
379 346 onReset() {
380   - this.screenList.forEach((obj, index)=>{
381   - for(let item of obj.tab_List){
382   - if (item.show) {
  347 + this.screenList.forEach((obj, index) => {
  348 + for (let item of obj.tab_List) {
  349 + if (item.show) {
383 350 this.$set(item, "show", false);
384 351 }
385 352 }
... ... @@ -463,6 +430,36 @@ export default {
463 430 }
464 431 },
465 432 /**
  433 + * 筛选按钮集合
  434 + */
  435 + getGiftOrderLabel() {
  436 + // 加载中提示
  437 + Indicator.open("加载中...");
  438 + this.http(
  439 + "/Api/" + this.getApiVersion().index + "/getGiftOrderLabel",
  440 + {},
  441 + this.getGiftOrderLabelCallback,
  442 + {
  443 + method: "post"
  444 + }
  445 + );
  446 + },
  447 + /**
  448 + * 获取礼物订单按钮筛选集合
  449 + * @param {object} res [服务器返回数据]
  450 + * @param {object} ext [扩展参数]
  451 + */
  452 + getGiftOrderLabelCallback(res, ext){
  453 + // 加载完成
  454 + Indicator.close();
  455 + // 返回处理
  456 + if (res.code == 200) {
  457 + // 解构数据
  458 + let { data: datas } = res;
  459 + this.screenList = datas.list
  460 + }
  461 + },
  462 + /**
466 463 * 获取收礼礼物列表
467 464 */
468 465 getorderGiftList(initPage) {
... ... @@ -603,9 +600,7 @@ export default {
603 600 }
604 601 },
605 602 // 列表的商品订单跳转
606   - OrderLink(){
607   -
608   - },
  603 + OrderLink() {},
609 604 // 送礼商品跳转到详情页
610 605 onGiftGiving(item) {
611 606 // 判断并调用通用跳转
... ... @@ -865,7 +860,10 @@ export default {
865 860 // ios支付成功回调
866 861 appPaymentCallback(item) {
867 862 // 取消订单
868   - if (this.orderOperation.item.status == 0 && JSON.parse(item).payResult == 0) {
  863 + if (
  864 + this.orderOperation.item.status == 0 &&
  865 + JSON.parse(item).payResult == 0
  866 + ) {
869 867 // status=1(已支付可分享状态)
870 868 this.$set(this.orderOperation.item, "status", "1");
871 869 }
... ...