html form checkcode,checkcode.html

兑换码检测后台

* {

box-sizing: border-box;

}

.container {

margin-top: 100px;

}

em {

font-style: normal;

}

.infobox li #sure {

display: none;

margin-left: 15px;

}

.surebox .layui-m-layerbtn span[yes] {

color: #f00;

}

@media only screen and (min-width: 100px) and (max-width: 640px) {

form {

height: 75px;

}

.input-group {

float: left;

width: calc(100% - 74px);

}

#checkBtn {

float: right;

}

.imglist {

width: 100%;

max-width: 325px;

margin: 0 auto;

}

.imglist .imgbox {

position: relative;

width: 100%;

border: 1px solid #999999;

padding: 5px;

margin: 10px 0;

border-radius: 5px;

overflow: hidden;

}

.imglist .imgbox:hover p {

transform: translateY(35px);

}

.imglist .imgbox img {

width: 100%;

border-radius: 5px;

}

.imglist .imgbox p {

position: absolute;

bottom: 5px;

left: 5px;

width: calc(100% - 10px);

height: 30px;

line-height: 30px;

background: rgba(0, 0, 0, .5);

text-align: center;

color: #fff;

margin: 0;

border-bottom-right-radius: 5px;

border-bottom-left-radius: 5px;

transition: transform .3s;

}

}

@media only screen and (min-width: 641px) and (max-width: 1920px) {

form {

display: block;

width: 1000px;

margin: 0 auto;

height: 150px;

border: 1px solid #f0f0f0;

padding: 58px;

margin-bottom: 50px;

}

form .input-group {

width: 700px;

float: left;

margin-right: 80px;

}

form button {

float: left;

}

.infobox {

width: 1000px;

margin: 0 auto;

}

.infobox li {

padding: 10px 55px;

}

.imglist {

display: -webkit-box;

display: -moz-box;

display: -ms-flexbox;

display: -webkit-flex;

display: flex;

width: 1000px;

margin: 0 auto;

flex-wrap: wrap;

justify-content: space-around;

}

.imglist .imgbox {

position: relative;

width: 325px;

border: 1px solid #999999;

padding: 5px;

margin: 5px 0;

border-radius: 5px;

overflow: hidden;

}

.imglist .imgbox:hover p {

transform: translateY(35px);

}

.imglist .imgbox img {

width: 100%;

border-radius: 5px;

}

.imglist .imgbox p {

position: absolute;

bottom: 5px;

left: 5px;

width: calc(100% - 10px);

height: 30px;

line-height: 30px;

background: rgba(0, 0, 0, .5);

text-align: center;

color: #fff;

margin: 0;

border-bottom-right-radius: 5px;

border-bottom-left-radius: 5px;

transition: transform .3s;

}

}

兑换码

查看

  • 兑换状态:确认消费
  • 兑换类型:
  • 生成时间:
  • 消费时间:
菜品展示

var foodslist = [{

type: 1, //500分

img: 'images/pb4.png',

food: ['“极品羔羊肉” 1份', '“麻辣鸳鸯锅” 1份']

},

{

type: 2, //1000分

img: 'images/pb3.png',

food: ['“龙利鱼” 1份', '“豆腐皮” 1份', '“油炸花生米” 1份']

},

{

type: 3, //2000分

img: 'images/pb2.png',

food: ['“极品肥牛” 1份', '“生菜” 1份', '“宽粉” 1份', '“腐竹” 1份']

},

{

type: 4, //3500分

img: 'images/pb1.png',

food: ['“手打牛肉丸” 1份', '“田园时蔬” 1份', '“鸭血” 1份', '“香豆腐” 1份', '“鹌鹑蛋” 1份', '“精品五花肉” 1份']

}

]

$("#checkBtn").on('click', function() {

if(!$.trim($("#exchangeCode").val()) == "") {

getinfo();

} else {

layer.open({

content: '请先输入兑换码',

skin: 'msg',

time: 2

});

}

})

//获取兑换信息

