Commit 744adf2b8a27082d16a4ecad891135bcb19e4920

Authored by zhiyangdu
1 parent c150b2a5

增加tab切换功能

src/pages/myGiftBox/myGiftBox.less
... ... @@ -53,6 +53,44 @@
53 53 overflow-y: auto;
54 54 box-sizing: border-box;
55 55 }
  56 + .tab_btn_list{
  57 + margin: 30px 30px 0 30px;
  58 + // tab边框
  59 + .van-hairline--top-bottom::after,
  60 + .van-hairline-unset--top-bottom::after {
  61 + border-width: 0;
  62 + }
  63 + .van-tabs__nav--line{
  64 + padding-bottom: 0;
  65 + }
  66 + .van-tabs{
  67 + width: 100%;
  68 + }
  69 + .van-tab{
  70 + padding: 0 2.67vw;
  71 + }
  72 + .van-tab:first-child{
  73 + padding-left: 0px;
  74 + }
  75 + .van-tabs--line .van-tabs__wrap{
  76 + height:100%;
  77 + }
  78 + .van-tab span{
  79 + display: block;
  80 + width: auto;
  81 + font-size: 26px;
  82 + color: #999999;
  83 + background-color: #F9F9F9;
  84 + border-radius: 8px;
  85 + }
  86 + .van-tab--active span{
  87 + font-weight:400;
  88 + color:rgba(208,2,27,1);
  89 + }
  90 + .van-tabs__line{
  91 + display: none;
  92 + }
  93 + }
56 94 .tip_text{
57 95 text-align: center;
58 96 margin-top: 20px;
... ...
src/pages/myGiftBox/myGiftBox.vue
... ... @@ -14,6 +14,13 @@
14 14 </div>
15 15 <div class="desc" @click="giftRules">规则说明</div>
16 16 </div>
  17 + <!-- btn按钮筛选 -->
  18 + <div class="tab_btn_list">
  19 + <van-tabs swipeable>
  20 + <van-tab v-for="index in 10" :title="'选项 ' + index">
  21 + </van-tab>
  22 + </van-tabs>
  23 + </div>
17 24 <!--内容-->
18 25 <div class="item_box">
19 26 <div
... ... @@ -112,11 +119,11 @@ export default {
112 119 // 暴露方法,由APP调用,接受参数
113 120 if (this.isiPhone.value) {
114 121 window.appPaymentCallback = item => {
115   - this.appPaymentCallback()
  122 + this.appPaymentCallback();
116 123 };
117 124 } else if (this.isAndroid.value) {
118 125 window.payFinish = item => {
119   - this.payFinish()
  126 + this.payFinish();
120 127 };
121 128 }
122 129 }
... ... @@ -198,14 +205,14 @@ export default {
198 205 ) {
199 206 // App内,iOS销毁WebView
200 207 window.webkit.messageHandlers.CNDSWebScrollEnabled.postMessage(
201   - { body: { display: 'none' } }
  208 + { body: { display: "none" } }
202 209 );
203 210 } else if (
204 211 window.obj &&
205 212 window.obj.setGiftBottomVisibleBySwitchTab
206 213 ) {
207 214 // App内,Android销毁WebView
208   - window.obj.CNDSWebScrollEnabled('none');
  215 + window.obj.CNDSWebScrollEnabled("none");
209 216 }
210 217 }
211 218 },
... ... @@ -535,7 +542,7 @@ export default {
535 542 // 隐藏底部聊天弹框
536 543 this.setGiftBottomVisibleBySwitchTab(0);
537 544 // 获取当前操作的支付订单
538   - this.orderOperation.item = item
  545 + this.orderOperation.item = item;
539 546 // App内
540 547 if (this.isCNLive.value) {
541 548 // 调用App,返回按键
... ... @@ -564,8 +571,8 @@ export default {
564 571 },
565 572 // 安卓支付成功回调
566 573 payFinish() {
567   - // 检测是否已支付
568   - this.cancelorder(this.orderOperation.item)
  574 + // 检测是否已支付
  575 + this.cancelorder(this.orderOperation.item);
569 576 },
570 577 // 安卓调用支付后检测是否已支付
571 578 cancelorder(item) {
... ... @@ -576,7 +583,7 @@ export default {
576 583 this.http(
577 584 "/Api/" + this.getApiVersion().index + "/isOrderPay",
578 585 {
579   - orderId: item.orderid, // 订单编号
  586 + orderId: item.orderid // 订单编号
580 587 },
581 588 this.cancelorderCallback,
582 589 {
... ... @@ -601,7 +608,7 @@ export default {
601 608 this.$set(ext.item, "status", "1");
602 609 }
603 610 }
604   - },
  611 + }
605 612 }
606 613 };
607 614 </script>
... ...