Kaynağa Gözat

支持用户修改头像and终结者

Rorschach 5 yıl önce
ebeveyn
işleme
ad557b822d
62 değiştirilmiş dosya ile 10389 ekleme ve 115 silme
  1. 270 0
      .history/component/hot/hot_20190129191712.js
  2. 117 0
      .history/component/hot/hot_20190129191834.wxml
  3. 269 0
      .history/component/hot/hot_20190325152142.js
  4. 118 0
      .history/component/hot/hot_20190325152225.wxml
  5. 270 0
      .history/component/hot/hot_20190325152253.js
  6. 270 0
      .history/component/hot/hot_20190327111152.js
  7. 270 0
      .history/component/hot/hot_20190327111215.js
  8. 268 0
      .history/component/hot/hot_20190327135616.js
  9. 117 0
      .history/component/hot/hot_20190327135616.wxml
  10. 269 0
      .history/component/hot/hot_20190327143311.js
  11. 343 0
      .history/component/share/share_20190128152337.js
  12. 347 0
      .history/component/share/share_20190322145541.js
  13. 340 0
      .history/pages/index/index_20190315155712.js
  14. 342 0
      .history/pages/index/index_20190327153623.js
  15. 727 0
      .history/pages/social/works/works_20190218174331.js
  16. 727 0
      .history/pages/social/works/works_20190327112337.js
  17. 173 0
      .history/pages/user/myEdit/myEdit_20190123180844.js
  18. 208 0
      .history/pages/user/myEdit/myEdit_20190123180844.wxss
  19. 55 0
      .history/pages/user/myEdit/myEdit_20190128180953.wxml
  20. 58 0
      .history/pages/user/myEdit/myEdit_20190327140358.wxml
  21. 220 0
      .history/pages/user/myEdit/myEdit_20190327140358.wxss
  22. 221 0
      .history/pages/user/myEdit/myEdit_20190327142456.wxss
  23. 59 0
      .history/pages/user/myEdit/myEdit_20190327142622.wxml
  24. 227 0
      .history/pages/user/myEdit/myEdit_20190327142622.wxss
  25. 228 0
      .history/pages/user/myEdit/myEdit_20190327143355.wxss
  26. 196 0
      .history/pages/user/myEdit/myEdit_20190327145648.js
  27. 59 0
      .history/pages/user/myEdit/myEdit_20190327145648.wxml
  28. 196 0
      .history/pages/user/myEdit/myEdit_20190327151305.js
  29. 196 0
      .history/pages/user/myEdit/myEdit_20190327151535.js
  30. 199 0
      .history/pages/user/myEdit/myEdit_20190327151604.js
  31. 199 0
      .history/pages/user/myEdit/myEdit_20190327151715.js
  32. 199 0
      .history/pages/user/myEdit/myEdit_20190327151800.js
  33. 201 0
      .history/pages/user/myEdit/myEdit_20190327152518.js
  34. 200 0
      .history/pages/user/myEdit/myEdit_20190327152604.js
  35. 201 0
      .history/pages/user/myEdit/myEdit_20190327152657.js
  36. 59 0
      .history/pages/user/myEdit/myEdit_20190327152925.wxml
  37. 202 0
      .history/pages/user/myEdit/myEdit_20190327153000.js
  38. 203 0
      .history/pages/user/myEdit/myEdit_20190327153148.js
  39. 203 0
      .history/pages/user/myEdit/myEdit_20190327153246.js
  40. 59 0
      .history/pages/user/myEdit/myEdit_20190327153405.wxml
  41. 228 0
      .history/pages/user/myEdit/myEdit_20190327154940.wxss
  42. 62 0
      .history/pages/user/myEdit/myEdit_20190327155027.wxml
  43. 61 0
      .history/pages/user/myEdit/myEdit_20190327155316.wxml
  44. 61 0
      .history/pages/user/myEdit/myEdit_20190327161816.wxml
  45. 61 0
      .history/pages/user/myEdit/myEdit_20190327162022.wxml
  46. 228 0
      .history/pages/user/myEdit/myEdit_20190327162022.wxss
  47. 229 0
      .history/pages/user/myEdit/myEdit_20190327162112.wxss
  48. 84 0
      .history/project.config_20190315155909.json
  49. 84 0
      .history/project.config_20190322144916.json
  50. 7 0
      .history/utils/const_20190315160409.js
  51. 7 0
      .history/utils/const_20190322144916.js
  52. 3 2
      component/hot/hot.js
  53. 1 1
      component/hot/hot.wxml
  54. 17 9
      component/share/share.js
  55. 1 1
      pages/groupPage/group-details/group-details.wxml
  56. 3 1
      pages/index/index.js
  57. 2 2
      pages/social/works/works.js
  58. 35 5
      pages/user/myEdit/myEdit.js
  59. 14 8
      pages/user/myEdit/myEdit.wxml
  60. 21 0
      pages/user/myEdit/myEdit.wxss
  61. 91 82
      project.config.json
  62. 4 4
      utils/const.js

+ 270 - 0
.history/component/hot/hot_20190129191712.js

@@ -0,0 +1,270 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+          [unReadMessageContent]: recommendRes.annunciateMsg.content,
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        [unReadMessageContent]: recommendRes.annunciateMsg.content,
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 117 - 0
.history/component/hot/hot_20190129191834.wxml

@@ -0,0 +1,117 @@
+<template name="hot">
+    <!-- <view class="messageSection" wx:if="{{hotData.unReadMessageNum > 0}}" bindtap="goToMessage"> -->
+    <!-- <view class="marquee">
+        <view class="content">
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+        </view>
+    </view> -->
+    <!-- <view class="messageSection" >
+        <image class="messageIcon" src="../../static/image/message_icon.png" />
+        <view class="marquee">
+            <view class="content">
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+            </view>
+        </view>
+    </view> -->
+    <view class="messageSection" bindtap="goToMessage" wx:if="{{hotData.isMessageNormal}}">
+        <image class="messageIcon" src="../../static/image/message_icon.png" />
+        <text class="messageText">{{hotData.unReadMessageContent}}</text>
+    </view>
+    <view class="myCourseSection">
+        <view class="title">
+            <view class="title-regular">我的课程</view>
+            <view class="right" bindtap="toMyCourse" wx:if="{{hotData.myCourse.length > 3}}">
+                更多
+                <image src="../../static/image/black_to.png" />
+            </view>
+        </view>
+        <view class="myCoursePlaceHolder" wx:if="{{hotData.myCourse.length === 0}}" bindtap="goToBooks">
+            <image src="../../static/image/add_class.png" />
+        </view>
+        <view class="book-box" wx:if="{{hotData.myCourse.length !== 0}}">
+            <block wx:for="{{hotData.myCourse}}" wx:key="{{index}}">
+                <view class="book-item" data-id="{{item.productId}}" bindtap="goToBook" data-title="{{item.title}}">
+                    <image class="book-img" src="{{item.iconImg}}"></image>
+                    <view class="book-title">{{item.title}}</view>
+                </view>
+            </block>
+        </view>
+    </view>
+    <view class="searchSection">
+        <input bindinput="inputHandler" value="{{hotData.inputValue}}" focus="{{hotData.inputFocus}}" bindfocus="searchIconDisappear" bindblur="searchIconCome" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
+        <view>{{searchIcon}}</view>
+        <view bindtap="inputFocus" class="searchBtn" wx:if="{{hotData.searchIcon}}">
+            <!-- <icon type="search" size="14" /> -->
+            <image src="../../static/image/search_new.png" alt="" />
+        </view>
+        <view class="allBooks" bindtap="goToBooks">全部课程</view>
+        <!-- <form bindsubmit="submitTest" report-submit="{{true}}" class="allBooks">
+            <button formType="submit">Reset</button>
+        </form> -->
+    </view>
+    <view class="swiperSection">
+        <view class="title-regular swiper-title">官方推荐</view>
+        <swiper previous-margin="0" next-margin="243rpx" bindchange="swiperChange" current="{{hotData.swiperCurrent}}" circular="{{true}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
+            <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
+                <swiper-item class="slide-item" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
+                    <image src="{{item.img}}" data-type="{{item.type}}" data-id="{{item.id}}" class="slide-image" />
+                    <view class="slide-summary">
+                        <text class="slide-title">{{item.title}}</text>
+                        <text class="slide-tip">{{item.summary}}</text>
+                    </view>
+                </swiper-item>
+            </block>
+        </swiper>
+        <view class="swiper-dots-wrapper">
+            <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
+                <view class="swiper-dots {{hotData.swiperCurrent === index ? 'dot-active' : ''}}">
+                    <text>{{index + 1}}</text>
+                </view>
+            </block>
+        </view>
+    </view>
+    <view class="recommdSection">
+        <view class="recommd-title">热门作品</view>
+        <view class="hotWares">
+            <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="worksCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
+                <view class="topData">
+                    <view class="worksLeft" catchtap="goToUsers" data-uid="{{item.uid}}">
+                        <image class="authorAvatar" lazy-load="true" src="{{item.avatar}}" />
+                        <view class="profession" wx:if="{{item.profession}}">
+                            {{item.profession}}
+                        </view>
+                        <view class="worksInfo">
+                            <view class="authorName">{{item.nickName}}</view>
+                            <view class="time">{{item.time}}</view>
+                        </view>
+                    </view>
+                    <view class="numberInfo">
+                        <view class="wareCardPlays">
+                            <image class="wareCardPlaysImg" lazy-load="true" src="../../static/image/hotPlays.png" />
+                            <text>{{item.plays}}</text>
+                        </view>
+                        <view class="wareCardLikes">
+                            <image class="wareCardLikesImg" lazy-load="true" src="../../static/image/flower_small_pink.png" />
+                            <text>{{item.likes}}</text>
+                        </view>
+                    </view>
+                </view>
+                <image class="wareCardImg" src="{{item.img}}" />
+                <view class="titleSummary">
+                    <text class="wareCardTitle">{{item.title}}</text>
+                    <text class="wareCardTip">{{item.summary}}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>

+ 269 - 0
.history/component/hot/hot_20190325152142.js

@@ -0,0 +1,269 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+          [unReadMessageContent]: unreadMsg.title,
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 118 - 0
.history/component/hot/hot_20190325152225.wxml

@@ -0,0 +1,118 @@
+<template name="hot">
+    <!-- <view class="messageSection" wx:if="{{hotData.unReadMessageNum > 0}}" bindtap="goToMessage"> -->
+    <!-- <view class="marquee">
+        <view class="content">
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+        </view>
+    </view> -->
+    <!-- <view class="messageSection" >
+        <image class="messageIcon" src="../../static/image/message_icon.png" />
+        <view class="marquee">
+            <view class="content">
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+            </view>
+        </view>
+    </view> -->
+    <!-- <view class="messageSection" bindtap="goToMessage" wx:if="{{hotData.isMessageNormal}}"> -->
+    <view class="messageSection" bindtap="goToMessage">
+        <image class="messageIcon" src="../../static/image/message_icon.png" />
+        <text class="messageText">{{hotData.unReadMessageContent}}</text>
+    </view>
+    <view class="myCourseSection">
+        <view class="title">
+            <view class="title-regular">我的课程</view>
+            <view class="right" bindtap="toMyCourse" wx:if="{{hotData.myCourse.length > 3}}">
+                更多
+                <image src="../../static/image/black_to.png" />
+            </view>
+        </view>
+        <view class="myCoursePlaceHolder" wx:if="{{hotData.myCourse.length === 0}}" bindtap="goToBooks">
+            <image src="../../static/image/add_class.png" />
+        </view>
+        <view class="book-box" wx:if="{{hotData.myCourse.length !== 0}}">
+            <block wx:for="{{hotData.myCourse}}" wx:key="{{index}}">
+                <view class="book-item" data-id="{{item.productId}}" bindtap="goToBook" data-title="{{item.title}}">
+                    <image class="book-img" src="{{item.iconImg}}"></image>
+                    <view class="book-title">{{item.title}}</view>
+                </view>
+            </block>
+        </view>
+    </view>
+    <view class="searchSection">
+        <input bindinput="inputHandler" value="{{hotData.inputValue}}" focus="{{hotData.inputFocus}}" bindfocus="searchIconDisappear" bindblur="searchIconCome" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
+        <view>{{searchIcon}}</view>
+        <view bindtap="inputFocus" class="searchBtn" wx:if="{{hotData.searchIcon}}">
+            <!-- <icon type="search" size="14" /> -->
+            <image src="../../static/image/search_new.png" alt="" />
+        </view>
+        <view class="allBooks" bindtap="goToBooks">全部课程</view>
+        <!-- <form bindsubmit="submitTest" report-submit="{{true}}" class="allBooks">
+            <button formType="submit">Reset</button>
+        </form> -->
+    </view>
+    <view class="swiperSection">
+        <view class="title-regular swiper-title">官方推荐</view>
+        <swiper previous-margin="0" next-margin="243rpx" bindchange="swiperChange" current="{{hotData.swiperCurrent}}" circular="{{true}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
+            <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
+                <swiper-item class="slide-item" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
+                    <image src="{{item.img}}" data-type="{{item.type}}" data-id="{{item.id}}" class="slide-image" />
+                    <view class="slide-summary">
+                        <text class="slide-title">{{item.title}}</text>
+                        <text class="slide-tip">{{item.summary}}</text>
+                    </view>
+                </swiper-item>
+            </block>
+        </swiper>
+        <view class="swiper-dots-wrapper">
+            <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
+                <view class="swiper-dots {{hotData.swiperCurrent === index ? 'dot-active' : ''}}">
+                    <text>{{index + 1}}</text>
+                </view>
+            </block>
+        </view>
+    </view>
+    <view class="recommdSection">
+        <view class="recommd-title">热门作品</view>
+        <view class="hotWares">
+            <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="worksCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
+                <view class="topData">
+                    <view class="worksLeft" catchtap="goToUsers" data-uid="{{item.uid}}">
+                        <image class="authorAvatar" lazy-load="true" src="{{item.avatar}}" />
+                        <view class="profession" wx:if="{{item.profession}}">
+                            {{item.profession}}
+                        </view>
+                        <view class="worksInfo">
+                            <view class="authorName">{{item.nickName}}</view>
+                            <view class="time">{{item.time}}</view>
+                        </view>
+                    </view>
+                    <view class="numberInfo">
+                        <view class="wareCardPlays">
+                            <image class="wareCardPlaysImg" lazy-load="true" src="../../static/image/hotPlays.png" />
+                            <text>{{item.plays}}</text>
+                        </view>
+                        <view class="wareCardLikes">
+                            <image class="wareCardLikesImg" lazy-load="true" src="../../static/image/flower_small_pink.png" />
+                            <text>{{item.likes}}</text>
+                        </view>
+                    </view>
+                </view>
+                <image class="wareCardImg" src="{{item.img}}" />
+                <view class="titleSummary">
+                    <text class="wareCardTitle">{{item.title}}</text>
+                    <text class="wareCardTip">{{item.summary}}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>

+ 270 - 0
.history/component/hot/hot_20190325152253.js

@@ -0,0 +1,270 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+          [unReadMessageContent]: unreadMsg.title,
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        [unReadMessageContent]: unreadMsg.title,
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 270 - 0
.history/component/hot/hot_20190327111152.js

@@ -0,0 +1,270 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+          [unReadMessageContent]: recommendRes.annunciateMsg.content,
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        [unReadMessageContent]: urecommendRes.annunciateMsg.content,
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 270 - 0
.history/component/hot/hot_20190327111215.js

@@ -0,0 +1,270 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+          [unReadMessageContent]: recommendRes.annunciateMsg.content,
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        [unReadMessageContent]: recommendRes.annunciateMsg.content,
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 268 - 0
.history/component/hot/hot_20190327135616.js

@@ -0,0 +1,268 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.title : '',
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.title : '',
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 117 - 0
.history/component/hot/hot_20190327135616.wxml

