focusFavoriteTab: function (e) { var that = this; var isFocus = that.data.isFocus; console.log("isFocus", isFocus) var itemId = that.data.itemId; if (isFocus) { favoriteService.cancel(that, itemId).then((res) => { wx.showToast({ title: "取消收藏", icon: 'success', duration: 1000 }); that.setData({ isFocus: false, }); }) } else { favoriteService.add(that, itemId).then((res) => { wx.showToast({ title: res.data == 1 ? "收藏成功" : "收藏失敗", icon: 'success', duration: 1000 }); that.setData({ isFocus: true, }); }); } }, 二.點贊 focuslikeTab: function (e) { var that = this; var isLike = that.data.isLike; let itemDetail = this.data.itemDetail var itemId = that.data.itemId; if (isLike) { itemService.cancellike(that, itemId).then((res) => { wx.showToast({ title: "點贊取消", icon: 'success', duration: 1000 }); itemDetail.liked--; that.setData({ itemDetail:itemDetail, isLike: false }); }) } else { itemService.addlike(that, itemId).then((res) => { wx.showToast({ title: res.data == 1 ? "點贊成功" : "點贊失敗", icon: 'success', duration: 1000 }); itemDetail.liked++; that.setData({ itemDetail: itemDetail, isLike: true }); }); } }, |
工作日 8:30-12:00 14:30-18:00
周六及部分節(jié)假日提供值班服務(wù)