Rorschach 5 år sedan
förälder
incheckning
9a6dde8474

+ 1 - 1
component/follow/follow.wxss

@@ -105,7 +105,7 @@
     text-align: left;
     color: #444;
     font-size: 24rpx;
-    line-height:40rpx;
+    line-height:44rpx;
 
 }
 

+ 18 - 42
component/group/group.js

@@ -18,25 +18,12 @@ export const groupInit = (that) => {
     groupIndex: 1
   })
   //推荐团购
-  that.recommend = function (pageNo) {
-    httpRequestApi.getGroupList(pageNo).success((res) => {
-      // that.data.groupData.listLength = res.data.data.length;
-      // that.data.groupData.recommendList = res.data.data.slice(start, end);
-      // that.setData({
-      //   groupData: that.data.groupData
-      // })
-      // that.data.groupData.recommendList.forEach( (item) => {
-      //   if(item.groupPurchaseOrder.closeTime - Date.parse(new Date()) < 0 ) {
-      //     that.data.groupData.timeList.push('时间到了,')
-      //   } else {
-      //     that.data.groupData.timeList.push(util.formatTime(item.groupPurchaseOrder.closeTime - Date.parse(new Date())).join(':'))
-      //   }
-      // })
-      // that.setData({
-      //   groupData: that.data.groupData
-      // })
+  that.recommend = function () {
+    console.log(that.data.listLength)
+    httpRequestApi.getGroupList(that.data.groupIndex).success((res) => {
+      
       const recommendListTemp = [];
-      res.data.data.forEach(item => {
+      res.data.data.list.forEach(item => {
         const temp = {};
         temp.avatar = item.organizer.avatar;
         temp.wechatName = item.organizer.wechatName;
@@ -53,7 +40,7 @@ export const groupInit = (that) => {
       that.setData({
         [recommendListStr]: recommendListTemp,
         // [recommendListThreeStr]: that.data.groupData.recommendList.slice(that.data.groupData.baseIndex, that.data.groupData.baseIndex + 3),
-        // listLength: res.data.data.length
+        listLength: res.data.data.totalNo
       })
     }).fail((error) => {
       console.log('错误', error)
@@ -77,32 +64,21 @@ export const groupInit = (that) => {
     })
   }();
 
-  that.recommend(1);
+  that.recommend();
 
   //点击换一换
   that.change = function () {
-    // that.data.groupData.baseIndex++;
-    // if(that.data.groupData.listLength <= 3 * (that.data.groupData.baseIndex)) {
-    //   that.data.groupData.baseIndex = 0;
-    // }
-    // that.setData({
-    //   groupData: that.data.groupData
-    // })
-    // that.recommend(3 * that.data.groupData.baseIndex, 3 * (that.data.groupData.baseIndex + 1));
-
-    // if (that.data.groupData.baseIndex / 3 >= that.data.listLength / 3) {
-    //   that.data.groupData.baseIndex = 0
-    // }
-    // const recommendListThreeStr = "groupData.recommendListThree";
-    // const baseIndexStr = "groupData.baseIndex";
-    // this.setData({
-    //   [recommendListThreeStr]: that.data.groupData.recommendList.slice(that.data.groupData.baseIndex + 3, that.data.groupData.baseIndex + 6),
-    //   [baseIndexStr]: that.data.groupData.baseIndex + 3
-    // })
-    // console.log(that.data.groupData.baseIndex / 3);
-    // console.log(that.data.listLength / 3);
-    // if(that.groupIndex )
-    that.recommend(that.data.groupIndex++)
+    that.data.groupIndex++
+    if (that.data.groupIndex >= that.data.listLength) {
+      that.setData({
+        groupIndex: 1
+      })
+    } else {
+      that.setData({
+        groupIndex: that.data.groupIndex
+      })
+    }
+    that.recommend(that.data.groupIndex)
   }
   //点击跳转
   that.more = function ({

+ 3 - 3
component/hot/hot.wxss

@@ -57,9 +57,9 @@ swiper {
     font-size: 32rpx;
     color: #41bb32;
     font-family: PingFangSC-regular;
-    width: 135rpx;
+    width: 166rpx;
     text-align: center;
-    margin-left: 56rpx;
+    margin-left: 20rpx;
     background:#F0F1F5;
     height: 56rpx;
     line-height: 56rpx;
@@ -486,7 +486,7 @@ height:28rpx;
     text-align: left;
     color: #444;
     font-size: 24rpx;
-    line-height: 40rpx;
+    line-height: 44rpx;
 
 }
 

+ 8 - 10
component/my/my.wxml

@@ -1,13 +1,11 @@
-<wxs src="../../pages/commonWxs/format.wxs" module="format" />
+<!-- <wxs src="../../pages/commonWxs/format.wxs" module="format" /> -->
 <template name="my">
   <view class='mine-container'>
     <view class='follow-details'>
       <view class='follow-info'>
         <view class='set-msg'>
-          <view class='avatar-bg'>
-            <view class='avatar-box'>
-              <image class='avatar-image' src='{{ myData.user.user.avatar }}'></image>
-            </view>
+          <view class='avatar-box'>
+            <image class='avatar-image' src='{{ myData.user.user.avatar }}'></image>
             <view class='occupation-title'>{{ myData.user.user.profession }}</view>
           </view>
           <view class='avatar-msg'>
@@ -19,9 +17,9 @@
               <view class='flowers-box' wx:elif='{{ myData.user.user.gender === 1 }}'>
                 <image src='../../static/image/boy.png'></image>
               </view>
-              <view wx:else class='gender-size'>未知</view>
+              <!-- <view wx:else class='gender-size'>未知</view> -->
             </view>
-            <view class='avatar-birthday'>{{ format.getBirthday(myData.user.user.birthday) }}</view>
+            <view class='avatar-birthday'>{{ myData.user.user.birthday }}</view>
             <view class='avatar-address'>{{ myData.user.user.schoolName }}</view>
           </view>
           <view class='mine-edit' bindtap='toMyEdit' data-title='{{ myData.title }}'>
@@ -34,7 +32,7 @@
       </view>
       <view class='mine-category'>
         <view class='play-count'>
-          <view>{{ myData.user.playAmount || 0 }}</view>
+          <view class='color' style="padding-right:38rpx;" >{{ myData.user.playAmount || 0 }}</view>
           <view class='border-right'>
             <view class='play-img'>
               <image src='../../static/image/play.png'></image>
@@ -43,7 +41,7 @@
           </view>
         </view>
         <view class='follow-count'>
-          <view class='color'>{{ myData.user.fansAmount || 0 }}</view>
+          <view class='color' style="padding-right:48rpx;">{{ myData.user.fansAmount || 0 }}</view>
           <view class='border-right'>
             <view class='red-heart'>
               <image src='../../static/image/fully_heart.png'></image>
@@ -52,7 +50,7 @@
           </view>
         </view>
         <view class='point-count'>
-          <view class='color'>{{ myData.user.likeAmount || 0 }}</view>
+          <view class='color' style="padding-right:60rpx;">{{ myData.user.likeAmount || 0 }}</view>
           <view class='border-right'>
             <view class='point-img'>
               <image src='../../static/image/point.png'></image>

+ 74 - 55
component/my/my.wxss

@@ -1,4 +1,4 @@
-.mine-container{
+.mine-container {
   width: 750rpx;
   height: 1136rpx;
   position: relative;
@@ -10,17 +10,17 @@
   box-sizing: border-box;
 }
 
-page{
+page {
   background: #F0F1F5;
 }
 
-.follow-details{
+.follow-details {
   width: 750rpx;
   box-sizing: border-box;
   padding: 0 15rpx;
 }
 
-.follow-info{
+.follow-info {
   margin-top: 20rpx;
   width: 100%;
   height: 382rpx;
@@ -29,7 +29,7 @@ page{
   display: flex;
 }
 
-.set-msg{
+.set-msg {
   width: 100%;
   height: 248rpx;
   display: flex;
@@ -37,7 +37,7 @@ page{
   justify-content: center;
 }
 
-.avatar-bg{
+.avatar-bg {
   margin-left: 20rpx;
   margin-top: 50rpx;
   width: 152rpx;
@@ -47,55 +47,59 @@ page{
   position: relative;
 }
 
-.avatar-box{
+.avatar-box {
   width: 138rpx;
   height: 138rpx;
   border-radius: 50%;
-  z-index: 300;
-  margin:6rpx auto;
+  margin: 50rpx 0;
+  position: relative;
 }
 
-.avatar-image{
+.avatar-image {
   width: 100%;
   height: 100%;
   border-radius: 50%;
+  border: 4rpx solid #61CA54;
 }
 
-.avatar-nickname{
+.avatar-nickname {
   width: 500rpx;
   display: flex;
 }
 
-.avatar-address{
+.avatar-address {
   width: 500rpx;
 }
 
-.flowers-box{
+.flowers-box {
   width: 26rpx;
   height: 26rpx;
   margin-left: 10rpx;
 }
 
-.flowers-box>image{
+.flowers-box>image {
   width: 100%;
   height: 100%;
 }
 
-.occupation-title{
+.occupation-title {
   position: absolute;
-  left: 100rpx;
-  top: 46rpx;
-  width: 68rpx;
+  left: 30rpx;
+  width: 90rpx;
   background: #61CA54;
   border-radius: 180rpx;
   z-index: 600;
-  line-height: 26rpx;
+  line-height: 32rpx;
   text-align: center;
   color: #FFFFFF;
-  font-size: 18rpx;
+  font-size: 20rpx;
+  bottom: -28rpx;
+  height: 32rpx;
+  border: 2rpx solid #fff;
+
 }
 
-.avatar-msg{
+.avatar-msg {
   margin-left: 40rpx;
   margin-top: 50rpx;
   width: 500rpx;
@@ -104,18 +108,20 @@ page{
   font-size: 32rpx;
 }
 
-.avatar-nickname,.avatar-birthday,.avatar-address{
+.avatar-nickname,
+.avatar-birthday,
+.avatar-address {
   line-height: 50rpx;
 }
 
-.gender-size{
+.gender-size {
   margin-left: 10rpx;
   font-size: 28rpx;
   align-self: center;
 }
 
 
-.mine-category{
+.mine-category {
   box-sizing: border-box;
   width: 674rpx;
   padding-top: 40rpx;
@@ -130,7 +136,7 @@ page{
   left: 38rpx;
 }
 
-.border-right{
+.border-right {
   display: flex;
   justify-content: center;
   align-items: center;
@@ -140,60 +146,69 @@ page{
   border-right: 2rpx solid #D6D6D6;
 }
 
-.flower-count .border-right{
+.flower-count .border-right {
   border: none;
 }
 
-.play-count,.point-count,.follow-count,.flower-count{
+.play-count,
+.point-count,
+.follow-count,
+.flower-count {
   width: 25%;
   text-align: center;
 }
 
-.play-img{
+.play-img {
   width: 28rpx;
   height: 26rpx;
   margin-right: 6rpx;
   margin-bottom: 6rpx;
 }
 
-.red-heart{
+.red-heart {
   width: 26rpx;
   height: 22rpx;
   margin-right: 6rpx;
   margin-bottom: 6rpx;
 }
 
-.point-img{
+.point-img {
   width: 28rpx;
   height: 24rpx;
   margin-right: 6rpx;
   margin-bottom: 6rpx;
 }
 
-image{
+image {
   width: 100%;
   height: 100%;
 }
 
-.play-count{
+.color {
+  text-align: right;
+  padding-right: 44rpx;
+
+}
+
+.play-count {
   color: #92D626;
 }
 
-.point-count{
+.point-count {
   color: #FFA700;
 }
 
-.follow-count{
+.follow-count {
   color: #FF0000;
 }
 
-.flower-count{
+.flower-count {
   color: #EE5750;
 }
 
 
 
-.mine-edit{
+.mine-edit {
   position: absolute;
   top: 72rpx;
   right: 36rpx;
@@ -202,7 +217,7 @@ image{
   border-radius: 26rpx;
   background: #FF9209;
   box-sizing: border-box;
-  align-items:center;
+  align-items: center;
   display: flex;
 }
 
@@ -213,17 +228,17 @@ image{
   margin-right: 10rpx;
 } */
 
-.edit-img{
-width:42rpx;
-height:34rpx;
-display:block;
-margin-left:20rpx;
-margin-right:10rpx;
+.edit-img {
+  width: 42rpx;
+  height: 34rpx;
+  display: block;
+  margin-left: 20rpx;
+  margin-right: 10rpx;
 
 
 }
 
-.edit-text{
+.edit-text {
   width: 150rpx;
   /* height: 32rpx; */
   color: #FFFFFF;
@@ -231,9 +246,9 @@ margin-right:10rpx;
   /* line-height:46rpx; */
 }
 
-.wallet-module{
+.wallet-module {
   margin-top: 30rpx;
-  width:716rpx;
+  width: 716rpx;
   height: 88rpx;
   font-size: 34rpx;
   color: #5E5E5E;
@@ -241,7 +256,7 @@ margin-right:10rpx;
   border-radius: 14rpx;
 }
 
-.wallet-center{
+.wallet-center {
   width: 680rpx;
   height: 88rpx;
   margin: 0 auto;
@@ -250,28 +265,32 @@ margin-right:10rpx;
   align-items: center;
 }
 
-.icon-box{
+.icon-box {
   width: 60rpx;
   height: 60rpx;
-  margin-right: 16rpx;  
-  margin-top:2rpx;
+  margin-right: 16rpx;
+  margin-top: 2rpx;
 
 }
 
-.wallet-left{
+.wallet-left {
   display: flex;
   align-items: center;
 }
 
-.wallet-right{
+.wallet-right {
   margin-bottom: 20rpx;
   width: 16rpx;
-  height: 28rpx;  
+  height: 28rpx;
 }
 
-.course-module,.group-module,.reading-module,.keep-module,.myfollow-module{
+.course-module,
+.group-module,
+.reading-module,
+.keep-module,
+.myfollow-module {
   margin-top: 20rpx;
-  width:716rpx;
+  width: 716rpx;
   height: 88rpx;
   font-size: 34rpx;
   color: #5E5E5E;

+ 8 - 2
pages/groupPage/collage-details/collage-details.js

@@ -104,8 +104,13 @@ Page({
       }
       //console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //时间转换
-      const timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
-      console.log(timeList)
+      let timeList = [];
+      const stillGoing = groupOrder.closeTime - Date.parse(new Date()) <= 0 ? false : true
+      if(stillGoing){
+        timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
+      }
+      // const timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
+      // console.log(timeList)
       //res.data.data.joinUserList.unshift(res.data.data.organizer);
       this.setData({
         groupPurchaseInfo: res.data.data.groupPurchaseInfo,
@@ -114,6 +119,7 @@ Page({
         joinUserList: res.data.data.joinUserList,
         surplusList: this.data.surplusList,
         timeList,
+        stillGoing,
         productId: groupOrder.productId,
         groupId: groupOrder.groupId,
         rewardMoney: res.data.data.groupPurchaseInfo.organizerPrice / 100

+ 6 - 10
pages/groupPage/collage-details/collage-details.wxml

@@ -12,7 +12,8 @@
         <view class="headImg">
             <block wx:for="{{joinUserList}}" wx:key="{{index}}">
                 <view class="headImg-item {{organizerUid == item.uid ? 'bg-boder' : ''}}">
-                    <image wx:if="{{organizerUid == item.uid}}" class="tuanzhangIcon" src="../../../static/groupImg/tuanzhangIcon.png"></image>
+                    <!-- <image wx:if="{{organizerUid == item.uid}}" class="tuanzhangIcon" src="../../../static/groupImg/tuanzhangIcon.png"></image> -->
+                    <view  wx:if="{{organizerUid == item.uid}}" class="organizerIcon">团长</view>
                     <image src="{{item.avatar}}"></image>
                 </view>
             </block>
@@ -24,31 +25,26 @@
         </view>
         <view class="shengyu">
             <view class="shengyu-num" wx:if="{{colonelName}}">团长{{colonelName}}发起团购</view>
-            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">还需邀请<text>{{surplusNum}}</text>名好友拼团成功</view>
-            <!--
-            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">即可获得一年级语文同步辅导(上学期)</view>
-            -->
+            <view class="shengyu-num" hidden="{{surplusNum == '0' || !stillGoing}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
+            <view class="shengyu-num" hidden="{{stillGoing}}">团购已超过时限</view>
             <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功!快去朗读吧</view>
-            <view class="shengyu-time" hidden="{{surplusNum == '0'}}" >
+            <view class="shengyu-time" hidden="{{!stillGoing}}">
                 剩余时间:
                 <view class="time">
-                    <!-- <image src="../../../static/groupImg/Rectangle_31.png"></image> -->
                     <text>{{timeList[0]}}</text>
                 </view>
                 <block wx:for="{{timeList[1]}}" wx:key="{{index}}">
                     <view class="time">
-                        <!-- <image src="../../../static/groupImg/Rectangle_31.png"></image> -->
                         <text>{{item}}</text>
                     </view>
                 </block>
                 <block wx:for="{{timeList[2]}}" wx:key="{{index}}">
                     <view class="time">
-                        <!-- <image src="../../../static/groupImg/Rectangle_31.png"></image> -->
                         <text>{{item}}</text>
                     </view>
-                </block>               
+                </block>                
             </view>
         </view>

+ 13 - 8
pages/groupPage/collage-details/collage-details.wxss

@@ -59,15 +59,20 @@
     border-radius: 50%;
 }
 
-.headImg-item .tuanzhangIcon {
+.headImg-item .organizerIcon {
     position: absolute;
-    right: -40rpx;
-    top: 20rpx;
-    width: 78rpx;
+    bottom: -15rpx;
+    width: 86rpx;
     height: 30rpx;
     background: #61ca54;
-border-radius:20rpx;
-
+    border-radius: 20rpx;
+    border: 2rpx solid rgba(255, 255, 255, 1);
+    font-size: 20rpx;
+    font-family: PingFangSC-Medium;
+    font-weight: 500;
+    color: rgba(255, 255, 255, 1);
+    left: 8rpx;
+    text-align: center;
 }
 
 .bg-boder {
@@ -148,8 +153,8 @@ border-radius:20rpx;
     line-height: 80rpx;
     z-index: 2;
     color: #fff;
-    background:#ff9209;
-border-radius:56rpx;
+    background: #ff9209;
+    border-radius: 56rpx;
 
 }
 

+ 1 - 1
pages/groupPage/grade-details/grade-details.wxss

@@ -147,7 +147,7 @@ scroll-view {
 .group-btn .bg1,
 .group-btn .bg2 {
     position: absolute;
-    top: 10rpx;
+    top: 14rpx;
     width: 4rpx;
     height: 70%;
 }

+ 26 - 63
pages/groupPage/group-details/group-details.js

@@ -35,7 +35,8 @@ Page({
     selectFlag: [],
     flag: true,
     colonelName: '',
-    article: ''
+    article: '',
+    alertFlag: false
   },
   //tab切换
   tabSwitch: function () {
@@ -92,6 +93,10 @@ Page({
   },
   //参团
   jionGroup: function () {
+    if(app.globalData.isIOS){
+      this.showAlert();
+      return;
+    }
     const orderId = this.data.orderId;
     //开始发起团购
     httpRequestApi.JoinGroupPurchas(orderId).success((res) => {
@@ -116,7 +121,11 @@ Page({
 
     })
   },
-
+  showAlert: function(){
+    this.setData({
+      alertFlag: !this.data.alertFlag
+    })
+  },
   //支付
   prePayMap: function (prePayMap, type) {
     console.log(prePayMap)
@@ -165,13 +174,8 @@ Page({
       if (this.data.article === '') {
         this.getBooksInfo(res.data.data.groupPurchaseOrder.productId)
       }
-      // 分享进来的并且团购失效 就跳转到详情页面
-      if(this.data.goBackHome && (surplusNum ===0 || !stillGoing) ){
-        console.log(' productID>>>>>>>>>>>>>>>>'+ res.data.data.groupPurchaseOrder.productId)
-        wx.navigateTo({
-          url: `/pages/groupPage/grade-details/grade-details?productId=${res.data.data.groupPurchaseOrder.productId}`
-        })
-      }
+ 
+     
       this.setData({
         organizer: groupOrder.organizer,
       })
@@ -192,17 +196,18 @@ Page({
           this.data.surplusList.push(1);
         }
       }
-
-      console.log(groupOrder.closeTime - groupOrder.gmtModified)
-      //时间转换
-  
-      // const timeList = util.formatTime(groupOrder.closeTime - groupOrder.gmtModified);
       let timeList = [];
       const stillGoing = groupOrder.closeTime - Date.parse(new Date()) <= 0 ? false : true
       if(stillGoing){
         timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
       }
-      console.log(stillGoing)
+      // 分享进来的并且团购失效 就跳转到详情页面
+      // if(this.data.goBackHome && (surplusNum ===0 || !stillGoing) ){
+      //   console.log(' productID>>>>>>>>>>>>>>>>'+ res.data.data.groupPurchaseOrder.productId)
+      //   wx.navigateTo({
+      //     url: `/pages/groupPage/grade-details/grade-details?productId=${res.data.data.groupPurchaseOrder.productId}`
+      //   })
+      // }
       this.setData({
         surplusNum,
         joinUserList: res.data.data.joinUserList,
@@ -325,12 +330,12 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    if (app.globalData.isIOS) {
-      wx.redirectTo({
-        url: '../../index/index'
-      })
-      return
-    }
+    // if (app.globalData.isIOS) {
+    //   wx.redirectTo({
+    //     url: '../../index/index'
+    //   })
+    //   return
+    // }
     getOpenidSessionKey((res) => {}, (error) => {
       this.setData({
         hide: !this.data.hide
@@ -416,47 +421,5 @@ Page({
    */
   onReady: function () {
     this.popup = this.selectComponent("#popupup");
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
   }
 })

+ 3 - 2
pages/groupPage/group-details/group-details.json

@@ -3,6 +3,7 @@
     "usingComponents": {
         "popup": "/component/popup/popup",
         "Dialog": "/component/dialog/dialog",
-        "goBackHome": "/component/goBackHome/goBackHome"
-    }  
+        "goBackHome": "/component/goBackHome/goBackHome",
+        "myToast": "/component/myToast/myToast"
+    }
 }

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

@@ -111,4 +111,5 @@
  <goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />
 <view hidden="{{hide}}">
   <Dialog bindmyevent="jurisdiction" />
-</view>
+</view>
+<myToast bindShowAlert="showAlert" wx:if="{{alertFlag}}" />

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

@@ -96,7 +96,7 @@ height:104rpx;
     position: absolute;
     left: 4rpx;
     top: 0;
-    z-index: 2;
+    /* z-index: 2; */
     color: #fff;
     font-size: 28rpx;
     width: 32rpx;

+ 6 - 12
pages/index/index.js

@@ -3,6 +3,8 @@
 import {
   getOpenidSessionKey
 } from '../../utils/httpUtil';
+import {formatDate} from '../../utils/util';
+
 const app = getApp()
 
 import {
@@ -105,16 +107,6 @@ Page({
   onLoad: function (options) {
 
     this.uid = wx.getStorageSync('uid');
-    // const type = GetQueryString(decodeURIComponent(options.scene),"type");
-    // const sceneId = GetQueryString( decodeURIComponent(options.scene),"id");
-    // console.log(type,sceneId)
-    // switch(type){
-    //   case "works":
-    //   wx.navigateTo({
-    //     url: `../social/works/works?id=${sceneId}&title="测试"`
-    //   })
-    //   break
-    // };
     wx.getSystemInfo({
       success: (res) => {
         this.setData({
@@ -156,12 +148,14 @@ Page({
   },
   // 获取用户信息
   getUserWorksInfo: function () {
+    console.log(wx.getStorageSync('user'));
     httpRequestApi.getUserWorksInfo().success(res => {
       this.data.myData.user = res.data.data; //直接赋值 给 myData的user对象。
+      this.data.myData.user.user.birthday =formatDate(res.data.data.user.birthday,4);
+      console.log(formatDate(res.data.data.user.birthday,1))
+      console.log(this.data.myData.user.birthday)
       this.setData({
         myData: this.data.myData,
-      },() => {
-        console.log(this.data.myData);
       });
     }).fail(error => {
       console.log(error)

+ 14 - 2
pages/main/class/class.js

@@ -8,6 +8,10 @@ Page({
     fullScreenBtn: false,
     playBtn: true,
     gesture: true,
+    centerBtn: false,
+    controls: true,
+    videoLoad: false,
+    autoPlay: true,
     videoUrl: '',
     poster: '',
     works: [],
@@ -23,7 +27,7 @@ Page({
   },
   onLoad: function (option) {
     console.log(option);
-    if(option.scene){
+    if(option.scene || option.shareCard){
       this.setData({
           goBackHome: true
       })
@@ -57,6 +61,14 @@ Page({
   //     videoUrl: this.data.lazyVideoUrl,
   //   })
   // },
+  videoPlayHandler: function(){
+    this.setData({
+      videoLoad: true
+    },()=>{
+      this.videoCtx = wx.createVideoContext('classVideo', this);
+      this.videoCtx.play();
+    })
+  },
   // 检查是否收藏
   checkLike: function () {
     httpRequestApi.classIsLike(this.uid, {
@@ -134,7 +146,7 @@ Page({
     }
     return {
         title: '老师同学都在玩的配音show,你还在等什么?',
-        path: `pages/main/class/class?id=${this.data.id}&title=${this.data.title}`,
+        path: `pages/main/class/class?id=${this.data.id}&title=${this.data.title}&shareCard=true`,
         imageUrl: '../../../static/share/class_icon.jpg'
     }
 },

+ 7 - 3
pages/main/class/class.wxml

@@ -1,6 +1,11 @@
 <view class="classPage">
-    <video id="classVideo" class="videoSection" src="{{videoUrl}}" controls="true" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
-    <view class="readWorksSection" >
+    <!-- <cover-image wx:if="{{!videoLoad}}" class="video-playBtn" bindtap="videoPlayHandler" src="../../../static/image/play-btn.png"></cover-image>
+    <view class="videoSection">
+        <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
+        <video wx:if="{{videoLoad}}" id="classVideo" class="videoSection" src="{{videoUrl}}" autoPlay="{{autoPlay}}" controls="{{controls}}" show-center-play-btn="{{centerBtn}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
+    </view> -->
+    <video id="classVideo" poster="{{iconImg}}" class="videoSection" src="{{videoUrl}}" autoPlay="{{autoPlay}}" controls="{{controls}}" show-center-play-btn="{{centerBtn}}" 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">共有{{total}}人完成了录音</view>
@@ -35,7 +40,6 @@
                 <text>分享</text>
             </button>
         </view>
-        
     </view>
     <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
     <shareDialog id="share-dialog" shareType='class' />

+ 17 - 1
pages/main/class/class.wxss

@@ -1,8 +1,24 @@
 .videoSection {
     width: 750rpx;
     height: 428rpx;
+    background: #000;
+}
+.video-playBtn{
+    width: 120rpx;
+    height: 120rpx;
+    position: absolute;
+    left: 0;
+    right: 0;
+    margin: 0 auto;
+    z-index: 99999;
+    top: 130rpx;
+}
+.videoIcon{
+    width: 750rpx;
+    height: 428rpx;
+    position: absolute;
+    top: 0;
 }
-
 .classPage {
     background: #e8e8e8;
     height: 100%;

+ 58 - 45
pages/social/works/works.js

@@ -6,7 +6,7 @@ const app = getApp()
 Page({
     data: {
         fullScreenBtn: false,
-        playBtn: false,
+        playBtn: true,
         gesture: true,
         author: '',
         videoSrc: '',
@@ -31,9 +31,8 @@ Page({
         // shareFlag: false
     },
     onLoad: function (option) {
-        console.log(option)
         let id = option.id ? option.id : option.scene.replace('QR', '')
-        if(option.scene || option.shareCard ){
+        if (option.scene || option.shareCard) {
             this.setData({
                 goBackHome: true
             })
@@ -42,31 +41,37 @@ Page({
             title: option.title //页面标题为路由参数
         })
         this.uid = wx.getStorageSync('uid');
+        let stackSize = 1;
+        console.log(option.stackSize)
+        if (option.stackSize) {
+            stackSize = option.stackSize;
+        }
         this.setData({
             title: option.title,
             id,
-            myUid: this.uid
+            myUid: this.uid,
+            stackSize
         })
         this.getWorks(this.uid, id);
     },
     onHide: function () {
+        // this.data.stackSize >= 2
+        console.log(this.data.stackSize)
         if (this.innerAudioContext) {
             this.innerAudioContext.stop();
         }
-        let videoCtx = wx.createVideoContext('worksVideo',this);
+        let videoCtx = wx.createVideoContext('worksVideo', this);
         videoCtx.stop();
     },
     onUnload: function () {
         if (this.innerAudioContext) {
             this.innerAudioContext.stop();
         }
-        let videoCtx = wx.createVideoContext('worksVideo',this);
+        let videoCtx = wx.createVideoContext('worksVideo', this);
         videoCtx.stop();
     },
     getWorks: function (uid, id) {
         httpRequestApi.getWorksDetail(uid, id).success((res) => {
-            console.log(res);
-            console.log(id);
             const others = res.data.data.otherRead;
             const author = res.data.data.user;
             const works = res.data.data.userRead;
@@ -84,6 +89,7 @@ Page({
                 totalRead: res.data.data.totalRead,
                 author: author.wechatName,
                 authorAvatar: author.avatar,
+                authorProfession: author.profession,
                 authorUid: author.uid,
                 videoSrc: works.originVideo,
                 audioSrc: works.audioPath,
@@ -100,8 +106,8 @@ Page({
             this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
         });
     },
-    onShow(options) {
-        console.log(options)
+    onShow() {
+        console.log(this.data.stackSize)
         this.setData({
             replyList: [],
             pageNo: 1,
@@ -148,9 +154,7 @@ Page({
     },
     videoPlay: function () {
         this.innerAudioContext.play();
-        httpRequestApi.playWorks(this.uid, this.data.id).success(res => {
-
-        })
+        httpRequestApi.playWorks(this.uid, this.data.id);
     },
     videoEnd: function () {
         this.innerAudioContext.stop();
@@ -169,20 +173,20 @@ Page({
                     })
                 } else {
                     // ios用户 并且没有购买过此书
-                    if(this.data.isIOS){
-                        wx.showModal({
-                            title: '暂不支持',
-                            content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
-                            success(res) {
-                                if (res.confirm) {
-                                    console.log('用户点击确定')
-                                } else if (res.cancel) {
-                                    console.log('用户点击取消')
-                                }
-                            }
-                        })
-                        return;
-                    }
+                    // if (this.data.isIOS) {
+                    //     wx.showModal({
+                    //         title: '暂不支持',
+                    //         content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
+                    //         success(res) {
+                    //             if (res.confirm) {
+                    //                 console.log('用户点击确定')
+                    //             } else if (res.cancel) {
+                    //                 console.log('用户点击取消')
+                    //             }
+                    //         }
+                    //     })
+                    //     return;
+                    // }
                     wx.showModal({
                         title: '您未购买过本书,不能朗读',
                         content: '超值团购进行中,快去看看',
@@ -237,8 +241,6 @@ Page({
                 })
             });
         }
-
-
     },
     // 点赞评论
     likeCommend: function (e) {
@@ -254,11 +256,30 @@ Page({
             })
         });
     },
+    // 去用户主页
+    goToUsers: function (e) {
+        let uid = e.currentTarget.dataset.uid;
+        console.log(uid);
+        wx.navigateTo({
+            url: `../../user/myworks/myworks?uid=${uid}`
+        });
+    },
     // 去其他用户的作品页
     goToOthers: function (e) {
-        wx.navigateTo({
-            url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
-        })
+        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 () {
@@ -267,19 +288,19 @@ Page({
         let pageNo = this.data.pageNo;
         let pageSize = this.data.pageSize;
         httpRequestApi.getReply(this.uid, columnId, pageNo, pageSize).success((res) => {
-            console.log(res.data.data.list);
             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 = item.detailDesc;
                 temp.id = item.id;
                 temp.replyCount = item.replyCount;
                 temp.time = formatDate(item.gmtModified, 3);
                 temp.likes = item.postsAttributeInfo.favors || 0;
-                console.log(temp.time)
                 this.data.replyList.push(temp);
             });
             this.setData({
@@ -293,7 +314,6 @@ Page({
     goToDetail: function (e) {
         let id = e.currentTarget.dataset.id;
         let count = e.currentTarget.dataset.count;
-        console.log(e);
         wx.navigateTo({
             url: `../../social/replyDetail/replyDetail?id=${id}&count=${count}`
         })
@@ -306,7 +326,6 @@ Page({
     },
     // 发布回复
     sendHandler: function () {
-        console.log(this.data.inputValue);
         if (this.data.inputValue !== '') {
             // let uid = wx.getStorageSync('uid');
             let data = {
@@ -315,11 +334,10 @@ Page({
                 "detailDesc": this.data.inputValue
             }
             httpRequestApi.postReply(this.uid, data).success(res => {
-                console.log(res);
                 this.setData({
                     inputValue: '',
-                  pageNo: 1,
-                  replyList: [],
+                    pageNo: 1,
+                    replyList: [],
                 })
                 this.getReply();
             });
@@ -342,7 +360,6 @@ Page({
     },
     // 设置点击时的id
     setSBId: function (e) {
-        console.log(e)
         this.setData({
             replySBId: e.currentTarget.dataset.id,
             replyModal: true,
@@ -356,7 +373,6 @@ Page({
             content: this.data.inputSBValue
         }
         httpRequestApi.postReplyComment(this.uid, data).success(res => {
-            console.log(res)
             const replyWho = this.data.replyList[this.data.replyIndex];
             const indexStr = `replyList[${this.data.replyIndex}]`;
             replyWho.replyCount++;
@@ -398,14 +414,12 @@ Page({
     },
     // 奖励
     rewardMoney: function () {
-        console.log(this.data.authorUid);
         const data = {
             targetUid: this.data.authorUid,
             amount: this.data.howMuch
         }
         // let uid = wx.getStorageSync('uid');
         httpRequestApi.rewardMoney(this.uid, data).success(res => {
-            console.log(res);
             this.payMoneyt(res.data.data);
         })
 
@@ -420,7 +434,6 @@ Page({
             'signType': orderInfo.signType,
             'paySign': orderInfo.sign,
             'success': function (res) {
-                console.log(res)
                 wx.showModal({
                     title: '提示',
                     content: '支付成功',
@@ -447,7 +460,7 @@ Page({
         })
     },
     // 回到首页
-    goBackHome: function(){
+    goBackHome: function () {
         wx.redirectTo({
             url: '../../index/index'
         })

+ 14 - 6
pages/social/works/works.wxml

@@ -1,8 +1,9 @@
 <view>
-    <video id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindended="videoEnd" bindpause="videoPause" muted="true" controls="false" enable-progress-gesture="false" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
+    <video id="worksVideo" class="videoSection" poster="{{iconImg}}" src="{{videoSrc}}" bindplay="videoPlay" bindended="videoEnd" bindpause="videoPause" muted="true" controls="false" enable-progress-gesture="false" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
     <view class="readAuthorSection">
-        <image class="avatar" src="{{authorAvatar}}" />
-        <text class="nickName">{{author}}</text>
+        <image class="avatar" src="{{authorAvatar}}" bindtap="goToUsers" data-uid="{{authorUid}}" />
+        <view class="profession" wx:if="{{authorProfession}}">{{authorProfession}}</view>
+        <text class="nickName" bindtap="goToUsers" data-uid="{{authorUid}}">{{author}}</text>
         <view class="like" bindtap="likeWorks" wx:if="{{authorUid !== myUid}}">
             <image src="{{isLike? '../../../static/image/red_like.png' :'../../../static/image/red_like_empty.png'  }}" />
             <text class="likeBtn">{{isLike ? '已' : ''}}点赞</text>
@@ -31,7 +32,10 @@
     </view>
     <view class="commentArea">
         <view class="commentItem" wx:for="{{replyList}}" wx:key="{{index}}">
-            <image class="avatar" src="{{item.avatar}}" />
+            <view class="avatar-wrapper" bindtap="goToUsers" data-uid="{{item.uid}}">
+                <image class="avatar" src="{{item.avatar}}" />
+                <view class="profession" wx:if="{{item.profession}}">{{item.profession}}</view>
+            </view>
             <view class="commentCore">
                 <text class="nickName">{{item.nickName}}</text>
                 <text class="time">{{item.time}}</text>
@@ -42,11 +46,15 @@
             </view>
             <view class="btnWrapper">
                 <image class="commentBtn" src="../../../static/image/comment.png" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}" />
-                <text class="commentText" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}">回复</text>
+                <text class="commentText" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}">
+                    回复
+                </text>
                 <!-- <image class="commentBtn" src="../../../static/image/comment.png" bindtap="goToDetail" data-count="{{item.replyCount}}" data-id="{{item.id}}" data-index="{{index}}" />
                 <text class="commentText" bindtap="goToDetail" data-id="{{item.id}}" data-count="{{item.replyCount}}" data-index="{{index}}">评论</text> -->
                 <image class="likeBtn" src="../../../static/image/like.png" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend" />
-                <text class="likeText" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend">{{item.likes}}</text>
+                <text class="likeText" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend">
+                    {{item.likes}}
+                </text>
             </view>
         </view>
     </view>

+ 51 - 4
pages/social/works/works.wxss

@@ -10,6 +10,8 @@
     /* justify-items: center; */
     align-items: center;
     border-bottom: solid 2rpx #f0f1f5;
+    position:relative;
+
 }
 
 .readAuthorSection .avatar {
@@ -17,6 +19,24 @@
     height: 108rpx;
     border-radius: 50%;
     margin-left: 22rpx;
+    border: 4rpx solid #61CA54;
+}
+
+.readAuthorSection .profession {
+    width: 68rpx;
+    height: 24rpx;
+    background: rgba(97, 202, 84, 1);
+    border-radius: 166rpx;
+    border: 2rpx solid rgba(255, 255, 255, 1);
+    font-size: 16rpx;
+    font-family: PingFangSC-Medium;
+    font-weight: 500;
+    color: rgba(255, 255, 255, 1);
+    line-height: 24rpx;
+    text-align: center;
+    position: absolute;
+    bottom: 4rpx;
+    left: 44rpx;
 }
 
 .readAuthorSection .nickName {
@@ -173,11 +193,35 @@
     flex-direction: column;
 }
 
+.commentItem .avatar-wrapper {
+    width: 100rpx;
+    height: 100rpx;
+    position: relative;
+}
+
 .commentItem .avatar {
     border-radius: 50%;
     width: 96rpx;
     height: 96rpx;
     margin-top: 18rpx;
+    border: 4rpx solid #61CA54;
+}
+
+.avatar-wrapper .profession {
+    width: 68rpx;
+    height: 24rpx;
+    background: rgba(97, 202, 84, 1);
+    border-radius: 166rpx;
+    border: 2rpx solid rgba(255, 255, 255, 1);
+    font-size: 16rpx;
+    font-family: PingFangSC-Medium;
+    font-weight: 500;
+    color: rgba(255, 255, 255, 1);
+    line-height: 24rpx;
+    text-align: center;
+    position: absolute;
+    bottom: -37rpx;
+    left: 17rpx;
 }
 
 .commentItem .nickName {
@@ -234,7 +278,7 @@
 
 .btnWrapper .commentText,
 .likeText {
-    width: auto;
+    /* width: auto; */
     height: 40rpx;
     color: #545454;
     font-size: 28rpx;
@@ -330,7 +374,7 @@ button::after {
 
 .footSection .microphone {
     display: block;
-    margin:-12rpx auto 9rpx;
+    margin: -12rpx auto 9rpx;
     width: 108rpx;
     height: 106rpx;
 }
@@ -384,6 +428,7 @@ button::after {
     position: absolute;
     top: 300rpx;
 }
+
 .sologan {
     width: 100%;
     margin: 0 auto;
@@ -393,6 +438,7 @@ button::after {
     position: absolute;
     top: 350rpx;
 }
+
 .moneyArea {
     width: 84%;
     height: 100rpx;
@@ -451,7 +497,7 @@ button::after {
     height: 68rpx;
     position: absolute;
     left: 345rpx;
-    top:1025rpx;
+    top: 1025rpx;
 }
 
 .replySection {
@@ -476,7 +522,8 @@ button::after {
     right: 45rpx;
 
 }
-.goBackHome image{
+
+.goBackHome image {
     width: 100%;
     height: 100%;
 }

+ 4 - 4
pages/user/myEdit/myEdit.wxss

@@ -100,15 +100,15 @@ radio .wx-radio-input.wx-radio-input-checked::before{
 radio{
   margin-left: 20rpx;
   border-radius: 50%;
-  width: 40rpx;/* 最好是4的倍数,不然会不在中间 */
-  height: 40rpx;
+  width: 32rpx;/* 最好是4的倍数,不然会不在中间 */
+  height: 32rpx;
   border: 4rpx solid #FF8100;/* 设置边框(外圆) */
   font-size: 0;/* 让边框重合 */
 }
 radio .wx-radio-input{
    border-radius: 50%;
-   width: 40rpx;
-   height: 40rpx; 
+   width: 32rpx;
+   height: 32rpx; 
    border: none;/* 替换边框(隐藏原有边框) */
 }
 

+ 1 - 0
pages/user/myconcern/myconcern.wxml

@@ -4,6 +4,7 @@
     <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}" bindtap='toUserDetails' data-uid='{{ item.user.uid }}' data-fanId='{{ item.fans.fanId }}'>
       <view class='avatar-box'>
         <image class='avatar-image' src="{{ item.user.avatar }}" />
+        <view class="user-profession">{{item.user.profession}}</view>
       </view>
       <view class="avatar-name">
         <text class="nickName">{{ item.user.wechatName }}</text>

+ 41 - 17
pages/user/myconcern/myconcern.wxss

@@ -1,14 +1,14 @@
-page{
+page {
   width: 750rpx;
   background: #F0F1F5;
 }
 
-.concern-center{
+.concern-center {
   width: 716rpx;
   margin: 20rpx auto;
 }
 
-.concern-info{
+.concern-info {
   margin-bottom: 20rpx;
   width: 100%;
   height: 132rpx;
@@ -18,59 +18,83 @@ page{
   background: #FFFFFF;
 }
 
-.avatar-image{
+.avatar-image {
   width: 100%;
   height: 100%;
   border-radius: 50%;
+  border: 4rpx solid #61CA54;
+
 }
 
-.avatar-box{
+.user-profession {
+  width: 68rpx;
+  height: 24rpx;
+  background: rgba(97, 202, 84, 1);
+  border-radius: 166rpx;
+  border: 2rpx solid rgba(255, 255, 255, 1);
+  font-size: 16rpx;
+  font-family: PingFangSC-Medium;
+  font-weight: 500;
+  color: rgba(255, 255, 255, 1);
+  line-height: 24rpx;
+  text-align: center;
+  position:absolute;
+bottom:-20rpx;
+left:17rpx;
+
+}
+
+.avatar-box {
   margin-left: 30rpx;
   width: 96rpx;
   height: 96rpx;
   border-radius: 50%;
+  margin-right: 6rpx;
+position:relative;
+margin-top:-20rpx;
+
 }
 
-.avatar-name{
+.avatar-name {
   display: flex;
   flex-direction: column;
   margin-left: 14rpx;
 }
 
-.nickName{
+.nickName {
   width: 420rpx;
   height: 44rpx;
   color: #000000;
   font-size: 32rpx;
 }
 
-.time{
+.time {
   width: 420rpx;
   height: 44rpx;
   color: #686868;
   font-size: 32rpx;
 }
 
-.avatar-follow{
-  margin-left:30rpx;
-  display:flex;
-  flex-direction:column;
-  align-items:center;
-  width:100rpx;
+.avatar-follow {
+  margin-left: 30rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  width: 100rpx;
 
 }
 
-.avatar-img{
+.avatar-img {
   width: 46rpx;
   height: 40rpx;
 }
 
-.avatar-images{
+.avatar-images {
   width: 100%;
   height: 100%;
 }
 
-.follow-status{
+.follow-status {
   margin-top: 8rpx;
   color: #686868;
   font-size: 20rpx;

+ 37 - 8
pages/user/myworks/myworks.js

@@ -11,7 +11,8 @@ Page({
     pageNo: 1,
     totalNo: 0,
     uid: '',
-    worksList: []
+    worksList: [],
+    isFans: false
   },
   toMyWorks: function(e){
     let id = e.currentTarget.dataset.id;
@@ -20,6 +21,33 @@ Page({
       url: `../../social/works/works?id=${id}&title=${title}`
     });
   },
+  // 关注用户
+  follow: function () {
+    let followUid = this.data.uid;
+    if (this.data.isFans) {
+      APIClient.cancerFollow(this.uid, followUid).success((res) => {
+            this.setData({
+                isFans: false
+            })
+            wx.showToast({
+                title: '取消关注',
+                icon: 'success',
+                duration: 1000
+            })
+        });
+    } else {
+      APIClient.followUser(this.uid, followUid).success((res) => {
+            this.setData({
+                isFans: true
+            })
+            wx.showToast({
+                title: '关注啦',
+                icon: 'success',
+                duration: 1000
+            })
+        });
+    }
+},
   getResults(){
     let pageNo = this.data.pageNo;
     let pageSize = 3;
@@ -27,9 +55,10 @@ Page({
     console.log('用户身份',uid);
     APIClient.getUserMsg(uid, pageNo, pageSize).success(res => {
       this.setData({
-        wareCards: res.data.data
+        wareCards: res.data.data,
+        isFans: res.data.data.like 
       });
-      wx.hideToast();
+      // wx.hideToast();
     }).fail(err => {
       console.log(err);
     });
@@ -38,7 +67,7 @@ Page({
         worksList: this.data.worksList.concat(res.data.data.list),
         totalNo: res.data.data.totalNo
       });
-      wx.hideToast();
+      // wx.hideToast();
     }).fail(err => {
       console.log(err);
     });
@@ -52,10 +81,10 @@ Page({
     },() => {
       console.log(options.uid);
     });
-    wx.showToast({
-      title: '加载中...',
-      icon: 'loading'
-    });
+    // wx.showToast({
+    //   title: '加载中...',
+    //   icon: 'loading'
+    // });
     this.getResults();
   },
 

+ 37 - 25
pages/user/myworks/myworks.wxml

@@ -1,4 +1,4 @@
-<!--pages/user/myworks/myworks.wxml-->
+<!-- pages/user/myworks/myworks.wxml -->
 <wxs src="../../commonWxs/format.wxs" module="format" />
 <view class='user-works'>
   <view class='follow-details'>
@@ -8,7 +8,9 @@
           <view class='avatar-box'>
             <image class='avatar-image' src='{{ wareCards.user.avatar }}'></image>
           </view>
-          <view class='occupation-title'>{{ wareCards.user.profession }}</view>
+          <view class='occupation-title' wx:if="{{wareCards.user.profession}}">
+            {{ wareCards.user.profession }}
+          </view>
         </view>
         <view class='avatar-msg'>
           <view class='avatar-nickname'>
@@ -25,37 +27,49 @@
           <view class='avatar-address'>{{ wareCards.user.schoolName }}</view>
         </view>
       </view>
+      <view class="follow">
+        <image src="{{isFans? '../../../static/image/fully_heart.png' : '../../../static/image/empty_heart.png'}}" />
+        <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
+      </view>
     </view>
     <view class='mine-category'>
-        <view class='play-count'>
-          <view>{{ wareCards.playAmount || 0 }}</view>
-          <view class='border-right'>
-            <image class='play-img' src='../../../static/image/play.png'></image>
-            <text>播放量</text>
+      <view class='play-count'>
+        <view class='color' style="padding-right:38rpx;">{{ wareCards.playAmount || 0 }}</view>
+        <view class='border-right'>
+          <view class='play-img'>
+            <image src='../../../static/image/play.png'></image>
           </view>
+          <text>播放量</text>
         </view>
-        <view class='follow-count'>
-          <view class='color'>{{ wareCards.fansAmount || 0 }}</view>
-          <view class='border-right'>
-            <image class='follow-img' src='../../../static/image/follow.png'></image>
-            <text>关注</text>
+      </view>
+      <view class='follow-count'>
+        <view class='color' style="padding-right:48rpx;">{{ wareCards.fansAmount || 0 }}</view>
+        <view class='border-right'>
+          <view class='red-heart'>
+            <image src='../../../static/image/fully_heart.png'></image>
           </view>
+          <text>关注</text>
         </view>
-        <view class='point-count'>
-          <view class='color'>{{ wareCards.likeAmount || 0 }}</view>
-          <view class='border-right'>
-            <image class='like-img' src='../../../static/image/point.png'></image>
-            <text>赞</text>
+      </view>
+      <view class='point-count'>
+        <view class='color' style="padding-right:60rpx;">{{ wareCards.likeAmount || 0 }}</view>
+        <view class='border-right'>
+          <view class='point-img'>
+            <image src='../../../static/image/point.png'></image>
           </view>
+          <text>赞</text>
         </view>
-        <view class='flower-count'>
-          <view class='color'>{{ wareCards.pointAmount || 0 }}</view>
-          <view class='border-right'>
-            <image class='flower-img' src='../../../static/image/flower.png'></image>
-            <text>红花</text>
+      </view>
+      <view class='flower-count'>
+        <view class='color'>{{ wareCards.pointAmount || 0 }}</view>
+        <view class='border-right'>
+          <view class='play-img'>
+            <image src='../../../static/image/flower.png'></image>
           </view>
+          <text>红花</text>
         </view>
       </view>
+    </view>
   </view>
   <view class='works-article' wx:for="{{ worksList }}" wx:key="{{ index }}">
     <view class='user-info'>
@@ -66,7 +80,6 @@
         <view class='user-name'>
           <view class='left-detail'>{{ item.user.wechatName }}</view>
           <view class='right-detail'>
-            
             <text class='plays-count'>{{ item.userRead.playAmount || 0 }}</text>
             <view class='plays-img'>
               <image src='../../../static/image/hotPlays.png'></image>
@@ -76,7 +89,6 @@
         <view class='user-name'>
           <view class='left-detail'>{{ format.formatDate(item.userRead.gmtCreated) || 0 }}</view>
           <view class='right-detail'>
-            
             <text class='likes-count'>{{ item.userRead.likeAmount || 0 }}</text>
             <view class='likes-img'>
               <image src='../../../static/image/like.png'></image>
@@ -93,4 +105,4 @@
       <view class='content-grage'>{{ item.userRead.summary }}</view>
     </view>
   </view>
-</view>
+</view>

+ 57 - 30
pages/user/myworks/myworks.wxss

@@ -29,7 +29,29 @@ page{
   width: 100%;
   display: flex;
 }
+.follow {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width:154rpx;
+height:58rpx;
+  border: 2rpx solid #ff0000;
+  font-size: 28rpx;
+  border-radius: 30rpx;
+  /* text-align: center; */
+  /* line-height: 60rpx; */
+  color: #ff0000;
+  position:absolute;
+  top: 36rpx;
+  right: 32rpx;
+}
+
+.follow image {
+  width: 36rpx;
+  height: 36rpx;
+  margin-right: 15rpx;
 
+}
 .avatar-bg{
   margin-left: 20rpx;
   margin-top: 50rpx;
@@ -80,8 +102,8 @@ page{
 
 .occupation-title{
   position: absolute;
-  left: 100rpx;
-  top: 46rpx;
+  left: 48rpx;
+  bottom: -10rpx;
   width: 68rpx;
   height: 26rpx;
   background: #61CA54;
@@ -125,8 +147,7 @@ page{
 .mine-category{
   box-sizing: border-box;
   width: 674rpx;
-  padding-top: 40rpx;
-  padding-bottom: 32rpx;
+  padding-top: 30rpx;
   border-top: 4rpx solid #F0F1F5;
   font-size: 28rpx;
   font-weight: 600;
@@ -137,73 +158,75 @@ page{
   left: 23rpx;
 }
 
-.border-right{
+.border-right {
   display: flex;
   justify-content: center;
   align-items: center;
   font-size: 24rpx;
   font-weight: lighter;
-  height: 26rpx;
+  height: 22rpx;
   border-right: 2rpx solid #D6D6D6;
 }
-
-.flower-count .border-right{
+.flower-count .border-right {
   border: none;
 }
 
-.play-count,.point-count,.follow-count,.flower-count{
+.play-count,
+.point-count,
+.follow-count,
+.flower-count {
   width: 25%;
   text-align: center;
 }
 
-.play-img{
-  margin-right: 6rpx;
+.play-img {
   width: 28rpx;
   height: 26rpx;
+  margin-right: 6rpx;
+  margin-bottom: 6rpx;
 }
 
-.follow-img{
-  margin-right: 6rpx;
+.red-heart {
   width: 26rpx;
   height: 22rpx;
+  margin-right: 6rpx;
+  margin-bottom: 6rpx;
 }
 
-.like-img{
-  margin-top: 4rpx;
-  margin-right: 6rpx;
+.point-img {
   width: 28rpx;
   height: 24rpx;
-}
-
-.flower-img{
   margin-right: 6rpx;
-  width: 30rpx;
-  height: 26rpx;
+  margin-bottom: 6rpx;
 }
 
-image{
+image {
   width: 100%;
   height: 100%;
 }
 
-.play-count{
+.color {
+  text-align: right;
+  padding-right: 44rpx;
+
+}
+
+.play-count {
   color: #92D626;
 }
 
-.point-count{
+.point-count {
   color: #FFA700;
 }
 
-.follow-count{
-  color: #529BEF;
+.follow-count {
+  color: #FF0000;
 }
 
-.flower-count{
+.flower-count {
   color: #EE5750;
 }
 
-
-
 .works-article{
   margin-top: 12rpx;
   box-sizing: border-box;
@@ -242,7 +265,7 @@ image{
 }
 
 .user-name{
-  width: 560rpx;
+  width: 552rpx;
   display: flex;
   justify-content: space-between;
   align-items: flex-end;
@@ -306,11 +329,15 @@ margin-right: 6rpx;
 .plays-img{
   width: 20rpx;
   height: 20rpx;
+  margin-right:4rpx;
+
 }
 
 .likes-img{
   width: 26rpx;
   height: 24rpx;
+  margin-right:4rpx;
+
 }
 
 .likes-count{

+ 2 - 2
pages/user/walletDetails/walletDetails.wxml

@@ -14,8 +14,8 @@
       </view>
       <view class="walletDetails-right">
         <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
-          <text class="avatar-symbol">+</text>
-          <text>{{ item.price / 100 }}</text>
+          <text class="avatar-symbol getMoney">+</text>
+          <text class="getMoney">{{ item.price / 100 }}</text>
         </view>
         <view class="avatar-value-neg" wx:else>
           <text class="avatar-symbol">-</text>

+ 3 - 1
pages/user/walletDetails/walletDetails.wxss

@@ -69,4 +69,6 @@ image {
     font-weight: bold;
     margin-right: 4rpx;
 }
-
+.getMoney{
+    color: #61CA54;
+}

+ 7 - 1
project.config.json

@@ -36,7 +36,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 2,
+			"current": 3,
 			"list": [
 				{
 					"id": -1,
@@ -56,6 +56,12 @@
 					"pathName": "pages/groupPage/group-details/group-details",
 					"query": "orderId=1542621051065701",
 					"scene": "1012"
+				},
+				{
+					"id": -1,
+					"name": "1",
+					"pathName": "pages/social/works/works",
+					"query": "id=1542687807564957&title=【课文1】小蝌蚪找妈妈"
 				}
 			]
 		}

BIN
static/image/play-btn.png


+ 4 - 4
utils/const.js

@@ -2,10 +2,10 @@
 module.exports = {
 
 	// ----测试环境-----
-	productApi: 'https://readerproduct.efunbox.cn/',
-	baseApi: 'https://readerbase.efunbox.cn/'
+	// productApi: 'https://readerproduct.efunbox.cn/',
+	// baseApi: 'https://readerbase.efunbox.cn/'
 
 	// // ----正式环境-----
-	// productApi: 'https://readerproduct.ai160.com/',
-	// baseApi: 'https://readerbase.ai160.com/'
+	productApi: 'https://readerproduct.ai160.com/',
+	baseApi: 'https://readerbase.ai160.com/'
 }

+ 1 - 1
utils/httpUtil.js

@@ -53,7 +53,7 @@ function getLoginSchedule(sessionKey, openId, successcallback, failcallback) {
                           duration: 1500
                       })
                       wx.setStorageSync('uid', res.data.data.data.uid)
-                      wx.setStorageSync('user', res)
+                      wx.setStorageSync('user', res.data.data.data)
                       console.log(res)
                       successcallback(res)
                   });

+ 0 - 1
utils/util.js

@@ -14,7 +14,6 @@ const formatNumber = n => {
 }
 //时间戳转时间
 function formatDate(time, flag) {
-	console.log(time)
 	const t = new Date(time); 
 	const tf = function(i){return (i < 10 ? '0' : '') + i};
 	const year = t.getFullYear();