myarticles.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. IsShowRemind:false,
  7. },
  8. onLoad: function (options) {
  9. let that = this;
  10. that.setData({
  11. Containnerheight: main.getWindowHeight(),
  12. });
  13. that.getData();
  14. },
  15. getData:function(){
  16. let that=this;
  17. main.getData('GetYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID, function (data) {
  18. if (data) {
  19. for(let i=0;i<data.length;i++){
  20. let item=data[i];
  21. item.WordsStr=item.Words.split(",").join(" ");
  22. }
  23. that.setData({
  24. List:data,
  25. });
  26. }
  27. });
  28. },
  29. goto: function (e) {
  30. let that=this;
  31. var url=e.currentTarget.dataset.url;
  32. wx.navigateTo({
  33. url: url,
  34. });
  35. },
  36. setClipboard:function(e){
  37. let words=e.currentTarget.dataset.words;
  38. app.globalData.SelectedWords=words.split(",");
  39. wx.redirectTo({
  40. url: 'wordsinput',
  41. })
  42. },
  43. deleteArticle:function(e){
  44. this.setData({
  45. IsShowRemind:true,
  46. ID:e.currentTarget.dataset.id
  47. });
  48. },
  49. showRemind:function(e){
  50. let that=this;
  51. const confirm=e.currentTarget.dataset.confirm;
  52. this.setData({
  53. IsShowRemind:!this.data.IsShowRemind,
  54. });
  55. if (confirm=="1") {
  56. main.getData('DeleteYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID+"&ID="+that.data.ID, function (data) {
  57. wx.showToast({
  58. title: '删除完成',
  59. });
  60. that.getData();
  61. });
  62. }
  63. },
  64. onShareAppMessage: function () {
  65. return {
  66. title: app.globalData.ShareTitle,
  67. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  68. imageUrl: app.globalData.ShareImage,
  69. }
  70. },
  71. })