@@ -0,0 +1,117 @@
+<template name="hot">
+    <!-- <view class="messageSection" wx:if="{{hotData.unReadMessageNum > 0}}" bindtap="goToMessage"> -->
+    <!-- <view class="marquee">
+        <view class="content">
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+            <text>【新春派兑】小红花兑换乐高玩具,6666朵小红花可兑换价值约500元的乐高积木玩具,2月26日兑换。</text>
+            <text style="display: inline-block; width: 5em;"></text>
+        </view>
+    </view> -->
+    <!-- <view class="messageSection" >
+        <image class="messageIcon" src="../../static/image/message_icon.png" />
+        <view class="marquee">
+            <view class="content">
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+                <text>{{hotData.unReadMessageContent}}</text>
+                <text style="display: inline-block; width: 5em;"></text>
+            </view>
+        </view>
+    </view> -->
+    <view class="messageSection" bindtap="goToMessage" wx:if="{{hotData.isMessageNormal}}">
+        <image class="messageIcon" src="../../static/image/message_icon.png" />
+        <text class="messageText">{{hotData.unReadMessageContent}}</text>
+    </view>
+    <view class="myCourseSection">
+        <view class="title">
+            <view class="title-regular">我的课程</view>
+            <view class="right" bindtap="toMyCourse" wx:if="{{hotData.myCourse.length > 3}}">
+                更多
+                <image src="../../static/image/black_to.png" />
+            </view>
+        </view>
+        <view class="myCoursePlaceHolder" wx:if="{{hotData.myCourse.length === 0}}" bindtap="goToBooks">
+            <image src="../../static/image/add_class.png" />
+        </view>
+        <view class="book-box" wx:if="{{hotData.myCourse.length !== 0}}">
+            <block wx:for="{{hotData.myCourse}}" wx:key="{{index}}">
+                <view class="book-item" data-id="{{item.productId}}" bindtap="goToBook" data-title="{{item.title}}">
+                    <image class="book-img" src="{{item.iconImg}}"></image>
+                    <view class="book-title">{{item.title}}</view>
+                </view>
+            </block>
+        </view>
+    </view>
+    <view class="searchSection">
+        <input bindinput="inputHandler" value="{{hotData.inputValue}}" focus="{{hotData.inputFocus}}" bindfocus="searchIconDisappear" bindblur="searchIconCome" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
+        <view>{{searchIcon}}</view>
+        <view bindtap="inputFocus" class="searchBtn" wx:if="{{hotData.searchIcon}}">
+            <!-- <icon type="search" size="14" /> -->
+            <image src="../../static/image/search_new.png" alt="" />
+        </view>
+        <view class="allBooks" bindtap="goToBooks">全部课程</view>
+        <!-- <form bindsubmit="submitTest" report-submit="{{true}}" class="allBooks">
+            <button formType="submit">Reset</button>
+        </form> -->
+    </view>
+    <view class="swiperSection">
+        <view class="title-regular swiper-title">官方推荐</view>
+        <swiper previous-margin="0" next-margin="243rpx" bindchange="swiperChange" current="{{hotData.swiperCurrent}}" circular="{{true}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
+            <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
+                <swiper-item class="slide-item" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
+                    <image src="{{item.img}}" data-type="{{item.type}}" data-id="{{item.id}}" class="slide-image" />
+                    <view class="slide-summary">
+                        <text class="slide-title">{{item.title}}</text>
+                        <text class="slide-tip">{{item.summary}}</text>
+                    </view>
+                </swiper-item>
+            </block>
+        </swiper>
+        <view class="swiper-dots-wrapper">
+            <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
+                <view class="swiper-dots {{hotData.swiperCurrent === index ? 'dot-active' : ''}}">
+                    <text>{{index + 1}}</text>
+                </view>
+            </block>
+        </view>
+    </view>
+    <view class="recommdSection">
+        <view class="recommd-title">热门作品</view>
+        <view class="hotWares">
+            <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="worksCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
+                <view class="topData">
+                    <view class="worksLeft" catchtap="goToUsers" data-uid="{{item.uid}}">
+                        <image class="authorAvatar" lazy-load="true" src="{{item.avatar}}" />
+                        <view class="profession" wx:if="{{item.profession}}">
+                            {{item.profession}}
+                        </view>
+                        <view class="worksInfo">
+                            <view class="authorName">{{item.nickName}}</view>
+                            <view class="time">{{item.time}}</view>
+                        </view>
+                    </view>
+                    <view class="numberInfo">
+                        <view class="wareCardPlays">
+                            <image class="wareCardPlaysImg" lazy-load="true" src="../../static/image/hotPlays.png" />
+                            <text>{{item.plays}}</text>
+                        </view>
+                        <view class="wareCardLikes">
+                            <image class="wareCardLikesImg" lazy-load="true" src="../../static/image/flower_small_pink.png" />
+                            <text>{{item.likes}}</text>
+                        </view>
+                    </view>
+                </view>
+                <image class="wareCardImg" src="{{item.img}}" />
+                <view class="titleSummary">
+                    <text class="wareCardTitle">{{item.title}}</text>
+                    <text class="wareCardTip">{{item.summary}}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>

+ 269 - 0
.history/component/hot/hot_20190327143311.js

@@ -0,0 +1,269 @@
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+export const hotInit = (that) => {
+  if (!that.data.hotData) {
+    that.setData({
+      hotData: {
+        title: '热门',
+        autoplay: false,
+        swiperCurrent: 0,
+        interval: 5000,
+        duration: 700,
+        circular: true,
+        hotWareCardFirst: 'hotWareCardFirst',
+        hotWareCard: 'hotWareCard',
+        hotSearch: '',
+        banner: [],
+        recommend: [],
+        hotWorks: [],
+        winH: that.data.winH,
+        searchIcon: true,
+        unReadMessageNum: 0,
+        myCourse: [],
+        inputFocus: false,
+        inputValue: ''
+        // circular: true
+      }
+    })
+  }
+  // 搜索方法
+  that.searchHandler = () => {
+      if (that.data.hotInput.lenght !== 0) {
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      const str = 'hotData.inputValue';
+      that.setData({
+        [str]: ''
+      })
+    },
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
+    }
+
+  // 输入框输入
+  that.inputHandler = (e) => {
+      that.setData({
+        hotInput: e.detail.value
+      });
+    },
+    // 输入框聚焦
+    that.inputFocus = () => {
+      const str = 'hotData.inputFocus'
+      that.setData({
+        [str]: true
+      });
+      console.log(that.data.hotData.inputFocus)
+    },
+    // 打开全部课本
+    that.openBooks = (e) => {
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
+  // 打开更多页面
+  that.openMore = () => {
+    wx.navigateTo({
+      url: `../main/week/week`
+    })
+  }
+  // 打开课程页面
+  that.openClass = (e, lessonId) => {
+    if (lessonId) {
+      wx.navigateTo({
+        url: `../main/class/class?id=${lessonId}`
+      })
+    } else {
+      let id = e.currentTarget.dataset.classid;
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../main/class/class?id=${id}&title=${title}`
+      })
+    }
+  }
+  // 打开用户作品页面
+  that.openWorks = (e) => {
+    let readId = e.currentTarget.dataset.readid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../social/works/works?id=${readId}&title=${title}`
+    })
+  }
+  that.getIndex = () => {
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.getIndex(
+      uid
+    ).success((res) => {
+      const recommend = res.data.data.recommendLesson;
+      const recommendTemp = [];
+      recommend.forEach(item => {
+        const oTemp = {};
+        oTemp.img = item.boothContent;
+        oTemp.classId = item.operationContent;
+        oTemp.title = item.title;
+        oTemp.summary = item.summary;
+        recommendTemp.push(oTemp);
+      });
+      let recommendIndex = 'hotData.recommend';
+      that.setData({
+        [recommendIndex]: recommendTemp
+      });
+      httpRequestApi.userIntoPage('pages/index/index', '首页推荐').success((res) => {
+
+      })
+    })
+  }
+  that.getHotRecommend = (uid) => {
+    httpRequestApi.getHotRecommend(
+      uid
+    ).success((res) => {
+      // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
+      const recommendRes = res.data.data;
+      console.log(that.data.hotData.hotWorks.length)
+      if (that.data.hotData.hotWorks.length > 0) {
+        const myCourseStr = 'hotData.myCourse'
+        const isMessageNormal = 'hotData.isMessageNormal'
+        const unReadMessageContent = 'hotData.unReadMessageContent'
+        // unread为true时显示 未读消息,unread为false时显示通知消息,并且通知消息不可读
+        that.setData({
+          [myCourseStr]: recommendRes.myCourse,
+          [isMessageNormal]: recommendRes.unread,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.title : '',
+          [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content
+        })
+
+        return;
+      }
+      recommendRes.hotReader.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user ? item.user.avatar : '';
+        temp.profession = item.user ? item.user.profession : '';
+        temp.uid = item.user ? item.user.uid : '';
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user ? item.user.wechatName : '';
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      const myCourseStr = 'hotData.myCourse'
+      const isMessageNormal = 'hotData.isMessageNormal'
+      const unReadMessageContent = 'hotData.unReadMessageContent'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        [myCourseStr]: recommendRes.myCourse,
+        [isMessageNormal]: recommendRes.unread,
+        [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        unfinishedCount: recommendRes.unfinishedCount
+      })
+    })
+  }
+
+  that.getHotRecommendSecond = (uid, pageNo, pageSize) => {
+    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+      console.log(res)
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
+    })
+  }
+  // 去全部课本
+  that.goToBooks = () => {
+    wx.navigateTo({
+      url: `../main/books/books`
+    })
+  }
+  that.bannerTap = (e) => {
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
+    }
+  // 下拉加载
+  that.scrollUpdate = (e) => {
+    console.log(e)
+  }
+  console.log(that.data.hotData.recommend)
+
+  if (wx.getStorageSync('uid')) {
+    that.getIndex();
+    that.getHotRecommend(wx.getStorageSync('uid'));
+  }
+  // that.getIndex();
+
+  // 获取全部课本
+  // that.getBookList();
+  // that.swiperChange = (e) => {
+  //   const str = 'hotData.swiperCurrent'
+  //   that.setData({
+  //     [str]: e.detail.current
+  //   });
+  // }
+  //跳转到课程详情
+  that.goToBook = function (e) {
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    console.log(id)
+    wx.navigateTo({
+      url: `/pages/groupPage/grade-details/grade-details?productId=${id}&title=${title}`
+    })
+  }
+  that.swiperChange = (e) => {
+    const str = 'hotData.swiperCurrent'
+    that.setData({
+      [str]: e.detail.current
+    });
+  }
+}

+ 343 - 0
.history/component/share/share_20190128152337.js

@@ -0,0 +1,343 @@
+// component/shar-dialog/shar-dialog.js
+import httpRequestApi from '../../utils/APIClient';
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    shareType: {
+      type: 'String',
+      value: ''
+    },
+    shareId: {
+      type: 'String',
+      value: ''
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    shareFlag: false,
+    imgUrls: '',
+    avatar: '',
+    author: '',
+    iconImg: '',
+    title: '',
+    path: '',
+    QRCodeImagePath: '',
+    QRCodeImageLocalPath: '',
+    groupPurchaseInfo: {},
+    groupType: '',
+    animationData: {},
+    touchMove: true,
+    randomSologan: [
+      '开发右脑最简单的方式就是大声朗读',
+      '大声朗读  有利于建立自信心',
+      '大声朗读  能帮助孩子提高写作能力',
+      '朗读是感知世界的一种重要方式',
+      '增强记忆力的方法之一大声朗读',
+      '大声朗读是语感形成的最佳途径',
+      '大声朗读  还原课文的诗性美',
+      '在朗读中  提升孩子的思辨能力',
+      '重温经典课文  享受亲子美好时光',
+      '大声朗读  能帮助孩子提高写作能力'
+    ]
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    touchMove: function () {
+      return false
+    },
+    poster: function () {
+      const that = this;
+      wx.showLoading({
+        title: '专属海报生成中',
+        // mask: true
+      })
+      httpRequestApi.createQRCode(this.data.QRData).success(res => {
+        // 下载二维码
+        wx.downloadFile({
+          url: res.data.data,
+          success: res => {
+            this.setData({
+              QRCodeImagePath: res.tempFilePath
+            },()=>{
+              this.saveAvatar();
+            })
+          }
+        });
+      })
+    },
+    makeImage: function () {
+      const ctx = wx.createCanvasContext('myCanvas');
+      // 画出背景和相同内容
+      if (this.data.shareType === 'works') {
+        ctx.drawImage('../../../static/image/works_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片  
+      } else {
+        ctx.drawImage('../../../static/image/group_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片  
+      }
+      ctx.save()
+      ctx.beginPath()
+      ctx.fill()
+      ctx.setFontSize(25)
+      ctx.setFillStyle('#fff')
+      ctx.fillText('课文朗读 每天5分钟', (300 - ctx.measureText('课文朗读 每天5分钟').width) / 2, 54.5)
+      ctx.setFontSize(16)
+      let randomSologan =this.data.randomSologan[Math.floor(Math.random()*10)];
+      ctx.fillText(randomSologan, (300 - ctx.measureText(randomSologan).width) / 2, 75.5)
+      ctx.setFontSize(15)
+      ctx.setFillStyle('#838383')
+      ctx.fillText('长按识别二维码', 130.5, 391)
+      ctx.setFontSize(12)
+      ctx.setFillStyle('#838383')
+      ctx.fillText('接收邀请,获得你的课程吧', 130.5, 409.5) /*  */
+      // 头像
+      console.log('画头像')
+      if (this.data.shareType === 'works') {
+        ctx.arc(150, 160, 36, 0, 2 * Math.PI, true)
+        ctx.clip(); //剪切头像区域
+        ctx.drawImage(this.data.avatar, 116, 126, 68, 68);
+        ctx.arc(150, 160, 34, 0, 2 * Math.PI, false)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fill();
+        ctx.clip(); //剪切头像区域
+        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+        ctx.setFontSize(15)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fillText(this.data.author, (300 - ctx.measureText(this.data.author).width) / 2, 220)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('播音主持特长生', (300 - ctx.measureText('播音主持特长生').width) / 2, 243)
+        ctx.setFontSize(15)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('使出洪荒之力,声情并茂地朗诵了', (300 - ctx.measureText('使出洪荒之力,声情并茂地朗诵了').width) / 2, 262)
+        ctx.fillText(`《${this.data.title}》`, (300 - ctx.measureText(`《${this.data.title}》`).width) / 2, 284)
+      } else {
+        ctx.arc(64, 146, 29, 0, 2 * Math.PI, true)
+        ctx.clip(); //剪切头像区域
+        ctx.drawImage(this.data.avatar, 37, 119, 54, 54);
+        ctx.arc(64, 146, 27, 0, 2 * Math.PI, false)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fill();
+        ctx.clip(); //剪切头像区域
+        //插入图片  
+        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+        ctx.setFontSize(18)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fillText(this.data.author, 100, 143.5)
+        ctx.setFontSize(16)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('邀您和我一起大声朗读', 100, 167.5)
+        ctx.drawImage(this.data.iconImg, 27, 194, 247, 103.5);
+        ctx.setFontSize(15)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('朗朗读书声,是世界上最美妙的声音', (300 - ctx.measureText('朗朗读书声,是世界上最美妙的声音').width) / 2, 327.5)
+      }
+      console.log('花二维码')
+      console.log(this.data)
+      console.log(this.data.avatar)
+      ctx.drawImage(this.data.QRCodeImagePath, 35, 351, 90, 90);
+      ctx.draw();
+      setTimeout(() => {
+        wx.canvasToTempFilePath({
+          x: 0,
+          y: 0,
+          width: 300,
+          height: 525,
+          destWidth: 1200,
+          destHeight: 2100,
+          canvasId: 'myCanvas',
+          success: (res) => {
+            this.setData({
+              imgUrls: res.tempFilePath
+            })
+            wx.hideLoading()
+          },
+          fail: (res) => {
+            console.log(res)
+            wx.hideLoading();
+          }
+        })
+      }, 400)
+
+    },
+    saveIcon: function(){
+      wx.downloadFile({
+        url: this.data.iconImg,
+        success: res => {
+          this.setData({
+            iconImg: res.tempFilePath
+          },()=>{
+            console.log(this.data.iconImg)
+            this.makeImage();
+          })
+        }
+      });
+    },
+    saveAvatar: function(){
+      wx.downloadFile({
+        url: this.data.avatar,
+        success: res => {
+          this.setData({
+            avatar: res.tempFilePath
+          },()=>{
+            if (this.data.shareType === 'group'){
+              this.saveIcon();
+            } else {
+              this.makeImage();
+            }
+          })
+        }
+      });
+    },
+    share: function (data) {
+      console.log(data)
+      if (this.data.shareType === 'works') {
+
+        this.setData({
+          shareFlag: !this.data.shareFlag,
+          avatar: data.avatar,
+          author: data.author,
+          iconImg: data.iconImg,
+          title: data.title,
+          productId: data.productId,
+          // path: data.path,
+          QRData: {
+            page: data.path,
+            scene: data.scene,
+            qrCodeId: this.data.shareId
+          }
+        })
+      }
+      if (this.data.shareType === 'group') {
+        console.log(data)
+        console.log('团购分享')
+        this.setData({
+          shareFlag: !this.data.shareFlag,
+          avatar: data.avatar,
+          author: data.author,
+          iconImg: data.iconImg,
+          title: data.title,
+          // path: data.path,
+          QRData: {
+            page: data.path,
+            scene: data.scene,
+            qrCodeId: this.data.shareId
+          },
+          groupPurchaseInfo: data.groupPurchaseInfo,
+          groupType: data.groupType
+        })
+      }
+      this.poster();
+
+      if (this.data.shareType === 'class') {
+        console.log('课程分享')
+        this.setData({
+          shareFlag: !this.data.shareFlag
+        })
+      }
+      // 动画测试
+      this.animation = wx.createAnimation({
+        duration: 700,
+        timingFunction: 'ease',
+      })
+      this.animation.bottom(0).step();
+      this.setData({
+        animationData: this.animation.export()
+      })
+      // 动画测试
+    },
+    //关闭弹框
+    close: function (e) {
+      this.animation = wx.createAnimation({
+        duration: 400,
+        timingFunction: 'ease',
+      })
+      this.animation.bottom(-300).step();
+      this.setData({
+        animationData: this.animation.export()
+      }, () => {
+        setTimeout(() => {
+          this.setData({
+            shareFlag: !this.data.shareFlag,
+            imgUrls: ''
+          })
+          this.triggerEvent('ShareDialogClose', {})
+        }, 200)
+      })
+      wx.hideLoading()
+    },
+    nothing: function (e) {
+      return
+    },
+    // 保存最终图片
+    PreservationImg: function () {
+      // this.getImgAuthorize()
+      wx.saveImageToPhotosAlbum({
+        filePath: this.data.imgUrls,
+        success: (res) => {
+          console.log(res)
+          const data = {};
+          console.log('productId', this.data.productId)
+          // 团购分享记录
+          if (this.data.shareType === 'group') {
+            data.shareTypeEnum = 'POSTER';
+            data.shareContentEnum = 'GROUP';
+            data.productId = this.data.groupPurchaseInfo.productId;
+          }
+          // 朗读分享记录
+          if (this.data.shareType === 'works') {
+            data.shareTypeEnum = 'POSTER';
+            data.shareContentEnum = 'READ';
+            data.productId = this.data.productId;
+          }
+          httpRequestApi.shareRecord(data).success((res) => {
+            console.log(res)
+          })
+          this.setData({
+            imgUrls: false
+          })
+        },
+        fail: res => {
+          wx.getSetting({
+            success(res) {
+              if (!res.authSetting['scope.writePhotosAlbum']) {
+                // wx.showToast({
+                //   title: '无权限操作',
+                //   icon: 'fail',
+                //   duration: 800
+                // })
+                wx.showModal({
+                  title: '无法保存分享图片到相册',
+                  content: '点击右上角浮点按钮->进入关于->点击右上角按钮->设置,进行授权',
+                  confirmText: '我知道了',
+                  showCancel: false,
+                  success(res) {
+                    console.log('用户点击确定')
+                  }
+                })
+              }
+            }
+          })
+        }
+      })
+    },
+    shareFriend: function () {
+      this.triggerEvent('customevent', {})
+    }
+  },
+  onShareAppMessage: (res) => {
+    if (res.from === 'button') {
+      // 来自页面内转发按钮
+      console.log(res.target)
+    }
+    return {
+      title: this.data.title,
+      path: this.data.path
+    }
+  },
+})

+ 347 - 0
.history/component/share/share_20190322145541.js

@@ -0,0 +1,347 @@
+// component/shar-dialog/shar-dialog.js
+import httpRequestApi from '../../utils/APIClient';
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    shareType: {
+      type: 'String',
+      value: ''
+    },
+    shareId: {
+      type: 'String',
+      value: ''
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    shareFlag: false,
+    imgUrls: '',
+    avatar: '',
+    author: '',
+    iconImg: '',
+    title: '',
+    path: '',
+    QRCodeImagePath: '',
+    QRCodeImageLocalPath: '',
+    groupPurchaseInfo: {},
+    groupType: '',
+    animationData: {},
+    touchMove: true,
+    randomSologan: [
+      '开发右脑最简单的方式就是大声朗读',
+      '大声朗读  有利于建立自信心',
+      '大声朗读  能帮助孩子提高写作能力',
+      '朗读是感知世界的一种重要方式',
+      '增强记忆力的方法之一大声朗读',
+      '大声朗读是语感形成的最佳途径',
+      '大声朗读  还原课文的诗性美',
+      '在朗读中  提升孩子的思辨能力',
+      '重温经典课文  享受亲子美好时光',
+      '大声朗读  能帮助孩子提高写作能力'
+    ]
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    touchMove: function () {
+      return false
+    },
+    poster: function () {
+      const that = this;
+      wx.showLoading({
+        title: '专属海报生成中',
+        // mask: true
+      })
+      httpRequestApi.createQRCode(this.data.QRData).success(res => {
+        // 下载二维码
+        wx.downloadFile({
+          url: res.data.data,
+          success: res => {
+            this.setData({
+              QRCodeImagePath: res.tempFilePath
+            }, () => {
+              this.saveAvatar();
+            })
+          }
+        });
+      })
+    },
+    makeImage: function () {
+      const ctx = wx.createCanvasContext('myCanvas');
+      // 画出背景和相同内容
+      if (this.data.shareType === 'works') {
+        ctx.drawImage('../../../static/image/works_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片  
+      } else {
+        ctx.drawImage('../../../static/image/group_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片  
+      }
+      ctx.save()
+      ctx.beginPath()
+      ctx.fill()
+      ctx.setFontSize(25)
+      ctx.setFillStyle('#fff')
+      ctx.fillText('课文朗读 每天5分钟', (300 - ctx.measureText('课文朗读 每天5分钟').width) / 2, 54.5)
+      ctx.setFontSize(16)
+      let randomSologan = this.data.randomSologan[Math.floor(Math.random() * 10)];
+      ctx.fillText(randomSologan, (300 - ctx.measureText(randomSologan).width) / 2, 75.5)
+      ctx.setFontSize(15)
+      ctx.setFillStyle('#838383')
+      ctx.fillText('长按识别二维码', 130.5, 391)
+      ctx.setFontSize(12)
+      ctx.setFillStyle('#838383')
+      ctx.fillText('接收邀请,获得你的课程吧', 130.5, 409.5) /*  */
+      // 头像
+      console.log('画头像')
+      if (this.data.shareType === 'works') {
+        ctx.arc(150, 160, 36, 0, 2 * Math.PI, true)
+        ctx.clip(); //剪切头像区域
+        ctx.drawImage(this.data.avatar, 116, 126, 68, 68);
+        ctx.arc(150, 160, 34, 0, 2 * Math.PI, false)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fill();
+        ctx.clip(); //剪切头像区域
+        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+        ctx.setFontSize(15)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fillText(this.data.author, (300 - ctx.measureText(this.data.author).width) / 2, 220)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('播音主持特长生', (300 - ctx.measureText('播音主持特长生').width) / 2, 243)
+        ctx.setFontSize(15)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('使出洪荒之力,声情并茂地朗诵了', (300 - ctx.measureText('使出洪荒之力,声情并茂地朗诵了').width) / 2, 262)
+        ctx.fillText(`《${this.data.title}》`, (300 - ctx.measureText(`《${this.data.title}》`).width) / 2, 284)
+      } else {
+        ctx.arc(64, 146, 29, 0, 2 * Math.PI, true)
+        ctx.clip(); //剪切头像区域
+        ctx.drawImage(this.data.avatar, 37, 119, 54, 54);
+        ctx.arc(64, 146, 27, 0, 2 * Math.PI, false)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fill();
+        ctx.clip(); //剪切头像区域
+        //插入图片  
+        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+        ctx.setFontSize(18)
+        ctx.setFillStyle('#ff6f42')
+        ctx.fillText(this.data.author, 100, 143.5)
+        ctx.setFontSize(16)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('邀您和我一起大声朗读', 100, 167.5)
+        ctx.drawImage(this.data.iconImg, 27, 194, 247, 103.5);
+        ctx.setFontSize(15)
+        ctx.setFillStyle('#434343')
+        ctx.fillText('朗朗读书声,是世界上最美妙的声音', (300 - ctx.measureText('朗朗读书声,是世界上最美妙的声音').width) / 2, 327.5)
+      }
+      console.log('花二维码')
+      console.log(this.data)
+      console.log(this.data.avatar)
+      ctx.drawImage(this.data.QRCodeImagePath, 35, 351, 90, 90);
+      ctx.draw();
+      setTimeout(() => {
+        wx.canvasToTempFilePath({
+          x: 0,
+          y: 0,
+          width: 300,
+          height: 525,
+          destWidth: 1200,
+          destHeight: 2100,
+          canvasId: 'myCanvas',
+          success: (res) => {
+            this.setData({
+              imgUrls: res.tempFilePath
+            })
+            wx.hideLoading()
+          },
+          fail: (res) => {
+            console.log(res)
+            wx.hideLoading();
+          }
+        })
+      }, 400)
+
+    },
+    saveIcon: function () {
+      wx.downloadFile({
+        url: this.data.iconImg,
+        success: res => {
+          this.setData({
+            iconImg: res.tempFilePath
+          }, () => {
+            console.log(this.data.iconImg)
+            this.makeImage();
+          })
+        }
+      });
+    },
+    saveAvatar: function () {
+      wx.downloadFile({
+        url: this.data.avatar,
+        success: res => {
+          this.setData({
+            avatar: res.tempFilePath
+          }, () => {
+            if (this.data.shareType === 'group') {
+              this.saveIcon();
+            } else {
+              this.makeImage();
+            }
+          })
+        }
+      });
+    },
+    share: function (data) {
+      console.log(data)
+      if (this.data.shareType === 'works') {
+
+        this.setData({
+          shareFlag: !this.data.shareFlag,
+          avatar: data.avatar,
+          author: data.author,
+          iconImg: data.iconImg,
+          title: data.title,
+          productId: data.productId,
+          // path: data.path,
+          QRData: {
+            page: data.path,
+            scene: data.scene,
+            qrCodeId: this.data.shareId
+          }
+        })
+      }
+      if (this.data.shareType === 'group') {
+        console.log(data)
+        console.log('团购分享')
+        this.setData({
+          shareFlag: !this.data.shareFlag,
+          avatar: data.avatar,
+          author: data.author,
+          iconImg: data.iconImg,
+          title: data.title,
+          // path: data.path,
+          QRData: {
+            page: data.path,
+            scene: data.scene,
+            qrCodeId: this.data.shareId
+          },
+          groupPurchaseInfo: data.groupPurchaseInfo,
+          groupType: data.groupType
+        })
+      }
+      this.poster();
+
+      if (this.data.shareType === 'class') {
+        console.log('课程分享')
+        this.setData({
+          shareFlag: !this.data.shareFlag
+        })
+      }
+      // 动画测试
+      this.animation = wx.createAnimation({
+        duration: 700,
+        timingFunction: 'ease',
+      })
+      this.animation.bottom(0).step();
+      this.setData({
+        animationData: this.animation.export()
+      })
+      // 动画测试
+    },
+    //关闭弹框
+    close: function (e) {
+      this.animation = wx.createAnimation({
+        duration: 400,
+        timingFunction: 'ease',
+      })
+      this.animation.bottom(-300).step();
+      this.setData({
+        animationData: this.animation.export()
+      }, () => {
+        setTimeout(() => {
+          this.setData({
+            shareFlag: !this.data.shareFlag,
+            imgUrls: ''
+          })
+          this.triggerEvent('ShareDialogClose', {})
+        }, 200)
+      })
+      wx.hideLoading()
+    },
+    nothing: function (e) {
+      return
+    },
+    // 保存最终图片
+    PreservationImg: function () {
+      // this.getImgAuthorize()
+      wx.saveImageToPhotosAlbum({
+        filePath: this.data.imgUrls,
+        success: (res) => {
+          wx.showToast({
+            title: '海报已保存,快去分享吧',
+            icon: 'success',
+            duration: 800
+          })
+          const data = {};
+          // 团购分享记录
+          if (this.data.shareType === 'group') {
+            data.shareTypeEnum = 'POSTER';
+            data.shareContentEnum = 'GROUP';
+            data.productId = this.data.groupPurchaseInfo.productId;
+          }
+          // 朗读分享记录
+          if (this.data.shareType === 'works') {
+            data.shareTypeEnum = 'POSTER';
+            data.shareContentEnum = 'READ';
+            data.productId = this.data.productId;
+          }
+          httpRequestApi.shareRecord(data).success((res) => {
+            console.log(res)
+          })
+
+          this.setData({
+            imgUrls: false
+          })
+        },
+        fail: res => {
+          wx.getSetting({
+            success(res) {
+              if (!res.authSetting['scope.writePhotosAlbum']) {
+                // wx.showToast({
+                //   title: '无权限操作',
+                //   icon: 'fail',
+                //   duration: 800
+                // })
+                wx.showModal({
+                  title: '无法保存分享图片到相册',
+                  content: '点击右上角浮点按钮->进入关于->点击右上角按钮->设置,进行授权',
+                  confirmText: '我知道了',
+                  showCancel: false,
+                  success(res) {
+                    console.log('用户点击确定')
+                  }
+                })
+              }
+            }
+          })
+        }
+      })
+    },
+    shareFriend: function () {
+      this.triggerEvent('customevent', {})
+    }
+  },
+  onShareAppMessage: (res) => {
+    if (res.from === 'button') {
+      // 来自页面内转发按钮
+      console.log(res.target)
+    }
+    return {
+      title: this.data.title,
+      path: this.data.path
+    }
+  },
+})

+ 340 - 0
.history/pages/index/index_20190315155712.js

@@ -0,0 +1,340 @@
+//index.js
+//获取应用实例
+import {
+  getOpenidSessionKey
+} from '../../utils/httpUtil';
+import {
+  formatDate
+} from '../../utils/util';
+
+const app = getApp()
+
+import {
+  hotInit
+} from '../../component/hot/hot';
+import {
+  groupInit
+} from '../../component/group/group';
+import {
+  myInit
+} from '../../component/my/my';
+// import {
+//   followInit
+// } from '../../component/follow/follow';
+// import '../../utils/hls';
+import httpRequestApi from '../../utils/APIClient';
+import httputil from '../../utils/httpUtil';
+import {
+  GetQueryString
+} from '../../utils/util';
+
+Page({
+  data: {
+    tab: [{
+        name: '我的',
+        templates: 'my',
+      },
+      {
+        name: '发现',
+        templates: 'hot',
+      },
+      {
+        name: '热团',
+        templates: 'group',
+      },
+      // {
+      //   name: '动态',
+      //   templates: 'follow',
+      // },
+
+    ],
+    winH: 568,
+    myIndex: 1,
+    followData: [],
+    recommendPageNo: 0,
+    recommendTotalNo: 1,
+    followPageNo: 1,
+    followPageTotalNo: 1,
+    myData: {},
+    templates: 'hot',
+    title: 'index中的title',
+    jurisdictionFlag: true,
+    hotInput: '12345',
+    mineSettingInfo: '528',
+    hide: true,
+    isIOS: app.globalData.isIOS,
+    ifHaveMore: true,
+    indexSignDialog: false,
+    indexMissionDialog: false,
+    unfinishedCount: 0
+  },
+  jurisdiction: function() {
+    //隐藏弹框
+    this.setData({
+      hide: !this.data.hide
+    })
+    //登录页信息
+    this.onShow();
+  },
+  //tab点击
+  switcher: function({
+    currentTarget
+  }) {
+    if (currentTarget.dataset.index === this.data.myIndex) return;
+    this.updateData(currentTarget.dataset.index);
+  },
+  // 根据index 更新template
+  updateData: function(index) {
+    let myIndex = index;
+    let templates = this.data.tab[myIndex].templates;
+    this.setData({
+      myIndex,
+      templates
+    });
+    if (myIndex == 0) {
+      // groupInit(this);
+      this.setData({
+        followPageNo: 1,
+      })
+      myInit(this);
+    }
+    if (myIndex == 1) {
+      // this.setData({
+      //   recommendPageNo: 0
+      // })
+      hotInit(this);
+    }
+    if (myIndex == 2) {
+      groupInit(this);
+    }
+  },
+  onLoad: function(options) {
+    this.uid = wx.getStorageSync('uid');
+    wx.getSystemInfo({
+      success: (res) => {
+        this.setData({
+          winH: res.windowHeight
+        });
+      }
+    });
+    if (options.index) {
+      this.updateData(options.index)
+    }
+    setTimeout(() => {
+      if (wx.getStorageSync('uid')) {
+        httpRequestApi.userLoginRecord().success(res => {
+          if (res.data.data && res.data.data.length !== 0) {
+            // 有数据弹签到
+            if (this.data.unfinishedCount > 0) {
+              this.setData({
+                indexSignDialog: true
+              })
+            }
+
+          } else {
+            // 没数据弹任务
+            let oldDay = wx.getStorageSync('oldDay');
+            let newDate = new Date();
+            let day = newDate.getDate() < 10 ? '0' + newDate.getDate() : newDate.getDate()
+            let timeStep = (newDate.getMonth() + 1).toString() + day
+            if (oldDay) {
+              let temp = parseInt(timeStep) - parseInt(oldDay)
+              if (temp > 0) {
+                wx.setStorageSync('oldDay', timeStep);
+                this.setData({
+                  indexMissionDialog: true
+                })
+              }
+            } else {
+              wx.setStorageSync('oldDay', timeStep);
+              this.setData({
+                indexMissionDialog: true
+              })
+            }
+          }
+        })
+      }
+    }, 2800)
+    // hotInit(this)
+    // this.init();
+
+  },
+  onShow: function() {
+    wx.setNavigationBarTitle({
+      title: '小学课文朗读配音'
+    })
+    // this.init();
+    getOpenidSessionKey((res) => {
+      hotInit(this)
+    }, (error) => {
+      // console.log(error)
+
+      wx.setStorageSync('userSourseType', 'normal')
+      this.setData({
+        hide: !this.data.hide
+      })
+      return;
+    });
+    if (this.data.myIndex === 0) {
+      // 从修改信息页面退回
+      this.getUserWorksInfo(true);
+    }
+  },
+  onHide: function() {
+    const str = 'hotData.inputFocus'
+    this.setData({
+      [str]: false
+    });
+  },
+  //初始化数据
+  // init: function () {
+  //   httputil.getOpenidSessionKey((res) => {
+  //     console.log('微信的用户信息', res)
+
+  //   }, (error) => {
+  //     console.log(1111111111111111)
+  //     // this.jurisdiction()
+  //     wx.navigateTo({
+  //       url: '../../loginPage/loginPage'
+  //     })
+  //   });
+  // },
+  // 获取用户信息
+  getUserWorksInfo: function(flag) {
+    console.log(flag)
+    if (flag) {
+      httpRequestApi.getUserWorksInfo().success(res => {
+        const str = 'myData.user.user.nickName';
+        this.setData({
+          [str]: res.data.data.user.nickName
+        })
+      })
+      return;
+    }
+    const userLocal = wx.getStorageSync('user')
+    console.log(userLocal)
+    const str = 'myData.user';
+    this.setData({
+      [str]: userLocal
+    })
+    httpRequestApi.getUserWorksInfo().success(res => {
+      this.data.myData.user = res.data.data;
+      httpRequestApi.userIntoPage('pages/index/index', '首页我的').success((res) => {})
+      if (this.data.myData.user.myRead) {
+        this.data.myData.user.myRead.gmtCreated = formatDate(this.data.myData.user.myRead.gmtCreated, 4)
+      }
+      this.setData({
+        myData: this.data.myData,
+      });
+    }).fail(error => {
+      console.log(error)
+    })
+  },
+  // 触底加载
+  onReachBottom: function() {
+    console.log(this.data.myIndex)
+    if (this.data.myIndex === 0) {
+      this.setData({
+        followPageNo: this.data.followPageNo + 1
+      })
+      if (this.data.followPageNo <= this.data.followPageTotalNo) {
+        this.getFollowWorks(this.data.followPageNo, 3);
+
+      } else {
+        console.log('没有更多')
+        this.setData({
+          ifHaveMore: false
+        })
+      }
+    }
+    // 当前在推荐页面 加载推荐
+    if (this.data.myIndex === 1) {
+      console.log(this.data.recommendPageNo)
+      console.log(this.data.recommendTotalNo)
+      this.setData({
+        recommendPageNo: this.data.recommendPageNo + 1
+      })
+      if (this.data.recommendPageNo <= this.data.recommendTotalNo) {
+        this.getHotRecommendSecond(this.uid, this.data.recommendPageNo, 3);
+
+      } else {
+        console.log('没有更多')
+      }
+    }
+
+  },
+  onPullDownRefresh: function() {
+    //当前在团购页下拉加载
+    if (this.data.myIndex === 0) {
+      // groupInit(this);
+    }
+
+    wx.showNavigationBarLoading() //在标题栏中显示加载
+    //模拟加载
+    setTimeout(function() {
+      wx.hideNavigationBarLoading() //完成停止加载
+      wx.stopPullDownRefresh() //停止下拉刷新
+    }, 1500);
+  },
+  // 获取全部课本
+  // getBookList: function () {
+  //   httpRequestApi.getAllBooks(1, 10).success((res) => {
+  //     this.data.bookList = res.data.data.list;
+  //     res.data.data.list.forEach(element => {
+  //       this.data.selectFlag.push(true);
+  //     });
+  //     this.setData({
+  //       bookList: this.data.bookList
+  //     })
+  //   }).fail((error) => {
+  //     console.log('错误', error)
+  //   })
+  // },
+  goToMessage: function() {
+    wx.navigateTo({
+      url: `../../pages/social/insideMessage/insideMessage`
+    });
+    const str = 'hotData.unReadMessageNum';
+    this.setData({
+      [str]: 0
+    })
+  },
+  toMyCollage: function(e) {
+    if (app.globalData.isIOS) {
+      wx.navigateTo({
+        url: `../../pages/groupPage/my-group/my-group?title=我的助力`
+      });
+    } else {
+      wx.navigateTo({
+        url: `../../pages/groupPage/my-group/my-group?title=我的拼团`
+      });
+    }
+
+  },
+  toMyCourse: function() {
+    wx.navigateTo({
+      url: `../../pages/user/mycourse/mycourse?title=我的课程`
+    });
+  },
+  goToFlower: function() {
+    wx.navigateTo({
+      url: `../../pages/social/littleFlower/littleFlower`
+    });
+  },
+  signInBtn: function(e) {
+    this.setData({
+      indexSignDialog: false
+    })
+    console.log(e.detail.formId)
+    httpRequestApi.postFormId(e.detail.formId).success(res => {
+      console.log(res)
+    })
+    this.goToFlower();
+  },
+  missionBtn: function() {
+    this.setData({
+      indexMissionDialog: false
+    })
+    this.goToFlower();
+  }
+})

+ 342 - 0
.history/pages/index/index_20190327153623.js

@@ -0,0 +1,342 @@
+//index.js
+//获取应用实例
+import {
+  getOpenidSessionKey
+} from '../../utils/httpUtil';
+import {
+  formatDate
+} from '../../utils/util';
+
+const app = getApp()
+
+import {
+  hotInit
+} from '../../component/hot/hot';
+import {
+  groupInit
+} from '../../component/group/group';
+import {
+  myInit
+} from '../../component/my/my';
+// import {
+//   followInit
+// } from '../../component/follow/follow';
+// import '../../utils/hls';
+import httpRequestApi from '../../utils/APIClient';
+import httputil from '../../utils/httpUtil';
+import {
+  GetQueryString
+} from '../../utils/util';
+
+Page({
+  data: {
+    tab: [{
+        name: '我的',
+        templates: 'my',
+      },
+      {
+        name: '发现',
+        templates: 'hot',
+      },
+      {
+        name: '热团',
+        templates: 'group',
+      },
+      // {
+      //   name: '动态',
+      //   templates: 'follow',
+      // },
+
+    ],
+    winH: 568,
+    myIndex: 1,
+    followData: [],
+    recommendPageNo: 0,
+    recommendTotalNo: 1,
+    followPageNo: 1,
+    followPageTotalNo: 1,
+    myData: {},
+    templates: 'hot',
+    title: 'index中的title',
+    jurisdictionFlag: true,
+    hotInput: '12345',
+    mineSettingInfo: '528',
+    hide: true,
+    isIOS: app.globalData.isIOS,
+    ifHaveMore: true,
+    indexSignDialog: false,
+    indexMissionDialog: false,
+    unfinishedCount: 0
+  },
+  jurisdiction: function() {
+    //隐藏弹框
+    this.setData({
+      hide: !this.data.hide
+    })
+    //登录页信息
+    this.onShow();
+  },
+  //tab点击
+  switcher: function({
+    currentTarget
+  }) {
+    if (currentTarget.dataset.index === this.data.myIndex) return;
+    this.updateData(currentTarget.dataset.index);
+  },
+  // 根据index 更新template
+  updateData: function(index) {
+    let myIndex = index;
+    let templates = this.data.tab[myIndex].templates;
+    this.setData({
+      myIndex,
+      templates
+    });
+    if (myIndex == 0) {
+      // groupInit(this);
+      this.setData({
+        followPageNo: 1,
+      })
+      myInit(this);
+    }
+    if (myIndex == 1) {
+      // this.setData({
+      //   recommendPageNo: 0
+      // })
+      hotInit(this);
+    }
+    if (myIndex == 2) {
+      groupInit(this);
+    }
+  },
+  onLoad: function(options) {
+    this.uid = wx.getStorageSync('uid');
+    wx.getSystemInfo({
+      success: (res) => {
+        this.setData({
+          winH: res.windowHeight
+        });
+      }
+    });
+    if (options.index) {
+      this.updateData(options.index)
+    }
+    setTimeout(() => {
+      if (wx.getStorageSync('uid')) {
+        httpRequestApi.userLoginRecord().success(res => {
+          if (res.data.data && res.data.data.length !== 0) {
+            // 有数据弹签到
+            if (this.data.unfinishedCount > 0) {
+              this.setData({
+                indexSignDialog: true
+              })
+            }
+
+          } else {
+            // 没数据弹任务
+            let oldDay = wx.getStorageSync('oldDay');
+            let newDate = new Date();
+            let day = newDate.getDate() < 10 ? '0' + newDate.getDate() : newDate.getDate()
+            let timeStep = (newDate.getMonth() + 1).toString() + day
+            if (oldDay) {
+              let temp = parseInt(timeStep) - parseInt(oldDay)
+              if (temp > 0) {
+                wx.setStorageSync('oldDay', timeStep);
+                this.setData({
+                  indexMissionDialog: true
+                })
+              }
+            } else {
+              wx.setStorageSync('oldDay', timeStep);
+              this.setData({
+                indexMissionDialog: true
+              })
+            }
+          }
+        })
+      }
+    }, 2800)
+    // hotInit(this)
+    // this.init();
+
+  },
+  onShow: function() {
+    wx.setNavigationBarTitle({
+      title: '小学课文朗读配音'
+    })
+    // this.init();
+    getOpenidSessionKey((res) => {
+      hotInit(this)
+    }, (error) => {
+      // console.log(error)
+
+      wx.setStorageSync('userSourseType', 'normal')
+      this.setData({
+        hide: !this.data.hide
+      })
+      return;
+    });
+    if (this.data.myIndex === 0) {
+      // 从修改信息页面退回
+      this.getUserWorksInfo(true);
+    }
+  },
+  onHide: function() {
+    const str = 'hotData.inputFocus'
+    this.setData({
+      [str]: false
+    });
+  },
+  //初始化数据
+  // init: function () {
+  //   httputil.getOpenidSessionKey((res) => {
+  //     console.log('微信的用户信息', res)
+
+  //   }, (error) => {
+  //     console.log(1111111111111111)
+  //     // this.jurisdiction()
+  //     wx.navigateTo({
+  //       url: '../../loginPage/loginPage'
+  //     })
+  //   });
+  // },
+  // 获取用户信息
+  getUserWorksInfo: function(flag) {
+    console.log(flag)
+    if (flag) {
+      httpRequestApi.getUserWorksInfo().success(res => {
+        const str = 'myData.user.user.nickName';
+        const avatarStr = 'myData.user.user.avatar';
+        this.setData({
+          [str]: res.data.data.user.nickName,
+          [avatarStr]: res.data.data.user.avatar
+        })
+      })
+      return;
+    }
+    const userLocal = wx.getStorageSync('user')
+    console.log(userLocal)
+    const str = 'myData.user';
+    this.setData({
+      [str]: userLocal
+    })
+    httpRequestApi.getUserWorksInfo().success(res => {
+      this.data.myData.user = res.data.data;
+      httpRequestApi.userIntoPage('pages/index/index', '首页我的').success((res) => {})
+      if (this.data.myData.user.myRead) {
+        this.data.myData.user.myRead.gmtCreated = formatDate(this.data.myData.user.myRead.gmtCreated, 4)
+      }
+      this.setData({
+        myData: this.data.myData,
+      });
+    }).fail(error => {
+      console.log(error)
+    })
+  },
+  // 触底加载
+  onReachBottom: function() {
+    console.log(this.data.myIndex)
+    if (this.data.myIndex === 0) {
+      this.setData({
+        followPageNo: this.data.followPageNo + 1
+      })
+      if (this.data.followPageNo <= this.data.followPageTotalNo) {
+        this.getFollowWorks(this.data.followPageNo, 3);
+
+      } else {
+        console.log('没有更多')
+        this.setData({
+          ifHaveMore: false
+        })
+      }
+    }
+    // 当前在推荐页面 加载推荐
+    if (this.data.myIndex === 1) {
+      console.log(this.data.recommendPageNo)
+      console.log(this.data.recommendTotalNo)
+      this.setData({
+        recommendPageNo: this.data.recommendPageNo + 1
+      })
+      if (this.data.recommendPageNo <= this.data.recommendTotalNo) {
+        this.getHotRecommendSecond(this.uid, this.data.recommendPageNo, 3);
+
+      } else {
+        console.log('没有更多')
+      }
+    }
+
+  },
+  onPullDownRefresh: function() {
+    //当前在团购页下拉加载
+    if (this.data.myIndex === 0) {
+      // groupInit(this);
+    }
+
+    wx.showNavigationBarLoading() //在标题栏中显示加载
+    //模拟加载
+    setTimeout(function() {
+      wx.hideNavigationBarLoading() //完成停止加载
+      wx.stopPullDownRefresh() //停止下拉刷新
+    }, 1500);
+  },
+  // 获取全部课本
+  // getBookList: function () {
+  //   httpRequestApi.getAllBooks(1, 10).success((res) => {
+  //     this.data.bookList = res.data.data.list;
+  //     res.data.data.list.forEach(element => {
+  //       this.data.selectFlag.push(true);
+  //     });
+  //     this.setData({
+  //       bookList: this.data.bookList
+  //     })
+  //   }).fail((error) => {
+  //     console.log('错误', error)
+  //   })
+  // },
+  goToMessage: function() {
+    wx.navigateTo({
+      url: `../../pages/social/insideMessage/insideMessage`
+    });
+    const str = 'hotData.unReadMessageNum';
+    this.setData({
+      [str]: 0
+    })
+  },
+  toMyCollage: function(e) {
+    if (app.globalData.isIOS) {
+      wx.navigateTo({
+        url: `../../pages/groupPage/my-group/my-group?title=我的助力`
+      });
+    } else {
+      wx.navigateTo({
+        url: `../../pages/groupPage/my-group/my-group?title=我的拼团`
+      });
+    }
+
+  },
+  toMyCourse: function() {
+    wx.navigateTo({
+      url: `../../pages/user/mycourse/mycourse?title=我的课程`
+    });
+  },
+  goToFlower: function() {
+    wx.navigateTo({
+      url: `../../pages/social/littleFlower/littleFlower`
+    });
+  },
+  signInBtn: function(e) {
+    this.setData({
+      indexSignDialog: false
+    })
+    console.log(e.detail.formId)
+    httpRequestApi.postFormId(e.detail.formId).success(res => {
+      console.log(res)
+    })
+    this.goToFlower();
+  },
+  missionBtn: function() {
+    this.setData({
+      indexMissionDialog: false
+    })
+    this.goToFlower();
+  }
+})

+ 727 - 0
.history/pages/social/works/works_20190218174331.js

@@ -0,0 +1,727 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+    formatDate
+} from '../../../utils/util';
+import {
+    getOpenidSessionKey
+} from '../../../utils/httpUtil';
+const app = getApp()
+Page({
+    data: {
+        fullScreenBtn: false,
+        playBtn: true,
+        gesture: false,
+        author: '',
+        videoSrc: '',
+        total: '',
+        authorAvatar: '',
+        user: [],
+        inputValue: '',
+        inputSBValue: '',
+        replyList: [],
+        howMuch: '200',
+        moneySelect: 'moneySelect',
+        moneyNormal: 'moneyNormal',
+        ifReward: false,
+        id: '',
+        path: '',
+        replyModal: false,
+        totalRead: 0,
+        pageNo: 1,
+        pageSize: 3,
+        goBackHome: false,
+        isIOS: app.globalData.isIOS,
+        alertFlag: false,
+        modalType: "text",
+        noScroll: '',
+        modalText: [{
+                text: '您还不是本课程的会员',
+                type: 'bigOrange'
+            },
+            {
+                text: '您可以开团,拼团成功获得使用权',
+                type: 'normal'
+            }
+        ],
+        modalBtnText: '去开团',
+        isModalShow: false,
+        modalCloseShow: true,
+        hide: true,
+        addComeOut: '',
+        flowerNum: '6'
+        // shareFlag: false
+    },
+    showAlert: function () {
+        this.setData({
+            alertFlag: !this.data.alertFlag
+        })
+    },
+    onLoad: function (option) {
+        console.log(option)
+        console.log(option.flowerCount)
+        console.log(option.flowerCount === 0)
+        if (option.flowerCount) {
+            this.setData({
+                fromReading: true
+            })
+            this.flowerAnimationHandler();
+            // setTimeout(() => {
+            //     this.openShare();
+            // }, 300)
+            if (option.flowerCount > 0) {
+                this.setData({
+                    flowerNum: option.flowerCount
+                })
+            }
+        }
+        getOpenidSessionKey((res) => {
+            let id = option.id ? option.id : option.scene.replace('QR', '')
+            if (option.scene || option.shareCard) {
+                this.setData({
+                    goBackHome: true
+                })
+            }
+            // wx.setNavigationBarTitle({
+            //     title: option.title //页面标题为路由参数
+            // })
+            this.uid = wx.getStorageSync('uid');
+            let stackSize = 1;
+            if (option.stackSize) {
+                stackSize = option.stackSize;
+            }
+            this.setData({
+                // title: option.title,
+                id,
+                myUid: this.uid,
+                stackSize
+            },()=>{
+                this.getWorks(this.uid, id);
+            })
+            
+        }, (error) => {
+            wx.setStorageSync('userSourseType','reading')
+            this.setData({
+                hide: !this.data.hide,
+                onLoadOption: option
+            })
+            return;
+        });
+    },
+    onHide: function () {
+        // this.data.stackSize >= 2
+        console.log('hide')
+        if (this.innerAudioContext) {
+            console.log('音频应该被暂停')
+            this.innerAudioContext.pause();
+        }
+        // this.videoCtx = null
+    },
+    onUnload: function () {
+        console.log(this.videoPlayTime)
+        if (this.videoPlayTime) {
+            const data = {
+                "title": this.data.title,
+                "lessonId": this.data.classId,
+                "productId": this.data.productId,
+                "playStopTime": Math.ceil(this.videoPlayTime),
+                "userReadId": this.data.userReadId,
+                "type": 'READ',
+            }
+            httpRequestApi.playLogReport(data).success(res => {
+                console.log(res)
+            })
+        }
+
+        if (this.innerAudioContext) {
+            this.innerAudioContext.destroy();
+        }
+        this.videoCtx = null
+        // let videoCtx = wx.createVideoContext('worksVideo', this);
+        // videoCtx.stop();
+    },
+    getWorks: function (uid, id) {
+        httpRequestApi.getWorksDetail(uid, id, this.data.goBackHome ? 'READ_SHARE' : '').success((res) => {
+            const others = res.data.data.otherRead;
+            const author = res.data.data.user;
+            const works = res.data.data.userRead;
+            wx.setNavigationBarTitle({
+                title: works.title //页面标题为路由参数
+            })
+            const othersTemp = [];
+            others.forEach((item) => {
+                const temp = {};
+                temp.uid = item.userRead.id;
+                temp.title = item.userRead.title;
+                temp.image = item.user.avatar;
+                temp.nickName = item.user.wechatName;
+                othersTemp.push(temp);
+            });
+            this.setData({
+                user: othersTemp,
+                totalRead: res.data.data.totalRead,
+                author: author.wechatName,
+                authorAvatar: author.avatar,
+                authorProfession: author.profession,
+                authorUid: author.uid,
+                videoSrc: works.originVideo,
+                audioSrc: works.audioPath,
+                iconImg: works.iconImg,
+                classId: works.lessonId,
+                isLike: res.data.data.isLike,
+                isFans: res.data.data.isFans,
+                title: works.title,
+                userReadId: works.id
+            })
+            httpRequestApi.checkLesson(works.lessonId).success(res => {
+                const productId = res.data.data[0];
+                this.setData({
+                    productId
+                })
+            });
+            // 设置音频路径
+            this.innerAudioContext = wx.createInnerAudioContext();
+            this.innerAudioContext.onPause((res) => {
+                // 播放音频失败的回调
+                console.log('音频暂停')
+            })
+            this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
+            if(this.data.fromReading){
+                setTimeout(()=>{
+                    this.openShare()
+                })
+            }
+
+
+        });
+    },
+    onShow() {
+        if(this.data.myUid){
+            this.setData({
+                replyList: [],
+                pageNo: 1,
+                pageSize: 2
+            }, () => {
+                this.getReply();
+            })
+        }
+    },
+    videoPlayHandler: function () {
+        this.setData({
+            videoLoad: true
+        }, () => {
+            this.videoCtx = wx.createVideoContext('worksVideo', this);
+            this.videoCtx.play();
+        })
+    },
+    likeWorks: function (e) {
+        // + 1 + 1的动画
+        this.setData({
+            addComeOut: 'add-one-come-out'
+            // isLike: true
+        })
+        setTimeout(() => {
+            if (this.data.addComeOut) {
+                this.setData({
+                    addComeOut: ''
+                })
+            }
+        }, 1100)
+
+        // 恭喜获得x朵小红花
+        if (this.data.isLike) {
+            // wx.showToast({
+            //     title: '不要重复点赞哦',
+            //     icon: 'fail',
+            //     duration: 1000
+            // })
+            return;
+        }
+        httpRequestApi.likeWorks(this.uid, this.data.id).success(res => {
+            this.setData({
+                isLike: true,
+                flowerNum: res.data.count
+            }, () => {
+                if (res.data.count > 0) {
+                    this.flowerAnimationHandler();
+                }
+            });
+        })
+
+    },
+    // 弹出分享框
+    openShare: function (e) {
+        console.log(this.data.authorAvatar)
+        console.log(this.data.author)
+        console.log(this.data.iconImg)
+        console.log(this.data.title)
+        console.log(this.data.id)
+        if (this.data.authorAvatar && this.data.author && this.data.iconImg && this.data.title && this.data.id) {
+            this.shareDialog = this.selectComponent("#share-dialog");
+            const data = {
+                avatar: this.data.authorAvatar,
+                author: this.data.author,
+                iconImg: this.data.iconImg,
+                title: this.data.title,
+                path: `pages/social/works/works`,
+                scene: this.data.id,
+                productId: this.data.productId
+                // tip: this.data.tip,
+            }
+            // console.log(data)
+            this.setData({
+                noScroll: 'noScroll'
+            })
+            this.shareDialog.share(data);
+        }
+    },
+    // 分享框关闭
+    shareDialogClose: function (e) {
+        this.setData({
+            noScroll: ''
+        })
+    },
+    videoPlay: function () {
+        // 视频开始 先结束 再开始
+        // this.innerAudioContext.play();
+        // this.innerAudioContext.pause();
+        // wx.showToast({
+        //     title: '加载中',
+        //     icon: 'loading',
+        //     duration: 600
+        // })
+        // setTimeout(() => {
+        this.innerAudioContext.play();
+        // }, 800)
+        // httpRequestApi.playWorks(this.uid, this.data.id).success(() => {
+        //     console.log('容个错')
+        // });
+    },
+    // 视频播放完毕销毁录音
+    videoEnd: function (e) {
+        console.log(e)
+
+        this.innerAudioContext.stop();
+    },
+    videoPause: function () {
+        console.log('视频暂停')
+        this.innerAudioContext.pause();
+    },
+    videoWaiting: function () {
+        console.log('视频缓冲')
+        this.innerAudioContext.pause();
+    },
+    videoProgress: function (e) {
+        if (e.detail.buffered <= 10) {
+            this.innerAudioContext.pause();
+        } else {
+            this.innerAudioContext.play();
+        }
+    },
+    videoTimeupdate: function (e) {
+        this.videoPlayTime = e.detail.currentTime
+        if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
+            this.innerAudioContext.seek(e.detail.currentTime - 0.1);
+        }
+    },
+    goToReading: function () {
+        const classId = this.data.classId;
+
+
+        httpRequestApi.areYouSuper(this.data.productId).success(res => {
+            if (res.data.success) {
+                wx.navigateTo({
+                    url: `../../main/reading/reading?id=${classId}`
+                })
+            } else {
+                // ios用户 并且没有购买过此书
+                // if (this.data.isIOS) {
+                //     wx.showModal({
+                //         title: '暂不支持',
+                //         content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
+                //         success(res) {
+                //             if (res.confirm) {
+                //                 console.log('用户点击确定')
+                //             } else if (res.cancel) {
+                //                 console.log('用户点击取消')
+                //             }
+                //         }
+                //     })
+                //     return;
+                // }
+                console.log('chulaiba')
+                this.setData({
+                    isModalShow: true
+                })
+                // wx.showModal({
+                //     title: '您未购买过本书,不能朗读',
+                //     content: '超值团购进行中,快去看看',
+                //     success(res) {
+                //         if (res.confirm) {
+                //             console.log('用户点击确定')
+                //             wx.navigateTo({
+                //                 url: `../../groupPage/grade-details/grade-details?productId=${productId}`
+                //             })
+                //         } else if (res.cancel) {
+                //             console.log('用户点击取消')
+                //         }
+                //     }
+                // })
+            }
+        })
+    },
+    onShareAppMessage: function () {
+        console.log(this.data.productId);
+        const data = {
+            shareTypeEnum: 'LINK',
+            shareContentEnum: 'READ',
+            productId: this.data.productId
+        }
+        httpRequestApi.shareRecord(data).success((res) => {
+            console.log(res)
+        })
+        return {
+            title: '一样的课文,不一样的味道!我的配音表演已开始,求各位大咖围观、点评!',
+            path: `pages/social/works/works?id=${this.data.id}&title=${this.data.title}&shareCard=true`,
+            imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/read_${this.data.productId}.jpg`,
+        }
+    },
+    follow: function () {
+        let followUid = this.data.authorUid;
+        if (this.data.isFans) {
+            httpRequestApi.cancerFollow(this.uid, followUid).success((res) => {
+                this.setData({
+                    isFans: false
+                })
+                wx.showToast({
+                    title: '取消关注',
+                    icon: 'success',
+                    duration: 1000
+                })
+            });
+        } else {
+            httpRequestApi.followUser(this.uid, followUid).success((res) => {
+                this.setData({
+                    isFans: true
+                })
+                wx.showToast({
+                    title: '关注啦',
+                    icon: 'success',
+                    duration: 1000
+                })
+            });
+        }
+    },
+    // 点赞评论
+    likeCommend: function (e) {
+        console.log(e);
+        // let uid = wx.getStorageSync('uid');
+        let followUid = e.currentTarget.dataset.id;
+        let index = e.currentTarget.dataset.index;
+        httpRequestApi.likeCommend(this.uid, followUid).success(res => {
+            console.log(res);
+            const str = `replyList[${index}].likes`;
+            const strImg = `replyList[${index}].isLike`;
+            this.setData({
+                [str]: res.data.data.favors,
+                [strImg]: true
+            })
+        });
+    },
+    // 去用户主页
+    goToUsers: function (e) {
+        let uid = e.currentTarget.dataset.uid;
+        wx.navigateTo({
+            url: `../../user/myworks/myworks?uid=${uid}`
+        });
+    },
+    // 去其他用户的作品页
+    goToOthers: function (e) {
+        this.data.stackSize++;
+        console.log(this.data.stackSize)
+        if (this.data.stackSize >= 3) {
+            console.log('跳转', this.data.stackSize)
+            wx.redirectTo({
+                url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}&stackSize=${this.data.stackSize}`
+            })
+        } else {
+            console.log('下一个页面', this.data.stackSize)
+            wx.navigateTo({
+                url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}&stackSize=${this.data.stackSize}`
+            })
+        }
+
+    },
+    // 查询回复
+    getReply: function () {
+        // let uid = wx.getStorageSync('uid');
+        let columnId = this.data.id;
+        let pageNo = this.data.pageNo;
+        let pageSize = this.data.pageSize;
+        httpRequestApi.getReply(this.uid, columnId, pageNo, pageSize).success((res) => {
+            const replyList = res.data.data.list;
+            // const replyTemp = [];
+            replyList.forEach((item) => {
+                const temp = {};
+                temp.nickName = item.user.wechatName;
+                temp.avatar = item.user.avatar;
+                temp.profession = item.user.profession;
+                temp.uid = item.user.uid;
+                // temp.text = decodeURI(item.detailDesc);
+                temp.text = item.detailDesc;
+                temp.id = item.id;
+                temp.replyCount = item.replyCount;
+                temp.time = formatDate(item.gmtCreated, 3);
+                temp.likes = item.postsAttributeInfo.favors || 0;
+                temp.isLike = item.isLike;
+                this.data.replyList.push(temp);
+            });
+            this.setData({
+                replyList: this.data.replyList,
+                total: res.data.data.totalSize,
+                totalPage: res.data.data.totalNo
+            })
+        });
+    },
+    // 打开回复详情页
+    goToDetail: function (e) {
+        let id = e.currentTarget.dataset.id;
+        // let count = e.currentTarget.dataset.count;
+        wx.navigateTo({
+            url: `../../social/replyDetail/replyDetail?id=${id}&productId=${this.data.productId}`
+        })
+    },
+    //  绑定输入框内容
+    inputValue: function (e) {
+        this.setData({
+            inputValue: e.detail.value
+        });
+    },
+    // 发布回复
+    sendHandler: function () {
+        console.log(this.data.productId)
+        if (this.data.inputValue !== '') {
+            // let uid = wx.getStorageSync('uid');
+            let data = {
+                "columnId": this.data.id,
+                colunmNames: 'what',
+                // "detailDesc": encodeURI(this.data.inputValue)
+                "detailDesc": this.data.inputValue,
+                productId: this.data.productId
+            }
+            httpRequestApi.postReply(this.uid, data).success(res => {
+                console.log(res)
+                this.setData({
+                    inputValue: '',
+                    pageNo: 1,
+                    replyList: [],
+                    flowerNum: res.data.count
+                })
+                this.getReply();
+                if (res.data.count > 0) {
+                    this.flowerAnimationHandler();
+                }
+            });
+            // 评论成功后刷新数据
+
+        }
+    },
+    flowerAnimationHandler: function () {
+        this.flowerBox = this.selectComponent("#flower-box");
+        this.flowerBox.comeOut();
+    },
+    // 触底加载
+    onReachBottom: function () {
+        // 当前在推荐页面 加载推荐
+        if (this.data.pageNo <= this.data.totalPage) {
+            this.setData({
+                pageNo: this.data.pageNo + 1
+            }, () => {
+                this.getReply();
+            })
+        }
+
+
+    },
+    // 设置点击时的id
+    setSBId: function (e) {
+        this.setData({
+            replySBId: e.currentTarget.dataset.id,
+            replyModal: true,
+            replyIndex: e.currentTarget.dataset.index
+        })
+    },
+    // 回复某个评论
+    replySB: function () {
+        const data = {
+            postsId: this.data.replySBId,
+            content: this.data.inputSBValue,
+            productId: this.data.productId
+        }
+        httpRequestApi.postReplyComment(this.uid, data).success(res => {
+            const replyWho = this.data.replyList[this.data.replyIndex];
+            const indexStr = `replyList[${this.data.replyIndex}]`;
+            replyWho.replyCount++;
+            this.setData({
+                replyModal: false,
+                [indexStr]: replyWho
+            })
+        });
+    },
+    // 获取回复楼中楼的内容
+    inputSBValue: function (e) {
+        this.setData({
+            inputSBValue: e.detail.value
+        });
+    },
+    // 选择金额
+    setMoney: function (e) {
+        this.setData({
+            howMuch: e.currentTarget.dataset.money
+        })
+    },
+    reward: function () {
+        if (this.data.isIOS) {
+            return
+        };
+        this.setData({
+            ifReward: true
+        })
+    },
+    quitReward: function () {
+        this.setData({
+            ifReward: false
+        })
+    },
+    // 奖励
+    rewardMoney: function () {
+        const data = {
+            targetUid: this.data.authorUid,
+            amount: this.data.howMuch
+        }
+        // let uid = wx.getStorageSync('uid');
+        httpRequestApi.rewardMoney(this.uid, data).success(res => {
+            if (res.data.message) {
+                wx.showModal({
+                    title: '提示',
+                    content: res.data.message,
+                    success(res) {
+                        if (res.confirm) {
+                            console.log('用户点击确定')
+                        } else if (res.cancel) {
+                            console.log('用户点击取消')
+                        }
+                    }
+                })
+                return false;
+            }
+            this.payMoney(res.data.data);
+        })
+
+    },
+    //支付
+    payMoney: function (orderInfo) {
+        if (this.data.haveTapMoney) {
+            return false
+        }
+        this.setData({
+            haveTapMoney: true
+        })
+        wx.requestPayment({
+            'appId': orderInfo.appId,
+            'timeStamp': orderInfo.timeStamp,
+            'nonceStr': orderInfo.nonceStr,
+            'package': orderInfo.package,
+            'signType': orderInfo.signType,
+            'paySign': orderInfo.sign,
+            'success': res => {
+                this.setData({
+                    modalType: 'image',
+                    isModalShow: true,
+                    modalCloseShow: false,
+                    modalBtnText: '确定',
+                    haveTapMoney: false,
+                    ifReward: false
+                })
+                // wx.showModal({
+                //     title: '提示',
+                //     content: '支付成功',
+                //     success(res) {
+                //         if (res.confirm) {
+                //             this.setData({
+                //                 ifReward: false
+                //             })
+                //         } else if (res.cancel) {
+                //             this.setData({
+                //                 ifReward: false
+                //             })
+                //         }
+                //     }
+                // })
+
+            },
+            'fail': res => {
+                this.setData({
+                    haveTapMoney: false,
+                })
+                console.log('支付失败', res)
+            }
+        })
+    },
+    // 回到首页
+    goBackHome: function () {
+        wx.redirectTo({
+            url: '../../index/index'
+        })
+    },
+    modalConfirmHandler: function () {
+
+        if (this.data.modalType === 'image') {
+            this.setData({
+                modalType: 'text',
+                isModalShow: false,
+                ifReward: false,
+                modalCloseShow: true,
+                modalBtnText: "去开团",
+                // ifReward: false
+            })
+            return false
+        }
+        this.setData({
+            isModalShow: false
+        })
+        wx.navigateTo({
+            url: `../../groupPage/grade-details/grade-details?productId=${this.data.productId}`
+        })
+    },
+    modalCloseHandler: function () {
+        this.setData({
+            isModalShow: false
+        })
+    },
+    jurisdiction: function () {
+        //隐藏弹框
+        this.setData({
+            hide: !this.data.hide
+        })
+        //登录页信息
+        this.onLoad(this.data.onLoadOption);
+    },
+    goToClass: function () {
+
+        if (!this.data.isIOS && this.videoCtx) {
+            this.innerAudioContext.stop();
+            this.innerAudioContext.destroy();
+            this.videoCtx.stop();
+            this.setData({
+                videoLoad: false
+            })
+        }
+
+        setTimeout(() => {
+            wx.navigateTo({
+                url: `../../main/class/class?id=${this.data.classId}`
+            })
+        }, 100)
+
+    }
+})

+ 727 - 0
.history/pages/social/works/works_20190327112337.js

@@ -0,0 +1,727 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+    formatDate
+} from '../../../utils/util';
+import {
+    getOpenidSessionKey
+} from '../../../utils/httpUtil';
+const app = getApp()
+Page({
+    data: {
+        fullScreenBtn: false,
+        playBtn: true,
+        gesture: false,
+        author: '',
+        videoSrc: '',
+        total: '',
+        authorAvatar: '',
+        user: [],
+        inputValue: '',
+        inputSBValue: '',
+        replyList: [],
+        howMuch: '200',
+        moneySelect: 'moneySelect',
+        moneyNormal: 'moneyNormal',
+        ifReward: false,
+        id: '',
+        path: '',
+        replyModal: false,
+        totalRead: 0,
+        pageNo: 1,
+        pageSize: 3,
+        goBackHome: false,
+        isIOS: app.globalData.isIOS,
+        alertFlag: false,
+        modalType: "text",
+        noScroll: '',
+        modalText: [{
+                text: '您还不是本课程的会员',
+                type: 'bigOrange'
+            },
+            {
+                text: '您可以开团,拼团成功获得使用权',
+                type: 'normal'
+            }
+        ],
+        modalBtnText: '去开团',
+        isModalShow: false,
+        modalCloseShow: true,
+        hide: true,
+        addComeOut: '',
+        flowerNum: '6'
+        // shareFlag: false
+    },
+    showAlert: function () {
+        this.setData({
+            alertFlag: !this.data.alertFlag
+        })
+    },
+    onLoad: function (option) {
+        console.log(option)
+        console.log(option.flowerCount)
+        console.log(option.flowerCount === 0)
+        if (option.flowerCount) {
+            this.setData({
+                fromReading: true
+            })
+            this.flowerAnimationHandler();
+            // setTimeout(() => {
+            //     this.openShare();
+            // }, 300)
+            if (option.flowerCount > 0) {
+                this.setData({
+                    flowerNum: option.flowerCount
+                })
+            }
+        }
+        getOpenidSessionKey((res) => {
+            let id = option.id ? option.id : option.scene.replace('QR', '')
+            if (option.scene || option.shareCard) {
+                this.setData({
+                    goBackHome: true
+                })
+            }
+            // wx.setNavigationBarTitle({
+            //     title: option.title //页面标题为路由参数
+            // })
+            this.uid = wx.getStorageSync('uid');
+            let stackSize = 1;
+            if (option.stackSize) {
+                stackSize = option.stackSize;
+            }
+            this.setData({
+                // title: option.title,
+                id,
+                myUid: this.uid,
+                stackSize
+            },()=>{
+                this.getWorks(this.uid, id);
+            })
+            
+        }, (error) => {
+            wx.setStorageSync('userSourseType','reading')
+            this.setData({
+                hide: !this.data.hide,
+                onLoadOption: option
+            })
+            return;
+        });
+    },
+    onHide: function () {
+        // this.data.stackSize >= 2
+        console.log('hide')
+        if (this.innerAudioContext) {
+            console.log('音频应该被暂停')
+            this.innerAudioContext.pause();
+        }
+        // this.videoCtx = null
+    },
+    onUnload: function () {
+        console.log(this.data.productId)
+        if (this.videoPlayTime) {
+            const data = {
+                "title": this.data.title,
+                "lessonId": this.data.classId,
+                "productId": this.data.productId,
+                "playStopTime": Math.ceil(this.videoPlayTime),
+                "userReadId": this.data.userReadId,
+                "type": 'READ',
+            }
+            httpRequestApi.playLogReport(data).success(res => {
+                console.log(res)
+            })
+        }
+
+        if (this.innerAudioContext) {
+            this.innerAudioContext.destroy();
+        }
+        this.videoCtx = null
+        // let videoCtx = wx.createVideoContext('worksVideo', this);
+        // videoCtx.stop();
+    },
+    getWorks: function (uid, id) {
+        httpRequestApi.getWorksDetail(uid, id, this.data.goBackHome ? 'READ_SHARE' : '').success((res) => {
+            const others = res.data.data.otherRead;
+            const author = res.data.data.user;
+            const works = res.data.data.userRead;
+            wx.setNavigationBarTitle({
+                title: works.title //页面标题为路由参数
+            })
+            const othersTemp = [];
+            others.forEach((item) => {
+                const temp = {};
+                temp.uid = item.userRead.id;
+                temp.title = item.userRead.title;
+                temp.image = item.user.avatar;
+                temp.nickName = item.user.wechatName;
+                othersTemp.push(temp);
+            });
+            this.setData({
+                user: othersTemp,
+                totalRead: res.data.data.totalRead,
+                author: author.wechatName,
+                authorAvatar: author.avatar,
+                authorProfession: author.profession,
+                authorUid: author.uid,
+                videoSrc: works.originVideo,
+                audioSrc: works.audioPath,
+                iconImg: works.iconImg,
+                classId: works.lessonId,
+                isLike: res.data.data.isLike,
+                isFans: res.data.data.isFans,
+                title: works.title,
+                userReadId: works.id
+            })
+            httpRequestApi.checkLesson(works.lessonId).success(res => {
+                const productId = res.data.data[0];
+                this.setData({
+                    productId
+                })
+            });
+            // 设置音频路径
+            this.innerAudioContext = wx.createInnerAudioContext();
+            this.innerAudioContext.onPause((res) => {
+                // 播放音频失败的回调
+                console.log('音频暂停')
+            })
+            this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
+            if(this.data.fromReading){
+                setTimeout(()=>{
+                    this.openShare()
+                })
+            }
+
+
+        });
+    },
+    onShow() {
+        if(this.data.myUid){
+            this.setData({
+                replyList: [],
+                pageNo: 1,
+                pageSize: 2
+            }, () => {
+                this.getReply();
+            })
+        }
+    },
+    videoPlayHandler: function () {
+        this.setData({
+            videoLoad: true
+        }, () => {
+            this.videoCtx = wx.createVideoContext('worksVideo', this);
+            this.videoCtx.play();
+        })
+    },
+    likeWorks: function (e) {
+        // + 1 + 1的动画
+        this.setData({
+            addComeOut: 'add-one-come-out'
+            // isLike: true
+        })
+        setTimeout(() => {
+            if (this.data.addComeOut) {
+                this.setData({
+                    addComeOut: ''
+                })
+            }
+        }, 1100)
+
+        // 恭喜获得x朵小红花
+        if (this.data.isLike) {
+            // wx.showToast({
+            //     title: '不要重复点赞哦',
+            //     icon: 'fail',
+            //     duration: 1000
+            // })
+            return;
+        }
+        httpRequestApi.likeWorks(this.uid, this.data.id).success(res => {
+            this.setData({
+                isLike: true,
+                flowerNum: res.data.count
+            }, () => {
+                if (res.data.count > 0) {
+                    this.flowerAnimationHandler();
+                }
+            });
+        })
+
+    },
+    // 弹出分享框
+    openShare: function (e) {
+        console.log(this.data.authorAvatar)
+        console.log(this.data.author)
+        console.log(this.data.iconImg)
+        console.log(this.data.title)
+        console.log(this.data.id)
+        if (this.data.authorAvatar && this.data.author && this.data.iconImg && this.data.title && this.data.id) {
+            this.shareDialog = this.selectComponent("#share-dialog");
+            const data = {
+                avatar: this.data.authorAvatar,
+                author: this.data.author,
+                iconImg: this.data.iconImg,
+                title: this.data.title,
+                path: `pages/social/works/works`,
+                scene: this.data.id,
+                productId: this.data.productId
+                // tip: this.data.tip,
+            }
+            // console.log(data)
+            this.setData({
+                noScroll: 'noScroll'
+            })
+            this.shareDialog.share(data);
+        }
+    },
+    // 分享框关闭
+    shareDialogClose: function (e) {
+        this.setData({
+            noScroll: ''
+        })
+    },
+    videoPlay: function () {
+        // 视频开始 先结束 再开始
+        // this.innerAudioContext.play();
+        // this.innerAudioContext.pause();
+        // wx.showToast({
+        //     title: '加载中',
+        //     icon: 'loading',
+        //     duration: 600
+        // })
+        // setTimeout(() => {
+        this.innerAudioContext.play();
+        // }, 800)
+        // httpRequestApi.playWorks(this.uid, this.data.id).success(() => {
+        //     console.log('容个错')
+        // });
+    },
+    // 视频播放完毕销毁录音
+    videoEnd: function (e) {
+        console.log(e)
+
+        this.innerAudioContext.stop();
+    },
+    videoPause: function () {
+        console.log('视频暂停')
+        this.innerAudioContext.pause();
+    },
+    videoWaiting: function () {
+        console.log('视频缓冲')
+        this.innerAudioContext.pause();
+    },
+    videoProgress: function (e) {
+        if (e.detail.buffered <= 10) {
+            this.innerAudioContext.pause();
+        } else {
+            this.innerAudioContext.play();
+        }
+    },
+    videoTimeupdate: function (e) {
+        this.videoPlayTime = e.detail.currentTime
+        if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
+            this.innerAudioContext.seek(e.detail.currentTime - 0.1);
+        }
+    },
+    goToReading: function () {
+        const classId = this.data.classId;
+
+
+        httpRequestApi.areYouSuper(this.data.productId).success(res => {
+            if (res.data.success) {
+                wx.navigateTo({
+                    url: `../../main/reading/reading?id=${classId}`
+                })
+            } else {
+                // ios用户 并且没有购买过此书
+                // if (this.data.isIOS) {
+                //     wx.showModal({
+                //         title: '暂不支持',
+                //         content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
+                //         success(res) {
+                //             if (res.confirm) {
+                //                 console.log('用户点击确定')
+                //             } else if (res.cancel) {
+                //                 console.log('用户点击取消')
+                //             }
+                //         }
+                //     })
+                //     return;
+                // }
+                console.log('chulaiba')
+                this.setData({
+                    isModalShow: true
+                })
+                // wx.showModal({
+                //     title: '您未购买过本书,不能朗读',
+                //     content: '超值团购进行中,快去看看',
+                //     success(res) {
+                //         if (res.confirm) {
+                //             console.log('用户点击确定')
+                //             wx.navigateTo({
+                //                 url: `../../groupPage/grade-details/grade-details?productId=${productId}`
+                //             })
+                //         } else if (res.cancel) {
+                //             console.log('用户点击取消')
+                //         }
+                //     }
+                // })
+            }
+        })
+    },
+    onShareAppMessage: function () {
+        console.log(this.data.productId);
+        const data = {
+            shareTypeEnum: 'LINK',
+            shareContentEnum: 'READ',
+            productId: this.data.productId
+        }
+        httpRequestApi.shareRecord(data).success((res) => {
+            console.log(res)
+        })
+        return {
+            title: '一样的课文,不一样的味道!我的配音表演已开始,求各位大咖围观、点评!',
+            path: `pages/social/works/works?id=${this.data.id}&title=${this.data.title}&shareCard=true`,
+            imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/read_${this.data.productId}.jpg`,
+        }
+    },
+    follow: function () {
+        let followUid = this.data.authorUid;
+        if (this.data.isFans) {
+            httpRequestApi.cancerFollow(this.uid, followUid).success((res) => {
+                this.setData({
+                    isFans: false
+                })
+                wx.showToast({
+                    title: '取消关注',
+                    icon: 'success',
+                    duration: 1000
+                })
+            });
+        } else {
+            httpRequestApi.followUser(this.uid, followUid).success((res) => {
+                this.setData({
+                    isFans: true
+                })
+                wx.showToast({
+                    title: '关注啦',
+                    icon: 'success',
+                    duration: 1000
+                })
+            });
+        }
+    },
+    // 点赞评论
+    likeCommend: function (e) {
+        console.log(e);
+        // let uid = wx.getStorageSync('uid');
+        let followUid = e.currentTarget.dataset.id;
+        let index = e.currentTarget.dataset.index;
+        httpRequestApi.likeCommend(this.uid, followUid).success(res => {
+            console.log(res);
+            const str = `replyList[${index}].likes`;
+            const strImg = `replyList[${index}].isLike`;
+            this.setData({
+                [str]: res.data.data.favors,
+                [strImg]: true
+            })
+        });
+    },
+    // 去用户主页
+    goToUsers: function (e) {
+        let uid = e.currentTarget.dataset.uid;
+        wx.navigateTo({
+            url: `../../user/myworks/myworks?uid=${uid}`
+        });
+    },
+    // 去其他用户的作品页
+    goToOthers: function (e) {
+        this.data.stackSize++;
+        console.log(this.data.stackSize)
+        if (this.data.stackSize >= 3) {
+            console.log('跳转', this.data.stackSize)
+            wx.redirectTo({
+                url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}&stackSize=${this.data.stackSize}`
+            })
+        } else {
+            console.log('下一个页面', this.data.stackSize)
+            wx.navigateTo({
+                url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}&stackSize=${this.data.stackSize}`
+            })
+        }
+
+    },
+    // 查询回复
+    getReply: function () {
+        // let uid = wx.getStorageSync('uid');
+        let columnId = this.data.id;
+        let pageNo = this.data.pageNo;
+        let pageSize = this.data.pageSize;
+        httpRequestApi.getReply(this.uid, columnId, pageNo, pageSize).success((res) => {
+            const replyList = res.data.data.list;
+            // const replyTemp = [];
+            replyList.forEach((item) => {
+                const temp = {};
+                temp.nickName = item.user.wechatName;
+                temp.avatar = item.user.avatar;
+                temp.profession = item.user.profession;
+                temp.uid = item.user.uid;
+                // temp.text = decodeURI(item.detailDesc);
+                temp.text = item.detailDesc;
+                temp.id = item.id;
+                temp.replyCount = item.replyCount;
+                temp.time = formatDate(item.gmtCreated, 3);
+                temp.likes = item.postsAttributeInfo.favors || 0;
+                temp.isLike = item.isLike;
+                this.data.replyList.push(temp);
+            });
+            this.setData({
+                replyList: this.data.replyList,
+                total: res.data.data.totalSize,
+                totalPage: res.data.data.totalNo
+            })
+        });
+    },
+    // 打开回复详情页
+    goToDetail: function (e) {
+        let id = e.currentTarget.dataset.id;
+        // let count = e.currentTarget.dataset.count;
+        wx.navigateTo({
+            url: `../../social/replyDetail/replyDetail?id=${id}&productId=${this.data.productId}`
+        })
+    },
+    //  绑定输入框内容
+    inputValue: function (e) {
+        this.setData({
+            inputValue: e.detail.value
+        });
+    },
+    // 发布回复
+    sendHandler: function () {
+        console.log(this.data.productId)
+        if (this.data.inputValue !== '') {
+            // let uid = wx.getStorageSync('uid');
+            let data = {
+                "columnId": this.data.id,
+                colunmNames: 'what',
+                // "detailDesc": encodeURI(this.data.inputValue)
+                "detailDesc": this.data.inputValue,
+                productId: this.data.productId
+            }
+            httpRequestApi.postReply(this.uid, data).success(res => {
+                console.log(res)
+                this.setData({
+                    inputValue: '',
+                    pageNo: 1,
+                    replyList: [],
+                    flowerNum: res.data.count
+                })
+                this.getReply();
+                if (res.data.count > 0) {
+                    this.flowerAnimationHandler();
+                }
+            });
+            // 评论成功后刷新数据
+
+        }
+    },
+    flowerAnimationHandler: function () {
+        this.flowerBox = this.selectComponent("#flower-box");
+        this.flowerBox.comeOut();
+    },
+    // 触底加载
+    onReachBottom: function () {
+        // 当前在推荐页面 加载推荐
+        if (this.data.pageNo <= this.data.totalPage) {
+            this.setData({
+                pageNo: this.data.pageNo + 1
+            }, () => {
+                this.getReply();
+            })
+        }
+
+
+    },
+    // 设置点击时的id
+    setSBId: function (e) {
+        this.setData({
+            replySBId: e.currentTarget.dataset.id,
+            replyModal: true,
+            replyIndex: e.currentTarget.dataset.index
+        })
+    },
+    // 回复某个评论
+    replySB: function () {
+        const data = {
+            postsId: this.data.replySBId,
+            content: this.data.inputSBValue,
+            productId: this.data.productId
+        }
+        httpRequestApi.postReplyComment(this.uid, data).success(res => {
+            const replyWho = this.data.replyList[this.data.replyIndex];
+            const indexStr = `replyList[${this.data.replyIndex}]`;
+            replyWho.replyCount++;
+            this.setData({
+                replyModal: false,
+                [indexStr]: replyWho
+            })
+        });
+    },
+    // 获取回复楼中楼的内容
+    inputSBValue: function (e) {
+        this.setData({
+            inputSBValue: e.detail.value
+        });
+    },
+    // 选择金额
+    setMoney: function (e) {
+        this.setData({
+            howMuch: e.currentTarget.dataset.money
+        })
+    },
+    reward: function () {
+        if (this.data.isIOS) {
+            return
+        };
+        this.setData({
+            ifReward: true
+        })
+    },
+    quitReward: function () {
+        this.setData({
+            ifReward: false
+        })
+    },
+    // 奖励
+    rewardMoney: function () {
+        const data = {
+            targetUid: this.data.authorUid,
+            amount: this.data.howMuch
+        }
+        // let uid = wx.getStorageSync('uid');
+        httpRequestApi.rewardMoney(this.uid, data).success(res => {
+            if (res.data.message) {
+                wx.showModal({
+                    title: '提示',
+                    content: res.data.message,
+                    success(res) {
+                        if (res.confirm) {
+                            console.log('用户点击确定')
+                        } else if (res.cancel) {
+                            console.log('用户点击取消')
+                        }
+                    }
+                })
+                return false;
+            }
+            this.payMoney(res.data.data);
+        })
+
+    },
+    //支付
+    payMoney: function (orderInfo) {
+        if (this.data.haveTapMoney) {
+            return false
+        }
+        this.setData({
+            haveTapMoney: true
+        })
+        wx.requestPayment({
+            'appId': orderInfo.appId,
+            'timeStamp': orderInfo.timeStamp,
+            'nonceStr': orderInfo.nonceStr,
+            'package': orderInfo.package,
+            'signType': orderInfo.signType,
+            'paySign': orderInfo.sign,
+            'success': res => {
+                this.setData({
+                    modalType: 'image',
+                    isModalShow: true,
+                    modalCloseShow: false,
+                    modalBtnText: '确定',
+                    haveTapMoney: false,
+                    ifReward: false
+                })
+                // wx.showModal({
+                //     title: '提示',
+                //     content: '支付成功',
+                //     success(res) {
+                //         if (res.confirm) {
+                //             this.setData({
+                //                 ifReward: false
+                //             })
+                //         } else if (res.cancel) {
+                //             this.setData({
+                //                 ifReward: false
+                //             })
+                //         }
+                //     }
+                // })
+
+            },
+            'fail': res => {
+                this.setData({
+                    haveTapMoney: false,
+                })
+                console.log('支付失败', res)
+            }
+        })
+    },
+    // 回到首页
+    goBackHome: function () {
+        wx.redirectTo({
+            url: '../../index/index'
+        })
+    },
+    modalConfirmHandler: function () {
+
+        if (this.data.modalType === 'image') {
+            this.setData({
+                modalType: 'text',
+                isModalShow: false,
+                ifReward: false,
+                modalCloseShow: true,
+                modalBtnText: "去开团",
+                // ifReward: false
+            })
+            return false
+        }
+        this.setData({
+            isModalShow: false
+        })
+        wx.navigateTo({
+            url: `../../groupPage/grade-details/grade-details?productId=${this.data.productId}`
+        })
+    },
+    modalCloseHandler: function () {
+        this.setData({
+            isModalShow: false
+        })
+    },
+    jurisdiction: function () {
+        //隐藏弹框
+        this.setData({
+            hide: !this.data.hide
+        })
+        //登录页信息
+        this.onLoad(this.data.onLoadOption);
+    },
+    goToClass: function () {
+
+        if (!this.data.isIOS && this.videoCtx) {
+            this.innerAudioContext.stop();
+            this.innerAudioContext.destroy();
+            this.videoCtx.stop();
+            this.setData({
+                videoLoad: false
+            })
+        }
+
+        setTimeout(() => {
+            wx.navigateTo({
+                url: `../../main/class/class?id=${this.data.classId}`
+            })
+        }, 100)
+
+    }
+})

