| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- import animation from '../../utils/animation';
- const app = getApp();
- Page({
- data: {
- IsShowRemind:false,
- },
- onLoad: function (options) {
- let that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- that.getData(app.globalData.userInfo.UserID);
- },
- getData:function(userID){
- wx.showLoading({
- title: '请稍候',
- });
- let that=this;
- main.getData('GetYJBDCArticleList?UserID=' + userID, function (data) {
- wx.hideLoading();
- if (data) {
- for(let i=0;i<data.length;i++){
- let item=data[i];
- item.WordsStr=item.Words.split(",").join(" ");
- }
- that.setData({
- List:data,
- });
- }
- });
- },
- goto: function (e) {
- let that=this;
- var url=e.currentTarget.dataset.url;
- wx.navigateTo({
- url: url,
- });
- },
- setClipboard:function(e){
- let words=e.currentTarget.dataset.words;
- app.globalData.SelectedWords=words.split(",");
- wx.redirectTo({
- url: 'wordsinput',
- })
- },
- deleteArticle:function(e){
- animation.toggleRemindWithAnimation(this);
- this.setData({
- ID:e.currentTarget.dataset.id
- });
- },
- showRemind:function(e){
- let that=this;
- const confirm=e.currentTarget.dataset.confirm;
- animation.toggleRemindWithAnimation(this);
- if (confirm=="1") {
- main.getData('DeleteYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID+"&ID="+that.data.ID, function (data) {
- wx.showToast({
- title: '删除完成',
- });
- that.getData(app.globalData.userInfo.UserID);
- });
- }
- },
- setGotoID:function(e){
- let that=this;
- if (app.globalData.userInfo.UserID<4){
- wx.showModal({
- title: '输入用户ID,获得生成的文章',
- content: '',
- editable:true,
- complete: (res) => {
- if (res.confirm) {
- if (res.content)
- that.getData(res.content);
- }
- }
- })
- }
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|