orzar/assets/js/main.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2025-06-05 14:46:21 +08:00
$(function() {
$("#subbtn").click(function() {
var name = $("#name").val()
var phone = $("#phone").val()
var content = $("#content").val()
var Email = $("#Email").val()
AjaxUtils.post('apis/contact/add', {
name: name,
phone: phone,
content: content,
email: Email,
vehicle_id: 0
}).done(function(result) {
alert(result.data.message)
// console.log(result);
}).fail(function(error) {
// console.error(error);
});
})
$("#subscribeFn").click(function() {
var email = $("#emailinput").val()
// if (email == '') {
// return false
// }
AjaxUtils.post('apis/email/subscribe', {
email: email,
}).done(function(result) {
alert(result.message)
// console.log(result);
}).fail(function(error) {
// console.error(error);
});
})
AjaxUtils.get('apis/brand/letterAll', {
is_hot:'1',
}).done(function(data) {
var brandList = data.data;
var html=''
$.each(brandList,function(){
2025-06-09 11:00:46 +08:00
html+='<li id="menu-item-'+this.id+'" class="menu-item"><a href="brand.html?id='+this.id+'"><img src="'+this.logo_full+'" alt="" />'+this.name+'</a></li>'
2025-06-05 14:46:21 +08:00
});
$(".has_lv3 .flex-layout").html(html)
}).fail(function(error) {
// console.error(error);
});
})