+ 173 - 0
.history/pages/user/myEdit/myEdit_20190123180844.js

@@ -0,0 +1,173 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 208 - 0
.history/pages/user/myEdit/myEdit_20190123180844.wxss

@@ -0,0 +1,208 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+

+ 55 - 0
.history/pages/user/myEdit/myEdit_20190128180953.wxml

@@ -0,0 +1,55 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 58 - 0
.history/pages/user/myEdit/myEdit_20190327140358.wxml

@@ -0,0 +1,58 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class="avatarBox">
+        <image src="{{user.avatar}}" class="avatarImage" />
+      </view>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 220 - 0
.history/pages/user/myEdit/myEdit_20190327140358.wxss

@@ -0,0 +1,220 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+}
+.avatarImage{
+  width: 200rpx;
+  height: 200rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+}
+
+

+ 221 - 0
.history/pages/user/myEdit/myEdit_20190327142456.wxss

@@ -0,0 +1,221 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+}
+
+

+ 59 - 0
.history/pages/user/myEdit/myEdit_20190327142622.wxml

@@ -0,0 +1,59 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class="avatarBox">
+        <image src="{{user.avatar}}" class="avatarImage" />
+        <view class="avatar-text">修改头像</view>
+      </view>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 227 - 0
.history/pages/user/myEdit/myEdit_20190327142622.wxss

