Browse Source

修改问题

Limengbo 6 years ago
parent
commit
2db3f0b052

+ 8 - 1
README.md

@@ -38,12 +38,19 @@ utils中httpRequest封装了一下wx.request的请求方法,const主要就是
 ├── pages   // 所有的页面都在这里
 │   ├── details     //  视频详情页
 │   ├── index       //  首页
-│   ├── setName      // 设置个人信息页面
+│   ├── setName      // 设置个人信息页面    |
+|   |—— access //别人观看的相册页
+|   |—— album //相册
+|   |—— childMatch //萌娃比赛
+|   |—— clip // 头像剪裁
+|   |—— clipPhoto //相册剪裁
+|   |—— Instruction //上传照片说明页
 |
 ├── component   // 所有的组件都在这里
 │   ├── look     //  看的组件
 │   ├── mys      //  我的组件
 │   ├── search      // 搜的组件
+|   |—— welCropper //图片剪裁组件
 |——static //静态文件
 |   |——image //图片

+ 7 - 2
pages/access/access.js

@@ -8,7 +8,8 @@ Page({
   data: {
     PhotoBoxInfo: {},
     likeStatus: false,
-    avatar: ""
+    avatar: "",
+    id: ""
   },
 
   /**
@@ -22,6 +23,9 @@ Page({
       })
       return false;
     }
+    this.setData({
+      id: options.id
+    })
     this.getPhoneBoxInfo(options.id);
   },
 
@@ -102,9 +106,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
+    const id = this.data.id;
     return {
       title: '七彩童年',
-      path: `pages/access/access?share=true`,
+      path: `pages/access/access?share=true&id=${id}`,
       success: function (res) {
         // 转发成功
         console.log("转发成功:" + JSON.stringify(res));

+ 30 - 7
pages/childMatch/childMatch.js

@@ -7,7 +7,9 @@ Page({
    */
   data: {
     photoBoxList: [],
-    hiddenFlag: true
+    hiddenFlag: true,
+    page: 1,
+    totalSize: 0
   },
 
   //点击跳转到相册
@@ -38,7 +40,7 @@ Page({
         }
       })
     }else {
-      this.getPhotoBoxList();
+      this.getPhotoBoxList(1, 7);
       this.setData({
         hiddenFlag: true
       })
@@ -54,14 +56,19 @@ Page({
       })
       return false;
     }
-    this.getPhotoBoxList();
+    this.getPhotoBoxList(1, 7);
   },
 
-  getPhotoBoxList() {
-    httpRequestApi.getPhotoBoxList().success((res) => {
+  getPhotoBoxList(pageNo, pageSize) {
+    httpRequestApi.getPhotoBoxList({
+      pageNo,
+      pageSize
+    }).success((res) => {
       this.setData({
-        photoBoxList: res.data.data.list
+        photoBoxList: res.data.data.list,
+        totalSize: res.data.data.totalSize
       })
+      wx.hideLoading();
     })
   },
 
@@ -76,7 +83,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    this.getPhotoBoxList();
+    this.getPhotoBoxList(1, 7);
   },
 
   /**
@@ -134,5 +141,21 @@ Page({
         console.log("转发失败:" + JSON.stringify(res));
       }
     }
+  },
+  /*上拉加载更多*/
+  onBottom: function (e) {
+    if(this.data.totalSize <= 10 * this.data.page){
+      return false;
+    }
+    wx.showLoading({
+      title: '加载中。。。。。。',
+    })
+    setTimeout( () => {
+      this.data.page++;
+      this.setData({
+        page: this.data.page++
+      })
+      this.getPhotoBoxList(1, 10 * this.data.page);
+    },2000)
   }
 })

+ 1 - 1
pages/childMatch/childMatch.wxml

@@ -4,7 +4,7 @@
             <image class="icon" src="../../static/image/search.png"></image>
             <input placeholder="输入关键字" bindinput="focus"/>
         </view>
-        <scroll-view scroll-y style="height: 92%; overflow: hidden;">
+        <scroll-view scroll-y style="height: 92%; overflow: hidden;" bindscrolltolower="onBottom">
             <view class="photo">
                 <view class="img" bindtap="album" id="{{item.user.id}}" wx:for="{{photoBoxList}}" wx:key="{{index}}" data-index="{{index}}">
                     <!-- <image src="{{item.cover}}" class="crown" mode='aspectFill'></image>  -->

+ 6 - 0
pages/childMatch/childMatch.wxss

@@ -86,8 +86,14 @@
 }
 
 .child-name {
+    width:332rpx;
+    display: inline-block;
+    text-align: center;
+    overflow: hidden;
     margin-top: 26rpx;
     font-size: 40rpx;
+    white-space: nowrap;  
+    text-overflow:ellipsis;
 }
 
 .img:nth-child(even) {

+ 3 - 0
pages/index/index.js

@@ -33,6 +33,9 @@ Page({
   },
   //tab点击
   switcher: function({currentTarget}) {
+    if (!this.data.jurisdictionFlag) {
+      return false;
+    }
     let ind = currentTarget.dataset.ind;
     let templates = this.data.tab[ind].templates;
     //console.log(this.data[ind])

+ 1 - 1
pages/setName/setName.js

@@ -27,7 +27,7 @@ Page({
   setHead: function () {
     wx.chooseImage({
       count: 1, // 默认9
-      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
+      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
       sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
       success:  (res) => {
         // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片

+ 13 - 1
project.config.json

@@ -36,13 +36,25 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 0,
+			"current": 2,
 			"list": [
 				{
 					"id": 0,
 					"name": "用户对接",
 					"pathName": "pages/index/index",
 					"query": "uid=1"
+				},
+				{
+					"id": 1,
+					"name": "萌娃比赛",
+					"pathName": "pages/childMatch/childMatch",
+					"query": "share=true"
+				},
+				{
+					"id": -1,
+					"name": "分享",
+					"pathName": "pages/access/access",
+					"query": "id=1539078520112091"
 				}
 			]
 		}