Bläddra i källkod

注册流程优化

zhengjinyi 5 år sedan
förälder
incheckning
a50960ec1b

+ 1 - 1
components/cm-custom/cm-custom.vue

@@ -2,7 +2,7 @@
 	<!-- 自定义导航栏 -->
 	<!-- 自定义导航栏 -->
 	<view class='navbar-wrap' :style="{height:CustomBar+'px',paddingTop:StatusBar+'px',background:navbarData.bgColor ? navbarData.bgColor : ''}"> 
 	<view class='navbar-wrap' :style="{height:CustomBar+'px',paddingTop:StatusBar+'px',background:navbarData.bgColor ? navbarData.bgColor : ''}"> 
 	  	<view class="navbar-text" 
 	  	<view class="navbar-text" 
-			  :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : capsule.height+'px'}" :class="platformClass">
+			  :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : 12+'px'}" :class="platformClass">
 	    	  {{navbarData.title ? navbarData.title : " "}}
 	    	  {{navbarData.title ? navbarData.title : " "}}
 	  	</view>
 	  	</view>
 	  	<view class="navbar-icon" v-if="navbarData.showCapsule == 1 ? true : false" 
 	  	<view class="navbar-icon" v-if="navbarData.showCapsule == 1 ? true : false" 

+ 69 - 0
components/cm-custom/custom-seller.vue

@@ -0,0 +1,69 @@
+<template name="headerNavbar">
+	<!-- 自定义导航栏 -->
+	<view class='navbar-wrap' :style="{height:CustomBar+'px',paddingTop:StatusBar+'px',background:navbarData.bgColor ? navbarData.bgColor : ''}"> 
+	  	<view class="navbar-text" 
+			  :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : 12+'px'}" :class="platformClass">
+	    	  {{navbarData.title ? navbarData.title : " "}}
+	  	</view>
+	</view>
+</template>
+
+<script>
+	var self;
+	export default{
+		name:'headerNavbar',
+		props:{
+		    navbarData: { // 由父页面传递的数据
+				type: Object
+		    }
+		},
+		data() {
+			return{
+				CustomBar:this.CustomBar,// 顶部导航栏高度
+				StatusBar: this.StatusBar,
+				fontSizeSetting:this.fontSizeSetting,
+				screenWidth:this.screenWidth,
+				capsule:this.capsule,
+				platformClass:this.platformClass,
+			}
+		},
+		created() {
+			if (getCurrentPages().length === 1) { // 当只有一个页面时
+			      this.navbarData.haveBack = false;
+			} else {
+			      this.navbarData.haveBack = true;
+			}
+		},
+		onLoad(){
+			
+		},
+		methods:{
+			
+		},
+		onShow(){
+	
+		}
+	}
+</script>
+
+<style lang="scss">
+	.navbar-wrap {
+		 position: fixed;
+		 width: 100%;
+		 top: 0;
+		 z-index: 100000;
+		 box-sizing: border-box;
+	}
+	.navbar-text {
+		 font-size: 30rpx;
+		 color: #000000;
+		 font-weight: 500;
+	}
+	.navbar-text.center{
+		text-align: center;
+	}
+	.navbar-text.left{
+		text-align: left;
+		padding-left: 45px;
+	}
+</style>

+ 4 - 4
components/cm-module/cm-seller/category.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="category-container clearfix" :style="{paddingTop:CustomBar+'px'}">
 	<view class="category-container clearfix" :style="{paddingTop:CustomBar+'px'}">
-		<cu-custom :navbar-data='nvabarData'></cu-custom>
+		<cm-custom :navbar-data='nvabarData'></cm-custom>
 		<!-- 头部轮播 -->
 		<!-- 头部轮播 -->
 		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
 		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
 		<view class="category-list tui-skeleton">
 		<view class="category-list tui-skeleton">
