Sfoglia il codice sorgente

关联修改及项目跳转控制

wgl 4 anni fa
parent
commit
db85e932e4

+ 1 - 1
config/project.js

@@ -1 +1 @@
-exports.name = 'business'
+exports.name = 'pension'

+ 5 - 3
src/components/Common.vue

@@ -135,13 +135,17 @@
 					var token = response;
 					this.set_fun_list(token);
 
+					this.projectExchange();
+					this.$emit('asynCallBack');
+
 				}).catch(error => {
 					mui.toast(error);
 				})
 			},
 			//判断权限然后进行跳转
 			projectExchange() {
-				if (this.projectCheck && this.person_popedom && this.person_popedom.sceneId) {
+				//如果不想跳转,还可以传参exchange,一般用于home注册切换等功能
+				if (this.projectCheck && this.$route.query.exchange != '1' && this.person_popedom && this.person_popedom.sceneId) {
 					let project = Dictionaries.getProject(this.person_popedom.sceneId);
 					if (projectName.name != project && ['devlopment'].indexOf(process.env.VUE_APP_NODE_NAME) == -1) {
 						window.location.href = '../' + project + '/#/master';
@@ -152,10 +156,8 @@
 
 			//异步回调父组件的方法
 			asynCallBack() {
-				this.projectExchange();
 				//获取所有功能列表
 				this.getAllFunList();
-				this.$emit('asynCallBack');
 			},
 			...mapMutations({
 				set_openid: types.SET_WEIXIN_OPENID,

+ 1 - 1
src/projects/business/views/Master/Mine/Config.vue

@@ -22,7 +22,7 @@
 						<a class="mui-navigate-right"> 关于小鹏管家 </a>
 					</li>
 				</ul>
-				<a href="../home/#/register?project=business" class="vongi-meset jump">注册新身份</a>
+				<a href="../home/#/register?project=business&exchange=1" class="vongi-meset jump">注册新身份</a>
 				<a href="../home/#/user/role?project=business&exchange=1" class="vongi-meset jump">切换身份</a>
 				<a @click="loginOut" class="vongi-meset">退出帐号</a>
 			</div>

+ 1 - 1
src/projects/home/views/Register/Pension/Step4.vue

@@ -43,7 +43,7 @@
 						<input v-model="subForm.idCard" type="text" class="mui-input-clear" placeholder="请输入身份证号">
 					</div>
 					<div class="mui-input-row">
-						<label style="width:50%">人脸识别照片<i class="iconfont icon-tishi color4fc5f7"></i></label>
+						<label style="width:50%">照片<i class="iconfont icon-tishi color4fc5f7"></i></label>
 						<button @click="chooseImage" class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:50%">
 							<img v-if="subForm.faceImageUrl" :src="subForm.faceImageUrl" />
 							<font v-else>请选择</font>

+ 3 - 4
src/projects/pension/router/master.js

@@ -267,7 +267,7 @@ const routesMaster = [
 							mode: true
 						}
 					},
-					//关联长者,未注册第一步
+					//关联长者,未注册第一步,这里不能配限制权限,开放
 					{
 						path: 'relationPersonRegister',
 						name: 'MasterUserRelationPersonRegister',
@@ -278,16 +278,15 @@ const routesMaster = [
 							title: '关联长者,未注册第一步',
 						}
 					},
-					//关联长者,已注册
+					//关联长者,已注册,这里不能配限制权限,开放,入口页不能配
 					{
 						path: 'relationPerson',
 						name: 'MasterUserRelationPerson',
 						component: () => import('../views/Master/User/RelationPerson.vue'),
 						meta: {
-							requireAuth: true,
+							requireAuth: false,
 							role: [],
 							title: '关联长者,已注册',
-							mode: true
 						}
 					},
 				],

+ 1 - 1
src/projects/pension/views/Master/Mine/Config.vue

@@ -22,7 +22,7 @@
 						<a class="mui-navigate-right"> 关于小鹏管家 </a>
 					</li>
 				</ul>
-				<a href="../home/#/register?project=business" class="vongi-meset jump">注册新身份</a>
+				<a href="../home/#/register?project=business&exchange=1" class="vongi-meset jump">注册新身份</a>
 				<a href="../home/#/user/role?project=business&exchange=1" class="vongi-meset jump">切换身份</a>
 				<a @click="loginOut" class="vongi-meset">退出帐号</a>
 			</div>

+ 16 - 3
src/projects/pension/views/Master/User/RelationPerson.vue

@@ -62,11 +62,16 @@
 					</div>
 				</form>
 			</div>
-
 		</div>
 		<div class="fyy-footer">
 			<div class="bindfyy-btn"><button @click="submit" type="submit" class="mui-btn mui-btn-pink ">保 存</button></div>
 		</div>
+
+		<loading :visible="isLoading"></loading>
+
+		<!--图片裁剪-->
+		<cropper :cwidth="cropperWidth" :cheight="cropperHeight" :visible="cropperVisible" :field="cropperField" :cropper="cropper"
+		 @cropperFinish="cropperFinish" @cropperCancel="cropperCancel"></cropper>
 	</div>
 </template>
 
@@ -81,6 +86,7 @@
 		mapGetters,
 		mapMutations
 	} from 'vuex'
+	import Cropper from '$project/components/Cropper.vue'
 	import * as types from '$project/store/mutation-types'
 	import * as WxJsApi from '$project/utils/wxJsApi'
 	export default {
@@ -89,7 +95,8 @@
 			Common,
 			Loading,
 			TopHeader,
-			NavMenu
+			NavMenu,
+			Cropper
 		},
 		data() {
 			return {
@@ -153,8 +160,14 @@
 				this.subForm = Object.assign(this.subForm, this.old_relation_form_data);
 			}
 
+			if (this.person_data) {
+				this.subForm.personId = this.person_data.id;
+				this.subForm.idCard = this.person_data.idCard;
+				this.subForm.faceImageUrl = this.person_data.faceImageUrl;
+			}
+
 			this.subForm.openId = this.openId;
-			this.subForm.personId = this.person_data.id;
+
 			this.subForm.relationName = this.relationArr[0];
 		},
 		methods: {

+ 22 - 7
src/projects/pension/views/Master/User/RelationPersonRegister.vue

@@ -74,16 +74,18 @@
 				//如果用户存在直接调用扫码功能
 				this.subForm.name = this.person_data.name;
 				this.subForm.telephone = this.person_data.phone;
-				//调用扫一扫
-				WxJsApi.getWxConfig().then(res => {
-					this.scanCode();
-				});
+				if (!this.id) {
+					//调用扫一扫
+					WxJsApi.getWxConfig().then(res => {
+						this.scanCode();
+					});
+				}
 			}
 		},
 		methods: {
 			//微信扫二维码
 			scanCode() {
-				WxJsApi.scanQRCode(2);
+				WxJsApi.scanQRCode(0);
 			},
 			//发送验证码
 			sendMsg() {
@@ -149,7 +151,9 @@
 						this.set_old_relation_form_data(this.subForm);
 						this.$router.push({
 							name: 'MasterUserRelationPerson',
-							id: this.id
+							query: {
+								id: this.id
+							}
 						})
 
 						this.isLoading = false;
@@ -159,7 +163,18 @@
 					})
 				}
 			},
-			asynCallBack() {},
+			asynCallBack() {
+				if (this.person_data && this.id) {
+					this.set_old_relation_form_data(this.subForm);
+					this.$router.push({
+						name: 'MasterUserRelationPerson',
+						query: {
+							id: this.id
+						}
+					})
+				}
+
+			},
 			...mapMutations({
 				set_old_relation_form_data: types.SET_OLD_RELATION_FORM_DATA,
 			})

+ 6 - 1
src/utils/wxJsApi.js

@@ -19,7 +19,12 @@ export function getWxConfig(jsApiList) {
 					signature: wxconfig.signature, // 必填,签名,见附录1
 					jsApiList: jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
 				});
-				resolve(response);
+				wx.ready(function() {
+					resolve(response);
+				})
+				wx.error(function(res) {
+					reject('微信api配置出错');
+				});
 			}).catch(error => {
 				mui.toast(error);
 				reject(error);