Browse Source

用户体系优化V1.0.0

zhengjinyi 5 years ago
parent
commit
2269b37d66
10 changed files with 616 additions and 234 deletions
  1. 101 23
      api/cart.js
  2. 59 16
      api/operator.js
  3. 123 26
      api/order.js
  4. 38 4
      api/product.js
  5. 185 41
      api/use.js
  6. 2 2
      common/config/config.js
  7. 5 5
      pages.json
  8. 1 1
      pages/tabBar/user/user.vue
  9. 101 112
      pages/user-module/password.vue
  10. 1 4
      pages/user-module/register.vue

+ 101 - 23
api/cart.js

@@ -1,30 +1,108 @@
 /**
  *@des 购物车模块接口
+ *@des 地址管理接口
  *@author zhengjinyi
  *@date 2020/03/19 14:56:57
  *@param registerByPass
  */
-// 获取购物车列表
-const queryShoppingCartList = "/personalCenter/address";
-// 购物车商品增减
-const cartUpdate = "/tiny-shop/v1/common/collect/create";
-// 购物车删除商品
-const cartDelete = "/tiny-shop/v1/common/collect/delete";
-// 查询地址列表
-const queryAddressList = "/tiny-shop/v1/common/collect/delete";
-// 添加新地址
-const addNewAddress = "/tiny-shop/v1/common/collect/delete";
-// 删除地址
-const deleteNewAddress = "/tiny-shop/v1/common/collect/delete";
-// 修改地址
-const updateAddress = "/tiny-shop/v1/common/collect/delete";
+import request from '@/common/config/caimeiApi.js'
+import $reg from '@/common/config/common.js'
+/**
+ *获取购物车列表
+ */
+export function queryShoppingCartList(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *购物车商品增减
+ */
+export function cartUpdate(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *购物车删除商品
+ */
+export function cartDelete(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *查询地址列表
+ */
+export function queryAddressList(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *添加新地址
+ */
+export function addNewAddress(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *添加新地址
+ */
+export function deleteNewAddress(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *修改地址
+ */
+export function updateAddress(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
 
-export {
-    queryShoppingCartList,
-    cartUpdate,
-    cartDelete,
-	queryAddressList,
-	addNewAddress,
-	deleteNewAddress,
-	updateAddress,
-};

+ 59 - 16
api/operator.js

@@ -1,23 +1,66 @@
 /**
- *@des 商品模块接口
+ *@des 运营人员管理接口
  *@author zhengjinyi
  *@date 2020/03/19 14:56:57
  *@param registerByPass
  */
-// 获取运营人员管理列表
-const queryOperatorList = "/personalCenter/address";
-// 添加运营人员
-const addOperator= "/tiny-shop/v1/common/collect/delete";
-// 删除运营人员
-const deleteOperator = "/tiny-shop/v1/common/collect/delete";
-// 更新邀请码
-const updateCode = "/tiny-shop/v1/common/transmit/create";
-
+import request from '@/common/config/caimeiApi.js'
+import $reg from '@/common/config/common.js'
 
+/**
+ *获取运营人员管理列表
+ */
+export function queryOperatorList(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *添加运营人员
+ */
+export function addOperator(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *删除运营人员
+ */
+export function deleteOperator(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *更新邀请码
+ */
+export function updateCode(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
 
-export {
-    queryOperatorList,
-    addOperator,
-    deleteOperator,
-	updateCode
-};

+ 123 - 26
api/order.js

@@ -4,30 +4,127 @@
  *@date 2020/03/19 14:56:57
  *@param registerByPass
  */
-// 获取订单区列表
-const queryOrderList = "/personalCenter/address";
-// 获取订单分享码
-const queryOrderShareCode = "/tiny-shop/v1/common/collect/create";
-// 取消订单
-const cancelOrder = "/tiny-shop/v1/common/collect/delete";
-// 删除订单
-const deleteOrder = "/tiny-shop/v1/common/transmit/create";
-// 确认收货
-const confirmReceipt = "/tiny-shop/v1/common/transmit/create";
-// 查询物流信息
-const queryLogistics = "/tiny-shop/v1/common/transmit/create";
-// 查询订单详情
-const queryOrderDetails = "/tiny-shop/v1/common/transmit/create";
-// 分享订单登录
-const orderShareLogin = "/tiny-shop/v1/common/transmit/create";
+import request from '@/common/config/caimeiApi.js'
+import $reg from '@/common/config/common.js'
+
+/**
+ *获取订单区列表
+ * @param
+ */
+export function queryOrderList(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *获取订单分享码
+ * @param
+ */
+export function queryOrderShareCode(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *取消订单
+ * @param
+ */
+export function cancelOrder(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *删除订单
+ * @param
+ */
+export function deleteOrder(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *确认收货
+ * @param
+ */
+export function confirmReceipt(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *查询物流信息
+ * @param
+ */
+export function queryLogistics(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *查询订单详情
+ * @param
+ */
+export function queryOrderDetails(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *分享订单登录
+ * @param
+ */
+export function orderShareLogin(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
 
-export {
-    queryOrderList,
-    queryOrderShareCode,
-    cancelOrder,
-    deleteOrder,
-	confirmReceipt,
-	queryLogistics,
-	queryOrderDetails,
-	orderShareLogin
-};

+ 38 - 4
api/product.js

@@ -4,6 +4,9 @@
  *@date 2020/03/19 14:56:57
  *@param registerByPass
  */
+import request from '@/common/config/caimeiApi.js'
+import $reg from '@/common/config/common.js'
+
 /**
  * 获取商品分类
  */
@@ -99,7 +102,38 @@ export function queryPreferred(params) {
 		})
 	});
 }
-// 再次购买商品列表
-const queryAgaingoodslist = "/tiny-shop/v1/common/transmit/create";
-// 加入购物车
-const addCart = "/tiny-shop/v1/common/transmit/create";
+/**
+ * @再次购买商品列表
+ * @param:
+ * @param:pageNum 页码
+ * @param:pageSize 每页条数
+ */
+export function queryAgaingoodslist(params) {
+	return new Promise(function(resolve,reject) {
+		request.get("/product//preferred",params, res => {
+			if(res.code == '0'){
+				resolve(res);
+			}else{
+				reject(res)
+			}
+		})
+	});
+}
+/**
+ * @加入购物车
+ * @param:
+ * @param:pageNum 页码
+ * @param:pageSize 每页条数
+ */
+export function addCart(params) {
+	return new Promise(function(resolve,reject) {
+		request.get("/product//preferred",params, res => {
+			if(res.code == '0'){
+				resolve(res);
+			}else{
+				reject(res)
+			}
+		})
+	});
+}
+

+ 185 - 41
api/use.js

@@ -5,35 +5,8 @@
  *@param registerByPass
  */
 import request from '@/common/config/caimeiApi.js'
-import { queryVerifImage , queryMobileCode , queryEmailCode } from '@/api/utils.js'
 import $reg from '@/common/config/common.js'
 
-// 首页初始化
-const queryHomeInfo = "/tiny-shop/v1/common/provinces/index";
-// 机构修改申请信息
-const organizationModify = "/tiny-shop/v1/common/provinces/index";
-// 获取机构资料
-const organizationInfo = "/tiny-shop/v1/common/provinces/index";
-// 机构资料修改保存
-const organizationUpdate = "/tiny-shop/v1/common/provinces/index";
-// 机构登录
-const organizationLogin = "/tiny-shop/v1/common/collect/create";
-// 绑定邮箱
-const bindingEmail = "/tiny-shop/v1/common/collect/delete";
-// 绑定微信
-const bindingWechat = "/tiny-shop/v1/common/transmit/create";
-// 邀请码授权登录
-const invitationLogin  = "/tiny-shop/v1/common/adv/index";
-// 获取个人中心信息
-const personalInfo  = "/tiny-shop/v1/common/config/index";
-// 获取账户余额明细
-const accountInfo = "/tiny-shop/v1/common/pay/create";
-// 手机修改密码
-const mobilePassword  = "/tiny-shop/v1/third-party/wechat-js-sdk";
-// 邮箱修改密码
-const emailPassword = "/tiny-shop/v1/third-party/wechat-js-sdk";
-
-
 /**
  *机构注册第一步校验
  */
@@ -136,6 +109,161 @@ export function organizationRegister(params) {
 		})
 	})
 }
+/**
+ *机构修改申请信息
+ */
+export function organizationModify(params) {
+	return new Promise(function(resolve,reject) {
+		request.get('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *机构提交修改申请信息
+ */
+export function organizationUpdateModify(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *获取机构资料
+ */
+export function organizationInfo(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *机构资料修改保存
+ */
+export function organizationUpdate(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}	
+/**
+ *机构登录
+ */
+export function organizationLogin(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}		
+/**
+ *绑定邮箱
+ */
+export function bindingEmail(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *绑定微信
+ */
+export function bindingWechat(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *邀请码授权登录
+ */
+export function invitationLogin(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *获取个人中心信息
+ */
+export function personalInfo(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *获取账户余额明细
+ */
+export function accountInfo(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+
+/**
+ *首页初始化
+ */
+export function queryHomeInfo(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
 
 /**
  *用户状态初始化
@@ -151,17 +279,33 @@ export function userInfoLogin(params) {
 		})
 	})
 }
-export default {
-    queryHomeInfo,
-    organizationModify,
-    organizationInfo,
-    organizationUpdate,
-    organizationLogin,
-    bindingEmail,
-    bindingWechat,
-    invitationLogin,
-    personalInfo,
-    accountInfo,
-    mobilePassword,
-    emailPassword,
-};
+/**
+ *手机修改密码
+ */
+export function mobilePassword(params) {
+	
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+/**
+ *邮箱修改密码
+ */
+export function emailPassword(params) {
+	return new Promise(function(resolve,reject) {
+		request.post('/club/authorization',params, res => {
+			if(res.code == '0'){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
+

+ 2 - 2
common/config/config.js

@@ -1,9 +1,9 @@
 let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-	URL_CONFIG = 'http://192.168.1.22:8008'//本地联调地址
+	// URL_CONFIG = 'http://192.168.1.22:8008'//本地联调地址
 	// URL_CONFIG = 'http://192.168.1.24:8107'//俊俊联调地址
-    // URL_CONFIG = 'https://mall-b.caimei365.com'//测试地址
+    URL_CONFIG = 'https://spi-b.caimei365.com'//测试地址
 }else{
     // 生产环境
     URL_CONFIG = 'https://mall.caimei365.com'

+ 5 - 5
pages.json

@@ -1,6 +1,11 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
+			"path": "pages/user-module/password",
+			"style": {
+				"navigationBarTitleText": "修改密码"
+			}
+		},{
 			"path": "pages/tabBar/home/home",
 			"style": {
 				"navigationBarTitleText": "采美采购商城",
@@ -171,11 +176,6 @@
 			"style": {
 				"navigationBarTitleText": "登录"
 			}
-		},{
-			"path": "pages/user-module/password",
-			"style": {
-				"navigationBarTitleText": "修改密码"
-			}
 		},{
 			"path": "pages/user-module/bindemail",
 			"style": {

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

@@ -209,7 +209,7 @@
 						this.initData();
 					}else{
 						this.isShowNoLogin = true;
-						this.$api.navigateTo('/pages/user-module/login-accont')
+						this.$api.redirectTo('/pages/user-module/login-accont')
 						this.$store.commit('updateAllNum',0)
 					}
 				})

+ 101 - 112
pages/user-module/password.vue

@@ -17,18 +17,18 @@
 		<view class="content" v-if="tabCurrentIndex === 1">
 			<view class="login-form clearfix">
 				<view class="login-input">
-					<input type="number" v-model="bindLinkPhone"  maxlength="11" class="input" @blur="onBlurInput" placeholder="请输入手机号"/>
+					<input type="number" v-model="mobile"  maxlength="11" class="input"  placeholder="请输入手机号"/>
 				</view>
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input code">
-					<input type="number" v-model="bindGraphiCode"  maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
+					<input type="number" v-model="imageCode"  maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
 				</view>
 				<view class="login-input img-btn">
 					<view class="vscodeimg">
-						<image src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2158189919,2752757953&fm=26&gp=0.jpg" mode=""></image>
+						<image :src="imageCodeUrl" mode=""></image>
 					</view>
-					<view class="vscod-refresh">
+					<view class="vscod-refresh" @click.stop="getVerificationCode">
 						<text class="iconfont icon-shuaxin"></text>
 						<text class="ref-text">刷新</text>
 					</view>
@@ -38,8 +38,8 @@
 				<view class="login-input code">
 					<input type="number" v-model="bindPhoneCode"  maxlength="6" class="input" placeholder="请输入短信验证码"/>
 				</view>
-				<view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
-					<button type="button" @click.stop="getEmailCode" :disabled="isDisabled" class="input" >获取验证码</button>
+				<view class="login-input btn" :class="[isMobileDisabled  ? 'disabled' : '']" @click.stop="getMobileCodeFn">
+					<button type="button" :disabled="isMobileDisabled" class="input" >{{ mobileCodeText }}</button>
 				</view>
 			</view>
 			<view class="login-form clearfix">
@@ -57,22 +57,22 @@
 				</view>
 			</view>
 			<view class="login-form clearfix">
-				<view class="login-btn"  @click="goLogin">修改密码</view>
+				<view class="login-btn"  @click="confirmPassword">修改密码</view>
 			</view>
 		</view>
 		<!-- 邮箱修改 -->
 		<view class="content" v-else>
 			<view class="login-form clearfix">
 				<view class="login-input">
-					<input class="input" type="number" v-model="bindLinkPhone"  maxlength="30" @blur="onBlurInput" placeholder="请输入邮箱地址"/>
+					<input class="input" type="number" v-model="email"  maxlength="30" placeholder="请输入邮箱地址"/>
 				</view>
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input code">
-					<input class="input" type="number" v-model="bindPhoneCode" maxlength="6"  placeholder="请输入邮箱验证码" />
+					<input class="input" type="number" v-model="emailCode" maxlength="6"  placeholder="请输入邮箱验证码" />
 				</view>
-				<view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
-					<button class="input"  type="button" @click.stop="getEmailCode" :disabled="isDisabled">获取验证码</button>
+				<view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']" @click.stop="getEmailCodeFn">
+					<button class="input"  type="button" :disabled="isEmialDisabled">{{ emailCodeText }}</button>
 				</view>
 			</view>
 			<view class="login-form clearfix">
@@ -93,42 +93,21 @@
 				<view class="login-btn"  @click="goLogin">修改密码</view>
 			</view>
 		</view>
-		<view v-if="isToast" class="model-warp" >
-			<view class="model-alert clearfix">
-				<view class="alert-content">
-					<view class="t-h1">{{toestText}}</view>
-					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
-				</view>
-				<view class="alert-btn">
-					<view class="btn btn-confirm" @click="hideToast">确定</view>
-				</view>
-			</view>
-		</view>
-		<!-- 授权按钮 -->
-		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
-			<view class="model-alert">
-				<view class="alert-content">
-					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
-				</view>
-				<view class="alert-btn">
-					<view class="btn btn-cancel" @click="hideModel">取消</view>
-					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
-				</view>
-			</view>
-		</view>
 	</view>
 </template>
 
 <script>
-	import { mapMutations } from 'vuex';
 	import authorize from '@/common/config/authorize.js' 
-	var self;
+	import { organizationRegister , organizationVerifyRegisterFirst ,organizationVerifyRegisterTwo } from "@/api/use.js"
+	import { getImageCode, getEmailCode, getMobileCode, uploadFileImage } from "@/api/utils.js"
+	
 	export default{
 		data() {
 			return{
 				tabCurrentIndex: 1,
-				mobile:'',  	//用户手机号
-				bindGraphiCode:'',  //图形验证
+				mobile:'',  		//用户手机号
+				email:'',			//邮箱地址
+				emailCode:'',		//油箱验证码
 				bindPhoneCode:'',  	//手机验证码
 				password:'',		//新密码
 				passwordCheck:'',   //二次校验新密码
@@ -136,87 +115,97 @@
 				isShowEyes:false,	//控显
 				iconEyes:'icon-yanjing_yincang_o',
 				iconEyen:'icon-yanjing_xianshi_o',
-				isDisabled:true,	//获取验证码按钮
-				isToast:false,		//控制显示未输入邀请码提示	
-				isUserInfo:false,	//控制显示授权弹窗
-				nickName:'',		//存储用户名
-				userInfo:'',		//存储微信用户授权信息
-				isSuccess:false,
-				toestText:'',
-				telPhone:'',
-				loginType:'',		//跳转类型
-				alertText:'',
-				listType: '',
-				listVal: '',
-				detilType:'',
-				id:''//商品ID
+				isEmialDisabled:false,//获取邮箱验证码按钮
+				isMobileDisabled:false,//获取手机短信按钮
+				imageCode:'',			//图形验证码
+				imageCodeUrl:'',		//图形验证码地址
+				imageCodetoken:'',		//图形校验token
+				count: '',				//倒计时
+				emailCodeText: '获取验证码',
+				mobileCodeText: '获取验证码',
+				codeTime: null,
 			}
 		},
 		onLoad(option) {
 			console.log(option)
+			this.getVerificationCode()
 		},
 		methods:{
-			...mapMutations(['login']),
-			goLogin() {
-				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
-					if (res.code == "1") {
-						//查看此微信用户是否已经授权过
-						authorize.getSetting().then(res =>{
-							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
-							if(res == 2){
-								self.isUserInfo = true
-							}else{
-								self.isUserInfo = false
-								self.wxGetUserInfo()
-							}
-						})
-					}else if(res.code =='0'){
-						self.toestText ='请输入邀请码';
-						self.alertText ='邀请码';
-						self.telPhone = res.msg;
-						self.isToast = true;
-					}else if(res.code =='-2'){
-						self.toestText ='邀请码已失效';
-						self.alertText ='新邀请码';
-						self.telPhone = res.msg;
-						self.isToast = true;
-					}else if(res.code =='-3'){
-						self.toestText ='邀请码已被使用';
-						self.alertText ='新邀请码';
-						self.telPhone = res.msg;
-						self.isToast = true;
-					}else{
-						uni.showToast({icon:'none', title: res.msg, duration: 3000});
-						self.isUserInfo = false
-					}
+			confirmPassword(){
+				
+			},
+			getVerificationCode(){//图形验证
+				getImageCode().then(res => {
+					this.imageCodeUrl = res.data.baseImage
+					this.imageCodetoken = res.data.token
 				})
 			},
-			onBlurInput(e){//邮箱输入框失去焦点设置按钮
-				if(e.detail.value ===''){
-					this.isDisabled = true
-				}else{
-					this.isDisabled = false
-				}
+			getEmailCodeFn(){
+				getEmailCode({email:this.email,status:3}).then(res =>{
+					this.$util.msg('验证邮件已发送至邮箱,请登录邮箱查收',2000);
+					const TIME_COUNT = 60;
+			     	if (!this.codeTime) {
+			       		this.count = TIME_COUNT;
+			       		this.isEmialDisabled = true;
+			       		this.codeTime = setInterval(() => {
+			       			if (this.count > 1 && this.count <= TIME_COUNT) {
+			         			this.count--
+			         			this.emailCodeText = this.count +'s重新发送'
+			        		} else {
+				         		this.isEmialDisabled = false;
+				         		clearInterval(this.codeTime)
+				         		this.codeTime = null
+								this.emailCodeText = '获取验证码'
+			        		}
+			       		},1000)
+			      	}
+				}).catch( res =>{
+					this.$util.msg(res.msg,2000);
+				})
 			},
-			getEmailCode(){
-				this.isDisabled = true
+			getMobileCodeFn(){
+				let params = {
+						mobile:this.mobile,
+						activateCodeType:1,
+						platformType:2,
+						imgCode:this.imageCode,
+						token:this.imageCodetoken,
+				}
+				getMobileCode(params).then(res =>{
+					this.$util.msg('验证短信已发送',2000);
+					const TIME_COUNT = 60;
+			     	if (!this.codeTime) {
+			       		this.count = TIME_COUNT;
+			       		this.isMobileDisabled = true;
+			       		this.codeTime = setInterval(() => {
+			       			if (this.count > 1 && this.count <= TIME_COUNT) {
+			         			this.count--
+			         			this.mobileCodeText = this.count +'s重新发送'
+			        		} else {
+				         		this.isMobileDisabled = false;
+				         		clearInterval(this.codeTime)
+				         		this.codeTime = null
+								this.mobileCodeText = '获取验证码'
+			        		}
+			       		},1000)
+			      	}
+				}).catch( res =>{
+					this.$util.msg(res.msg,2000);
+				})
 			},
 			tabClick(index) {//tab切换
 				this.tabCurrentIndex = index;
+				this.password = ''
+				this.passwordCheck = ''
+				if(this.tabCurrentIndex == 1){
+					this.getVerificationCode()
+				}
 			},
 			passwordEye() {//密码显隐操作
 				this.isShowEye = !this.isShowEye;
 			},
 			passwordEyes() {//密码显隐操作
 				this.isShowEyes = !this.isShowEyes;
-			},
-			//关闭未填邀请码弹窗
-			hideToast(){
-				self.isToast = false;
-			},
-			//关闭未授权用户授权提示弹窗
-			hideModel(){
-				self.isUserInfo = false;
 			}
 		}
 	}
@@ -226,12 +215,6 @@
 	.login{
 		width: 100%;
 		height: auto;
-		.model-warp.none{
-			display: none;			
-		}
-		.model-warp.show{
-			display: block;
-		}
 		.login-main{
 			width: 100%;
 			display: flex;
@@ -305,15 +288,21 @@
 				&.btn{
 					width: 215rpx;
 					float: left;
-					&.none{
-						background: $color-system;
-						.input{
-							color: #FFFFFF;
-							background: $color-system;
+					background: $btn-confirm;
+					.input{
+						width: 215rpx;
+						padding: 0;
+						color: #FFFFFF;
+						background: $btn-confirm;
+						text-align: center;
+						&.none{
+							background: #F7F7F7;
 						}
 					}
 					&.disabled{
+						background: #F7F7F7;
 						.input{
+							background: #F7F7F7;
 							color: #999999;
 						}
 					}

+ 1 - 4
pages/user-module/register.vue

@@ -71,7 +71,7 @@
 					<view class="vscodeimg">
 						<image :src="imageCodeUrl" mode=""></image>
 					</view>
-					<view class="vscod-refresh" @click.stop="refreshVscode">
+					<view class="vscod-refresh" @click.stop="getVerificationCode">
 						<text class="iconfont icon-shuaxin"></text>
 						<text class="ref-text">刷新</text>
 					</view>
@@ -494,9 +494,6 @@
 					this.imageCodetoken = res.data.token
 				})
 			},
-			refreshVscode(){//刷新图形吗
-				this.getVerificationCode()
-			},
 			// 三级联动选择
 			showMulLinkageThreePicker() {
 				this.isShowInput = true