@@ -48,11 +48,11 @@
 		data() {
 		data() {
 			return {
 			return {
 				nvabarData: {		//顶部自定义导航
 				nvabarData: {		//顶部自定义导航
-					showCapsule: 0, // 是否显示左上角图标  1表示显示  0表示不显示,
-					showSearch: 0,
 					title: '商品分类',  // 导航栏 中间的标题
 					title: '商品分类',  // 导航栏 中间的标题
 					haveBack:false,
 					haveBack:false,
-					textLeft:this.$store.state.isIphone
+					textLeft:this.$store.state.isIphone,
+					textColor:'#333333',
+					bgColor:'#FFFFFF'
 				},
 				},
 				isIphoneX:this.$store.state.isIphoneX,
 				isIphoneX:this.$store.state.isIphoneX,
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				CustomBar:this.CustomBar,// 顶部导航栏高度

+ 1 - 0
components/cm-module/cm-seller/home.vue

@@ -329,6 +329,7 @@
 		background:#FFFFFF url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/05/%E8%83%8C%E6%99%AF2%402x.png)no-repeat;
 		background:#FFFFFF url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/05/%E8%83%8C%E6%99%AF2%402x.png)no-repeat;
 		position: relative;
 		position: relative;
 		background-size: cover;
 		background-size: cover;
+		margin-top: 10rpx;
 	}	
 	}	
 	.tui-banner-swiper {
 	.tui-banner-swiper {
 		width: 700rpx;
 		width: 700rpx;

+ 1 - 1
components/cm-module/cm-seller/user.vue

@@ -6,7 +6,7 @@
 				<view class="header-main" v-if="hasLogin">
 				<view class="header-main" v-if="hasLogin">
 					<view class="header-text">
 					<view class="header-text">
 						<view class="user-item">
 						<view class="user-item">
-							<text class="u-h1">协销员工</text>
+							<text class="u-h1">{{name}}</text>
 						</view>
 						</view>
 						<view class="user-item">
 						<view class="user-item">
 							<text class="u-tips">协销人员</text>
 							<text class="u-tips">协销人员</text>

+ 3 - 3
components/cm-module/home/cm-custom.vue

@@ -1,8 +1,8 @@
 <template name="headerNavbar">
 <template name="headerNavbar">
 	<!-- 自定义导航栏 -->
 	<!-- 自定义导航栏 -->
-	<view class='navbar-wrap' :style="{height:(CustomBar+55)+'px',paddingTop:StatusBar+'px'}"> 
+	<view class='navbar-wrap' :style="{height:(CustomBar+50)+'px',paddingTop:StatusBar+'px'}"> 
 	  	<view class="navbar-text" 
 	  	<view class="navbar-text" 
-			  :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : capsule.height+'px'}" :class="platformClass">
+			  :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : 12+'px'}" :class="platformClass">
 	    	  {{navbarData.title ? navbarData.title : " "}}
 	    	  {{navbarData.title ? navbarData.title : " "}}
 	  	</view>
 	  	</view>
 		<view class="search-input">
 		<view class="search-input">
@@ -118,7 +118,7 @@
 	.search-input{
 	.search-input{
 		width: 100%;
 		width: 100%;
 		height: 70rpx;
 		height: 70rpx;
-		padding: 20rpx 0;
+		padding: 20rpx 0 10rpx 0;
 		.gosearch-btn{
 		.gosearch-btn{
 			/* #ifndef APP-NVUE */
 			/* #ifndef APP-NVUE */
 			display: flex;
 			display: flex;

+ 4 - 7
components/cm-module/modelAlert/upgradeAlert.vue

@@ -1,12 +1,12 @@
 <template name="alert">
 <template name="alert">
 	<view class="alert spec" :class="specClass">
 	<view class="alert spec" :class="specClass">
 		<!-- 运费弹窗说明 -->
 		<!-- 运费弹窗说明 -->
-		<view class="freight-alert"  @click.stop="hideFpgradeAlert">
+		<view class="freight-alert"  @click.stop="unBindUpgrade">
 			<view class="content clearfix">
 			<view class="content clearfix">
-				<view class="title"><text class="iconfont icon-iconfontguanbi" @click.stop="hideFpgradeAlert"></text></view>
+				<view class="title"><text class="iconfont icon-iconfontguanbi" @click.stop="unBindUpgrade"></text></view>
 				<view class="text-content">
 				<view class="text-content">
 					<view class="text-h1">您目前为<text class="col">普通机构用户</text></view>
 					<view class="text-h1">您目前为<text class="col">普通机构用户</text></view>
-					<view class="text-h1">可以升级<text class="col">会员机构</text>享受更多的服务</view>
+					<view class="text-h1">可以升级<text class="col">会员机构</text>享受更多更好的服务</view>
 				</view>
 				</view>
 				<view class="text-btn">
 				<view class="text-btn">
 					<view class="btn" @click.stop="GoApply">去升级</view>
 					<view class="btn" @click.stop="GoApply">去升级</view>
@@ -38,11 +38,8 @@
 			
 			
 		},
 		},
 		methods:{
 		methods:{
-			hideFpgradeAlert(){
-				this.$parent.isUpgradeAlert = false
-			},
 			GoApply(){
 			GoApply(){
-				this.$api.navigateTo(`/pages/login/apply?clubStatus=${this.status}`);
+				this.$emit('GoApply')
 			},
 			},
 			unBindUpgrade(){
 			unBindUpgrade(){
 				this.$emit('unBindUpgrade')
 				this.$emit('unBindUpgrade')

+ 2 - 0
main.js

@@ -8,8 +8,10 @@ import { msg, modal,json,prePage } from'./utils/util'
 import Json from './json' //本地数据
 import Json from './json' //本地数据
 import cuCustom from './components/cm-custom/cu-custom.vue'
 import cuCustom from './components/cm-custom/cu-custom.vue'
 import cmCustom from './components/cm-custom/cm-custom.vue'
 import cmCustom from './components/cm-custom/cm-custom.vue'
+import customCeller from './components/cm-custom/custom-seller.vue'
 Vue.component('cu-custom',cuCustom)
 Vue.component('cu-custom',cuCustom)
 Vue.component('cm-custom',cmCustom)
 Vue.component('cm-custom',cmCustom)
+Vue.component('custom-seller',customCeller)
 
 
 Vue.prototype.$getStorage = function(key){
 Vue.prototype.$getStorage = function(key){
 	var userParam = uni.getStorageSync(key);
 	var userParam = uni.getStorageSync(key);

+ 19 - 4
pages/authorization/authorization.vue

@@ -70,11 +70,26 @@
 				authorize.getCode('weixin').then(wechatcode =>{
 				authorize.getCode('weixin').then(wechatcode =>{
 					wx.getUserInfo({
 					wx.getUserInfo({
 						success: res => {
 						success: res => {
+							console.log(self.authorizeType)
 							wxLogin.wxLoginAuthorize()
 							wxLogin.wxLoginAuthorize()
-							
-							setTimeout(()=>{
-								uni.navigateBack({delta: 1});
-							},2000)
+							switch(self.authorizeType){
+								case '0':
+									self.$api.switchTabTo('/pages/tabBar/home/home')
+									break;
+								case '1':
+									self.$api.navigateTo('/pages/login/login')
+									break;
+								case '2':
+									self.$api.navigateTo('/pages/login/register')
+									break;
+								case '3':
+									self.$api.navigateTo('/pages/login/logincode')
+									break;
+								default:
+									setTimeout(()=>{
+										uni.navigateBack({delta: 1});
+									},2000)
+							}
 						}
 						}
 					})
 					})
 				})
 				})

+ 8 - 5
pages/goods/cart.vue

@@ -219,13 +219,17 @@
 				}, 500)
 				}, 500)
 			},
 			},
 			initGetCartGoodsList(){//初始化购物车 index:1
 			initGetCartGoodsList(){//初始化购物车 index:1
-				let params = {userID:this.userID,pageNum:1,pageSize:this.pageSize}
+				let params = {userID:this.userID}
 				queryShoppingCartList(params).then(response =>{
 				queryShoppingCartList(params).then(response =>{
 					this.skeletonShow = false
 					this.skeletonShow = false
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					const responseData = response.data
 					const responseData = response.data
-					if(responseData.pageDate.length > 0 ){
+					if(responseData.pageDate.length > 0 && responseData.failureList.length > 0){
 						this.isEmpty =false
 						this.isEmpty =false
+					}else{
+						this.isEmpty =true
+					}
+					if(responseData.pageDate && responseData.pageDate.length > 0 ){
 						this.goodsList = responseData.pageDate;
 						this.goodsList = responseData.pageDate;
 						this.goodsList.forEach((item,index) => {
 						this.goodsList.forEach((item,index) => {
 							let productsListLength = item.productsList.length,
 							let productsListLength = item.productsList.length,
@@ -237,10 +241,9 @@
 							item.isDisabled = invalidLength === productsListLength;
 							item.isDisabled = invalidLength === productsListLength;
 						})
 						})
 					} else {
 					} else {
-						this.isEmpty =true
 						this.goodsList = [];
 						this.goodsList = [];
 					}
 					}
-					if( responseData.failureList.length > 0){
+					if( responseData.failureList && responseData.failureList.length > 0){
 						let newFailureList = [],isFailureLayer;
 						let newFailureList = [],isFailureLayer;
 						responseData.failureList.forEach((failure,index) => {
 						responseData.failureList.forEach((failure,index) => {
 							if(failure.failureState == 1 || failure.failureState == 2) {
 							if(failure.failureState == 1 || failure.failureState == 2) {
@@ -442,7 +445,7 @@
 			},
 			},
 			changeCountSub(item,pros){//商品数量减减
 			changeCountSub(item,pros){//商品数量减减
 				if(pros.productCount<=pros.minBuyNumber){
 				if(pros.productCount<=pros.minBuyNumber){
-					pros.productCount= pros.minBuyNumber
+					pros.productCount = pros.minBuyNumber
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					return
 					return
 				}else{
 				}else{

+ 3 - 3
pages/goods/product.vue

@@ -362,7 +362,7 @@
 							this.$api.navigateTo('/pages/login/login?type=1')
 							this.$api.navigateTo('/pages/login/login?type=1')
 						}
 						}
 					}else{
 					}else{
-						this.$api.navigateTo('/pages/authorization/authorization')
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
 					}
 					}
 				})	
 				})	
 			},
 			},
@@ -375,7 +375,7 @@
 							this.$api.navigateTo('/pages/login/login?type=1')
 							this.$api.navigateTo('/pages/login/login?type=1')
 						}
 						}
 					}else{
 					}else{
-						this.$api.navigateTo('/pages/authorization/authorization')
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
 					}	
 					}	
 				})
 				})
 			},	
 			},	
@@ -465,7 +465,7 @@
 					if(wxResponse == 1){
 					if(wxResponse == 1){
 						this.$api.navigateTo(`/pages/login/login?type=detilType&id=${this.productID}`)
 						this.$api.navigateTo(`/pages/login/login?type=detilType&id=${this.productID}`)
 					}else{
 					}else{
-						this.$api.navigateTo('/pages/authorization/authorization')
+						this.$api.navigateTo('/pages/authorization/authorization?type=1')
 					}
 					}
 				})	
 				})	
 			},
 			},

+ 6 - 4
pages/tabBar/cart/cart.vue

@@ -216,8 +216,12 @@
 					this.skeletonShow = false
 					this.skeletonShow = false
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					const responseData = response.data
 					const responseData = response.data
-					if(responseData.pageDate.length > 0 ){
+					if(responseData.pageDate.length > 0 && responseData.failureList.length > 0){
 						this.isEmpty =false
 						this.isEmpty =false
+					}else{
+						this.isEmpty =true
+					}
+					if(responseData.pageDate && responseData.pageDate.length > 0 ){
 						this.goodsList = responseData.pageDate;
 						this.goodsList = responseData.pageDate;
 						this.goodsList.forEach((item,index) => {
 						this.goodsList.forEach((item,index) => {
 							let productsListLength = item.productsList.length,
 							let productsListLength = item.productsList.length,
@@ -229,11 +233,9 @@
 							item.isDisabled = invalidLength === productsListLength;
 							item.isDisabled = invalidLength === productsListLength;
 						})
 						})
 					} else {
 					} else {
-						console.log('2222')
-						this.isEmpty =true
 						this.goodsList = [];
 						this.goodsList = [];
 					}
 					}
