소스 검색

commit - 微服务 用户更换手机 修改密码联调

zhengjinyi 4 년 전
부모
커밋
71e7acfb16

+ 0 - 138
api/use.js

@@ -1,138 +0,0 @@
-/**
- *@des 用户模块接口
- *@author zhengjinyi
- *@date 2020/03/19 14:56:57
- *@param registerByPass
- */
-import request from '@/common/config/caimeiApi.js'
-import $reg from '@/common/config/common.js'
-/**
- *手机修改密码
- */
-export function mobilePassword(params) {
-	return new Promise(function(resolve,reject) {
-		if( params.mobileOrEmail == ''){
-			uni.showToast({title: '请输入手机号',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isMobile(params.mobileOrEmail)){
-			uni.showToast({title: '手机格式不正确',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.activateCode == ''){
-			uni.showToast({title: '请输入手机验证码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isMobileCode(params.activateCode)){
-			uni.showToast({title: '验证码格式不正确',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.passWord == ''){
-			uni.showToast({title: '请输入密码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.checkPwd(params.passWord)){
-			uni.showToast({title: '密码必须为8-16位字母数字的组合',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.confirmPwd == ''){
-			uni.showToast({title: '请再次确认密码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.confirmPwd !== params.passWord){
-			uni.showToast({title: '两次输入的密码不一致',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		request.post('/user/findCompanyPwd',params, true,res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
-/**
- *邮箱修改密码
- */
-export function emailPassword(params) {
-	return new Promise(function(resolve,reject) {
-		if( params.mobileOrEmail == ''){
-			uni.showToast({title: '请输入邮箱',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isEmail(params.mobileOrEmail)){
-			uni.showToast({title: '请输入正确的邮箱地址',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.activateCode == ''){
-			uni.showToast({title: '请输入邮箱验证码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isEmailCode(params.activateCode)){
-			uni.showToast({title: '验证码格式不正确',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.passWord == ''){
-			uni.showToast({title: '请输入密码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.checkPwd(params.passWord)){
-			uni.showToast({title: '密码必须为8-16位字母数字的组合',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.confirmPwd == ''){
-			uni.showToast({title: '请再次确认密码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.confirmPwd !== params.passWord){
-			uni.showToast({title: '两次输入的密码不一致',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		request.post('/user/findCompanyPwd',params,true, res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
-/**
- *修改手机号
- */
-export function changeMobile(params) {
-	return new Promise(function(resolve,reject) {
-		if( params.contractMobile == ''){
-			uni.showToast({title: '请输入新的手机号码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isMobile(params.contractMobile)){
-			uni.showToast({title: '请输入正确的手机号码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.mobileCode == ''){
-			uni.showToast({title: '请输入旧手机验证码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isMobileCode(params.mobileCode)){
-			uni.showToast({title: '旧手机验证码格式不正确',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.newMobileCode == ''){
-			uni.showToast({title: '请输入新手机验证码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if(!$reg.isMobileCode(params.newMobileCode)){
-			uni.showToast({title: '新手机验证码格式不正确',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		request.post('/club/changeMobile',params,true, res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}

+ 0 - 174
api/utils.js

@@ -1,174 +0,0 @@
-/**
- *@des 公共接口
- *@author zhengjinyi
- *@date 2020/03/19 14:56:57
- *@param registerByPass
- */
-import requestUrl from '@/services/ajax.env.js'
-import request from '@/common/config/caimeiApi.js'
-import $reg from '@/common/config/common.js'
-
-
-/**
- *获取省市区列表
- */
-export function queryAddressInformation() {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/address",{}, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- * @新分类下的商品列表
- * @param:tinyTypeID 三级分类ID
- * @param:pageNum	页码
- * @param:pageSize	每页显示条数
- */
-export function searchQueryTinyType(url,params) {
-	return new Promise(function(resolve,reject) {
-		request.lodingGet(url,params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *获取协议
- */
-export function queryProtocol() {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/protocol",{}, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *获取邮箱验证码
- */
-export function getEmailCode(params) {
-	return new Promise(function(resolve,reject) {		
-		request.get("/user/mailbox",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *注册专用获取验证码
- */
-export function getRegisterMobileCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/captcha",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *会所资料修改手机号
- *旧手机号获取验证码
- */
-export function getClubMobileCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/modifyPhoneNumber",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *会所资料修改手机号
- *新手机号获取验证码
- */
-export function getClubNewMobileCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/modifyPhoneNumber",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *小程序机构账号绑定微信,PC微信绑定机构账号
- */
-export function getbindWechatCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/user/note",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *通过邀请链接绑定运营人员获取手机短信
- */
-export function getbindOperatorCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/seller/note",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
-				reject(res)
-			}
-		})
-	});
-}
-/**
- *上传图片
- */
-export function uploadFileImage() {
-	return new Promise(function(resolve,reject) {
-		uni.chooseImage({
-			count: 1, //默认1
-			sizeType: ['original','compressed'], //可以指定是原图还是压缩图,默认二者都有
-			sourceType: ['album'], //从相册选择
-			success: (res) => {
-				const tempFilePaths = res.tempFilePaths;
-				const uploadTask = uni.uploadFile({
-					url : requestUrl+'/formData/MultiPictareaddData',
-					filePath: tempFilePaths[0],
-					name: 'file',
-					header: {
-					    "Content-Type": "multipart/form-data",
-					},
-					formData: {
-						'user': 'test'
-					},
-					success: function (res) {
-						resolve(res);
-					},
-					error : function(e){
-						reject(res)
-					}
-				})
-			}
-		});
-	});
-}

+ 47 - 43
common/config/addressdata.js

@@ -2,12 +2,16 @@
  *请求获取省市区
  *已提供给地区选择picker组件使用
  */ 
-import { queryAddressInformation } from '@/api/utils.js';
+import ajaxService from '@/services/ajax.service.js'
+import PublicService from '@/services/public.service'
+
+const _PublicService = new PublicService(ajaxService)
+
 const provinceData=[];
 const cityData=[];
 const areaData=[];
 
-queryAddressInformation().then(res =>{
+_PublicService.GetAllAddressData().then(res =>{
 	let list = res.data;
 	list.forEach(item => {
 		let xxx = handleCitys(item);
@@ -15,48 +19,48 @@ queryAddressInformation().then(res =>{
 		cityData.push(xxx.e);
 		areaData.push(xxx.f);
 	})
-})
-//获取市后继续处理
-function handleCitys(data) {
-    const x = [];
-    const s = [];
-    if (data.cityList.length) {
-        data.cityList.forEach(item => {
-			let xxx = handleTowns(item);
-			s.push(xxx);
-			x.push(item)
-        })
-    }else{
-		s.push([{name:''}]);
-		x.push([{name:''}]);
+	//获取市后继续处理
+	function handleCitys(data) {
+	    const x = [];
+	    const s = [];
+	    if (data.cityList.length) {
+	        data.cityList.forEach(item => {
+				let xxx = handleTowns(item);
+				s.push(xxx);
+				x.push(item)
+	        })
+	    }else{
+			s.push([{name:''}]);
+			x.push([{name:''}]);
+		}
+	    return {
+	        e: x,
+	        f: s,
+	    };
 	}
-    return {
-        e: x,
-        f: s,
-    };
-}
-//获取区后继续处理
-function handleTowns(data) {
-    const x = [];
-    data.townList.forEach(item => {
-        x.push(item)
-    })
-    return x;
-}
-
-function handleData3(data) {
-    const xxx = [];
-    data.forEach(item => {
-        const ooo = []
-        item.forEach(opt => {
-           opt.forEach(z => {
-               ooo.push(z);
-           })
-        })
-        xxx.push(ooo)
-    })
-    return xxx;
-}
+	//获取区后继续处理
+	function handleTowns(data) {
+	    const x = [];
+	    data.townList.forEach(item => {
+	        x.push(item)
+	    })
+	    return x;
+	}
+	
+	function handleData3(data) {
+	    const xxx = [];
+	    data.forEach(item => {
+	        const ooo = []
+	        item.forEach(opt => {
+	           opt.forEach(z => {
+	               ooo.push(z);
+	           })
+	        })
+	        xxx.push(ooo)
+	    })
+	    return xxx;
+	}
+})
 module.exports = {
 	provinceData,
 	cityData,

+ 1 - 1
components/cm-module/listTemplate/commodityList.vue

@@ -109,7 +109,7 @@
 	import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
 	import modalLayer from "@/components/modal-layer"
 	import uniGrader from '@/components/uni-grade/uni-grade.vue'
-	import { searchQueryTinyType} from "@/api/utils.js"
+	import { searchQueryTinyType} from "@/services/public.js"
 	import { mapState,mapMutations } from 'vuex';
 	export default{
 		name:'CommodityList',

+ 0 - 1
components/cm-module/modelAlert/supplierRegisreAlert.vue

@@ -23,7 +23,6 @@
 </template>
 
 <script>
-	import { cancelPrompt } from "@/api/use.js"
 	export default{
 		name:'alert',
 		props:{

+ 0 - 1
components/cm-module/modelAlert/upgradeAlert.vue

@@ -18,7 +18,6 @@
 </template>
 
 <script>
-	import { cancelPrompt } from "@/api/use.js"
 	export default{
 		name:'alert',
 		props:{

+ 1 - 1
pages/login/apply-supplier.vue

@@ -204,7 +204,7 @@
 	import { mapMutations } from 'vuex';
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import { supplierList,supplierMedicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { uploadFileImage } from "@/api/utils.js" 
+	import { uploadFileImage } from "@/services/public.js" 
 	export default{
 		components:{
 			mpvueCityPicker

+ 1 - 1
pages/login/apply.vue

@@ -203,7 +203,7 @@
 	import { mapMutations } from 'vuex';
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { uploadFileImage } from "@/api/utils.js" 
+	import { uploadFileImage } from "@/services/public.js" 
 	export default{
 		components:{
 			mpvueCityPicker

+ 0 - 1
pages/login/bindOperator.vue

@@ -80,7 +80,6 @@
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js' 
 	import wxLogin from "@/common/config/wxLogin.js"
-	import { getbindOperatorCode } from "@/api/utils.js"
 	export default{
 		data() {
 			return{

+ 1 - 1
pages/login/binding.vue

@@ -111,7 +111,7 @@
 
 <script>
 	import { mapState,mapMutations } from 'vuex'
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	import authorize from '@/common/config/authorize.js'
 	import wxLogin from "@/common/config/wxLogin.js"
 	export default{

+ 0 - 1
pages/login/bindwechat.vue

@@ -72,7 +72,6 @@
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js' 
 	import wxLogin from "@/common/config/wxLogin.js"
-	import { getbindWechatCode } from "@/api/utils.js"
 	export default{
 		data() {
 			return{

+ 1 - 1
pages/login/information.vue

@@ -251,7 +251,7 @@
 	import { mapMutations } from 'vuex';
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { getClubMobileCode,getClubNewMobileCode,uploadFileImage } from "@/api/utils.js" 
+	import { uploadFileImage } from "@/services/public.js" 
 	var self;
 	export default{
 		components:{

+ 109 - 53
pages/login/password.vue

@@ -17,7 +17,7 @@
 		<view class="content" v-if="tabCurrentIndex === 1">
 			<view class="login-form clearfix">
 				<view class="login-input">
-					<input type="number" v-model="mobile"  maxlength="11" class="input" placeholder="请输入手机号" placeholder-class="placeholder"/>
+					<input type="number" v-model="phoneParams.mobileOrEmail"  maxlength="11" class="input" placeholder="请输入手机号" placeholder-class="placeholder"/>
 				</view>
 			</view>
 			<view class="login-form clearfix">
@@ -36,7 +36,7 @@
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input code">
-					<input type="number" v-model="mobileCode"  maxlength="6" class="input" placeholder="请输入短信验证码"  placeholder-class="placeholder"/>
+					<input type="number" v-model="phoneParams.smsCode"  maxlength="6" class="input" placeholder="请输入短信验证码"  placeholder-class="placeholder"/>
 				</view>
 				<view class="login-input btn" :class="[isMobileDisabled  ? 'disabled' : '']" >
 					<button type="button"
@@ -49,15 +49,15 @@
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input pwd">
-					<input v-show="isShowEye" type="text" v-model="password"  maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
-					<input v-show="!isShowEye" type="password" v-model="password"  :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="isShowEye" type="text" v-model="phoneParams.password"  maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="!isShowEye" type="password" v-model="phoneParams.password"  :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
 					<view class="iconfont" :class="isShowEye ? 'icon-kejian1' : 'icon-bukejian'"  @click="passwordEye"></view>
 				</view>
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input pwd">
-					<input v-show="isShowEyes" type="text" v-model="passwordCheck"  maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
-					<input v-show="!isShowEyes" type="password" v-model="passwordCheck"  :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="isShowEyes" type="text" v-model="phoneParams.passwordConfirm"  maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="!isShowEyes" type="password" v-model="phoneParams.passwordConfirm"  :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
 					<view class="iconfont" :class="isShowEyes ? 'icon-kejian1' : 'icon-bukejian'"  @click="passwordEyes"></view>
 				</view>
 			</view>
@@ -69,12 +69,12 @@
 		<view class="content" v-else>
 			<view class="login-form clearfix">
 				<view class="login-input">
-					<input class="input" type="text" v-model="email"  maxlength="30" placeholder="请输入邮箱地址"  placeholder-class="placeholder"/>
+					<input class="input" type="text" v-model="emailParams.mobileOrEmail"  maxlength="30" placeholder="请输入邮箱地址"  placeholder-class="placeholder"/>
 				</view>
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input code">
-					<input class="input" type="number" v-model="emailCode" maxlength="4"  placeholder="请输入邮箱验证码"  placeholder-class="placeholder"/>
+					<input class="input" type="number" v-model="emailParams.smsCode" maxlength="6"  placeholder="请输入邮箱验证码"  placeholder-class="placeholder"/>
 				</view>
 				<view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']">
 					<button class="input"  
@@ -87,15 +87,15 @@
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input pwd">
-					<input v-show="isShowEye" type="text" v-model="password"  maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
-					<input v-show="!isShowEye" type="password" v-model="password"  :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="isShowEye" type="text" v-model="emailParams.password"  maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="!isShowEye" type="password" v-model="emailParams.password"  :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"  placeholder-class="placeholder"/>
 					<view class="iconfont" :class="isShowEye ? 'icon-kejian1' : 'icon-bukejian'"  @click="passwordEye"></view>
 				</view>
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input pwd">
-					<input v-show="isShowEyes" type="text" v-model="passwordCheck"  maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
-					<input v-show="!isShowEyes" type="password" v-model="passwordCheck"  :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="isShowEyes" type="text" v-model="emailParams.passwordConfirm"  maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
+					<input v-show="!isShowEyes" type="password" v-model="emailParams.passwordConfirm"  :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password"  placeholder-class="placeholder"/>
 					<view class="iconfont" :class="isShowEyes ? 'icon-kejian1' : 'icon-bukejian'"  @click="passwordEyes"></view>
 				</view>
 			</view>
@@ -108,19 +108,11 @@
 
 <script>
 	import authorize from '@/common/config/authorize.js' 
-	import { mobilePassword , emailPassword } from "@/api/use.js"
-	import { getEmailCode } from "@/api/utils.js"
 	
 	export default{
 		data() {
 			return{
 				tabCurrentIndex: 1,
-				mobile:'',  		//用户手机号
-				email:'',			//邮箱地址
-				emailCode:'',		//油箱验证码
-				mobileCode:'',  	//手机验证码
-				password:'',		//新密码
-				passwordCheck:'',   //二次校验新密码
 				isShowEye:false,	//控显
 				isShowEyes:false,	//控显
 				iconEyes:'icon-yanjing_yincang_o',
@@ -134,6 +126,20 @@
 				emailCodeText: '获取验证码',
 				mobileCodeText: '获取验证码',
 				codeTime: null,
+				phoneParams: {
+					mobileOrEmail :'',
+					smsCode : '',
+					password : '',
+					passwordConfirm : '',
+					status:1
+				},
+				emailParams: {
+					mobileOrEmail :'',
+					smsCode : '',
+					password : '',
+					passwordConfirm : '',
+					status:2
+				},
 			}
 		},
 		onLoad(option) {
@@ -141,15 +147,40 @@
 		},
 		methods:{
 			confirmMobilePassword(){//手机号修改
-				let params = {
-						mobileOrEmail : this.mobile,
-						activateCode : this.mobileCode,
-						passWord : this.password,
-						confirmPwd : this.passwordCheck,
-						status:1
-					}
-				mobilePassword(params).then(res =>{
-					this.$util.msg(res.msg,2000);
+				if( this.phoneParams.mobileOrEmail == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.phoneParams.mobileOrEmail)){
+					this.$util.msg('手机格式不正确',2000);
+					return
+				}
+				if( this.phoneParams.smsCode == ''){
+					this.$util.msg('请输入手机验证码',2000);
+					return
+				}
+				if(!this.$reg.isMobileCode(this.phoneParams.smsCode)){
+					this.$util.msg('验证码格式不正确',2000);
+					return
+				}
+				if( this.phoneParams.password == ''){
+					this.$util.msg('请输入密码',2000);
+					return
+				}
+				if(!this.$reg.checkPwd(this.phoneParams.password)){
+					this.$util.msg('密码必须为8-16位字母数字的组合',2000);
+					return
+				}
+				if( this.phoneParams.passwordConfirm == ''){
+					this.$util.msg('请再次确认密码',2000);
+					return
+				}
+				if( this.phoneParams.passwordConfirm !== this.phoneParams.password){
+					this.$util.msg('两次输入的密码不一致',2000);
+					return
+				}
+				this.UserService.ModifyMobilePassword(this.phoneParams).then(res =>{
+					this.$util.msg(res.msg,2000,true,'success')
 					setTimeout(()=>{
 						uni.navigateBack({
 							delta: 1
@@ -160,23 +191,48 @@
 				})
 			},
 			confirmEmailPassword(){//邮箱修改密码
-				 let params = {
-						mobileOrEmail : this.email,
-						activateCode : this.emailCode,
-						passWord : this.password,
-						confirmPwd : this.passwordCheck,
-						status:2
-					}
-				emailPassword(params).then(res =>{
-					this.$util.msg(res.msg,2000);
-					setTimeout(()=>{
-						uni.navigateBack({
-							delta: 1
-						});
-					},2000)
-				}).catch( error =>{
-					this.$util.msg(error.msg,2000);
-				})
+				 if( this.emailParams.mobileOrEmail == ''){
+				 	this.$util.msg('请输入邮箱',2000);
+				  	return
+				  }
+				  if(!this.$reg.isEmail(this.emailParams.mobileOrEmail)){
+				 	this.$util.msg('请输入正确的邮箱地址',2000);
+				  	return
+				  }
+				  if( this.emailParams.smsCode == ''){
+				 	this.$util.msg('请输入邮箱验证码',2000);
+				  	return
+				  }
+				  if(!this.$reg.isMobileCode(this.emailParams.smsCode)){
+				 	this.$util.msg('验证码格式不正确',2000);
+				  	return
+				  }
+				  if( this.emailParams.password == ''){
+				 	this.$util.msg('请输入密码',2000);
+				  	return
+				  }
+				  if(!this.$reg.checkPwd(this.emailParams.password)){
+				 	this.$util.msg('密码必须为8-16位字母数字的组合',2000);
+				  	return
+				  }
+				  if( this.emailParams.passwordConfirm == ''){
+				 	this.$util.msg('请再次确认密码',2000);
+				  	return
+				  }
+				  if( this.emailParams.passwordConfirm !== this.emailParams.password){
+				 	this.$util.msg('两次输入的密码不一致',2000);
+				  	return
+				  }
+				 this.UserService.ModifyMobilePassword(this.emailParams).then(res =>{
+				 	this.$util.msg(res.msg,2000,true,'success')
+				 	setTimeout(()=>{
+				 		uni.navigateBack({
+				 			delta: 1
+				 		});
+				 	},2000)
+				 }).catch( error =>{
+				 	this.$util.msg(error.msg,2000);
+				 })
 			},
 			getVerificationCode(){//图形验证
 				this.PublicService.GetImgVerifyCode().then(res => {
@@ -185,16 +241,16 @@
 				})
 			},
 			getEmailCodeFn(){//获取邮箱验证码
-				if( this.email == ''){
+				if( this.emailParams.mobileOrEmail == ''){
 					this.$util.msg('请输入邮箱地址',2000);
 					return
 				}
-				if(!this.$reg.isEmail(this.email)){
+				if(!this.$reg.isEmail(this.emailParams.mobileOrEmail)){
 					this.$util.msg('请输入正确的邮箱地址',2000);
 					return
 				}
 				this.isEmialDisabled = true;
-				getEmailCode({email:this.email,status:3}).then(res =>{
+				this.PublicService.GetUserEmailCode({email:this.emailParams.mobileOrEmail,status:3}).then(res =>{
 					this.$util.msg('邮箱验证码已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {
@@ -218,11 +274,11 @@
 				})
 			},
 			getMobileCodeFn(){//获取手机验证码
-				if( this.mobile == ''){
+				if( this.phoneParams.mobileOrEmail == ''){
 					this.$util.msg('请输入手机号',2000);
 					return
 				}
-				if(!this.$reg.isMobile(this.mobile)){
+				if(!this.$reg.isMobile(this.phoneParams.mobileOrEmail)){
 					this.$util.msg('请输入正确的手机号',2000);
 					return
 				}
@@ -231,14 +287,14 @@
 					return
 				}
 				let params = {
-						mobile:this.mobile,
+						mobile:this.phoneParams.mobileOrEmail,
 						activateCodeType:1,
 						platformType:2,
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
 					}
 				this.isMobileDisabled = true;
-				this.PublicService.GetMobileCode(params).then(res =>{
+				this.PublicService.GetRegisterMobileCode(params).then(res =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {

+ 1 - 1
pages/login/register-supplier.vue

@@ -270,7 +270,7 @@
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import supplierAlert from '@/components/cm-module/modelAlert/supplierRegisreAlert.vue'
 	import { supplierList,supplierMedicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	export default{
 		components:{
 			mpvueCityPicker,

+ 1 - 1
pages/login/register.vue

@@ -71,7 +71,7 @@
 	import wxLogin from "@/common/config/wxLogin.js"
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	export default{
 		components:{
 			mpvueCityPicker

+ 0 - 1
pages/tabBar/user/user.vue

@@ -152,7 +152,6 @@
 	import upgradeAlert from '@/components/cm-module/modelAlert/upgradeAlert.vue'
 	import authorize from '@/common/config/authorize.js'
 	import { mapState,mapMutations } from 'vuex'
-	import { cancelPrompt } from "@/api/use.js"
 	
 	
 	export default{

+ 0 - 1
pages/user/account/account.vue

@@ -69,7 +69,6 @@
 	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
 	import tuiNomore from "@/components/tui-components/nomore/nomore"
 	import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
-	import { accountInfo } from "@/api/use.js"
 	var date = new Date();
 	export default{
 		components: {

+ 57 - 28
pages/user/setting/phone.vue

@@ -4,12 +4,12 @@
 			<view class="register-row clearfix">
 				<view class="register-from">
 					<view class="label">原手机号:</view>
-					<view class="row-input">{{bindMobile}}</view>
+					<view class="row-input">{{ params.mobile }}</view>
 				</view>
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from code">
-					<input class="row-input" type="number" v-model="mobileCode" placeholder="请输入原手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
+					<input class="row-input" type="number" v-model="params.smsCode" placeholder="请输入原手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
 				</view>
 				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']">
 					<button class="row-input"  type="button" @click.stop="getMobileCodeFn" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
@@ -17,12 +17,12 @@
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from">
-					<input class="row-input" type="number" v-model="contractMobile" placeholder="请输入新手机号" placeholder-class="place-holder" maxlength="11"/>
+					<input class="row-input" type="number" v-model="params.newMobile" placeholder="请输入新手机号" placeholder-class="place-holder" maxlength="11"/>
 				</view>
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from code">
-					<input class="row-input" type="number" v-model="newMobileCode" placeholder="请输入新手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
+					<input class="row-input" type="number" v-model="params.newSmsCode" placeholder="请输入新手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
 				</view>
 				<view class="register-from btn" :class="[isNewMobileDisabled  ? 'disabled' : '']" >
 					<button class="row-input"  type="button" @click.stop="getNewMobileCodeFn" :disabled="isNewMobileDisabled">{{ newMobileCodeText }}</button>
@@ -40,40 +40,57 @@
 
 <script>
 	import { mapMutations } from 'vuex';
-	import { getClubMobileCode,getClubNewMobileCode } from "@/api/utils.js" 
-	import { changeMobile } from "@/api/use.js" 
 	var self;
 	export default{
 		data() {
 			return{
-				userID:'',					//用户ID
 			    count: '',					//倒计时
 			    newCount: '',				//倒计时
 			    codeTime: null,
 			    codeTimeNew: null,
-				bindMobile:'',				//联系人手机号
-				contractMobile:'',			//新联系人手机号
-				mobileCode:'',				//手机号验证码
-				newMobileCode:'',			//新手机号手机验证码
 				mobileCodeText: '获取验证码',
 				newMobileCodeText: '获取验证码',
 				isMobileDisabled: false,	//手机验证码按钮控制
 				isNewMobileDisabled: false,	//手机验证码按钮控制
+				params:{
+					mobile:'',  //旧联系人手机号
+					newMobile:'', //新联系人手机号
+					smsCode:'',   //原手机号验证码
+					newSmsCode:'',//新手机号手机验证码
+					userId:0
+				},
 			}	
 		},
 		onLoad(option) {
-			this.bindMobile = option.phone
+			this.params.mobile = option.phone
 		},
 		methods:{
 			bindMobileCheck(){
-				let params = {
-						contractMobile2:this.bindMobile,
-						contractMobile:this.contractMobile,
-						mobileCode:this.mobileCode,
-						newMobileCode:this.newMobileCode,
-						userID:this.userID
+				if( this.params.newMobile == ''){
+					this.$util.msg('请输入新的手机号码',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.params.newMobile)){
+					this.$util.msg('请输入正确的手机号码',2000);
+					return
+				}
+				if( this.params.smsCode == ''){
+					this.$util.msg('请输入旧手机验证码',2000);
+					return
+				}
+				if(!this.$reg.isMobileCode(this.params.smsCode)){
+					this.$util.msg('旧手机验证码格式不正确',2000);
+					return
 				}
-				changeMobile(params).then(response =>{
+				if( this.params.newSmsCode == ''){
+					this.$util.msg('请输入新手机验证码',2000);
+					return
+				}
+				if(!this.$reg.isMobileCode(this.params.newSmsCode)){
+					this.$util.msg('新手机验证码格式不正确',2000);
+					return
+				}
+				this.UserService.UserUpdateMobile(this.params).then(response =>{
 					this.$util.msg('修改成功',1500,true,'success')
 					setTimeout(()=>{
 						uni.navigateBack({delta: 1})
@@ -83,17 +100,23 @@
 				})
 			},
 			getMobileCodeFn(){
-				if( this.bindMobile == ''){
+				if( this.params.mobile == ''){
 					this.$util.msg('请输入手机号',2000);
 					return
 				}
-				if(!this.$reg.isMobile(this.bindMobile)){
+				if(!this.$reg.isMobile(this.params.mobile)){
 					this.$util.msg('请输入正确的手机号',2000);
 					return
 				}
-				let params = { mobile : this.bindMobile }
 				this.isMobileDisabled = true;
-				getClubMobileCode(params).then(response =>{
+				this.PublicService.GetRegisterMobileCode(
+					{
+						mobile:this.params.mobile,
+						isCheckCaptcha:1,
+						activateCodeType:4,
+						platformType:0
+					}
+				).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {
@@ -117,17 +140,23 @@
 				})
 			},
 			getNewMobileCodeFn(){
-				if( this.contractMobile == ''){
+				if( this.params.newMobile == ''){
 					this.$util.msg('请输入手机号',2000);
 					return
 				}
-				if(!this.$reg.isMobile(this.contractMobile)){
+				if(!this.$reg.isMobile(this.params.newMobile)){
 					this.$util.msg('请输入正确的手机号',2000);
 					return
 				}
-				let params = { newMobile : this.contractMobile }
 				this.isNewMobileDisabled = true;
-				getClubNewMobileCode(params).then(response =>{
+				this.PublicService.GetRegisterMobileCode(
+					{
+						mobile:this.params.newMobile,
+						isCheckCaptcha:1,
+						activateCodeType:5,
+						platformType:0
+					}
+				).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTimeNew) {
@@ -153,7 +182,7 @@
 		},
 		onShow() {
 			this.$api.getStorage().then((resolve) =>{
-				this.userID = resolve.userId ? resolve.userId : 0
+				this.params.userId = resolve.userId ? resolve.userId : 0
 			})
 		}
 	}

+ 1 - 1
second/pages/form/form.vue

@@ -239,7 +239,7 @@
 <script>
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import paymentRecord from '@/components/cm-module/orderDetails/paymentRecord'
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	import authorize from '@/common/config/authorize.js'
 	import $reg from '@/common/config/common.js'
 	import { mapState,mapMutations } from 'vuex';

+ 0 - 1
seller/pages/club/addoperator.vue

@@ -73,7 +73,6 @@
 <script>
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js' 
-	import { getbindWechatCode } from "@/api/utils.js"
 	export default{
 		data() {
 			return{

+ 1 - 1
seller/pages/login/apply.vue

@@ -270,7 +270,7 @@
 import { mapMutations } from 'vuex';
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { uploadFileImage } from "@/api/utils.js" 
+	import { uploadFileImage } from "@/services/public.js" 
 	export default{
 		components:{
 			mpvueCityPicker

+ 1 - 1
seller/pages/login/information.vue

@@ -251,7 +251,7 @@
 	import { mapMutations } from 'vuex';
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
-	import { uploadFileImage } from "@/api/utils.js" 
+	import { uploadFileImage } from "@/services/public.js" 
 	export default{
 		components:{
 			mpvueCityPicker

+ 8 - 8
seller/pages/login/login.vue

@@ -54,13 +54,7 @@
 			}
 		},
 		onLoad() {
-			authorize.checkLogin().then(res => {
-				this.getWxAuthorize()
-			})
-			.catch(err => {
-				this.$api.navigateTo('/pages/authorization/authorization')
-				this.isSeller= true
-			})
+			
 		},
 		computed: {
 			...mapState(['isWxAuthorize'])
@@ -141,7 +135,13 @@
 			},
 		},
 		onShow() {
-			
+			authorize.checkLogin().then(res => {
+				this.getWxAuthorize()
+			})
+			.catch(err => {
+				this.$api.navigateTo('/pages/authorization/authorization')
+				this.isSeller= true
+			})
 		}
 	}
 </script>

+ 1 - 1
seller/pages/login/register-member.vue

@@ -256,7 +256,7 @@
 	
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
 	import shareModel from '@/components/cm-module/modelAlert/shareModel.vue'			 //分享弹窗
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	export default{
 		components:{
 			shareModel

+ 1 - 1
seller/pages/login/register.vue

@@ -238,7 +238,7 @@
 	import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
 	import authorize from '@/common/config/authorize.js' 
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	var self;
 	export default{
 		components:{

+ 59 - 0
services/public.js

@@ -0,0 +1,59 @@
+/**
+ *@des 公共接口
+ *@author zhengjinyi
+ *@date 2020/03/19 14:56:57
+ *@param registerByPass
+ */
+import requestUrl from '@/services/ajax.env.js'
+import request from '@/common/config/caimeiApi.js'
+import $reg from '@/common/config/common.js'
+
+/**
+ * @新分类下的商品列表
+ * @param:tinyTypeID 三级分类ID
+ * @param:pageNum	页码
+ * @param:pageSize	每页显示条数
+ */
+export function searchQueryTinyType(url,params) {
+	return new Promise(function(resolve,reject) {
+		request.lodingGet(url,params, res => {
+			if(res.code == 0){
+				resolve(res);
+			}else{
+				reject(res)
+			}
+		})
+	});
+}
+/**
+ *上传图片
+ */
+export function uploadFileImage() {
+	return new Promise(function(resolve,reject) {
+		uni.chooseImage({
+			count: 1, //默认1
+			sizeType: ['original','compressed'], //可以指定是原图还是压缩图,默认二者都有
+			sourceType: ['album'], //从相册选择
+			success: (res) => {
+				const tempFilePaths = res.tempFilePaths;
+				const uploadTask = uni.uploadFile({
+					url : requestUrl+'/formData/MultiPictareaddData',
+					filePath: tempFilePaths[0],
+					name: 'file',
+					header: {
+					    "Content-Type": "multipart/form-data",
+					},
+					formData: {
+						'user': 'test'
+					},
+					success: function (res) {
+						resolve(res);
+					},
+					error : function(e){
+						reject(res)
+					}
+				})
+			}
+		});
+	});
+}

+ 23 - 0
services/public.service.js

@@ -6,6 +6,16 @@ export default class PublicService {
 		Object.assign(this, { AjaxService })
 		this.name = 'PublicService'
 	}
+	/**
+	 * 获取地址
+	 */
+	GetAllAddressData (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/club/address', 
+			data, 
+			isLoading: true ,
+		})
+	}
 	/**
 	 * 获取图形验证码
 	 * platformType:小程序 2  WWW 0  CRM 1 
@@ -57,6 +67,19 @@ export default class PublicService {
 			isHost:true
 		})
 	}
+	/**
+	 * 获取邮箱短信验证码
+	 * email 	邮箱
+	 * status	1:绑定邮箱,2邮箱注册,3邮箱找回秘密
+	 */
+	GetUserEmailCode (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/user/mail/code', 
+			data, 
+			isLoading: true,
+			isHost:true
+		})
+	}
 	/**
 	 * 获取手机短信验证码
 	 * bindMobile 		机构手机号

+ 17 - 1
services/user.service.js

@@ -144,7 +144,23 @@ export default class UserService {
 		return this.AjaxService.post({ 
 			url:'/user/update/password', 
 			data, 
-			isLoading: false ,
+			isLoading: true ,
+			isHost:true
+		})
+	}
+	/**
+	 * 更换手机号
+	 * @param: mobile			原手机号	
+	 * @param: newMobile		新手机号
+	 * @param: smsCode			原手机号验证码
+	 * @param: newSmsCode		新手机号验证码
+	 * @param: userId			用户userId
+	*/
+	UserUpdateMobile (data = {}) {
+		return this.AjaxService.post({ 
+			url:'/user/update/mobile', 
+			data, 
+			isLoading: true ,
 			isHost:true
 		})
 	}

+ 1 - 1
supplier/pages/deliver/add-logistics.vue

@@ -55,7 +55,7 @@
 <script>
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js' 
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	var isPreviewImg;
 	export default{
 		data() {

+ 4 - 3
supplier/pages/login/bind-operator.vue

@@ -70,7 +70,6 @@
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js' 
 	import wxLogin from "@/common/config/wxLogin.js"
-	import { getbindOperatorCode } from "@/api/utils.js"
 	export default{
 		data() {
 			return{
@@ -140,14 +139,16 @@
 					return
 				}
 				let params = {
-						userId:this.bind_supplierInfo.userId,
 						mobile:this.bindLinkPhone,
+						userId:this.bind_supplierInfo.userId,
 						platformType:2,
+						isCheckCaptcha:0,
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
 					}
 				this.isMobileDisabled = true;
-				getbindOperatorCode(params).then(res =>{
+				this.PublicService.GetBindMobileCode(params)
+					.then(res =>{
 					const TIME_COUNT = 60;
 					this.$util.msg('验证短信已发送',2000)
 			     	if (!this.codeTime) {

+ 1 - 1
supplier/pages/user/information.vue

@@ -251,7 +251,7 @@
 
 <script>
 	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
-	import { uploadFileImage } from "@/api/utils.js"
+	import { uploadFileImage } from "@/services/public.js"
 	import { mapState,mapMutations } from 'vuex';
 	export default{
 		name:'information',

+ 76 - 34
supplier/pages/user/setting/password.vue

@@ -74,7 +74,7 @@
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input code">
-					<input class="input" type="number" v-model="emailParams.smsCode" maxlength="4"  placeholder="请输入邮箱验证码"  placeholder-class="placeholder"/>
+					<input class="input" type="number" v-model="emailParams.smsCode" maxlength="6"  placeholder="请输入邮箱验证码"  placeholder-class="placeholder"/>
 				</view>
 				<view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']">
 					<button class="input"  
@@ -108,19 +108,11 @@
 
 <script>
 	import authorize from '@/common/config/authorize.js' 
-	import { mobilePassword , emailPassword } from "@/api/use.js"
-	import { getEmailCode } from "@/api/utils.js"
 	
 	export default{
 		data() {
 			return{
 				tabCurrentIndex: 1,
-				mobile:'',  		//用户手机号
-				email:'',			//邮箱地址
-				emailCode:'',		//油箱验证码
-				mobileCode:'',  	//手机验证码
-				password:'',		//新密码
-				passwordCheck:'',   //二次校验新密码
 				isShowEye:false,	//控显
 				isShowEyes:false,	//控显
 				iconEyes:'icon-yanjing_yincang_o',
@@ -155,15 +147,40 @@
 		},
 		methods:{
 			confirmMobilePassword(){//手机号修改
-				let params = {
-						mobileOrEmail : this.mobile,
-						activateCode : this.mobileCode,
-						passWord : this.password,
-						confirmPwd : this.passwordCheck,
-						status:1
-					}
-				mobilePassword(params).then(res =>{
-					this.$util.msg(res.msg,2000);
+				if( this.phoneParams.mobileOrEmail == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.phoneParams.mobileOrEmail)){
+					this.$util.msg('手机格式不正确',2000);
+					return
+				}
+				if( this.phoneParams.smsCode == ''){
+					this.$util.msg('请输入手机验证码',2000);
+					return
+				}
+				if(!this.$reg.isMobileCode(this.phoneParams.smsCode)){
+					this.$util.msg('验证码格式不正确',2000);
+					return
+				}
+				if( this.phoneParams.password == ''){
+					this.$util.msg('请输入密码',2000);
+					return
+				}
+				if(!this.$reg.checkPwd(this.phoneParams.password)){
+					this.$util.msg('密码必须为8-16位字母数字的组合',2000);
+					return
+				}
+				if( this.phoneParams.passwordConfirm == ''){
+					this.$util.msg('请再次确认密码',2000);
+					return
+				}
+				if( this.phoneParams.passwordConfirm !== this.phoneParams.password){
+					this.$util.msg('两次输入的密码不一致',2000);
+					return
+				}
+				this.UserService.ModifyMobilePassword(this.phoneParams).then(res =>{
+					this.$util.msg(res.msg,2000,true,'success')
 					setTimeout(()=>{
 						uni.navigateBack({
 							delta: 1
@@ -174,15 +191,40 @@
 				})
 			},
 			confirmEmailPassword(){//邮箱修改密码
-				 let params = {
-						mobileOrEmail : this.email,
-						activateCode : this.emailCode,
-						passWord : this.password,
-						confirmPwd : this.passwordCheck,
-						status:2
-					}
-				emailPassword(params).then(res =>{
-					this.$util.msg(res.msg,2000);
+				 if( this.emailParams.mobileOrEmail == ''){
+					this.$util.msg('请输入邮箱',2000);
+				 	return
+				 }
+				 if(!this.$reg.isEmail(this.emailParams.mobileOrEmail)){
+					this.$util.msg('请输入正确的邮箱地址',2000);
+				 	return
+				 }
+				 if( this.emailParams.smsCode == ''){
+					this.$util.msg('请输入邮箱验证码',2000);
+				 	return
+				 }
+				 if(!this.$reg.isMobileCode(this.emailParams.smsCode)){
+					this.$util.msg('验证码格式不正确',2000);
+				 	return
+				 }
+				 if( this.emailParams.password == ''){
+					this.$util.msg('请输入密码',2000);
+				 	return
+				 }
+				 if(!this.$reg.checkPwd(this.emailParams.password)){
+					this.$util.msg('密码必须为8-16位字母数字的组合',2000);
+				 	return
+				 }
+				 if( this.emailParams.passwordConfirm == ''){
+					this.$util.msg('请再次确认密码',2000);
+				 	return
+				 }
+				 if( this.emailParams.passwordConfirm !== this.emailParams.password){
+					this.$util.msg('两次输入的密码不一致',2000);
+				 	return
+				 }
+				this.UserService.ModifyMobilePassword(this.emailParams).then(res =>{
+					this.$util.msg(res.msg,2000,true,'success')
 					setTimeout(()=>{
 						uni.navigateBack({
 							delta: 1
@@ -199,16 +241,16 @@
 				})
 			},
 			getEmailCodeFn(){//获取邮箱验证码
-				if( this.email == ''){
+				if( this.emailParams.mobileOrEmail == ''){
 					this.$util.msg('请输入邮箱地址',2000);
 					return
 				}
-				if(!this.$reg.isEmail(this.email)){
+				if(!this.$reg.isEmail(this.emailParams.mobileOrEmail)){
 					this.$util.msg('请输入正确的邮箱地址',2000);
 					return
 				}
 				this.isEmialDisabled = true;
-				getEmailCode({email:this.email,status:3}).then(res =>{
+				this.PublicService.GetUserEmailCode({email:this.emailParams.mobileOrEmail,status:3}).then(res =>{
 					this.$util.msg('邮箱验证码已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {
@@ -232,11 +274,11 @@
 				})
 			},
 			getMobileCodeFn(){//获取手机验证码
-				if( this.mobile == ''){
+				if( this.phoneParams.mobileOrEmail == ''){
 					this.$util.msg('请输入手机号',2000);
 					return
 				}
-				if(!this.$reg.isMobile(this.mobile)){
+				if(!this.$reg.isMobile(this.phoneParams.mobileOrEmail)){
 					this.$util.msg('请输入正确的手机号',2000);
 					return
 				}
@@ -245,14 +287,14 @@
 					return
 				}
 				let params = {
-						mobile:this.mobile,
+						mobile:this.phoneParams.mobileOrEmail,
 						activateCodeType:1,
 						platformType:2,
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
 					}
 				this.isMobileDisabled = true;
-				this.PublicService.GetMobileCode(params).then(res =>{
+				this.PublicService.GetRegisterMobileCode(params).then(res =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {

+ 57 - 28
supplier/pages/user/setting/phone.vue

@@ -4,12 +4,12 @@
 			<view class="register-row clearfix">
 				<view class="register-from">
 					<view class="label">原手机号:</view>
-					<view class="row-input">{{bindMobile}}</view>
+					<view class="row-input">{{ params.mobile }}</view>
 				</view>
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from code">
-					<input class="row-input" type="number" v-model="mobileCode" placeholder="请输入原手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
+					<input class="row-input" type="number" v-model="params.smsCode" placeholder="请输入原手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
 				</view>
 				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']">
 					<button class="row-input"  type="button" @click.stop="getMobileCodeFn" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
@@ -17,12 +17,12 @@
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from">
-					<input class="row-input" type="number" v-model="contractMobile" placeholder="请输入新手机号" placeholder-class="place-holder" maxlength="11"/>
+					<input class="row-input" type="number" v-model="params.newMobile" placeholder="请输入新手机号" placeholder-class="place-holder" maxlength="11"/>
 				</view>
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from code">
-					<input class="row-input" type="number" v-model="newMobileCode" placeholder="请输入新手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
+					<input class="row-input" type="number" v-model="params.newSmsCode" placeholder="请输入新手机号的验证码" placeholder-class="place-holder" maxlength="6"/>
 				</view>
 				<view class="register-from btn" :class="[isNewMobileDisabled  ? 'disabled' : '']" >
 					<button class="row-input"  type="button" @click.stop="getNewMobileCodeFn" :disabled="isNewMobileDisabled">{{ newMobileCodeText }}</button>
@@ -40,40 +40,57 @@
 
 <script>
 	import { mapMutations } from 'vuex';
-	import { getClubMobileCode,getClubNewMobileCode } from "@/api/utils.js" 
-	import { changeMobile } from "@/api/use.js" 
 	var self;
 	export default{
 		data() {
 			return{
-				userID:'',					//用户ID
 			    count: '',					//倒计时
 			    newCount: '',				//倒计时
 			    codeTime: null,
 			    codeTimeNew: null,
-				bindMobile:'',				//联系人手机号
-				contractMobile:'',			//新联系人手机号
-				mobileCode:'',				//手机号验证码
-				newMobileCode:'',			//新手机号手机验证码
 				mobileCodeText: '获取验证码',
 				newMobileCodeText: '获取验证码',
 				isMobileDisabled: false,	//手机验证码按钮控制
 				isNewMobileDisabled: false,	//手机验证码按钮控制
+				params:{
+					mobile:'',  //旧联系人手机号
+					newMobile:'', //新联系人手机号
+					smsCode:'',   //原手机号验证码
+					newSmsCode:'',//新手机号手机验证码
+					userId:0
+				},
 			}	
 		},
 		onLoad(option) {
-			this.bindMobile = option.phone
+			this.params.mobile = option.phone
 		},
 		methods:{
 			bindMobileCheck(){
-				let params = {
-						contractMobile2:this.bindMobile,
-						contractMobile:this.contractMobile,
-						mobileCode:this.mobileCode,
-						newMobileCode:this.newMobileCode,
-						userID:this.userID
+				if( this.params.newMobile == ''){
+					this.$util.msg('请输入新的手机号码',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.params.newMobile)){
+					this.$util.msg('请输入正确的手机号码',2000);
+					return
+				}
+				if( this.params.smsCode == ''){
+					this.$util.msg('请输入旧手机验证码',2000);
+					return
+				}
+				if(!this.$reg.isMobileCode(this.params.smsCode)){
+					this.$util.msg('旧手机验证码格式不正确',2000);
+					return
 				}
-				changeMobile(params).then(response =>{
+				if( this.params.newSmsCode == ''){
+					this.$util.msg('请输入新手机验证码',2000);
+					return
+				}
+				if(!this.$reg.isMobileCode(this.params.newSmsCode)){
+					this.$util.msg('新手机验证码格式不正确',2000);
+					return
+				}
+				this.UserService.UserUpdateMobile(this.params).then(response =>{
 					this.$util.msg('修改成功',1500,true,'success')
 					setTimeout(()=>{
 						uni.navigateBack({delta: 1})
@@ -83,17 +100,23 @@
 				})
 			},
 			getMobileCodeFn(){
-				if( this.bindMobile == ''){
+				if( this.params.mobile == ''){
 					this.$util.msg('请输入手机号',2000);
 					return
 				}
-				if(!this.$reg.isMobile(this.bindMobile)){
+				if(!this.$reg.isMobile(this.params.mobile)){
 					this.$util.msg('请输入正确的手机号',2000);
 					return
 				}
-				let params = { mobile : this.bindMobile }
 				this.isMobileDisabled = true;
-				getClubMobileCode(params).then(response =>{
+				this.PublicService.GetRegisterMobileCode(
+					{
+						mobile:this.params.mobile,
+						isCheckCaptcha:1,
+						activateCodeType:4,
+						platformType:0
+					}
+				).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {
@@ -117,17 +140,23 @@
 				})
 			},
 			getNewMobileCodeFn(){
-				if( this.contractMobile == ''){
+				if( this.params.newMobile == ''){
 					this.$util.msg('请输入手机号',2000);
 					return
 				}
-				if(!this.$reg.isMobile(this.contractMobile)){
+				if(!this.$reg.isMobile(this.params.newMobile)){
 					this.$util.msg('请输入正确的手机号',2000);
 					return
 				}
-				let params = { newMobile : this.contractMobile }
 				this.isNewMobileDisabled = true;
-				getClubNewMobileCode(params).then(response =>{
+				this.PublicService.GetRegisterMobileCode(
+					{
+						mobile:this.params.newMobile,
+						isCheckCaptcha:1,
+						activateCodeType:5,
+						platformType:0
+					}
+				).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTimeNew) {
@@ -153,7 +182,7 @@
 		},
 		onShow() {
 			this.$api.getStorage().then((resolve) =>{
-				this.userID = resolve.userId ? resolve.userId : 0
+				this.params.userId = resolve.userId ? resolve.userId : 0
 			})
 		}
 	}