瀏覽代碼

用户体系优化V2.0.0

zhengjinyi 5 年之前
父節點
當前提交
3dc59f5b28

+ 2 - 0
App.vue

@@ -20,6 +20,7 @@
 			 })
 		},
 		methods:{
+			...mapMutations(['login','logout']),
 			getCheekeyCode(){// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
 				authorize.getCode('weixin').then(wechatcode =>{
 					// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
@@ -29,6 +30,7 @@
 						uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
 						this.$store.commit('updateStatus',response.data)
 					}).catch(response =>{
+						this.logout()
 						uni.removeStorageSync('sessionid')
 						uni.setStorageSync('sessionid','JSESSIONID='+response.data)
 						this.$store.commit('updateStatus',response.data)

+ 1 - 1
api/order.js

@@ -61,7 +61,7 @@ export function getOrderPostage(params) {
  */
 export function queryOrderList(params) {
 	return new Promise(function(resolve,reject) {
-		request.get('/order/list',params, res => {
+		request.lodingGet('/order/list',params, res => {
 			if(res.code == 0){
 				resolve(res)
 			}else{

+ 0 - 32
api/utils.js

@@ -76,18 +76,6 @@ export function getEmailCode(params) {
  */
 export function getMobileCode(params) {
 	return new Promise(function(resolve,reject) {
-		if( params.mobile == ''){
-			uni.showToast({title: '请输入手机号',duration: 2000,mask:true, icon:'none'})
-			return
-		}
-		if(!$reg.isMobile(params.mobile)){
-			uni.showToast({title: '请输入正确的手机号',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.imgCode == ''){
-			uni.showToast({title: '请输入图形验证码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
 		request.get("/user/activateCodeByReg",params, res => {
 			if(res.code == 0){
 				resolve(res);
@@ -118,14 +106,6 @@ export function getClubMobileCode(params) {
  */
 export function getClubNewMobileCode(params) {
 	return new Promise(function(resolve,reject) {
-		if( params.newMobile == ''){
-			uni.showToast({title: '请输入新手机号',duration: 2000,mask:true, icon:'none'})
-			return
-		}
-		if(!$reg.isMobile(params.newMobile)){
-			uni.showToast({title: '请输入正确的手机号',duration: 2000,mask:true,icon:'none'})
-			return
-		}
 		request.get("/club/modifyPhoneNumber",params, res => {
 			if(res.code == 0){
 				resolve(res);
@@ -140,18 +120,6 @@ export function getClubNewMobileCode(params) {
  */
 export function getbindWechatCode(params) {
 	return new Promise(function(resolve,reject) {
-		if( params.mobile == ''){
-			uni.showToast({title: '请输入手机号',duration: 2000,mask:true, icon:'none'})
-			return
-		}
-		if(!$reg.isMobile(params.mobile)){
-			uni.showToast({title: '请输入正确的手机号',duration: 2000,mask:true,icon:'none'})
-			return
-		}
-		if( params.imgCode == ''){
-			uni.showToast({title: '请输入图形验证码',duration: 2000,mask:true,icon:'none'})
-			return
-		}
 		request.get("/user/note",params, res => {
 			if(res.code == 0){
 				resolve(res);

+ 1 - 0
common/config/authorize.js

@@ -91,6 +91,7 @@ const getSetting = function() {
     return new Promise((resolve,reject) => {
         uni.getSetting({
             success:function(res) {
+				console.log(res)
                 let authSetting=res.authSetting
                 if(authSetting['scope.userInfo']){resolve(1);return;}//授权成功
                 if(authSetting['scope.userInfo']===false){resolve(0);return;}//拒绝授权

+ 1 - 1
common/config/config.js

@@ -1,7 +1,7 @@
 let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	// URL_CONFIG = 'http://192.168.1.26:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
     URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
 }else{

+ 1 - 3
components/module/creatOrder/freight.vue

@@ -37,11 +37,9 @@
 					case '0':
 						this.freightText = '包邮';break
 					case '1':
-						this.freightText = '需要运费';break
+						this.freightText = res.freePostFlag;break
 					case '-1':
 						this.freightText = '到付';break
-					case '-2':
-						this.freightText = '仪器到付-产品包邮';break
 				}
 			},
 			showTip(){

+ 3 - 4
components/module/listTemplate/commodityList.vue

@@ -91,11 +91,10 @@
 			}
 		},
 		created() {
-			let self = this;
-			self.$api.getStorage().then((resolve) =>{
-				self.userID = resolve.userID
+			this.$api.getStorage().then((resolve) =>{
+				this.userID = resolve.userID ? resolve.userID : '';
 			})
-			self.setScrollHeight();		
+			this.setScrollHeight();		
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])

+ 5 - 0
pages.json

@@ -6,6 +6,11 @@
 				"navigationBarTitleText": "采美采购商城",
 				"enablePullDownRefresh":true
 			}
+		},{
+			"path": "pages/authorization/authorization",
+			"style": {
+				"navigationBarTitleText": "微信授权"
+			}
 		},{
 		    "path" : "pages/tabBar/category/category",
 		    "style" : {

+ 108 - 0
pages/authorization/authorization.vue

@@ -0,0 +1,108 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<button class="login-btn" type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo">微信授权</button>
+	</view>
+</template>
+
+<script>
+	import {mapState,mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	export default{
+		data() {
+			return{
+				
+			}
+		},
+		onLoad() {
+
+		},
+		methods:{
+			...mapMutations(['wxLogin']),
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					this.wxGetUserInfo()
+			    }else{
+					this.$util.msg('授权失败',2000)
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							uni.switchTab({
+								url:'/pages/tabBar/home/home'
+							})						
+						}
+					});	
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: auto;
+			padding:200rpx 0 0 0;
+			.logo{
+				width: 276rpx;
+				height: 236rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: $font-size-44;
+				line-height: 44rpx;
+				color: $color-system;
+				margin-top: 44rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 60rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-28;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-28;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			text-align: center;
+			background: linear-gradient(135deg,rgba(8,162,103,1) 0%,rgba(5,183,115,1) 100%);
+			margin: 0 auto;
+			margin-top: 400rpx;
+		}
+	}
+</style>

+ 1 - 1
pages/goods/product.vue

@@ -505,7 +505,7 @@
 		},
 		onShow() {
 			this.$api.getStorage().then((resolve) => {
-				this.userID = resolve.userID;	
+				this.userID = resolve.userID ? resolve.userID : '';	
 				if (isPreviewImg) {
 					isPreviewImg = false;
 					return;

+ 12 - 2
pages/search/search.vue

@@ -34,7 +34,11 @@
 								<uni-stars :stars="parseInt(item.price1Grade)" :font-size='36' :width-info="180"></uni-stars>
 							</view>
 							<view class="list-price" v-else>
-								<text>¥<text class="price-larger">{{item.retailPrice.toFixed(2)}}</text></text>
+								<view class="price-larger" v-if="item.price1TextFlag == '1'">
+									<text class="txt">该商品尚未公开价格</text>
+									<text class="txt">购买请致电:0755-22907771</text>
+								</view>
+								<text v-else>¥<text class="price-larger">{{item.retailPrice.toFixed(2)}}</text></text>
 							</view>
 						</view>
 					</view>
@@ -102,7 +106,7 @@
 		methods:{
 			initGetSerachRecord(){
 				this.$api.getStorage().then((resolve) =>{
-					this.userID = resolve.userID
+					this.userID = resolve.userID ? resolve.userID : '';
 				    querySearchHistory({userId:this.userID}).then(response =>{
 				    	this.serachRecordList = response.data
 				    }).catch(response =>{
@@ -514,6 +518,12 @@
 			color: #FF2A2A;
 			.price-larger {
 				font-size: 32rpx;
+				.txt{
+					font-size: $font-size-24;
+					display: inline-block;
+					line-height: 30rpx;
+					text-align: left;
+				}
 			}
 		}
 	}

+ 2 - 4
pages/tabBar/category/category.vue

@@ -54,7 +54,7 @@
 				verticalNavTop: 0,
 			}
 		},
-		onShow() {
+		onLoad() {
 			this.initData();
 		},
 		methods: {
@@ -65,7 +65,7 @@
 				})
 			},
 			// 数据初始化
-			async initData() {
+			initData() {
 				this.getProductCate();
 			},
 			// 获取商品分类列表
@@ -93,9 +93,7 @@
 				})
 			},
 			navToListPage(pro,index){//分类导航跳转
-				console.log(index)
 				let self = this;
-				console.log(pro)
 				uni.setStorage({
 					key: 'commodity_id',
 					data: pro.tinyTypeID,

+ 19 - 12
pages/tabBar/home/home.vue

@@ -65,19 +65,19 @@
 								<view class="title tui-skeleton-rect">
 									<text class="mclap">{{item.name}}</text>
 								</view>
-								<view class="title-none" v-if="item.price1TextFlag == '1'">
-									<text class="p big">尚未公开价格</text>
-								</view>
-								<view class="" v-else>
-									<view v-if="isLogin" class="price tui-skeleton-rect">
+								<view class="" v-if="isLogin">
+									<view class="title-none" v-if="item.price1TextFlag == '1'">
+										<text class="p big">尚未公开价格</text>
+									</view>
+									<view class="price tui-skeleton-rect" v-else>
 										<text class="p sm">¥</text>
 										<text class="p big">{{item.retailPrice.toFixed(2)}}</text>
 									</view>
-									<view v-else class="no-price">		
-										<text class="p-no">价格:</text>
-										<uni-stars :stars="parseInt(item.price1Grade)"></uni-stars>
-									</view>	
 								</view>
+								<view v-else class="no-price">
+									<text class="p-no">价格:</text>
+									<uni-stars :stars="parseInt(item.price1Grade)"></uni-stars>
+								</view>	
 							</view>
 						</view>
 					</scroll-view>
@@ -302,7 +302,14 @@
 		},
 		onShow(){
 			this.modallayer = false;
-			this.getCheekeyCode()
+			//查看此微信用户是否已经授权过
+			authorize.getSetting().then(res =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+				if(res == 1){
+					this.getCheekeyCode()
+				}else{
+					this.$api.redirectTo('/pages/authorization/authorization')
+				}
+			})				
 		}
 	}
 </script>
@@ -523,10 +530,10 @@
 				border-radius: 10rpx;
 			}
 			.title-none{
-				font-size: $font-size-28;
+				font-size: $font-size-24;
 				color: #FF2A2A;
 				line-height: 24rpx;
-				margin-top: 18rpx;
+				margin-top: 10rpx;
 			}
 			.title{
 				width: 210rpx;

+ 2 - 8
pages/tabBar/user/user.vue

@@ -87,15 +87,9 @@
 						<text class="cell-more iconfont icon-xiayibu"></text>
 					</view>
 				</view>
-				<view class="list-cell-item">
-					<view class="list-cell" @click="navigator('/pages/user/regularPurchase/regularPurchase')" hover-class="cell-hover" :hover-stay-time="50">
-						<text class="cell-tit">再次购买</text>
-						<text class="cell-more iconfont icon-xiayibu"></text>
-					</view>
-				</view>
 				<view class="list-cell-item">
 					<view class="list-cell" @click="navigator('/pages/user/setting/setting')" hover-class="cell-hover" :hover-stay-time="50">
-						<text class="cell-tit">户设置</text>
+						<text class="cell-tit">账户设置</text>
 						<text class="cell-more iconfont icon-xiayibu"></text>
 					</view>
 				</view>
@@ -143,7 +137,7 @@
 				],
 				twoList:[
 					{name:'账户余额明细',path:'/pages/user/account/account'},
-					{name:'发票信息',path:'/pages/user/invoice/invoice'}
+					{name:'再次购买',path:'/pages/user/regularPurchase/regularPurchase'}
 				]
 			}
 		},

+ 35 - 10
pages/user-module/apply.vue

@@ -2,7 +2,7 @@
 	<view class="container register">
 		<view class="register-error clearfix">
 			<view class="error-top animation" @click="showOpenError" :class="{'error-top--none': isOpenError}" >
-				<view class="name">审核未通过原因:</view>
+				<view class="name">审核未通过原因</view>
 				<view class="icon">{{ isOpenError ? '' : '查看详情'}}<text class="iconfont icon-xiangxiajiantou" :class="{'icon-xiangxiajiantou-active':isOpenError}"></text></view>
 			</view>
 			<view class="error-main animation" :class="{'error-main--hide':!isOpenError}" 
@@ -40,10 +40,10 @@
 			</view>
 			<view class="register-row clearfix" v-show="isShowCheckPhone">
 				<view class="register-from code">
-					<input class="row-input" type="text" v-model="mobileCode" placeholder="请输入上述手机号的验证码" maxlength="6"/>
+					<input class="row-input" type="number" v-model="mobileCode" placeholder="请输入上述手机号的验证码" maxlength="6"/>
 				</view>
-				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']" @click.stop="getMobileCodeFn">
-					<button class="row-input"  type="button" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
+				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']">
+					<button class="row-input"  type="button" @click.stop="getMobileCodeFn" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
 				</view>
 			</view>
 			<view class="register-row clearfix" v-show="isShowCheckPhone">
@@ -53,10 +53,10 @@
 			</view>
 			<view class="register-row clearfix" v-show="isShowCheckPhone">
 				<view class="register-from code">
-					<input class="row-input" type="text" v-model="newMobileCode" placeholder="请输入新手机号的验证码" maxlength="6"/>
+					<input class="row-input" type="number" v-model="newMobileCode" placeholder="请输入新手机号的验证码" maxlength="6"/>
 				</view>
-				<view class="register-from btn" :class="[isNewMobileDisabled  ? 'disabled' : '']" @click.stop="getNewMobileCodeFn">
-					<button class="row-input"  type="button" :disabled="isNewMobileDisabled">{{ newMobileCodeText }}</button>
+				<view class="register-from btn" :class="[isNewMobileDisabled  ? 'disabled' : '']" >
+					<button class="row-input"  type="button" @click.stop="getNewMobileCodeFn" :disabled="isNewMobileDisabled">{{ newMobileCodeText }}</button>
 				</view>
 			</view>
 		</view>
@@ -451,7 +451,16 @@ import { mapMutations } from 'vuex';
 				})
 			},
 			getMobileCodeFn(){
+				if( this.mobile == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.mobile)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
 				let params = { mobile : this.mobile }
+				this.isMobileDisabled = true;
 				getClubMobileCode(params).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
@@ -472,10 +481,20 @@ import { mapMutations } from 'vuex';
 			      	}		
 				}).catch( response =>{
 					this.$util.msg(response.msg,2000);
+					this.isMobileDisabled = false;
 				})
 			},
 			getNewMobileCodeFn(){
+				if( this.newMobile == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.newMobile)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
 				let params = { newMobile : this.newMobile }
+				this.isNewMobileDisabled = true;
 				getClubNewMobileCode(params).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
@@ -496,6 +515,7 @@ import { mapMutations } from 'vuex';
 			      	}
 				}).catch( res =>{
 					this.$util.msg(response.msg,2000);
+					this.isNewMobileDisabled = false;
 				})
 			},
 			// 三级联动选择
@@ -859,17 +879,22 @@ import { mapMutations } from 'vuex';
 						}
 					}
 					&.btn{
-						width: 176rpx;
+						width: 224rpx;
+						height: 88rpx;
 						float: left;
 						background: $btn-confirm;
+						padding: 0;
 						.row-input{
-							width: 176rpx;
+							width: 224rpx;
+							height: 88rpx;
+							line-height: 88rpx;
 							padding: 0;
 							color: #FFFFFF;
 							background: $btn-confirm;
 							text-align: center;
+							border-radius: 14rpx;
 							&.other{
-								width: 240rpx;
+								width: 224rpx;
 								background: #F7F7F7;
 								margin-right: 20rpx;
 							}

+ 19 - 4
pages/user-module/bindemail.vue

@@ -22,8 +22,13 @@
 					   placeholder="请输入邮箱验证码"
 				/>
 			</view>
-			<view class="login-input btn" :class="[isEmialDisabled  ? 'disabled' : '']" @click.stop="getEmailCodeFn">
-				<button type="button" :disabled="isEmialDisabled" class="input" >{{ emailCodeText }}</button>
+			<view class="login-input btn" :class="[isEmialDisabled  ? 'disabled' : '']">
+				<button type="button"  
+						@click.stop="getEmailCodeFn"
+						:disabled="isEmialDisabled" 
+						class="input" >
+						{{ emailCodeText }}
+				</button>
 			</view>
 		</view>
 		<view class="login-form btns clearfix">
@@ -87,6 +92,7 @@
 				this.$api.navigateTo(`/pages/user-module/bindwechat?data=${JSON.stringify(this.getOption)}&type=${this.loginType}`)
 			},
 			getEmailCodeFn(){
+				this.isEmialDisabled = true;	
 				getEmailCode({email:this.bindEmail,status:1}).then(res =>{
 					this.$util.msg('验证邮件已发送至邮箱,请登录邮箱查收',2000)
 					const TIME_COUNT = 60;
@@ -107,6 +113,7 @@
 			      	}
 				}).catch( res =>{
 					this.$util.msg(res.msg,2000);
+					this.isEmialDisabled = false;
 				})
 			}
 		},
@@ -184,12 +191,20 @@
 					margin-right: 20rpx;
 				}
 				&.btn{
-					width: 210rpx;
+					width: 258rpx;
+					height: 88rpx;
+					padding: 0;
 					float: left;
 					background: $btn-confirm;
 					.input{
-						background: $btn-confirm;
+						width: 258rpx;
+						height: 88rpx;
+						line-height: 88rpx;
+						padding: 0;
+						border-radius: 14rpx;
 						color: #FFFFFF;
+						background: $btn-confirm;
+						
 					}
 					&.disabled{
 						background: #F7F7F7;

+ 53 - 77
pages/user-module/bindwechat.vue

@@ -25,7 +25,7 @@
 		</view>
 		<view class="login-form clearfix">
 			<view class="login-input code">
-				<input type="number" 
+				<input type="text" 
 					   v-model="imageCode"  
 					   maxlength="6" 
 					   class="input" 
@@ -51,27 +51,17 @@
 					   placeholder="请输入短信验证码"
 				/>
 			</view>
-			<view class="login-input btn" :class="[isMobileDisabled  ? 'disabled' : '']" @click.stop="getMobileCodeFn">
+			<view class="login-input btn" :class="[isMobileDisabled  ? 'disabled' : '']" >
 				<button type="button"
+						@click.stop="getMobileCodeFn"
 						:disabled="isMobileDisabled"
-					    class="input" 
-				>{{ mobileCodeText }}</button>
+					    class="input">
+						{{ mobileCodeText }}
+				</button>
 			</view>
 		</view>
 		<view class="login-form clearfix">
-			<view class="login-btn"  @click="bindWechatInfo">绑定</view>
-		</view>
-		<!-- 授权按钮 -->
-		<view class="model-warp" :class="[isUserInfo ? 'show':'none']">
-			<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 class="login-btn"  @click="bindWechatInfo">绑定并登录</view>
 		</view>
 	</view>
 </template>
@@ -93,7 +83,6 @@
 				imageCodeUrl:'',		//图形验证码地址
 				imageCodetoken:'',		//图形校验token
 				isMobileDisabled:false, //获取手机短信按钮
-				isUserInfo:false,		//控制显示授权弹窗
 				count: '',				//倒计时
 				mobileCodeText: '获取验证码',
 				codeTime: null,
@@ -141,16 +130,7 @@
 					this.$util.msg('验证码格式不正确',2000)
 					return
 				}
-				//查看此微信用户是否已经授权过
-				authorize.getSetting().then(res =>{
-					// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
-					if(res == 2){
-						this.isUserInfo = true
-					}else{
-						this.isUserInfo = false
-						this.wxGetUserInfo()
-					}
-				})
+				this.bindingWechatLogin()
 			},
 			getVerificationCode(){//图形验证
 				getImageCode().then(res => {
@@ -159,6 +139,18 @@
 				})
 			},
 			getMobileCodeFn(){//获取手机验证码
+				if( this.bindLinkPhone == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.bindLinkPhone)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
+				if( this.imageCode == ''){
+					this.$util.msg('请输入图形验证码',2000);
+					return
+				}
 				let params = {
 						mobile:this.bindLinkPhone,
 						mobileOrEmail:this.bindMobile,
@@ -166,6 +158,7 @@
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
 				}
+				this.isMobileDisabled = true;
 				getbindWechatCode(params).then(res =>{
 					const TIME_COUNT = 60;
 					this.$util.msg('验证短信已发送',2000)
@@ -186,57 +179,32 @@
 			      	}
 				}).catch( res =>{
 					this.$util.msg(res.msg,2000)
+					this.isMobileDisabled = false;
 				})
 			},
-			getuserinfo: function (e) {//微信授权登录
-			    if (e.detail.userInfo) {
-					this.wxGetUserInfo()
-			    }else{
-					//用户按了拒绝按钮
-					uni.showModal({
-						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
-						showCancel: false,
-						confirmText: '授权',
-						success: function (res) {
-							 if (res.confirm) {
-								uni.openSetting({
-									 success: res => {
-										// console.log(res.authSetting)
-									 },
-									 fail: res => {
-										// console.log(res)
-									 }
-								})
-							 }
-						}
-					})
-			    }
-			 },
-			wxGetUserInfo(){
-				authorize.getCode('weixin').then(wechatcode =>{
-					wx.getUserInfo({
-						success: res => {
-							console.log('useInfo:',res.userInfo)
-							this.isUserInfo = false;
-							this.userInfo = res.userInfo;
-							let params ={
-									userID:this.userID,
-									mobile:this.bindLinkPhone,
-									linkName:this.bindLinkName,
-									verificationCode:this.mobildeCode,
-									nickName:res.userInfo.nickName,
-									headimgurl:res.userInfo.avatarUrl,
-							}
-							bindingWechat(params).then(response =>{
-								// this.login(response.data);
-								uni.switchTab({
-									url:'/pages/tabBar/user/user'
-								})
-							}).catch(response =>{
-								this.$util.msg(response.msg,2000)
-							})							
+			bindingWechatLogin(){//获取用户基本信息登录
+				wx.getUserInfo({
+					success: res => {
+						console.log('useInfo:',res.userInfo)
+						this.isUserInfo = false;
+						this.userInfo = res.userInfo;
+						let params ={
+								userID:this.userID,
+								mobile:this.bindLinkPhone,
+								linkName:this.bindLinkName,
+								verificationCode:this.mobildeCode,
+								nickName:res.userInfo.nickName,
+								headimgurl:res.userInfo.avatarUrl,
 						}
-					});	
+						bindingWechat(params).then(response =>{
+							// this.login(response.data);
+							uni.switchTab({
+								url:'/pages/tabBar/user/user'
+							})
+						}).catch(response =>{
+							this.$util.msg(response.msg,2000)
+						})							
+					}
 				})
 			},
 			goUserLogininit(){
@@ -318,12 +286,20 @@
 					margin-right: 20rpx;
 				}
 				&.btn{
-					width: 210rpx;
+					width: 258rpx;
+					height: 88rpx;
+					padding: 0;
 					float: left;
 					background: $btn-confirm;
 					.input{
+						width: 258rpx;
+						height: 88rpx;
+						line-height: 88rpx;
+						padding: 0;
+						border-radius: 14rpx;
 						color: #FFFFFF;
 						background: $btn-confirm;
+						
 					}
 					&.disabled{
 						background: #F7F7F7;

+ 34 - 9
pages/user-module/information.vue

@@ -34,10 +34,10 @@
 			</view>
 			<view class="register-row clearfix" v-show="isShowCheckPhone">
 				<view class="register-from code">
-					<input class="row-input" type="text" v-model="mobileCode" placeholder="请输入上述手机号的验证码" maxlength="6"/>
+					<input class="row-input" type="number" v-model="mobileCode" placeholder="请输入上述手机号的验证码" maxlength="6"/>
 				</view>
-				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']" @click.stop="getMobileCodeFn">
-					<button class="row-input"  type="button" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
+				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']">
+					<button class="row-input"  type="button" @click.stop="getMobileCodeFn" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
 				</view>
 			</view>
 			<view class="register-row clearfix" v-show="isShowCheckPhone">
@@ -47,10 +47,10 @@
 			</view>
 			<view class="register-row clearfix" v-show="isShowCheckPhone">
 				<view class="register-from code">
-					<input class="row-input" type="text" v-model="newMobileCode" placeholder="请输入新手机号的验证码" maxlength="6"/>
+					<input class="row-input" type="number" v-model="newMobileCode" placeholder="请输入新手机号的验证码" maxlength="6"/>
 				</view>
-				<view class="register-from btn" :class="[isNewMobileDisabled  ? 'disabled' : '']" @click.stop="getNewMobileCodeFn">
-					<button class="row-input"  type="button" :disabled="isNewMobileDisabled">{{ newMobileCodeText }}</button>
+				<view class="register-from btn" :class="[isNewMobileDisabled  ? 'disabled' : '']" >
+					<button class="row-input"  type="button" @click.stop="getNewMobileCodeFn" :disabled="isNewMobileDisabled">{{ newMobileCodeText }}</button>
 				</view>
 			</view>
 		</view>
@@ -469,7 +469,16 @@
 				})
 			},
 			getMobileCodeFn(){
+				if( this.mobile == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.mobile)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
 				let params = { mobile : this.mobile }
+				this.isMobileDisabled = true;
 				getClubMobileCode(params).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
@@ -490,10 +499,20 @@
 			      	}		
 				}).catch( response =>{
 					this.$util.msg(response.msg,2000);
+					this.isMobileDisabled = false;
 				})
 			},
 			getNewMobileCodeFn(){
+				if( this.newMobile == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.newMobile)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
 				let params = { newMobile : this.newMobile }
+				this.isNewMobileDisabled = true;
 				getClubNewMobileCode(params).then(response =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
@@ -514,6 +533,7 @@
 			      	}
 				}).catch( res =>{
 					this.$util.msg(response.msg,2000);
+					this.isNewMobileDisabled = false;
 				})
 			},
 			// 三级联动选择
@@ -791,17 +811,22 @@
 						}
 					}
 					&.btn{
-						width: 176rpx;
+						width: 224rpx;
+						height: 88rpx;
 						float: left;
 						background: $btn-confirm;
+						padding: 0;
 						.row-input{
-							width: 176rpx;
+							width: 224rpx;
+							height: 88rpx;
+							line-height: 88rpx;
 							padding: 0;
 							color: #FFFFFF;
 							background: $btn-confirm;
 							text-align: center;
+							border-radius: 14rpx;
 							&.other{
-								width: 240rpx;
+								width: 224rpx;
 								background: #F7F7F7;
 								margin-right: 20rpx;
 							}

+ 2 - 2
pages/user-module/login-accont.vue

@@ -6,7 +6,7 @@
 		</view>
 		<view class="login-form">
 			<view class="login-input">
-				<input type="number" 
+				<input type="text" 
 					   v-model="accountNumber"  
 					   maxlength="30" 
 					   class="input" 
@@ -24,7 +24,7 @@
 			</view>
 		</view>
 		<view class="login-btn"  @click="confirmLogin">登录</view>
-		<view class="login-btn-last" @click.stop="this.$api.navigateTo(`/pages/user-module/login?data=${getOption}`)">授权登录</view>
+		<view class="login-btn-last" @click.stop="this.$api.navigateTo(`/pages/user-module/login?data=${getOption}`)">邀请码登录</view>
 	</view>
 </template>
 

+ 24 - 86
pages/user-module/login.vue

@@ -12,19 +12,7 @@
 				   placeholder="请输入邀请码"
 			/>
 		</view>
-		<view class="login-btn"  @click="goLogin">授权登录</view>
-		<!-- 授权按钮 -->
-		<view class="model-warp" :class="[isUserInfo ? 'show':'none']">
-			<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 class="login-btn"  @click="goLogin">登录</view>
 	</view>
 </template>
 
@@ -36,12 +24,6 @@
 		data() {
 			return{
 				invitationCode:'',  //获取用户登录的邀请码
-				isUserInfo:false,	//控制显示授权弹窗
-				nickName:'',		//存储用户名
-				userInfo:'',		//存储微信用户授权信息
-				isSuccess:false,
-				toestText:'',
-				telPhone:'',
 				loginType:'',		//跳转类型
 				alertText:'',
 				listType: '',
@@ -68,71 +50,31 @@
 					this.$util.msg('请输入邀请码',2000)
 					return
 				}
-				
-				//查看此微信用户是否已经授权过
-				authorize.getSetting().then(res =>{
-					// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
-					if(res == 2){
-						this.isUserInfo = true
-					}else{
+				wx.getUserInfo({
+					success: res => {
+						console.log('useInfo:',res.userInfo)
 						this.isUserInfo = false
-						this.wxGetUserInfo()
-					}
-				})				
-			},
-			//授权登录 
-			getuserinfo: function (e) {
-			    if (e.detail.userInfo) {
-					this.wxGetUserInfo()
-			    }else{
-					//用户按了拒绝按钮
-					uni.showModal({
-						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
-						showCancel: false,
-						confirmText: '授权',
-						success: function (res) {
-							 if (res.confirm) {
-								uni.openSetting({
-									 success: res => {
-										// console.log(res.authSetting)
-									 },
-									 fail: res => {
-										// console.log(res)
-									 }
+						this.userInfo = res.userInfo;
+						let params ={
+								invitationCode:this.invitationCode,
+								nickName:res.userInfo.nickName,
+								headimgurl:res.userInfo.avatarUrl,
+						}							
+						invitationCodeLogin(params).then(response =>{
+							if(response.code == 0){
+								this.login(response.data)
+								uni.switchTab({
+									url:'/pages/tabBar/home/home'
 								})
-							 }
-						}
-					})
-			    }
-			 },
-			wxGetUserInfo(){
-				authorize.getCode('weixin').then(wechatcode =>{
-					wx.getUserInfo({
-						success: res => {
-							console.log('useInfo:',res.userInfo)
-							this.isUserInfo = false
-							this.userInfo = res.userInfo;
-							let params ={
-									invitationCode:this.invitationCode,
-									nickName:res.userInfo.nickName,
-									headimgurl:res.userInfo.avatarUrl,
-							}							
-							invitationCodeLogin(params).then(response =>{
-								if(response.code == 0){
-									this.login(response.data)
-									uni.switchTab({
-										url:'/pages/tabBar/home/home'
-									})
-								}else if(response.code == 4){
-									this.login(response.data)
-									this.$api.navigateTo(`/pages/user-module/bindemail?data=${JSON.stringify(this.getOption)}&pathType=1`)
-								}else{
-									this.$util.msg(response.msg,2000)
-									this.isUserInfo = false
-								}
-							})
-						}
-					});	
+							}else if(response.code == 4){
+								this.login(response.data)
+								this.$api.navigateTo(`/pages/user-module/bindemail?data=${JSON.stringify(this.getOption)}&pathType=1`)
+							}else{
+								this.$util.msg(response.msg,2000)
+								this.isUserInfo = false
+							}
+						})
+					}
 				})
 			},
 			goUserLogininit(){
@@ -155,10 +97,6 @@
 				} else if(this.listType) {
 					this.$api.navToListPage({type:this.listType,value:this.listVal,lType:'4'});
 				}
-			},
-			//关闭未授权用户授权提示弹窗
-			hideModel(){
-				this.isUserInfo = false;
 			}
 		}
 	}

+ 39 - 8
pages/user-module/password.vue

@@ -22,7 +22,7 @@
 			</view>
 			<view class="login-form clearfix">
 				<view class="login-input code">
-					<input type="number" v-model="imageCode"  maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
+					<input type="text" v-model="imageCode"  maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
 				</view>
 				<view class="login-input img-btn">
 					<view class="vscodeimg">
@@ -38,8 +38,13 @@
 				<view class="login-input code">
 					<input type="number" v-model="mobileCode"  maxlength="6" class="input" placeholder="请输入短信验证码"/>
 				</view>
-				<view class="login-input btn" :class="[isMobileDisabled  ? 'disabled' : '']" @click.stop="getMobileCodeFn">
-					<button type="button" :disabled="isMobileDisabled" class="input" >{{ mobileCodeText }}</button>
+				<view class="login-input btn" :class="[isMobileDisabled  ? 'disabled' : '']" >
+					<button type="button"
+							@click.stop="getMobileCodeFn"
+							:disabled="isMobileDisabled" 
+							class="input" >
+							{{ mobileCodeText }}
+					</button>
 				</view>
 			</view>
 			<view class="login-form clearfix">
@@ -64,15 +69,20 @@
 		<view class="content" v-else>
 			<view class="login-form clearfix">
 				<view class="login-input">
-					<input class="input" type="number" v-model="email"  maxlength="30" placeholder="请输入邮箱地址"/>
+					<input class="input" type="text" 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="emailCode" maxlength="6"  placeholder="请输入邮箱验证码" />
 				</view>
-				<view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']" @click.stop="getEmailCodeFn">
-					<button class="input"  type="button" :disabled="isEmialDisabled">{{ emailCodeText }}</button>
+				<view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']">
+					<button class="input"  
+							type="button"  
+							@click.stop="getEmailCodeFn"
+							:disabled="isEmialDisabled">
+							{{ emailCodeText }}
+					</button>
 				</view>
 			</view>
 			<view class="login-form clearfix">
@@ -166,6 +176,7 @@
 				})
 			},
 			getEmailCodeFn(){//获取邮箱验证码
+				this.isEmialDisabled = true;
 				getEmailCode({email:this.email,status:3}).then(res =>{
 					this.$util.msg('验证邮件已发送至邮箱,请登录邮箱查收',2000);
 					const TIME_COUNT = 60;
@@ -186,9 +197,22 @@
 			      	}
 				}).catch( res =>{
 					this.$util.msg(res.msg,2000);
+					this.isEmialDisabled = false;
 				})
 			},
 			getMobileCodeFn(){//获取手机验证码
+				if( this.mobile == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.mobile)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
+				if( this.imageCode == ''){
+					this.$util.msg('请输入图形验证码',2000);
+					return
+				}
 				let params = {
 						mobile:this.mobile,
 						activateCodeType:1,
@@ -196,6 +220,7 @@
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
 					}
+				this.isMobileDisabled = true;
 				getMobileCode(params).then(res =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
@@ -216,6 +241,7 @@
 			      	}
 				}).catch( res =>{
 					this.$util.msg(res.msg,2000);
+					this.isMobileDisabled = false;
 				})
 			},
 			tabClick(index) {//tab切换
@@ -310,15 +336,20 @@
 					margin-right: 20rpx;
 				}
 				&.btn{
-					width: 215rpx;
+					width: 263rpx;
+					height: 88rpx;
 					float: left;
 					background: $btn-confirm;
+					padding: 0;
 					.input{
-						width: 215rpx;
+						width: 263rpx;
+						height: 88rpx;
+						line-height: 88rpx;
 						padding: 0;
 						color: #FFFFFF;
 						background: $btn-confirm;
 						text-align: center;
+						border-radius: 14rpx;
 						&.none{
 							background: #F7F7F7;
 						}

+ 42 - 11
pages/user-module/register.vue

@@ -15,16 +15,21 @@
 			<view class="register-row clearfix">
 				<view class="register-from">
 					<view class="label">邮箱:</view>
-					<input class="row-input" type="text"  v-model="registerEmail" placeholder="请输入您的常用邮箱" maxlength="30"/>
+					<input class="row-input" type="text" @input="onInput1" v-model="registerEmail" placeholder="请输入您的常用邮箱" maxlength="30"/>
 				</view>
 			</view>
 			<view class="register-row clearfix">
 				<view class="register-from code">
 					<view class="label">邮箱验证码:</view>
-					<input class="row-input" type="text" v-model="regEmailCode" placeholder="请输入邮箱验证码" maxlength="4"/>
+					<input class="row-input" type="text" @input="onInput2" v-model="regEmailCode" placeholder="请输入邮箱验证码" maxlength="4"/>
 				</view>
-				<view class="register-from btn" :class="[isEmialDisabled ? 'disabled' : '']" @click.stop="getEmailCodeFn">
-					<button class="row-input"  type="button"  :disabled="isEmialDisabled">{{ emailCodeText }}</button>
+				<view class="register-from btn" :class="[isEmialDisabled ? 'disabled' : '']">
+					<button class="row-input"  
+							type="button"  
+							@click.stop="getEmailCodeFn"  
+							:disabled="isEmialDisabled">
+							{{ emailCodeText }}
+					</button>
 				</view>
 			</view>
 			<view class="register-row clearfix">
@@ -82,8 +87,13 @@
 					<view class="label">短信验证码:</view>
 					<input class="row-input" type="text" v-model="mobileCode" placeholder="请输入短信验证码" maxlength="6"/>
 				</view>
-				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']" @click.stop="getMobileCodeFn">
-					<button class="row-input"  type="button" :disabled="isMobileDisabled">{{ mobileCodeText }}</button>
+				<view class="register-from btn" :class="[isMobileDisabled  ? 'disabled' : '']" >
+					<button class="row-input"  
+							type="button" 
+							@click.stop="getMobileCodeFn" 
+							:disabled="isMobileDisabled">
+							{{ mobileCodeText }}
+					</button>
 				</view>
 			</view>
 			<view class="register-row clearfix">
@@ -425,29 +435,43 @@
 				})
 			},
 			getEmailCodeFn(){
+				this.isEmialDisabled = true;
 				getEmailCode({email:this.registerEmail,status:2}).then(res =>{
 					this.$util.msg('验证邮件已发送至邮箱,请登录邮箱查收',2000);
 					const TIME_COUNT = 60;
 			     	if (!this.codeTime) {
 			       		this.count = TIME_COUNT;
-			       		this.isEmialDisabled = true;
+						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 = '获取验证码'
+								this.isEmialDisabled = false;
 			        		}
 			       		},1000)
 			      	}
 				}).catch( res =>{
 					this.$util.msg(res.msg,2000);
+					this.isEmialDisabled = false;
 				})
 			},
 			getMobileCodeFn(){
+				if( this.registerMobile == ''){
+					this.$util.msg('请输入手机号',2000);
+					return
+				}
+				if(!this.$reg.isMobile(this.registerMobile)){
+					this.$util.msg('请输入正确的手机号',2000);
+					return
+				}
+				if( this.imageCode == ''){
+					this.$util.msg('请输入图形验证码',2000);
+					return
+				}
 				let params = {
 						mobile:this.registerMobile,
 						activateCodeType:2,
@@ -455,6 +479,7 @@
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
 					}
+				this.isMobileDisabled = true;
 				getMobileCode(params).then(res =>{
 					this.$util.msg('验证短信已发送',2000);
 					const TIME_COUNT = 60;
@@ -475,6 +500,7 @@
 			      	}
 				}).catch( res =>{
 					this.$util.msg(res.msg,2000);
+					this.isEmialDisabled = false;
 				})
 			},
 			getVerificationCode(){//图形验证
@@ -803,17 +829,22 @@
 						}
 					}
 					&.btn{
-						width: 176rpx;
+						width: 224rpx;
+						height: 88rpx;
 						float: left;
 						background: $btn-confirm;
+						padding: 0;
 						.row-input{
-							width: 176rpx;
+							width: 224rpx;
+							height: 88rpx;
+							line-height: 88rpx;
 							padding: 0;
 							color: #FFFFFF;
 							background: $btn-confirm;
 							text-align: center;
+							border-radius: 14rpx;
 							&.other{
-								width: 240rpx;
+								width: 224rpx;
 								background: #F7F7F7;
 								margin-right: 20rpx;
 							}

+ 1 - 1
pages/user/operator/list.vue

@@ -503,7 +503,7 @@
 		z-index: 1000;
 		.operator-alert{
 			width: 435rpx;
-			height: 376rpx;
+			height: 360rpx;
 			padding: 68rpx 32rpx;
 			background: #FFFFFF;
 			border-radius: 14rpx;

+ 1 - 1
pages/user/order/create-order.vue

@@ -233,7 +233,7 @@
 					let params ={
 							userId:resolve.userID,
 							productIds:this.productIds,
-							totalPrice:this.payAllPrice,
+							totalPrice:this.allPrice,
 							townID:this.addressData.townID
 						}
 					getOrderPostage(params).then(response =>{

+ 11 - 0
store/index.js

@@ -8,6 +8,7 @@ const store = new Vuex.Store({
 	state: {
 		hasLogin: false,
 		userInfo: {},
+		wechatUserInfo:{},
 		cartNumber:0,
 		isIphoneX:false
 	},
@@ -28,6 +29,16 @@ const store = new Vuex.Store({
 			uni.removeStorage({  
 		        key: 'userInfo'  
 		    })
+			uni.removeStorage({
+			    key: 'token'  
+			})
+		},
+		wxLogin(state,provider) {
+			state.wechatUserInfo = provider;
+			uni.setStorage({//缓存用户登陆状态
+			    key: 'wechatUserInfo',  
+			    data: provider  
+			}) 
 		},
 		updateStatus(state,provider){
 			let TIME = api.formatDate()