15807800591 2 years ago
parent
commit
c9003654fe
5 changed files with 447 additions and 315 deletions
  1. 4 2
      common/http.js
  2. 2 4
      pages.json
  3. 284 207
      pages/index/detail.vue
  4. 16 11
      pages/index/index.vue
  5. 141 91
      pages/login.vue

+ 4 - 2
common/http.js

@@ -8,6 +8,8 @@ const urls = {
 	home: ip + '/app/home/index', //首页数据
 
 	login: ip + '/runtime/login/loginWithCiphertext2', //用户登陆
+	myprofile: ip + '/runtime/users/myprofile', //用户登陆
+	
 	user_register: ip + '/app/user/register', //用户注册
 	accessToken: ip + '/rest/accessToken?secret=11ec-db2f-ca248770-8df3-890eb68cafa4', //用户注册
    // wt_list:ip + '/runtime/__gAPYBW4YxB3UePM3lqO/views/__km3aURKW95BHxp12XVt/documents?parentId=&sortCol=&sortStatus=&lines=10&treedocid=&parentNodeId=&_docid=&_fieldid=&isRelate=&startDate=&endDate=&parentParam=&isQueryButton=false',
@@ -20,10 +22,10 @@ const urls = {
 	wt_rwfp:ip + '/runtime/__gAPYBW4YxB3UePM3lqO/views/__m9w03S06KHbg3KioRIh/documents?lines=10&isQueryButton=false',
 	
 	documents: ip + '/runtime/__gAPYBW4YxB3UePM3lqO/documents/', //获取文档详情
-	documents: ip + '/runtime/__gAPYBW4YxB3UePM3lqO/forms/__0FLGNncOS1lz0T9jsFn/empty?', //创建委托单文档
+	empty: ip + '/runtime/__gAPYBW4YxB3UePM3lqO/forms/__0FLGNncOS1lz0T9jsFn/empty?formId=__0FLGNncOS1lz0T9jsFn&appId=__gAPYBW4YxB3UePM3lqO', //创建委托单文档
 }
 /**
- * 封装的http请求
+ * 封装的http请求wt_
  */
 const request = (opt) => {
 	opt = opt || {};

+ 2 - 4
pages.json

@@ -39,13 +39,11 @@
                 "enablePullDownRefresh": false
             }
             
-        }
-      
-        ,{
+        },{
             "path" : "pages/login",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "",
+                "navigationBarTitleText": "柳工",
                 "enablePullDownRefresh": false
             }
             

+ 284 - 207
pages/index/detail.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="title">检测申请方填写</view>
-		
+
 		<view class="form_group">
 			<view class="label">委托单编号</view>
 			<view class="tag">
@@ -30,7 +30,7 @@
 				<text class="span">{{item.purpose}}</text>
 			</view>
 		</view>
-		
+
 		<view class="form_group">
 			<view class="label">申请人</view>
 			<view class="tag">
@@ -63,10 +63,10 @@
 			<view class="label">试验类型</view>
 			<view class="tag">
 				<text class="icon more">&#xe631;</text>
-				
-					<text class="span"> {{item.product}} </text>
-					
-					<text class="span"> {{item.experiment_type}} </text>
+
+				<text class="span"> {{item.product}} </text>
+
+				<text class="span"> {{item.experiment_type}} </text>
 			</view>
 		</view>
 		<view class="form_group">
@@ -78,7 +78,9 @@
 		</view>
 		<view class="form_group">
 			<view class="label">结果形式</view>
-			<view class="tag"><u-subsection :list="radio" :current="current" @change="change"></u-subsection></view>
+			<view class="tag">
+				<u-subsection :list="radio" :current="current" @change="change"></u-subsection>
+			</view>
 		</view>
 		<view class="form_group">
 			<view class="label">模板</view>
@@ -87,8 +89,8 @@
 				<text class="span">{{item.item_num}}</text>
 			</view>
 		</view>
-		
-		
+
+
 		<view class="title">设置审批人员</view>
 		<view class="form_group" @click="select('1')">
 			<view class="label omit" style="width: 200px;">需求审核-产品经理或主管人员</view>
@@ -127,16 +129,23 @@
 		</view>
 		<view class="title">样机</view>
 		<view class="form_group">
