zhengkaixin 1 سال پیش
والد
کامیت
ffdc87f9c7

+ 1 - 1
apis/pagejs/index.md

@@ -11,7 +11,7 @@ import request from '@/apis/utils/request'
  ---------------------
  recruit-api
  
- 
+ /mobile/dictionary/findByName
  
  
  

+ 8 - 1
apis/pagejs/tab.js

@@ -1,3 +1,10 @@
 import requestWhite from '@/apis/utils/requestWhite'
 import request from '@/apis/utils/request'
- 
+ 
+export function createUser(data) {
+  	return requestWhite({
+  		method: 'post',
+  		data: data,
+  		url: '/mobile/user/createUser'
+  	})
+ }

+ 17 - 0
apis/weixin.js

@@ -19,3 +19,20 @@ export function findAppletUserInfo(code) {
 		method: 'get',
 	})
 }
+
+
+export function findUserPhoneNumber(code) {
+	return request({
+		url: '/wechat/findUserPhoneNumber/' + code,
+		params: {},
+		method: 'get',
+	})
+}
+
+export function findByOpenId(openId) {
+	return request({
+		url: '/mobile/user/findByOpenId?openId='+openId,
+		params: {},
+		method: 'get',
+	})
+}

+ 4 - 1
pages/tab/choreInformation/choreInformation.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar back-text="零工驿站"  back-icon-size="0"  :customBack="()=>{}" back-icon-color="#ffffff"
+		<u-navbar back-text="零工驿站"  back-icon-size="0"  :customBack="customBack" back-icon-color="#ffffff"
 			:background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
 
 		<!-- 搜索框 -->
@@ -196,6 +196,9 @@
 			}
 		},
 		methods: {
+			customBack(){
+				
+			},
 			// 执行搜索
 			doSearch(searchQuery) {
 				console.log('searchQuery', searchQuery);

+ 4 - 1
pages/tab/issue/issue.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar back-text="发布"  back-icon-size="0"  :customBack="()=>{}" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
+		<u-navbar back-text="发布"  back-icon-size="0"  :customBack="customBack" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
 			:back-text-style="{color: '#ffffff'}"></u-navbar>
 
 		<view class="main">
@@ -87,6 +87,9 @@
 			}
 		},
 		methods: {
+			customBack(){
+				
+			},
 			toMyJobInformation() {
 				uni.navigateTo({
 					url: '/pages/mine/myJobInformation/myJobInformation'

+ 4 - 1
pages/tab/jobInformation/jobInformation.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar back-text="用工信息" back-icon-size="0"  :customBack="()=>{}" back-icon-color="#ffffff"
+		<u-navbar back-text="用工信息" back-icon-size="0"  :customBack="customBack" back-icon-color="#ffffff"
 			:background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
 
 		<!-- 搜索框 -->
@@ -232,6 +232,9 @@
 			}
 		},
 		methods: {
+			customBack(){
+				
+			},
 			// 执行搜索
 			doSearch(searchQuery) {
 				console.log('searchQuery', searchQuery);

+ 73 - 7
pages/tab/mine/mine.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar back-text="我的"  back-icon-size="0"  :customBack="()=>{}" back-icon-color="#ffffff"
+		<u-navbar back-text="我的"  back-icon-size="0"  :customBack="customBack" back-icon-color="#ffffff"
 			:background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
 		<view class="top">
 			<view class="photo">
@@ -105,12 +105,12 @@
 			 			</view>
 			 			<view class="grid-text">联系客服</view>
 			 		</u-grid-item>
-			 		<u-grid-item>
+			 		<!-- <u-grid-item>
 			 			<view class="icon">
 			 				<img src="@/assets/img/riLine-logout-box-r-line@1x.png" alt="">
 			 			</view>
 			 			<view class="grid-text">退出登录</view>
-			 		</u-grid-item>
+			 		</u-grid-item> -->
 			 	</u-grid>
 		</view>
 		<!-- 登录弹窗 -->
@@ -118,11 +118,14 @@
 				<view class="title">
 					登录荆开零工驿站
 				</view>
-				<view class="login-btn">
-				<u-icon name="weixin-fill" size="46"></u-icon>	<text>微信用户一键登录</text>
+				<view >
+					<button class="login-btn"  open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber" >
+						<u-icon name="weixin-fill" size="46"></u-icon>	<text>微信用户一键登录</text>
+					</button>
+				
 				</view>
 				
-				<view class="radio">
+				<view class="radio" v-if="false">
 					<!-- <radio></radio>
 						<view class="agreement">
 							阅读并同意<text style="color: #2795FD">《用户隐私协议》</text>
@@ -140,6 +143,8 @@
 
 <script>
 	import * as API from '@/apis/pagejs/tab.js'
+	import * as API_weixin from '@/apis/weixin.js'
+	
 	import tabbar from "@/components/Tabbar.vue"
 	
 	export default {
@@ -154,7 +159,68 @@
 							
 			}
 		},
+		onLoad() {
+			this.findByOpenId()
+		},
 		methods: {
+			findByOpenId(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				 API_weixin.findByOpenId(this.carhelp.getOpenId()).then((res) => {
+					 
+					 this.carhelp.setPersonInfo(res.data.regUser );
+					 this.carhelp.setToken(res.data.token);
+					 this.carhelp.setPersonInfoPlus(res.data);
+					 
+					 uni.hideLoading();
+					 this.show=false;
+				 }).catch(error => {
+					 uni.hideLoading();
+				 	// uni.showToast({
+				 	// 	title: error
+				 	// })
+				 	//this.getPhone()
+				 	
+				 })
+				
+			},
+			decryptPhoneNumber(e){
+				 console.log(e.detail.code)
+				 
+				 uni.showLoading({
+				 	title: "加载中",
+				 	mask: true,
+				 })
+				 API_weixin.findUserPhoneNumber(e.detail.code).then((res) => {
+				 	console.log(res)
+					API.createUser({
+						phone:res.data,
+						openId:this.carhelp.getOpenId()
+					}).then((res2) => {
+						
+						this.findByOpenId()
+						
+					}).catch(error2 => {	 
+						uni.showToast({
+							title: error2
+						})
+					})
+					
+				 	
+				 }).catch(error => {
+				 
+				 	uni.showToast({
+				 		title: error
+				 	})
+				 	//this.getPhone()
+				 	
+				 })
+			},
+			customBack(){
+				
+			},
 			toAuthentication() {
 				uni.navigateTo({
 					url: '/pages/mine/otherServices/authentication'
@@ -288,7 +354,7 @@
 	.login-btn{
 		background-color: rgba(0, 188, 99, 1);
 		color: #fff;
-		padding: 28rpx 70rpx;
+		padding: 8rpx 70rpx;
 		margin-top: 56rpx;
 		margin-bottom: 16rpx;
 		border-radius: 8px;