zhengkaixin 2 years ago
parent
commit
69a42ca2cb

+ 13 - 0
apis/common.js

@@ -2,6 +2,19 @@ import request from '@/apis/utils/request'
  
 import Qs from 'qs';
 
+export function uploadPicture(formData) {
+	return request({
+		url: '/uploadPicture',
+		header:{
+			   'Content-Type': 'application/x-www-form-urlencoded'
+
+		},
+		data: formData,
+		method: 'post',
+		
+	})
+}
+
 
 export function getBannerInfo(formData) {
 	return request({

+ 35 - 0
apis/pagejs/activity.js

@@ -0,0 +1,35 @@
+import request from '@/apis/utils/request'
+ 
+import Qs from 'qs';
+
+export function pageList(formData) {
+	return request({
+		url: '/open/activity/pageList',
+		data: formData,
+		method: 'post',	
+	//	header:{'Content-Type':'application/json'},
+	})
+}
+
+export function edit(id) {
+	return request({
+		url: '/open/activity/edit/'+id,
+		//data: formData,
+		method: 'get',	
+	//	header:{'Content-Type':'application/json'},
+	})
+}
+
+
+
+export function notesList(id) {
+	return request({
+		url: '/open/activity/notesList',
+		data: {
+			activityId:id
+		},
+		method: 'post',	
+	//	header:{'Content-Type':'application/json'},
+	})
+}
+

+ 1 - 0
apis/utils/init.js

@@ -63,6 +63,7 @@ var app = {
 		 		
 		 		var token = res ? res.data.data.token : '';
 		 		carhelp.setPersonInfo(res.data.data.regUser );
+		 		carhelp.setPersonInfoPlus(res.data.data );
 		 		
 		 		carhelp.setToken(token);
 		 	 

+ 1 - 1
apis/utils/mixin.js

@@ -1,4 +1,4 @@
-var prefix = 'jp-education-teacher' + process.car.NODE_ENV + '_';
+var prefix = 'jp-railway-' + process.car.NODE_ENV + '_';
 
 var app = {
 	getGzDate : (key) => {

+ 0 - 94
apis/utils/requestStudent.js

@@ -1,94 +0,0 @@
-import  carhelp from '@/apis/utils/mixin-student.js'
-import requestSon from './requestSon.js';
-import requestNum from './requestNum.js';
-
-
-const request = (options) => {
-	//记录请求次数和响应次数
-	var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
-	var token_tdate=carhelp.get("token_tdate");//每10分钟存储一次token
-	
-	var token=carhelp.getToken(options);
-	
-	 if(token_tdate&&token_tdate==tdate){
-	 	return requestSon(options);
-	 }
-	 var openId=carhelp.getOpenId()
-	var  urlindex="/wechat/findUserInfo"
-	var k=options.url.indexOf(urlindex)==-1;
-	
-	 if(!openId&&k){
-		 return
-	 }
-	if(!k){
-		return requestSon(options);
-	}
-	
-	return new Promise((resolve, reject) => {
-		 var loginurl="/mobile/regUser/findByOpenId"
-		 
-		 
-		 
-		uni.request({
-			method:'get',
-			url: process.car.BASE_URL + loginurl,
-			data: {
-				openId:openId,
-			
-			},
-			
-			header: {
-				'Content-Type': 'application/x-www-form-urlencoded',
-				'X-Requested-With': 'XMLHttpRequest',
-				//'Authorization':token
-			}
-		}).then((response) => {
- 			let [error, res] = response;
-			
-			
-			if (res.data.code == 200&&res.data.result) {
-				
-				var token = res ? res.data.data.token : '';
-				carhelp.setPersonInfo(res.data.data.regUser );
-				
-				carhelp.setToken(token);
-				carhelp.setPersonInfoPlus(res.data.data);
-				
-				options.token=token
-				
-				var isson= requestSon(options)
-				//requestNum(options);
-				resolve(isson);
-				 
-			} else  if(res.data.code == 415||(res.data.code == 200&&!res.data.result)||res.data.code == 400){
-				
-				//var url=window.location.href.split("#")[1]
-			
-				console.log("没有免登陆 ----------------"+options.url)
-				//var url="/pages/login/index?message=请登录&back="+ url+"&phone="+options.data.phone
-				var thisurl='/pages/login/login';
-				
-				if(options&&options.data&&options.data.jpcode){
-					thisurl+="?jpcode="+options.data.jpcode
-				}
-				carhelp.signOut()
-				uni.redirectTo({
-					url: thisurl
-				})
-				
-				
-				
-			 
-				
-			}else{
-		
-				reject(res.data.message)
-			}
-		}).catch(error => {
-			
-			let [err, res] = error;
-			reject(err)
-		})
-	});
-}
-export default request

+ 0 - 94
apis/utils/requestTeacher.js

@@ -1,94 +0,0 @@
-import  carhelp from '@/apis/utils/mixin.js'
-import requestSon from './requestSon.js';
-import requestNum from './requestNum.js';
-
-
-const request = (options) => {
-	//记录请求次数和响应次数
-	var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
-	var token_tdate=carhelp.get("token_tdate");//每10分钟存储一次token
-	
-	var token=carhelp.getToken(options);
-	
-	 if(token_tdate&&token_tdate==tdate){
-	 	return requestSon(options);
-	 }
-	 var openId=carhelp.getOpenId()
-	var  urlindex="/wechat/findUserInfo"
-	var k=options.url.indexOf(urlindex)==-1;
-	
-	 if(!openId&&k){
-		 return
-	 }
-	if(!k){
-		return requestSon(options);
-	}
-	
-	return new Promise((resolve, reject) => {
-		 var loginurl="/mobile/regUser/findByOpenId"
-		 
-		  
-		 
-		uni.request({
-			method:'get',
-			url: process.car.BASE_URL + loginurl,
-			data: {
-				openId:openId,
-			
-			},
-			
-			header: {
-				'Content-Type': 'application/x-www-form-urlencoded',
-				'X-Requested-With': 'XMLHttpRequest',
-				//'Authorization':token
-			}
-		}).then((response) => {
- 			let [error, res] = response;
-			
-			
-			if (res.data.code == 200&&res.data.result) {
-				
-				var token = res ? res.data.data.token : '';
-				carhelp.setPersonInfo(res.data.data.regUser );
-				
-				carhelp.setToken(token);
-				carhelp.setPersonInfoPlus(res.data.data);
-				
-				options.token=token
-				
-				var isson= requestSon(options)
-				//requestNum(options);
-				resolve(isson);
-				 
-			} else  if(res.data.code == 415||(res.data.code == 200&&!res.data.result)||res.data.code == 400){
-				
-				//var url=window.location.href.split("#")[1]
-			
-				console.log("没有免登陆 ----------------"+options.url)
-				//var url="/pages/login/index?message=请登录&back="+ url+"&phone="+options.data.phone
-				var thisurl='/pages/login/login';
-				
-				if(options&&options.data&&options.data.jpcode){
-					thisurl+="?jpcode="+options.data.jpcode
-				}
-				carhelp.signOut()
-				uni.redirectTo({
-					url: thisurl
-				})
-				
-				
-				
-			 
-				
-			}else{
-		
-				reject(res.data.message)
-			}
-		}).catch(error => {
-			
-			let [err, res] = error;
-			reject(err)
-		})
-	});
-}
-export default request

+ 227 - 0
components/limeClipper/README.md

@@ -0,0 +1,227 @@
+> 插件来源:[https://ext.dcloud.net.cn/plugin?id=3594](https://ext.dcloud.net.cn/plugin?id=3594)
+##### 以下是作者写的插件介绍:
+
+# Clipper 图片裁剪
+> uniapp 图片裁剪,可用于图片头像等裁剪处理
+> [查看更多](http://liangei.gitee.io/limeui/#/clipper) <br>
+> Q群:458377637
+
+
+## 平台兼容
+
+| H5  | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App |
+| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- |
+| √   | √          | √         | 未测       | √          | √      | √   |
+
+
+## 代码演示
+### 基本用法
+`@success` 事件点击 👉 **确定** 后会返回生成的图片信息,包含 `url`、`width`、`height`
+
+```html
+<image :src="url" v-if="url" mode="widthFix"></image>
+<l-clipper v-if="show" @success="url = $event.url; show = false" @cancel="show = false"  ></l-clipper>
+<button @tap="show = true">裁剪</button>
+```
+
+```js
+// 非uni_modules引入
+import lClipper from '@/components/lime-clipper/'
+// uni_modules引入
+import lClipper from '@/uni_modules/lime-clipper/components/lime-clipper/'
+export default {
+	components: {lClipper},
+    data() {
+        return {
+            show: false,
+			url: '',
+        }
+    }
+}
+```
+
+
+### 传入图片
+`image-url`可传入**相对路径**、**临时路径**、**本地路径**、**网络图片**<br>
+
+* **当为网络地址时**
+* H5:👉 需要解决跨域问题。 <br>
+* 小程序:👉 需要配置 downloadFile 域名 <br>
+
+
+```html
+<image :src="url" v-if="url" mode="widthFix"></image>
+<l-clipper v-if="show" :image-url="imageUrl"  @success="url = $event.url; show = false" @cancel="show = false"  ></l-clipper>
+<button @tap="show = true">裁剪</button>
+```
+
+```js
+export default {
+	components: {lClipper},
+    data() {
+        return {
+			imageUrl: 'https://img12.360buyimg.com/pop/s1180x940_jfs/t1/97205/26/1142/87801/5dbac55aEf795d962/48a4d7a63ff80b8b.jpg',
+            show: false,
+			url: '',
+        }
+    }
+}
+```
+
+
+### 确定按钮颜色
+样式变量名:`--l-clipper-confirm-color`
+可放到全局样式的 `page` 里或节点的 `style`
+```html
+<l-clipper class="clipper" style="--l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24)"  ></l-clipper>
+```
+```css
+// css 中为组件设置 CSS 变量
+.clipper {
+	--l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24)
+}
+// 全局
+page {
+	--l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24)
+}
+```
+
+
+### 使用插槽
+共五个插槽 `cancel` 取消按钮、 `photo` 选择图片按钮、 `rotate` 旋转按钮、 `confirm` 确定按钮和默认插槽。
+
+```html
+<image :src="url" v-if="url" mode="widthFix"></image>
+<l-clipper 
+	v-if="show" 
+	:isLockWidth="isLockWidth"
+	:isLockHeight="isLockHeight"
+	:isLockRatio="isLockRatio"
+	:isLimitMove="isLimitMove"
+	:isDisableScale="isDisableScale"
+	:isDisableRotate="isDisableRotate"
+	:isShowCancelBtn="isShowCancelBtn"
+	:isShowPhotoBtn="isShowPhotoBtn"
+	:isShowRotateBtn="isShowRotateBtn"
+	:isShowConfirmBtn="isShowConfirmBtn"
+	@success="url = $event.url; show = false" 
+	@cancel="show = false" >
+	<!-- 四个基本按钮插槽 -->
+	<view slot="cancel">取消</view>
+	<view slot="photo">选择图片</view>
+	<view slot="rotate">旋转</view>
+	<view slot="confirm">确定</view>
+	<!-- 默认插槽 -->
+	<view class="tools">
+		<view>显示取消按钮
+			<switch :checked="isShowCancelBtn" @change="isShowCancelBtn = $event.target.value" ></switch>
+		</view>
+		<view>显示选择图片按钮
+			<switch :checked="isShowPhotoBtn" @change="isShowPhotoBtn = $event.target.value" ></switch>
+		</view>
+		<view>显示旋转按钮
+			<switch :checked="isShowRotateBtn" @change="isShowRotateBtn = $event.target.value" ></switch>
+		</view>
+		<view>显示确定按钮
+			<switch :checked="isShowConfirmBtn" @change="isShowConfirmBtn = $event.target.value" ></switch>
+		</view>
+		<view>锁定裁剪框宽度
+			<switch :checked="isLockWidth" @change="isLockWidth = $event.target.value" ></switch>
+		</view>
+		<view>锁定裁剪框高度
+			<switch :checked="isLockHeight" @change="isLockHeight = $event.target.value" ></switch>
+		</view>
+		<view>锁定裁剪框比例
+			<switch :checked="isLockRatio" @change="isLockRatio = $event.target.value" ></switch>
+		</view>
+		<view>限制移动范围
+			<switch :checked="isLimitMove" @change="isLimitMove = $event.target.value" ></switch>
+		</view>
+		<view>禁止缩放
+			<switch :checked="isDisableScale" @change="isDisableScale = $event.target.value" ></switch>
+		</view>
+		<view>禁止旋转
+			<switch :checked="isDisableRotate" @change="isDisableRotate = $event.target.value" ></switch>
+		</view>
+	</view>
+</l-clipper>
+<button @tap="show = true">裁剪</button>
+```
+
+```js
+export default {
+	components: {lClipper},
+    data() {
+        return {
+            show: false,
+            url: '',
+            isLockWidth: false,
+            isLockHeight: false,
+            isLockRatio: true,
+            isLimitMove: false,
+            isDisableScale: false,
+            isDisableRotate: false,
+            isShowCancelBtn: true,
+            isShowPhotoBtn: true,
+            isShowRotateBtn: true,
+            isShowConfirmBtn: true
+        }
+    }
+}
+```
+
+
+## API
+
+### Props
+
+| 参数           | 说明         | 类型             | 默认值       |
+| ------------- | ------------ | ---------------- | ------------ |
+| image-url     | 图片路径     | <em>string</em>   |              |
+| quality       | 图片的质量,取值范围为 [0, 1],不在范围内时当作1处理   | <em>number</em>  |    `1`      |
+| source       | `{album: '从相册中选择'}`key为图片来源类型,value为选项说明   | <em>Object</em>  |         |
+| width | 裁剪框宽度,单位为 `rpx` | <em>number</em> | `400`      |
+| height | 裁剪框高度 | <em>number</em> | `400`      |
+| min-width | 裁剪框最小宽度 | <em>number</em> | `200`      |
+| min-height |裁剪框最小高度 | <em>number</em> | `200`  |
+| max-width | 裁剪框最大宽度 | <em>number</em> | `600`  |
+| max-height | 裁剪框最大宽度 | <em>number</em> | `600`  |
+| min-ratio | 图片最小缩放比 | <em>number</em> | `0.5`  |
+| max-ratio | 图片最大缩放比 | <em>number</em> | `2`  |
+| rotate-angle | 旋转按钮每次旋转的角度 | <em>number</em> | `90`  |
+| scale-ratio | 生成图片相对于裁剪框的比例, **比例越高生成图片越清晰**	 | <em>number</em> | `1`  |
+| is-lock-width | 是否锁定裁剪框宽度 | <em>boolean</em> | `false`  |
+| is-lock-height | 是否锁定裁剪框高度上 | <em>boolean</em> | `false`  |
+| is-lock-ratio | 是否锁定裁剪框比例 | <em>boolean</em> | `true`  |
+| is-disable-scale | 是否禁止缩放 | <em>boolean</em> | `false`  |
+| is-disable-rotate | 是否禁止旋转 | <em>boolean</em> | `false`  |
+| is-limit-move | 是否限制移动范围 | <em>boolean</em> | `false`  |
+| is-show-photo-btn | 是否显示选择图片按钮 | <em>boolean</em> | `true`  |
+| is-show-rotate-btn | 是否显示转按钮 | <em>boolean</em> | `true`  |
+| is-show-confirm-btn | 是否显示确定按钮 | <em>boolean</em> | `true`  |
+| is-show-cancel-btn | 是否显示关闭按钮 | <em>boolean</em> | `true`  |
+
+
+
+### 事件 Events
+
+| 事件名  | 说明         | 回调           |
+| ------- | ------------ | -------------- |
+| success | 生成图片成功 | {`width`, `height`, `url`} |
+| fail | 生成图片失败 | `error` |
+| cancel | 关闭 | `false` |
+| ready   | 图片加载完成 | {`width`, `height`, `path`, `orientation`, `type`} |
+| change | 图片大小改变时触发 | {`width`, `height`} |
+| rotate | 图片旋转时触发 | `angle` |
+
+## 常见问题
+> 1、H5端使用网络图片需要解决跨域问题。<br>
+> 2、小程序使用网络图片需要去公众平台增加下载白名单!二级域名也需要配!<br>
+> 3、H5端生成图片是base64,有时显示只有一半可以使用原生标签`<IMG/>`<br>
+> 4、IOS APP 请勿使用HBX2.9.3.20201014的版本!这个版本无法生成图片。<br>
+> 5、APP端无成功反馈、也无失败反馈时,请更新基座和HBX。<br>
+
+
+## 打赏
+如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。<br>
+![输入图片说明](https://images.gitee.com/uploads/images/2020/1122/222521_bb543f96_518581.jpeg "微信图片编辑_20201122220352.jpg")

+ 19 - 0
components/limeClipper/images/photo.svg

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#606060;}
+	.st1{fill:none;stroke:#FFFFFF;stroke-width:2.4306;stroke-miterlimit:10;}
+	.st2{fill:#FFFFFF;}
+</style>
+<g>
+	<path class="st2" d="M11.6,11c0.4,0.4,0.6,0.9,0.6,1.5c0,0.6-0.2,1.1-0.6,1.4c-0.4,0.4-0.9,0.6-1.5,0.6c-0.6,0-1.1-0.2-1.5-0.6
+		c-0.4-0.4-0.6-0.9-0.6-1.4s0.2-1.1,0.6-1.5c0.4-0.4,0.9-0.6,1.5-0.6C10.8,10.4,11.2,10.6,11.6,11z M24.6,18.4V6.7H5.4v12l1.8-1.8
+		c0.3-0.3,0.6-0.4,1-0.4c0.4,0,0.7,0.1,1,0.4l1.8,1.8l5.8-7c0.3-0.3,0.6-0.5,1.1-0.5c0.4,0,0.8,0.2,1.1,0.5
+		C18.8,11.6,24.6,18.4,24.6,18.4z M25.6,5.7C25.9,6,26,6.3,26,6.7v16.1c0,0.4-0.1,0.7-0.4,1c-0.3,0.3-0.6,0.4-1,0.4H5.4
+		c-0.4,0-0.7-0.1-1-0.4c-0.3-0.3-0.4-0.6-0.4-1V6.7c0-0.4,0.1-0.7,0.4-1c0.3-0.3,0.6-0.4,1-0.4h19.3C25,5.3,25.3,5.4,25.6,5.7z"/>
+	<path class="st1" d="M24.3,21.5H5.7c-0.2,0-0.3-0.2-0.3-0.3V7c0-0.2,0.2-0.3,0.3-0.3h18.6c0.2,0,0.3,0.2,0.3,0.3v14.2
+		C24.6,21.3,24.5,21.5,24.3,21.5z"/>
+</g>
+</svg>

+ 15 - 0
components/limeClipper/images/rotate.svg

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="30px" height="30px" viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:none;stroke:#FFFFFF;stroke-width:2.4306;stroke-miterlimit:10;}
+	.st1{fill:#FFFFFF;}
+</style>
+<g>
+	<path class="st0" d="M17.1,24.2h-12c-0.2,0-0.3-0.2-0.3-0.3v-9.3c0-0.2,0.2-0.3,0.3-0.3h12c0.2,0,0.3,0.2,0.3,0.3v9.3
+		C17.5,24.1,17.3,24.2,17.1,24.2z"/>
+	<path class="st0" d="M16.6,5.4c4.8,0,8.7,3.9,8.7,8.7"/>
+	<polyline class="st0" points="19.3,10.1 14.9,5.6 19.3,1.2 	"/>
+</g>
+</svg>

+ 160 - 0
components/limeClipper/index.css

@@ -0,0 +1,160 @@
+.flex-auto {
+  flex: auto;
+}
+.bg-transparent {
+  background-color: rgba(0,0,0,0.9);
+  transition-duration: 0.35s;
+}
+.l-clipper {
+  width: 100vw;
+  height: calc(100vh - var(--window-top));
+  background-color: rgba(0,0,0,0.9);
+  position: fixed;
+  top: var(--window-top);
+  left: 0;
+  z-index: 1;
+}
+.l-clipper-mask {
+  position: relative;
+  z-index: 2;
+  pointer-events: none;
+}
+.l-clipper__content {
+  pointer-events: none;
+  position: absolute;
+  border: 1rpx solid rgba(255,255,255,0.3);
+  box-sizing: border-box;
+  box-shadow: rgba(0,0,0,0.5) 0 0 0 80vh;
+  background: transparent;
+}
+.l-clipper__content::before,
+.l-clipper__content::after {
+  content: '';
+  position: absolute;
+  border: 1rpx dashed rgba(255,255,255,0.3);
+}
+.l-clipper__content::before {
+  width: 100%;
+  top: 33.33%;
+  height: 33.33%;
+  border-left: none;
+  border-right: none;
+}
+.l-clipper__content::after {
+  width: 33.33%;
+  left: 33.33%;
+  height: 100%;
+  border-top: none;
+  border-bottom: none;
+}
+.l-clipper__edge {
+  position: absolute;
+  width: 34rpx;
+  height: 34rpx;
+  border: 6rpx solid #fff;
+  pointer-events: auto;
+}
+.l-clipper__edge::before {
+  content: '';
+  position: absolute;
+  width: 40rpx;
+  height: 40rpx;
+  background-color: transparent;
+}
+.l-clipper__edge:nth-child(1) {
+  left: -6rpx;
+  top: -6rpx;
+  border-bottom-width: 0 !important;
+  border-right-width: 0 !important;
+}
+.l-clipper__edge:nth-child(1):before {
+  top: -50%;
+  left: -50%;
+}
+.l-clipper__edge:nth-child(2) {
+  right: -6rpx;
+  top: -6rpx;
+  border-bottom-width: 0 !important;
+  border-left-width: 0 !important;
+}
+.l-clipper__edge:nth-child(2):before {
+  top: -50%;
+  left: 50%;
+}
+.l-clipper__edge:nth-child(3) {
+  left: -6rpx;
+  bottom: -6rpx;
+  border-top-width: 0 !important;
+  border-right-width: 0 !important;
+}
+.l-clipper__edge:nth-child(3):before {
+  bottom: -50%;
+  left: -50%;
+}
+.l-clipper__edge:nth-child(4) {
+  right: -6rpx;
+  bottom: -6rpx;
+  border-top-width: 0 !important;
+  border-left-width: 0 !important;
+}
+.l-clipper__edge:nth-child(4):before {
+  bottom: -50%;
+  left: 50%;
+}
+.l-clipper-image {
+  width: 100%;
+  border-style: none;
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 1;
+  -webkit-backface-visibility: hidden;
+  backface-visibility: hidden;
+  transform-origin: center;
+}
+.l-clipper-canvas {
+  position: fixed;
+  z-index: 10;
+  left: -200vw;
+  top: -200vw;
+  pointer-events: none;
+}
+.l-clipper-tools {
+  position: fixed;
+  left: 0;
+  bottom: 10px;
+  width: 100%;
+  z-index: 99;
+  color: #fff;
+}
+.l-clipper-tools__btns {
+  font-weight: bold;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 100%;
+  padding: 20rpx 40rpx;
+  box-sizing: border-box;
+}
+.l-clipper-tools__btns .cancel {
+  width: 112rpx;
+  height: 60rpx;
+  text-align: center;
+  line-height: 60rpx;
+}
+.l-clipper-tools__btns .confirm {
+  width: 112rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  background-color: #07c160;
+  border-radius: 6rpx;
+  text-align: center;
+}
+.l-clipper-tools__btns image {
+  display: block;
+  width: 60rpx;
+  height: 60rpx;
+}
+.l-clipper-tools__btns {
+  flex-direction: row;
+}

+ 816 - 0
components/limeClipper/limeClipper.vue

@@ -0,0 +1,816 @@
+<template>
+	<view class="l-clipper" :class="{open: value}" disable-scroll :style="'z-index: ' + zIndex + ';' + customStyle">
+		<view class="l-clipper-mask" @touchstart.stop.prevent="clipTouchStart" @touchmove.stop.prevent="clipTouchMove" @touchend.stop.prevent="clipTouchEnd">
+			<view class="l-clipper__content" :style="clipStyle"><view class="l-clipper__edge" v-for="(item, index) in [0, 0, 0, 0]" :key="index"></view></view>
+		</view>
+		<image
+			class="l-clipper-image"
+			@error="imageLoad"
+			@load="imageLoad"
+			@touchstart.stop.prevent="imageTouchStart"
+			@touchmove.stop.prevent="imageTouchMove"
+			@touchend.stop.prevent="imageTouchEnd"
+			:src="image"
+			:mode="imageWidth == 'auto' ? 'widthFix' : ''"
+			v-if="image"
+			:style="imageStyle"
+		/>
+		<canvas
+			:canvas-id="canvasId"
+			id="l-clipper"
+			disable-scroll
+			:style="'width: ' + canvasWidth * scaleRatio + 'px; height:' + canvasHeight * scaleRatio + 'px;'"
+			class="l-clipper-canvas"
+		></canvas>
+		<view class="l-clipper-tools">
+			<view class="l-clipper-tools__btns">
+				<view v-if="isShowCancelBtn" @tap="cancel">
+					<slot name="cancel" v-if="$slots.cancel" />
+					<view v-else class="cancel">取消</view>
+				</view>
+				<view v-if="isShowPhotoBtn" @tap="uploadImage">
+					<slot name="photo" v-if="$slots.photo" />
+					<image v-else src="@/static/limeClipper/photo.svg" />
+				</view>
+				<view v-if="isShowRotateBtn" @tap="rotate">
+					<slot name="rotate" v-if="$slots.rotate" />
+					<image v-else src="@/static/limeClipper/rotate.svg" data-type="inverse" />
+				</view>
+				<view v-if="isShowConfirmBtn" @tap="confirm">
+					<slot name="confirm" v-if="$slots.confirm" />
+					<view v-else class="confirm">确定</view>
+				</view>
+			</view>
+			<slot></slot>
+		</view>
+	</view>
+</template>
+
+<script>
+import { determineDirection, calcImageOffset, calcImageScale, calcImageSize, calcPythagoreanTheorem, clipTouchMoveOfCalculate, imageTouchMoveOfCalcOffset } from './utils';
+const cache = {}
+export default {
+	// version: '0.6.3',
+	name: 'l-clipper',
+	props: {
+		value: {
+			type: Boolean,
+			default: true
+		},
+		// #ifdef MP-WEIXIN
+		type: {
+			type: String,
+			default: '2d'
+		},
+		// #endif
+		customStyle: {
+			type: String,
+		},
+		canvasId: {
+			type: String,
+			default: 'l-clipper'
+		},
+		zIndex: {
+			type: Number,
+			default: 99
+		},
+		imageUrl: {
+			type: String
+		},
+		fileType: {
+			type: String,
+			default: 'png'
+		},
+		quality: {
+			type: Number,
+			default: 1
+		},
+		width: {
+			type: Number,
+			default: 400
+		},
+		height: {
+			type: Number,
+			default: 400
+		},
+		minWidth: {
+			type: Number,
+			default: 200
+		},
+		maxWidth: {
+			type: Number,
+			default: 600
+		},
+		minHeight: {
+			type: Number,
+			default: 200
+		},
+		maxHeight: {
+			type: Number,
+			default: 600
+		},
+		isLockWidth: {
+			type: Boolean,
+			default: false
+		},
+		isLockHeight: {
+			type: Boolean,
+			default: false
+		},
+		isLockRatio: {
+			type: Boolean,
+			default: true
+		},
+		scaleRatio: {
+			type: Number,
+			default: 1
+		},
+		minRatio: {
+			type: Number,
+			default: 0.5
+		},
+		maxRatio: {
+			type: Number,
+			default: 2
+		},
+		isDisableScale: {
+			type: Boolean,
+			default: false
+		},
+		isDisableRotate: {
+			type: Boolean,
+			default: false
+		},
+		isLimitMove: {
+			type: Boolean,
+			default: false
+		},
+		isShowPhotoBtn: {
+			type: Boolean,
+			default: true
+		},
+		isShowRotateBtn: {
+			type: Boolean,
+			default: true
+		},
+		isShowConfirmBtn: {
+			type: Boolean,
+			default: true
+		},
+		isShowCancelBtn: {
+			type: Boolean,
+			default: true
+		},
+		rotateAngle: {
+			type: Number,
+			default: 90
+		},
+		source: {
+			type: Object,
+			default: () => ({
+					album: '从相册中选择',
+					camera: '拍照',
+					// #ifdef MP-WEIXIN
+					message: '从微信中选择'
+					// #endif
+				})
+		}
+	},
+	data() {
+		return {
+			canvasWidth: 0,
+			canvasHeight: 0,
+			clipX: 0,
+			clipY: 0,
+			clipWidth: 0,
+			clipHeight: 0,
+			animation: false,
+			imageWidth: 0,
+			imageHeight: 0,
+			imageTop: 0,
+			imageLeft: 0,
+			scale: 1,
+			angle: 0,
+			image: this.imageUrl,
+			sysinfo: {},
+			throttleTimer: null,
+			throttleFlag: true,
+			timeClipCenter: null,
+			flagClipTouch: false,
+			flagEndTouch: false,
+			clipStart: {},
+			animationTimer: null,
+			touchRelative: [{x: 0,y: 0}],
+			hypotenuseLength: 0,
+			ctx: null
+		};
+	},
+	computed: {
+		clipStyle() {
+			const {clipWidth, clipHeight, clipY, clipX, animation} = this
+			return  `
+			width: ${clipWidth}px;
+			height:${clipHeight}px;
+			transition-property: ${animation ? '' : 'background'};
+			left: ${clipX}px;
+			top: ${clipY}px
+			`
+		},
+		imageStyle() {
+			const {imageWidth, imageHeight, imageLeft, imageTop, animation, scale, angle} = this
+			return `
+				width: ${imageWidth ? imageWidth + 'px' : 'auto'};
+				height: ${imageHeight ? imageHeight + 'px' : 'auto'};
+				transform: translate3d(${imageLeft - imageWidth / 2}px, ${imageTop - imageHeight / 2}px, 0) scale(${scale}) rotate(${angle}deg);
+				transition-duration: ${animation ? 0.35 : 0}s
+			`
+		},
+		clipSize() {
+			const { clipWidth, clipHeight } = this;
+			return { clipWidth, clipHeight };
+		},
+		clipPoint() {
+			const { clipY, clipX } = this;
+			return { clipY, clipX };
+		}
+	},
+	watch: {
+		value(val) {
+			if(!val) {
+				this.animation = 0
+				this.angle = 0
+			} else {
+				if(this.imageUrl) {
+					const {imageWidth, imageHeight, imageLeft, imageTop, scale, clipX, clipY, clipWidth, clipHeight, path} = cache?.[this.imageUrl] || {}
+					if(path != this.image) {
+						this.image = this.imageUrl;
+					} else {
+						this.setDiffData({imageWidth, imageHeight, imageLeft, imageTop, scale, clipX, clipY, clipWidth, clipHeight})
+					}
+					
+				}
+				
+			}
+		},
+		imageUrl(url) {
+			this.image = url
+		},
+		image:{
+			handler: async function(url) {
+				this.getImageInfo(url)
+			},
+			// immediate: true,
+		},
+		clipSize({ widthVal, heightVal }) {
+			let { minWidth, minHeight } = this;
+			minWidth = minWidth / 2;
+			minHeight = minHeight / 2;
+			if (widthVal < minWidth) {
+				this.setDiffData({clipWidth: minWidth})
+			}
+			if (heightVal < minHeight) {
+				this.setDiffData({clipHeight: minHeight})
+			}
+			this.calcClipSize();
+		},
+		angle(val) {
+			this.animation = true;
+			this.moveStop();
+			const { isLimitMove } = this;
+			if (isLimitMove && val % 90) {
+				this.setDiffData({
+					angle: Math.round(val / 90) * 90
+				})
+			}
+			this.imgMarginDetectionScale();
+		},
+		animation(val) {
+			clearTimeout(this.animationTimer);
+			if (val) {
+				let animationTimer = setTimeout(() => {
+					this.setDiffData({
+						animation: false
+					})
+				}, 260);
+				this.setDiffData({animationTimer})
+				this.animationTimer = animationTimer;
+			}
+		},
+		isLimitMove(val) {
+			if (val) {
+				if (this.angle % 90) {
+					this.setDiffData({
+						angle : Math.round(this.angle / 90) * 90
+					})
+				}
+				this.imgMarginDetectionScale();
+			}
+		},
+		clipPoint() {
+			this.cutDetectionPosition();
+		},
+		width(width, oWidth) {
+			if (width !== oWidth) {
+				this.setDiffData({
+					clipWidth:  width / 2
+				})
+			}
+		},
+		height(height, oHeight) {
+			if (height !== oHeight) {
+				this.setDiffData({
+					clipHeight:  height / 2
+				})
+			}
+		}
+	},
+	mounted() {
+		const sysinfo = uni.getSystemInfoSync();
+		this.sysinfo = sysinfo;
+		this.setClipInfo();
+		if(this.image) {
+			this.getImageInfo(this.image)
+		}
+		this.setClipCenter();
+		this.calcClipSize();
+		this.cutDetectionPosition();
+	},
+	methods: {
+		setDiffData(data) {
+			Object.keys(data).forEach(key => {
+			  if (this[key] !== data[key]) {
+				this[key] = data[key];
+			  }
+			});
+		},
+		getImageInfo(url) {
+			if (!url) return;
+			if(this.value) {
+				uni.showLoading({
+					title: '请稍候...',
+					mask: true
+				});
+			}
+			uni.getImageInfo({
+				src: url,
+				success: res => {
+					this.imgComputeSize(res.width, res.height);
+					this.image = res.path;
+					if (this.isLimitMove) {
+						this.imgMarginDetectionScale();
+						this.$emit('ready', res);
+					}
+					const {imageWidth, imageHeight, imageLeft, imageTop, scale, clipX, clipY, clipWidth, clipHeight} = this
+					cache[url] = Object.assign(res, {imageWidth, imageHeight, imageLeft, imageTop, scale, clipX, clipY, clipWidth, clipHeight});
+				},
+				fail: (err) => {
+					this.imgComputeSize();
+					if (this.isLimitMove) {
+						this.imgMarginDetectionScale();
+					}
+				}
+			});
+			
+		},
+		setClipInfo() {
+			const { width, height, sysinfo, canvasId } = this;
+			const clipWidth = width / 2;
+			const clipHeight = height / 2;
+			const clipY = (sysinfo.windowHeight - clipHeight) / 2;
+			const clipX = (sysinfo.windowWidth - clipWidth) / 2;
+			const imageLeft = sysinfo.windowWidth / 2;
+			const imageTop = sysinfo.windowHeight / 2;
+			this.ctx = uni.createCanvasContext(canvasId, this);
+			this.clipWidth = clipWidth;
+			this.clipHeight = clipHeight;
+			this.clipX = clipX;
+			this.clipY = clipY;
+			this.canvasHeight = clipHeight;
+			this.canvasWidth = clipWidth;
+			this.imageLeft = imageLeft;
+			this.imageTop = imageTop;
+		},
+		setClipCenter() {
+			const { sysInfo, clipHeight, clipWidth, imageTop, imageLeft } = this;
+			let sys = sysInfo || uni.getSystemInfoSync();
+			let clipY = (sys.windowHeight - clipHeight) * 0.5;
+			let clipX = (sys.windowWidth - clipWidth) * 0.5;
+			this.imageTop = imageTop - this.clipY + clipY;
+			this.imageLeft = imageLeft - this.clipX + clipX;
+			this.clipY = clipY;
+			this.clipX = clipX;
+		},
+		calcClipSize() {
+			const { clipHeight, clipWidth, sysinfo, clipX, clipY } = this;
+			if (clipWidth > sysinfo.windowWidth) {
+				this.setDiffData({
+					clipWidth:  sysinfo.windowWidth
+				})
+			} else if (clipWidth + clipX > sysinfo.windowWidth) {
+				this.setDiffData({
+					clipX: sysinfo.windowWidth - clipX
+				})
+			}
+			if (clipHeight > sysinfo.windowHeight) {
+				this.setDiffData({
+					clipHeight: sysinfo.windowHeight
+				})
+			} else if (clipHeight + clipY > sysinfo.windowHeight) {
+				this.clipY = sysinfo.windowHeight - clipY;
+				this.setDiffData({
+					clipY: sysinfo.windowHeight - clipY
+				})
+			}
+		},
+		cutDetectionPosition() {
+			const { clipX, clipY, sysinfo, clipHeight, clipWidth } = this;
+			let cutDetectionPositionTop = () => {
+					if (clipY < 0) {
+						this.setDiffData({clipY: 0})
+					}
+					if (clipY > sysinfo.windowHeight - clipHeight) {
+						this.setDiffData({clipY: sysinfo.windowHeight - clipHeight})
+					}
+				},
+				cutDetectionPositionLeft = () => {
+					if (clipX < 0) {
+						this.setDiffData({clipX: 0})
+					}
+					if (clipX > sysinfo.windowWidth - clipWidth) {
+						this.setDiffData({clipX: sysinfo.windowWidth - clipWidth})
+					}
+				};
+			if (clipY === null && clipX === null) {
+				let newClipY = (sysinfo.windowHeight - clipHeight) * 0.5;
+				let newClipX = (sysinfo.windowWidth - clipWidth) * 0.5;
+				this.setDiffData({
+					clipX: newClipX,
+					clipY: newClipY
+				})
+			} else if (clipY !== null && clipX !== null) {
+				cutDetectionPositionTop();
+				cutDetectionPositionLeft();
+			} else if (clipY !== null && clipX === null) {
+				cutDetectionPositionTop();
+				this.setDiffData({
+					clipX: (sysinfo.windowWidth - clipWidth) / 2
+				})
+			} else if (clipY === null && clipX !== null) {
+				cutDetectionPositionLeft();
+				this.setDiffData({
+					clipY: (sysinfo.windowHeight - clipHeight) / 2
+				})
+			}
+		},
+		imgComputeSize(width, height) {
+			const { imageWidth, imageHeight } = calcImageSize(width, height, this);
+			this.imageWidth = imageWidth;
+			this.imageHeight = imageHeight;
+		},
+		imgMarginDetectionScale(scale) {
+			if (!this.isLimitMove) return;
+			const currentScale = calcImageScale(this, scale);
+			this.imgMarginDetectionPosition(currentScale);
+		},
+		imgMarginDetectionPosition(scale) {
+			if (!this.isLimitMove) return;
+			const { scale: currentScale, left, top } = calcImageOffset(this, scale);
+			this.setDiffData({
+				imageLeft: left,
+				imageTop: top,
+				scale: currentScale
+			})
+		},
+		throttle() {
+			this.setDiffData({
+				throttleFlag: true
+			})
+		},
+		moveDuring() {
+			clearTimeout(this.timeClipCenter);
+		},
+		moveStop() {
+			clearTimeout(this.timeClipCenter);
+			const timeClipCenter = setTimeout(() => {
+				if (!this.animation) {
+					this.setDiffData({animation: true})
+				}
+				this.setClipCenter();
+			}, 800);
+			this.setDiffData({timeClipCenter})
+		},
+		clipTouchStart(event) {
+			// #ifdef H5
+			event.preventDefault()
+			// #endif
+			if (!this.image) {
+				uni.showToast({
+					title: '请选择图片',
+					icon: 'none'
+				});
+				return;
+			}
+			const currentX = event.touches[0].clientX;
+			const currentY = event.touches[0].clientY;
+			const { clipX, clipY, clipWidth, clipHeight } = this;
+			const corner = determineDirection(clipX, clipY, clipWidth, clipHeight, currentX, currentY);
+			this.moveDuring();
+			if(!corner) {return}
+			this.clipStart = {
+				width: clipWidth,
+				height: clipHeight,
+				x: currentX,
+				y: currentY,
+				clipY,
+				clipX,
+				corner
+			};
+			this.flagClipTouch = true;
+			this.flagEndTouch = true;
+		},
+		clipTouchMove(event) {
+			// #ifdef H5
+			event.stopPropagation()
+			event.preventDefault()
+			// #endif
+			if (!this.image) {
+				uni.showToast({
+					title: '请选择图片',
+					icon: 'none'
+				});
+				return;
+			}
+			// 只针对单指点击做处理
+			if (event.touches.length !== 1) {
+				return;
+				
+			}
+			const { flagClipTouch, throttleFlag } = this;
+			if (flagClipTouch && throttleFlag) {
+				const { isLockRatio, isLockHeight, isLockWidth } = this;
+				if (isLockRatio && (isLockWidth || isLockHeight)) return;
+				this.setDiffData({
+					throttleFlag: false
+				})
+				this.throttle();
+				const clipData = clipTouchMoveOfCalculate(this, event);
+				if(clipData) {
+					const { width, height, clipX, clipY } = clipData;
+					if (!isLockWidth && !isLockHeight) {
+						this.setDiffData({
+							clipWidth: width,
+							clipHeight: height,
+							clipX,
+							clipY
+						})
+					} else if (!isLockWidth) {
+						this.setDiffData({
+							clipWidth: width,
+							clipX
+						})
+					} else if (!isLockHeight) {
+						this.setDiffData({
+							clipHeight: height,
+							clipY
+						})
+					}
+					this.imgMarginDetectionScale();
+				}
+
+			}
+		},
+		clipTouchEnd() {
+			this.moveStop();
+			this.flagClipTouch = false;
+		},
+		imageTouchStart(e) {
+			// #ifdef H5
+			event.preventDefault()
+			// #endif
+			this.flagEndTouch = false;
+			const { imageLeft, imageTop } = this;
+			const clientXForLeft = e.touches[0].clientX;
+			const clientYForLeft = e.touches[0].clientY;
+
+			let touchRelative = [];
+			if (e.touches.length === 1) {
+				touchRelative[0] = {
+					x: clientXForLeft - imageLeft,
+					y: clientYForLeft - imageTop
+				};
+				this.touchRelative = touchRelative;
+			} else {
+				const clientXForRight = e.touches[1].clientX;
+				const clientYForRight = e.touches[1].clientY;
+				let width = Math.abs(clientXForLeft - clientXForRight);
+				let height = Math.abs(clientYForLeft - clientYForRight);
+				const hypotenuseLength = calcPythagoreanTheorem(width, height);
+
+				touchRelative = [
+					{
+						x: clientXForLeft - imageLeft,
+						y: clientYForLeft - imageTop
+					},
+					{
+						x: clientXForRight - imageLeft,
+						y: clientYForRight - imageTop
+					}
+				];
+				this.touchRelative = touchRelative;
+				this.hypotenuseLength = hypotenuseLength;
+			}
+		},
+		imageTouchMove(e) {
+			// #ifdef H5
+			event.preventDefault()
+			// #endif
+			const { flagEndTouch, throttleFlag } = this;
+			if (flagEndTouch || !throttleFlag) return;
+			const clientXForLeft = e.touches[0].clientX;
+			const clientYForLeft = e.touches[0].clientY;
+			this.setDiffData({throttleFlag: false})
+			this.throttle();
+			this.moveDuring();
+			if (e.touches.length === 1) {
+				const { left: imageLeft, top:  imageTop} = imageTouchMoveOfCalcOffset(this, clientXForLeft, clientYForLeft);
+				this.setDiffData({
+					imageLeft,
+					imageTop
+				})
+				this.imgMarginDetectionPosition();
+			} else {
+				const clientXForRight = e.touches[1].clientX;
+				const clientYForRight = e.touches[1].clientY;
+				let width = Math.abs(clientXForLeft - clientXForRight),
+					height = Math.abs(clientYForLeft - clientYForRight),
+					hypotenuse = calcPythagoreanTheorem(width, height),
+					scale = this.scale * (hypotenuse / this.hypotenuseLength);
+				if (this.isDisableScale) {
+
+					scale = 1;
+				} else {
+					scale = scale <= this.minRatio ? this.minRatio : scale;
+					scale = scale >= this.maxRatio ? this.maxRatio : scale;
+					this.$emit('change', {
+						width: this.imageWidth * scale,
+						height: this.imageHeight * scale
+					});
+				}
+
+				this.imgMarginDetectionScale(scale);
+				this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
+				this.scale = scale;
+			}
+		},
+		imageTouchEnd() {
+			this.setDiffData({
+				flagEndTouch: true
+			})
+			this.moveStop();
+		},
+		uploadImage() {
+			const itemList = Object.entries(this.source)
+			const sizeType = ['original', 'compressed']
+			const success = ({tempFilePaths:a, tempFiles: b}) => {
+				this.image = a ? a[0] : b[0].path
+			};
+			const _uploadImage = (type) => {
+				if(type !== 'message') {
+					uni.chooseImage({
+						count: 1,
+						sizeType,
+						sourceType: [type],
+						success
+					});
+				}
+				// #ifdef MP-WEIXIN
+				if(type == 'message') {
+					wx.chooseMessageFile({
+					  count: 1,
+					  type: 'image',
+					  success
+					})
+				}
+				// #endif
+			}
+			if(itemList.length > 1) {
+				uni.showActionSheet({
+					itemList: itemList.map(v => v[1]),
+					success: ({tapIndex: i}) => {
+						_uploadImage(itemList[i][0])
+					}
+				})
+			} else {
+				_uploadImage(itemList[0][0])
+			}
+		},
+		imageReset() {
+			const sys = this.sysinfo || uni.getSystemInfoSync();
+			this.scale = 1;
+			this.angle = 0;
+			this.imageTop = sys.windowHeight / 2;
+			this.imageLeft = sys.windowWidth / 2;
+		},
+		imageLoad(e) {
+			this.imageReset();
+			uni.hideLoading();
+			this.$emit('ready', e.detail);
+		},
+		rotate(event) {
+			if (this.isDisableRotate) return;
+			if (!this.image) {
+				uni.showToast({
+					title: '请选择图片',
+					icon: 'none'
+				});
+				return;
+			}
+			const { rotateAngle } = this;
+			const originAngle = this.angle
+			const type = event.currentTarget.dataset.type;
+			if (type === 'along') {
+				this.angle = originAngle + rotateAngle
+			} else {
+				this.angle = originAngle - rotateAngle
+			}
+			this.$emit('rotate', this.angle);
+		},
+		confirm() {
+			if (!this.image) {
+				uni.showToast({
+					title: '请选择图片',
+					icon: 'none'
+				});
+				return;
+			}
+			uni.showLoading({
+				title: '加载中'
+			});
+			const { canvasHeight, canvasWidth, clipHeight, clipWidth, ctx, scale, imageLeft, imageTop, clipX, clipY, angle, scaleRatio: dpr, image, quality, fileType, type: imageType, canvasId } = this;
+			const draw = () => {
+				const imageWidth = this.imageWidth * scale * dpr;
+				const imageHeight = this.imageHeight * scale * dpr;
+				const xpos = imageLeft - clipX;
+				const ypos = imageTop - clipY;
+				ctx.translate(xpos * dpr, ypos * dpr);
+				ctx.rotate((angle * Math.PI) / 180);
+				ctx.drawImage(image, -imageWidth / 2, -imageHeight / 2, imageWidth, imageHeight);
+				ctx.draw(false, () => {
+					const width = clipWidth * dpr
+					const height = clipHeight * dpr
+					let params = {
+						x: 0,
+						y: 0,
+						width,
+						height,
+						destWidth: width,
+						destHeight: height,
+						canvasId: canvasId,
+						fileType,
+						quality,
+						success: (res) => {
+							data.url = res.tempFilePath;
+							uni.hideLoading();
+							this.$emit('success', data);
+							this.$emit('input', false)
+						},
+						fail: (error) => {
+							console.error('error', error)
+							this.$emit('fail', error);
+							this.$emit('input', false)
+						}
+					};
+
+					let data = {
+						url: '',
+						width,
+						height
+					};
+					uni.canvasToTempFilePath(params, this)
+				});
+			};
+
+			if (canvasWidth !== clipWidth || canvasHeight !== clipHeight) {
+				this.canvasWidth = clipWidth;
+				this.canvasHeight = clipHeight;
+				ctx.draw();
+				this.$nextTick(() => {
+					setTimeout(() => {
+						draw();
+					}, 100);
+				})
+			} else {
+				draw();
+			}
+		},
+		cancel() {
+			this.$emit('cancel', false)
+			this.$emit('input', false)
+		},
+	}
+};
+</script>
+
+<style scoped>
+@import './index'
+</style>

+ 244 - 0
components/limeClipper/utils.js

@@ -0,0 +1,244 @@
+/**
+ * 判断手指触摸位置
+ */
+export function determineDirection(clipX, clipY, clipWidth, clipHeight, currentX, currentY) {
+	/*
+	 * (右下>>1 右上>>2 左上>>3 左下>>4)
+	 */
+	let corner;
+	/**
+	 * 思路:(利用直角坐标系)
+	 *  1.找出裁剪框中心点
+	 *  2.如点击坐标在上方点与左方点区域内,则点击为左上角
+	 *  3.如点击坐标在下方点与右方点区域内,则点击为右下角
+	 *  4.其他角同理
+	 */
+	const mainPoint = [clipX + clipWidth / 2, clipY + clipHeight / 2]; // 中心点
+	const currentPoint = [currentX, currentY]; // 触摸点
+
+	if (currentPoint[0] <= mainPoint[0] && currentPoint[1] <= mainPoint[1]) {
+		corner = 3; // 左上
+	} else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] <= mainPoint[1]) {
+		corner = 2; // 右上
+	} else if (currentPoint[0] <= mainPoint[0] && currentPoint[1] >= mainPoint[1]) {
+		corner = 4; // 左下
+	} else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] >= mainPoint[1]) {
+		corner = 1; // 右下
+	}
+
+	return corner;
+}
+
+/**
+ * 图片边缘检测检测时,计算图片偏移量
+ */
+export function calcImageOffset(data, scale) {
+	let left = data.imageLeft;
+	let top = data.imageTop;
+	scale = scale || data.scale;
+	
+	let imageWidth = data.imageWidth;
+	  let imageHeight = data.imageHeight;
+	  if ((data.angle / 90) % 2) {
+	    imageWidth = data.imageHeight;
+	    imageHeight = data.imageWidth;
+	  }
+	  const {
+	      clipX,
+	      clipWidth,
+	      clipY,
+	      clipHeight
+	    } = data;
+
+	// 当前图片宽度/高度
+	const currentImageSize = (size) => (size * scale) / 2;
+	const currentImageWidth = currentImageSize(imageWidth);
+	const currentImageHeight = currentImageSize(imageHeight);
+
+	left = clipX + currentImageWidth >= left ? left : clipX + currentImageWidth;
+	left = clipX + clipWidth - currentImageWidth <= left ? left : clipX + clipWidth - currentImageWidth;
+	top = clipY + currentImageHeight >= top ? top : clipY + currentImageHeight;
+	top = clipY + clipHeight - currentImageHeight <= top ? top : clipY + clipHeight - currentImageHeight;
+	return {
+		left,
+		top,
+		scale
+	};
+}
+
+/**
+ * 图片边缘检测时,计算图片缩放比例
+ */
+export function calcImageScale(data, scale) {
+	scale = scale || data.scale;
+	let {
+		imageWidth,
+		imageHeight,
+		clipWidth,
+		clipHeight,
+		angle
+	} = data
+	if ((angle / 90) % 2) {
+		imageWidth = imageHeight;
+		imageHeight = imageWidth;
+	}
+	if (imageWidth * scale < clipWidth) {
+		scale = clipWidth / imageWidth;
+	}
+	if (imageHeight * scale < clipHeight) {
+		scale = Math.max(scale, clipHeight / imageHeight);
+	}
+	return scale;
+}
+
+/**
+ * 计算图片尺寸
+ */
+export function calcImageSize(width, height, data) {
+	let imageWidth = width,
+		imageHeight = height;
+	let {
+		clipWidth,
+		clipHeight,
+		sysinfo,
+		width: originWidth,
+		height: originHeight
+	} = data
+	if (imageWidth && imageHeight) {
+		if (imageWidth / imageHeight > (clipWidth || originWidth) / (clipWidth || originHeight)) {
+			imageHeight = clipHeight || originHeight;
+			imageWidth = (width / height) * imageHeight;
+		} else {
+			imageWidth = clipWidth || originWidth;
+			imageHeight = (height / width) * imageWidth;
+		}
+	} else {
+		let sys = sysinfo || uni.getSystemInfoSync();
+		imageWidth = sys.windowWidth;
+		imageHeight = 0;
+	}
+	return {
+		imageWidth,
+		imageHeight
+	};
+}
+
+/**
+ * 勾股定理求斜边
+ */
+export function calcPythagoreanTheorem(width, height) {
+	return Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
+}
+
+/**
+ * 拖动裁剪框时计算
+ */
+export function clipTouchMoveOfCalculate(data, event) {
+	const clientX = event.touches[0].clientX;
+	const clientY = event.touches[0].clientY;
+
+	let {
+		clipWidth,
+		clipHeight,
+		clipY: oldClipY,
+		clipX: oldClipX,
+		clipStart,
+		isLockRatio,
+		maxWidth,
+		minWidth,
+		maxHeight,
+		minHeight
+	} = data;
+	maxWidth = maxWidth / 2;
+	minWidth = minWidth / 2;
+	minHeight = minHeight / 2;
+	maxHeight = maxHeight / 2;
+
+	let width = clipWidth,
+		height = clipHeight,
+		clipY = oldClipY,
+		clipX = oldClipX,
+		// 获取裁剪框实际宽度/高度
+		// 如果大于最大值则使用最大值
+		// 如果小于最小值则使用最小值
+		sizecorrect = () => {
+			width = width <= maxWidth ? (width >= minWidth ? width : minWidth) : maxWidth;
+			height = height <= maxHeight ? (height >= minHeight ? height : minHeight) : maxHeight;
+		},
+		sizeinspect = () => {
+			sizecorrect();
+			if ((width > maxWidth || width < minWidth || height > maxHeight || height < minHeight) && isLockRatio) {
+				return false;
+			} else {
+				return true;
+			}
+		};
+	//if (clipStart.corner) {
+	height = clipStart.height + (clipStart.corner > 1 && clipStart.corner < 4 ? 1 : -1) * (clipStart.y - clientY);
+	//}
+	switch (clipStart.corner) {
+		case 1:
+			width = clipStart.width - clipStart.x + clientX;
+			if (isLockRatio) {
+				height = width / (clipWidth / clipHeight);
+			}
+			if (!sizeinspect()) return;
+			break;
+		case 2:
+			width = clipStart.width - clipStart.x + clientX;
+			if (isLockRatio) {
+				height = width / (clipWidth / clipHeight);
+			}
+			if (!sizeinspect()) {
+				return;
+			} else {
+				clipY = clipStart.clipY - (height - clipStart.height);
+			}
+
+			break;
+		case 3:
+			width = clipStart.width + clipStart.x - clientX;
+			if (isLockRatio) {
+				height = width / (clipWidth / clipHeight);
+			}
+			if (!sizeinspect()) {
+				return;
+			} else {
+				clipY = clipStart.clipY - (height - clipStart.height);
+				clipX = clipStart.clipX - (width - clipStart.width);
+			}
+
+			break;
+		case 4:
+			width = clipStart.width + clipStart.x - clientX;
+			if (isLockRatio) {
+				height = width / (clipWidth / clipHeight);
+			}
+			if (!sizeinspect()) {
+				return;
+			} else {
+				clipX = clipStart.clipX - (width - clipStart.width);
+			}
+			break;
+		default:
+			break;
+	}
+	return {
+		width,
+		height,
+		clipX,
+		clipY
+	};
+}
+
+/**
+ * 单指拖动图片计算偏移
+ */
+export function imageTouchMoveOfCalcOffset(data, clientXForLeft, clientYForLeft) {
+	let left = clientXForLeft - data.touchRelative[0].x,
+		top = clientYForLeft - data.touchRelative[0].y;
+	return {
+		left,
+		top
+	};
+}

+ 12 - 1
pages.json

@@ -143,7 +143,18 @@
                 "enablePullDownRefresh": false
             }
             
-        }
+        }
+		
+		
+		,{
+		    "path" : "pages/mine/cropImage",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
         ,{
             "path" : "pages/mine/personalPage",
             "style" :                                                                                    

+ 163 - 76
pages/login/index.vue

@@ -1,38 +1,59 @@
 <template>
 	<view>
-		<view class="login-logo">
-			<u-image width="120rpx" height="120rpx" src="@/assets/img/logo.png" border-radius="20"></u-image>
-			<h3>荆州市地方铁路有限公司</h3>
 		
-		</view>
-		<view class="login-form">
-			<u-form :model="form" ref="uForm">
-				<view class="login-form-row">
-					<u-icon name="user-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="40"></u-icon>
-					<u-line color="#d9e0ec" length="20" direction="col" margin="10px"/>
-					<u-form-item label="" prop="phone"  :border-bottom="false">
-						<u-input  v-model="form.phone" placeholder="请输入手机号"  />
-					</u-form-item>
-				</view>
-				<view class="login-form-row">
-					<u-icon name="message-3-fill" custom-prefix="custom-icon" color="#b0b8c8" size="40"></u-icon>
-					<u-line color="#d9e0ec" length="20" direction="col" margin="10px"/>
-					<u-form-item label="" prop="code"  :border-bottom="false">
-						<u-input v-model="form.code"  placeholder="请输入验证码" />
-					</u-form-item>
-				</view>
-				<view class="login-code" >
-					<span  @click="getCode" >{{codeTips}}</span>
+		<view class="main">
+			<view class="close" @click="goBack">
+				<u-icon name="close" size="32" color="#101010"></u-icon>
+			</view>
+			<view class="logo">
+				<img src="../../assets/img/logo.png" alt="">
+			</view>
+			<view class="name">
+				荆州市地方铁路有限公司
+			</view>
+
+			<view class="login">
+				<view class="login-box">
+					<view class="tel">
+						<view class="icon">
+							<u-icon name="account-fill" size="40" color="#1F4A99 "></u-icon>
+
+						</view>
+						<u-line color="red" direction="col" length="40rpx" margin="auto 0" />
+						<view class="tips">
+							<u-input type="number"  v-model="form.phone" placeholder="请填写系统预留手机号码" />
+						</view>
+					</view>
+					<view class="pwd">
+						<view class="icon">
+							<u-icon name="chat-fill" size="40"></u-icon>
+
+						</view>
+						<u-line color="red" direction="col" length="40rpx" margin="auto 0" />
+						<view class="tips">
+							<view class="input">
+								<u-input type="number" v-model="form.code"  placeholder="请输入验证码" />
+							</view>
+							<view class="verification-code"  @click="getCode"  >{{codeTips}}</view>
+							<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start">
+							</u-verification-code>
+						</view>
+					</view>
 				</view>
-			</u-form>
-			<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start">
-			</u-verification-code>
-			<u-button  style="    margin-top: 30px;"
-			 :class="{
-			 	'login-btn':!(form.phone&&form.code)
-			 }" type="primary"
-			 @click="finish">登录</u-button>
+			</view>
+			
+			<view class="btn">
+				<button
+				:class="{
+					'login-btn':!(form.phone&&form.code)
+				}" type="primary"
+				@click="finish"
+				
+				>登录</button>
+				
+			</view>
 		</view>
+		
 	</view>
 </template>
 
@@ -46,13 +67,10 @@
 			return {
 				form: {
 					name: '',
-					intro: '',
-				
+					
 					phone: '',
 					code: '',
 				},
-				backUrl: "",
-				message: "",
 				codeTips: '',
 				isSendMsgIng: false,
 				sendMsgSecond: 60 * 2,
@@ -63,15 +81,23 @@
 		},
 		onLoad(op) {
 		
-			this.message = op.message;
-			this.backUrl = op.back;
+			// this.message = op.message;
+			// this.backUrl = op.back;
 			if (op.phone) {
 				this.form.phone = op.phone;
 			}
 		
+		},
+		onReady() {
+			this.query()
+			
 		},
 		methods: {
-		codeChange(text) {
+			goBack(){
+				uni.redirectTo({
+					url: '/'
+				})
+			},codeChange(text) {
 				this.codeTips = text;
 			},
 			//倒计时
@@ -231,51 +257,99 @@
 					}
 				})
 			}
-		},
-		onReady() {
-			this.query()
-			
 		}
 	}
 </script>
-<style>
-	page{
-		background: url(../../assets/img/bgbg.png) no-repeat;
-		background-size: 100%;
-	}
-</style>
+
 <style lang="scss" scoped>
-	.login-logo{
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		padding-top: 20%;
-		h3{
-			margin:15px 0;
-		}
-	}
-	/deep/.u-form-item{
-		padding: 0;
-		flex: 1;
+	page {
+	   background: url("../../assets/img/bgc.png");
 	}
-	.login-form{
-		width: 80%;
-		margin:50px auto 0;
-	}
-	.login-form-row{
-		height: 40px;
-		border: 1px solid #c7d1e2;
-		background-color: #fff;
-		border-radius: 10px;
-		display: flex;
-		align-items: center;
-		padding: 2px 10px;
-		margin-bottom: 15px;
+
+	
+
+	.main {
+		width: 100%;
+		padding-top:240rpx;
+		position: relative;
+        .close{
+			position: absolute;
+			top: 24rpx;
+			left: 24rpx;
+		}
+		.logo {
+			display: flex;
+			justify-content: center;
+		}
+
+		.name {
+			color: rgba(16, 16, 16, 1);
+			font-size: 20px;
+			text-align: center;
+			font-weight: bold;
+			margin-top: 8rpx;
+		}
+
 	}
-	.login-code{
-		text-align: right;
-		span{
-			color:#005AD9;
+
+	.login-box {
+		margin-top: 160rpx;
+
+		.tel {
+			/deep/.u-input {
+				width: 400rpx;
+			}
+		}
+
+		.tel,
+		.pwd {
+			display: flex;
+			width: 74.4%;
+			height: 80rpx;
+			line-height: 80rpx;
+			color: rgba(183, 172, 172, 1);
+			margin: auto;
+			margin-bottom: 36rpx;
+			border: 1px solid rgba(31, 74, 153, 1);
+			box-shadow: 0px 0px 8rpx 0px rgba(0, 90, 217, 50);
+			border-radius: 8px;
+
+			.icon {
+				width: 14%;
+				text-align: center;
+
+				img {
+					vertical-align: middle;
+				}
+			}
+
+
+			.tips {
+				text-indent: 16rpx;
+				padding-right: 16rpx;
+				display: flex;
+				justify-content: space-between;
+
+				/deep/uni-input {
+					height: 80rpx !important;
+					line-height: 80rpx !important;
+				}
+
+				.input {
+					width: 50%;
+				}
+			}
+
+			// 验证码
+			.verification-code {
+				color: #1F4A99;
+				line-height: 80rpx;
+			}
+		}
+
+		.pwd {
+			border: 1px solid rgba(193, 204, 223, 1);
+			box-shadow: none;
 		}
 	}
 	.login-btn{
@@ -284,4 +358,17 @@
 		color:#fff;
 		margin-top: 30px;
 	}
+  .btn{
+	  width: 100%;
+	  margin-top: 120rpx;
+	  
+	  uni-button{
+		  margin:0 96rpx;
+		  height: 40px;
+		  border-radius: 8px;
+		  background-color: rgba(31, 74, 153, 1);
+		  color: rgba(255, 255, 255, 1);
+		  font-size: 16px;
+	  }
+  }
 </style>

+ 38 - 0
pages/mine/cropImage.vue

@@ -0,0 +1,38 @@
+<template>
+	<view class="content" >
+		<limeClipper :width="options.width" :scale-ratio="2" :is-lock-width="false" :is-lock-height="false" :height="options.height" :image-url="path"  
+			@success="successFn" @cancel="cancel"  />
+	</view>
+</template>
+<script>
+import limeClipper from '@/components/limeClipper/limeClipper.vue';
+export default {
+	components: {limeClipper},
+	data() {return {path: '',options:{"width":600,"height":600}}},
+	onLoad({path,options}) {
+		this.path = path
+		//('path-path-path-path',path);
+		if(options){
+			this.options = JSON.parse(options)
+		}
+	},
+	methods:{
+		successFn(e){
+			this.getOpenerEventChannel().emit('success',e.url)
+			uni.navigateBack()
+		},
+		cancel(){
+			uni.navigateBack()
+		}
+	}
+}
+</script>
+
+<style>
+	.box{
+		width: 400rpx;
+	}
+	.mt{
+		margin-top: -10px;
+	}
+</style>

+ 151 - 6
pages/mine/data.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<u-navbar title="编辑个人资料">
-			<view class="slot-wrap">
+			<view class="slot-wrap" @click="submit">
 				保存
 			</view>	
 		</u-navbar>
@@ -10,9 +10,11 @@
 				<view class="data-icon">
 					<u-icon name="camera-fill"  color="#fff" size="32"></u-icon>
 				</view>
-				<u-avatar  size="160" ></u-avatar>
+				<img v-if="form.headImg" :src="form.headImg" style="width: 160rpx;" alt="">
+				
+				<u-avatar v-else  size="160" ></u-avatar>
 			</view>
-			<view class="change">
+			<view class="change"  @click="uploadPhoto" >
 				点击更换头像
 			</view>
 			
@@ -21,7 +23,7 @@
 					昵称
 				</view>
 				<view class="input">
-					<input type="text">
+					<input type="text" placeholder="修改昵称"  v-model="form.name" >
 				</view>
 			</view>
 		</view>
@@ -29,14 +31,157 @@
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/user.js'
+	import * as API_common from '@/apis/common.js'
+	
 	export default {
 		data() {
 			return {
-				
+				plusInfo:{},
+				userInfo:{},
+				form:{},
 			}
 		},
-		methods: {
+		onLoad() {
+			this.plusInfo=this.carhelp.getPersonInfoPlus();
+			this.userInfo=this.carhelp.getPersonInfo();
+			this.form={
+				name:this.userInfo.name,
+				headImg:this.userInfo.headImg
+			}
 			
+		},
+		methods: {
+			submit() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				API.changeData(this.form).then((res) => {
+					uni.hideLoading();
+					this.userInfo.name=this.form.name
+					this.userInfo.headImg=this.form.headImg
+					this.carhelp.setPersonInfo(this.userInfo);
+					uni.showToast({
+						title: "提交成功",
+						icon: "none"
+					})
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			uploadPhoto() {
+				let _self = this;
+				
+				const crop = {
+					quality: 100,
+					width: 600,
+					height: 600,
+					resize: true
+				};
+				
+				// 上传图片
+				uni.chooseImage({
+					count: 1,
+					crop,
+					success: async (res) => {
+						//(res);
+						let tempFile = res.tempFiles[0],
+							avatar_file = {
+								// #ifdef H5
+								extname: tempFile.name.split('.')[tempFile.name.split('.').length - 1],
+								// #endif
+								// #ifndef H5
+								extname: tempFile.path.split('.')[tempFile.path.split('.').length - 1]
+								// #endif
+							},
+							filePath = res.tempFilePaths[0]
+							
+						// #ifndef APP-PLUS
+						//(`filePath=${filePath}`)
+						
+						//非app端用前端组件剪裁头像,app端用内置的原生裁剪
+						let fileData = await new Promise((callback) => {
+							uni.navigateTo({
+								url: '/pages/mine/cropImage?path=' + filePath +
+									`&options=${JSON.stringify(crop)}`,
+								animationType: "fade-in",
+								events: {
+									success: url => {
+										callback(url)
+									}
+								}
+							});
+						})
+						// #endif
+						
+						
+						function dataURLtoBlob(dataurl){
+						    var arr = dataurl.split(','),
+						      mime = arr[0].match(/:(.*?);/)[1],
+						      bstr = atob(arr[1]),
+						      n = bstr.length,
+						      u8arr = new Uint8Array(n);
+						    while (n--) {
+						      u8arr[n] = bstr.charCodeAt(n);
+						    }
+						    return new Blob([u8arr], { type: mime });
+						  }
+						  //2,再将blob转换为file
+						function  blobToFile(theBlob, fileName){
+						     theBlob.lastModifiedDate = new Date();  // 文件最后的修改日期
+						     theBlob.name = fileName;                // 文件名
+						     return new File([theBlob], fileName, {type: theBlob.type, lastModified: Date.now()});
+						  }
+						  
+						  
+						  var blob= dataURLtoBlob(fileData)
+						  var file= blobToFile(blob,'1.jpg')
+						  console.log(file)
+						  
+						//返回 base64 图片
+						//(fileData);
+					var formData = new FormData();
+					
+					formData.append('subFolder', "111");
+					
+					formData.append('photoFile', file);
+					var token=this.carhelp.getToken()
+						
+						uni.uploadFile({
+								 url: process.car.BASE_URL + "uploadPicture",//仅为示例,非真实的接口地址
+									files: [{
+										name:"photoFile",
+										file:file
+									}],
+									header: {
+									    'Authorization': token,
+										//'Content-Type': 'multipart/form-data',
+										'X-Requested-With': 'XMLHttpRequest',
+									//	'content-type': 'multipart/form-data'
+									},
+									name: 'file',
+									formData: {
+										subFolder:"headimg"
+									},
+									success: (uploadFileRes) => {
+										
+										
+										var obj=JSON.parse(uploadFileRes.data)
+										console.log(obj);
+										 _self.form.headImg = obj.data.fileUrl;
+												
+										// uni.hideLoading();
+									}
+								});
+					
+					 
+					}
+				});
+			},
 		}
 	}
 </script>

+ 131 - 10
pages/mine/feedback.vue

@@ -2,25 +2,146 @@
 	<view>
 		<u-navbar title="意见反馈"></u-navbar>
 		<view class="main">
-			<textarea name="" id="" cols="30" rows="10" placeholder="填写反馈内容(必填)"></textarea>
-			<u-upload :action="action" :file-list="fileList" upload-text=""></u-upload>
+			<textarea name="" id="" 
+			v-model="subForm.content"
+			cols="30" rows="10" placeholder="填写反馈内容(必填)"></textarea>
+			<u-upload  :form-data="formData" :header="header" :action="action"
+			:file-list="fileList" upload-text=""></u-upload>
 
-			<input type="text" placeholder="请留下联系方式,方便我们与您取得联系(必填)" />
+			<input type="text" 
+			 v-model="subForm.telephone"
+			placeholder="请留下联系方式,方便我们与您取得联系" />
 		</view>
 
-		<button>提交</button>
+		<button  @click="submit">提交</button>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/user.js'
+	import * as WxJsApi from '@/apis/utils/wxJsApi'
+	
 	export default {
 		data() {
 			return {
-
+				action:"",
+				formData:{},
+				fileList:[],
+				header:{
+					
+				},
+				subForm: {
+					content: '',
+					imgUrl: '',
+					telephone: ''
+				}
+			}
+		},onLoad() {
+			this.action=process.car.BASE_URL+"uploadPicture"
+			
+			this.formData.subFolder="/team51/message"
+			//接口应该免登陆
+			var token=this.carhelp.getToken()
+			
+			this.header={
+		
+				'Authorization':token
 			}
+			// //获取微信配置
+			// WxJsApi.getWxConfig(['getLocation','addEventListener']).then((res)=>{
+			
+			// 	this.isReady=true;
+			// 	//(res)
+			 
+			// }).catch(error => {
+			// 		//(res)
+			// })
 		},
 		methods: {
-
+			//表单检测
+			checkFrom() {
+				if (!this.subForm.content) {
+				
+					uni.showToast({
+						title: "请输入内容"
+					})
+					return false;
+				} else {
+					return true;
+				}
+			},
+			//提交
+			submit() {
+				if (this.checkFrom()) {
+					uni.showModal({
+						title: '提示',
+						content: '提交成功',
+						showCancel:false,
+						success: res=>{
+							if (res.confirm) {
+								uni.navigateBack({
+									
+								})
+							} else if (res.cancel) {
+								//('用户点击取消');
+							}
+						}
+					});
+				}
+			},
+			//提交
+			submit2() {
+				let files = [];
+								// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
+								files = this.$refs.uUpload.lists.filter(val => {
+									return val.progress == 100;
+								})
+								// 如果您不需要进行太多的处理,直接如下即可
+								// files = this.$refs.uUpload.lists;
+				
+				//(files);
+					
+				var imgUrl=files.map(item=>{
+					return item.response.data;
+				})
+				//(imgUrl);
+				this.subForm.imgUrl = imgUrl.join(',');
+				
+			
+				if (this.checkFrom()) {
+					this.subForm.picUrl = this.listPic.join(',');
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					
+					API.feedback(this.subForm).then(response => {
+						
+						uni.hideLoading()
+						uni.showModal({
+							title: '提示',
+							content: '提交成功',
+							showCancel:false,
+							success: res=>{
+								if (res.confirm) {
+									uni.navigateBack({
+										
+									})
+								} else if (res.cancel) {
+									//('用户点击取消');
+								}
+							}
+						});
+						
+			
+					}).catch(error => {
+					
+						uni.showToast({
+							title: error
+						})
+					})
+				}
+			},
 		}
 	}
 </script>
@@ -37,10 +158,10 @@
 			margin-top: 0;
 		}
 
-		/deep/.u-icon__icon {
-			font-size: 90rpx !important;
-			color: #b0b0b0 !important;
-		}
+		// /deep/.u-icon__icon {
+		// 	font-size: 90rpx !important;
+		// 	color: #b0b0b0 !important;
+		// }
 		.u-upload{
 			margin-top: 32rpx;
 		}

+ 82 - 18
pages/mine/mine.vue

@@ -4,19 +4,22 @@
 		<view class="person-infos">
 			<view class="main">
 				<view class="photo">
-					<img src="../../assets/img/shareP.png" alt="">
+					<img v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
+					
+					<u-avatar  v-else  size="120" ></u-avatar>
 				</view>
 				<view class="infos">
 					<view class="name">
-						王泽
+						{{userInfo.name}}
 					</view>
 					<view class="department-position">
-						<view class="department">
+						<view class="department" v-if="userInfo.orgName">
 							<view class="icon">
+								
 								<img src="../../assets/img/department.png" alt="">
 							</view>
 							<view class="text">
-								采购部
+								{{userInfo.orgName}}
 							</view>
 						</view>
 						<view class="position">
@@ -29,7 +32,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="to-homepage">
+				<view class="to-homepage" v-if="false" >
 					<text class="text">个人主页</text><text>
 						<u-icon size="32" name="arrow-right" color="#80FFFFFF"></u-icon>
 					</text>
@@ -38,7 +41,7 @@
 			<view class="grid">
 				<view class="item">
 					<view class="amout">
-						999
+						0
 					</view>
 					<view class="text">
 						发布
@@ -46,7 +49,7 @@
 				</view>
 				<view class="item">
 					<view class="amout">
-						999
+						0
 					</view>
 					<view class="text">
 						点赞
@@ -54,7 +57,7 @@
 				</view>
 				<view class="item">
 					<view class="amout">
-						999
+						0
 					</view>
 					<view class="text">
 						评论
@@ -62,7 +65,7 @@
 				</view>
 				<view class="item">
 					<view class="amout">
-						999
+						{{plusInfo.userPoints}}
 					</view>
 					<view class="text">
 						积分
@@ -72,7 +75,7 @@
 
 		</view>
 		<!-- 功能 -->
-		<view class="function-group group1">
+		<view class="function-group group1" v-if="false">
 			<view class="item">
 				<view class="title">
 					<view class="icon">
@@ -104,7 +107,7 @@
 		</view>
 
 		<view class="function-group ">
-			<view class="item">
+			<view class="item" @click="gotoUrl('pages/mine/data')">
 				<view class="title">
 					<view class="icon">
 						<img src="../../assets/img/riLine-account-box-line@2x.png" alt="">
@@ -118,7 +121,7 @@
 				</view>
 			</view>
 
-			<view class="item">
+			<view class="item"  @click="gotoUrl('pages/mine/phone')" >
 				<view class="title">
 					<view class="icon">
 						<img src="../../assets/img/riLine-smartphone-line@2x.png" alt="">
@@ -128,11 +131,11 @@
 					</view>
 				</view>
 				<view class="right">
-					<text class="value">155****0000</text>
+					<text class="value">{{userPhone}}</text>
 					<u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item"   @click="gotoUrl('pages/mine/feedback')" >
 				<view class="title">
 					<view class="icon">
 						<img src="../../assets/img/riLine-file-edit-line@2x.png" alt="">
@@ -145,7 +148,7 @@
 					<u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item" v-if="false">
 				<view class="title">
 					<view class="icon">
 						<img src="../../assets/img/riLine-customer-service-2-line@2x.png" alt="">
@@ -159,7 +162,7 @@
 					<u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item"  @click="logout" >
 				<view class="title">
 					<view class="icon">
 						<img src="../../assets/img/riLine-logout-box-r-line@2x.png" alt="">
@@ -179,6 +182,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/user.js'
+	
 	import tabbar from "../../components/Tabbar.vue"
 	export default {
 		components: {
@@ -186,11 +191,70 @@
 		},
 		data() {
 			return {
-
+				plusInfo:{},
+				userInfo:{},
+				userPhone:"",
+			}
+		},
+		onLoad() {
+			this.plusInfo=this.carhelp.getPersonInfoPlus();
+			this.userInfo=this.carhelp.getPersonInfo();
+			
+			
+			if(this.userInfo&&this.userInfo.phone){
+				var phone = this.userInfo.phone;
+				var phone1 = phone.slice(0,3);
+				var phone2 = phone.slice(-4);
+				this.userPhone = phone1 + '****' + phone2;
 			}
+		
 		},
 		methods: {
-
+			logoutApi(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var data = {
+					
+				};
+				 
+				API.logout(data).then((res) => {
+					this.carhelp.setToken("",);
+					this.carhelp.set("token_tdate","")
+					this.carhelp.setPersonInfo("");
+					this.carhelp.setPersonInfoPlus(""  )
+					
+					uni.reLaunch({
+						url:"/"
+					})
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			phone(){
+				uni.makePhoneCall({
+				    phoneNumber:this.tel //仅为示例
+				});
+			},
+			logout(){
+						uni.showModal({
+							title: '提示',
+							content: '确认是否退出?',
+							success: res=> {
+								if (res.confirm) {
+								   //付钱  改为组件
+								   this.logoutApi();
+								   
+								} else if (res.cancel) {
+									console.log('用户点击取消');
+								}
+							}
+						});
+					},
 		}
 	}
 </script>

+ 174 - 10
pages/mine/phone.vue

@@ -4,18 +4,20 @@
 		<view class="login-form">
 			<view class="login-form-item">
 				<view class="input">
-					<u-input   type="number" placeholder="请输入手机号"/>
+					<u-input   type="number"  v-model="form.phone"  placeholder="请输入手机号"/>
 				</view>
 			</view>
 			<view class="login-form-item">
 				<view class="input">
-					<u-input    type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
-					<view class="code" >获取验证码</view>
+					<u-input  v-model="form.code"    type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
+					<view class="code"  @click="getCode" >{{codeTips}}</view>
 				</view>
+				<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start">
+				</u-verification-code>
 			</view>
 		</view>
 		
-		<u-button class="login-btn" type="success" shape="circle" >确认修改</u-button>
+		<u-button class="login-btn" @click="finish" type="success" shape="circle" >确认修改</u-button>
 		
 		
 	</view>
@@ -23,19 +25,181 @@
 
 <script>
 	
-	
+	import * as API from '@/apis/pagejs/user.js'
+	import {
+		checkPhone
+	} from '@/apis/utils'
 	export default {
 		data() {
 			return {
-				
-		}
+				form: {
+					name: '',
+					
+					phone: '',
+					code: '',
+				},
+				codeTips: '',
+				isSendMsgIng: false,
+				sendMsgSecond: 60 * 2,
+			}
 		},
 		methods: {
 			
-
-		
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			//倒计时
+					
+			end() {
+				this.sendMsgSecond = 2 * 60;
+				this.isSendMsgIng = false;
+			},
+			finish() {
+					
+				if (!this.carhelp.getOpenId()) {
+					// uni.showToast({
+					// 	title: "请使用“微信”访问本系统登录"
+					// })
+					// return
+				}
+				if (!this.form.phone) {
+					uni.showToast({
+						title: "请输入手机号"
+					})
+					return
+				}
+				if (!this.form.code) {
+					uni.showToast({
+						title: "请输入验证码"
+					})
+					return
+				}
+					
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+					
+					
+				API.changePhone({
+					verifyCode: this.form.code,
+					telephone: this.form.phone,
+				
+				}).then((response) => {
+					
+					this.query()
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			start() {
+				if (!this.isSendMsgIng) {
+					
+					
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					API.getVerifyCode(this.form.phone).then((response) => {
+					
+					
+						uni.hideLoading();
+						this.carhelp.set("getvcodetime", new Date().getTime());
+					
+						if (!"") {
+							//倒计时
+							uni.showToast({
+								title: "发送成功"
+							})
+						} else {
+							uni.showToast({
+								title: "您的验证码已经发送[5分钟有效],请勿重复点击"
+							})
+						}
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
+					})
+					
+					
+				}
+			},
+			// 获取验证码
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+					
+				} else {
+					
+					uni.showToast({
+						title: '倒计时结束后再发送',
+						icon: "none"
+					})
+					return
+				}
+					
+				var checkPhoneResult = checkPhone(this.form.phone);
+					
+				if (checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+					
+					})
+					return;
+				}
+				this.$refs.uCode.start();
+			},loginset(response){
+				var token = response ? response.data.token : '';
+				this.carhelp.setToken(token);
+				this.carhelp.setPersonInfo(response.data.regUser);
+				this.carhelp.setPersonInfoPlus(response.data)
+				//this.gotoUrl("pages/user/index")
+				uni.redirectTo({
+					url: '/pages/mine/mine'
+				})
+			},
+			query(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.findByOpenId({
+					noerror:true,
+					openId: this.carhelp.getOpenId(),
+					
+				}).then((response) => {
+					this.loginset(response)
+					
+				
+				}).catch(error => {
+					uni.hideLoading();
+					// if (!this.carhelp.getOpenId()) {
+					// 	uni.showToast({
+					// 		title: "请使用“微信”访问本系统登录"
+					// 	})
+					// 	return
+					// }
+					var time = this.carhelp.get("getvcodetime");
+					if (time) {
+						//this.$refs.uCode.start();
+						var nowtime = new Date().getTime()
+						var differ = (nowtime - time) / 1000
+						if (differ < 2 * 60) {
+							this.sendMsgSecond = 2 * 60 - parseInt(differ)
+							this.isSendMsgIng = true;
+							this.$refs.uCode.start();
+						}
+					}
+				})
+			}
 		
-	}
+		}
 	}
 </script>
 <style>

+ 78 - 35
pages/staffHome/activityCenter/activityCenter.vue

@@ -2,21 +2,22 @@
 	<view>
 		<u-navbar title="活动中心"></u-navbar>
 		<view class="main">
-			 <view class="activity-item">
+			 <view class="activity-item"  v-for="(item,i) in list" :key="i">
 			 	<view class="title">
-			 		2023年度春季职工运动会
+			 		{{item.title}}
 			 	</view>
 			 	<view class="pictures">
-			 		<img src="../../../assets/img/sharePic1.png" alt="">
-			 		<img src="../../../assets/img/sharePic2.png" alt="">
-			 		<img src="../../../assets/img/sharePic3.png" alt="">
+			 		<img v-if="item.pic1" @click="previewImage(item.pic1)"  :src="item.pic1" alt="">
+			 		<img v-if="item.pic2"  @click="previewImage(item.pic2)"  :src="item.pic2" alt="">
+			 		<img v-if="item.pic3"  @click="previewImage(item.pic3)"   :src="item.pic3" alt="">
+			 		
 			 	</view>
 				<view class="introduce">
-					探索了5种改善移动用户体验的绝佳做法,进来学!移动用户体验的绝佳做法,进来学!
+					{{item.synopsis}}
 				</view>
-				<view class="to-detail">
-					<view class="tag">
-						工会活动
+				<view class="to-detail"  @click="ckItem(item)" >
+					<view class="tag" >
+						活动
 					</view>
 					<view class="click">
 						<text>点击查看活动详情</text>
@@ -25,45 +26,87 @@
 				</view>
 			 </view>
 			 
-			 <view class="activity-item">
-			 	<view class="title">
-			 		2023年度春季职工运动会
-			 	</view>
-			 	<view class="pictures">
-			 		<img src="../../../assets/img/sharePic1.png" alt="">
-			 		<img src="../../../assets/img/sharePic2.png" alt="">
-			 		<img src="../../../assets/img/sharePic3.png" alt="">
-			 	</view>
-			 				<view class="introduce">
-			 					探索了5种改善移动用户体验的绝佳做法,进来学!移动用户体验的绝佳做法,进来学!
-			 				</view>
-			 				<view class="to-detail">
-			 					<view class="tag tag2">
-			 						党建活动
-			 					</view>
-			 					<view class="click">
-			 						<text>点击查看活动详情</text>
-			 						<text><u-icon name="arrow-right" color="#777777"></u-icon></text>
-			 					</view>
-			 				</view>
-			 </view>
+			
 		</view>
-		<u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
-		<view class="bottom">
+		<u-divider :isnone="list.length==0" nonetext="没有找到相关内容" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
+		<view class="bottom" v-if="false">
 			<img src="../../../assets/img/riFill-camera-fill@2x.png">
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/activity.js'
+	
 	export default {
 		data() {
 			return {
-				
+				listForm:{
+					pageIndex:1,
+					pageSize:20,
+					
+				},
+				list:[],
+				recordsTotal:0,
+			}
+		},
+		onLoad(op){
+		
+			this.getList()
+		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {			
+				this.myLoadmore();
 			}
 		},
 		methods: {
-			
+			previewImage(pic) {
+				let imgs = [pic];
+				
+				uni.previewImage({
+					indicator:"default",
+					loop:true,
+					urls: imgs,
+					current: i
+				})
+			},
+			ckItem(item){
+				var url="/pages/staffHome/activityCenter/activityDetail?id="+item.id;
+				uni.navigateTo({
+					url:url
+				})
+			},
+			myLoadmore(){
+				this.listForm.pageIndex += 1;
+				this.getList();
+			},
+			getList(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.pageList(this.listForm).then((res) => {
+					
+					uni.hideLoading();
+					//this.list=response.data.data
+					if(this.listForm.pageIndex==1){
+						this.list = res.data.data;
+					}else{
+						this.list = [
+							...this.list,
+							...res.data.data
+						];
+					}
+					this.recordsTotal = res.data.recordsTotal;
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>

+ 33 - 170
pages/staffHome/activityCenter/activityDetail.vue

@@ -1,191 +1,54 @@
 <template>
 	<view>
 		<u-navbar title="活动详情"></u-navbar>
-		<view class="main">
-			<view class="image">
-				<u-image width="100%" height="200rpx" :src="src" border-radius="16"></u-image>
-			</view>
-			<!-- 活动介绍 -->
-			<view class="introduction">
-				<view class="title">
-					活动介绍
-				</view>
-				<view class="content">
-					为贯彻落实习近平新时代中国特色社会主义思想和党的十九大精神,引导荆州工业企业进一步做大、做强、做优,为全市打造“ 一城三区、一区多园 ”和高端制造强市作出新的贡献。
-				</view>
-			</view>
-		
-		   <!-- 活动时间 -->
-		<view class="date">
-			<view class="title">
-				活动时间
-			</view>
-			<view class="item">
-				<view class="item-title">
-					报名时间
-				</view>
-				<view class="value">
-					2023年1月15日至2023年1月31日
-					
-				</view>
-			</view>
-			<view class="item">
-				<view class="item-title">
-					活动时间
-				</view>
-				<view class="value">
-					2023年1月15日至2023年4月30日
-					
-				</view>
-			</view>
+		<view class="main" v-html="info.content">
 			
-		</view>
-		<!-- 联系人 -->
-		<view class="date">
-			<view class="title">
-				联系人
-			</view>
-			<view class="item ">
-				<view class="item-title name">
-					段问薇
-				</view>
-				<view class="value">
-					19333312231
-					
-					
-				</view>
-			</view>
-			<view class="item ">
-				<view class="item-title name">
-					顾伦
-				</view>
-				<view class="value">
-					19612348970
-				</view>
-			</view>
-			
-		</view>
 		
-		<!-- 积分 -->
-		<view class="integral">
-			 <view class="title">
-			 	积分获取
-			 </view>
-			 <view class="integral-group">
-			 	<view class="item item1">
-			 		<view class="integral-title">
-			 			获取积分途径与方式
-			 		</view>
-					<view class="value">
-						分值
-					</view>
-			 	</view>
-				<view class="item">
-					<view class="integral-title">
-						阅读文章
-					</view>
-					<view class="value">
-						1
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						好文点赞
-					</view>
-					<view class="value">
-						1
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						评论文章
-					</view>
-					<view class="value">
-						5
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						转发文章
-					</view>
-					<view class="value">
-						1
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						发布文字内容(记录心得)
-					</view>
-					<view class="value">
-						10
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						参加党务活动、强国学习
-					</view>
-					<view class="value">
-						10
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						企业宣传(抖音、双微、小红书等)
-					</view>
-					<view class="value">
-						20
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						参加羽毛球活动
-					</view>
-					<view class="value">
-						20
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						参加演讲、讲课
-					</view>
-					<view class="value">
-						20
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						发表书法、摄影作品
-					</view>
-					<view class="value">
-						10
-					</view>
-				</view>
-				<view class="item">
-					<view class="integral-title">
-						好人好事
-					</view>
-					<view class="value">
-						50
-					</view>
-				</view>
-			 </view>
-		</view>
+		
+		
 		</view>
-	 <view class="bottom">
+	 <view class="bottom" v-if="false">
 	 	<button>发布作品</button>
 	 </view>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/activity.js'
+	
 	export default {
 		data() {
 			return {
-				src: 'https://wx2.sinaimg.cn/mw600/0071CBv1ly8ha20byn9wwj30sg0k8436.jpg'
+				id:'',
+				info:{},
 			}
 		},
-		methods: {
+		onLoad(op){
+			if(op.id){
+				this.id=op.id
+				this.getInfo()
+			}
 			
+		},
+		methods: {
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.edit(this.id).then((res) => {
+					
+					uni.hideLoading();
+					//this.list=response.data.data
+					this.info=res.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>

+ 96 - 24
pages/staffHome/activityReward/activityReward.vue

@@ -2,59 +2,131 @@
 	<view>
 		<u-navbar title="活动奖励"></u-navbar>
 		<view class="main">
-			<view class="reward-detail">
+			<view class="reward-detail"  v-for="(item,i) in list" :key="i" @click="ckItem(item)"  >
 				<view class="content">
 					<view class="title">
-						2023年度春季职工运动会活动奖励公示
+						{{item.title}}
 					</view>
 					<view class="tag">
 						<view class="item">
-							工会活动
+							活动
 						</view>
 					</view>
 					
 				</view>
 				 <view class="picture">
-				 	<img src="../../../assets/img/sharePic2.png" alt="">
+				 	<img v-if="item.pic1" @click="previewImage(item.pic1)"  :src="item.pic1" alt="">
+				 	<img v-else-if="item.pic2"  @click="previewImage(item.pic2)"  :src="item.pic2" alt="">
+				 	<img v-else-if="item.pic3"  @click="previewImage(item.pic3)"   :src="item.pic3" alt="">
+				 	
 				 </view>
 			</view>
 			
-			<view class="reward-detail">
-				<view class="content">
-					<view class="title">
-						2023庆祝建党节书法作品大赛活动奖励公示
-					</view>
-					<view class="tag">
-						<view class="item item1">
-							党建活动
-						</view>
-					</view>
-					
-				</view>
-				 <view class="picture">
-				 	<img src="../../../assets/img/sharePic2.png" alt="">
-				 </view>
-			</view>	
+			 
 			
 		</view>
-		<u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
-	</view>
+		<u-divider :isnone="list.length==0" nonetext="没有找到相关内容" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
+		<view class="bottom" v-if="false">
+			<img src="../../../assets/img/riFill-camera-fill@2x.png">
+		</view>
+<!-- 		<u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
+ -->	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/activity.js'
+	
 	export default {
 		data() {
 			return {
-				
+				listForm:{
+					pageIndex:1,
+					pageSize:20,
+					
+				},
+				list:[],
+				recordsTotal:0,
+			}
+		},
+		onLoad(op){
+		
+			this.getList()
+		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {			
+				this.myLoadmore();
 			}
 		},
 		methods: {
-			
+			previewImage(pic) {
+				let imgs = [pic];
+				
+				uni.previewImage({
+					indicator:"default",
+					loop:true,
+					urls: imgs,
+					current: i
+				})
+			},
+			ckItem(item){
+				var url="/pages/staffHome/activityReward/rewardDetail?id="+item.id;
+				uni.navigateTo({
+					url:url
+				})
+			},
+			myLoadmore(){
+				this.listForm.pageIndex += 1;
+				this.getList();
+			},
+			getList(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.pageList(this.listForm).then((res) => {
+					
+					uni.hideLoading();
+					//this.list=response.data.data
+					if(this.listForm.pageIndex==1){
+						this.list = res.data.data;
+					}else{
+						this.list = [
+							...this.list,
+							...res.data.data
+						];
+					}
+					this.recordsTotal = res.data.recordsTotal;
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss">
+	.bottom{
+		   background: linear-gradient(223.81deg, rgba(0,90,217,1) 14.24%,rgba(0,52,148,1) 86.67%);
+		   width: 104rpx;
+		   height: 104rpx;
+		   border-radius: 50px;
+		   display: flex;
+		   justify-content: center;
+		   align-items: center;
+		   position: fixed;
+		   right: 72rpx;
+		   bottom: 72rpx;
+		   img{
+			   width: 56rpx;
+			   height: 56rpx;
+			   
+		   }
+	}
 	.main{
 		padding: 24rpx 32rpx 0 32rpx;
 		.reward-detail{

+ 33 - 11
pages/staffHome/activityReward/rewardDetail.vue

@@ -1,15 +1,8 @@
 <template>
 	<view>
 		<u-navbar title="活动奖励详情"></u-navbar>
-		<view class="banner">
-			<view class="">
-				2023年度荆州市地方铁路优先公司
-			</view>
-			<view class="">
-				企业文化建设获奖名单
-			</view>
-		</view>
-		<view class="reward-group">
+		
+		<view class="reward-group" v-if="false">
 			<view class="reward-item">
 				劳模
 			</view>
@@ -45,19 +38,48 @@
 			</view>
 			
 			</view>
+			<u-divider :isnone="list.length==0" nonetext="没有找到相关内容" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
+			
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/activity.js'
+	
 	export default {
 		data() {
 			return {
-				
+				id:'',
+				list:[],
 			}
 		},
-		methods: {
+		onLoad(op){
+			if(op.id){
+				this.id=op.id
+				this.getInfo()
+			}
 			
+		},
+		methods: {
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.notesList(this.id).then((res) => {
+					
+					uni.hideLoading();
+					//this.list=response.data.data
+					this.list=res.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>

+ 11 - 32
pages/staffHome/teamHonor/badgeDetails.vue

@@ -4,13 +4,13 @@
 		<!-- 荣誉名称 -->
 		<view class="honor-name">
 			<view class="icon">
-				<img src="../../../assets/img/honorPic1.png" alt="">
+				<img :src="info.img" alt="">
 			</view>
 			<view class="name">
-				荣誉名称
+				{{info.name}}
 			</view>
 			<view class="explain">
-				荣誉说明荣誉说明荣誉说明荣誉说明荣
+				{{info.synopsis}}
 			</view>
 		</view>
 		<!-- 荣誉记录 -->
@@ -24,13 +24,13 @@
 				</view>
 			</view>
 
-			<view class="commend-box">
+			<view class="commend-box"  v-for="(item,i) in list" :key="i">
 				<view class="commend-content">
 					<view class="title">
-						综合办公室
+						{{item.orgName?item.orgName:item.typeName}}
 					</view>
 					<view class="commendation">
-						荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明
+						{{item.content}}
 					</view>
 					<view class="integral">
 						<view class="flex">
@@ -38,40 +38,17 @@
 								<img src="../../../assets/img/riFill-copper-diamond-fill@2x.png" alt="">
 							</view>
 							<view class="text">
-								每人20~50积分
+								{{item.scoreInfo}}积分
 							</view>
 						</view>
 						<view class="date">
-							2023-01-15
-						</view>
-					</view>
-				</view>
-				
-			</view>
-			<view class="commend-box">
-				<view class="commend-content">
-					<view class="title">
-						党建科
-					</view>
-					<view class="commendation">
-						荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明荣誉说明
-					</view>
-					<view class="integral">
-						<view class="flex">
-							<view class="icon">
-								<img src="../../../assets/img/riFill-copper-diamond-fill@2x.png" alt="">
-							</view>
-							<view class="text">
-								每人20~50积分
-							</view>
-						</view>
-						<view class="date">
-							2023-01-15
+							{{item.createTime}}
 						</view>
 					</view>
 				</view>
 				
 			</view>
+			
 		</view>
 		<u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
 	</view>
@@ -97,7 +74,9 @@
 		onLoad(op){
 			if(op.type){
 				this.type=op.type
+				
 				this.getInfo()
+				this.listForm.type=op.id
 				this.getList()
 			}
 			

+ 7 - 4
pages/staffHome/teamHonor/teamHonor.vue

@@ -25,6 +25,7 @@
 			<view class="gainer">
 				<img v-if="item.badge" :src="item.badge.imgUrl" alt="">
 				<img v-if="item.regUser" :src="item.regUser.headImg" alt="">
+			<!-- 	<u-avatar  v-else  size="120" ></u-avatar> -->
 				<view class="name">
 					{{item.userName?item.userName:item.badgeName}}
 				</view>
@@ -83,10 +84,12 @@
 		methods: {
 			
 			ckItem(item){
-				var url="/pages/staffHome/teamHonor/badgeDetails?type="+item.badgeId;
-				uni.navigateTo({
-					url:url
-				})
+				if(item.badgeId){
+					var url="/pages/staffHome/teamHonor/badgeDetails?type="+item.badgeId+"&id="+item.type;
+					uni.navigateTo({
+						url:url
+					})
+				}
 			},
 			myLoadmore(){
 				this.listForm.pageIndex += 1;