Browse Source

Merge branch 'dongyuan' of http://gogs.efunbox.cn:3000/Rorschach/reader into dongyuan

dongyuan0658 6 years ago
parent
commit
d81bc47d24
91 changed files with 2268 additions and 235 deletions
  1. 8 2
      app.json
  2. 2 5
      app.wxss
  3. 27 0
      component/dialog/dialog.js
  4. 4 0
      component/dialog/dialog.json
  5. 8 0
      component/dialog/dialog.wxml
  6. 30 0
      component/dialog/dialog.wxss
  7. 27 10
      component/follow/follow.js
  8. 1 1
      component/follow/follow.wxml
  9. 15 15
      component/group/group.js
  10. 2 0
      component/group/group.wxml
  11. 17 7
      component/group/group.wxss
  12. 25 14
      component/hot/hot.js
  13. 2 2
      component/hot/hot.wxml
  14. 5 0
      component/my/my.wxss
  15. 23 0
      component/popup/popup.js
  16. 4 0
      component/popup/popup.json
  17. 2 0
      component/popup/popup.wxml
  18. 1 0
      component/popup/popup.wxss
  19. 110 0
      component/share/share.js
  20. 4 0
      component/share/share.json
  21. 22 0
      component/share/share.wxml
  22. 76 0
      component/share/share.wxss
  23. 13 3
      pages/discount-group/discount-group.js
  24. 6 0
      pages/groupPage/collage-details/collage-details.json
  25. 77 0
      pages/groupPage/collage-details/collage-details.wxml
  26. 173 0
      pages/groupPage/collage-details/collage-details.wxss
  27. 11 1
      pages/discount-group/discount-group.js
  28. 0 0
      pages/groupPage/discount-group/discount-group.json
  29. 1 1
      pages/discount-group/discount-group.wxml
  30. 0 0
      pages/groupPage/discount-group/discount-group.wxss
  31. 1 1
      pages/discount-group/discount-group.js
  32. 0 0
      pages/groupPage/grade-details/grade-details.json
  33. 44 0
      pages/groupPage/grade-details/grade-details.wxml
  34. 138 0
      pages/groupPage/grade-details/grade-details.wxss
  35. 104 0
      pages/groupPage/group-details/group-details.js
  36. 0 0
      pages/groupPage/group-details/group-details.json
  37. 88 0
      pages/groupPage/group-details/group-details.wxml
  38. 193 0
      pages/groupPage/group-details/group-details.wxss
  39. 66 30
      pages/index/index.js
  40. 5 1
      pages/index/index.json
  41. 3 0
      pages/index/index.wxml
  42. 29 1
      pages/main/books/books.js
  43. 5 2
      pages/main/books/books.wxml
  44. 27 0
      pages/main/books/books.wxss
  45. 49 26
      pages/main/class/class.js
  46. 2 2
      pages/main/class/class.wxml
  47. 53 32
      pages/main/reading/reading.js
  48. 1 2
      pages/main/reading/reading.wxml
  49. 73 0
      pages/main/searchResult/searchResult.js
  50. 0 0
      pages/main/searchResult/searchResult.json
  51. 9 0
      pages/main/searchResult/searchResult.wxml
  52. 52 0
      pages/main/searchResult/searchResult.wxss
  53. 43 0
      pages/main/singleBook/singleBook.js
  54. 0 0
      pages/main/singleBook/singleBook.json
  55. 22 0
      pages/main/singleBook/singleBook.wxml
  56. 62 0
      pages/main/singleBook/singleBook.wxss
  57. 89 0
      pages/social/replyDetail/replyDetail.js
  58. 0 0
      pages/social/replyDetail/replyDetail.json
  59. 16 0
      pages/social/replyDetail/replyDetail.wxml
  60. 90 0
      pages/social/replyDetail/replyDetail.wxss
  61. 70 6
      pages/social/works/works.js
  62. 5 5
      pages/social/works/works.wxml
  63. 1 1
      pages/social/works/works.wxss
  64. 15 3
      project.config.json
  65. BIN
      static/groupImg/Bitmap1.png
  66. BIN
      static/groupImg/Combined Shape.png
  67. BIN
      static/groupImg/Group 5 Copy 7.png
  68. BIN
      static/groupImg/Invitation.png
  69. BIN
      static/groupImg/Mask Copy@2x.png
  70. BIN
      static/groupImg/Preservation.png
  71. BIN
      static/groupImg/Rectangle 31@2x.png
  72. BIN
      static/groupImg/Rectangle 32@2x.png
  73. BIN
      static/groupImg/Rectangle 34@2x.png
  74. BIN
      static/groupImg/Rectangle 41.png
  75. BIN
      static/groupImg/Rectangle 8 Copy.png
  76. BIN
      static/groupImg/Rectangle 8 Copy@2x.png
  77. BIN
      static/groupImg/Rectangle 9.png
  78. BIN
      static/groupImg/circle.png
  79. BIN
      static/groupImg/code.png
  80. BIN
      static/groupImg/error.png
  81. BIN
      static/groupImg/liwu.png
  82. BIN
      static/groupImg/rule1.png
  83. BIN
      static/groupImg/rule2.png
  84. BIN
      static/groupImg/share.png
  85. BIN
      static/groupImg/step.png
  86. BIN
      static/groupImg/success.png
  87. BIN
      static/groupImg/weixin.png
  88. BIN
      static/groupImg/团长.png
  89. 122 1
      utils/APIClient.js
  90. 95 0
      utils/httpUtil.js
  91. 0 61
      utils/httpUtill.js

+ 8 - 2
app.json

@@ -2,12 +2,18 @@
   "pages": [
     "pages/index/index",
     "pages/social/works/works",
+    "pages/social/replyDetail/replyDetail",
     "pages/main/class/class",
     "pages/main/books/books",
+    "pages/main/singleBook/singleBook",
     "pages/main/reading/reading",
     "pages/user/myEdit/myEdit",
-    "pages/user/myconcern/myconcern",
-    "pages/discount-group/discount-group"
+    "pages/groupPage/discount-group/discount-group",
+    "pages/groupPage/group-details/group-details",
+    "pages/groupPage/grade-details/grade-details",
+    "pages/groupPage/collage-details/collage-details",
+    "pages/main/searchResult/searchResult",
+    "pages/user/myconcern/myconcern"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 2 - 5
app.wxss

@@ -6,12 +6,9 @@ page {
 
 .container {
   height: 100%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: space-between;
+  
   padding-top: 80rpx;
-  box-sizing: border-box;
+ 
 } 
 ::-webkit-scrollbar{
   width: 0;

+ 27 - 0
component/dialog/dialog.js

@@ -0,0 +1,27 @@
+// compontents/dialog/dialog.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    flag: true,
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    impower: function () {
+      var myEventDetail = {} // detail对象,提供给事件监听函数
+      var myEventOption = {} // 触发事件的选项
+      this.triggerEvent('myevent', myEventDetail, myEventOption)
+    }
+  }
+})

+ 4 - 0
component/dialog/dialog.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 8 - 0
component/dialog/dialog.wxml

@@ -0,0 +1,8 @@
+<!--compontents/dialog/dialog.wxml-->
+<view class="dialog">
+    <view class="dialog-contain">
+        <text>登录后可继续操作</text>
+        <button class="btn" type="primary" open-type="getUserInfo" bindgetuserinfo="impower">授权微信后登录</button>
+    </view>
+</view>
+

+ 30 - 0
component/dialog/dialog.wxss

@@ -0,0 +1,30 @@
+/* compontents/dialog/dialog.wxss */
+.dialog {
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, .4);
+    z-index:100;
+}
+
+.dialog-contain {
+    position: absolute;
+    left: 0;
+    top: 0;
+    bottom: 0;
+    right: 0;
+    width: 80%;
+    height: 200rpx;
+    background: #fff;
+    margin: auto;
+    border-radius: 20rpx;
+    text-align: center;
+    padding: 0 40rpx;
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-around;
+    font-size: 32rpx;
+}

+ 27 - 10
component/follow/follow.js

