Merge branch 'hotfix/life' of http://git.dev.yoho.cn/web/yohobuywap into hotfix/life
Showing
11 changed files
with
94 additions
and
8 deletions
@@ -12354,14 +12354,13 @@ function get() { | @@ -12354,14 +12354,13 @@ function get() { | ||
12354 | $('.statu-mark').show(); | 12354 | $('.statu-mark').show(); |
12355 | $('.statu-box').show(); | 12355 | $('.statu-box').show(); |
12356 | if (data.code === 200) { | 12356 | if (data.code === 200) { |
12357 | - $('.sure').click(function() { | ||
12358 | - location.href = '/life/coupon' + '?' + 'code' + '=' + data.data; | ||
12359 | - }); | 12357 | + location.href = '/life/coupon' + '?' + 'code' + '=' + data.data; |
12358 | + } else if (data.code === 401) { | ||
12359 | + $('.successed').show(); | ||
12360 | + } else if (data.code === 403) { | ||
12361 | + $('.late').show(); | ||
12360 | } else { | 12362 | } else { |
12361 | - $('.sure').click(function() { | ||
12362 | - $('.statu-mark').hide(); | ||
12363 | - $('.statu-box').hide(); | ||
12364 | - }); | 12363 | + $('.faill').show(); |
12365 | } | 12364 | } |
12366 | } | 12365 | } |
12367 | }); | 12366 | }); |
@@ -12380,5 +12379,92 @@ var $ = require("jquery"), | @@ -12380,5 +12379,92 @@ var $ = require("jquery"), | ||
12380 | var arr = code.split('='); | 12379 | var arr = code.split('='); |
12381 | 12380 | ||
12382 | $('.coupon-input').val(arr[1]); | 12381 | $('.coupon-input').val(arr[1]); |
12383 | -require("js/plugin/wx-share"); | 12382 | +require("js/plugin/life-share"); |
12383 | +}); | ||
12384 | +define("js/plugin/life-share", ["jquery"], function(require, exports, module){ | ||
12385 | +/** | ||
12386 | + * 微信分享 | ||
12387 | + * @author: xuqi<qi.xu@yoho.cn> | ||
12388 | + * @date: 2015/10/30 | ||
12389 | + */ | ||
12390 | + | ||
12391 | +var $ = require("jquery"); | ||
12392 | + | ||
12393 | +module.exports = function() { | ||
12394 | + var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage'; | ||
12395 | + | ||
12396 | + $.getJSON(_weChatInterface + '?pageurl=' + | ||
12397 | + encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function(json) { | ||
12398 | + var _appId, _timestamp, _nonceStr, _signature; | ||
12399 | + | ||
12400 | + if (json !== undefined && json !== '') { | ||
12401 | + _appId = json.appId.toString(); | ||
12402 | + _timestamp = json.timestamp; | ||
12403 | + _nonceStr = json.nonceStr.toString(); | ||
12404 | + _signature = json.signature.toString(); | ||
12405 | + | ||
12406 | + wx.config({ | ||
12407 | + debug: false, | ||
12408 | + appId: _appId, | ||
12409 | + timestamp: _timestamp, | ||
12410 | + nonceStr: _nonceStr, | ||
12411 | + signature: _signature, | ||
12412 | + jsApiList: [ | ||
12413 | + 'checkJsApi', | ||
12414 | + 'onMenuShareTimeline', | ||
12415 | + 'onMenuShareAppMessage', | ||
12416 | + 'onMenuShareQQ', | ||
12417 | + 'onMenuShareWeibo', | ||
12418 | + 'hideMenuItems', | ||
12419 | + 'showMenuItems', | ||
12420 | + 'hideAllNonBaseMenuItem', | ||
12421 | + 'showAllNonBaseMenuItem', | ||
12422 | + 'translateVoice', | ||
12423 | + 'startRecord', | ||
12424 | + 'stopRecord', | ||
12425 | + 'onRecordEnd', | ||
12426 | + 'playVoice', | ||
12427 | + 'pauseVoice', | ||
12428 | + 'stopVoice', | ||
12429 | + 'uploadVoice', | ||
12430 | + 'downloadVoice', | ||
12431 | + 'chooseImage', | ||
12432 | + 'previewImage', | ||
12433 | + 'uploadImage', | ||
12434 | + 'downloadImage', | ||
12435 | + 'getNetworkType', | ||
12436 | + 'openLocation', | ||
12437 | + 'getLocation', | ||
12438 | + 'hideOptionMenu', | ||
12439 | + 'showOptionMenu', | ||
12440 | + 'closeWindow', | ||
12441 | + 'scanQRCode', | ||
12442 | + 'chooseWXPay', | ||
12443 | + 'openProductSpecificView', | ||
12444 | + 'addCard', | ||
12445 | + 'chooseCard', | ||
12446 | + 'openCard' | ||
12447 | + ] | ||
12448 | + }); | ||
12449 | + } | ||
12450 | + }); | ||
12451 | + | ||
12452 | + wx.ready(function() { | ||
12453 | + var shareTitle = $('#title').val(); | ||
12454 | + var shareImg = $('#img').val(); | ||
12455 | + var shareDesc = $('#desc').val(); | ||
12456 | + var shareLink = $('#link').val(); | ||
12457 | + var shareData = { | ||
12458 | + title: shareTitle, | ||
12459 | + desc: shareDesc, | ||
12460 | + imgUrl: shareImg, | ||
12461 | + link: shareLink | ||
12462 | + }; | ||
12463 | + | ||
12464 | + wx.onMenuShareAppMessage(shareData); | ||
12465 | + wx.onMenuShareTimeline(shareData); | ||
12466 | + wx.onMenuShareQQ(shareData); | ||
12467 | + wx.onMenuShareWeibo(shareData); | ||
12468 | + }); | ||
12469 | +}; | ||
12384 | }); | 12470 | }); |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

20.9 KB

20.5 KB

79.2 KB

8.94 KB

32.6 KB
-
Please register or login to post a comment