|
|
@@ -396,6 +396,32 @@ function initContentEvent(nameEn) {
|
|
|
$("#watchlistpreview").css("display", "none");
|
|
|
}
|
|
|
$(this).unbind("click");
|
|
|
+ $(".watchlistpreview-top-submit").unbind("click");
|
|
|
+ });
|
|
|
+ $(".watchlistpreview-top-submit").click(function () {
|
|
|
+ $.ajax({
|
|
|
+ url: "coin/watchlistUpdate", //请求的url地址
|
|
|
+ dataType: "json", //返回格式为json
|
|
|
+ data: {"symbol": $(".watchlistpreview-content").find(".watchlistpreview-symbol").val(), "remark": $(".watchlistpreview-content").find("textarea").val()}, //参数值
|
|
|
+ type: "post", //请求方式
|
|
|
+ async: false, //请求是否异步,默认为异步,这也是ajax重要特性
|
|
|
+ success: function (data) {
|
|
|
+ //请求成功时处理
|
|
|
+ if (data != null && $.trim(data) != "" && data.success) {
|
|
|
+ console.log("success");
|
|
|
+ } else {
|
|
|
+ //alert(data.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeSend: function () {
|
|
|
+ },
|
|
|
+ complete: function () {
|
|
|
+ },
|
|
|
+ error: function (data) {
|
|
|
+ //请求出错处理
|
|
|
+ //alert('error:' + data);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
var operationType = $(this).attr("operationType");
|
|
|
@@ -404,8 +430,10 @@ function initContentEvent(nameEn) {
|
|
|
} else if (operationType === 'update') {
|
|
|
$(".watchlistpreview-top-submit").css("display", "block");
|
|
|
}
|
|
|
+
|
|
|
+ var symbol = $(this).attr("symbolName");
|
|
|
$.ajax({
|
|
|
- url: "coin/watchlistDetail/" + $(this).attr("symbolName") + "/" + operationType, //请求的url地址
|
|
|
+ url: "coin/watchlistDetail/" + symbol + "/" + operationType, //请求的url地址
|
|
|
type: "get", //请求方式
|
|
|
async: true, //请求是否异步,默认为异步,这也是ajax重要特性
|
|
|
success: function (data) {
|
|
|
@@ -416,7 +444,8 @@ function initContentEvent(nameEn) {
|
|
|
if (operationType === 'detail') {
|
|
|
$(".watchlistpreview-content").html(data);
|
|
|
} else if (operationType === 'update') {
|
|
|
- var update4Text = '<textarea rows="4" cols="50" style="width: 100%;height: 100%;">' + data + '</textarea>';
|
|
|
+ var update4Text = '<textarea rows="4" cols="50" style="background: antiquewhite;width: 100%;height: 100%;">' + data + '</textarea>';
|
|
|
+ update4Text += '<input type="hidden" class="watchlistpreview-symbol" value="' + symbol + '"/>';
|
|
|
$(".watchlistpreview-content").html(update4Text);
|
|
|
}
|
|
|
} else {
|