init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)

这个提交包含在:
Developer
2026-10-30 10:18:50 +08:00
当前提交 1f3e0ce2f6
共有 9291 个文件被更改,包括 1776674 次插入 和 0 次删除

72
Public/vip/js/exchange.js 可执行文件
查看文件

@@ -0,0 +1,72 @@
var showIndex = localStorage.exchangeShowIndex||0;
$('.memb_inner').eq(showIndex).addClass('cheakm');
$('.list_con').eq(showIndex).show();
$(".memb_inner").on('touchstart',function() {
$(".memb_inner").removeClass("cheakm");
$(this).addClass("cheakm");
var index = $(this).index();
localStorage.exchangeShowIndex = index;
$('.list_con').hide();
$('.list_con').eq(index).show();
})
var need = 0;
//兑换优惠券
$('#coupon').on('touchstart',function (e) {
var e = e ||window.event;
exchange(e.target,1);
})
//兑换商品
$('#goods').on('touchstart',function (e) {
var e = e ||window.event;
exchange(e.target,2);
})
function exchange(target,type) {
var integral = parseInt($('.memb_a>p>span').html());
need = parseInt($(target).attr('need'));
if(need>integral){
alertMsg('您的积分不足'+need,1000);
return;
}
if(target.className=='memb_c03'||target.className=='memb_b04'){
var t = type==1?'优惠券':'商品';
alertSureAndCancel({
title:'温馨提示',
detail:'您确认兑换该'+t+'?',
sureText:'兑换',
sure:function () {
alertShowLoading({
title:t+'兑换中'
},function () {
var integral = parseInt($('.memb_a>p>span').html());
var exchangeid = $(target).attr('id');
exchangeid = exchangeid.split('-')[1];
$.post("/index.php/Vip/Exchange/toExchange",{
exchangeid:exchangeid,
type:type,
storeid:storeid
},function (data) {
alertHideLoading();
if(data.success){
localStorage.exchange = 1;//积分变动
if(type==1){
//优惠券
alertMsg(data.msg,1000,function () {
window.location.replace("/index.php/Vip/Coupon/index");
})
}else {
//商品
alertBtn(data.msg,function () {
window.history.go(-1);//返回首页
});
}
}else {
alertMsg(data.msg,1000);
}
})
})
}
})
}
}