switch to jquery as Liangzhifeng comments. code review by bikai
Showing
1 changed file
with
11 additions
and
11 deletions
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | var $ = require('jquery'); | 6 | var $ = require('jquery'); |
7 | 7 | ||
8 | var loading = require('../plugin/loading'), | 8 | var loading = require('../plugin/loading'), |
9 | - tip = require('../plugin/tip'); | 9 | + tip = require('../plugin/tip'), |
10 | Hammer = require('yoho.hammer'); | 10 | Hammer = require('yoho.hammer'); |
11 | 11 | ||
12 | var theOrderCode = document.getElementById('ordercode').value; | 12 | var theOrderCode = document.getElementById('ordercode').value; |
@@ -100,9 +100,9 @@ function isWXOpen() { | @@ -100,9 +100,9 @@ function isWXOpen() { | ||
100 | } | 100 | } |
101 | 101 | ||
102 | function hideWeChatPay() { | 102 | function hideWeChatPay() { |
103 | - var payApps = $('.app'); | 103 | + var $payApps = $('.app'); |
104 | 104 | ||
105 | - payApps.each(function(idx, app) { | 105 | + $payApps.each(function(idx, app) { |
106 | if ($(app).attr('id') === 'weixin') { | 106 | if ($(app).attr('id') === 'weixin') { |
107 | $(app).parent().css('display', 'none'); | 107 | $(app).parent().css('display', 'none'); |
108 | return false; | 108 | return false; |
@@ -122,25 +122,25 @@ function setAppIcon(el, position) { | @@ -122,25 +122,25 @@ function setAppIcon(el, position) { | ||
122 | } | 122 | } |
123 | 123 | ||
124 | function loadIcon() { | 124 | function loadIcon() { |
125 | - var boxs = $('.box'); | ||
126 | - var div = null; | 125 | + var $boxs = $('.box'); |
126 | + var $div = null; | ||
127 | var appid = null; | 127 | var appid = null; |
128 | 128 | ||
129 | - boxs.each(function(idx, box) { | ||
130 | - div = $(box).find('.icon').find('div'); | ||
131 | - if (div.length > 0) { | 129 | + $boxs.each(function(idx, box) { |
130 | + $div = $(box).find('.icon').find('div'); | ||
131 | + if ($div.length > 0) { | ||
132 | appid = $(box).attr('id'); | 132 | appid = $(box).attr('id'); |
133 | if (appid !== 'alipay') { | 133 | if (appid !== 'alipay') { |
134 | - setAppIcon(div, appIconPosition[appid]); | 134 | + setAppIcon($div, appIconPosition[appid]); |
135 | } | 135 | } |
136 | } | 136 | } |
137 | }); | 137 | }); |
138 | } | 138 | } |
139 | 139 | ||
140 | function showPage() { | 140 | function showPage() { |
141 | - var pageList = $('.payapp-list'); | 141 | + var $pageList = $('.payapp-list'); |
142 | 142 | ||
143 | - pageList.css('visibility', 'visible'); | 143 | + $pageList.css('visibility', 'visible'); |
144 | } | 144 | } |
145 | 145 | ||
146 | if (wxHammer) { | 146 | if (wxHammer) { |
-
Please register or login to post a comment