306132416@qq.com před 4 roky
rodič
revize
7b58afa929

+ 8 - 0
App.vue

@@ -129,4 +129,12 @@ page {
 .items-center {
   align-items: center;
 }
+.margin-top-3{
+  margin-top: 10%;
+}
+.shareParent {
+	width: 100%;
+	height: 100%;
+	position: fixed;
+}
 </style>

+ 64 - 0
components/share-modal/share-modal.vue

@@ -0,0 +1,64 @@
+<template>
+		<view class="mask-share-box" v-if="isShowShare">
+			<image src="/static/share-arrow.png" mode="aspectFit" :style="{ 'margin-top': isFirstPage ? '15%' : '0' }"></image>
+			<view :style="{ 'margin-top': isFirstPage ? '30%' : '15%' }">点击右上角分享至支部群</view>
+			<button @click="closeShare">关闭</button>
+		</view>
+</template>
+
+<script>
+export default {
+  name: "share-modal",
+  props: {
+    isShowShare: {
+      type: Boolean,
+      default: false,
+    },
+	isFirstPage: {
+	  type: Boolean,
+	  default: false,
+	},
+  },
+  data() {
+    return {};
+  },
+  methods: {
+    closeShare() {
+      this.$emit("closeShare",'success');
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+	.mask-share-box{
+		position: fixed;
+		width: 100%;
+		height: 100%;
+		z-index: 999;
+		background-color: rgba(0,0,0,.7);
+		  image {
+			width: 100rpx;
+			height: 100rpx;
+			float: right;
+			margin-right: 15%;
+		  }
+		  view {
+			color: #fff;
+			font-size: 32rpx;
+			text-align: center;
+			margin: 15% 0 70% 15%;
+			font-weight: bold;
+		  }
+		  button {
+			  width: 200rpx;
+			  font-size: 26rpx;
+			  position: fixed;
+			  bottom: 35%;
+			  left: 37%;
+			  background: transparent;
+			  color: #fff;
+			  border: 1px solid #fff;
+		  }
+	}
+</style>

+ 11 - 12
pages.json

@@ -1,6 +1,17 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
+		    "path" : "pages/index/activity/activity",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "活动记录",
+		        "enablePullDownRefresh": false,
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
+		    }
+		    
+		},
+		{
 			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "农工笔记",
@@ -54,17 +65,6 @@
             
         },
 		{
-		    "path" : "pages/index/activity/activity",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "活动记录",
-		        "enablePullDownRefresh": false,
-				"navigationStyle": "custom",
-				"navigationBarTextStyle": "white"
-		    }
-		    
-		},
-		{
 		    "path" : "pages/index/honor/honor",
 		    "style" :                                                                                    
 		    {
@@ -145,7 +145,6 @@
 	},
 	"tabBar": {
 		"borderStyle":"white",
-		"selectedColor": "#aa55ff", 
 		"list": [{
 				"pagePath": "pages/index/activity/activity",
 				"iconPath": "/static/tabbar/activity.png",

+ 284 - 18
pages/index/activity/activity.vue

@@ -2,7 +2,7 @@
   <view class="content">
     <view class="self-inf">
 	  <view class="antu-box">
-		<view class="img-name-box" style="margin-bottom: 5%">
+		<view class="img-name-box" style="margin-bottom: 5%" :style="{ 'z-index': isFirstPage ? '0' : '101' }">
 		  <image :src="userHeadImg" class="heade-img" mode="aspectFill"></image>
 		  <p class="nickname">{{userNickName}}</p>
 		  <p class="nickname">{{userPhone}}</p>
@@ -43,10 +43,10 @@
 				<view style="width: 55%;">{{item.type}}</view>
 			</view>
 			<view class="active-content-box">
-				<view class="active-content">
+				<view class="active-content" style="margin-bottom: 3%;">
 					<view class="active-name">{{item.name}}</view>
 				</view>
-				<view class="active-content" >
+				<view class="active-content"  style="margin-bottom: 2%;color: #ccc;">
 					<view style="margin-right:10rpx;">{{item.branch}}</view>
 					<view class="author-box">{{item.author}}</view>
 					<view style="margin-left:10rpx;">记录数:({{item.process_count}}/
@@ -66,16 +66,31 @@
 			</view> -->
 		</view>
 		</mescroll-body>
-		
 	</view>
+	<uni-popup ref="popup" type="center" :is-mask-click="false">
+			<view class="auth-pop">
+				<image src="/static/logo.png" mode="aspectFill"></image>
+				<text class="margin-top-3 auth-title">欢迎使用农工笔记小程序</text>
+				<text class="margin-top-3 auth-content">此页面是微信授权页面,授权之后你可以获取更优质的服务,您的隐私将会受到保护</text>
+				<view class="margin-top-3">
+					<!-- <button type='default' class="refuse" @click="goAuthPage">去授权</button>-->
+					<button type='primary' class="allow" @click="getUserInfo()" v-if="!isAuth">登录授权</button>
+					<button type="primary" class="allow"  open-type="getPhoneNumber"  style="font-size: 12px;"
+					@getphonenumber="getPhoneNumber" v-if="isAuth && !isNeedPhone">手机号码授权</button> 
+				</view>
+			</view>
+		</uni-popup>
+		 <share-modal  @closeShare="closeShare" :isShowShare="isShowShareModal" :isFirstPage="isFirstPage" :class="{ shareParent: isShowShareModal}"></share-modal>
   </view>
 </template>
 
 <script>
 import md5 from "@/common/md5.js";
 import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+import shareModal from '@/components/share-modal/share-modal.vue'
 export default {
 	components: {
+		"share-modal": shareModal,
 	},
   mixins: [MescrollMixin], // 使用mixin
   data() {
@@ -84,27 +99,216 @@ export default {
 	  arrayYear:[],
       dateMonth:'全部',
 	  arrayMonth:['全部',"1","2","3","4","5","6","7","8","9","10","11","12"],
-      userHeadImg: getApp().globalData.user_headUrl,
-      userNickName:getApp().globalData.user_name,
-	  userPhone:getApp().globalData.user_phone.substr(0, 3) + '****' + getApp().globalData.user_phone.substr(7),
+	  isAuth: true,
+      userHeadImg:'',
+      userNickName:'',
+	  userPhone:'',
 	  userPosList:[],
+	  isNeedPhone:getApp().globalData.user_phone,
 	  branchArray: [],
 	  branchValue:'全部',
 	  branchId:'0',
 	  page:1,
 	  pageSize:10,
-	  activiList:[]
+	  activiList:[],
+	  isShowShareModal:false,
+	  isFirstPage:false
     };
   },
   onShow() {
 	 // this.getActiveList(this.branchId)
   },
-  onLoad(option) {
-	  this.getUserInfoBranch()
-	  this.getActiveInfoBranch()
+  onShareAppMessage() {
+    return {
+  	  title: '农工笔记',
+  	  path:'/pages/index/activity/activity'
+  	}
+  },
+ async onLoad(option) {
+	  await this.$getOpenId
+	  this.getUserInfoData()
 	  this.makeYearArr()
   },
   methods: {
+	    open(){
+	      // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
+			uni.hideTabBar();
+			this.$refs.popup.open('center')
+	    },
+		pageShowShare(obj){
+		    this.isShowShareModal = true;
+			this.isFirstPage = true;
+		},
+		closeShare(e){
+			this.isShowShareModal = false;
+		},
+	  getUserInfo() {
+	  	uni.getUserProfile({
+	  		desc:'登录',
+	  		success:(res)=> {
+	  			getApp().globalData.user_headUrl = res.userInfo.avatarUrl;
+	  			getApp().globalData.user_name = res.userInfo.nickName;
+	  			this.userHeadImg = res.userInfo.avatarUrl;
+	  			this.userNickName = res.userInfo.nickName;
+	  			this.iv = res.iv;
+	  			this.encryptedData = res.encryptedData;
+	  			this.isAuth = true;
+	  			getApp().globalData.isAuth = true; 
+	  			getApp().globalData.globalAuth = true; 
+	  			this.loginUserInfo()
+	  		},
+	  		fail:(err)=> {
+	  			getApp().globalData.isAuth = false;
+	  			getApp().globalData.globalAuth = false; 
+	  			this.isAuth = false;
+	  		}
+	  	})
+	  },
+	  getPhoneNumber(e){
+	  	let that = this;
+	  	 if (e.detail.errMsg == 'getPhoneNumber:ok') { //允许授权执行跳转
+	  	  that.phoneRequest(e.detail.iv, e.detail.encryptedData, getApp().globalData.session_key)
+	  	} else { //
+	  	      that.isNeedPhone = false;
+	  	}
+	  },
+	  phoneRequest(myIv,myEncryptedData,sKey){
+	  	let that = this;
+	  	let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&source=user&action=phone&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+	  	uni.request({
+	  		url:url,
+	  		method: 'POST',
+	  		header: {
+	  			'content-type': 'application/x-www-form-urlencoded'
+	  		},
+	  		data: {
+	  			iv:myIv,
+	  			sessionKey:sKey,
+	  			encryptedData:myEncryptedData,
+	  			openid:getApp().globalData.open_id
+	  		},
+	  		success: (res) => {
+	  			console.log(res)
+	  			if(res.data.code === 200){
+	  				getApp().globalData.user_phone = res.data.data;
+	  				this.userPhone = res.data.data.substr(0, 3) + '****' + res.data.data.substr(7) ;
+	  				this.$refs.popup.close()
+	  				uni.showTabBar({})
+					this.getUserInfoBranch();
+					this.getActiveList(this.branchId)
+					this.getActiveInfoBranch()
+	  			}else {
+	  				uni.showToast({
+	  				  title: res.data.msg,
+	  				  duration: 2500,
+	  				  icon: "none",
+	  				});
+	  			} 
+	  		},
+	  		fail: () => {
+	  			console.log("连接失败");
+	  		}
+	  	});
+	  },
+	  loginUserInfo(){
+	  	let md5Sign = md5(
+	  	  "method=" +
+	  		"user" +
+	  		"&timestamp=" +
+	  		getApp().globalData.globalTimestamp +
+	  		"&secret=" +
+	  		getApp().globalData.secret
+	  	);
+	  	let url =
+	  	  getApp().globalData.shareUrl +
+	  	  "api/api.php" +
+	  	  "?method=user&action=update&timestamp=" +
+	  	  getApp().globalData.globalTimestamp +
+	  	  "&sign=" +
+	  	  md5Sign;
+	  	uni.request({ 
+	  	  url: url,
+	  	  method: "POST",
+	  	  header: {
+	  		"content-type": "application/x-www-form-urlencoded",
+	  	  },
+	  	  data: {
+	  		nickname:getApp().globalData.user_name,
+	  		headimg:getApp().globalData.user_headUrl,
+	  		openid:getApp().globalData.open_id
+	  	  },
+	  	  success: (res) => {
+	  		if (res.data.code === 200) {
+	  		}
+	  	  },
+	  	  fail: () => {
+	  		console.log("连接失败");
+	  	  },
+	  	});
+	  },
+	  getUserInfoData() {
+			let md5Sign = md5(
+			  "method=" +
+				"user" +
+				"&timestamp=" +
+				getApp().globalData.globalTimestamp +
+				"&secret=" +
+				getApp().globalData.secret
+			);
+			let url =
+			  getApp().globalData.shareUrl +
+			  "api/api.php" +
+			  "?method=user&action=info_by_openid&timestamp=" +
+			  getApp().globalData.globalTimestamp +
+			  "&sign=" +
+			  md5Sign;
+			uni.request({
+			  url: url,
+			  method: "POST",
+			  header: {
+				"content-type": "application/x-www-form-urlencoded",
+			  },
+			  data: {
+				openid:getApp().globalData.open_id,
+			  },
+			  success: (res) => {
+				if (res.data.code === 200) {
+					if (res.data.data.nickname) {
+					  this.isAuth = true;
+					  this.userHeadImg = res.data.data.headimg;
+					  this.userNickName = res.data.data.nickname;
+					  if(res.data.data.phone){
+						  this.userPhone = res.data.data.phone.substr(0, 3) + '****' + res.data.data.phone.substr(7)
+						  this.getUserInfoBranch();
+						  this.getActiveList(this.branchId);
+					  }else {
+						  this.open()
+					  }
+					  getApp().globalData.globalAuth  = true;
+					  getApp().globalData.user_name  = res.data.data.nickname;
+					  getApp().globalData.user_headUrl  = res.data.data.headimg;
+					  getApp().globalData.user_department = res.data.data.department;
+					  getApp().globalData.user_real_name = res.data.data.real_name;
+					  getApp().globalData.user_phone = res.data.data.phone;
+					  getApp().globalData.isAuth = true;
+					  this.isAuth = true;
+					  this.isNeedPhone = false;
+					}else {
+					  this.open();	
+					  this.isAuth = false;
+					  getApp().globalData.globalAuth  = false;
+					  getApp().globalData.user_name = '';
+					  getApp().globalData.isAuth = false;
+					  this.isAuth = false;
+					}
+				}
+			  },
+			  fail: () => {
+				console.log("连接失败");
+			  },
+			});
+		  },
 	  makeYearArr(){
 		  let nowYear = new Date().getFullYear(),yearList = ['全部'];
 		  for(let i = 0; i < 10 ; i ++){
@@ -174,10 +378,8 @@ export default {
 				  title: "删除成功",
 				  icon: "none", 
 				  duration: 2500,
-				  success:()=>{
-					 this.getActiveList(this.branchId)
-				  }
 				});
+				this.getActiveList(this.branchId)
 			  }
 			},
 			fail: () => {
@@ -268,7 +470,19 @@ export default {
 		    },
 	  	  success: (res) => {
 	  	    if (res.data.code === 200) {
-	  				this.activiList=res.data.data.list;
+				// 接口返回的当前页数据列表 (数组)
+				let curPageData = res.data.data.list; 
+				// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+				let curPageLen = curPageData.length; 
+				// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+				let totalPage = res.data.data.page_count; 
+				// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+				let totalSize = res.data.data.count;  
+				// // 接口返回的是否有下一页 (true/false)
+				// let hasNext = data.xxx; 
+				this.activiList = res.data.data.list;
+				this.mescroll.endByPage(curPageLen || 0, totalPage); 
+	  			//	this.activiList=res.data.data.list;
 	  	    }
 	  	  },
 	  	  fail: () => {
@@ -277,7 +491,6 @@ export default {
 	  	});
 	  },
 	  upCallback(page) {
-		console.log(666)
 		let pageNum = page.num; // 页码, 默认从1开始
 		let pageSize = page.size; // 页长, 默认每页10条
 	  	let md5Sign = md5(
@@ -418,6 +631,59 @@ export default {
   //   }
   // }
 }
+    .auth-pop{
+			background-color: #fff;
+			text-align: center;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			width: 75%;
+			margin: 0 auto;
+			border-radius: 10rpx;
+			padding: 20rpx;
+	}
+	.auth-pop image{
+		   width: 200upx;
+		   height: 200upx;
+		   margin-top: 10%;
+	}
+	.auth-pop view {
+		   // display: flex;
+		   // width: 490upx;
+		   // justify-content: space-between;
+	}
+	.auth-title {
+		   font-size: 32upx;
+	}
+	.auth-content {
+		   font-size: 26upx;
+		   color: #a7aaa9;
+	}
+	.allow {
+		   background-color: #27BCEF;
+		   margin: 20rpx 0 75rpx;
+		   text-align: center;
+		   vertical-align: middle;
+		   touch-action: manipulation;
+		   cursor: pointer;
+		   background-image: none;
+		   white-space: nowrap;
+		   user-select: none;
+		   font-size: 14px;
+		   border: 0 !important;
+		   position: relative;
+		   text-decoration: none;
+		   height: 44px;
+		   width: 250rpx;
+		   line-height: 44px;
+		   box-shadow: inset 0 0 0 1px #27BCEF;
+		   background: #fff !important;
+		   color: #27BCEF !important;
+		   display: inline-block;
+		   border-radius: 10rpx;
+	
+	}
  .self-inf {
    position: relative;
    height: 440rpx;
@@ -430,7 +696,7 @@ export default {
      margin-top:80rpx;
      display: flex;
      align-items: center;
- 	  z-index: 99999;
+ 	  z-index: 101;
      .auth-btn {
  		margin-left: 30rpx;
  		margin-top: 20rpx;
@@ -604,7 +870,7 @@ export default {
 		background-color: #81d3f8;
 	}
 	.fontRed {
-		color: red;
+		color: coral;
 	}
 }
 </style>

+ 1 - 1
pages/index/activity/create1.vue

@@ -10,7 +10,7 @@
 		<view class="info-box">
 			<view class="info-title-box">
 				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
-				<text>所属支部</text>
+				<text>选择活动所属支部/组织</text>
 			</view>
 			<view class="info-value-box">
 				  <picker @change="bindPickerChange"  :range="honorBranch" :range-key="'name'" class="select-box">

+ 2 - 0
pages/index/activity/create2.vue

@@ -373,11 +373,13 @@
 								let nowPage = pages[pages.length - 1]; //当前页页面实例
 								let prevPage = pages[pages.length - 2]; //上一页页面实例
 								prevPage.$vm.pageRefresh(types)
+								prevPage.$vm.pageShowShare(types)
 								uni.navigateBack({delta:1})
 							}else{
 								let nowPage = pages[pages.length - 1]; //当前页页面实例
 								let prevPage = pages[pages.length - 3]; //上一页页面实例
 								prevPage.$vm.pageRefresh(types)
+								prevPage.$vm.pageShowShare(types)
 								uni.navigateBack({delta:2})
 							}
 						},800)

+ 30 - 10
pages/index/activity/list.vue

@@ -46,17 +46,19 @@
 		
 		<button class="footer-box-record" @click="goRecord()">上传记录</button>
 	</view>
-    
+    <share-modal  @closeShare="closeShare" :isShowShare="isShowShareModal" :class="{ shareParent: isShowShareModal}"></share-modal>
  
   </view>
 </template>
 
 <script>
 import md5 from "@/common/md5.js";
+import shareModal from '@/components/share-modal/share-modal.vue'
 export default {
 	components: {
+		"share-modal": shareModal,
 	},
-  data() {
+   data() {
     return {
       isAuth:getApp().globalData.globalAuth,
       userHeadImg: getApp().globalData.user_headUrl,
@@ -66,7 +68,8 @@ export default {
 	  branchId:'',
 	  recordId:'',
 	  activeDesc:{},
-	  activiList:[]
+	  activiList:[],
+	  isShowShareModal:false,
     };
   },
   onLoad(option) {
@@ -77,12 +80,25 @@ export default {
   onShow() {
 	 this.readActive(this.recordId) 
   },
+  onShareAppMessage() {
+    return {
+  	  title: '农工笔记',
+  	  path:'/pages/index/activity/activity'
+  	}
+  },
   methods: {
 	      goEditPage(id){
 			 uni.navigateTo({
 			 	url:'./record?id='+ id + '&bId=' + this.branchId + '&aId=' + this.activeId + '&types=edit'
 			 }) 
 		  },
+		  pageShowShare(obj){
+			  console.log(obj)
+			  this.isShowShareModal = true;
+		  },
+		  closeShare(e){
+		  	this.isShowShareModal = false;
+		  },
 		  showLarge(urlList,index) {
 			  let imgList = urlList,imgArr = [];
 			  imgList.forEach((item,index)=>{
@@ -337,10 +353,13 @@ export default {
 }
 .active-box {
 	display: flex;
-	position: relative;
-	font-size: 28rpx;
-	padding: 20rpx;
-	border-bottom: 1px solid #d7d7d7;
+    position: relative;
+    font-size: 28rpx;
+    padding: 20rpx;
+    width: 92%;
+    margin-left: 1.5%;
+    margin-bottom: 1%;
+    box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
 	.active-header {
 		display: flex;
 		width: 100%;
@@ -364,9 +383,10 @@ export default {
 	.active-content-box-img {
 		display: flex;
 		justify-content: flex-start;
+		flex-wrap: wrap;
 		image {
-			width: 230rpx;
-			height: 160rpx;
+			width: 220rpx;
+			height: 300rpx;
 		}
 	}
 	.active-content {
@@ -411,7 +431,7 @@ export default {
 		margin-bottom: 80rpx;
 	}
 	.marginR5{
-		margin-right: 10rpx;
+		margin-right: 5rpx;
 	}
 	.footer-box-record{
 		position: fixed;

+ 75 - 57
pages/index/activity/record.vue

@@ -6,17 +6,21 @@
 				<text>上传图片</text>
 			</view>
 			<view class="info-value-box">
+				
 				<view class="update_button display-flex">
 				  <view class="upload-box" @click="getImage('album')">
 				    <view class="img" style="margin-top: 2%;">
 				      <image src="/static/upload-photo.png" class="photo"></image>
 				    </view>
 				  </view>
-				  <view class="display-flex upload-box-photo" v-for="(item, index) in uploadList" :key="index">
-				    <image :src="item" mode="aspectFit"  style="width: 100%; height: 100%" @click="showLarge(item)"/>
-				    <image src="/static/del.png" class="del-icon"mode="aspectFit" 
-							style="width: 30rpx; height: 30rpx" @click="delPhoto(index)"></image>
+				  
+				  <view class="display-wrap" style="width: 75%;">
+					  <view class="display-flex upload-box-photo" v-for="(item, index) in uploadList" :key="index">
+					    <image :src="item" mode="aspectFit"  style="width: 100%; height: 100%" @click="showLarge(item)"/>
+					    <image src="/static/del.png" class="del-icon"mode="aspectFit" style="width: 30rpx; height: 30rpx" @click="delPhoto(index)"></image>
+					  </view>
 				  </view>
+				
 				</view>
 			</view>		
 		</view>
@@ -44,20 +48,22 @@
 			<!-- <button type="primary" class="submit-bth" style="background-color: #aaaaaa;" @click="goStep()">清空</button> -->
 			<button type="primary" class="submit-bth" style="background-color: #169bd5;" @click="goStep()">提交</button>
 		</view>
-		<view class="mask-share-box" v-if="isShowShare">
+<!-- 		<view class="mask-share-box" v-if="isShowShare">
 			<image src="/static/share-arrow.png" mode="aspectFit"></image>
 			<view>点击右上角分享</view>
 			<button @click="closeShare">关闭</button>
-		</view>
+		</view> -->
+		<!-- <share-modal  @closeShare="closeShare" :isShowShare="isShowShareModal"></share-modal> -->
 	</view>
 </template>
 
 <script>
 	import md5 from "@/common/md5.js";
-	// import pickerAddress from '@/components/liudx-pickerAddress/index.vue'
+	import shareModal from '@/components/share-modal/share-modal.vue'
 	// var graceChecker = require("../../../common/graceChecker.js");
 	export default {
 		components: {
+			"share-modal": shareModal,
 		},
 		data() {
 			return {
@@ -71,7 +77,7 @@
 				contentDesc:'',
 				contentLink:'',
 				type:'add',
-				isShowShare:false,
+				isShowShareModal:false,
 			}
 		},
 		onLoad(option) {
@@ -86,17 +92,17 @@
 		onShow() {
 		},
 		onShareAppMessage() {
-			  return {
-			      title: '农工笔记',
-			      path:'/pages/index/index'
-			    }
+		  return {
+			  title: '农工笔记',
+			  path:'/pages/index/activity/activity'
+			}
 		},
 		methods: {
 			goStep(){
 				 this.addOrEditActiveRecord();
 			},
-			closeShare(){
-				this.isShowShare = false;
+			closeShare(e){
+				this.isShowShareModal = false;
 				uni.showToast({
 				  title: "上传成功",
 				  icon: "none", 
@@ -183,7 +189,18 @@
 							});
 							setTimeout(()=>{uni.navigateBack({})},500)
 						}else {
-							this.isShowShare = true
+							let types = 'add';
+							let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
+							let nowPage = pages[pages.length - 1]; //当前页页面实例
+							let prevPage = pages[pages.length - 2]; //上一页页面实例
+							prevPage.$vm.pageShowShare(types)
+							uni.showToast({
+							  title: "上传成功",
+							  icon: "none", 
+							  duration: 2500,
+							});
+							setTimeout(()=>{uni.navigateBack({delta:1})},500)
+							//this.isShowShareModal = true
 						}
 				    }
 				  },
@@ -194,9 +211,9 @@
 			}, 
 			getImage(type) {
 			  let that = this;
-			  if (that.uploadList.length >= 3) {
+			  if (that.uploadList.length >= 9) {
 			    uni.showToast({
-			      title: "最多上传3张图片",
+			      title: "最多上传9张图片",
 			      icon: "none",
 			      duration: 2500,
 			    });
@@ -204,7 +221,7 @@
 			  }
 			  uni.chooseImage({
 			    sourceType: [type],
-			    count:3 - that.uploadList.length,
+			    count:9 - that.uploadList.length,
 			    sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
 			    success: (res) => {
 			      for (let i = 0; i < res.tempFilePaths.length; i++) {
@@ -422,28 +439,29 @@
 		margin-bottom: 8%;
 	}
 	.upload-box {
-	  display: flex;
-	  flex-flow: column;
-	  width: 22%;
-	  height: 100rpx;
-	  border-radius: 10rpx;
-	  padding-top: 15rpx;
+		display: flex;
+		flex-flow: column;
+		width: 22%;
+		height: 100rpx;
+		border-radius: 10rpx;
+		padding-top: 15rpx;
+		}
 	  image {
 	    width: 100rpx;
 	    height:100rpx;
 	  }
-	}
 	.upload-box-photo {
 		width: 25%;
 		height: 100rpx;
 		border-radius: 10rpx;
 		padding-top: 15rpx;
 		position: relative;
-		margin-left: 10rpx;
+		margin-left: 20rpx;
+		margin-right: 20rpx;
 	}
 	.del-icon {
 	  position: absolute;
-	  right: 0;
+	  right: -10rpx;
 	  width: 30rpx;
 	  height: 30rpx;
 	}
@@ -519,34 +537,34 @@
 		margin: 3% auto;
 		padding: 4%;
 	}
-	.mask-share-box{
-		position: fixed;
-		width: 100%;
-		height: 100%;
-		z-index: 999;
-		background-color: rgba(0,0,0,.7);
-		  image {
-			width: 100rpx;
-			height: 100rpx;
-			float: right;
-			margin-right: 15%;
-		  }
-		  view {
-			color: #fff;
-			font-size: 32rpx;
-			text-align: center;
-			margin: 15% 0 70% 15%;
-			font-weight: bold;
-		  }
-		  button {
-			  width: 200rpx;
-			  font-size: 26rpx;
-			  position: fixed;
-			  bottom: 35%;
-			  left: 37%;
-			  background: transparent;
-			  color: #fff;
-			  border: 1px solid #fff;
-		  }
-	}
+	// .mask-share-box{
+	// 	position: fixed;
+	// 	width: 100%;
+	// 	height: 100%;
+	// 	z-index: 999;
+	// 	background-color: rgba(0,0,0,.7);
+	// 	  image {
+	// 		width: 100rpx;
+	// 		height: 100rpx;
+	// 		float: right;
+	// 		margin-right: 15%;
+	// 	  }
+	// 	  view {
+	// 		color: #fff;
+	// 		font-size: 32rpx;
+	// 		text-align: center;
+	// 		margin: 15% 0 70% 15%;
+	// 		font-weight: bold;
+	// 	  }
+	// 	  button {
+	// 		  width: 200rpx;
+	// 		  font-size: 26rpx;
+	// 		  position: fixed;
+	// 		  bottom: 35%;
+	// 		  left: 37%;
+	// 		  background: transparent;
+	// 		  color: #fff;
+	// 		  border: 1px solid #fff;
+	// 	  }
+	// }
 </style>

+ 73 - 30
pages/index/honor/honor.vue

@@ -5,18 +5,17 @@
 		 <view class="content">
 			 <view v-show="current == 0">
 				 <view class="active-title-box">
-                  <!--<uni-datetime-picker
-				 	    class="time-select-box"
-				 		type="date"
-				 		:value="single"
-				 		@change="change"
-				 		:clear-icon="false"
-				 	/> -->
-					<picker mode="date" fields="year"  @change="bindDateChange" class="picker-class">
-						<view class="uni-input display-between items-center">{{dateYear}}年<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image></view>
+					<picker :range="arrayYear" :value="dateYear"  @change="bindDateChange" class="picker-class" style="margin-left: 2%; width:20%;">
+						<view class="uni-input display-between items-center">
+						<view>{{dateYear}}<text v-if="dateYear!=='全部'">年</text></view>
+						<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image>
+						</view>
 					</picker>
-					<picker :range="arrayMonth" :value="dateMonth"  @change="bindDateMonthChange" class="picker-class" style="margin-left: 2%;">
-						<view class="uni-input display-between items-center" style="color: #707070;">{{dateMonth}}月<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image></view>
+					<picker :range="arrayMonth" :value="dateMonth"  @change="bindDateMonthChange" class="picker-class" style="margin-left: 2%; width:15%;">
+						<view class="uni-input display-between items-center" style="color: #707070;">
+						<view>{{dateMonth}}<text v-if="dateMonth!=='全部'">月</text></view>
+						<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image>
+						</view>
 					</picker>
 				    <picker @change="bindPickerChange" :value="index" :range="array">
 				 			<view class="uni-input">{{array[index]}}</view>
@@ -27,7 +26,9 @@
 				 <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
 				 <view class="honor-box" v-for="(item,index) in honorList" :key="index" style="position: relative;">
 					    <view class="honor-name">{{item.name}}</view>
-						<image :src="item.pic_url_resize" mode="aspectFit" @click="showLarge(item.pic_url)"></image>
+						<view class="honor-img-box">
+							<image :src="item.pic_url_resize" mode="aspectFit" @click="showLarge(item.pic_url)"></image>
+						</view>
 						<view style="display: flex;">
 							<view class="honor-award" style="width:120rpx;">获奖人:</view>
 							<view class="honor-award">{{item.for_branch}} {{item.for_names}}</view>
@@ -53,16 +54,28 @@
 			 </view>
 			 <view v-if="current == 1">
 				 <view class="active-title-box">
-					<picker mode="date" fields="year"  @change="bindDateChangeSelf" class="picker-class">
+					<!-- <picker mode="date" fields="year"  @change="bindDateChangeSelf" class="picker-class">
 						<view class="uni-input display-between items-center">{{dateYearSelf}}年<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image></view>
-					</picker>
-					<picker :range="arrayMonth" :value="dateMonthSelf"  @change="bindDateMonthChangeSelf" class="picker-class" style="margin-left: 2%;">
+					</picker> -->
+<!-- 					<picker :range="arrayMonth" :value="dateMonthSelf"  @change="bindDateMonthChangeSelf" class="picker-class" style="margin-left: 2%;">
 						<view class="uni-input display-between items-center" style="color: #707070;">{{dateMonthSelf}}月<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image></view>
-					</picker>
+					</picker> -->
 	<!-- 			    <picker @change="bindPickerChangeSelf" :value="indexSelf" :range="arraySelf">
 				 			<view class="uni-input">{{arraySelf[index]}}</view>
 				 			<image src="/static/arrow_down.svg" mode="aspectFit"></image>
 				    </picker> -->
+					<picker :range="arrayYear" :value="dateYearSelf"  @change="bindDateChangeSelf" class="picker-class" style="margin-left: 2%; width:20%;">
+						<view class="uni-input display-between items-center">
+						<view>{{dateYearSelf}}<text v-if="dateYearSelf!=='全部'">年</text></view>
+						<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image>
+						</view>
+					</picker>
+					<picker :range="arrayMonth" :value="dateMonthSelf"  @change="bindDateMonthChangeSelf" class="picker-class" style="margin-left: 2%; width:15%;">
+						<view class="uni-input display-between items-center" style="color: #707070;">
+						<view>{{dateMonthSelf}}<text v-if="dateMonthSelf!=='全部'">月</text></view>
+						<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image>
+						</view>
+					</picker>
 				    <button @click="goRecord()" style="margin-left: 20%;">+获奖记录</button>
 				 </view>
 				 <view class="honor-box" v-for="(item,index) in myHonorList" :key="index" style="position: relative;">
@@ -92,6 +105,7 @@
 			 </view>
 		 </view>
 	 </view>
+	<!-- <share-modal  @closeShare="closeShare" :isShowShare="isShowShareModal" :isFirstPage="isFirstPage" :class="{ shareParent: isShowShareModal}"></share-modal> -->
   </view>
 </template>
 
@@ -99,7 +113,11 @@
 <script>
 import md5 from "@/common/md5.js";
 import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+// import shareModal from '@/components/share-modal/share-modal.vue'
 export default {
+	components: {
+		//"share-modal": shareModal,
+	},
   mixins: [MescrollMixin], // 使用mixin
   data() {
     return {
@@ -111,12 +129,13 @@ export default {
 	  array:['全部','中央','省级','市级','区级','单位'],
 	  index:0,
 	  indexSelf:0,
-	  dateYear:new Date().getFullYear(),
-	  dateMonth:new Date().getMonth() + 1,
-	  dateYearSelf:new Date().getFullYear(),
-	  dateMonthSelf:new Date().getMonth() + 1,
+	  dateYear:'全部',
+	  arrayYear:[],
+	  dateMonth:'全部',
+	  arrayMonth:['全部',"1","2","3","4","5","6","7","8","9","10","11","12"],
+	  dateYearSelf:'全部',
+	  dateMonthSelf:'全部',
 	  arraySelf:['全部','中央','省级','市级','区级','单位'],
-	  arrayMonth:["1", "2","3", "4","5", "6","7", "8","9", "10","11", "12"],
       imageList: [],
       time: "",
 	  globalUrl:getApp().globalData.shareUrl,
@@ -124,15 +143,38 @@ export default {
 	  myHonorList:[],
 	  page:1,
 	  pageSize:10,
+	  // isShowShareModal:false,
+	  // isFirstPage:false
     };
   },
   onLoad() {
+	   this.makeYearArr()
      // this.getHonorList(this.dateYear,this.dateMonth,this.index)
   },
   onShow(){
 	  //this.getHonorList(this.dateYear,this.dateMonth,this.index)
   },
+  onShareAppMessage() {
+    return {
+  	  title: '农工笔记',
+  	  path:'/pages/index/activity/activity'
+  	}
+  },
   methods: {
+	makeYearArr(){
+		  let nowYear = new Date().getFullYear(),yearList = ['全部'];
+		  for(let i = 0; i < 10 ; i ++){
+			  yearList.push(nowYear--)
+		  }
+		  this.arrayYear = yearList;
+	},
+	// pageShowShare(obj){
+	//     this.isShowShareModal = true;
+	// 	this.isFirstPage = true;
+	// },
+	// closeShare(e){
+	// 	this.isShowShareModal = false;
+	// },
 	pageRefreshHonor(object) {
 	        if (object === 'add') {
 				if(this.current){
@@ -159,7 +201,7 @@ export default {
 		 this.getHonorList(this.dateYear,this.dateMonth,this.index) 
 	},
 	 bindDateChange(e){
-	 	this.dateYear = e.target.value;
+	 	this.dateYear = this.arrayYear[e.target.value];
 		this.getHonorList(this.dateYear,this.dateMonth,this.index)
 	 },
 	 bindDateMonthChange(e){
@@ -171,7 +213,7 @@ export default {
 		 this.getHonorList(this.dateYear,this.dateMonth,e.detail.value)
 	 },
 	 bindDateChangeSelf(e){
-	 	this.dateYearSelf = e.target.value;
+	 	this.dateYearSelf = this.arrayYear[e.target.value];
 	 	this.getMyHonor(this.dateYearSelf,this.dateMonthSelf,this.indexSelf)
 	 },
 	 bindDateMonthChangeSelf(e){
@@ -447,13 +489,14 @@ export default {
 	   margin: 2% 0 2% 2%;
 	   width: 90%;
 	   border-radius: 10rpx;
-	   image {
-			// width: 360rpx;
-			// height: 160rpx;
-			// margin: 20rpx auto;
-			    width: 100%;
-			    height: 260rpx;
-			    margin: 20rpx auto;
+	   .honor-img-box{
+		   margin-top: 30rpx;
+		   border-radius: 10rpx
+		   image {
+		   			width: 100%;
+		   			height: 450rpx;
+		   			margin: 20rpx auto;
+		   }
 	   }
 	   .honor-award {
 		   width: 80%;

+ 1 - 0
pages/index/honor/record.vue

@@ -368,6 +368,7 @@
 						this.typeValue = typeObj[infoObj.for];
 						this.fromValue = fromObj[infoObj.from];
 						this.levelValue = levelObj[infoObj.level];
+						this.memberIds = infoObj.member_list.map((item)=>{return item.member_id})
 						this.filterChecked(infoObj.member_list);
 						this.branchValue = (this.honorBranch.find((item)=>{return item.branch_id == infoObj.branch_id})).name;
 			      }

+ 55 - 63
pages/index/index.vue

@@ -50,13 +50,13 @@
       </view>
     </view>
 	
-	<uni-popup ref="popup" type="center" :is-mask-click="false">
+		<uni-popup ref="popup" type="center" :is-mask-click="false">
 			<view class="auth-pop">
 				<image src="/static/logo.png" mode="aspectFill"></image>
 				<text class="margin-top-3 auth-title">欢迎使用农工笔记小程序</text>
 				<text class="margin-top-3 auth-content">此页面是微信授权页面,授权之后你可以获取更优质的服务,您的隐私将会受到保护</text>
 				<view class="margin-top-3">
-					<!-- <button type='default' class="refuse" @click="goAuthPage">去授权</button>-->
+					<!-- <button type='default' class="refuse" @click="goAuthPage">去授权</button> -->
 					<button type='primary' class="allow" @click="getUserInfo()" v-if="!isAuth">登录授权</button>
 					<button type="primary" class="allow"  open-type="getPhoneNumber"  style="font-size: 12px;"
 					@getphonenumber="getPhoneNumber" v-if="isAuth && !isNeedPhone">手机号码授权</button> 
@@ -77,10 +77,9 @@ export default {
     return {
       isAuth: true,
 	  btnPos:26.5,
-      userHeadImg: "",
-      userNickName: "",
-	  userPhone:'',
-	  userBranch:'',
+      userHeadImg: getApp().globalData.user_headUrl,
+      userNickName:getApp().globalData.user_name,
+	  userPhone:getApp().globalData.user_phone.substr(0, 3) + '****' + getApp().globalData.user_phone.substr(7),
 	  userPosList:[],
 	  posLength:0,
 	  userPos:'',
@@ -134,13 +133,9 @@ export default {
       ],
     };
   },
-  async onLoad() {
-	  // setTimeout(()=>{
-	  // 		this.getUserInfo()
-	  // },1000)
+  onLoad() {
 	  this.getPageHeight()
-	  await this.$getOpenId
-	  this.getUserInfoData()
+	  this.getUserInfoBranch();
   },
   onShow() {
   },
@@ -365,7 +360,7 @@ export default {
 	        success: (res) => {
 	          if (res.data.code === 200) {
 				  this.userPosList = res.data.data;
-				  this.posLength = res.data.data.length;
+				 // this.posLength = res.data.data.length;
 	          }
 	        },
 	        fail: () => {
@@ -485,54 +480,54 @@ export default {
       }
     },
     loginOut() {
-    let md5Sign = md5(
-      "method=" +
-        "user" +
-        "&timestamp=" +
-        getApp().globalData.globalTimestamp +
-        "&secret=" +
-        getApp().globalData.secret
-    );
-    let url = getApp().globalData.shareUrl +
-      "api/api.php" +
-      "?method=user&action=logout&timestamp=" +
-      getApp().globalData.globalTimestamp +
-      "&sign=" +
-      md5Sign;
-    uni.request({
-      url: url,
-      method: "POST",
-      header: {
-        "content-type": "application/x-www-form-urlencoded",
-      },
-      data: {
-        openid: getApp().globalData.open_id,
-      },
-      success: (res) => {
-        if (res.data.code === 200) {
-		  let that = this;	
-          that.isAuth = false;
-          getApp().globalData.isAuth = false;
-          getApp().globalData.user_headUrl = "";
-          getApp().globalData.user_name = "";
-          getApp().globalData.user_phone = "";
-		  this.userPhone = '';
-		  //this.list[3].isShow = false;
-  		//this.$forceUpdate();
-          uni.showToast({
-            title: "退出登录成功",
-            duration: 2500,
-            icon: "none",
-			success() {
-				that.open()
+		let md5Sign = md5(
+		  "method=" +
+			"user" +
+			"&timestamp=" +
+			getApp().globalData.globalTimestamp +
+			"&secret=" +
+			getApp().globalData.secret
+		);
+		let url = getApp().globalData.shareUrl +
+		  "api/api.php" +
+		  "?method=user&action=logout&timestamp=" +
+		  getApp().globalData.globalTimestamp +
+		  "&sign=" +
+		  md5Sign;
+		uni.request({
+		  url: url,
+		  method: "POST",
+		  header: {
+			"content-type": "application/x-www-form-urlencoded",
+		  },
+		  data: {
+			openid: getApp().globalData.open_id,
+		  },
+		  success: (res) => {
+			if (res.data.code === 200) {
+			  let that = this;	
+			  that.isAuth = false;
+			  getApp().globalData.isAuth = false;
+			  getApp().globalData.user_headUrl = "";
+			  getApp().globalData.user_name = "";
+			  getApp().globalData.user_phone = "";
+			  this.userPhone = '';
+			  //this.list[3].isShow = false;
+			//this.$forceUpdate();
+			  uni.showToast({
+				title: "退出登录成功",
+				duration: 2500,
+				icon: "none",
+				success() {
+					that.open()
+				}
+			  });
 			}
-          });
-        }
-      },
-      fail: () => {
-        console.log("连接失败");
-      },
-    });
+		  },
+		  fail: () => {
+			console.log("连接失败");
+		  },
+		});
   },
   },
 };
@@ -806,9 +801,6 @@ export default {
 	   border-radius: 10rpx;
 
    }
-   .margin-top-3{
-	   margin-top: 10%;
-   }
    .paddingTop80 {
 	   padding-top:160rpx;
    }