-					if( responseData.failureList.length > 0){
+					if( responseData.failureList && responseData.failureList.length > 0){
 						let newFailureList = [],isFailureLayer;
 						let newFailureList = [],isFailureLayer;
 						responseData.failureList.forEach((failure,index) => {
 						responseData.failureList.forEach((failure,index) => {
 							if(failure.failureState == 1 || failure.failureState == 2) {
 							if(failure.failureState == 1 || failure.failureState == 2) {

+ 12 - 6
pages/tabBar/user/user.vue

@@ -17,12 +17,12 @@
 					<view class="header-text">
 					<view class="header-text">
 						<view class="user-item">
 						<view class="user-item">
 							<text class="u-h1" @click="navigator('/pages/login/login')">账号登录</text><text class="u-h1 line">|</text>
 							<text class="u-h1" @click="navigator('/pages/login/login')">账号登录</text><text class="u-h1 line">|</text>
-							<text class="u-h1" @click="navigatorNex('/pages/login/register')">立即注册</text>
+							<text class="u-h1" @click="navigatorNex('/pages/login/register','2')">立即注册</text>
 						</view>
 						</view>
 						<view class="user-item">
 						<view class="user-item">
 							<text class="u-p" @click="navigator('/pages/login/login')">登录商城了解更多产品信息吧!</text>
 							<text class="u-p" @click="navigator('/pages/login/login')">登录商城了解更多产品信息吧!</text>
 						</view>
 						</view>
-						<view class="user-item" @click="navigatorNex('/pages/login/logincode')">
+						<view class="user-item" @click="navigatorNex('/pages/login/logincode','3')">
 							<view class="u-btn"><text>邀请码登录</text><text class="iconfont icon-xiangyouhuabeifen"></text></view>
 							<view class="u-btn"><text>邀请码登录</text><text class="iconfont icon-xiangyouhuabeifen"></text></view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -129,7 +129,7 @@
 				</view>	
 				</view>	
 			</view>
 			</view>
 		</view>	
 		</view>	
-		<upgrade-alert v-if="isUpgradeAlert" :clubStatus="clubStatus" @unBindUpgrade="hanldUnBindUpgrade"></upgrade-alert>
+		<upgrade-alert v-if="isUpgradeAlert" :clubStatus="clubStatus" @unBindUpgrade="hanldUnBindUpgrade" @GoApply="hanldGoApply"></upgrade-alert>
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
@@ -247,6 +247,12 @@
 					this.isUpgradeAlert = false
 					this.isUpgradeAlert = false
 				})
 				})
 			},
 			},
+			hanldGoApply(){
+				cancelPrompt({ userId:this.userID}).then(response =>{
+					this.isUpgradeAlert = false
+					this.$api.navigateTo(`/pages/login/apply?clubStatus=${this.clubStatus}`);
+				})
+			},
 			navigator(url){
 			navigator(url){
 				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
 				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
 					if(wxResponse == 1){
 					if(wxResponse == 1){
@@ -260,17 +266,17 @@
 					}
 					}
 				})	
 				})	
 			},	
 			},	
-			navigatorNex(url){
+			navigatorNex(url,type){
 				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
 				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
 					if(wxResponse == 1){
 					if(wxResponse == 1){
 						if(!this.hasLogin){
 						if(!this.hasLogin){
 							this.$api.navigateTo(url)
 							this.$api.navigateTo(url)
 						}
 						}
 					}else{
 					}else{
-						this.$api.navigateTo('/pages/authorization/authorization?type=1')
+						this.$api.navigateTo(`/pages/authorization/authorization?type=${type}`)
 					}
 					}
 				})	
 				})	
-			},			
+			},		
 			showBadge(n){
 			showBadge(n){
 				let num ='';
 				let num ='';
 				if(n>100){num = 99}else{num = n;}
 				if(n>100){num = 99}else{num = n;}