@@ -0,0 +1,227 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+  margin-top: 30rpx;
+}
+.avatar-text{
+  width: 100%;
+  font-size: 28rpx;
+  color: #444;
+  text-align: center;
+}
+

+ 228 - 0
.history/pages/user/myEdit/myEdit_20190327143355.wxss

@@ -0,0 +1,228 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+  margin-top: 30rpx;
+}
+.avatar-text{
+  width: 100%;
+  font-size: 34rpx;
+  color: #444;
+  text-align: center;
+  margin-top: 24rpx;
+}
+

+ 196 - 0
.history/pages/user/myEdit/myEdit_20190327145648.js

@@ -0,0 +1,196 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const tempFilePaths = res.tempFilePaths
+        wx.uploadFile({
+          url: 'https://reader.lingjiao.cn/readerBase/file/upload',
+          filePath: tempFilePaths,
+          name: '头像',
+          header: {
+              uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+              console.log(res)
+          }
+
+      })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 59 - 0
.history/pages/user/myEdit/myEdit_20190327145648.wxml

@@ -0,0 +1,59 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class="avatarBox" bindtap="changeAvatar">
+        <image src="{{user.avatar}}" class="avatarImage" />
+        <view class="avatar-text">修改头像</view>
+      </view>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 196 - 0
.history/pages/user/myEdit/myEdit_20190327151305.js

@@ -0,0 +1,196 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const tempFilePaths = res.tempFilePaths
+        console.log(tempFilePaths)
+      //   wx.uploadFile({
+      //     url: 'https://reader.lingjiao.cn/readerBase/file/upload',
+      //     filePath: tempFilePaths,
+      //     name: '头像',
+      //     header: {
+      //         uid: wx.getStorageSync('uid')
+      //     },
+      //     success: (res) => {
+      //         console.log(res)
+      //     }
+      // })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 196 - 0
.history/pages/user/myEdit/myEdit_20190327151535.js

@@ -0,0 +1,196 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        
+        wx.uploadFile({
+          url: 'https://reader.lingjiao.cn/readerBase/file/upload',
+          filePath: tempFilePaths,
+          name: '头像',
+          header: {
+              uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+              console.log(res)
+          }
+      })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 199 - 0
.history/pages/user/myEdit/myEdit_20190327151604.js

@@ -0,0 +1,199 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        // const str = 'user.avatar'
+        // this.setData({
+        //   [str]: localImage
+        // })
+        wx.uploadFile({
+          url: 'https://reader.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+              uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+              console.log(res)
+          }
+      })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 199 - 0
.history/pages/user/myEdit/myEdit_20190327151715.js

@@ -0,0 +1,199 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        // const str = 'user.avatar'
+        // this.setData({
+        //   [str]: localImage
+        // })
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+              uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+              console.log(res)
+          }
+      })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 199 - 0
.history/pages/user/myEdit/myEdit_20190327151800.js

@@ -0,0 +1,199 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        // const str = 'user.avatar'
+        // this.setData({
+        //   [str]: localImage
+        // })
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+              uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+              console.log(JSON.parse(res.data))
+          }
+      })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 201 - 0
.history/pages/user/myEdit/myEdit_20190327152518.js

@@ -0,0 +1,201 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function(e){
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        // const str = 'user.avatar'
+        // this.setData({
+        //   [str]: localImage
+        // })
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+              uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+              // console.log(JSON.parse(res.data));
+              const newAvatar = JSON.parse(res.data).data;
+              console.log(newAvatar)
+          }
+      })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user',res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
+        
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 200 - 0
.history/pages/user/myEdit/myEdit_20190327152604.js

@@ -0,0 +1,200 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function (e) {
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+            uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+            // console.log(JSON.parse(res.data));
+            const newAvatar = JSON.parse(res.data).data;
+            const str = 'user.avatar'
+            this.setData({
+              [str]: newAvatar
+            })
+          }
+        })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if (e.detail.value.nickname === '') {
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user', res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit', '修改资料页面').success((res) => {
+
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 201 - 0
.history/pages/user/myEdit/myEdit_20190327152657.js

@@ -0,0 +1,201 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function (e) {
+    const _this = this;
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+            uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+            // console.log(JSON.parse(res.data));
+            const newAvatar = JSON.parse(res.data).data;
+            const str = 'user.avatar'
+            _this.setData({
+              [str]: newAvatar
+            })
+          }
+        })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    if (e.detail.value.nickname === '') {
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user', res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit', '修改资料页面').success((res) => {
+
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 59 - 0
.history/pages/user/myEdit/myEdit_20190327152925.wxml

@@ -0,0 +1,59 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class="avatarBox" bindtap="changeAvatar" name="avatar" value="user.avatar">
+        <image src="{{user.avatar}}" class="avatarImage" />
+        <view class="avatar-text">修改头像</view>
+      </view>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 202 - 0
.history/pages/user/myEdit/myEdit_20190327153000.js

@@ -0,0 +1,202 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function (e) {
+    const _this = this;
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+            uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+            // console.log(JSON.parse(res.data));
+            const newAvatar = JSON.parse(res.data).data;
+            const str = 'user.avatar'
+            _this.setData({
+              [str]: newAvatar
+            })
+          }
+        })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    console.log(e)
+    if (e.detail.value.nickname === '') {
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user', res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit', '修改资料页面').success((res) => {
+
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 203 - 0
.history/pages/user/myEdit/myEdit_20190327153148.js

@@ -0,0 +1,203 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function (e) {
+    const _this = this;
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+            uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+            // console.log(JSON.parse(res.data));
+            const newAvatar = JSON.parse(res.data).data;
+            const str = 'user.avatar'
+            _this.setData({
+              [str]: newAvatar
+            })
+          }
+        })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    console.log(e)
+    if (e.detail.value.nickname === '') {
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || '',
+      avatar: this.user.avatar
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user', res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit', '修改资料页面').success((res) => {
+
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 203 - 0
.history/pages/user/myEdit/myEdit_20190327153246.js

@@ -0,0 +1,203 @@
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function (e) {
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    });
+  },
+  saveAddress: function (e) {
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    });
+  },
+  bindDateChange: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      date: e.detail.value
+    });
+  },
+  optionAction: function (e) {
+    console.log(e.detail.value);
+  },
+  optionSetting: function (e) {
+    console.log(e.detail.value);
+  },
+  changeAvatar: function (e) {
+    const _this = this;
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        wx.uploadFile({
+          url: 'https://readertest.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+            uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+            // console.log(JSON.parse(res.data));
+            const newAvatar = JSON.parse(res.data).data;
+            const str = 'user.avatar'
+            _this.setData({
+              [str]: newAvatar
+            })
+          }
+        })
+      }
+    })
+  },
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    console.log(e)
+    if (e.detail.value.nickname === '') {
+      return false
+    }
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      nickName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: e.detail.value.radioGroup1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || '',
+      avatar: this.data.user.avatar
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.setStorageSync('user', res.data.data);
+      wx.navigateBack({
+        delta: 1
+      })
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  getUserInfo: function () {
+
+  },
+  onLoad: function (option) {
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
+      this.setData({
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit', '修改资料页面').success((res) => {
+
+      })
+    });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 59 - 0
.history/pages/user/myEdit/myEdit_20190327153405.wxml

@@ -0,0 +1,59 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class="avatarBox"  name="avatar" value="user.avatar">
+        <image src="{{user.avatar}}" bindtap="changeAvatar"  class="avatarImage" />
+        <view class="avatar-text" bindtap="changeAvatar">修改头像</view>
+      </view>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 228 - 0
.history/pages/user/myEdit/myEdit_20190327154940.wxss

@@ -0,0 +1,228 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+  margin-top: 30rpx;
+}
+.avatar-text{
+  width: 100%;
+  font-size: 34rpx;
+  color: rgb(0, 162, 255);
+  text-align: center;
+  margin-top: 24rpx;
+}
+

+ 62 - 0
.history/pages/user/myEdit/myEdit_20190327155027.wxml

@@ -0,0 +1,62 @@
+<view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class="avatarBox"  name="avatar" value="user.avatar">
+        <image src="{{user.avatar}}" bindtap="changeAvatar"  class="avatarImage" />
+        <view class="avatar-text" bindtap="changeAvatar">
+        <text >修改头像</text>
+        <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
+          </input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
+         <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 61 - 0
.history/pages/user/myEdit/myEdit_20190327155316.wxml

@@ -0,0 +1,61 @@
+<view>
+  <view class="avatarBox" name="avatar" value="user.avatar">
+    <image src="{{user.avatar}}" bindtap="changeAvatar" class="avatarImage" />
+    <view class="avatar-text" bindtap="changeAvatar">
+      <text>修改头像</text>
+      <image src='../../../static/image/edit_new.png' class='icon'></image>
+    </view>
+  </view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'></input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+          <view class="picker">
+            <text class='setting-title'>生日</text>
+            <text>{{ date }}</text>
+          </view>
+        </picker>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 61 - 0
.history/pages/user/myEdit/myEdit_20190327161816.wxml

@@ -0,0 +1,61 @@
+<view style="background:#f7f7f7;">
+  <view class="avatarBox" name="avatar" value="user.avatar">
+    <image src="{{user.avatar}}" bindtap="changeAvatar" class="avatarImage" />
+    <view class="avatar-text" bindtap="changeAvatar">
+      <text>修改头像</text>
+      <image src='../../../static/image/edit_new.png' class='icon'></image>
+    </view>
+  </view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'></input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+          <view class="picker">
+            <text class='setting-title'>生日</text>
+            <text>{{ date }}</text>
+          </view>
+        </picker>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 61 - 0
.history/pages/user/myEdit/myEdit_20190327162022.wxml

@@ -0,0 +1,61 @@
+<view style="background:#f7f7f7;margin-top:-30rpx;">
+  <view class="avatarBox" name="avatar" value="user.avatar">
+    <image src="{{user.avatar}}" bindtap="changeAvatar" class="avatarImage" />
+    <view class="avatar-text" bindtap="changeAvatar">
+      <text>修改头像</text>
+      <image src='../../../static/image/edit_new.png' class='icon'></image>
+    </view>
+  </view>
+  <view class='setting-info'>
+    <form bindsubmit="formSubmit" class='form'>
+      <view class='nickname-box'>
+        <text class='setting-title'>宝贝昵称</text>
+        <view class='user-action'>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'></input>
+        </view>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='sex-box'>
+        <view class='setting-title'>性别</view>
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.sex }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='birthday-box'>
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+          <view class="picker">
+            <text class='setting-title'>生日</text>
+            <text>{{ date }}</text>
+          </view>
+        </picker>
+        <view class='edit-img'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class='occupation-box'>
+        <text class='setting-title'>职业</text>
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
+          <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
+            <text class='sex-title'>{{ item.value }}</text>
+            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+          </label>
+        </radio-group>
+      </view>
+      <view class='school-box'>
+        <text class='setting-title'>学校</text>
+        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+        <view class='edit-image'>
+          <image src='../../../static/image/edit_new.png' class='icon'></image>
+        </view>
+      </view>
+      <view class="submit-btn">
+        <button class='btn' formType="submit">保存</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 228 - 0
.history/pages/user/myEdit/myEdit_20190327162022.wxss

@@ -0,0 +1,228 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 10rpx auto 0;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+  margin-top: 30rpx;
+}
+.avatar-text{
+  width: 100%;
+  font-size: 34rpx;
+  color: rgb(0, 162, 255);
+  text-align: center;
+  margin-top: 24rpx;
+}
+

+ 229 - 0
.history/pages/user/myEdit/myEdit_20190327162112.wxss

