|
@@ -288,7 +288,7 @@ Page({
|
|
winHeight: 0,
|
|
winHeight: 0,
|
|
// tab切换
|
|
// tab切换
|
|
currentTab: 0,
|
|
currentTab: 0,
|
|
- follow:"关注",
|
|
|
|
|
|
+ follow:"",
|
|
ec: {
|
|
ec: {
|
|
// onInit: initChart
|
|
// onInit: initChart
|
|
},
|
|
},
|
|
@@ -378,29 +378,41 @@ Page({
|
|
},
|
|
},
|
|
postfollow:function(){
|
|
postfollow:function(){
|
|
var that = this;
|
|
var that = this;
|
|
-
|
|
|
|
var data={
|
|
var data={
|
|
plateId: this.data.object.plateId,
|
|
plateId: this.data.object.plateId,
|
|
plateName: this.data.object.Name,
|
|
plateName: this.data.object.Name,
|
|
userId: wx.getStorageSync('openid'),
|
|
userId: wx.getStorageSync('openid'),
|
|
userName: app.globalData.userInfo.nickName,
|
|
userName: app.globalData.userInfo.nickName,
|
|
}
|
|
}
|
|
-
|
|
|
|
var postfollow = wxRequest.postRequest(Api.postfollow(),data);
|
|
var postfollow = wxRequest.postRequest(Api.postfollow(),data);
|
|
- postfollow.then((res)=>{
|
|
|
|
-
|
|
|
|
- if(res.statusCode==200){
|
|
|
|
- that.setData({
|
|
|
|
- follow:res.data.data==1? "已关注":"关注"
|
|
|
|
- })
|
|
|
|
- wx.showToast({
|
|
|
|
- title: res.data.message,
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ var postfollowcancel=wxRequest.postRequest(Api.postfollowcancel(),data);
|
|
|
|
+ if(this.data.follow=="关注"){
|
|
|
|
+ postfollow.then((res)=>{
|
|
|
|
+ if(res.statusCode==200){
|
|
|
|
+ that.setData({
|
|
|
|
+ follow:res.data.data==1? "已关注":"关注"
|
|
|
|
+ })
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: res.data.message,
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ postfollowcancel.then((res)=>{
|
|
|
|
+ if(res.statusCode==200){
|
|
|
|
+ that.setData({
|
|
|
|
+ follow:res.data.data==1? "关注":"已关注"
|
|
|
|
+ })
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: res.data.message,
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//获取数据
|
|
//获取数据
|
|
posthisfind:function(row){
|
|
posthisfind:function(row){
|