Commit 9c58757a by 梁建民

账户设置

parent ccdefd46
...@@ -840,3 +840,4 @@ body { ...@@ -840,3 +840,4 @@ body {
color: #ADB6BF; color: #ADB6BF;
cursor: pointer; cursor: pointer;
} }
/*# sourceMappingURL=base.css.map */
\ No newline at end of file
...@@ -256,3 +256,4 @@ ...@@ -256,3 +256,4 @@
.home_content .new_xj .new_xj_list .new_xj_item:hover { .home_content .new_xj .new_xj_list .new_xj_item:hover {
box-shadow: 0px 5px 10px 0px rgba(216, 223, 230, 0.5); box-shadow: 0px 5px 10px 0px rgba(216, 223, 230, 0.5);
} }
/*# sourceMappingURL=home.css.map */
\ No newline at end of file
{"version":3,"sources":["home.less"],"names":[],"mappings":"AAAA,aACI;EACI,aAAA;EACA,sBAAA;EACA,6BAAA;EACA,eAAA;;AALR,aACI,WAMI;EACI,gBAAA;EACA,OAAO,kBAAP;EACA,mBAAA;;AAVZ,aACI,WAMI,aAKI;EACI,aAAA;EACA,YAAA;EACA,sBAAA;EACA,kBAAA;;AAhBhB,aACI,WAMI,aAYI;EACI,cAAA;EACA,OAAO,kBAAP;;AArBhB,aACI,WAMI,aAYI,WAII;EACI,eAAA;;AAxBpB,aACI,WAMI,aAYI,WASI;EACI,gBAAA;EACA,eAAA;EACA,mBAAA;;AA/BpB,aACI,WAMI,aAYI,WAeI;EACI,cAAA;EACA,eAAA;EACA,gBAAA;;AArCpB,aACI,WAMI,aAYI,WAeI,YAKI;EACI,kBAAA;;AAxCxB,aACI,WAMI,aAYI,WAeI,YAKI,OAGI;EACI,cAAA;;AA3C5B,aACI,WAiDI;EACI,gBAAA;EACA,kBAAA;EACA,YAAA;;AArDZ,aACI,WAiDI,YAKI;EACI,cAAA;;AAxDhB,aACI,WAiDI,YASI;EACI,eAAA;;AAEA,aA7DZ,WAiDI,YASI,KAGK;EACG,cAAA;;AAGJ,aAjEZ,WAiDI,YASI,KAOK;EACG,cAAA;;AAGJ,aArEZ,WAiDI,YASI,KAWK;EACG,cAAA;;AAvEpB,aACI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,MAcK;EACG,yBAAA;;AAhM5B,aAyKI,OAGI,YAGI,YACI,UAqBI;EACI,iBAAA;EACA,OAAO,iBAAP;;AAvMxB,aAgNI;EACI,gBAAA;;AAjNR,aAgNI,QAGI;EACI,kBAAA;;AApNZ,aAgNI,QAGI,cAGI;EACI,eAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,UAAA;;AA5NhB,aAgNI,QAgBI;EACI,eAAA;EACA,gBAAA;;AAlOZ,aAgNI,QAgBI,aAII;EACI,YAAA;EACA,sBAAA;EACA,gBAAA;EACA,eAAA;EACA,cAAA;EACA,eAAA;EACA,iBAAA;EACA,gCAAA;;AAEA,aA9BZ,QAgBI,aAII,aAUK;EACG,mBAAA;;AA/OpB,aAgNI,QAgBI,aAII,aAcI;EACI,cAAA;EACA,eAAA;EACA,UAAA;;AArPpB,aAgNI,QAgBI,aAII,aAoBI;EACI,UAAA;;AAzPpB,aAgNI,QAgBI,aAII,aAoBI,OAGI;EACI,cAAA;;AA5PxB,aAgNI,QAgBI,aAII,aA4BI;EACI,UAAA;;AAjQpB,aAgNI,QAgBI,aAII,aA4BI,KAGI;EACI,cAAA;;AApQxB,aAgNI,QAgBI,aAII,aAoCI;EACI,UAAA;;AAzQpB,aAgNI,QAgBI,aAII,aAoCI,SAGI;EACI,eAAA;EACA,cAAA;EACA,yCAAA;EACA,8BAAA;EACA,gBAAA;EACA,kBAAA;;AAEA,aAnEpB,QAgBI,aAII,aAoCI,SAGI,MAQK;EACG,yCAAA;EACA,cAAA;;AArR5B,aAgNI,QAgBI,aAII,aAoCI,SAiBI;EACI,cAAA;;AA1RxB,aAgNI,QAgBI,aAII,aA0DI;EACI,UAAA;;AA/RpB,aAgNI,QAgBI,aAII,aA+DI;EACI,WAAA;EACA,cAAA;EACA,SAAA;EACA,eAAA;;AAGJ,aA1FZ,QAgBI,aAII,aAsEK;EACG,qDAAA","file":"home.css"} {"version":3,"sources":["home.less"],"names":[],"mappings":"AAAA,aACI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A;EACA,UAAA;;AA9OhB,aAkOI,QAgBI;EACI,eAAA;EACA,gBAAA;;AApPZ,aAkOI,QAgBI,aAII;EACI,YAAA;EACA,sBAAA;EACA,gBAAA;EACA,eAAA;EACA,cAAA;EACA,eAAA;EACA,iBAAA;EACA,gCAAA;;AAEA,aA9BZ,QAgBI,aAII,aAUK;EACG,mBAAA;;AAjQpB,aAkOI,QAgBI,aAII,aAcI;EACI,cAAA;EACA,eAAA;EACA,UAAA;;AAvQpB,aAkOI,QAgBI,aAII,aAoBI;EACI,UAAA;;AA3QpB,aAkOI,QAgBI,aAII,aAoBI,OAGI;EACI,cAAA;;AA9QxB,aAkOI,QAgBI,aAII,aA4BI;EACI,UAAA;;AAnRpB,aAkOI,QAgBI,aAII,aA4BI,KAGI;EACI,cAAA;;AAtRxB,aAkOI,QAgBI,aAII,aAoCI;EACI,UAAA;;AA3RpB,aAkOI,QAgBI,aAII,aAoCI,SAGI;EACI,eAAA;EACA,cAAA;EACA,yCAAA;EACA,8BAAA;EACA,gBAAA;EACA,kBAAA;;AAEA,aAnEpB,QAgBI,aAII,aAoCI,SAGI,MAQK;EACG,yCAAA;EACA,cAAA;;AAvS5B,aAkOI,QAgBI,aAII,aAoCI,SAiBI;EACI,cAAA;;AA5SxB,aAkOI,QAgBI,aAII,aA0DI;EACI,UAAA;;AAjTpB,aAkOI,QAgBI,aAII,aA+DI;EACI,WAAA;EACA,cAAA;EACA,SAAA;EACA,eAAA;;AAGJ,aA1FZ,QAgBI,aAII,aAsEK;EACG,qDAAA","file":"home.css"}
\ No newline at end of file \ No newline at end of file
!function () {
window.AccountController = {
isClick: false,
token: Util.getCookie('token') || '',
init: function () {
this.created(this).mounted(this).handleBind(this);
},
created: function (opt) {
//默认获取省
IcController.getData(apis.regionPcd, 'POST', {token: opt.token}, function (res) {
if (res.errcode == 0) {
var getTpl = provinceHtml.innerHTML;
layui.laytpl(getTpl).render(res.data, function (html) {
$("#province_id").empty().html(html);
layui.form.render();
});
}
});
return this;
},
mounted: function (opt) {
//获取会员信息
IcController.getData(apis.userInfo, 'GET', {token: opt.token}, function (res) {
if (res.errcode == 0) {
$("input[name='mobile']").val(res.data.mobile);
layui.form.val("userInfo", {
"sys_msg": Number(res.data.sys_msg),
"business_msg": Number(res.data.business_msg),
"activity_msg": Number(res.data.activity_msg)
})
}
});
return this;
},
handleBind: function (opt) {
//系统消息通知
layui.form.on('switch(sys_msg)', function (data) {
Observer.emit('switch', {
type: 1,
data: data.elem.checked ? 1 : 0
});
});
//业务通知
layui.form.on('switch(business_msg)', function (data) {
Observer.emit('switch', {
type: 2,
data: data.elem.checked ? 1 : 0
});
});
//活动通知
layui.form.on('switch(activity_msg)', function (data) {
Observer.emit('switch', {
type: 3,
data: data.elem.checked ? 1 : 0
});
});
//监听消息推送
Observer.on('switch', function (e) {
IcController.getData(apis.userSetmsg, 'POST', {token: opt.token, type: e.args.type, is_open: e.args.data}, function (res) {
if (res.errcode == 0) {
layer.msg('设置成功');
} else {
layer.msg(res.msg);
}
})
});
//账户设置
layui.form.on('submit(account)', function (data) {
$(data.elem).addClass("layui-btn-disabled");
if (!opt.isClick) {
opt.isClick = true;
var params = $.extend({}, data.field, {token: opt.token});
IcController.getData(apis.userAccount, 'POST', params, function (res) {
if (res.errcode == 0) {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
} else {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
}
});
}
});
//省
layui.form.on('select(province_id)', function (data) {
Observer.emit('region', {
type: 'province_id',
province_id: data.value,
city_id: ''
});
});
//市
layui.form.on('select(city_id)', function (data) {
Observer.emit('region', {
type: 'city_id',
province_id: $('select[name="province_id"]').val(),
city_id: data.value
});
});
//监听省市区
Observer.on('region', function (e) {
var getTpl = cityHtml.innerHTML,
getTpl1 = districtHtml.innerHTML,
tpl = '';
e.args.type == 'province_id' ? tpl = getTpl : tpl = getTpl1;
var params = {
token: opt.token,
province_id: e.args.province_id,
city_id: e.args.city_id
};
IcController.getData(apis.regionPcd, 'POST', params, function (res) {
if (res.errcode == 0) {
layui.laytpl(tpl).render(res.data, function (html) {
if (e.args.type == 'province_id') {
//省联动市
$("#city_id").empty().html(html);
$("#district_id").empty().html('<select name="district_id" lay-verify="required" lay-filter="district_id">' +
' <option value=""></option>' +
'</select>');
} else if (e.args.type == 'city_id') {
//市联动区
$("#district_id").empty().html(html);
}
layui.form.render();
});
}
}, false);
});
return this;
},
}, $(function () {
AccountController.init();
})
}();
\ No newline at end of file
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
*/ */
inquiryInfo: offer_url + "/inquiry/info", inquiryInfo: offer_url + "/inquiry/info",
/*** /***
* 我的询价回复 * 我的询价回复
*/ */
inquiryMyOffer: offer_url + "/inquiry/my/offer", inquiryMyOffer: offer_url + "/inquiry/my/offer",
/*** /***
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
* 询价上下架 * 询价上下架
*/ */
inquirysave: offer_url + "/inquiry/save", inquirysave: offer_url + "/inquiry/save",
/*** /***
* 询价统计 * 询价统计
*/ */
inquirycount: offer_url + "/inquiry/count", inquirycount: offer_url + "/inquiry/count",
...@@ -119,7 +119,23 @@ ...@@ -119,7 +119,23 @@
* 我的报价单列表 * 我的报价单列表
*/ */
offerinfo: offer_url + "/offer/info", offerinfo: offer_url + "/offer/info",
/***
* 获取会员信息
*/
userInfo: user_url + "/user/info",
/***
* 账户消息通知设置
*/
userSetmsg: user_url + "/user/setmsg",
/***
* 账户设置
*/
userAccount: user_url + "/user/account",
/***
* 获取省市区
*/
regionPcd: user_url + "/region/pcd"
}; };
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
return apis; return apis;
......
var Observer = (function () {
//防止消息队列暴漏而被篡改故将消息容器作为静态私有变量保存
var __message = {}
return {
// 订阅事件
on: function (type, fn) {
if (typeof __message[type] === 'undefined') {
__message[type] = [fn]
} else {
__message[type].push(fn)
}
},
// 触发事件(发布事件)
emit: function (type, args) {
//如果该消息没有注册,则返回
if (!__message[type]) return;
//定义消息信息
var events = {
type: type, //消息类型
args: args //消息携带数据
}
i = 0; //消息动作循环变量
len = __message[type].length;
//循环消息动作
for (; i < len; i++) {
//依次执行注册的消息对应的动作系列
__message[type][i].call(this, events)
}
},
//删除订阅事件
remove: function (type, fn) {
//如果消息动作队列存在
if (__message[type] instanceof Array) {
//从最后一个消息动作遍历
var i = __message[type].length - 1;
for (; i >= 0; i--) {
//如果存在该动作则在消息动作序列中移除相应动作
__message[type][i] === fn && __message[type].splice(i, 1)
}
}
}
}
})()
...@@ -42,8 +42,10 @@ ...@@ -42,8 +42,10 @@
$("#daytext").val(val + '天'); $("#daytext").val(val + '天');
}); });
//上传商品发布 //上传商品发布
layui.form.on('submit(add)', function (data) { layui.form.on('submit(add)', function (data) {
$(data.elem).addClass("layui-btn-disabled"); $(data.elem).addClass("layui-btn-disabled");
if (!opt.isClick) { if (!opt.isClick) {
...@@ -74,6 +76,7 @@ ...@@ -74,6 +76,7 @@
}); });
} }
}); });
return this; return this;
}, },
}, $(function () { }, $(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment