Browse Source

合并分支

Limengbo 5 years ago
parent
commit
8cea191892

+ 17 - 1
app.js

@@ -1,6 +1,9 @@
 //app.js
+import {GetQueryString} from 'utils/util'
 App({
-  onLaunch: function () {
+  onLaunch: function (options) {
+   
+
     // 展示本地存储能力
     var logs = wx.getStorageSync('logs') || []
     logs.unshift(Date.now())
@@ -33,6 +36,19 @@ App({
       }
     })
   },
+  // onShow: function(options){
+  //   console.log(options)
+  //   const type = GetQueryString(decodeURIComponent(options.query.scene), "type");
+  //   const sceneId = GetQueryString(decodeURIComponent(options.query.scene), "id");
+  //   console.log(type, sceneId)
+  //   switch (type) {
+  //     case "works":
+  //       wx.navigateTo({
+  //         url: `../social/works/works?id=${sceneId}&title="测试"`
+  //       })
+  //       break
+  //   };
+  // },
   globalData: {
     userInfo: null
   }

+ 31 - 0
component/goBackHome/goBackHome.js

@@ -0,0 +1,31 @@
+// compontents/dialog/dialog.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        show: {
+            type: 'Boolean',
+            value: false
+          },
+    },
+  
+    /**
+     * 组件的初始数据
+     */
+    data: {
+    //   show: false
+    },
+  
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        goBackHome: function(){
+            wx.redirectTo({
+                url: '../../index/index'
+            })
+      }
+    }
+  })
+  

+ 4 - 0
component/goBackHome/goBackHome.json

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

+ 3 - 0
component/goBackHome/goBackHome.wxml

@@ -0,0 +1,3 @@
+<view class="goBackHome" bindtap="goBackHome" >
+    <image src="../../static/image/goBackHome.png" />
+</view>

+ 12 - 0
component/goBackHome/goBackHome.wxss

@@ -0,0 +1,12 @@
+.goBackHome {
+    width: 100rpx;
+    height: 100rpx;
+    position: fixed;
+    bottom: 168rpx;
+    right: 45rpx;
+
+}
+.goBackHome image{
+    width: 100%;
+    height: 100%;
+}

+ 4 - 1
component/hot/hot.wxml

@@ -12,6 +12,9 @@
             <icon type="search" size="17" />
         </button>
         <view class="allBooks" bindtap="goToBooks">全部课本</view>
+        <!-- <form bindsubmit="submitTest" report-submit="{{true}}" class="allBooks">
+            <button formType="submit">Reset</button>
+        </form> -->
     </view>
     <view class="hotSection">
         <view class="title">
@@ -46,7 +49,7 @@
                 <text>人气推荐</text>
             </view>
         </view>
-        <view class="hotWares"  >
+        <view class="hotWares">
             <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="hotWareCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
                 <image class="wareCardImg" src="{{item.img}}" />
                 <text class="wareCardTitle">{{item.title}}</text>

+ 24 - 10
component/share/share.js