function getinfo() {

$.ajax({

url: cpj.ajaxUrl + '/act/selectPrizeCodeInfo.json',

data: {

prizeCode: $.trim($("#exchangeCode").val())

},

success: function(data) {

if(data.responseHead.code == 200) {

var result = data.responseBody.prize;

var status, type;

if(result.status == 1) {

status = '未消费';

$("#sure").off("click");

$("#sure").show().on('click', function() {

layer.open({

content: '确认消费?',

btn: ['朕确认了', '点错了'],

className: 'surebox',

yes: function(index) {

if($.trim($("#exchangeCode").val()) != "") {

usePrizeCode();

} else {

layer.open({

content: '请先输入兑换码',

skin: 'msg',

time: 2

});

}

}

});

});

} else {

status = '已消费';

$("#sure").hide()

}

switch(Number(result.type)) {

case 1:

type = '500 分值菜品';

break;

case 2:

type = '1000 分值菜品';

break;

case 3:

type = '2000 分值菜品';

break;

case 4:

type = '3500 分值菜品';

break;

default:

type = '未知';

break;

}

$(".infobox li").eq(0).find("em").text(status);

$(".infobox li").eq(1).find("em").text(type);

$(".infobox li").eq(2).find("em").text(result.createTime);

$(".infobox li").eq(3).find("em").text(result.usedTime ? result.usedTime : "");

$("#imglist").empty();

foodslist[Number(result.type) - 1].food.forEach(function(item, index) {

var box = '

';

box += ''%20+%20index%20+%20'.jpg';

box += '

' + item + '

';

$("#imglist").append(box);

});

} else {

layer.open({

content: data.responseHead.msg,

skin: 'msg',

time: 2

});

}

}

});

}

//使用兑换码

function usePrizeCode() {

cpj.ajax({

url: '/act/usePrizeCode.json',

data: { prizeCode: $.trim($("#exchangeCode").val()) },

success: function(data) {

layer.open({

content: '使用成功',

end: function() {

getinfo();

}

});

},

error: function(code, msg) {

layer.open({

content: msg,

skin: 'msg',

time: 2

});

}

})

}

一键复制

编辑

Web IDE

原始数据

按行查看

历史

根据提供的引用内容,有三种解决方法可以解决在后台无法获取设置了ReadOnly=true的TextBox控件的值的问题。 方法一:使用HiddenField控件 在前台页面中,将TextBox的值赋给一个HiddenField控件的Value属性。然后在后台代码中,通过读取HiddenField的Value属性来获取TextBox的值。 方法二:使用ViewState 在前台页面中,将TextBox的值赋给ViewState变量。然后在后台代码中,通过读取ViewState变量来获取TextBox的值。 方法三:使用Request.Form 在后台代码中,通过Request.Form来获取TextBox的值。例如,如果TextBox的id为checkCode,可以使用Request.Form["checkCode"]来获取其值。 以下是三种解决方法的示例代码: 方法一:使用HiddenField控件 ```html <input type="text" onclick="createCode()" readonly="readonly" id="checkCode" class="code" style="width: 100px"> <asp:HiddenField ID="hiddenField1" runat="server" /> <script> function createCode() { // 获取TextBox的值 var textBoxValue = document.getElementById("checkCode").value; // 将TextBox的值赋给HiddenField document.getElementById("<%= hiddenField1.ClientID %>").value = textBoxValue; } </script> ``` 方法二:使用ViewState ```html <input type="text" onclick="createCode()" readonly="readonly" id="checkCode" class="code" style="width: 100px"> <script> function createCode() { // 获取TextBox的值 var textBoxValue = document.getElementById("checkCode").value; // 将TextBox的值赋给ViewState <%= ViewState["textBoxValue"] = textBoxValue %> } </script> ``` 方法三:使用Request.Form ```csharp protected void Page_Load(object sender, EventArgs e) { // 获取TextBox的值 string textBoxValue = Request.Form["checkCode"]; // 使用TextBox的值 // ... } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值