添加前台小组申请和申请列表,的一系列页面,带测试,这个结构类似与题目和题目提交列表的样式和结构(页面的关系),写了简略的测试

This commit is contained in:
esp
2015-08-31 20:54:32 +08:00
parent 37defa0266
commit de04f0c2e3
6 changed files with 167 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
require(["jquery", "csrfToken", "bsAlert"], function ($, csrfTokenHeader, bsAlert) {
$("#sendApplication").click(function (){
var message = $("#applyMessage").val();
console.log(message);
var groupId = window.location.pathname.split("/")[2];
console.log(groupId);
data = {group_id: groupId,message:message}
$.ajax({
url: "/api/group_join/",
method: "post",
dataType: "json",
beforeSend: csrfTokenHeader,
data: JSON.stringify(data),
contentType: "application/json",
success: function (data) {
if (data.code) {
bsAlert(data.data);
}
else {
bsAlert("申请已提交!");
}
}
})
})
})