Commit 3d8b6e0d by 颜景龙

礼物页面

parent 9229b923
正在显示 包含 36 行增加13 行删除
......@@ -107,6 +107,7 @@
text-overflow: ellipsis;
overflow: hidden;
color:#000;
line-height: 1.375rem;
}
.card-type {
......@@ -201,6 +202,7 @@
height: 2rem;
width: 2rem;
margin: 0.5rem;
margin-top: 1.2rem;
}
</style>
......@@ -328,7 +330,7 @@
var cardFooter = $("<div class='card-footer'></div>");
var cardType = $("<div class='card-type'></div>");
$('<span class="gift-name"></span>').text(list[i].name).appendTo(cardType);
$('<span class="gift-price"></span>').text(list[i].price).appendTo(cardType);
$('<span class="gift-price"></span>').text('¥ '+list[i].price).appendTo(cardType);
cardFooter.append(cardType);
$("<p></p>").text(list[i].description).appendTo(cardFooter);
......@@ -391,9 +393,7 @@
sendForm:true,
firstInvalidFocus: true,
invalid:function() {
setTimeout(() => {
console.log($('.field-tooltipWrap').children().children().children());
}, 500);
},
valid:function(event,options){
//点击提交按钮时,表单通过验证触发函数
......@@ -415,6 +415,7 @@
dataType: 'json',
success: function(result){
if (result.code == 0) {
$("#uploadForm")[0].reset();
location.href="ydl://goback";
} else {
alert(result.data);
......
......@@ -58,13 +58,14 @@
height: 2rem;
width: 2rem;
margin: 0.5rem;
margin-top: 1.2rem;
}
</style>
</head>
<body>
<img id="return-img" class="return-img" src="./left_white.png" />
<img class="img" src="./giftindex.jpg">
<button type="submit" id="submitBtn" class="zbtn zbtn-full zbtn-lg submit-btn">参加活动</button>
<!-- <button type="submit" id="submitBtn" class="zbtn zbtn-full zbtn-lg submit-btn">参加活动</button> -->
<script src="https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
<script type="text/javascript">
function getUrlParam(name) {
......@@ -73,6 +74,13 @@
if (r != null) return unescape(r[2]); return null; //返回参数值
}
//var HTTP_URL = 'http://192.168.31.182:8080/wedo-fit';
var HTTP_URL = 'http://192.168.31.217:8080/wedo';
var id = getUrlParam('id');
var customerUserId = getUrlParam('customerUserId');
$(document).ready(function() {
$(window).ready(function(){
......@@ -82,14 +90,27 @@
$('html').css({'font-size':$(window).width()/375*16});
});
$("#submitBtn").on('click', function(e){
var id = getUrlParam('id');
var customerUserId = getUrlParam('customerUserId');
if (id && customerUserId) {
location.href = './gift.html?id=' + id + "&customerUserId=" + customerUserId;
if (id && customerUserId) {
$.ajax({
type: 'get',
url: HTTP_URL+"/wedofit/gift/isAcquireGift/"+customerUserId,
contentType: 'application/json',
dataType: 'json',
success: function(result){
if (result.code == 0 && result.data.status) {
$('<button type="submit" id="submitBtn" class="zbtn zbtn-full zbtn-lg submit-btn">参加活动</button>').appendTo($("body"));
$("#submitBtn").on('click', function(e){
if (id && customerUserId) {
location.href = './gift.html?id=' + id + "&customerUserId=" + customerUserId;
}
});
}
},
error: function(xhr, type){
alert('Ajax error!')
}
});
});
}
$("#return-img").on('click', function(e){
......
......@@ -25,5 +25,5 @@
### 礼品活动页面(id="活动id", customerUserId="用户id")
> http://192.168.31.182:8080/wedo-fit/htmlpages/course/gift/gift.html?id=8356215132383232&customerUserId=8355171395831808
### 礼品展示页面
### 礼品展示页面(id="活动id", customerUserId="用户id")
> http://192.168.31.182:8080/wedo-fit/htmlpages/course/gift/giftindex.html
\ No newline at end of file
此文件类型无法预览
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此消息的编辑!
注册登录 后发表评论