...
|
...
|
@@ -6,7 +6,14 @@ var $ = require('yoho-jquery'), |
|
|
oldUserCouponPic = $('#oldUserCouponPic').html(),
|
|
|
newUserCouponPic = $('#newUserCouponPic').html(),
|
|
|
tipMessage = $('#tipMessage').html(),
|
|
|
activityID = $('#activityID').html();
|
|
|
activityID = $('#activityID').html(),
|
|
|
pageInfo = $('#pageInfo').html(),
|
|
|
_weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage',
|
|
|
shareTitle = $('#shareTitle').val(),
|
|
|
shareImg = $('#shareImg').val(),
|
|
|
shareDesc = $('#shareDesc').val(),
|
|
|
shareLink = $('#shareLink').val(),
|
|
|
wx = window.wx;
|
|
|
|
|
|
$('#phone').bind('input propertychange', function() {
|
|
|
if ($(this).val().length === 11) {
|
...
|
...
|
@@ -42,8 +49,90 @@ if (!$('#newUser').html()) { |
|
|
$('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic);
|
|
|
}
|
|
|
|
|
|
$('.input-content').on('click', '.verification-code', function() {
|
|
|
$('.input-content div').eq('0').removeClass('verification-code');
|
|
|
/**
|
|
|
* 微信分享
|
|
|
*/
|
|
|
if (typeof wx !== 'undefined') {
|
|
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
|
|
encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
|
|
|
function(json) {
|
|
|
var _appId, _timestamp, _nonceStr, _signature;
|
|
|
|
|
|
if (json) {
|
|
|
_appId = json.appId.toString();
|
|
|
_timestamp = json.timestamp;
|
|
|
_nonceStr = json.nonceStr.toString();
|
|
|
_signature = json.signature.toString();
|
|
|
|
|
|
wx.config({
|
|
|
debug: false,
|
|
|
appId: _appId,
|
|
|
timestamp: _timestamp,
|
|
|
nonceStr: _nonceStr,
|
|
|
signature: _signature,
|
|
|
jsApiList: [
|
|
|
'checkJsApi',
|
|
|
'onMenuShareTimeline',
|
|
|
'onMenuShareAppMessage',
|
|
|
'onMenuShareQQ',
|
|
|
'onMenuShareWeibo',
|
|
|
'hideMenuItems',
|
|
|
'showMenuItems',
|
|
|
'hideAllNonBaseMenuItem',
|
|
|
'showAllNonBaseMenuItem',
|
|
|
'translateVoice',
|
|
|
'startRecord',
|
|
|
'stopRecord',
|
|
|
'onRecordEnd',
|
|
|
'playVoice',
|
|
|
'pauseVoice',
|
|
|
'stopVoice',
|
|
|
'uploadVoice',
|
|
|
'downloadVoice',
|
|
|
'chooseImage',
|
|
|
'previewImage',
|
|
|
'uploadImage',
|
|
|
'downloadImage',
|
|
|
'getNetworkType',
|
|
|
'openLocation',
|
|
|
'getLocation',
|
|
|
'hideOptionMenu',
|
|
|
'showOptionMenu',
|
|
|
'closeWindow',
|
|
|
'scanQRCode',
|
|
|
'chooseWXPay',
|
|
|
'openProductSpecificView',
|
|
|
'addCard',
|
|
|
'chooseCard',
|
|
|
'openCard'
|
|
|
]
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
wx.ready(function() {
|
|
|
var shareData = {
|
|
|
title: shareTitle,
|
|
|
desc: shareDesc,
|
|
|
imgUrl: shareImg,
|
|
|
link: shareLink
|
|
|
};
|
|
|
|
|
|
// 分享给朋友
|
|
|
wx.onMenuShareAppMessage(shareData);
|
|
|
|
|
|
// 分享到朋友圈
|
|
|
wx.onMenuShareTimeline(shareData);
|
|
|
|
|
|
// 分享到QQ
|
|
|
wx.onMenuShareQQ(shareData);
|
|
|
|
|
|
// 分享到微博
|
|
|
wx.onMenuShareWeibo(shareData);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.input-content div').on('click', function() {
|
|
|
phone = $(this).siblings('input').val();
|
|
|
reg = /[0-9]{11}/;
|
|
|
if (!reg.test(phone)) {
|
...
|
...
|
@@ -63,7 +152,6 @@ $('.input-content').on('click', '.verification-code', function() { |
|
|
mobile: $('#phone').val(),
|
|
|
ordercode: orderCode
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
success: function(data) {
|
|
|
if (data.result.code === 200) {
|
|
|
if (window._yas) {
|
...
|
...
|
@@ -122,11 +210,15 @@ $('.input-content').on('click', '.verification-code', function() { |
|
|
}, 1400);
|
|
|
}
|
|
|
},
|
|
|
error: function(data) {
|
|
|
error: function() {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>');
|
|
|
console.log(data);
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -211,11 +303,15 @@ $('.input-content').on('click', '.get', function() { |
|
|
}, 1400);
|
|
|
}
|
|
|
},
|
|
|
error: function(data) {
|
|
|
error: function() {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>');
|
|
|
console.log(data);
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
...
|
...
|
@@ -243,7 +339,7 @@ $('.description').on('click', function() { |
|
|
$('.mask').removeClass('hidden');
|
|
|
});
|
|
|
|
|
|
$('.input-content').on('click', '.get', function() {
|
|
|
$('.use-coupon-btn').on('click', function() {
|
|
|
if (window._yas) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
activityID: activityID
|
...
|
...
|
|