lilei 1 year ago
parent
commit
b9fb6c4a8c
4 changed files with 72 additions and 43 deletions
  1. 2 2
      App.vue
  2. 10 29
      pages.json
  3. 37 8
      pages/login/login.vue
  4. 23 4
      pages/login/phoneLogin.vue

+ 2 - 2
App.vue

@@ -2,8 +2,8 @@
 	export default {
 		globalData: {
 			// baseUrl: 'http://192.168.0.103:7904/beauty-customer/', // 本地
-			baseUrl: 'https://cust.test.baibaibai.net/beauty-customer/', // 预发布
-			// baseUrl: 'https://cust.baibaibai.net/beauty-customer/' ,// 生产
+			// baseUrl: 'https://cust.test.baibaibai.net/beauty-customer/', // 预发布
+			baseUrl: 'https://cust.baibaibai.net/beauty-customer/' ,// 生产
 			extraData: ''
 		},
 		onLaunch: function() {

+ 10 - 29
pages.json

@@ -3,6 +3,16 @@
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+		    "path" : "pages/report/report",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "诊断报告",
+		        "enablePullDownRefresh": true,
+		        "navigationBarBackgroundColor": "#58c4c4"
+		    }
+		    
+		},
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -48,16 +58,6 @@
                 "enablePullDownRefresh": false
             }
             
-        }
-        ,{
-            "path" : "pages/report/report",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "诊断报告",
-                "enablePullDownRefresh": true,
-                "navigationBarBackgroundColor": "#58c4c4"
-            }
-            
         }
         ,{
             "path" : "pages/checkReport/index",
@@ -83,24 +83,5 @@
 		"navigationBarTitleText": "uni-app",
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8"
-	},
-	"tabBar": {
-		"color": "#7A7E83",
-		"selectedColor": "#191919",
-		"backgroundColor": "#ffffff",
-		"fontSize": "14px",
-		"list": [{
-				"pagePath": "pages/index/index",
-				"iconPath": "static/tab/tab_home_normal.png",
-				"selectedIconPath": "static/tab/tab_home_pressed.png",
-				"text": "会员/套餐"
-			},
-			{
-				"pagePath": "pages/report/report",
-				"iconPath": "static/tab/tab_personal_normal.png",
-				"selectedIconPath": "static/tab/tab_personal_pressed.png",
-				"text": "诊断报告"
-			}
-		]
 	}
 }

+ 37 - 8
pages/login/login.vue

@@ -5,16 +5,25 @@
 				<u-image src="/static/logo-mini.png" width="396" height="76" class="logo"></u-image>
 			</view>
 		    <view class="login-btns">
-				<u-button shape="circle" :custom-style="wxButton" class="login-btn" type="success" :hair-line="false" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
-					微信手机号快捷登录
+				<u-button
+				shape="circle" 
+				:custom-style="wxButton" 
+				class="login-btn" 
+				type="success" 
+				:hair-line="false" 
+				:open-type="tyYd?'getPhoneNumber':''" 
+				@click="getCheckYd"
+				@getphonenumber="getPhoneNumber">
+					手机号快捷登录
 				</u-button>
 				<u-button shape="circle" :custom-style="phoneButton" class="login-btn phoneBtn" @click="phoneLogin" :hoverClass='none'>
 					手机验证码登录
 				</u-button>
 		    </view>
 		</view>
-		<view class="xieyi" @click="gotoXieyi()">
-			登录即代表同意 <text>《用户协议》和《隐私政策》</text>
+		<view class="xieyi" style="display: flex;align-items: center;padding:50upx 0;justify-content: center;font-size: 24rpx;">
+			<u-checkbox v-model="tyYd" shape="circle" style="width:25px;"></u-checkbox>
+			登录代表您已同意<text @click="gotoXieyi()">隐私政策、服务条款</text>
 		</view>
 	</view>
     
