@@ -62,11 +62,11 @@ |
||
62 | 62 |
<script type="text/javascript" src="{% static 'tamron/js/jswe.js' %}?v=1"></script> |
63 | 63 |
<script> |
64 | 64 |
V.initWxData({ |
65 |
- imgUrl: "http://pai.ai/static/pai2/img/paiai_96_96.png", |
|
66 |
- link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://pai.ai/page/lensman&scope=snsapi_base', |
|
67 |
- desc: "摄影师授权", |
|
68 |
- title: "摄影师授权", |
|
69 |
- timeLine: "" |
|
65 |
+ imgUrl: 'http://pai.ai/static/pai2/img/paiai_96_96.png', |
|
66 |
+ link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://tamron.xfoto.com.cn/page/clerk', |
|
67 |
+ desc: '店员授权', |
|
68 |
+ title: '店员授权', |
|
69 |
+ timeLine: '' |
|
70 | 70 |
}, true); |
71 | 71 |
V.hideOptionMenu(); |
72 | 72 |
</script> |
@@ -186,11 +186,11 @@ |
||
186 | 186 |
<script type="text/javascript" src="{% static 'tamron/js/jswe.js' %}?v=1"></script> |
187 | 187 |
<script> |
188 | 188 |
V.initWxData({ |
189 |
- imgUrl: "http://pai.ai/static/pai2/img/paiai_96_96.png", |
|
190 |
- link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://pai.ai/page/lensman&scope=snsapi_base', |
|
191 |
- desc: "摄影师授权", |
|
192 |
- title: "摄影师授权", |
|
193 |
- timeLine: "" |
|
189 |
+ imgUrl: 'http://pai.ai/static/pai2/img/paiai_96_96.png', |
|
190 |
+ link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://tamron.xfoto.com.cn/page/clerk', |
|
191 |
+ desc: '店员授权', |
|
192 |
+ title: '店员授权', |
|
193 |
+ timeLine: '' |
|
194 | 194 |
}, true); |
195 | 195 |
V.hideOptionMenu(); |
196 | 196 |
</script> |
@@ -39,6 +39,7 @@ |
||
39 | 39 |
<div class="weui_cell_bd weui_cell_primary"> |
40 | 40 |
<input id="code" class="weui_input" type="text" value="" placeholder="请输入机身码"> |
41 | 41 |
</div> |
42 |
+ <a id="scan" href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">扫码</a> |
|
42 | 43 |
</div> |
43 | 44 |
</div> |
44 | 45 |
|
@@ -178,13 +179,22 @@ |
||
178 | 179 |
<script type="text/javascript" src="{% static 'tamron/js/jswe.js' %}?v=1"></script> |
179 | 180 |
<script> |
180 | 181 |
V.initWxData({ |
181 |
- imgUrl: "http://pai.ai/static/pai2/img/paiai_96_96.png", |
|
182 |
- link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://pai.ai/page/lensman&scope=snsapi_base', |
|
183 |
- desc: "摄影师授权", |
|
184 |
- title: "摄影师授权", |
|
185 |
- timeLine: "" |
|
182 |
+ imgUrl: 'http://pai.ai/static/pai2/img/paiai_96_96.png', |
|
183 |
+ link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://tamron.xfoto.com.cn/page/clerk', |
|
184 |
+ desc: '店员授权', |
|
185 |
+ title: '店员授权', |
|
186 |
+ timeLine: '' |
|
186 | 187 |
}, true); |
187 | 188 |
V.hideOptionMenu(); |
189 |
+ |
|
190 |
+ $('#scan').click(function () { |
|
191 |
+ V.scanQRCode({ |
|
192 |
+ needResult: 1 |
|
193 |
+ }); |
|
194 |
+ }); |
|
195 |
+ V.wxScanQRCodeSuccess = function (res) { |
|
196 |
+ $('#code').val(res.resultStr); |
|
197 |
+ } |
|
188 | 198 |
</script> |
189 | 199 |
</body> |
190 | 200 |
</html> |
@@ -3,7 +3,7 @@ |
||
3 | 3 |
wxconfig: 'http://api.pai.ai/wx/jsapi_signature', |
4 | 4 |
callback: 'callback' |
5 | 5 |
}, wxData = { |
6 |
- debug: false, |
|
6 |
+ debug: true, |
|
7 | 7 |
imgUrl: '', |
8 | 8 |
link: '', |
9 | 9 |
desc: '', |
@@ -229,6 +229,20 @@ |
||
229 | 229 |
for (var index in localIds) {uploadImage(localIds[index], isShowProgressTips)} |
230 | 230 |
} |
231 | 231 |
|
232 |
+ // 9 微信原生接口 |
|
233 |
+ // 9.1.1 扫描二维码并返回结果 |
|
234 |
+ // 9.1.2 扫描二维码并返回结果 |
|
235 |
+ function scanQRCode(scan_params) { |
|
236 |
+ if ('undefined' === typeof scan_params) scan_params = {} |
|
237 |
+ wx.scanQRCode({ |
|
238 |
+ needResult: scan_params.needResult || 0, // 默认为0,0扫描结果由微信处理,1直接返回扫描结果 |
|
239 |
+ scanType: scan_params.scanType || ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有 |
|
240 |
+ success: function (res) { // 当 needResult 为 1 时,扫码返回的结果 |
|
241 |
+ if (JSWE.wxScanQRCodeSuccess) {JSWE.wxScanQRCodeSuccess(res)} |
|
242 |
+ } |
|
243 |
+ }); |
|
244 |
+ } |
|
245 |
+ |
|
232 | 246 |
// 10 微信支付接口 |
233 | 247 |
// 10.1 发起一个支付请求 |
234 | 248 |
function chooseWXPay(wxpay_params) { |
@@ -290,6 +304,9 @@ |
||
290 | 304 |
uploadImage: uploadImage, |
291 | 305 |
uploadImages: uploadImages, |
292 | 306 |
|
307 |
+ // Scan Function |
|
308 |
+ scanQRCode: scanQRCode, |
|
309 |
+ |
|
293 | 310 |
// Pay Function |
294 | 311 |
chooseWXPay: chooseWXPay, |
295 | 312 |
|