@@ -1,11 +1,11 @@
-export const followInit =  (that) => {
+import httpRequestApi from '../../utils/APIClient';
+export const followInit = (that) => {
   that.setData({
     followData: {
       title: '关注',
-      wareCards:[
-        {
-          title:"铺满色巴掌的水泥道",
-          grade:"一年级 上学期",
+      wareCards: [{
+          title: "铺满色巴掌的水泥道",
+          grade: "一年级 上学期",
           img: "../../static/image/timg.jpg",
           plays: "1",
           likes: "2",
@@ -15,8 +15,8 @@ export const followInit =  (that) => {
           time: '11-01 14:14'
         },
         {
-          title:"铺满色巴掌的水泥道",
-          grade:"一年级 上学期",
+          title: "铺满色巴掌的水泥道",
+          grade: "一年级 上学期",
           img: "../../static/image/timg.jpg",
           plays: "1",
           likes: "2",
@@ -26,8 +26,8 @@ export const followInit =  (that) => {
           time: '11-01 14:14'
         },
         {
-          title:"铺满色巴掌的水泥道",
-          grade:"一年级 上学期",
+          title: "铺满色巴掌的水泥道",
+          grade: "一年级 上学期",
           img: "../../static/image/timg.jpg",
           plays: "1",
           likes: "2",
@@ -40,5 +40,22 @@ export const followInit =  (that) => {
     }
   })
   //请求数据封装
-
+  that.getWorks = (uid, pageNo, pageSize) => {
+    httpRequestApi.getFollowWorks(uid, pageNo, pageSize).success(res => {
+      const followData = res.data.data.list;
+      const followTemp = [];
+      followData.forEach(item => {
+        const temp = {};
+        temp.nickName = item.user.wechatName;
+        temp.avatar = item.user.avatar;
+        temp.plays = item.userRead.playAmount;
+        temp.likes = item.userRead.likeAmount;
+        temp.id = item.userRead.id;
+        // 还差一些字段
+        followTemp.push(temp);
+      });
+      console.log(followTemp);
+    });
+  }
+  that.getWorks(1, 1, 10);
 }

+ 1 - 1
component/follow/follow.wxml

@@ -1,6 +1,6 @@
 <template name="follow">
   <view class="followWares" style="flex-direction:row;">
-    <view wx:for="{{followData.wareCards}}" wx:key="{{index}}" class="followWareCard" bindtap="openWorks" data-classId="{{item.classId}}" data-title="{{item.title}}">
+    <view wx:for="{{followData.wareCards}}" wx:key="{{index}}" class="followWareCard" bindtap="openWorks" data-uid="{{item.classId}}" data-title="{{item.title}}">
       <view class="userCard">
         <image class="avatar" src="{{item.avatar}}" />
         <view class="nameCross">

+ 15 - 15
component/group/group.js

@@ -1,16 +1,16 @@
-export const groupInit =  (that) => {
-    that.setData({
-      groupData: {
-        title: '关注'
-      }
-    })
-    //请求数据封装
-    that.more = function () {
-      wx.navigateTo({
-        url: '/pages/discount-group/discount-group'
-      })
-      wx.setNavigationBarTitle({
-        title: '限量优惠团购'
-      })
+export const groupInit = (that) => {
+  that.setData({
+    groupData: {
+      title: '关注'
     }
-  }
+  })
+  //请求数据封装
+  that.more = function () {
+    wx.navigateTo({
+      url: '/pages/groupPage/discount-group/discount-group'
+    })
+    wx.setNavigationBarTitle({
+      title: '限量优惠团购'
+    })
+  }
+}

+ 2 - 0
component/group/group.wxml

@@ -69,6 +69,7 @@
         </view>
     </scroll-view>
     <view class="Collage-bottom">
+      <image class="bg" src="../../static/groupImg/Rectangle 9.png"></image>
       <view>
         <image src="../../static/groupImg/Shape1@2x.png"></image>
         <text>发起团购</text>
@@ -79,4 +80,5 @@
       </view>
     </view>
   </view>
+  <button open-type="getUserInfo">授权</button>
 </template>

+ 17 - 7
component/group/group.wxss

@@ -1,12 +1,12 @@
 ::-webkit-scrollbar {
     display: none;
-  }
+}
 
 .group {
     height: 100%;
     width: 100%;
     padding-bottom: 102rpx;
-    box-sizing: border-box; 
+    box-sizing: border-box;
 }
 
 scroll-view {
@@ -16,7 +16,7 @@ scroll-view {
 .group-container {
     width: 100%;
     box-sizing: border-box;
-    padding: 0 18rpx; 
+    padding: 0 18rpx;
     background: #fff;
 }
 
@@ -50,7 +50,7 @@ scroll-view {
 
 .whole-group {
     margin-top: 32rpx;
-    padding: 0 18rpx; 
+    padding: 0 18rpx;
     box-sizing: border-box;
 }
 
@@ -65,7 +65,7 @@ scroll-view {
 
 .title .left {
     font-size: 32rpx;
-    padding-left: 52rpx; 
+    padding-left: 52rpx;
 }
 
 .quota {
@@ -73,7 +73,7 @@ scroll-view {
     color: red;
 }
 
-.title .ren  {
+.title .ren {
     width: 42rpx;
     height: 36rpx;
     position: absolute;
@@ -130,9 +130,10 @@ scroll-view {
  justify-content: space-around;
  align-items: center;
  height: 102rpx;
+ position: relative;
 }
 
-.Collage-bottom image {
+.Collage-bottom view image {
     width: 42rpx;
     height: 50rpx;
     vertical-align: middle;
@@ -141,4 +142,13 @@ scroll-view {
 
 .Collage-bottom text {
     vertical-align: middle;
+}
+
+.Collage-bottom .bg {
+    position: absolute;
+    left: 50%;
+    top: 15%;
+    width: 4rpx;
+    height: 70%;
+    transform: translateX(-50%);
 }

+ 25 - 14
component/hot/hot.js

@@ -4,9 +4,9 @@ export const hotInit = (that) => {
       hotData: {
         title: '热门',
         imgUrls: [
-          'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
-          'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
-          'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
+          '../../static/image/timg.jpg',
+          '../../static/image/timg.jpg',
+          '../../static/image/timg.jpg'
         ],
         indicatorDots: true,
         autoplay: true,
@@ -18,28 +18,28 @@ export const hotInit = (that) => {
         hotSearch: '鹅鹅鹅',
         wareCards:[
           {
-            title:"铺满色巴掌的水泥道",
+            title:"铺满色巴掌的水泥道1",
             grade:"一年级 上学期",
             img: "../../static/image/timg.jpg",
             plays: "1",
             likes: "2",
-            classId: "1"
+            classId: "1001"
           },
           {
-            title:"铺满金色巴掌的水泥道",
+            title:"铺满金色巴掌的水泥道2",
             grade:"一年级 上学期",
             img: "../../static/image/timg.jpg",
             plays: "12345",
             likes: "54321",
-            classId: "2"
+            classId: "1002"
           },
           {
-            title:"铺满金色巴掌的水泥道",
+            title:"铺满金色巴掌的水泥道3",
             grade:"一年级 上学期",
             img: "../../static/image/timg.jpg",
             plays: "12345",
             likes: "54321",
-            classId: "2"
+            classId: "1003"
           },
         ]
       }
@@ -48,6 +48,12 @@ export const hotInit = (that) => {
     that.searchHandler = () => {
       console.log('搜索按钮')
       console.log(that.data.hotInput);
+      if(that.data.hotInput.lenght !== 0){
+        wx.navigateTo({
+          url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
+        })
+      }
+      
     },
     // 输入框输入
     that.inputHandler = (e) => {
@@ -65,18 +71,18 @@ export const hotInit = (that) => {
     
     // 打开课程页面
     that.openClass = (e) =>{
-      let classId = e.currentTarget.dataset.classid;
+      let id = e.currentTarget.dataset.classid;
       let title = e.currentTarget.dataset.title;
       wx.navigateTo({
-        url: `../main/class/class?id=${classId}&title=${title}`
+        url: `../main/class/class?id=${id}&title=${title}`
       })
     }
     // 打开用户作品页面
     that.openWorks = (e) =>{
-      let classId = e.currentTarget.dataset.classid;
+      let uid = e.currentTarget.dataset.uid;
       let title = e.currentTarget.dataset.title;
       wx.navigateTo({
-        url: `../social/works/works?id=${classId}&title=${title}`
+        url: `../social/works/works?id=${uid}&title=${title}`
       })
     }
     that.getIndex = (uid)=>{
@@ -87,7 +93,6 @@ export const hotInit = (that) => {
       })
     }
     that.getHotRecommend = (uid,pageNo,pageSize)=>{
-      console.log(pageNo)
       httpRequestApi.getHotRecommend(
         uid,
         pageNo,
@@ -96,6 +101,12 @@ export const hotInit = (that) => {
         console.log(res);
       })
     }
+    // 去全部课本
+    that.goToBooks = () =>{
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
+    }
     that.getIndex(1);
     that.getHotRecommend(1,1,3) 
 }

+ 2 - 2
component/hot/hot.wxml

@@ -16,7 +16,7 @@
     <view class="hotSection">
         <view class="title">
             <view class="leftWrapper">
-                <image class="recommendTag" src="../../static/image/class_recommend.png" alt="" />
+                <image class="recommendTag" src="../../static/image/course.png" alt="" />
                 <text>本周课程推荐</text>
             </view>
             <view class="moreBtn" bindtap="openBooks">更多></view>
@@ -47,7 +47,7 @@
             </view>
         </view>
         <view class="hotWares" style="flex-direction:row;">
-            <view wx:for="{{hotData.wareCards}}" wx:key="{{index}}" class="hotWareCard" bindtap="openWorks" data-classId="{{item.classId}}" data-title="{{item.title}}">
+            <view wx:for="{{hotData.wareCards}}" wx:key="{{index}}" class="hotWareCard" bindtap="openWorks" data-uid="{{item.classId}}" data-title="{{item.title}}">
                 <image class="wareCardImg" src="{{item.img}}" />
                 <text class="wareCardTitle">{{item.title}}</text>
                 <view class="bottomData">

+ 5 - 0
component/my/my.wxss

@@ -3,6 +3,11 @@
   height: 1116rpx;
   background: #F0F1F5;
   position: relative;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  box-sizing: border-box;
 }
 
 .mine-center{

+ 23 - 0
component/popup/popup.js

@@ -0,0 +1,23 @@
+// component/popup/popup.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
component/popup/popup.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 2 - 0
component/popup/popup.wxml

@@ -0,0 +1,2 @@
+<!--component/popup/popup.wxml-->
+<text>component/popup/popup.wxml</text>

+ 1 - 0
component/popup/popup.wxss

@@ -0,0 +1 @@
+/* component/popup/popup.wxss */

+ 110 - 0
component/share/share.js

@@ -0,0 +1,110 @@
+// component/shar-dialog/shar-dialog.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    shareFlag: true,
+    imgUrls: ''
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    poster: function () {
+      const that = this;
+      const ctx = wx.createCanvasContext('myCanvas');
+      ctx.rect(0, 0, 370, 507)
+      ctx.setFillStyle('#fff')
+      ctx.fill()
+      ctx.save()
+      ctx.beginPath()
+      ctx.setFillStyle('#fff')
+      ctx.fill()
+      ctx.arc(185, 48, 37, 0, 2 * Math.PI, false)
+      ctx.clip();//画了圆 再剪切  原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内  
+      ctx.drawImage('../../../static/groupImg/Bitmap1.png', 148, 8, 100, 100);   //插入图片  
+      ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+      ctx.setFontSize(20)
+      ctx.setFillStyle('#000')
+      ctx.fillText('喔喔', 166, 115)
+      ctx.setFillStyle('#FF4400')
+      ctx.fillText('郎朗读书声是世上最美的声音', 50, 138) 
+      ctx.drawImage('../../../static/groupImg/Bitmap1.png', 9, 156, 352, 145);  
+      ctx.setFontSize(18)
+      ctx.setFillStyle('#000')
+      ctx.fillText('一年级语文上学期', 12, 329)
+      ctx.drawImage('../../../static/groupImg/Combined Shape.png', 11, 348, 196, 65);
+      ctx.drawImage('../../../static/groupImg/Rectangle 41.png', 134, 358, 59, 20);
+      ctx.setFontSize(14)  
+      ctx.setFillStyle('#fff')
+      ctx.fillText('五人团', 149, 373) 
+      ctx.setFontSize(16)  
+      ctx.setFillStyle('#A95A00')
+      ctx.fillText('原价', 24, 373)
+      ctx.setStrokeStyle('red')
+      ctx.moveTo(64, 368)
+      ctx.lineTo(114, 368)
+      ctx.stroke()
+      ctx.fillText('¥99元', 64, 373)
+      ctx.setFontSize(18)
+      ctx.fillText('团购价仅需', 20, 403)
+      ctx.fillText('元', 144, 403)
+      ctx.setFontSize(20)  
+      ctx.setFillStyle('red')
+      ctx.fillText('¥1', 109, 403) 
+      ctx.drawImage('../../../static/groupImg/Group 5 Copy 7.png', 3, 419, 370, 192);  
+      ctx.setFontSize(20)
+      ctx.setFillStyle('red')
+      ctx.fillText('名额有限,售完截止', 9, 467)
+      ctx.setFontSize(18)
+      ctx.setFillStyle('#000')
+      ctx.fillText('长按识别二维码参加团购', 9, 493)
+      ctx.drawImage('../../../static/groupImg/code.png', 217, 374, 135, 135);
+      ctx.draw(true, function (res) {
+        wx.canvasToTempFilePath({
+          x: 0,
+          y: 0,
+          width: 370,
+          height: 507,
+          destWidth: 370,
+          destHeight: 507,
+          canvasId: 'myCanvas',
+          success:(res) => {
+              console.log(res.tempFilePath)
+              // wx.saveImageToPhotosAlbum({
+              //   filePath: res.path,
+              //   success(res) {
+              //     console.log(res);
+              //    }
+              // })
+              that.setData({
+                imgUrls: res.tempFilePath
+              })
+          }
+        })
+      })
+    },
+    share: function () {
+      this.setData({
+        shareFlag: !this.data.shareFlag
+      })
+    },
+    PreservationImg: function () {
+      wx.saveImageToPhotosAlbum({
+        filePath: this.data.imgUrls,
+        success(res) { 
+          console.log('保存成功')
+        }
+      })
+    }
+  }
+})

+ 4 - 0
component/share/share.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 22 - 0
component/share/share.wxml

@@ -0,0 +1,22 @@
+<view class="share" bindtap="share" hidden="{{shareFlag}}">
+   <view class="btn" wx:if="{{!imgUrls}}">
+       <image class="bg" src="../../static/groupImg/share.png"></image>
+       <view class="share-btn">
+           <view class="share-friend">
+               <image  src="../../static/groupImg/weixin.png"></image>
+               <text>发送给群/好友</text>
+           </view>
+           <view class="share-circle" catchtap="poster">
+               <image  src="../../static/groupImg/circle.png"></image>
+               <text>发朋友圈</text>
+           </view>           
+       </view>
+   </view>
+   <view class="share-img" wx:if="{{imgUrls}}">
+       <image class="img" src="{{imgUrls}}"></image>
+       <view class="Preservation">
+           <image class="PreservationBg" src="../../static/groupImg/Preservation.png"></image>
+           <text bindtap="PreservationImg">点我保存,并分享至朋友圈</text>
+       </view>
+   </view>
+</view>

+ 76 - 0
component/share/share.wxss

@@ -0,0 +1,76 @@
+/* component/shar-dialog/shar-dialog.wxss */
+.share {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, .3);
+    z-index: 99;
+}
+
+.btn {
+    position: absolute;
+    bottom: 0;
+    width: 100%;
+    height: 290rpx;
+    background: #fff;
+}
+
+.btn .bg {
+    width: 90%;
+    margin: 46rpx 5%;
+    height: 42rpx;
+}
+
+.share-btn {
+    display: flex;
+    justify-content: space-around;
+}
+
+.share-btn image {
+    width: 66rpx;
+    height: 66rpx;
+}
+
+.share-btn view {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    font-size: 32rpx;
+}
+
+.img {
+    position: absolute;
+    left: 5rpx;
+    top: 30rpx;
+    width: 740rpx;
+    height: 1014rpx;
+}
+
+.Preservation {
+    position: absolute;
+    left: 15%;
+    bottom: 5%;
+    width: 70%;
+    height: 88rpx;
+
+}
+
+.Preservation .PreservationBg {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.Preservation text {
+    color: #fff;
+    font-size: 36rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 20rpx;
+    z-index: 9;
+}

+ 13 - 3
pages/discount-group/discount-group.js

@@ -1,13 +1,23 @@
-// pages/discount-group/discount-group.js
+// pages/groupPage/collage-details/collage-details.js
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    hideFlag: true
   },
 
+  //规则页显示和隐藏
+  hide: function () {
+    this.setData({
+      hideFlag: !this.data.hideFlag
+    })
+  },
+  //显示分享页 
+  share: function () {
+    this.shareDialog.share();
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -19,7 +29,7 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-
+    this.shareDialog = this.selectComponent("#share-dialog");
   },
 
   /**

+ 6 - 0
pages/groupPage/collage-details/collage-details.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "shareDialog": "/component/share/share"
+    }
+  }

+ 77 - 0
pages/groupPage/collage-details/collage-details.wxml

@@ -0,0 +1,77 @@
+<!--pages/groupPage/collage-details/collage-details.wxml-->
+<view class="collage-details">
+    <view class="step">
+        <image src="../../../static/groupImg/step.png"></image>
+        <view class="txt">
+            <text>1.支付成功</text>
+            <text>2.邀请朋友参加</text>
+            <text>3.去朗读</text>
+        </view>
+    </view>
+    <view class="details-head">
+        <view class="headImg">
+            <view class="headImg-item">
+                
+            </view>
+            <view class="headImg-item">
+ 
+            </view>
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>  
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>                      
+        </view>
+        <view class="shengyu">
+            <view class="shengyu-num">仅剩<text>3</text>个名额就拼团成功了</view>
+            <view class="shengyu-time">
+                剩余时间:
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>
+                天
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view> 
+                时             
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>                
+                分             
+            </view>
+        </view>
+        <view class="invitation-btn" bindtap="share">
+            <image src="../../../static/groupImg/Invitation.png"></image>
+            <text>邀请朋友参加</text>
+        </view>
+    </view>  
+    <view class="rule" style="{{hideFlag ? 'right' : 'left'}}: 0" bindtap="hide">
+        <image src="../../../static/groupImg/rule{{hideFlag ? '1' : '2'}}.png"></image>
+        <text>拼团规则</text>        
+    </view>  
+    <view class="explain" hidden="{{hideFlag}}">
+        <text>拼团规则</text>
+        * 转发给自己的朋友们,分享好课, 追随您一起学习进步。您的魅力不是吹的! * 在限定时间内内成功拼团,您将得到xx元的奖励金哦。 * 如果拼团失败,您预付的课程费将在48小时内退回您的账户。
+    </view>
+</view> 
+<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+<shareDialog id="share-dialog"/>
+

+ 173 - 0
pages/groupPage/collage-details/collage-details.wxss

@@ -0,0 +1,173 @@
+/* pages/groupPage/collage-details/collage-details.wxss */
+.collage-details {
+    height: 100%;
+    width: 100%;
+    background:rgba(240,241,245,1);    
+}
+
+.step {
+    width: 100%;
+    height: 250rpx;
+    background: #fff;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+}
+
+.step image {
+    height: 60rpx;
+    width: 70%;
+    margin: 0 auto;
+}
+
+.txt {
+    display: flex;
+    justify-content: space-around;
+    color: #535353;
+    font-size: 32rpx;
+    padding: 0 46rpx;
+    margin-top: 20rpx;
+}
+
+.details-head {
+    width: 100%;
+    height: 78%;
+    margin-top: 12rpx;
+    background: #fff;
+}
+
+.headImg {
+    display: flex;
+    flex-wrap: wrap;
+    padding: 40rpx 0;
+    box-sizing: border-box;
+}
+
+.headImg-item {
+    width: 106rpx;
+    height: 106rpx;
+    background: red;
+    border-radius: 50%;
+    margin: 20rpx 22rpx;
+}
+
+.headImg-item image {
+    width: 100%;
+    height: 100%
+}
+
+.shengyu {
+ display: flex;
+ flex-direction: column;   
+ color: #696969;
+}
+
+.shengyu-num {
+    text-align:center;    
+}
+
+.shengyu-num text {
+    color: #FF4330;
+}
+
+.shengyu-time {
+    display: flex;
+    justify-content: center;
+    align-items: center; 
+    margin-top: 8rpx;  
+}
+
+.shengyu-time .time {
+    position: relative;
+    width: 20rpx;
+    height: 40rpx;
+    margin:  0 8rpx;
+}
+
+.shengyu-time .time image {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 20rpx;
+    height: 40rpx;
+}
+
+.shengyu-time .time  text{
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 2;
+    color: #fff;
+    font-size: 28rpx;
+}
+
+.invitation-btn {
+    position: absolute;
+    left: 50%;
+    top: 65%;
+    transform: translate(-50%);
+    width: 434rpx;
+    height: 80rpx;
+}
+
+.invitation-btn image{
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.invitation-btn text{
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+    text-align: center;
+    line-height: 80rpx;
+    z-index: 2;
+    color: #fff;
+}
+
+.rule {
+    position: fixed;
+    right: 0;
+    top: 82%;
+    width: 84rpx;
+    height: 88rpx;
+    z-index:2;    
+}
+
+.rule image {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.rule text {
+    position: absolute;
+    left: 30rpx;
+    top: 10rpx;
+    font-size: 24rpx;
+    color: #fff;
+    z-index: 2;
+}
+
+.explain {
+    position: absolute;
+    top: 73%;
+    left: 11%;
+    background: #61CA54;
+    padding: 20rpx;
+    color: #000;
+    font-size: 32rpx;
+    width: 668rpx;
+    box-sizing: border-box;
+} 
+
+.explain text {
+    display: block;
+    font-size: 36rpx;
+}

+ 11 - 1
pages/discount-group/discount-group.js

@@ -1,4 +1,4 @@
-// pages/discount-group/discount-group.js
+// pages/groupPage//discount-group/discount-group.js
 Page({
 
   /**
@@ -8,6 +8,16 @@ Page({
 
   },
 
+//点击跳转到团购详情
+groupDetails:function () {
+  wx.navigateTo({
+    url: '/pages/groupPage/group-details/group-details'
+  })
+  wx.setNavigationBarTitle({
+    title: '拼团详情'
+  })
+},
+
   /**
    * 生命周期函数--监听页面加载
    */

pages/discount-group/discount-group.json → pages/groupPage/discount-group/discount-group.json


+ 1 - 1
pages/discount-group/discount-group.wxml

@@ -4,7 +4,7 @@
       <view class="group-container">
         <view class="less-group">
           <view class="group-box">
-            <view class="group-item">
+            <view class="group-item" bindtap="groupDetails">
               <image src="" style="background: red;"></image>
               <view>拼团价 <text>¥1</text></view>
               <view>原价 <text style="text-decoration: line-through;">¥99</text></view>

pages/discount-group/discount-group.wxss → pages/groupPage/discount-group/discount-group.wxss


+ 1 - 1
pages/discount-group/discount-group.js

@@ -1,4 +1,4 @@
-// pages/discount-group/discount-group.js
+// pages/grade-details/grade-details.js
 Page({
 
   /**

pages/discount-group/discount-group.json → pages/groupPage/grade-details/grade-details.json


+ 44 - 0
pages/groupPage/grade-details/grade-details.wxml

@@ -0,0 +1,44 @@
+<!--pages/grade-details/grade-details.wxml-->
+<view class="group-details">
+    <scroll-view scroll-y="{{true}}">
+        <view class="grade-details">
+            <image src="" style="background: red;"></image>
+            <text>【部编版】一年级语文同步-上学期</text>
+            <text>《语文一年级上册》为人教社2016年修订的教材,包括“我上学了识字汉语拼音课文口语交际语文园地”和“快乐读吧供一年级上学期使用。</text>
+        </view>
+        <view class="catalog">
+            <image src="../../../static/groupImg/Rectangle 34@2x.png"></image>
+            <text>语文目录</text>
+        </view>
+        <view class="catalog-list">
+            <view class="catalog-item">
+                <text class="left">第一课 小小的船</text>
+                <text class="right">3215朗读 ></text>
+            </view>
+            <view class="catalog-item">
+                <text class="left">第一课 小小的船</text>
+                <text class="right">3215朗读 ></text>
+            </view>
+            <view class="catalog-item">
+                <text class="left">第一课 小小的船</text>
+                <text class="right">3215朗读 ></text>
+            </view>            
+        </view>
+    </scroll-view>
+    <view class="group-btn">
+        <image class="bg1" src="../../../static/groupImg/Rectangle 9.png"></image>
+        <image class="bg2" src="../../../static/groupImg/Rectangle 9.png"></image>
+        <view class="Price">
+            <text>¥99</text>
+            <text>单人团</text>
+        </view>
+        <view class="Price">
+            <text>¥99</text>
+            <text>单人团</text>
+        </view>
+        <view class="Price">
+            <text>¥99</text>
+            <text>单人团</text>
+        </view>
+    </view>
+</view>

+ 138 - 0
pages/groupPage/grade-details/grade-details.wxss

@@ -0,0 +1,138 @@
+/* pages/grade-details/grade-details.wxss */
+.group-details {
+    height: 100%;
+    width: 100%;
+    background:rgba(240,241,245,1);    
+}
+
+
+scroll-view {
+    height: 100%;
+    width: 100%;
+}
+
+.grade-details {
+    margin: 12rpx 0;
+    background: #fff;
+    display: flex;
+    flex-direction: column;
+    padding: 24rpx;
+}
+
+.grade-details image{
+    width: 100%;
+    height: 290rpx;
+    border-radius: 20rpx;
+}
+
+.grade-details text {
+    font-size: 32rpx;
+}
+
+.grade-details text:nth-child(2) {
+    margin: 12rpx 0;
+}
+
+.catalog {
+    width: 100%;
+    height: 62rpx;
+    background: #fff;
+    position: relative;
+}
+
+.catalog image {
+    position: absolute;
+    left: 24rpx;
+    top: 10rpx;
+    width: 208rpx;
+    height: 42rpx;
+}
+
+.catalog text {
+    position: absolute;
+    left: 34rpx;
+    top: 7rpx;
+    z-index: 2;
+    color: #fff;
+    font-size: 36rpx;
+}
+
+.catalog-list {
+    width: 100%;
+    padding: 18rpx;
+    box-sizing: border-box;
+}
+
+.catalog-item {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    height: 88rpx;
+    background: #fff;
+    padding: 0 20rpx;
+    box-sizing: border-box;
+    margin-bottom: 12rpx;
+    border-radius: 10rpx;
+}
+
+.catalog-item .left {
+    color: #656565;
+    font-size: 36rpx;
+}
+
+.catalog-item .right {
+    color: #939393;
+    font-size: 28rpx;
+}
+
+.group-btn {
+    width: 100%;
+    height: 102rpx;
+    background: #E5E5E5;
+    display: flex;
+    position: absolute;
+    bottom: 0;
+}
+
+.group-btn .Price {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    color: #000;
+}
+
+.group-btn .Price:nth-child(4) {
+    color: #4A90E2;
+}
+
+.group-btn .Price:nth-child(5) {
+    color: #FC6400;
+}
+
+.group-btn .Price text:nth-child(1) {
+    font-size: 32rpx;
+}
+
+.group-btn .Price text:nth-child(2) {
+    font-size: 36rpx;
+}
+
+
+.group-btn .bg1,
+.group-btn .bg2 {
+    position: absolute;
+    top: 15%;
+    width: 4rpx;
+    height: 70%;
+}
+
+.group-btn .bg1 {
+    left: 35%;
+}
+
+.group-btn .bg2 {
+    left: 68%;
+}

+ 104 - 0
pages/groupPage/group-details/group-details.js

@@ -0,0 +1,104 @@
+// pages/group-details/group-details.js
+import httpRequestApi from '../../../utils/APIClient';
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+  //跳转到年级
+  gradeDetails: function () {
+    wx.navigateTo({
+      url: '/pages/groupPage/grade-details/grade-details'
+    })
+    // wx.setNavigationBarTitle({
+    //   title: '限量优惠团购'
+    // })
+  
+  },
+  //跳转到拼团详情
+  collage: function () {
+    wx.navigateTo({
+      url: '/pages/groupPage/collage-details/collage-details'
+    })
+    wx.setNavigationBarTitle({
+      title: '拼团详情'
+    })
+  
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    httpRequestApi.getGroupPurchaseInfo(1).success( (res) =>{
+      console.log(res);
+    }).fail( (error) => {
+
+    })
+    httpRequestApi.SendGroupPurchas({
+      "productId": "1",
+      "groupId": "1"
+    }).success( (res) =>{
+
+    }).fail( (error) => {
+      
+    })
+    httpRequestApi.JoinGroupPurchas('1541386476732288').success( (res) =>{
+
+    }).fail( (error) => {
+      
+    })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

pages/discount-group/discount-group.json → pages/groupPage/group-details/group-details.json


+ 88 - 0
pages/groupPage/group-details/group-details.wxml

@@ -0,0 +1,88 @@
+<!--pages/group-details/group-details.wxml-->
+<view class="group-details">
+    <view class="details-head" bindtap="collage">
+        <view class="headImg">
+            <view class="headImg-item">
+                
+            </view>
+            <view class="headImg-item">
+ 
+            </view>
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>  
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>
+            <view class="headImg-item">
+                <image src="../../../static/groupImg/Mask Copy@2x.png"></image>
+            </view>                      
+        </view>
+        <view class="shengyu">
+            <view class="shengyu-num">仅剩<text>3</text>个名额就拼团成功了</view>
+            <view class="shengyu-time">
+                剩余时间:
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>
+                天
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view> 
+                时             
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>
+                <view class="time">
+                    <image src="../../../static/groupImg/Rectangle 31@2x.png"></image>
+                    <text>1</text>
+                </view>                
+                分             
+            </view>
+        </view>
+    </view>
+    <scroll-view scroll-y="{{true}}">
+        <view class="grade-details" bindtap="gradeDetails">
+            <image src="" style="background: red;"></image>
+            <text>【部编版】一年级语文同步-上学期</text>
+            <text>《语文一年级上册》为人教社2016年修订的教材,包括“我上学了识字汉语拼音课文口语交际语文园地”和“快乐读吧供一年级上学期使用。</text>
+        </view>
+        <view class="catalog">
+            <image src="../../../static/groupImg/Rectangle 34@2x.png"></image>
+            <text>语文目录</text>
+        </view>
+        <view class="catalog-list">
+            <view class="catalog-item">
+                <text class="left">第一课 小小的船</text>
+                <text class="right">3215朗读 ></text>
+            </view>
+            <view class="catalog-item">
+                <text class="left">第一课 小小的船</text>
+                <text class="right">3215朗读 ></text>
+            </view>
+            <view class="catalog-item">
+                <text class="left">第一课 小小的船</text>
+                <text class="right">3215朗读 ></text>
+            </view>            
+        </view>
+    </scroll-view>
+    <view class="group-details-btn">
+        <view class="left-btn">
+            开团
+        </view>
+        <view class="right-btn">
+            <image src="../../../static/groupImg/Rectangle 8 Copy@2x.png"></image>
+            <text>参团</text>
+        </view>
+    </view>
+</view>

+ 193 - 0
pages/groupPage/group-details/group-details.wxss

@@ -0,0 +1,193 @@
+/* pages/group-details/group-details.wxss */
+.group-details {
+    height: 100%;
+    width: 100%;
+    background:rgba(240,241,245,1);    
+}
+
+.details-head {
+    width: 100%;
+    background: #fff;
+}
+
+.headImg {
+    display: flex;
+    flex-wrap: wrap;
+    padding: 40rpx 0;
+    box-sizing: border-box;
+}
+
+.headImg-item {
+    width: 106rpx;
+    height: 106rpx;
+    background: red;
+    border-radius: 50%;
+    margin: 20rpx 22rpx;
+}
+
+.headImg-item image {
+    width: 100%;
+    height: 100%
+}
+
+.shengyu {
+ display: flex;
+ flex-direction: column;   
+ color: #696969;
+}
+
+.shengyu-num {
+    text-align:center;    
+}
+
+.shengyu-num text {
+    color: #FF4330;
+}
+
+.shengyu-time {
+    display: flex;
+    justify-content: center;
+    align-items: center; 
+    margin-top: 8rpx;  
+}
+
+.shengyu-time .time {
+    position: relative;
+    width: 20rpx;
+    height: 40rpx;
+    margin:  0 8rpx;
+}
+
+.shengyu-time .time image {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 20rpx;
+    height: 40rpx;
+}
+
+.shengyu-time .time  text{
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 2;
+    color: #fff;
+    font-size: 28rpx;
+}
+
+scroll-view {
+    height: 59%;
+    width: 100%;
+}
+
+.grade-details {
+    margin: 12rpx 0;
+    background: #fff;
+    display: flex;
+    flex-direction: column;
+    padding: 24rpx;
+}
+
+.grade-details image{
+    width: 100%;
+    height: 290rpx;
+    border-radius: 20rpx;
+}
+
+.grade-details text {
+    font-size: 32rpx;
+}
+
+.grade-details text:nth-child(2) {
+    margin: 12rpx 0;
+}
+
+.catalog {
+    width: 100%;
+    height: 62rpx;
+    background: #fff;
+    position: relative;
+}
+
+.catalog image {
+    position: absolute;
+    left: 24rpx;
+    top: 10rpx;
+    width: 208rpx;
+    height: 42rpx;
+}
+
+.catalog text {
+    position: absolute;
+    left: 34rpx;
+    top: 7rpx;
+    z-index: 2;
+    color: #fff;
+    font-size: 36rpx;
+}
+
+.catalog-list {
+    width: 100%;
+    padding: 18rpx;
+    box-sizing: border-box;
+}
+
+.catalog-item {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    height: 88rpx;
+    background: #fff;
+    padding: 0 20rpx;
+    box-sizing: border-box;
+    margin-bottom: 12rpx;
+    border-radius: 10rpx;
+}
+
+.catalog-item .left {
+    color: #656565;
+    font-size: 36rpx;
+}
+
+.catalog-item .right {
+    color: #939393;
+    font-size: 28rpx;
+}
+
+.group-details-btn {
+    position: absolute;
+    bottom: 0;
+    display: flex;
+    width: 100%;
+    height: 102rpx;
+}
+
+.left-btn {
+    width: 35%;
+    height: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    background: #F0F1F5;
+}
+
+.right-btn {
+    width: 65%;
+}
+
+.right-btn image{
+    position: absolute;
+    right: 0;
+    top: 0;
+    width: 65%;
+    height: 100%;
+}
+
+.right-btn text{
+    position: absolute;
+    width: 65%;
+    color: #fff;
+    text-align: center;
+    line-height: 102rpx;
+}

+ 66 - 30
pages/index/index.js

@@ -1,28 +1,39 @@
 //index.js
 //获取应用实例
+import {
+  getOpenidSessionKey
+} from '../../utils/httpUtil';
 const app = getApp()
-import { groupInit } from '../../component/group/group';
-import { hotInit } from '../../component/hot/hot';
-import { myInit } from '../../component/my/my';
-import { followInit } from '../../component/follow/follow';
+
+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/APIRequest';
-// import httputil from '../../utils/httputil';
+import httputil from '../../utils/httpUtil';
 Page({
   data: {
-    tab:[
-      {
+    tab: [{
         name: '热团',
         templates: 'group',
-      }, 
+      },
       {
         name: '推荐',
         templates: 'hot',
-      },  
+      },
       {
         name: '关注',
         templates: 'follow',
-      },  
+      },
       {
         name: '我的',
         templates: 'my',
@@ -30,17 +41,29 @@ Page({
     ],
     myIndex: 1,
     templates: 'hot',
-    title:'index中的title',
+    title: 'index中的title',
     jurisdictionFlag: true,
-    hotInput:'12345',
-    mineSettingInfo:'528'
+    hotInput: '12345',
+    mineSettingInfo: '528',
+    hide: true
+  },
+  jurisdiction: function () {
+    console.log(1)
+    //隐藏弹框
+    this.setData({
+      hide: !this.data.hide
+    })
+    //登录页信息
+    this.onShow();
   },
   //tab点击
-  switcher: function({currentTarget}) {
+  switcher: function ({
+    currentTarget
+  }) {
     this.updateData(currentTarget.dataset.index);
   },
   // 根据index 更新template
-  updateData:function(index){
+  updateData: function (index) {
     let myIndex = index;
     let templates = this.data.tab[myIndex].templates;
     this.setData({
@@ -62,25 +85,38 @@ Page({
     }
   },
   onLoad: function (options) {
-    if(options.index) {
+    if (options.index) {
       this.updateData(options.index)
     }
     hotInit(this)
-    this.init();
+    // this.init();
+
+  },
+  onShow: function () {
+    // this.init();
+    getOpenidSessionKey((res) => {
+      console.log(res);
+    }, (error) => {
+      // console.log(error)
+      this.setData({
+        hide: !this.data.hide
+      })
+    });
   },
   //初始化数据
   init: function () {
-    // httputil.getOpenidSessionKey((res) => {
-    //   console.log('微信的用户信息', res);
-    //   this.setData({
-    //     jurisdictionFlag: true
-    //   })
-    //   lookInit(this);
-    // },(error) => {
-    //   console.log(error);
-    //   this.setData({
-    //     jurisdictionFlag: false
-    //   })
-    // });
+    httputil.getOpenidSessionKey((res) => {
+      console.log('微信的用户信息', res);
+      // this.setData({
+      //   jurisdictionFlag: true
+      // })
+      // lookInit(this);
+    }, (error) => {
+      console.log(error);
+      this.jurisdiction()
+      // this.setData({
+      //   jurisdictionFlag: false
+      // })
+    });
   }
-})
+})

+ 5 - 1
pages/index/index.json

@@ -1 +1,5 @@
-{}
+{
+    "usingComponents": {
+        "Dialog": "../../component/dialog/dialog"
+    }
+  }

+ 3 - 0
pages/index/index.wxml

@@ -24,4 +24,7 @@
   <view class="template" wx:else="{{templates == 'my'}}">
     <template is="{{templates}}" data="{{myData: myData}}"></template>
   </view> -->
+</view>
+<view hidden="{{hide}}">
+    <Dialog bindmyevent="jurisdiction" />
 </view>

+ 29 - 1
pages/main/books/books.js

@@ -1,7 +1,35 @@
+import httpRequestApi from '../../../utils/APIClient';
 Page({
-    onLoad:function(options){
+    data: {
+        allBooks: []
+    },
+    onLoad: function (options) {
         wx.setNavigationBarTitle({
             title: '全部课本'
+        })
+        httpRequestApi.getAllBooks(1, 1, 10).success((res) => {
+            const books = res.data.data.list;
+            const booksTemp = [];
+            books.forEach(item => {
+                let temp = {};
+                temp.id = item.id;
+                temp.iconImg = item.iconImg;
+                temp.title = item.title.substring(0,5);
+                booksTemp.push(temp);
+            });
+            this.setData({
+                allBooks: booksTemp
+            })
+            console.log(this.data.allBooks)
+        });
+    },
+    goToBook: function(e){
+        console.log(e.currentTarget.dataset)
+        let id = e.currentTarget.dataset.id;
+        let title = e.currentTarget.dataset.title;
+
+        wx.navigateTo({
+            url: `../singleBook/singleBook?id=${id}&title=${title}`
           })
     }
 })

+ 5 - 2
pages/main/books/books.wxml

@@ -1,3 +1,6 @@
-<view >
-    全部书籍
+<view class = 'allBooks' >
+    <view class="book" wx:for="{{allBooks}}" wx:key="{{index}}" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToBook">
+        <image src="{{item.iconImg}}" />
+        <text >{{item.title}}</text>
+    </view>
 </view>

+ 27 - 0
pages/main/books/books.wxss

@@ -0,0 +1,27 @@
+.allBooks {
+    margin-top: 44rpx;
+    display: flex;
+    flex-direction: row;
+}
+.book{
+    width: 214rpx;
+    display: flex;
+    text-align: center;
+    flex-direction: column;
+    margin-left: 28rpx;
+}
+.book image{
+    display: block;
+    width: 214rpx;
+    height: 190rpx;
+}
+.book text{
+    margin-top: 20rpx;
+    width: 214rpx;
+    height: 38rpx;
+    font-size: 28rpx;
+    color:#373737;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    white-space: nowrap;
+}

+ 49 - 26
pages/main/class/class.js

@@ -1,90 +1,113 @@
+import httpRequestApi from '../../../utils/APIClient';
 Page({
   data: {
     fullScreenBtn: false,
     playBtn: false,
     gesture: true,
-    works:[
-      {
+    videoUrl: '',
+    title: '',
+    poster: '',
+    works: [{
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '1123'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
       {
         nickName: '萝莉小猫咪',
         time: '10-18 09:56',
         avatar: '../../../static/image/timg.jpg',
-        likes: '12332'
+        likes: '1123',
+        uid: '1'
       },
 
+
+
     ]
   },
   onLoad: function (option) {
-    if(option.title){
-      wx.setNavigationBarTitle({
-        title: option.title//页面标题为路由参数
-      })
-      this.setData({
-        title: option.title,
-        id: option.id
-      })
-    }
+    console.log(option);
+    wx.setNavigationBarTitle({
+      title: option.title //页面标题为路由参数
+    })
+    this.setData({
+      title: option.title,
+      id: option.id
+    })
+    let uid = 1;
+
+    httpRequestApi.getClassDetail(uid, option.id).success(res => {
+        console.log(res);
+        this.setData({
+          title: res.data.data.title,
+          videoUrl:res.data.data.playUrl
+        })
+    })
   },
 
-  goToReading: function(){
+  goToReading: function () {
     let id = this.data.id;
     let title = this.data.title;
     wx.navigateTo({
-      url: `../../main/reading/reading?id=${id}&title=${'战狼撤侨归来'}`
+      url: `../../main/reading/reading?id=${id}&title=${this.data.title}&img=${this.data.img}`
     })
   },
-  goToWorks: function(){
-    // let id = this.data.id;
-    // let title = this.data.title;
+  goToWorks: function (e) {
+    console.log(e);
+    let readId = e.target.dataset.uid;
+    let title = this.data.title;
     wx.navigateTo({
-      url: `../../social/works/works`
+      url: `../../social/works/works?id=${readId}&tilte=${title}`
     })
   }
 })

+ 2 - 2
pages/main/class/class.wxml

@@ -1,11 +1,11 @@
 <view class="classPage">
-    <video class="videoSection" src="https://efunvideo.ai160.com/vs2m/001/00103075/00103075012/00103075012.m3u8" controls show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
+    <video class="videoSection" src="{{videoUrl}}" controls show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
     <view class="readWorksSection">
         <view class="peopleNum">
             <image class="peoplesIcon" src="../../../static/image/peoples.png" />
             <view class="title">共有12345人完成了录音</view>
         </view>
-        <view class="workCard" wx:for="{{works}}" wx:key="{{index}}" bindtap="goToWorks">
+        <view class="workCard" wx:for="{{works}}" wx:key="{{index}}" bindtap="goToWorks" data-uid="{{item.uid}}">
             <image class="avatar" src="{{item.avatar}}" />
             <view class="name">
                 <text class="nickName">{{item.nickName}}</text>

File diff suppressed because it is too large
+ 53 - 32
pages/main/reading/reading.js


+ 1 - 2
pages/main/reading/reading.wxml

@@ -10,7 +10,6 @@
   enable-progress-gesture="{{gesture}}"
   bindwaiting="{{videoWaiting}}"
   bindended="{{videoCtr}}"
-  bindplay="{{videoPlay}}"
   ></video>
 
   <!-- <audio name="123" author="123" src="{{recordSource}}" id="myAudio" controls loop></audio> -->
@@ -29,7 +28,7 @@
             <image class="microphone" src="{{recordFlag === 1 ? recordingGif :microphonePng}}" />
             <text>我要朗读</text>
         </view>
-        <view class="shareBtn footerBtn" wx:if="{{btnFlag}}">
+        <view class="shareBtn footerBtn" wx:if="{{btnFlag}}" bindtap="upload">
             <image src="../../../static/image/upload.png" />
             <text>上传</text>
         </view>

+ 73 - 0
pages/main/searchResult/searchResult.js

@@ -0,0 +1,73 @@
+import httpRequestApi from '../../../utils/APIClient';
+Page({
+  data: {
+    wareCards:[
+        {
+          title:"铺满色巴掌的水泥道1",
+          grade:"一年级 上学期",
+          img: "../../../static/image/timg.jpg",
+          plays: "1",
+          likes: "2",
+          classId: "1001"
+        },
+        {
+          title:"铺满金色巴掌的水泥道2",
+          grade:"一年级 上学期",
+          img: "../../../static/image/timg.jpg",
+          plays: "12345",
+          likes: "54321",
+          classId: "1002"
+        },
+        {
+          title:"铺满金色巴掌的水泥道3",
+          grade:"一年级 上学期",
+          img: "../../../static/image/timg.jpg",
+          plays: "12345",
+          likes: "54321",
+          classId: "1003"
+        },
+      ]
+  },
+  onLoad: function (option) {
+    console.log(option);
+    wx.setNavigationBarTitle({
+      title: '搜索' //页面标题为路由参数
+    })
+    console.log(option.keyWords)
+    this.search(option.keyWords);
+    // httpRequestApi.getClassDetail(uid, option.id).success(res => {
+    //     console.log(res);
+    //     this.setData({
+    //       title: res.data.data.title,
+    //       videoUrl:res.data.data.playUrl
+    //     })
+    // })
+  },
+  search: function(key){
+    httpRequestApi.getSearchResult(1,key,1,10).success(res =>{
+        console.log(res);
+        const result = res.data.data.list;
+        const resultTemp = [];
+        result.forEach(item => {
+            console.log(item)
+            const temp = {};
+            temp.title = item.lesson.title;
+            temp.grade = item.lesson.gradeClassify;
+            temp.img = item.lesson.iconImg;
+            temp.classId = item.lesson.id
+            resultTemp .push(temp);
+        });
+        this.setData({
+            wareCards: resultTemp
+        })
+        console.log(this.data.wareCards)
+    });
+  },
+  openClass: (e) =>{
+    let id = e.currentTarget.dataset.classid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../class/class?id=${id}&title=${title}`
+    })
+  }
+})

pages/discount-group/discount-group.json → pages/main/searchResult/searchResult.json


+ 9 - 0
pages/main/searchResult/searchResult.wxml

@@ -0,0 +1,9 @@
+<view class="hotWares" style="flex-direction:row;">
+            <view wx:for="{{wareCards}}" wx:key="{{index}}" class="hotWareCard" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
+                <image class="wareCardImg" src="{{item.img}}" />
+                <text class="wareCardTitle">{{item.title}}</text>
+                <view class="bottomData">
+                    <text class="wareCardTip">{{item.grade}}</text>
+                </view>
+            </view>
+        </view>

+ 52 - 0
pages/main/searchResult/searchResult.wxss

@@ -0,0 +1,52 @@
+.hotWares .hotWareCard {
+    position: relative;
+    overflow: hidden;
+    width: 704rpx;
+    height: 402rpx;
+    margin: 0 auto 20rpx;
+}
+.hotWareCard .wareCardImg {
+    width: 100%;
+    height: 290rpx;
+    border-radius: 20rpx;
+}
+
+
+
+.hotWareCard .wareCardTitle {
+    /* margin: 0 auto; */
+    width: 100%;
+    height: 46rpx;
+    display: block;
+    /* text-align: left; */
+    color: #414141;
+    font-size: 32rpx;
+    letter-spacing: 4rpx;
+    font-family: MicrosoftYaHei;
+}
+.hotWareCard .bottomData {
+    height: 34rpx;
+    margin-top: 10rpx;
+    display: flex;
+    /* flex-direction: row; */
+    justify-content: space-between;
+    align-items: center;
+}
+
+.hotWareCard .bottomData .wareCardPlays {
+    width: 100rpx;
+    margin-left: 270rpx;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+}
+
+.hotWareCard .wareCardTip {
+
+    width: 178rpx;
+    height: 40rpx;
+    display: block;
+    text-align: center;
+    color: #414141;
+    font-size: 24rpx;
+}

+ 43 - 0
pages/main/singleBook/singleBook.js

@@ -0,0 +1,43 @@
+import httpRequestApi from '../../../utils/APIClient';
+Page({
+    data: {
+        titleIcon: '',
+        title: '',
+        bookInfo: '',
+        lessonList: []
+    },
+    onLoad: function (options) {
+        wx.setNavigationBarTitle({
+            title: options.title
+        })
+        httpRequestApi.getBookDetail(1, options.id).success((res) => {
+            console.log(res.data.data)
+            const bookInfo = res.data.data.product;
+            const lessonList = res.data.data.lessonList;
+            this.setData({
+                titleIcon: bookInfo.iconImg,
+                title: bookInfo.title,
+                bookInfo: bookInfo.description
+            })
+            const lessonTemp = [];
+            lessonList.forEach(item => {
+                const temp = {};
+                temp.id = item.id;
+                temp.title = item.title;
+                temp.readNum = item.readCount;
+                lessonTemp.push(temp);
+            });
+            this.setData({
+                lessonList: lessonTemp
+            });
+            console.log(this.data.lessonList)
+        });
+    },
+    goToClass: function(e){
+        let id = e.currentTarget.dataset.id;
+        let title = e.currentTarget.dataset.title;
+        wx.navigateTo({
+            url: `../class/class?id=${id}&title=${title}`
+          })
+    }
+})

pages/discount-group/discount-group.json → pages/main/singleBook/singleBook.json


+ 22 - 0
pages/main/singleBook/singleBook.wxml

@@ -0,0 +1,22 @@
+<view class="bookDetail">
+    <view class="headSection">
+        <image class="titleIcon" src="{{titleIcon}}" />
+        <text class="bookName">{{title}}</text>
+        <text class="bookInfo">{{bookInfo}}</text>
+    </view>
+    <view class="dirTag">
+        <!-- <image src="" /> -->
+    </view>
+    <view class="listSection">
+        <view class="classItem" wx:for="{{lessonList}}" wx:key="{{index}}" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToClass">
+            <text class="classTitle">{{item.title}}</text>
+            <text class="readingNum">{{item.readingNum}}朗读 ></text>
+        </view>
+    </view>
+    <view class="footerSection">
+        <view class="footerBuy">
+            <text class="buyPrice"></text>
+            <text class="buyProduct"></text>
+        </view>
+    </view>
+</view>

+ 62 - 0
pages/main/singleBook/singleBook.wxss

@@ -0,0 +1,62 @@
+.bookDetail{
+    font-size: 32rpx;
+    color: #414141;
+    background: #f0f1f5;
+}
+.headSection{
+    padding-top: 18rpx;
+    width: 100%;
+    background: #fff;
+}
+.headSection .titleIcon{
+    display: block;
+    width: 704rpx;
+    height: 190rpx;
+    margin: 0 auto;
+    background: #fff;
+}
+.headSection .bookName{
+    width: 700rpx;
+    height: 42rpx;
+    line-height: 42rpx;
+    margin: 10rpx 0 12rpx 20rpx;
+}
+.headSection .bookInfo{
+    width: 700rpx;
+    height: auto;
+}
+.dirTag{
+    width: 100%;
+    height: 100rpx;
+    margin-top: 12rpx;
+    background: #fff;
+}
+.listSection{
+    width: 100%;
+    margin-top: 12rpx;
+}
+.listSection .classItem{
+    width: 716rpx;
+    height: 88rpx;
+    margin: 0 auto 8rpx;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    background: #fff;
+    border-radius: 14rpx;
+}
+.classItem .classTitle{
+    width: auto;
+    height: 88rpx;
+    font-size: 32rpx;
+    margin-left: 40rpx;
+    line-height: 88rpx;
+}
+.classItem .readingNum{
+    width: auto;
+    height: 88rpx;
+    line-height: 88rpx;
+    margin-right: 40rpx;
+    color: #939393;
+    font-size: 28rpx;
+}

+ 89 - 0
pages/social/replyDetail/replyDetail.js

@@ -0,0 +1,89 @@
+import httpRequestApi from '../../../utils/APIClient';
+Page({
+    data: {
+        class1: 'commentItem commentItemFirst',
+        classNormal: 'commentItem',
+        comment:[
+            {
+                name: '阿尔萨斯',
+                text: '总有一天我将死去而你我儿子啊将加冕为王加冕为王加冕为王加冕为王加冕为王加冕为王加冕为王',
+                time: '10-18 09:56',
+                likes: '165',
+                avatar: '../../../static/image/timg.jpg'
+            },
+            {
+                name: '古尔丹',
+                text: '你读的是个求',
+                time: '10-18 09:56',
+                likes: '165',
+                avatar: '../../../static/image/timg.jpg'
+            },
+            {
+                name: '阿尔萨斯',
+                text: '圣光将照耀我',
+                time: '10-18 09:56',
+                likes: '165',
+                avatar: '../../../static/image/timg.jpg'
+            },
+        ]
+        
+    },
+    onLoad: function (option) {
+        console.log(option)
+
+        wx.setNavigationBarTitle({
+            title: option.num + '条回复'//页面标题为路由参数
+        })
+
+
+    },
+    goToReading: function () {
+        let id = this.data.id;
+        let title = this.data.title;
+        wx.navigateTo({
+            url: `../../main/reading/reading?id=${id}&title=${title}`
+        })
+    },
+    onShareAppMessage: function (res) {
+        if (res.from === 'button') {
+            // 来自页面内转发按钮
+            console.log(res.target)
+        }
+        return {
+            title: '测试',
+            path: '/pages/social/works/works'
+        }
+    },
+    follow: function () {
+        let uid = 1;
+        let followUid = 2;
+        httpRequestApi.followUser(uid, followUid).success((res) => {
+            console.log(res)
+        });
+    },
+    // 去其他用户的作品页
+    goToOthers: function (e) {
+        wx.navigateTo({
+            url: `../../main/reading/reading?id=${id}&title=${title}`
+        })
+    },
+    // 查询回复
+    getReply: function () {
+        let uid = 1;
+        let columnId = 1001;
+        let pageNo = 1;
+        let pageSize = 10;
+        httpRequestApi.getReply(uid, columnId, pageNo, pageSize).success((res) => {
+            console.log(res);
+        });
+    },
+    // 打开回复详情页
+    goToDetail: function (e) {
+        let id = e.currentTarget.dataset.id;
+        let num = e.currentTarget.dataset.num;
+        console.log(e);
+        wx.navigateTo({
+            url: `../../social/replyDetail/replyDetail?id=${id}&num=${num}`
+        })
+    }
+})

pages/discount-group/discount-group.json → pages/social/replyDetail/replyDetail.json


+ 16 - 0
pages/social/replyDetail/replyDetail.wxml

@@ -0,0 +1,16 @@
+ <view class="commentArea">
+        <view class="{{index === 0? class1 : classNormal}}" wx:for="{{comment}}" wx:key="{{index}}" >
+            <image class="avatar" src="{{item.avatar}}" />
+            <view class="commentCore">
+                <text class="nickName">{{item.name}}</text>
+                <text class="time">{{item.time}}</text>
+                <text class="gut">{{item.text}}</text>
+            </view>
+            <view class="btnWrapper">
+                <image class="commentBtn" src="../../../static/image/comment.png" wx:if="{{index===0}}" />
+                <text class="commentText" wx:if="{{index===0}}">评论</text>
+                <image class="likeBtn" src="../../../static/image/like.png" />
+                <text class="likeText">{{item.likes}}</text>
+            </view>
+        </view>
+    </view>

+ 90 - 0
pages/social/replyDetail/replyDetail.wxss

@@ -0,0 +1,90 @@
+.commentArea {
+    width: 100%;
+}
+
+.commentArea .commentItem {
+    width: 100%;
+    padding: 0 0 0 23rpx;
+    height: 100%;
+    border-bottom: solid 2rpx #979797;
+    /* margin: 0 auto 10; */
+    display: flex;
+    position: relative;
+    background: #f0f1f5;
+}
+.commentArea  .commentItemFirst{
+    background: #fff;
+    border-bottom: none;
+    min-height: 200rpx;
+}
+.commentItem .commentCore {
+    margin-left: 14rpx;
+    width: 600rpx;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+}
+
+.commentItem .avatar {
+    border-radius: 50%;
+    width: 96rpx;
+    height: 96rpx;
+    margin-top: 18rpx;
+}
+
+.commentItem .nickName {
+    margin-top: 18rpx;
+    height: 44rpx;
+    font-size: 32rpx;
+    color: #000;
+    font-family: PingFangSC-Regular;
+}
+
+.commentItem .time {
+    width: 200rpx;
+    height: 44rpx;
+    font-size: 32rpx;
+    color: #686868;
+}
+
+.commentItem .gut {
+    margin-top: 12rpx;
+    width: 420rpx;
+    /* height: 44rpx; */
+    line-height: 44rpx;
+    font-size: 32rpx;
+    color: #000;
+    /* overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap; */
+}
+
+.commentItem .btnWrapper {
+    position: absolute;
+    top: 10rpx;
+    right: 30rpx;
+    display: flex;
+    align-items: center;
+}
+
+.btnWrapper .commentBtn {
+    width: 32rpx;
+    height: 30rpx;
+    margin-left: 8rpx;
+}
+
+.btnWrapper .commentText,
+.likeText {
+    width: 58rpx;
+    height: 40rpx;
+    color: #545454;
+    font-size: 28rpx;
+    line-height: 40rpx;
+    margin-left: 8rpx;
+}
+
+.btnWrapper .likeBtn {
+    width: 32rpx;
+    height: 28rpx;
+    margin-left: 8rpx;
+}

+ 70 - 6
pages/social/works/works.js

@@ -53,9 +53,11 @@ Page({
                 image: '../../../static/image/timg.jpg',
             }
         ],
+        inputValue: 'smdx',
         text: '总有一天我将实质性操作死去而你我的\xa0\xa0\xa0\xa0\xa0\xa0\xa0儿子自行车在啊实打实大苏打撒旦将加冕为王'
     },
     onLoad: function (option) {
+        console.log(option)
         if (option.title) {
             wx.setNavigationBarTitle({
                 title: option.title //页面标题为路由参数
@@ -66,8 +68,9 @@ Page({
             })
         }
         let uid = 1;
-        httpRequestApi.getWorksDetail(uid,option.id).success((res)=>{
+        httpRequestApi.getWorksDetail(uid, option.id).success((res) => {
             console.log(res);
+            this.getReply();
         });
     },
     goToReading: function () {
@@ -79,12 +82,73 @@ Page({
     },
     onShareAppMessage: function (res) {
         if (res.from === 'button') {
-          // 来自页面内转发按钮
-          console.log(res.target)
+            // 来自页面内转发按钮
+            console.log(res.target)
         }
         return {
-          title: '测试',
-          path: '/pages/social/works/works'
+            title: '测试',
+            path: '/pages/social/works/works'
         }
-      }
+    },
+    follow: function () {
+        let uid = 1;
+        let followUid = 2;
+        httpRequestApi.followUser(uid, followUid).success((res) => {
+            console.log(res)
+        });
+    },
+    // 去其他用户的作品页
+    goToOthers: function (e) {
+        wx.navigateTo({
+            url: `../../main/reading/reading?id=${id}&title=${title}`
+        })
+    },
+    // 查询回复
+    getReply: function () {
+        let uid = 1;
+        let columnId = 1001;
+        let pageNo = 1;
+        let pageSize = 10;
+        httpRequestApi.getReply(uid, columnId, pageNo, pageSize).success((res) => {
+            console.log(res);
+        });
+    },
+    // 打开回复详情页
+    goToDetail: function (e) {
+        let id = e.currentTarget.dataset.id;
+        let num = e.currentTarget.dataset.num;
+        console.log(e);
+        wx.navigateTo({
+            url: `../../social/replyDetail/replyDetail?id=${id}&num=${num}`
+        })
+    },
+    //  绑定输入框内容
+    inputValue: function (e) {
+        this.setData({
+            inputValue: e.detail.value
+        });
+    },
+    // 发布回复
+    sendHandler: function () {
+        console.log(this.data.inputValue);
+        if (this.data.inputValue !== '') {
+            // let uid = 1;
+            // let data = {
+            //     "postId": 1,
+            //     "content": this.data.inputValue
+            // }
+            // httpRequestApi.postReplyComment(uid, data).success(res => {
+            //     console.log(res);
+            // });
+            let uid = 1;
+            let data = {
+                "columnId": '1541403885738293',
+                colunmNames: '金色巴掌',
+                "detailDesc": this.data.inputValue
+            }
+            httpRequestApi.postReply(uid, data).success(res => {
+                console.log(res);
+            });
+        }
+    }
 })

+ 5 - 5
pages/social/works/works.wxml

@@ -8,7 +8,7 @@
             <text class="likeBtn">点赞</text>
         </view>
         <view class="follow">
-            <text class="followBtn">关注</text>
+            <text class="followBtn" bindtap="follow">关注</text>
         </view>
     </view>
     <view class="userSection">
@@ -19,23 +19,23 @@
         <scroll-view scroll-x class="scrollWrapper" scroll-with-animation="true">
             <view class="avatarRow">
                 <view class="userItem" wx:for="{{user}}" wx:key="{{index}}">
-                    <image src="{{item.image}}" />
+                    <image src="{{item.image}}" bindtap="goToOthers" data-uid = "{{item.uid}}" />
                 </view>
             </view>
         </scroll-view>
     </view>
     <view class="commentSection">
         <view class="title">评论(38)</view>
-        <view class="commentInput">听了这么多,说点什么吧</view>
+        <input class="commentInput" bindconfirm="sendHandler" confirm-type="send" placeholder="听了这么多,说点什么吧" bindinput="inputValue"></input>
     </view>
     <view class="commentArea">
-        <view class="commentItem">
+        <view class="commentItem" >
             <image class="avatar" src="../../../static/image/timg.jpg" />
             <view class="commentCore">
                 <text class="nickName">阿尔萨斯</text>
                 <text class="time">10-18 09:56</text>
                 <text class="gut">{{text}}</text>
-                <view class="commentAll">共有123条评论</view>
+                <view class="commentAll" bindtap="goToDetail" data-id="1" data-num="8">共有123条评论</view>
             </view>
             <view class="btnWrapper">
                 <image class="commentBtn" src="../../../static/image/comment.png" />

+ 1 - 1
pages/social/works/works.wxss

@@ -178,7 +178,7 @@
 }
 
 .commentItem .time {
-    width: 180rpx;
+    width: 200rpx;
     height: 44rpx;
     font-size: 32rpx;
     color: #686868;

+ 15 - 3
project.config.json

@@ -36,7 +36,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 2,
+			"current": 4,
 			"list": [
 				{
 					"id": 0,
@@ -52,8 +52,20 @@
 				},
 				{
 					"id": -1,
-					"name": "concern",
-					"pathName": "pages/user/myconcern/myconcern"
+					"name": "团购详情",
+					"pathName": "pages/group-details/group-details",
+					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "课程详情",
+					"pathName": "pages/grade-details/grade-details",
+					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "团购",
+					"pathName": "pages/groupPage/collage-details/collage-details"
 				}
 			]
 		}

BIN
static/groupImg/Bitmap1.png


BIN
static/groupImg/Combined Shape.png


BIN
static/groupImg/Group 5 Copy 7.png


BIN
static/groupImg/Invitation.png


BIN
static/groupImg/Mask Copy@2x.png


BIN
static/groupImg/Preservation.png


BIN
static/groupImg/Rectangle 31@2x.png


BIN
static/groupImg/Rectangle 32@2x.png


BIN
static/groupImg/Rectangle 34@2x.png


BIN
static/groupImg/Rectangle 41.png


BIN
static/groupImg/Rectangle 8 Copy.png


BIN
static/groupImg/Rectangle 8 Copy@2x.png


BIN
static/groupImg/Rectangle 9.png


BIN
static/groupImg/circle.png


BIN
static/groupImg/code.png


BIN
static/groupImg/error.png


BIN
static/groupImg/liwu.png


BIN
static/groupImg/rule1.png


BIN
static/groupImg/rule2.png


BIN
static/groupImg/share.png


BIN
static/groupImg/step.png


BIN
static/groupImg/success.png


BIN
static/groupImg/weixin.png


BIN
static/groupImg/团长.png


+ 122 - 1
utils/APIClient.js

@@ -2,7 +2,7 @@ var constant = require('const.js');
 const HOST_PRODUCT = constant.productApi;
 const HOST_BASE = constant.baseApi;
 let request = require('WXHttpRequest.js');
-const httputil = require('httpUtill.js');
+const httputil = require('httpUtil.js');
 
 function getProductUrl(action) {
 	return HOST_PRODUCT + action;
@@ -36,5 +36,126 @@ module.exports = {
 		return request.getInstance().header({
 			uid
 		}).url(url).send();
+	},
+	// 获取全部课本
+	getAllBooks(uid,pageNo,pageSize) {
+		let url = getProductUrl('wx/product');
+		return request.getInstance().header({
+			uid
+		}).url(url).data({
+			pageNo,
+			pageSize
+		}).send();
+	},
+	// 获取课本详情
+	getBookDetail(uid,id) {
+		let url = getProductUrl(`wx/product/${id}`);
+		return request.getInstance().header({
+			uid
+		}).url(url).send();
+	},
+	// 获取单课详情
+	getClassDetail(uid,id) {
+		let url = getProductUrl(`wx/lesson/${id}`);
+		return request.getInstance().header({
+			uid
+		}).url(url).send();
+	},
+	// 发布作品
+	postWork(uid, data) {
+		console.log(data);
+		let url = getBaseUrl(`wx/userRead`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data(data).method('POST').send();
+	},
+	// 关注用户 
+	followUser(uid, followUid) {
+		let url = getBaseUrl(`wx/fans`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data({
+			"uid": followUid
+		}).method('POST').send();
+	},
+	//获取关注的用户列表
+	getFollowUsers(uid, pageNo, pageSize) {
+		let url = getBaseUrl(`wx/fans`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data({
+			pageNo: pageNo,
+			pageSize: pageSize
+		}).send();
+	},
+	// 获取关注用户的作品列表
+	getFollowWorks(uid, pageNo, pageSize) {
+		let url = getBaseUrl(`wx/fans/interest`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data({
+			pageNo: pageNo,
+			pageSize: pageSize
+		}).send();
+	},
+	// 搜索
+	getSearchResult(uid,key,pageNo,pageSize){
+		let url = getProductUrl(`wx/lesson`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data({
+			title:key,
+			productId: '',
+			pageNo: pageNo,
+			pageSize: pageSize
+		}).send();
+	},
+	// 获取回复信息
+	getReply(uid, columnId, pageNo, pageSize){
+		let url = getBaseUrl(`wx/posts/reply`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data({
+			columnId: columnId,
+			pageNo: pageNo,
+			pageSize: pageSize
+		}).send();
+	},
+	// 发布回复(楼中楼)
+	postReplyComment(uid, data){
+		let url = getBaseUrl(`wx/reply`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data(data).method('POST').send();
+	},
+	// 发布讨论
+	postReply(uid, data){
+		let url = getBaseUrl(`wx/posts`);
+		return request.getInstance().header({
+			uid
+		}).url(url).data(data).method('POST').send();
+	},
+	// 获取课程团购信息
+	getGroupPurchaseInfo (productId) {
+		let url = getBaseUrl(`wx/groupPurchaseInfo/info/${productId}`);
+		return request.getInstance().header({
+			uid: 1
+		}).url(url).send();
+	},
+	// 发起团购
+	SendGroupPurchas (data) {
+		let url = getBaseUrl(`wx/groupPurchase/create`);
+		return request.getInstance().header({
+			uid: 1
+		}).url(url).data(data).method('POST').send();
+	},
+	// 参加团购
+	JoinGroupPurchas (orderId) {
+		let url = getBaseUrl(`wx/groupPurchase/join`);
+		return request.getInstance().header({
+			uid: 1
+		}).url(url).data({
+			orderId
+		}).method('POST').send();
 	}
 }

+ 95 - 0
utils/httpUtil.js

@@ -0,0 +1,95 @@
+const request = require('./WXHttpRequest.js');
+const url = require('./const.js');
+const util = require('./util.js');
+
+const HOST = url.baseApi;
+
+
+function genAPIUrl(action) {
+	return HOST + action;
+}
+
+// 登录
+function wxLogin(successcallback, failcallback) {
+    wx.showToast({
+        title: '登录中...',
+        icon: 'loading',
+        duration: 1500
+    })
+    wx.login({  
+        success: function(res) {
+            if (res.code) {
+                // 获取openid
+                 let url = genAPIUrl('wx/user/openId')
+                 let data = { code: res.code }
+                 return request.getInstance().url(url).data(data).send().success(successcallback).fail(failcallback);
+            } else {
+                console.log('获取用户登录态失败!' + res.errMsg)
+            }
+        }
+    })
+}
+//登录
+function getLoginSchedule(sessionKey, openId, successcallback, failcallback) {
+    wx.getSetting({
+        success: function(res) {
+            // 已经授权,可以直接调用 getUserInfo 获取头像昵称
+            wx.getUserInfo({
+                withCredentials: true,
+                success: function (res) {
+                  let url = genAPIUrl('wx/user/loginRegist');
+                  const userData = {
+                      encryptedData: res.encryptedData,
+                      sessionKey: sessionKey,
+                      iv: res.iv
+                  }
+                  request.getInstance().url(url).header({
+                      "content-type": "application/x-www-form-urlencoded; charset=UTF-8"
+                  }).data(userData).method('POST').send().success(res => {
+                      wx.hideToast()
+                      wx.showToast({
+                          title: '登录成功',
+                          icon: 'success',
+                          duration: 1500
+                      })
+                      wx.setStorageSync('uid', res.data.data.data.uid)
+                      wx.setStorageSync('user', res)
+                      successcallback(res)
+                  });
+                },
+                fail: function(res) {
+                    failcallback(res)
+                }
+            })
+          } 
+      })
+}
+// 获取原来的 openid 和 session_key
+function getOpenidSessionKey(successcallback, failcallback) {
+    if (wx.getStorageSync('user')) {
+      successcallback(
+        wx.getStorageSync('user'),
+        //分享小程序按钮
+        wx.showShareMenu({
+          withShareTicket: true
+        })
+      );
+      return;
+    }
+    wxLogin(function(res) {
+      if(res.data.code == 200){
+        let sessionKey = res.data.data.session_key;
+        let openId = res.data.data.openid;
+        getLoginSchedule(sessionKey, openId, successcallback, failcallback);
+      }
+
+    },function(res) {
+        failcallback(res);
+    })    
+}
+
+
+
+module.exports = {
+    getOpenidSessionKey
+}

+ 0 - 61
utils/httpUtill.js

@@ -1,61 +0,0 @@
-const request = require('./WXHttpRequest.js');
-const url = require('./const.js');
-const util = require('./util.js');
-
-const HOST = url.apiUrlOnLine;
-
-
-function genAPIUrl(action) {
-	return HOST + action;
-}
-
-// 登录
-function wxLogin(successcallback, failcallback) {
-    wx.showToast({
-        title: '登录中...',
-        icon: 'loading',
-        duration: 1500
-    })
-    wx.login({  
-        success: function(res) {
-            if (res.code) {
-                // 获取openid
-                 let url = genAPIUrl('wx/openId')
-                 let data = { code: res.code }
-                 return request.getInstance().url(url).data(data).send().success(successcallback).fail(failcallback);
-            } else {
-                console.log('获取用户登录态失败!' + res.errMsg)
-            }
-        }
-    })
-}
-
-// 获取原来的 openid 和 session_key
-function getOpenidSessionKey(successcallback, failcallback) {
-    if (wx.getStorageSync('user')) {
-      successcallback(
-        wx.getStorageSync('user'),
-        //分享小程序按钮
-        wx.showShareMenu({
-          withShareTicket: true
-        })
-      );
-      return;
-    }
-    wxLogin(function(res) {
-      if(res.data.code == 200){
-        let sessionKey = res.data.data.session_key;
-        let openId = res.data.data.openid;
-        getLoginSchedule(sessionKey, openId, successcallback, failcallback);
-      }
-
-    },function(res) {
-        failcallback(res);
-    })    
-}
-
-//登录
-
-module.exports = {
-    getOpenidSessionKey
-}