@@ -32,7 +41,7 @@
         },
         data() {
             return {
-				path: '/pages/index/index',
+				path: '/pages/report/report',
 				lanuch: false,
 				mobile: '',
 				code: '',
@@ -49,7 +58,8 @@
 				phoneButton:{
 					background: '#f8f8f8',
 					borderColor: '#eeeeee'
-				}
+				},
+				tyYd: false
             }
         },
         computed: mapState(['forcedLogin']),
@@ -74,9 +84,28 @@
 		},
         methods: {
 			...mapMutations(['login']),
+			changeYd(v){
+				this.tyYd = v
+			},
+			getCheckYd(){
+				if(!this.tyYd){
+					uni.showToast({
+						title: "请阅读并同意隐私政策、服务条款",
+						icon: "none"
+					})
+					return
+				}
+			},
 			// 微信授权登录
 			getPhoneNumber(e) {
 				let _this = this
+				if(!this.tyYd){
+					uni.showToast({
+						title: "请阅读并同意隐私政策、服务条款",
+						icon: "none"
+					})
+					return
+				}
 				uni.showLoading({
 					mask: true,
 					title: '加载中'
@@ -99,7 +128,7 @@
 							if (res.status == '200') {
 								this.toMain(res.data)
 								uni.$emit("getUserInfo")
-								if (_this.path === '/pages/index/index' || _this.lanuch) {
+								if (_this.path === '/pages/report/report' || _this.lanuch) {
 									uni.reLaunch({
 										url: _this.path
 									});
@@ -139,7 +168,7 @@
 			toMain(data) {
 			    this.login(data);
 			    uni.reLaunch({
-			        url: '/pages/index/index',
+			        url: '/pages/report/report',
 			    });
 			},
 			// 手机号登录

+ 23 - 4
pages/login/phoneLogin.vue

@@ -20,8 +20,9 @@
 			</u-form>
 		</view>
  
-		<view class="xieyi" @click="gotoXieyi()">
-			登录即代表同意 <text>《用户协议》和《隐私政策》</text>
+		<view class="xieyi" style="display: flex;align-items: center;padding:50upx 0;justify-content: center;font-size: 24rpx;">
+			<u-checkbox v-model="tyYd" shape="circle" style="width:25px;"></u-checkbox>
+			登录代表您已同意<text @click="gotoXieyi()">隐私政策、服务条款</text>
 		</view>
 		<!-- 图文验证码 -->
 		<uni-popup @change="changeModal" ref="imageTxtPopup" type="center">
@@ -69,7 +70,8 @@
 					marginTop: '15px',
 					color: '#ffffff'
 				},
-				isDisabled: false // 倒计时按钮是否禁用
+				isDisabled: false ,// 倒计时按钮是否禁用
+				tyYd: false
 			}
 		},
 		computed: mapState(['forcedLogin']),
@@ -81,6 +83,9 @@
 		},
 		methods: {
 			...mapMutations(['login']),
+			changeYd(v){
+				this.tyYd = v
+			},
 			// 获取验证码
 			getCode() {
 				let sid = null
@@ -104,6 +109,13 @@
 			checkMobile() {
 				if (!this.getCodeing) {
 					if (this.mobile) {
+						if(!this.tyYd){
+							uni.showToast({
+								title: "请阅读并同意隐私政策、服务条款",
+								icon: "none"
+							})
+							return false
+						}
 						if (!isvalidPhone(this.mobile)) {
 							uni.showToast({
 								title: '请输入正确的手机号码',
@@ -174,6 +186,13 @@
 			},
 			// 登录
 			bindLogin() {
+				if(!this.tyYd){
+					uni.showToast({
+						title: "请阅读并同意隐私政策、服务条款",
+						icon: "none"
+					})
+					return
+				}
 				if (this.mobile) {
 					let data = {
 						'mobile': this.mobile,
@@ -202,7 +221,7 @@
 			toMain(data) {
 				this.login(data);
 				uni.reLaunch({
-					url: '/pages/index/index',
+					url: '/pages/report/report',
 				});
 			},
 			// 用户协议