@@ -79,17 +79,19 @@ Component({
                   y: 0,
                   width: 370,
                   height: 507,
-                  destWidth: 370,
-                  destHeight: 507,
+                  // destWidth: 370,
+                  destWidth: 1110,
+                  // destHeight: 507,
+                  destHeight: 1521,
                   canvasId: 'myCanvas',
                   success: (res) => {
                     console.log(res.tempFilePath)
-                    wx.saveImageToPhotosAlbum({
-                      filePath: res.path,
-                      success(res) {
-                        console.log(res);
-                      }
-                    })
+                    // wx.saveImageToPhotosAlbum({
+                    //   filePath: res.path,
+                    //   success(res) {
+                    //     console.log(res);
+                    //   }
+                    // })
                     that.setData({
                       imgUrls: res.tempFilePath
                     }, () => {
@@ -158,6 +160,17 @@ Component({
         })
       }
     },
+    //关闭弹框
+    close: function(e){
+      console.log(e)
+      this.setData({
+        shareFlag: !this.data.shareFlag,
+        imgUrls: ''
+      })
+    },
+    nothing: function(e){
+      return
+    },
     // 保存图片到本地
     saveImg: function () {
       console.log('yibuububu')
@@ -269,7 +282,7 @@ Component({
         ctx.fillText('已使出洪荒之力,声情并茂的为', (370 - ctx.measureText('已使出洪荒之力,声情并茂的为').width) / 2, 138)
         ctx.fillText(`《${this.data.title}》`, (370 - ctx.measureText(`《${this.data.title}》`).width) / 2, 160)
         ctx.fillText(`配了一段惊世之作`, (370 - ctx.measureText(`配了一段惊世之作`).width) / 2, 182)
-        ctx.drawImage(this.data.iconImg, 9, 205, 352, 145);
+        ctx.drawImage(this.data.iconImg, 9, 205, 704, 145);
         ctx.setFontSize(18)
         ctx.setFillStyle('#000')
         ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
@@ -327,7 +340,8 @@ Component({
     PreservationImg: function () {
       wx.saveImageToPhotosAlbum({
         filePath: this.data.imgUrls,
-        success(res) {
+        success: (res)=> {
+          console.log(res)
           this.setData({
             imgUrls: false
           })

+ 3 - 3
component/share/share.wxml

@@ -1,5 +1,5 @@
-<view class="share" bindtap="share" wx:if="{{shareFlag}}">
-   <view class="btn" wx:if="{{!imgUrls}}">
+<view class="share" bindtap="close" wx:if="{{shareFlag}}">
+   <view class="btn" wx:if="{{!imgUrls}}" id="btnArea" bindtap="nothing">
        <image class="bg" src="../../static/groupImg/share.png"></image>
        <view class="share-btn">
             <button class="share-friend" open-type="share" catchtap="shareFriend">
@@ -12,7 +12,7 @@
             </view>           
        </view>
    </view>
-   <view class="share-img" wx:if="{{imgUrls}}">
+   <view class="share-img" wx:if="{{imgUrls}}" id="imgArea" bindtap="nothing">
        <cover-image class="img" src="{{imgUrls}}"></cover-image>
        <view class="Preservation">
            <image class="PreservationBg" src="../../static/groupImg/Preservation.png"></image>

+ 13 - 8
component/share/share.wxss

@@ -18,19 +18,22 @@
 }
 
 .btn .bg {
-    width: 90%;
-    margin: 46rpx 5%;
+  display: block;
+    width: 500rpx;
+    margin: 5% auto;
     height: 42rpx;
 }
-
+.btn text{
+  font-size: 28rpx;
+}
 .share-btn {
     display: flex;
     justify-content: space-around;
 }
 
 .share-btn image {
-    width: 66rpx;
-    height: 66rpx;
+    width: 68rpx;
+    height: 68rpx;
 }
 
 .share-btn view {
@@ -40,6 +43,7 @@
     align-items: center;
     font-size: 32rpx;
     height: 120rpx;
+    width: 180rpx
 }
 
 .img {
@@ -86,12 +90,13 @@
     margin:0;
     border-radius:0;    
     height: 140rpx;
-    font-size:32rpx;  
+    font-size:32rpx;
+    width: 180rpx;  
 }
 
 .share-friend image {
-    width: 66rpx;
-    height: 66rpx;
+    width: 68rpx;
+    height: 68rpx;
 }
 
 button::after{ border: none; } 

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

@@ -102,7 +102,7 @@ Page({
       'signType': 'MD5',
       'paySign': prePayMap.sign,
       'success': function (res) {
-        console.log('支付成功')
+        console.log('支付成功',res)
         wx.showModal({
           title: '提示',
           content: '支付成功',

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

@@ -137,7 +137,7 @@ Page({
             //获取拼团信息
             console.log(that.data.orderId)
             wx.showLoading({
-              title: '作品转码中',
+              title: '支付查询中...',
               mask: true
             })
             setTimeout(() => {

+ 16 - 5
pages/index/index.js

@@ -20,6 +20,9 @@ import {
 // import '../../utils/hls';
 import httpRequestApi from '../../utils/APIClient';
 import httputil from '../../utils/httpUtil';
+import {
+  GetQueryString
+} from '../../utils/util';
 
 Page({
   data: {
@@ -78,7 +81,7 @@ Page({
       templates
     });
     if (myIndex == 0) {
-      
+
       groupInit(this);
     }
     if (myIndex == 1) {
@@ -105,9 +108,18 @@ Page({
     }
   },
   onLoad: function (options) {
-    console.log(options)
-    this.uid = wx.getStorageSync('uid');
 
+    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({
@@ -132,7 +144,6 @@ Page({
       })
     });
     if (this.data.myIndex === 3) {
-      console.log('aaaaaaa')
       this.getUserWorksInfo();
     }
   },
@@ -162,7 +173,7 @@ Page({
   },
   // 触底加载
   onReachBottom: function () {
-    
+
     // 当前在推荐页面 加载推荐
     if (this.data.myIndex === 1) {
       console.log(this.data.recommendPageNo)

+ 8 - 3
pages/main/class/class.js

@@ -17,10 +17,15 @@ Page({
     pageNo: 1,
     totalNo: 0,
     collectFlag: false,
+    goBackHome: false
   },
   onLoad: function (option) {
     console.log(option);
-    
+    if(option.scene){
+      this.setData({
+          goBackHome: true
+      })
+  }
     this.setData({
       // title: option.title,
       id: option.id
@@ -126,8 +131,8 @@ Page({
     // let uid =  wx.getStorageSync('uid');
     let data = {
       targetCode: this.data.id,
-      title: this.data.title,
-      iconImg: this.data.iconImg
+      // title: this.data.title,
+      // iconImg: this.data.iconImg
     }
     httpRequestApi.collectClass(this.uid, data).success(res => {
       this.setData({

+ 2 - 1
pages/main/class/class.json

@@ -5,6 +5,7 @@
     "component": true,
     "usingComponents": {
         "shareDialog": "/component/share/share",
-        "popup": "/component/popup/popup"
+        "popup": "/component/popup/popup",
+        "goBackHome": "/component/goBackHome/goBackHome"
     }
 }

+ 1 - 0
pages/main/class/class.wxml

@@ -39,4 +39,5 @@
     </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' />
+    <goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />
 </view>

+ 23 - 2
pages/social/replyDetail/replyDetail.js

@@ -7,8 +7,8 @@ Page({
         class1: 'commentItem commentItemFirst',
         classNormal: 'commentItem',
         postId: '',
-        comment: []
-
+        comment: [],
+        replyInfo: ''
     },
     onLoad: function (option) {
         console.log(option)
@@ -22,6 +22,27 @@ Page({
         this.uid = wx.getStorageSync('uid');
         this.getReplyDetail();
     },
+    // 保存 回复的内容
+    saveValue: function(e){
+     this.setData({
+       replyInfo: e.detail.value
+     },() => {
+       console.log(this.data.replyInfo);
+     });
+    },
+    replyDone:function(){
+      const data = {
+        postsId: this.data.postId,
+        content: this.data.replyInfo
+      }
+      
+      httpRequestApi.postReplyComment(this.uid, data).success(res => {
+        this.setData({
+          replyModal: false
+        });
+        this.getReplyDetail();//更新 变化后的 replyTemp。
+      });
+    },
     // 查询回复详情
     getReplyDetail: function () {
         // let uid = wx.getStorageSync('uid');

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

@@ -17,4 +17,11 @@
     <view class="replySection" wx:if="{{replyModal}}">
         <input bindblur="bindTextAreaBlur" bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
     </view>
+    <view class='reply-msg'>
+      <!-- <input name='reply' class='reply-input' placeholder='回复@{{ comment[0].name }}' confirm-type="send" bindinput='saveValue' auto-focus auto-height></input> -->
+
+      <input name='reply' class='reply-input' placeholder='回复@{{ comment[0].name }}' bindinput='saveValue'>
+      </input>
+      <text class='reply-btn' bindtap='replyDone'>回复</text>
+    </view>
 </view>

+ 31 - 3
pages/social/replyDetail/replyDetail.wxss

@@ -1,5 +1,6 @@
 .commentArea {
-    width: 100%;
+  width: 100%;
+  margin-bottom: 92rpx;
 }
 
 .commentArea .commentItem {
@@ -51,7 +52,7 @@
     margin-top: 12rpx;
     width: 420rpx;
     /* height: 44rpx; */
-    line-height: 44rpx;
+    line-height: 60rpx;
     font-size: 32rpx;
     color: #000;
     /* overflow: hidden;
@@ -99,4 +100,31 @@
     width: 100%;
     height: 300rpx;
     text-indent: 4rpx;
-}
+}
+
+.reply-msg{
+  position: fixed;
+  bottom: 0;
+  width: 750rpx;
+  height: 92rpx;
+  z-index: 100rpx;
+  box-sizing: border-box;
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+  background: #FFFFFF;
+  font-size: 28rpx;
+}
+
+.reply-input{
+  width: 610rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  padding-left: 20rpx;
+  border-radius: 12rpx;
+  background: #F0F1F5;
+}
+
+.reply-btn{
+  color: #3BAF34;
+}

+ 16 - 5
pages/social/works/works.js

@@ -24,13 +24,18 @@ Page({
         replyModal: false,
         totalRead: 0,
         pageNo: 1,
-        pageSize: 2
+        pageSize: 2,
+        goBackHome: false
         // shareFlag: false
     },
     onLoad: function (option) {
         console.log(option)
         let id = option.id ? option.id : option.scene.replace('QR', '')
-
+        if(option.scene){
+            this.setData({
+                goBackHome: true
+            })
+        }
         wx.setNavigationBarTitle({
             title: option.title //页面标题为路由参数
         })
@@ -92,7 +97,8 @@ Page({
 
         });
     },
-    onShow() {
+    onShow(options) {
+        console.log(options)
         this.setData({
             replyList: [],
             pageNo: 1,
@@ -135,7 +141,7 @@ Page({
             iconImg: this.data.iconImg,
             title: this.data.title,
             path: `pages/social/works/works`,
-            scene: `QR${this.data.id}`
+            scene: `this.data.id`
             // tip: this.data.tip,
         }
         this.shareDialog.share(data);
@@ -421,5 +427,10 @@ Page({
             }
         })
     },
-
+    // 回到首页
+    goBackHome: function(){
+        wx.redirectTo({
+            url: '../../index/index'
+        })
+    }
 })

+ 2 - 1
pages/social/works/works.json

@@ -2,7 +2,8 @@
     "component": true,
     "usingComponents": {
         "shareDialog": "/component/share/share",
-        "popup": "/component/popup/popup"
+        "popup": "/component/popup/popup",
+        "goBackHome": "/component/goBackHome/goBackHome"
     },
     "window": {
         "onReachBottomDistance": 50

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

@@ -8,7 +8,8 @@
             <text class="likeBtn">{{isLike ? '已' : ''}}点赞</text>
         </view>
         <view class="follow" wx:if="{{authorUid !== myUid}}">
-            <text class="followBtn" bindtap="follow" >{{isFans ? '已' : ''}}关注</text>
+            <image src="{{isFans? '../../../static/image/fully_heart.png' : '../../../static/image/empty_heart.png'}}" />
+            <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
         </view>
     </view>
     <view class="userSection">
@@ -41,9 +42,9 @@
             </view>
             <view class="btnWrapper">
                 <image class="commentBtn" src="../../../static/image/comment.png" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}" />
-                <text class="commentText" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}" >评论</text>
+                <text class="commentText" bindtap="setSBId" data-id="{{item.id}}" 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>
@@ -71,7 +72,7 @@
     <shareDialog id="share-dialog" shareType='works' shareId="{{id}}" />
     <!-- 评论框 -->
     <view class="replySection" wx:if="{{replyModal}}">
-        <input bindblur="bindTextAreaBlur"  bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
+        <input bindblur="bindTextAreaBlur" bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
     </view>
     <!-- 奖励弹窗 -->
     <cover-view class="modalWrapper" wx:if="{{ifReward}}">
@@ -94,5 +95,9 @@
         </cover-view>
         <cover-image class="quitBtn" bindtap="quitReward" src="../../../static/groupImg/cha.png" />
     </cover-view>
-    
+    <!-- 回到首页弹窗 -->
+    <!-- <view class="goBackHome" bindtap="goBackHome" wx:if="{{goBackHome}}">
+        <image src="../../../static/image/goBackHome.png" />
+    </view> -->
+    <goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />
 </view>

+ 26 - 2
pages/social/works/works.wxss

@@ -51,15 +51,25 @@
 }
 
 .readAuthorSection .follow {
+    display: flex;
+    align-items: center;
+    justify-content: center;
     margin-left: 12rpx;
     width: 160rpx;
     height: 60rpx;
-    border: 2rpx solid #259b24;
+    border: 2rpx solid #ff0000;
     font-size: 28rpx;
     border-radius: 30rpx;
     text-align: center;
     line-height: 60rpx;
-    color: #539bee;
+    color: #ff0000;
+}
+
+.readAuthorSection .follow image {
+    width: 36rpx;
+    height: 36rpx;
+    margin-right: 15rpx;
+
 }
 
 .userSection {
@@ -213,6 +223,7 @@
     right: 10rpx;
     display: flex;
     align-items: center;
+    /* width: 200rpx; */
 }
 
 .btnWrapper .commentBtn {
@@ -452,4 +463,17 @@ button::after {
     width: 100%;
     height: 300rpx;
     text-indent: 4rpx;
+}
+
+.goBackHome {
+    width: 100rpx;
+    height: 100rpx;
+    position: fixed;
+    bottom: 168rpx;
+    right: 45rpx;
+
+}
+.goBackHome image{
+    width: 100%;
+    height: 100%;
 }

+ 0 - 1
pages/user/myEdit/myEdit.js

@@ -68,7 +68,6 @@ Page({
 
   },
   onLoad: function (option) {
-
     httpRequestApi.getUserInfo().success(res => {
       const user = res.data.data
       console.log(user)

+ 8 - 1
pages/user/myconcern/myconcern.js

@@ -9,7 +9,12 @@ Page({
       gesture: true,
       fanList:[]
   },
-
+  toUserDetails: function(e){
+    let fanId = e.currentTarget.dataset.fanId;
+    wx.navigateTo({
+      url: `../../social/works/works?fanId=${fanId}`
+    });
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -26,6 +31,8 @@ Page({
     httpRequestApi.myFans().success(res => {
       this.setData({
         fanList: res.data.data.list
+      },() => {
+        console.log(this.data.fanList);
       });
     });
   },

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

@@ -8,7 +8,7 @@
 </wxs>
 <view class='my-concern'>
   <view class="concern-center">
-    <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}">
+    <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}" bindtap='toUserDetails' data-fanId='{{ item.fans.fanId }}'>
       <view class='avatar-box'>
         <image class='avatar-image' src="{{ item.user.avatar }}" />
       </view>

+ 19 - 7
project.config.json

@@ -36,7 +36,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 0,
+			"current": 7,
 			"list": [
 				{
 					"id": 0,
@@ -46,12 +46,6 @@
 				},
 				{
 					"id": -1,
-					"name": "edit",
-					"pathName": "pages/user/myEdit/myEdit",
-					"query": ""
-				},
-				{
-					"id": -1,
 					"name": "团购详情",
 					"pathName": "pages/group-details/group-details",
 					"query": ""
@@ -74,6 +68,24 @@
 					"pathName": "pages/user/myEdit/myEdit",
 					"query": "title=修改资料",
 					"scene": "1012"
+				},
+				{
+					"id": -1,
+					"name": "read",
+					"pathName": "pages/user/myread/myread",
+					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "replydetails",
+					"pathName": "pages/social/replyDetail/replyDetail",
+					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "replydetails",
+					"pathName": "pages/social/replyDetail/replyDetail",
+					"query": ""
 				}
 			]
 		}

BIN
static/groupImg/Preservation.png


BIN
static/groupImg/circle.png


BIN
static/groupImg/share.png


BIN
static/groupImg/weixin.png


BIN
static/image/empty_heart.png


BIN
static/image/fully_heart.png


BIN
static/image/goBackHome.png


+ 9 - 0
utils/APIClient.js

@@ -111,6 +111,15 @@ module.exports = {
       "uid": followUid
     }).method('POST').send();
   },
+  // 取消关注
+  cancerFollow(uid, followUid) {
+    let url = getBaseUrl(`wx/fans`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      "uid": followUid
+    }).method('PUT').send();
+  },
   //获取关注的用户列表
   getFollowUsers(uid, pageNo, pageSize) {
     let url = getBaseUrl(`wx/fans`);

+ 8 - 1
utils/util.js

@@ -32,7 +32,14 @@ function formatDate(time, flag) {
 		return month + '-' + day + ' ' + hour + ':' + minute;
 	}
 }
+function GetQueryString(str,name){
+	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
+	var r = str.match(reg);
+	if(r!=null) return  unescape(r[2]); 
+	return null;
+}
 module.exports = {
   formatTime: formatTime,
-  formatDate
+	formatDate,
+	GetQueryString
 }