@@ -0,0 +1,229 @@
+/* page{
+  width: 750rpx;
+  height: 1206rpx;
+  padding-top: 0;
+  background: #F7F7F7;
+} */
+
+.setting-info{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  padding: 0 17rpx;
+  font-size: 32rpx;
+  color: #5E5E5E;
+  background: #F7F7F7;
+}
+
+.nickname-box{
+  margin-top: 34rpx;
+  width: 716rpx;
+  height: 88rpx;
+  position: relative;
+  box-sizing: border-box;
+  padding: 22rpx 0 22rpx 26rpx;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  border-radius: 12rpx;
+}
+
+.user-action{
+  /* min-width: 100rpx; */
+  /* max-width: 400rpx; */
+  width: 74%;
+}
+
+.nickname{
+  width: 74%;
+}
+
+.setting-title{
+  display: inline-block;
+  width: 145rpx;
+  text-align: center;
+}
+
+.placeholderStyle{
+  font-size: 32rpx;
+  color: #737373;
+}
+
+.edit-img{
+  position: absolute;
+  right:50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.icon{
+  width: 100%;
+  height: 100%;
+}
+
+.sex-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-title,.radio-each,.birthday-title,.occupation-title{
+  margin-right: 30rpx;
+}
+
+.radio-group{
+  display: flex;
+  height: 42rpx;
+  overflow: hidden;
+  /* margin-top: -8rpx; */
+}
+
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
+
+.radio{
+  margin-right: 50rpx;
+  display: flex;
+  
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before{
+   border-radius: 50%;
+   width: 8rpx; 
+   height: 8rpx; 
+   text-align: center;
+   font-size:0rpx; /* 对勾大小 去掉 */
+   background-color: #FF5E00; 
+   transform:translate(-50%, -50%) scale(1);
+   -webkit-transform:translate(-50%, -50%) scale(1);
+}
+
+radio{
+  margin-left: 20rpx;
+  border-radius: 50%;
+  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 28rpx;
+  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
+  font-size: 0;/* 让边框重合 */
+  margin-top: 6rpx;
+}
+radio .wx-radio-input{
+   border-radius: 50%;
+   width: 28rpx;
+   height: 28rpx; 
+   border: none;/* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked{
+   border: none;
+   background: #f00; 
+}
+
+
+.birthday-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+  overflow:hidden;
+
+}
+
+.occupation-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+}
+
+.school-box{
+  margin-top: 20rpx;
+  width: 716rpx;
+  height: 88rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  background: #FFFFFF;
+  padding: 22rpx 0 22rpx 26rpx;
+  border-radius: 12rpx;
+  position: relative;
+}
+
+.address{
+  /* width: 420rpx; */
+  /* height: 88rpx; */
+  width: 74%;
+}
+
+.edit-image{
+  position: absolute;
+  right: 50rpx;
+  top: 24rpx;
+  width: 22rpx;
+  height: 32rpx;
+}
+
+.submit-btn{
+  margin-top: 392rpx;
+  width: 716rpx;
+  height: 200rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn{
+  font-size: 40rpx;
+  color: #FFFFFF;
+  width: 464rpx;
+  line-height: 80rpx;
+  border-radius: 80rpx;
+  background: #FF9209;
+}
+
+picker {
+  width: 100%;
+}
+
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+  padding-top: 30rpx;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+  margin-top: 30rpx;
+}
+.avatar-text{
+  width: 100%;
+  font-size: 34rpx;
+  color: rgb(0, 162, 255);
+  text-align: center;
+  margin-top: 24rpx;
+}
+

+ 84 - 0
.history/project.config_20190315155909.json

@@ -0,0 +1,84 @@
+{
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "newFeature": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.3.2",
+  "appid": "wxdfa8a4f1623d28db",
+  "projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "isGameTourist": false,
+  "condition": {
+    "search": {
+      "current": -1,
+      "list": []
+    },
+    "conversation": {
+      "current": -1,
+      "list": []
+    },
+    "plugin": {
+      "current": -1,
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "miniprogram": {
+      "current": 5,
+      "list": [{
+          "id": -1,
+          "name": "小红花",
+          "pathName": "pages/social/littleFlower/littleFlower",
+          "query": ""
+        },
+        {
+          "id": 1,
+          "name": "作品",
+          "pathName": "pages/social/works/works",
+          "query": "id=1548160250807513&title=【识字1】春夏秋冬",
+          "scene": "1012"
+        },
+        {
+          "id": 2,
+          "name": "分享团",
+          "pathName": "pages/groupPage/group-details/group-details",
+          "query": "productId=1550459447432909",
+          "scene": 1012
+        },
+        {
+          "id": -1,
+          "name": "公众号进入",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": 1020,
+          "referrerInfo": {}
+        },
+        {
+          "id": -1,
+          "name": "公众号文章进入",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": 1058
+        },
+        {
+          "id": -1,
+          "name": "小红花兑换页面",
+          "pathName": "pages/social/prize/prize",
+          "scene": null
+        }
+      ]
+    }
+  }
+}

+ 84 - 0
.history/project.config_20190322144916.json

@@ -0,0 +1,84 @@
+{
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "newFeature": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.3.2",
+  "appid": "wx8961a3e5512f307c",
+  "projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "isGameTourist": false,
+  "condition": {
+    "search": {
+      "current": -1,
+      "list": []
+    },
+    "conversation": {
+      "current": -1,
+      "list": []
+    },
+    "plugin": {
+      "current": -1,
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "miniprogram": {
+      "current": 5,
+      "list": [{
+          "id": -1,
+          "name": "小红花",
+          "pathName": "pages/social/littleFlower/littleFlower",
+          "query": ""
+        },
+        {
+          "id": 1,
+          "name": "作品",
+          "pathName": "pages/social/works/works",
+          "query": "id=1548160250807513&title=【识字1】春夏秋冬",
+          "scene": "1012"
+        },
+        {
+          "id": 2,
+          "name": "分享团",
+          "pathName": "pages/groupPage/group-details/group-details",
+          "query": "productId=1550459447432909",
+          "scene": 1012
+        },
+        {
+          "id": -1,
+          "name": "公众号进入",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": 1020,
+          "referrerInfo": {}
+        },
+        {
+          "id": -1,
+          "name": "公众号文章进入",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": 1058
+        },
+        {
+          "id": -1,
+          "name": "小红花兑换页面",
+          "pathName": "pages/social/prize/prize",
+          "scene": null
+        }
+      ]
+    }
+  }
+}

+ 7 - 0
.history/utils/const_20190315160409.js

@@ -0,0 +1,7 @@
+// 常量列表
+module.exports = {
+  productApi: 'https://reader.lingjiao.cn/readerProduct/',
+  // productApi: 'https://readertest.lingjiao.cn/readerProduct/',
+  baseApi: 'https://reader.lingjiao.cn/readerBase/'
+  // baseApi: 'https://readertest.lingjiao.cn/readerBase/'
+}

+ 7 - 0
.history/utils/const_20190322144916.js

@@ -0,0 +1,7 @@
+// 常量列表
+module.exports = {
+  // productApi: 'https://reader.lingjiao.cn/readerProduct/',
+  productApi: 'https://readertest.lingjiao.cn/readerProduct/',
+  // baseApi: 'https://reader.lingjiao.cn/readerBase/'
+  baseApi: 'https://readertest.lingjiao.cn/readerBase/'
+}

+ 3 - 2
component/hot/hot.js

@@ -141,7 +141,8 @@ export const hotInit = (that) => {
         that.setData({
           [myCourseStr]: recommendRes.myCourse,
           [isMessageNormal]: recommendRes.unread,
-          [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+          // [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.title : '',
+          [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.title : recommendRes.annunciateMsg.title
         })
 
         return;
@@ -171,7 +172,7 @@ export const hotInit = (that) => {
         [hotStr]: that.data.hotData.hotWorks,
         [myCourseStr]: recommendRes.myCourse,
         [isMessageNormal]: recommendRes.unread,
-        [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.content : recommendRes.annunciateMsg.content,
+        [unReadMessageContent]: recommendRes.unread ? recommendRes.unreadMsg.title : recommendRes.annunciateMsg.title,
         unfinishedCount: recommendRes.unfinishedCount
       })
     })

+ 1 - 1
component/hot/hot.wxml

@@ -23,7 +23,7 @@
             </view>
         </view>
     </view> -->
-    <view class="messageSection" bindtap="goToMessage" wx:if="{{hotData.isMessageNormal}}">
+    <view class="messageSection" bindtap="goToMessage" wx:if="{{hotData.unReadMessageContent !== ''}}">
         <image class="messageIcon" src="../../static/image/message_icon.png" />
         <text class="messageText">{{hotData.unReadMessageContent}}</text>
     </view>

+ 17 - 9
component/share/share.js

@@ -66,7 +66,7 @@ Component({
           success: res => {
             this.setData({
               QRCodeImagePath: res.tempFilePath
-            },()=>{
+            }, () => {
               this.saveAvatar();
             })
           }
@@ -88,7 +88,7 @@ Component({
       ctx.setFillStyle('#fff')
       ctx.fillText('课文朗读 每天5分钟', (300 - ctx.measureText('课文朗读 每天5分钟').width) / 2, 54.5)
       ctx.setFontSize(16)
-      let randomSologan =this.data.randomSologan[Math.floor(Math.random()*10)];
+      let randomSologan = this.data.randomSologan[Math.floor(Math.random() * 10)];
       ctx.fillText(randomSologan, (300 - ctx.measureText(randomSologan).width) / 2, 75.5)
       ctx.setFontSize(15)
       ctx.setFillStyle('#838383')
@@ -165,27 +165,27 @@ Component({
       }, 400)
 
     },
-    saveIcon: function(){
+    saveIcon: function () {
       wx.downloadFile({
         url: this.data.iconImg,
         success: res => {
           this.setData({
             iconImg: res.tempFilePath
-          },()=>{
+          }, () => {
             console.log(this.data.iconImg)
             this.makeImage();
           })
         }
       });
     },
-    saveAvatar: function(){
+    saveAvatar: function () {
       wx.downloadFile({
         url: this.data.avatar,
         success: res => {
           this.setData({
             avatar: res.tempFilePath
-          },()=>{
-            if (this.data.shareType === 'group'){
+          }, () => {
+            if (this.data.shareType === 'group') {
               this.saveIcon();
             } else {
               this.makeImage();
@@ -280,9 +280,16 @@ Component({
       wx.saveImageToPhotosAlbum({
         filePath: this.data.imgUrls,
         success: (res) => {
-          console.log(res)
+          wx.showModal({
+            title: '海报已保存至相册',
+            content: '快去分享给小伙伴吧',
+            confirmText: '我知道了',
+            showCancel: false,
+            success(res) {
+              console.log('用户点击确定')
+            }
+          })
           const data = {};
-          console.log('productId', this.data.productId)
           // 团购分享记录
           if (this.data.shareType === 'group') {
             data.shareTypeEnum = 'POSTER';
@@ -298,6 +305,7 @@ Component({
           httpRequestApi.shareRecord(data).success((res) => {
             console.log(res)
           })
+
           this.setData({
             imgUrls: false
           })

+ 1 - 1
pages/groupPage/group-details/group-details.wxml

@@ -40,7 +40,7 @@
                 </view>
                 <view wx:if="{{groupOsType === 'ANDROID'}}">即可拼团成功</view>
                 <view wx:if="{{groupOsType === 'IOS' && colonelName}}">
-                    即可助力团长{{colonelName}}获得300朵
+                    即可助力团长{{colonelName}}获得100朵
                     <image class="flower-inline" src="../../../static/image/flower_small.png" />
                 </view>
             </view>

+ 3 - 1
pages/index/index.js

@@ -205,8 +205,10 @@ Page({
     if (flag) {
       httpRequestApi.getUserWorksInfo().success(res => {
         const str = 'myData.user.user.nickName';
+        const avatarStr = 'myData.user.user.avatar';
         this.setData({
-          [str]: res.data.data.user.nickName
+          [str]: res.data.data.user.nickName,
+          [avatarStr]: res.data.data.user.avatar
         })
       })
       return;

+ 2 - 2
pages/social/works/works.js

@@ -117,7 +117,7 @@ Page({
         // this.videoCtx = null
     },
     onUnload: function () {
-        console.log(this.videoPlayTime)
+        console.log(this.data.productId)
         if (this.videoPlayTime) {
             const data = {
                 "title": this.data.title,
@@ -175,7 +175,7 @@ Page({
             httpRequestApi.checkLesson(works.lessonId).success(res => {
                 const productId = res.data.data[0];
                 this.setData({
-                    productId
+                    productId: productId
                 })
             });
             // 设置音频路径

+ 35 - 5
pages/user/myEdit/myEdit.js

@@ -38,9 +38,38 @@ Page({
   optionSetting: function (e) {
     console.log(e.detail.value);
   },
+  changeAvatar: function (e) {
+    const _this = this;
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album', 'camera'],
+      success(res) {
+        // tempFilePath可以作为img标签的src属性显示图片
+        const localImage = res.tempFilePaths[0];
+        wx.uploadFile({
+          url: 'https://reader.lingjiao.cn/readerBase/file/upload',
+          filePath: localImage,
+          name: '头像',
+          header: {
+            uid: wx.getStorageSync('uid')
+          },
+          success: (res) => {
+            // console.log(JSON.parse(res.data));
+            const newAvatar = JSON.parse(res.data).data;
+            const str = 'user.avatar'
+            _this.setData({
+              [str]: newAvatar
+            })
+          }
+        })
+      }
+    })
+  },
   formSubmit: function (e) {
     console.log(e.detail.value)
-    if(e.detail.value.nickname === ''){
+    console.log(e)
+    if (e.detail.value.nickname === '') {
       return false
     }
     // const uid = wx.getStorageSync('uid');
@@ -52,14 +81,15 @@ Page({
       schoolCity: '',
       schoolName: e.detail.value.address || '',
       profession: e.detail.value.radioGroup2 || '',
-      birthday: e.detail.value.picker || ''
+      birthday: e.detail.value.picker || '',
+      avatar: this.data.user.avatar
     }
     httpRequestApi.settingUserInfo(data).success(res => {
       console.log(res.data.data); //修改资料成功后 调用 getUserInfo
       // wx.redirectTo({
       //   url: '/pages/index/index?index=3'
       // });
-      wx.setStorageSync('user',res.data.data);
+      wx.setStorageSync('user', res.data.data);
       wx.navigateBack({
         delta: 1
       })
@@ -115,8 +145,8 @@ Page({
           title: option.title
         });
       }
-      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit','修改资料页面').success((res)=>{
-        
+      httpRequestApi.userIntoPage('pages/user/myEdit/myEdit', '修改资料页面').success((res) => {
+
       })
     });
 

+ 14 - 8
pages/user/myEdit/myEdit.wxml

@@ -1,11 +1,17 @@
-<view>
+<view style="background:#f7f7f7;margin-top:-30rpx;">
+  <view class="avatarBox" name="avatar" value="user.avatar">
+    <image src="{{user.avatar}}" bindtap="changeAvatar" class="avatarImage" />
+    <view class="avatar-text" bindtap="changeAvatar">
+      <text>修改头像</text>
+      <image src='../../../static/image/edit_new.png' class='icon'></image>
+    </view>
+  </view>
   <view class='setting-info'>
     <form bindsubmit="formSubmit" class='form'>
       <view class='nickname-box'>
         <text class='setting-title'>宝贝昵称</text>
         <view class='user-action'>
-          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'>
-          </input>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'></input>
         </view>
         <view class='edit-img'>
           <image src='../../../static/image/edit_new.png' class='icon'></image>
@@ -22,12 +28,12 @@
       </view>
       <view class='birthday-box'>
         <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
-            <view class="picker">
-              <text class='setting-title'>生日</text>
-              <text>{{ date }}</text>
-            </view>
+          <view class="picker">
+            <text class='setting-title'>生日</text>
+            <text>{{ date }}</text>
+          </view>
         </picker>
-         <view class='edit-img'>
+        <view class='edit-img'>
           <image src='../../../static/image/edit_new.png' class='icon'></image>
         </view>
       </view>

+ 21 - 0
pages/user/myEdit/myEdit.wxss

@@ -205,4 +205,25 @@ picker {
   width: 100%;
 }
 
+.avatarBox{
+  width: 100%;
+  height: 200rpx;
+  margin: 0 auto;
+  padding-top: 30rpx;
+}
+.avatarImage{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+  margin: 0 auto;
+  display: block;
+  margin-top: 30rpx;
+}
+.avatar-text{
+  width: 100%;
+  font-size: 34rpx;
+  color: rgb(0, 162, 255);
+  text-align: center;
+  margin-top: 24rpx;
+}
 

+ 91 - 82
project.config.json

@@ -1,84 +1,93 @@
 {
-  "description": "项目配置文件",
-  "packOptions": {
-    "ignore": []
-  },
-  "setting": {
-    "urlCheck": true,
-    "es6": true,
-    "postcss": true,
-    "minified": true,
-    "newFeature": true
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.3.2",
-  "appid": "wxdfa8a4f1623d28db",
-  "projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "isGameTourist": false,
-  "condition": {
-    "search": {
-      "current": -1,
-      "list": []
-    },
-    "conversation": {
-      "current": -1,
-      "list": []
-    },
-    "plugin": {
-      "current": -1,
-      "list": []
-    },
-    "game": {
-      "currentL": -1,
-      "list": []
-    },
-    "miniprogram": {
-      "current": 5,
-      "list": [{
-          "id": -1,
-          "name": "小红花",
-          "pathName": "pages/social/littleFlower/littleFlower",
-          "query": ""
-        },
-        {
-          "id": 1,
-          "name": "作品",
-          "pathName": "pages/social/works/works",
-          "query": "id=1548160250807513&title=【识字1】春夏秋冬",
-          "scene": "1012"
-        },
-        {
-          "id": 2,
-          "name": "分享团",
-          "pathName": "pages/groupPage/group-details/group-details",
-          "query": "productId=1550459447432909",
-          "scene": 1012
-        },
-        {
-          "id": -1,
-          "name": "公众号进入",
-          "pathName": "pages/index/index",
-          "query": "",
-          "scene": 1020,
-          "referrerInfo": {}
-        },
-        {
-          "id": -1,
-          "name": "公众号文章进入",
-          "pathName": "pages/index/index",
-          "query": "",
-          "scene": 1058
-        },
-        {
-          "id": -1,
-          "name": "小红花兑换页面",
-          "pathName": "pages/social/prize/prize",
-          "scene": null
-        }
-      ]
-    }
-  }
+	"description": "项目配置文件",
+	"packOptions": {
+		"ignore": []
+	},
+	"setting": {
+		"urlCheck": true,
+		"es6": true,
+		"postcss": true,
+		"minified": true,
+		"newFeature": true
+	},
+	"compileType": "miniprogram",
+	"libVersion": "2.3.2",
+	"appid": "wxdfa8a4f1623d28db",
+	"projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
+	"debugOptions": {
+		"hidedInDevtools": []
+	},
+	"isGameTourist": false,
+	"condition": {
+		"search": {
+			"current": -1,
+			"list": []
+		},
+		"conversation": {
+			"current": -1,
+			"list": []
+		},
+		"plugin": {
+			"current": -1,
+			"list": []
+		},
+		"game": {
+			"currentL": -1,
+			"list": []
+		},
+		"miniprogram": {
+			"current": 6,
+			"list": [
+				{
+					"id": -1,
+					"name": "小红花",
+					"pathName": "pages/social/littleFlower/littleFlower",
+					"query": ""
+				},
+				{
+					"id": 1,
+					"name": "作品",
+					"pathName": "pages/social/works/works",
+					"query": "id=1548160250807513&title=【识字1】春夏秋冬",
+					"scene": "1012"
+				},
+				{
+					"id": 2,
+					"name": "分享团",
+					"pathName": "pages/groupPage/group-details/group-details",
+					"query": "productId=1550459447432909",
+					"scene": 1012
+				},
+				{
+					"id": -1,
+					"name": "公众号进入",
+					"pathName": "pages/index/index",
+					"query": "",
+					"scene": 1020,
+					"referrerInfo": {}
+				},
+				{
+					"id": -1,
+					"name": "公众号文章进入",
+					"pathName": "pages/index/index",
+					"query": "",
+					"scene": 1058
+				},
+				{
+					"id": -1,
+					"name": "小红花兑换页面",
+					"pathName": "pages/social/prize/prize",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "有问题朗读页面",
+					"pathName": "pages/social/works/works",
+					"query": "id=1553402613620097&title=【课文7】怎么都快乐",
+					"scene": null
+				}
+			]
+		}
+	}
 }

+ 4 - 4
utils/const.js

@@ -1,7 +1,7 @@
 // 常量列表
 module.exports = {
-	productApi: 'https://reader.lingjiao.cn/readerProduct/',
-	// productApi: 'https://readertest.lingjiao.cn/readerProduct/',
-	baseApi: 'https://reader.lingjiao.cn/readerBase/'
-	// baseApi: 'https://readertest.lingjiao.cn/readerBase/'
+  productApi: 'https://reader.lingjiao.cn/readerProduct/',
+  // productApi: 'https://readertest.lingjiao.cn/readerProduct/',
+  baseApi: 'https://reader.lingjiao.cn/readerBase/'
+  // baseApi: 'https://readertest.lingjiao.cn/readerBase/'
 }