-			<view class="label">委托单编号</view>
+			<view class="label">GH560</view>
+			<view class="tag">
+				<text class="icon more">&#xe631;</text>
+				<text class="span">XH890656565556</text>
+			</view>
+		</view>
+		<view class="form_group">
+			<view class="label">GH560</view>
 			<view class="tag">
 				<text class="icon more">&#xe631;</text>
-				<text class="span">W000003496</text>
+				<text class="span">XH890656565556</text>
 			</view>
 		</view>
-		
-		
-		
-		
+
+
+
+
 		<view>
 			<u-popup :show="show" mode="bottom">
 				<view class="content">
@@ -148,10 +157,10 @@
 							</view>
 							<u-radio-group @change="radioGroupChange">
 								<u-radio v-for="(item, index) in nextNodes" :key="index" :name="item.id">
-		
+
 								</u-radio>
 							</u-radio-group>
-		
+
 						</view>
 					</scroll-view>
 					<view class="confrim-btn">
@@ -169,10 +178,10 @@
 							</view>
 							<u-radio-group @change="radioGroupChange">
 								<u-radio v-for="(item, index) in backNodes" :key="index" :name="item.id">
-			
+
 								</u-radio>
 							</u-radio-group>
-			
+
 						</view>
 					</scroll-view>
 					<view class="confrim-btn">
@@ -180,173 +189,234 @@
 					</view>
 				</view>
 			</u-popup>
-			
+
 		</view>
 		<view class="footer">
-			
-			<button class="btn ws" @click="submission()" v-if="p.istmp">{{p.istmp}}提交</button>
-				<button class="btn ws" @click="back()">回退</button>
+
+			<button class="btn ws" @click="submission()" v-if="btnshow">提交</button>
+			<button class="btn ws" @click="back()" v-if="btnshow&& state == 1">回退</button>
 		</view>
-		
-		
-		
+
+
+
 	</view>
-	
-	
-	
-	
 
-	
+
+
+
+
+
 </template>
 
 <script>
