Commit 95ae7661 by 颜景龙

增加微信支持

parent 69bccb6e
正在显示 包含 18 行增加4 行删除
...@@ -547,6 +547,7 @@ ...@@ -547,6 +547,7 @@
var id = getUrlParam('id'); var id = getUrlParam('id');
var customerUserId = getUrlParam('customerUserId'); var customerUserId = getUrlParam('customerUserId');
var type = getUrlParam('type');
$(document).ready(function() { $(document).ready(function() {
...@@ -559,6 +560,10 @@ ...@@ -559,6 +560,10 @@
if (id && customerUserId) { if (id && customerUserId) {
if (type === "weixin") {
$('#return-img').remove();
}
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: HTTP_URL+"/wedofit/gift/info", url: HTTP_URL+"/wedofit/gift/info",
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
var HTTP_URL = CONSTANT.getConstant(); var HTTP_URL = CONSTANT.getConstant();
var id = getUrlParam('id'); var id = getUrlParam('id');
var customerUserId = getUrlParam('customerUserId'); var customerUserId = getUrlParam('customerUserId');
var type = getUrlParam('type');
$(document).ready(function() { $(document).ready(function() {
$(window).ready(function(){ $(window).ready(function(){
...@@ -104,6 +104,10 @@ ...@@ -104,6 +104,10 @@
}, 200); }, 200);
if (id && customerUserId) { if (id && customerUserId) {
if (type === "weixin") {
$('#return-img').remove();
}
$.ajax({ $.ajax({
type: 'get', type: 'get',
url: HTTP_URL+"/wedofit/gift/isHasGift/"+customerUserId, url: HTTP_URL+"/wedofit/gift/isHasGift/"+customerUserId,
...@@ -113,9 +117,14 @@ ...@@ -113,9 +117,14 @@
if (result.code == 0 && result.data) { if (result.code == 0 && result.data) {
$('<button type="submit" id="submitBtn" class="zbtn zbtn-full zbtn-lg submit-btn">参加活动</button>').appendTo($("body")); $('<button type="submit" id="submitBtn" class="zbtn zbtn-full zbtn-lg submit-btn">参加活动</button>').appendTo($("body"));
$("#submitBtn").on('click', function(e){ $("#submitBtn").on('click', function(e){
if (id && customerUserId) { var resultHref = '';
location.href = './gift.html?id=' + id + "&customerUserId=" + customerUserId; if (id && customerUserId && !type) {
resultHref = './gift.html?id=' + id + "&customerUserId=" + customerUserId;
} else if (id && customerUserId && type) {
resultHref = './gift.html?id=' + id + "&customerUserId=" + customerUserId + "&type=" + type;
} }
location.href = resultHref;
}); });
} }
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "http-server -a 0.0.0.0 -p 9091" "start": "http-server -a 0.0.0.0 -p 8080"
}, },
"author": "", "author": "",
"license": "ISC" "license": "ISC"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此消息的编辑!
注册登录 后发表评论