Authored by 郭成尧

btn-status

@@ -33,4 +33,6 @@ @@ -33,4 +33,6 @@
33 </div> 33 </div>
34 </div> 34 </div>
35 {{/usable_giftCards}} 35 {{/usable_giftCards}}
  36 +
  37 + <button id="useGiftCardBtn" class="use-giftcard-btn">使用</button>
36 </div> 38 </div>
@@ -11,8 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production'; @@ -11,8 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production';
11 const isTest = process.env.NODE_ENV === 'test'; 11 const isTest = process.env.NODE_ENV === 'test';
12 12
13 const domains = { 13 const domains = {
14 - api: 'http://api-test3.yohops.com:9999/',  
15 - service: 'http://service-test3.yohops.com:9999/', 14 + api: 'http://dev-api.yohops.com:9999/',
  15 + service: 'http://dev-service.yohops.com:9999/',
16 singleApi: 'http://api-test3.yohops.com:9999/', 16 singleApi: 'http://api-test3.yohops.com:9999/',
17 global: 'http://global-test-soa.yohops.com:9999', 17 global: 'http://global-test-soa.yohops.com:9999',
18 liveApi: 'http://testapi.live.yohops.com:9999/', 18 liveApi: 'http://testapi.live.yohops.com:9999/',
@@ -10,7 +10,8 @@ class SelectGiftCard extends Page { @@ -10,7 +10,8 @@ class SelectGiftCard extends Page {
10 this.selector = { 10 this.selector = {
11 rule: $('#rule'), 11 rule: $('#rule'),
12 page: $('.select-giftcard-page'), 12 page: $('.select-giftcard-page'),
13 - giftcard: $('.giftcard') 13 + giftcard: $('.giftcard'),
  14 + useGiftCardBtn: $('#useGiftCardBtn')
14 }; 15 };
15 this.init(); 16 this.init();
16 this.bindEvents(); 17 this.bindEvents();
@@ -24,6 +25,25 @@ class SelectGiftCard extends Page { @@ -24,6 +25,25 @@ class SelectGiftCard extends Page {
24 25
25 bindEvents() { 26 bindEvents() {
26 this.selector.giftcard.on('click', '.checkbox', this.checkboxClickHandle.bind(this)); 27 this.selector.giftcard.on('click', '.checkbox', this.checkboxClickHandle.bind(this));
  28 + this.selector.useGiftCardBtn.on('click', this.useGiftCard.bind(this));
  29 + }
  30 +
  31 + /**
  32 + * 使用礼品卡
  33 + */
  34 + useGiftCard() {
  35 + console.log('ok');
  36 + }
  37 +
  38 + /**
  39 + * 改变 使用 按钮状态
  40 + */
  41 + changeUseBtnStatus() {
  42 + if (this.selector.giftcard.hasClass('checked')) {
  43 + this.selector.useGiftCardBtn.addClass('active');
  44 + } else {
  45 + this.selector.useGiftCardBtn.removeClass('active');
  46 + }
27 } 47 }
28 48
29 /** 49 /**
@@ -37,6 +57,8 @@ class SelectGiftCard extends Page { @@ -37,6 +57,8 @@ class SelectGiftCard extends Page {
37 } else { 57 } else {
38 theGiftCard.addClass('checked'); 58 theGiftCard.addClass('checked');
39 } 59 }
  60 +
  61 + this.changeUseBtnStatus();
40 } 62 }
41 } 63 }
42 64
@@ -16,6 +16,10 @@ $title-font-color: #fff; @@ -16,6 +16,10 @@ $title-font-color: #fff;
16 display: none; 16 display: none;
17 } 17 }
18 18
  19 + .active {
  20 + background-color: #444 !important;
  21 + }
  22 +
19 .pull-left { 23 .pull-left {
20 float: left; 24 float: left;
21 } 25 }
@@ -106,4 +110,17 @@ $title-font-color: #fff; @@ -106,4 +110,17 @@ $title-font-color: #fff;
106 .checked > .card-body > .checkbox > .no-checked-icon { 110 .checked > .card-body > .checkbox > .no-checked-icon {
107 display: none; 111 display: none;
108 } 112 }
  113 +
  114 + .use-giftcard-btn {
  115 + position: fixed;
  116 + bottom: 0;
  117 + left: 0;
  118 + width: 750px;
  119 + height: 88px;
  120 + border-radius: 2px;
  121 + background-color: #b0b0b0;
  122 + color: #fff;
  123 + font-size: 32px;
  124 + text-align: center;
  125 + }
109 } 126 }