-let qrcode = require('@/common/code.js');
-export default {
-	data() {
-		return {
-			p:{},
-			item: {},
-			current: 0,
-			radio: [{ name: '正式报告' }, { name: '仅原始数据' }, { name: '协助试验' }],
-			id:'',
-			items: {
-				document: {
-					items: {}
-				}
-			},
-			show: false,
-			bshow: false,
-			itemt: {},
-			up: {},
-			content: '标题',
-			nextNodes: [],
-			backNodes: [],
-			touser: {nodeid: "1649917385058", isToPerson: true, userids: "__jFFZYvLIG6uFc7CdBMg"},
-			
-		};
-	},
-	onLoad(e) {
-	console.log('eeee:' + JSON.stringify(e));
-		
-		this.id=e.id;
-		//传过来的id
-		if (e.id) {
-			/* this.http.request({
-				url: this.http.urls.xxxx + e.id,
-				success: res => {
-					this.item = res.data.data;
-				}
-			}); */
+	let qrcode = require('@/common/code.js');
+	export default {
+		data() {
+			return {
+				p: {},
+				item: {},
+				current: 0,
+				radio: [{
+					name: '正式报告'
+				}, {
+					name: '仅原始数据'
+				}, {
+					name: '协助试验'
+				}],
+				id: '',
+				items: {
+					document: {
+						items: {}
+					}
+				},
+				show: false,
+				bshow: false,
+				itemt: {},
+				up: {},
+				content: '标题',
+				nextNodes: [],
+				backNodes: [],
+				touser: {
+					nodeid: "1649917385058",
+					isToPerson: true,
+					userids: "__jFFZYvLIG6uFc7CdBMg"
+				},
+				btnshow: false,
+                   state:0,
+			};
+		},
+		onLoad(e) {
+
+			this.id = e.id;
+			//传过来的id
+			this.state=e.ste;
+			if (e.ste == 1) {
+				/* this.http.request({
+					url: this.http.urls.xxxx + e.id,
+					success: res => {
+						this.item = res.data.data;
+					}
+				}); */
 				this.getDocuments();
-		}
-		//选中审批人员监听函数,其它类型的参考这个
-		uni.$on('select', res => {
-			console.log('asd2:' + JSON.stringify(res));
-			if(res.ste==1){
-				this.item.WTXQSH=res.items.__L5a8n9ZH5gJC0CL1s6X.value;
-			}else if(res.ste==2){
-				this.item.WTSYSH=res.items.__0ils0bIBD7Vf90TjVb3.value;
-			}
-			else if(res.ste==3){
-				this.item.WTXQPZ=res.items.__uiMgMPHg9jmqTXzwdzl.value;
-			}
-			else if(res.ste==4){
-				this.item.WTSYPZ=res.items.__WSh3KXD8wfeyU3FbipN.value;
-			}
-			else if(res.ste==5){
-				this.item.WTRWFP=res.items.__IzBqxyYJhOYJntHpmEv.value;
+			} else if (e.ste == 2) {
+				this.empty();
 			}
-		});
-	},
-	methods: {
-		
-		// 选中任一radio时,由radio-group触发
-		radioGroupChange(e) {
-			// console.log(e);
-			this.itemt.nextNodeIds = [];
-			this.itemt.nextNodeIds.push(e);
-		},//详情
-		getDocuments() {
-		
-		
-			this.http.request({
-				url: this.http.urls.documents + this.id,
-				data: this.item,
-				loading: 'false',
-				success: res => {
-					this.item = res.data.data.items;
-					this.p = res.data.data;
-					console.log('this.p:' + JSON.stringify(this.p));
-					//this.current=res.data.data.items.report_type;
-					if(this.item.report_type=='正式报告'){
-						this.current=0;
-					}else if(this.item.report_type=='仅原始数据'){
-					this.current=1;
-					}else if(this.item.report_type=='协助试验'){
-					this.current=2;
-					}
-					this.iteml = res.data.data;
-					
-					this.items.applicationId = "__gAPYBW4YxB3UePM3lqO";
-					this.items.docId = this.iteml.id;
-					this.items.id = this.iteml.id;
-					this.items.formId = this.iteml.formid;
-					this.items.parentId = "";
-					this.items.subSelects = [];
-					this.items.templateForm = "";
-					this.items.viewId = "";
-					this.items.document.items = this.item;
-					this.items.document.applicationId = "__gAPYBW4YxB3UePM3lqO";
-					this.items.document.exparams = {};
-					this.items.document.formId = this.iteml.formid;
-					this.items.document.id = this.iteml.id;
-					this.items.document.parentId = "";
-					this.items.document.sign = "";
-					this.items.document.stateId = this.iteml.stateid;
-					this.items.document.subDocuments = [];
-					this.items.document.templateForm = "";
-					this.items.document.versions = "0";
+			//选中审批人员监听函数,其它类型的参考这个
+			uni.$on('select', res => {
+				console.log('asd2:' + JSON.stringify(res));
+				if (res.ste == 1) {
+					this.item.WTXQSH = res.items.__L5a8n9ZH5gJC0CL1s6X.value;
+				} else if (res.ste == 2) {
+					this.item.WTSYSH = res.items.__0ils0bIBD7Vf90TjVb3.value;
+				} else if (res.ste == 3) {
+					this.item.WTXQPZ = res.items.__uiMgMPHg9jmqTXzwdzl.value;
+				} else if (res.ste == 4) {
+					this.item.WTSYPZ = res.items.__WSh3KXD8wfeyU3FbipN.value;
+				} else if (res.ste == 5) {
+					this.item.WTRWFP = res.items.__IzBqxyYJhOYJntHpmEv.value;
 				}
 			});
 		},
-		//选择结果形式
-		change(e) {
-			this.current = e;
-			console.log('aa:' + this.radio[this.current].name);
-			this.item.report_type=this.radio[this.current].name;
-		},
-		//选择审批人员
-		select(e) {
-			uni.navigateTo({
-				url: '/pages/index/select?ste=' + e
-			});
-		},
-		//提交
-		add() {
-			this.http.request({
-				url: this.http.urls.user_task_add,
-				data: this.item,
-				method: 'POST',
-				success: res => {
-					uni.showModal({
-						title: '提示',
-						content: '提交成功',
-						showCancel: false,
-						success: res => {
-							if (res.confirm) {
-								uni.navigateBack();
-							}
+		methods: {
+
+			// 选中任一radio时,由radio-group触发
+			radioGroupChange(e) {
+				// console.log(e);
+				this.itemt.nextNodeIds = [];
+				this.itemt.nextNodeIds.push(e);
+			}, //详情
+			getDocuments() {
+
+
+				this.http.request({
+					url: this.http.urls.documents + this.id,
+					data: this.item,
+					loading: 'false',
+					success: res => {
+						this.item = res.data.data.items;
+						this.p = res.data.data;
+
+
+						if (this.p.lastFlowOperation == undefined || this.p.auditorList.includes(this.getUser()
+								.id)) {
+							console.log('this.p1:' + JSON.stringify(this.p));
+							this.btnshow = true;
 						}
-					});
-				}
-			});
-		},
+
+
+						//this.current=res.data.data.items.report_type;
+						if (this.item.report_type == '正式报告') {
+							this.current = 0;
+						} else if (this.item.report_type == '仅原始数据') {
+							this.current = 1;
+						} else if (this.item.report_type == '协助试验') {
+							this.current = 2;
+						}
+						this.iteml = res.data.data;
+
+						this.items.applicationId = "__gAPYBW4YxB3UePM3lqO";
+						this.items.docId = this.iteml.id;
+						this.items.id = this.iteml.id;
+						this.items.formId = this.iteml.formid;
+						this.items.parentId = "";
+						this.items.subSelects = [];
+						this.items.templateForm = "";
+						this.items.viewId = "";
+						this.items.document.items = this.item;
+						this.items.document.applicationId = "__gAPYBW4YxB3UePM3lqO";
+						this.items.document.exparams = {};
+						this.items.document.formId = this.iteml.formid;
+						this.items.document.id = this.iteml.id;
+						this.items.document.parentId = "";
+						this.items.document.sign = "";
+						this.items.document.stateId = this.iteml.stateid;
+						this.items.document.subDocuments = [];
+						this.items.document.templateForm = "";
+						this.items.document.versions = "0";
+					}
+				});
+			},
+			empty() {
+				this.btnshow = true;
+				this.http.request({
+					url: this.http.urls.empty,
+					data: this.item,
+
+					success: res => {
+						console.log('res2:' + JSON.stringify(res));
+						this.item = res.data.data.items;
+						this.p = res.data.data;
+						console.log('this.p1:' + JSON.stringify(this.p));
+						//this.current=res.data.data.items.report_type;
+						if (this.item.report_type == '正式报告') {
+							this.current = 0;
+						} else if (this.item.report_type == '仅原始数据') {
+							this.current = 1;
+						} else if (this.item.report_type == '协助试验') {
+							this.current = 2;
+						}
+						this.iteml = res.data.data;
+
+						this.items.applicationId = "__gAPYBW4YxB3UePM3lqO";
+						this.items.docId = this.iteml.id;
+						this.items.id = this.iteml.id;
+						this.items.formId = this.iteml.formid;
+						this.items.parentId = "";
+						this.items.subSelects = [];
+						this.items.templateForm = "";
+						this.items.viewId = "";
+						this.items.document.items = this.item;
+						this.items.document.applicationId = "__gAPYBW4YxB3UePM3lqO";
+						this.items.document.exparams = {};
+						this.items.document.formId = this.iteml.formid;
+						this.items.document.id = this.iteml.id;
+						this.items.document.parentId = "";
+						this.items.document.sign = "";
+						this.items.document.stateId = this.iteml.stateid;
+						this.items.document.subDocuments = [];
+						this.items.document.templateForm = "";
+						this.items.document.versions = "0";
+					}
+				});
+			},
+			//选择结果形式
+			change(e) {
+				this.current = e;
+				console.log('aa:' + this.radio[this.current].name);
+				this.item.report_type = this.radio[this.current].name;
+			},
+			//选择审批人员
+			select(e) {
+				uni.navigateTo({
+					url: '/pages/index/select?ste=' + e
+				});
+			},
+			//提交
+			add() {
+				this.http.request({
+					url: this.http.urls.user_task_add,
+					data: this.item,
+					method: 'POST',
+					success: res => {
+						uni.showModal({
+							title: '提示',
+							content: '提交成功',
+							showCancel: false,
+							success: res => {
+								if (res.confirm) {
+									uni.navigateBack();
+								}
+							}
+						});
+					}
+				});
+			},
 			//提交流程面板
 			submission() {
 
 
 				this.http.request({
-					url: this.http.urls.documents + this.id+"/panels/submission",
+					url: this.http.urls.documents + this.id + "/panels/submission",
 					data: this.items,
 
 					method: 'POST',
@@ -372,7 +442,8 @@ export default {
 				});
 			}, //提交流程
 			submit() {
-//this.itemt.document.items.purpose="试验目的111";
+				//this.itemt.document.items.purpose="试验目的5656";
+				//this.itemt.document.items.title="标题5656";
 				this.itemt.applicationId = "__gAPYBW4YxB3UePM3lqO";
 				this.itemt.docId = this.iteml.id;
 				this.itemt.id = this.iteml.id;
@@ -384,7 +455,7 @@ export default {
 				this.itemt.templateForm = "";
 				this.itemt.viewId = "";
 				this.http.request({
-					url: this.http.urls.documents + this.id+"/workflows/submit",
+					url: this.http.urls.documents + this.id + "/workflows/submit",
 					data: this.itemt,
 
 					method: 'PUT',
@@ -396,8 +467,9 @@ export default {
 						this.title = res.data.data.name;
 						this.nextNodes = res.data.data.nextNodes;
 						uni.$emit('index');
-						uni.redirectTo({ url: '/pages/index/index' ,
-						
+						uni.redirectTo({
+							url: '/pages/index/index',
+
 						});
 						//this.content=res.data.data.formname;
 					}
@@ -405,18 +477,18 @@ export default {
 			}, //刷新数据
 			//回退流程面板
 			back() {
-			
-			
+
+
 				this.http.request({
-					url: this.http.urls.documents +this.id+"/panels/back",
+					url: this.http.urls.documents + this.id + "/panels/back",
 					data: this.items,
-			
+
 					method: 'POST',
 					success: res => {
 						//this.item=res.data.data;
 						console.log('zx22:' + JSON.stringify(res.data.data));
 						this.bshow = true;
-			
+
 						this.title = res.data.data.name;
 						this.backNodes = res.data.data.backNodes;
 						this.itemt.flowId = res.data.data.flowId;
@@ -432,9 +504,9 @@ export default {
 						//this.content=res.data.data.formname;
 					}
 				});
-			},  //提交回退流程
+			}, //提交回退流程
 			workflowsback() {
-//this.itemt.document.items.purpose="试验目的111";
+				//this.itemt.document.items.purpose="试验目的111";
 				this.itemt.applicationId = "__gAPYBW4YxB3UePM3lqO";
 				this.itemt.docId = this.iteml.id;
 				this.itemt.id = this.iteml.id;
@@ -446,7 +518,7 @@ export default {
 				this.itemt.templateForm = "";
 				this.itemt.viewId = "";
 				this.http.request({
-					url: this.http.urls.documents +this.id+"/workflows/back",
+					url: this.http.urls.documents + this.id + "/workflows/back",
 					data: this.itemt,
 
 					method: 'PUT',
@@ -458,43 +530,48 @@ export default {
 						this.title = res.data.data.name;
 						this.nextNodes = res.data.data.nextNodes;
 						uni.$emit('index');
-						uni.redirectTo({ url: '/pages/index/index' ,
-						
+						uni.redirectTo({
+							url: '/pages/index/index',
+
 						});
 						//this.content=res.data.data.formname;
 					}
 				});
-			}, 
-	}
-};
+			},
+		}
+	};
 </script>
 
 <style lang="scss">
-.title {
-	padding: 12px;
-	font-weight: bold;
-	font-size: 16px;
-}
-.tag {
-	float: right;
-	margin-top: -18px;
-	width: 70%;
-	text-align: left;
-	.span {
-		float: right;
-		color: #545555;
-	}
-	.code {
-		font-size: 25px;
+	.title {
+		padding: 12px;
+		font-weight: bold;
+		font-size: 16px;
 	}
-	.more {
+
+	.tag {
 		float: right;
-		margin-top: 2px;
-		color: darkgray;
-	}
+		margin-top: -18px;
+		width: 70%;
+		text-align: left;
 
-	.uni-label-pointer {
-		padding: 5px;
+		.span {
+			float: right;
+			color: #545555;
+		}
+
+		.code {
+			font-size: 25px;
+		}
+
+		.more {
+			float: right;
+			margin-top: 2px;
+			color: darkgray;
+		}
+
+		.uni-label-pointer {
+			padding: 5px;
+		}
 	}
-}
 </style>

+ 16 - 11
pages/index/index.vue

@@ -13,7 +13,7 @@
 			</view>
 		</view>
 		<view class="list">
-			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id)">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id,'1')">
 				<view class="title">
 					<text class="tv">{{item.items.__yZMMXcXNnmKq5pTTfPH.value}}</text>
 					<text class="icon">&#xe631;</text>
@@ -36,13 +36,13 @@
 						<view class="label">当前审批人:</view>
 						<view class="name">{{item.items.__hInQ1R0YkMQNrgTq3q0.value}}</view>
 					</view>
-					<view class="tag">{{item.items.__oUywWKvn4BhpnBmxqYT.value}}</view>
+					<view class="tag" v-if="item.items.__oUywWKvn4BhpnBmxqYT.value !=''">{{item.items.__oUywWKvn4BhpnBmxqYT.value}}</view>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
 		</view>
-		<view class="footer"><button class="btn" style="width: 30%;border-radius: 25px;">新建</button></view>
+		<view class="footer"><button class="btn" style="width: 30%;border-radius: 25px;" @click="detail('0',2)">新建</button></view>
 	</view>
 </template>
 
@@ -60,7 +60,7 @@ export default {
 	onLoad(e) {
 		//this.getaccessToken();
 		this.getData();
-		console.log("0000===");
+		
 	},
 	methods: {
 		getaccessToken() {
@@ -87,9 +87,8 @@ export default {
 				method:'POST',
 				loading: 'false',
 				success: res => {
-					console.log("res.data.data.page==="+JSON.stringify(res));
-					console.log("this.pageNum==="+this.pageNum);
-					this.loadMore = res.data.data.page > this.pageNum? true : false;
+				
+					this.loadMore = res.data.data.page > this.pageNum-1? true : false;
 					res.data.data.data.forEach(item => {
 						this.list.push(item);
 					});
@@ -106,9 +105,15 @@ export default {
 			console.log("11111===");
 		},
 		//跳转到详情
-		detail(id) {
+		detail(id,ste) {
 			uni.navigateTo({
-				url: '/pages/index/detail?id=' + id
+				url: '/pages/index/detail?id=' + id+"&ste="+ ste
+			});
+		},
+		//跳转到详情
+		add() {
+			uni.navigateTo({
+				url: '/pages/index/addwt'
 			});
 		}
 	},
@@ -122,11 +127,11 @@ export default {
 	},
 	//上拉加载
 	onReachBottom() {
-		console.log("333===");
+	
 		if (this.loadMore) {
 			
 			this.pageNum++;
-			console.log("this.pageNum==="+this.pageNum);
+			
 			this.getData();
 		}
 	},

+ 141 - 91
pages/login.vue

@@ -11,6 +11,12 @@
 					<view class="lable"><text class="icon">&#xe728;</text></view>
 					<input type="password" placeholder="密码" v-model="item.password" />
 				</view>
+				<view class="form_group" v-if="checkcodeImg !=''">
+					<view class="lable" style="width: 25%;">
+						<image :src=checkcodeImg style="height: 70rpx;"></image>
+					</view>
+					<input type="text" placeholder="验证码" v-model="item.checkcode" />
+				</view>
 				<button class="btn" @click="login()">登陆</button>
 				<navigator url="/pages/find_pass" class="pass" hover-class="none">找回密码</navigator>
 			</view>
@@ -19,104 +25,148 @@
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			item: {domainName:'柳工',remember:'0',debug:'false',checkcode:'',language:'CN',url:'/obpm'},
-			uitem:{}
-		};
-	},
-	onLoad(e) {
-		
-		
-		//刷新
-					uni.$on('index', res => {
-		//this.refresh();
-		uni.showLoading({
-		     title: '加载中',  
-		     mask: true  
-		 });  
-					});
-					   
-	},
-	
-	mounted() {
-		//自动登陆
-			
-		if (this.hasLogin()) {
-			uni.redirectTo({ url: '/pages/index/index' ,
-			
-			
-			});
-			
-		}
-	},
-	methods: {
-		//登陆
-		login() {
-			let rule = [{ name: 'username', checkType: 'notnull', errorMsg: '请输入账号' }, { name: 'password', checkType: 'notnull', errorMsg: '请输入密码' }];
-			//if (!vm.verify.check(this.item, rule)) {
-			//	uni.showModal({ content: this.verify.error, showCancel: false });
-			//	return false;
-		//	}
-			this.item.password = window.btoa(this.item.password);
-			var p1=this.item.password.slice(2);
-			var p2=this.item.password.substring(0,2)
-			this.item.password=p1+p2;
-			//console.log("this.item:"+this.item);
-			this.http.request({
-				url: this.http.urls.login,
-				data: this.item,
-				method: 'post',
-				success: res => {
-					console.log("gfgh==="+JSON.stringify(res));
-					if(res.data.resultCode==1){
-				
-					uni.removeStorageSync('user');
-					uni.setStorageSync('user', res.data);
-					uni.$emit('index');
-					uni.redirectTo({ url: '/pages/index/index' ,
-					
-					});
-					console.log("res.data.resultCode==="+res.data.resultCode);
-					}
-				}
+	export default {
+		data() {
+			return {
+				item: {
+					domainName: '柳工',
+					remember: '0',
+					debug: 'false',
+					checkcode: '',
+					language: 'CN',
+					url: '/obpm'
+				},
+				uitem: {},
+				checkcodeImg: ''
+			};
+		},
+		onLoad(e) {
+
+
+			//刷新
+			uni.$on('index', res => {
+				//this.refresh();
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				});
 			});
+
 		},
-		
-	}
-};
+
+		mounted() {
+			//自动登陆
+
+			if (this.hasLogin()) {
+				//uni.redirectTo({ url: '/pages/index/index' ,
+
+
+				//	});
+
+			}
+		},
+		methods: {
+			//登陆
+			login() {
+				let rule = [{
+					name: 'username',
+					checkType: 'notnull',
+					errorMsg: '请输入账号'
+				}, {
+					name: 'password',
+					checkType: 'notnull',
+					errorMsg: '请输入密码'
+				}];
+				//if (!vm.verify.check(this.item, rule)) {
+				//	uni.showModal({ content: this.verify.error, showCancel: false });
+				//	return false;
+				//	}
+				this.item.password = window.btoa(this.item.password);
+				var p1 = this.item.password.slice(2);
+				var p2 = this.item.password.substring(0, 2)
+				this.item.password = p1 + p2;
+				//console.log("this.item:"+this.item);
+				this.http.request({
+					url: this.http.urls.login,
+					data: this.item,
+					method: 'post',
+					success: res => {
+						console.log("gfgh===" + JSON.stringify(res.data));
+						if (res.data.resultCode == 1) {
+
+							uni.removeStorageSync('user');
+							uni.setStorageSync('user', res.data);
+							this.myprofile();
+
+						} else {
+							this.checkcodeImg = res.data.checkcodeImg;
+						}
+					}
+				});
+			}, //登陆
+			myprofile() {
+
+				this.http.request({
+					url: this.http.urls.myprofile,
+					data: this.item,
+					success: res => {
+
+						if (res.data.errmsg == 'ok') {
+							var accessToken = this.getUser().accessToken;
+							res.data.data.accessToken = accessToken;
+							uni.removeStorageSync('user');
+							//console.log("gfgh==="+JSON.stringify(res.data.data));
+							uni.setStorageSync('user', res.data.data);
+							uni.$emit('index');
+							uni.redirectTo({
+								url: '/pages/index/index',
+
+							});
+							console.log("res.data.resultCode===" + res.data.errcode);
+						}
+					}
+				});
+			},
+
+		}
+	};
 </script>
 <style lang="scss">
-.bg {
-	padding: 15px;
-	image {
-		width: 100%;
-		height: 10px;
-		border-radius: 5px;
-	}
-	.login {
-		.form_group {
-			border: 1px solid $line;
+	.bg {
+		padding: 15px;
+
+		image {
+			width: 100%;
+			height: 10px;
 			border-radius: 5px;
-			margin-top: 10px;
-			.lable {
-				width: 10px;
+		}
+
+		.login {
+			.form_group {
+				border: 1px solid $line;
+				border-radius: 5px;
+				margin-top: 10px;
+
+				.lable {
+					width: 10px;
+				}
+
+				input {
+					border: 0px;
+				}
 			}
-			input {
-				border: 0px;
+
+			.btn {
+				margin-top: 25px;
+				width: 82%;
+			}
+
+			.pass {
+				width: 90%;
+				text-align: right;
+				padding-top: 20px;
+				//color: $cor;
 			}
-		}
-		.btn {
-			margin-top: 25px;
-			width: 82%;
-		}
-		.pass {
-			width: 90%;
-			text-align: right;
-			padding-top: 20px;
-			//color: $cor;
 		}
 	}
-}
 </style>