Browse Source

add phonenum

master
= 4 years ago
parent
commit
997c152b4f
2 changed files with 30 additions and 0 deletions
  1. +5
    -0
      APP/static/js/wsy.js
  2. +25
    -0
      APP/templates/square.html

+ 5
- 0
APP/static/js/wsy.js View File

@ -144,6 +144,7 @@ async function checkLike(list) {
var dt = new FormData();
var obj = list.textList[i];
dt.append('collection_id', obj['id']);
dt.append('phonenum', phonenum);
sendRequest('collection/isLike', dt, function (data) {
obj['isLike'] = data.isLike;
Vue.set(list.textList, obj['order'], obj);
@ -261,6 +262,7 @@ var page = new Vue({
Vue.set(this.textList, order, obj);
var data = new FormData();
data.append('collection_id', obj['id']);
data.append('phonenum', phonenum);
sendRequest('collection/like', data, function () { ; });
},
unlike: function (order) {
@ -270,6 +272,7 @@ var page = new Vue({
Vue.set(this.textList, order, obj);
var data = new FormData();
data.append('collection_id', obj['id']);
data.append('phonenum', phonenum);
sendRequest('collection/unlike', data, function () { ; });
}
}
@ -311,6 +314,7 @@ var recommend = new Vue({
Vue.set(this.textList, order, obj);
var data = new FormData();
data.append('collection_id', obj['id']);
data.append('phonenum', phonenum);
sendRequest('collection/like', data, function () { ; });
},
unlike: function (order) {
@ -320,6 +324,7 @@ var recommend = new Vue({
Vue.set(this.textList, order, obj);
var data = new FormData();
data.append('collection_id', obj['id']);
data.append('phonenum', phonenum);
sendRequest('collection/unlike', data, function () { ; });
}
}

+ 25
- 0
APP/templates/square.html View File

@ -17,6 +17,31 @@
<script src="../static/js/jquery-3.5.1.min.js"></script>
<script>
// wsy
var cookie = {
setCookie: function (name, value) {
document.cookie = name + '=' + value + ';';
},
getCookie: function (name) {
var arr = document.cookie.split('; ');
for (var i = 0; i < arr.length; i++) {
var arr2 = arr[i].split('=');
if (arr2[0] == name) {
return arr2[1];
}
}
return '';
},
removeCookie: function (name) {
cookie.setCookie(name, '', -1)
}
};
// wsy:这个phonenum可能需要用什么传参的方式得到
var phonenum = cookie.getCookie("phonenum");
if(phonenum == ""){
window.location.href = "login.html";
//phonenum = "1";
}
$(document).ready(function () { getContent('collection'); });
</script>

Loading…
Cancel
Save