| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- ImageUrl:app.globalData.serverUrl,
- },
- onLoad: function (options) {
- let that = this;
- that.setData({
- Title:options.Title,
- Containnerheight: main.getWindowHeight(),
- });
- wx.setNavigationBarTitle({
- title: options.Title,
- });
- main.getData('GetReaderBooksChapter?UserID=' + app.globalData.userInfo.UserID+"&Title="+options.Title, function (data) {
- if (data) {
- let arr=[];
- for(let i=0;i<data.length;i++){
- let obj={};
- obj.CSS="";
- obj.Chapter=data[i];
- arr.push(obj);
- }
- that.setData({
- List:arr,
- });
- that.enterSchedule();
- }
- });
- },
- enterSchedule:function(){
- let that=this;
- let schedule=wx.getStorageSync('Schedule_'+this.data.Title);
- if (schedule){
- let list=this.data.List;
- for(let i=0;i<list.length;i++){
- if (list[i].Chapter==schedule.Chapter){
- list[i].CSS="highlight";
- break;
- }
- }
- that.setData({
- List:list,
- });
- let url="article?Title="+that.data.Title+"&Chapter="+schedule.Chapter;
- that.goto({currentTarget:{dataset:{url:url}}});
- }
- },
- goto: function (e) {
- let that=this;
- var url=e.currentTarget.dataset.url;
- wx.navigateTo({
- url: url,
- });
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|