slambb 4 жил өмнө
parent
commit
5b4ceda7e0

+ 5 - 2
common/config.js

@@ -9,10 +9,10 @@ const active = "dev";
 //线上地址,腾讯云服务器
 // const host="https://www.9527fun.cn/api_prd"
 //测试地址,阿里云服务器
-const host="https://www.9527fun.cn/api_dev"
+// const host="https://www.9527fun.cn/api_dev"
 //本地测试地址
 // const host = "http://192.168.1.11:9090/api_dev"
-// const host = "http://192.168.0.112:9090/api_dev"
+const host = "http://192.168.0.112:9090/api_dev"
 // const host = "http://47.104.216.192:9090/api_dev"
 // const host = "http://121.4.103.151:9090/api_prd"
 // const host = "http://121.4.59.141:9090/api_dev"
@@ -24,6 +24,9 @@ const URL = {
 	SMSLOGIN: `${host}/program/SMS_login`,
 	//获取验证码
 	GETCODE: `${host}/program/getCode`,
+	//根据类型获取验证码,0:电话 和1:邮箱 
+	GETCODEACCORDINGTYPE:`${host}/program/getCodeAccordingType`,
+	
 	//短信绑定手机号
 	BINDPHONE: `${host}/program/SMS_bind_phone`,
 	// 解绑手机号

+ 8 - 4
pages.json

@@ -20,7 +20,11 @@
 		// #ifdef APP-PLUS || H5
 		{
 			"path": "pages/Loading-page/Loading/Loading",
-			"style": {}
+			"style": {
+				"app-plus": {
+					"animationType": "none"
+				}
+			}
 		},
 		//app 相关注册页面
 		{
@@ -311,7 +315,7 @@
 								// "width": "100%",
 								// "height": "100%",
 								"background": "transparent",
-								"mask":"rgba(0,0,0,0)"
+								"mask": "rgba(0,0,0,0)"
 							}
 						}]
 					}
@@ -327,8 +331,8 @@
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#F8F8F8",
 		"navigationStyle": "custom",
-		"app-plus":{
-			"bounce":"none"
+		"app-plus": {
+			"bounce": "none"
 		}
 	},
 	"condition": { //模式配置,仅开发期间生效

+ 1 - 1
pages/Loading-page/Loading/Loading.vue

@@ -68,7 +68,7 @@
 			...mapMutations(['accountLogin']),
 			onNavTo(navType) {
 				// uni.hideToast();
-				console.log('navType:',navType);
+				console.log('当前loading 跳转的页面是 navType:',navType);
 				if (navType == "userInfo") {
 					uni.redirectTo({
 						url: "../../my-page/userInfo/userInfo"

+ 206 - 135
pages/login-page/login/login.vue

@@ -6,107 +6,106 @@
 			<!-- 258px  -->
 			<view id="HeadArea" style="height: 25%;"></view>
 			<view id="MidArea">
-				<view class="action-row align-center " style="background-color: rgba(0, 0, 0, 0.2); padding: 29px 104rpx 29px 104rpx;">
-					<!-- <view class="text-white text-22px  text-center" style="width: 100%;" @tap="onSwitchLogin(true)">手机登录</view> -->
-					<view class=" text-white " :class="bMobileLogin?'text-22px':'text-16px'" @tap="onSwitchLogin(true)">手机登录</view>
-					<view class="text-bold text-white">|</view>
-					<view class=" text-white " :class="!bMobileLogin?'text-22px':'text-16px'" @tap="onSwitchLogin(false)">账号登录</view>
+				<view class="action-row align-center position-relative"
+					style="background-color: rgba(146, 146, 255, 0.15); padding: 29px 104rpx 29px 104rpx;">
+					<view class="text-white " :class="bMobileLogin?'text-22px':'text-16px'" @tap="onSwitchLogin(true)">
+						手机登录</view>
+					<view class="text-white " :class="!bMobileLogin?'text-22px':'text-16px'"
+						@tap="onSwitchLogin(false)">邮箱登录</view>
+					<view class="position-absolute-center"
+						style="height: 29px ;width: 1px; background-color: rgba(255, 255, 255, 0.25);"></view>
 				</view>
-				<view v-if="bMobileLogin">
-					<!-- 手机端登录,获取验证码 -->
-					<view v-if="bGetCode">
-						<view class="input-container" style="margin: 32px 102rpx 0 68rpx;">
-							<view class="input-row padding" style="width: 318px;">
-								<m-input type="number" maxlength="11" clearable v-model="account" placeholder="请填写11位手机号码"></m-input>
+				<!-- bMobileLogin -->
+				<view v-if="bPhoneNumberAndPasswordLogin">
+					<view class="input-container" style="margin: 10px 102rpx 0 68rpx;">
+						<view class="input-row padding  align-center" style="width: 318px;">
+							<view class="text-18px text-regular " style="width: 72rpx;">
+								{{bMobileLogin?' +86':'邮箱'}}
 							</view>
-						</view>
-						<view class="btn-row" style="margin: 32px 0 0 0;">
-							<view class="btn-confirm" @tap="onNavToReg">获取验证码</view>
-						</view>
-						<!-- <view v-if="appleOauth" class="btn-row" style="margin: 5px 0 0 0;">
-							<view class="btn-apple-confirm" @tap="onAppleReg">
-								<image style="width: 48rpx;height: 48rpx;margin-right: 5px;" src="../../../static/img/apple.png"></image>
-								<view>通过Apple注册</view>
+							<view class="margin-left-sm margin-right-sm"
+								style="width: 2rpx; height: 25rpx; background-color: rgba(209, 209, 209, 1);">
 							</view>
-						</view> -->
-					</view>
-					<view v-else>
-						<!-- 手机端登录 -->
-						<view class="text-22px make-text-bPurple" style="margin: 34px 0 0 96rpx;">输入验证码</view>
-						<view class="text-16px text-gray" style="margin: 20px 0 0 96rpx;">已发送4位验证码至 +86 {{phoneNumber}}</view>
-
-						<view class="code-input-main">
-							<view class="inputLine">
-								<!-- <view class="input-item" maxlength="1" :value="inputCode[0]">{{inputCode[0]}}</input> -->
-								<view class="input-item">{{inputCode[0]}}</view>
-								<view class="input-item">{{inputCode[1]}}</view>
-								<view class="input-item">{{inputCode[2]}}</view>
-								<view class="input-item">{{inputCode[3]}}</view>
-							</view>
-							<!-- @input="inputEvent" -->
-							<input class="code-input-input" v-model="inputCode" maxlength="4" type="number" />
+							<m-input type="number" clearable v-model="account"
+								:placeholder="bMobileLogin?'请填写11位手机号码':'请输入邮箱'"></m-input>
 						</view>
 
-						<view class="btn-row">
-							<!--  :disabled="inputCode.length<4" -->
-							<view class="btn-confirm " :class="inputCode.length<4?'disabledBtn':''" @tap="onConfirm">确认</view>
+					</view>
+					<view class="input-container" style="margin: 8px 102rpx 0 68rpx;">
+						<view class="input-row padding align-center" style="width: 318px;">
+							<view class="text-18px text-regular " style="width: 72rpx;">
+								密码
+							</view>
+							<view class="margin-left-sm margin-right-sm"
+								style="width: 2rpx; height: 25rpx; background-color: rgba(209, 209, 209, 1);">
+							</view>
+							<m-input type="password" maxlength="14" displayable v-model="password" placeholder="请输入密码">
+							</m-input>
 						</view>
 
+					</view>
 
-						<view v-if="bCodeDisabled" class="action-row-text">
-							<view class="action-child text-gray">重新获取({{count}})</view>
-							<!-- <text style="color: #FFFFFF;">|</text>
-						<navigator url="../pwd/pwd">忘记密码</navigator> -->
-						</view>
-						<view v-else class="action-row-text">
-							<view class="action-child text-gray" @tap="onGetCode">重新发送验证码</view>
-							<!-- <text style="color: #FFFFFF;">|</text>
-						<navigator url="../pwd/pwd">忘记密码</navigator> -->
+					<view class="btn-row" style="margin: 20px 0 0 0;">
+						<view class="btn-confirm" @tap="bindLogin">登录</view>
+					</view>
+				</view>
+				<!-- 手机端登录或者邮箱,获取验证码 -->
+				<view v-else-if="bGetCode">
+					<view class="input-container" style="margin: 32px 102rpx 0 68rpx;">
+						<view class="input-row padding align-center" style="width: 318px;">
+							<view class="text-18px text-regular " style="width: 72rpx;">
+								{{bMobileLogin?' +86':'邮箱'}}
+							</view>
+							<view class="margin-left-sm margin-right-sm"
+								style="width: 2rpx; height: 25rpx; background-color: rgba(209, 209, 209, 1);">
+							</view>
+							<m-input :type="bMobileLogin?'number':'string'" :maxlength="bMobileLogin?'11':'20'" clearable v-model="account"
+								:placeholder="bMobileLogin?'请填写11位手机号码':'请输入邮箱'"></m-input>
 						</view>
-
-
-						<input class='ipt' type="number" :maxlength="Length" :focus="bFocus" @input="onInputFocus" @focus="onFocus"></input>
-
-
 					</view>
-
-
+					<view class="btn-row" style="margin: 32px 0 0 0;">
+						<view class="btn-confirm" @tap="onNavToReg">获取验证码</view>
+					</view>
 				</view>
 				<view v-else>
-					<!-- 密码登录 -->
-					<!-- <view class="text-26px text-white" style="margin: 116px 0 0 58rpx;">密码登录</view>
-					<view class="text-16px text-white" style="margin: 32px 0 0 58rpx;">记录你的运动轨迹,呵护你的身体健康</view> -->
-					<view class="input-container" style="margin: 10px 102rpx 0 68rpx;">
-						<view class="input-row padding" style="width: 318px;">
-							<m-input type="number" clearable v-model="account" placeholder="输入手机号码"></m-input>
-						</view>
-
+					<!-- 手机端登录 -->
+					<view class="text-22px make-text-bPurple" style="margin: 34px 0 0 96rpx;">输入验证码</view>
+					<view v-if="bMobileLogin" class="text-16px text-gray" style="margin: 20px 0 0 96rpx;">已发送4位验证码至 +86
+						{{phoneNumber}}
 					</view>
-					<view class="input-container" style="margin: 8px 102rpx 0 68rpx;">
-						<view class="input-row padding" style="width: 318px;">
-							<m-input type="password" maxlength="14" displayable v-model="password" placeholder="请输入密码"></m-input>
+					<view v-else class="text-16px text-gray" style="margin: 20px 0 0 96rpx;">已发送4位验证码至 {{mailboxNumber}}
+						邮箱</view>
+
+					<view class="code-input-main">
+						<view class="inputLine">
+							<!-- <view class="input-item" maxlength="1" :value="inputCode[0]">{{inputCode[0]}}</input> -->
+							<view class="input-item">{{inputCode[0]}}</view>
+							<view class="input-item">{{inputCode[1]}}</view>
+							<view class="input-item">{{inputCode[2]}}</view>
+							<view class="input-item">{{inputCode[3]}}</view>
 						</view>
-
+						<!-- @input="inputEvent" -->
+						<input class="code-input-input" v-model="inputCode" maxlength="4" type="number" />
 					</view>
 
-					<!-- border: 1rpx solid #007AFF; -->
-					<view class="btn-row" style="margin: 20px 0 0 0;">
-						<view class="btn-confirm" @tap="bindLogin">登录</view>
+					<view class="btn-row">
+						<!--  :disabled="inputCode.length<4" -->
+						<view class="btn-confirm " :class="inputCode.length<4?'disabledBtn':''" @tap="onConfirm">确认
+						</view>
 					</view>
-					<!-- 	<view class="action-row " style="margin: 29px 58rpx 0 58rpx;">
-						<view class="text-14px text-gray">
-							<text class="cuIcon-roundcheck "></text>
-							我已阅读并同意使用<span style="color: rgba(151, 151, 255, 1);">服务协议</span></view>
-						<view class="text-14px" style="color: rgba(151, 151, 255, 1);">忘记密码?</view>
-					</view> -->
-
-
+					<view v-if="bCodeDisabled" class="action-row-text">
+						<view class="action-child text-gray">重新获取({{count}})</view>
+					</view>
+					<view v-else class="action-row-text">
+						<view class="action-child text-gray" @tap="onGetCode">重新发送验证码</view>
+					</view>
+					<input class='ipt' type="number" :maxlength="Length" :focus="bFocus" @input="onInputFocus"
+						@focus="onFocus"></input>
 				</view>
 
 			</view>
 
 			<!-- v-if="hasProvider" style="border: 1rpx solid #000000;"-->
-			<view class="oauth-row" v-if="bGetCode" v-bind:style="{top: positionTop + 'px'}" >
+			<view class="oauth-row" v-if="bGetCode" v-bind:style="{top: positionTop + 'px'}">
 				<view v-if="hasProvider&&providerList.length>0">
 					<view v-if="(bInstallWechat&&!bHideWeixin)||appleOauth" class="text-14px text-gray">其他登录方式</view>
 					<!-- <view v-else style="height: 50px;"></view> -->
@@ -114,24 +113,33 @@
 						<!-- 	<view class="oauth-image" v-for="provider in providerList" :key="provider.value">
 							<image :src="provider.image" @tap="oauth(provider.value)"></image>
 						</view> -->
-						<view v-if="bInstallWechat&&!bHideWeixin" v-for="provider in providerList" :key="provider.value">
+						<view v-if="bInstallWechat&&!bHideWeixin" v-for="provider in providerList"
+							:key="provider.value">
 							<view class="btn-apple-confirm" @tap="oauth(provider.value)">
-								<image style="width: 48rpx;height: 48rpx;margin-right: 5px;" :src="provider.image"></image>
+								<image style="width: 48rpx;height: 48rpx;margin-right: 5px;" :src="provider.image">
+								</image>
 								<view>通过微信注册</view>
 							</view>
 						</view>
 						<view v-if="appleOauth" class="btn-apple-confirm" @tap="onAppleReg">
-							<image style="width: 48rpx;height: 48rpx;margin-right: 5px;" src="../../../static/img/apple.png"></image>
+							<image style="width: 48rpx;height: 48rpx;margin-right: 5px;"
+								src="../../../static/img/apple.png"></image>
 							<view>通过Apple注册</view>
 						</view>
 					</view>
 				</view>
 
-				<view class="action-row-text">
-					<view class=" ">登录即代表同意哔蹦</view>
-					<view class="text-bold text-decoration" @tap="onSwitchAgree('agreement')">用户协议</view>
-					<view class=" ">和</view>
-					<view class="text-bold text-decoration" @tap="onSwitchAgree('privacy')">隐私政策</view>
+				<view class="">
+					<view class="action-row-text" style="margin-top: 0;">
+						<view class="text-gray">登录即代表同意哔蹦</view>
+						<view class="text-bold text-decoration make-text-bPurple" @tap="onSwitchAgree('agreement')">用户协议
+						</view>
+						<view class=" ">和</view>
+						<view class="text-bold text-decoration make-text-bPurple" @tap="onSwitchAgree('privacy')">隐私政策
+						</view>
+					</view>
+					<view @click="onSwitchGetCode" class="make-text-bPurple text-right text-bold"
+						style="margin: 20rpx 120rpx 0 0;">{{bPhoneNumberAndPasswordLogin?'验证码登录':'密码登录'}} </view>
 				</view>
 			</view>
 
@@ -161,6 +169,8 @@
 			return {
 				//获取验证码页面
 				bGetCode: true,
+				//默认手机号和密码登录
+				bPhoneNumberAndPasswordLogin: true,
 				bMobileLogin: true,
 				providerList: [],
 				hasProvider: true,
@@ -177,8 +187,9 @@
 				appleOauth: null,
 			}
 		},
-		computed: mapState(['bNewUser', 'forcedLogin', 'phoneNumber', 'bCodeDisabled', 'count', 'bInstallWechat',
-			'bHideWeixin','clientName'
+		computed: mapState(['bNewUser', 'forcedLogin', 'phoneNumber', 'mailboxNumber', 'bCodeDisabled', 'count',
+			'bInstallWechat',
+			'bHideWeixin', 'clientName'
 		]),
 		methods: {
 			...mapMutations(['login', 'addUserAvatarAndLogin', 'appleUserInfoLogin', 'accountLogin', 'countDown',
@@ -216,9 +227,9 @@
 				}, data => {
 					// console.log("得到节点信息1" + JSON.stringify(data));
 					let headHeight = data.height;
-					if(_self.clientName.indexOf('iPad')>-1){
+					if (_self.clientName.indexOf('iPad') > -1) {
 						_self.positionTop = headHeight + 390;
-					}else{
+					} else {
 						_self.positionTop = headHeight + 280;
 					}
 					// let midView = uni.createSelectorQuery().in(this).select('#MidArea');
@@ -352,8 +363,10 @@
 										key: 'token',
 										data: resData.data.token,
 										success: function() {
-											_self.$store.state.bNewUser = resData.data.newUser;
-											console.log("wx token = ", resData.data.token);
+											_self.$store.state.bNewUser = resData.data
+												.newUser;
+											console.log("wx token = ", resData.data
+												.token);
 											//如果是新用户,则获取用户信息
 											if (_self.bNewUser) {
 												uni.getUserInfo({
@@ -361,42 +374,67 @@
 													success: (infoRes) => {
 														//获取了用户信息后
 														let userInfo = {
-															username: infoRes.userInfo.nickName,
+															username: infoRes
+																.userInfo
+																.nickName,
 															gender: 0 //默认是男性
 														}
 														//服务器0是男,1是女
 														//微信的2 对应的女
-														if (infoRes.userInfo.gender == 2) {
+														if (infoRes
+															.userInfo
+															.gender == 2) {
 															//服务器记录的是1
-															userInfo.gender = 1;
+															userInfo
+																.gender =
+																1;
 														}
-														console.log("微信数据:", infoRes, userInfo);
+														console.log(
+															"微信数据:",
+															infoRes,
+															userInfo);
 
 														uni.downloadFile({
-															url: infoRes.userInfo.avatarUrl,
-															success: (res) => {
+															url: infoRes
+																.userInfo
+																.avatarUrl,
+															success: (
+																res
+															) => {
 																// if (res.statusCode === 200) {
 																// 	console.log('下载成功');
 																// }
 																// console.log(res.tempFilePath);
-																_self.addUserAvatarAndLogin({
-																	params: userInfo,
-																	filePath: res.tempFilePath,
-																	callback: () => {
-																		_self.$store.state.openid = infoRes.userInfo.openId || '';
-																		uni.hideToast();
-
-																		uni.reLaunch({
-																			url: "../../my-page/perfectInfo/perfectInfo"
-																		})
-																	}
-																});
+																_self
+																	.addUserAvatarAndLogin({
+																		params: userInfo,
+																		filePath: res
+																			.tempFilePath,
+																		callback: () => {
+																			_self
+																				.$store
+																				.state
+																				.openid =
+																				infoRes
+																				.userInfo
+																				.openId ||
+																				'';
+																			uni
+																				.hideToast();
+
+																			uni.reLaunch({
+																				url: "../../my-page/perfectInfo/perfectInfo"
+																			})
+																		}
+																	});
 															}
 														});
 													},
 													fail: (failRes) => {
 														uni.hideToast();
-														console.log('getUserInfo failRes:', failRes);
+														console.log(
+															'getUserInfo failRes:',
+															failRes);
 													}
 												})
 											} else {
@@ -448,13 +486,16 @@
 											url: config.URL.WXGETUSERINFO,
 											data: {
 												appid: 'wxd6dfd60729d33d17',
-												encryptedData: infoRes.encryptedData,
+												encryptedData: infoRes
+													.encryptedData,
 												iv: infoRes.iv,
 												signature: infoRes.signature,
 												rawData: infoRes.rawData
 											},
 											success: (wxInfoRes) => {
-												console.log('WXGETUSERINFO 请求返回:', wxInfoRes);
+												console.log(
+													'WXGETUSERINFO 请求返回:',
+													wxInfoRes);
 											}
 
 										})
@@ -478,24 +519,29 @@
 				console.log('callbackUserInfo:', userinfo);
 			},
 			onSwitchLogin(bMobileLogin) {
-				// console.log(bMobileLogin);
 				this.bMobileLogin = bMobileLogin;
 				//如果是已获取的验证码页面,返回获取验证码界面
 				if (this.bGetCode == false)
 					this.bGetCode = true;
-				// this.bMobileLogin = !this.bMobileLogin;
+			},
+			onSwitchGetCode() {
+				this.bPhoneNumberAndPasswordLogin = !this.bPhoneNumberAndPasswordLogin;
 			},
 			onNavToReg() {
-				if (!verify.checkPhone(this.account)) {
-					uni.showToast({
-						icon: 'none',
-						title: '输入手机号错误'
-					});
-					return;
+				if(this.bMobileLogin){
+					if (!verify.checkPhone(this.account)) {
+						uni.showToast({
+							icon: 'none',
+							title: '输入手机号错误'
+						});
+						return;
+					}
+					this.$store.state.phoneNumber = this.account;
+				}else{
+					//todo 后面要验证邮箱
+					
+					this.$store.state.mailboxNumber = this.account;
 				}
-				// console.log("手机号正确:",this.account);
-				// return;
-				this.$store.state.phoneNumber = this.account;
 				this.bGetCode = false;
 				this.onGetCode();
 			},
@@ -576,10 +622,19 @@
 			onGetCode() {
 				//置灰状态
 				if (this.bCodeDisabled) return;
-
-
 				//调用store 倒计时
-				this.countDown(this.phoneNumber);
+				if (this.bMobileLogin) {
+					this.countDown({
+						count: this.phoneNumber,
+						type: 0
+					});
+				} else {
+					this.countDown({
+						count: this.mailboxNumber,
+						type: 1
+					});
+				}
+
 
 			},
 			onTap() {
@@ -645,15 +700,23 @@
 												key: 'token',
 												data: res.data.token,
 												success: function() {
-													_self.$store.state.bNewUser = res.data.newUser;
+													_self.$store.state.bNewUser = res
+														.data.newUser;
 													// console.log("apple token = ", res.data.token);
 													//如果是新用户,则获取用户信息
 													if (_self.bNewUser) {
 														//获取了用户信息后
 														let tempName = "匿名";
-														if (resUser.userInfo.fullName.hasOwnProperty("familyName") &&
-															resUser.userInfo.fullName.hasOwnProperty("givenName")) {
-															tempName = resUser.userInfo.fullName.familyName + resUser.userInfo.fullName.givenName;
+														if (resUser.userInfo.fullName
+															.hasOwnProperty(
+																"familyName") &&
+															resUser.userInfo.fullName
+															.hasOwnProperty(
+																"givenName")) {
+															tempName = resUser.userInfo
+																.fullName.familyName +
+																resUser.userInfo
+																.fullName.givenName;
 														}
 														let userInfo = {
 															username: tempName,
@@ -665,8 +728,16 @@
 															params: userInfo,
 															callback: () => {
 																//这里是记录appleid,不是微信
-																_self.$store.state.appleid = resUser.userInfo.openId || '';
-																uni.hideToast();
+																_self
+																	.$store
+																	.state
+																	.appleid =
+																	resUser
+																	.userInfo
+																	.openId ||
+																	'';
+																uni
+																	.hideToast();
 
 																uni.reLaunch({
 																	url: "../../my-page/perfectInfo/perfectInfo"
@@ -769,7 +840,7 @@
 	}
 
 	.action-row-text {
-		margin-top: 25px;
+		margin-top: 18px;
 		display: flex;
 		flex-direction: row;
 		justify-content: center;

+ 6 - 6
pages/my-page/perfectInfo/perfectInfo.vue

@@ -44,36 +44,36 @@
 			</view>
 		</view>
 
-		<view class="flex justify-between perf-bottom-container">
+		<view class="flex justify-between perf-bottom-container" @tap="showModal" data-target="showPickerModal" data-type="birthday">
 			<view class="flex justify-center align-center">
 				<!-- <image style="width: 10px;height: 10px; margin-left: 38rpx;" src="/static/asterisk.png"></image> -->
 				<view class="text-grey padding-sm margin-name text-width flex">生日</view>
 				<view class="text-bold">{{sBirthday}} </view>
 			</view>
-			<view class="right-container" @tap="showModal" data-target="showPickerModal" data-type="birthday">
+			<view class="right-container" >
 				<text class="text-grey text-sm" style="margin: 0 24rpx;">请选择</text>
 				<view class="only-arrow"></view>
 			</view>
 		</view>
 
-		<view class="flex justify-between perf-bottom-container">
+		<view class="flex justify-between perf-bottom-container" @tap="showModal" data-target="showPickerModal" data-type="height">
 			<view class="flex justify-center align-center">
 				<!-- <image style="width: 10px;height: 10px; margin-left: 38rpx;" src="/static/asterisk.png"></image> -->
 				<view class="text-grey padding-sm margin-name text-width flex">身高</view>
 				<view class="text-bold">{{height}}cm </view>
 			</view>
-			<view class="right-container" @tap="showModal" data-target="showPickerModal" data-type="height">
+			<view class="right-container" >
 				<text class="text-grey text-sm" style="margin: 0 24rpx;">请选择</text>
 				<view class="only-arrow"></view>
 			</view>
 		</view>
-		<view class="flex justify-between perf-bottom-container">
+		<view class="flex justify-between perf-bottom-container" @tap="showModal" data-target="showPickerModal" data-type="weight">
 			<view class="flex justify-center align-center">
 				<!-- <image style="width: 10px;height: 10px; margin-left: 38rpx;" src="/static/asterisk.png"></image> -->
 				<view class="text-grey padding-sm margin-name text-width flex">体重</view>
 				<view class="text-bold">{{weight}}kg </view>
 			</view>
-			<view class="right-container" @tap="showModal" data-target="showPickerModal" data-type="weight">
+			<view class="right-container" >
 				<text class="text-grey text-sm" style="margin: 0 24rpx;">请选择</text>
 				<view class="only-arrow"></view>
 			</view>

+ 12 - 7
pages/personal-page/devices-hardware/devices-hardware.vue

@@ -16,10 +16,10 @@
 		<view class="card-view padding-top padding-bottom" v-for="(item,index) in devicesList" :key="index" :class="item.bRatio?'hardware-border':''">
 			<view class="flex justify-between align-center">
 				<view class="flex justify-start align-center">
-					<image style="margin-left: 30rpx; width: 200rpx;height: 120rpx;" :src="item.icon" mode="aspectFit"></image>
-					<view>
-						<view style="margin: 20rpx 50rpx; font-weight: bold; font-size: 18px; color: #565656;">{{item.cname}}</view>
-						<view style="margin-left: 50rpx; font-size: 12px;" class="make-text-bPurple">{{item.describe}}</view>
+					<image style="margin-left: 20rpx; width: 200rpx;height: 120rpx;" :src="item.icon" mode="aspectFit"></image>
+					<view style="width: 350rpx;margin-left: 10rpx;">
+						<view style="margin: 20rpx 0rpx; font-weight: bold; font-size: 18px; color: #565656;">{{item.cname}}</view>
+						<view style="font-size: 12px; white-space:pre-wrap;" class="make-text-bPurple">{{item.describe}}</view>
 					</view>
 
 				</view>
@@ -28,7 +28,11 @@
 			</view>
 		</view>
 		<!-- <button @click="onGetDevice()"> onGetDevice</button> -->
-
+		<!-- <view class="margin">
+			<view class="make-text-bPurple text-14px">** 匹配步骤 **</view>
+			<view class="make-text-bPurple text-14px">1.长按游戏手柄直到蓝灯正常闪烁</view>
+			<view class="make-text-bPurple text-14px">2.蓝灯正常闪烁后,选择下面模式匹配手柄</view>
+		</view> -->
 	</view>
 
 
@@ -95,7 +99,8 @@
 			// 	})
 			// }
 			this.BLEInfoList.forEach((item, index, selfarr) => {
-				if (item.deviceType == 'BLEHandle' || item.deviceType == 'BLERope') {
+				//item.deviceType == 'BLEHandle' || 
+				if (item.deviceType == 'BLERope') {
 					let item = Object.assign({}, selfarr[index]);
 					this.devicesList.push(item);
 				}
@@ -734,7 +739,7 @@
 				//需要连接设备后,才能进入升级
 				if (!this.currentItem || !this.currentItem.bRatio || !this.BLEConnectDevice) {
 					uni.showToast({
-						title: '选择一个连接后进入',
+						title: '请先连接硬件!',
 						icon: 'none'
 					})
 					return;

+ 172 - 69
pages/personal-page/devices-update/devices-update.vue

@@ -1,7 +1,8 @@
 <!-- 蓝牙平台限制 todo https://uniapp.dcloud.io/api/system/bluetooth?id=stopbluetoothdevicesdiscovery -->
 <template>
 	<view>
-		<uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" title="设备升级" color="#000000" fixed="true" :border="false">
+		<uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onTipBack()" title="设备升级" color="#000000" fixed="true"
+			:border="false">
 			<view slot="left">
 				<view class=" flex align-center margin-left">
 					<image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
@@ -10,14 +11,18 @@
 
 		</uni-nav-bar>
 
-		<view class="card-view padding-top padding-bottom" v-for="(item,index) in devicesList" :key="index" :class="item.bRatio?'hardware-border':''">
+		<view class="card-view padding-top padding-bottom" v-for="(item,index) in devicesList" :key="index"
+			:class="item.bRatio?'hardware-border':''">
 			<view class="flex justify-between align-center">
 
-				<image style="margin-left: 30rpx; width: 200rpx;height: 120rpx;" :src="item.icon" mode="aspectFit"></image>
+				<image style="margin-left: 30rpx; width: 200rpx;height: 120rpx;" :src="item.icon" mode="aspectFit">
+				</image>
 				<view style="width: 250rpx;">
-					<view style="font-weight: bold; font-size: 18px; color: #565656; margin: 20rpx 0;">{{item.cname}}</view>
+					<view style="font-weight: bold; font-size: 18px; color: #565656; margin: 20rpx 0;">{{item.cname}}
+					</view>
 					<view v-if="send_index<=0&&item.currentVersion !== ''">
-						<view style="margin: 20rpx 0; font-size: 12px; color: grey;">固件版本号:{{item.currentVersion}}</view>
+						<view style="margin: 20rpx 0; font-size: 12px; color: grey;">固件版本号:{{item.currentVersion}}
+						</view>
 						<!-- <view style="margin: 20rpx; font-size: 12px;" class="make-text-bPurple">更新版本号:{{item.latestVersion}}</view> -->
 					</view>
 					<!-- <view class="flex">
@@ -43,17 +48,18 @@
 
 				</view>
 
-				<view v-if = "!bStart" style="width: 180rpx;margin-right: 30rpx;">
+				<view v-if="!bStart" style="width: 180rpx;margin-right: 30rpx;">
 					<view v-if="send_index<=0&&item.latestVersion !== ''">
-						<view v-if="bCanUpdate&&downLoadOTA!==''" class="text-11px make-text-bPurple " style="text-decoration:underline"
-						 @click="onSendConnect"> 请更新版本{{item.latestVersion}}
+						<view v-if="bCanUpdate&&downLoadOTA!==''" class="text-11px make-text-bPurple "
+							style="text-decoration:underline" @click="onSendConnect"> 请更新版本{{item.latestVersion}}
 						</view>
 						<view v-else class="text-11px text-grey">最新版本{{item.latestVersion}}</view>
 						<!-- <button v-else class="text-11px make-bg-bPurple text-white" @click="onCheckDeviceFiles">检查更新</button> -->
 						<!-- <button v-if="item.currentVersion !== ''" class="text-11px margin" @click="onSendConnect">开始</button> -->
 						<!-- <button v-if="item.currentVersion !== ''" class="text-11px margin" @click="onStop">停止</button> -->
 					</view>
-					<view v-if="send_index<=0&&item.latestVersion === ''" class="text-26px text-grey text-center"><text class="cuIcon-loading2 cuIconfont-spin"></text></view>
+					<view v-if="send_index<=0&&item.latestVersion === ''" class="text-26px text-grey text-center"><text
+							class="cuIcon-loading2 cuIconfont-spin"></text></view>
 				</view>
 				<view v-else style="width: 180rpx;margin-right: 30rpx;">
 					<view v-if="send_index<=0&&!sending_file" class="text-11px text-grey">{{writeTip}}</view>
@@ -153,10 +159,10 @@
 				writeHeadTimeout: null,
 				backTimeout: null,
 				sendFileHeaderTimeout: null,
-				
-				writeTip:'准备写入数据..',
-				
-				bBacking:false,
+
+				writeTip: '准备写入数据..',
+
+				bBacking: false,
 			}
 		},
 		onLoad(option) {
@@ -180,7 +186,7 @@
 							this.onCheckServerFiles();
 
 							this.onCheckDeviceFiles();
-							
+
 							uni.showToast({
 								title: '获取信息...',
 								icon: 'loading',
@@ -215,29 +221,71 @@
 				clearTimeout(this.sendFileHeaderTimeout);
 				this.sendFileHeaderTimeout = null;
 			}
-			
+
 			this.onBack();
+
+			uni.$off("OTAValueChange", this.onOTAValueChange);
 		},
 		onShow() {
-			
+
+		},
+		onHide() {
+
 		},
-		onHide() {},
 		methods: {
 			...mapMutations(['initAdapter', 'onCloseBLEConnection',
-				'onGetRSSITransDistance'
+				'onGetRSSITransDistance', 'B_NotifyBLECharacteristicValueChange'
 			]),
 			updateCallbackCloseBLE() {
-				this.onBack();
+				this.onBack(true);
 			},
-			onBack() {
+			onTipBack() {
+				if (this.send_index != 0) {
+					uni.showModal({
+						title: '提示',
+						content: '退出会停止更新,是否退出。',
+						confirmText: '是',
+						cancelText: '否',
+						success: (res) => {
+							if (res.confirm) {
+								this.onBack();
+							}
+						}
+					})
+				} else {
+					this.onBack();
+				}
+			},
+			onBack(isReset) {
 				// if(this.bStart){
 
 				// }
-				if(this.bBacking)return;
+				if (this.bBacking) return;
 				this.bBacking = true;
 				//停止发送数据
 				this.onStop();
-				console.log('onBack:',this.BLEConnectDevice);
+				console.log('onBack:', this.BLEConnectDevice);
+				//关闭当前的蓝牙连接
+				// this.onCloseBLEConnection({
+				// 	getSuccess: () => {
+				// 		console.log("close ble");
+				// 		this.$store.state.bConnection = false;
+				// 	}
+				// });
+				// this.$store.state.cIndex = -1;
+				// this.$store.state.BLEConnectDevice = null;
+				// this.$store.state.BLEGetServices = null;
+				// this.$store.state.bOpenBluetooth = false;
+				if (isReset) {
+					this.onBackClose();
+				}
+
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			onBackClose() {
+				console.log('onBackClose');
 				//关闭当前的蓝牙连接
 				this.onCloseBLEConnection({
 					getSuccess: () => {
@@ -245,16 +293,11 @@
 						this.$store.state.bConnection = false;
 					}
 				});
-				console.log('onBack');
-				
+
 				this.$store.state.cIndex = -1;
 				this.$store.state.BLEConnectDevice = null;
 				this.$store.state.BLEGetServices = null;
 				this.$store.state.bOpenBluetooth = false;
-
-				uni.navigateBack({
-					delta: 1
-				})
 			},
 
 			//获取版本
@@ -284,7 +327,7 @@
 								title: '请求硬件更新数据...',
 								icon: 'none',
 								duration: 3000,
-								mask:true
+								mask: true
 							})
 							//发送头指令timeout
 							if (this.sendFileHeaderTimeout) {
@@ -308,7 +351,7 @@
 			//启用低功耗蓝牙设备特征值变化时的 notify 功能,订阅特征值。
 			//注意:必须设备的特征值支持notify或者indicate才可以成功调用,具体参照 characteristic 的 properties 属性
 			notifyBLECharacteristicValueChange(context) {
-				var _self = this;
+				let _self = this;
 				let {
 					deviceId,
 					serviceId,
@@ -322,12 +365,13 @@
 					characteristicId: characteristicId,
 					success: function(res) {
 						if (!_self.bListenValueChange) {
-							_self.onBLECharacteristicValueChange(); //监听特征值变化
+							// _self.onBLECharacteristicValueChange(); //监听特征值变化
+							uni.$on("OTAValueChange", _self.onOTAValueChange);
 							_self.bListenValueChange = true;
 						}
 						if (characteristicId == _self.UUID_IDENTFY) {
 							//重发3次
-							_self.onGetDeviceVersion(context,3);
+							_self.onGetDeviceVersion(context, 3);
 						}
 
 					},
@@ -341,8 +385,8 @@
 					}
 				})
 			},
-			
-			onGetDeviceVersion(context,retryCount){
+
+			onGetDeviceVersion(context, retryCount) {
 				let _self = this;
 				let {
 					deviceId,
@@ -355,38 +399,40 @@
 					_self.writeHeadTimeout = null;
 				}
 				_self.writeHeadTimeout = setTimeout(() => {
-					
+
 					// 向蓝牙设备发送一个0x00的16进制数据
 					let bufferDevice = new ArrayBuffer(1)
 					let dataViewDevice = new DataView(bufferDevice)
 					dataViewDevice.setUint8(0, 0)
-				
+
 					uni.writeBLECharacteristicValue({
 						deviceId: deviceId,
 						serviceId: serviceId,
 						characteristicId: characteristicId,
 						value: bufferDevice,
-						success:(res) => {
-							console.log('获取版本:writeBLECharacteristicValue success', res.errMsg ," == " ,retryCount)
+						success: (res) => {
+							console.log('获取版本:writeBLECharacteristicValue success', res.errMsg, " == ",
+								retryCount)
 						},
-						fail:(fail)=>{
-							console.error('获取版本:writeBLECharacteristicValue fail', fail.errMsg ," == " ,retryCount)
-							
-							if(retryCount>0){
+						fail: (fail) => {
+							console.error('获取版本:writeBLECharacteristicValue fail', fail.errMsg, " == ",
+								retryCount)
+
+							if (retryCount > 0) {
 								retryCount--;
-								setTimeout(()=>{
-									_self.onGetDeviceVersion(context,retryCount);
-								},300);
+								setTimeout(() => {
+									_self.onGetDeviceVersion(context, retryCount);
+								}, 300);
 								return;
 							}
-							
-							
+
+
 							uni.showModal({
-								title:'获取固件版本',
-								content:'获取不成功,是否重新获取',
+								title: '获取固件版本',
+								content: '获取不成功,是否重新获取',
 								success: (resValue) => {
-									if(resValue.confirm){
-										_self.onGetDeviceVersion(context,retryCount);
+									if (resValue.confirm) {
+										_self.onGetDeviceVersion(context, retryCount);
 									}
 								}
 							})
@@ -394,6 +440,54 @@
 					})
 				}, 3000)
 			},
+			onOTAValueChange(res) {
+				console.log(
+					`update onOTAValueChange  ${res.serviceId} characteristic ${res.characteristicId} has changed, now is ${res.value}`
+				);
+				let _self = this;
+				if (res.characteristicId.toLocaleLowerCase() === _self.UUID_IDENTFY) {
+					//如果硬件的版本获取版本
+					var resValue = ab2hext(res.value); //16进制字符串
+					// console.log("Device 版本:", resValue.substr(0, 4), "Rom 版本号:", resValue.substr(16, 4));
+					_self.devicesList[0].currentRomVersion = resValue.substr(16, 4);
+					_self.devicesList[0].currentVersion = resValue.substr(0, 4);
+
+					//读取到硬件版本,判断是否需要更新
+					if (_self.devicesList[0].currentVersion === _self.devicesList[0].latestVersion && _self
+						.devicesList[0].currentRomVersion ===
+						_self.devicesList[0].latestRomVersion) {
+						uni.showToast({
+							title: '版本一致,无需升级',
+							icon: 'none',
+							mask: true,
+
+						})
+						_self.bCanUpdate = false;
+						return;
+					}
+					uni.showToast({
+						title: '获取信息成功',
+						icon: 'success',
+						mask: true,
+					})
+					//设置状态
+					_self.bCanUpdate = true;
+
+				} else {
+					uni.hideToast();
+					//成功发送头文件会走一个回调
+					let uint8_buf = new DataView(res.value);
+					_self.send_index = ((uint8_buf.getUint8(1) << 8) | uint8_buf.getUint8(0));
+					// console.log("val===>> data:" + ab2hext(res.value) + ",rv index:" + _self.send_index + _self.sending_file)
+
+					if (_self.sending_file == false) {
+						_self.sending_file = true;
+						// console.log("SendBlePkg");
+						_self.writeTip = "正在写入设备...";
+						_self.SendBlePkg();
+					}
+				}
+			},
 			//监听低功耗蓝牙设备的特征值变化。必须先启用notify接口才能接收到设备推送的notification。
 			onBLECharacteristicValueChange() {
 				var _self = this;
@@ -401,6 +495,10 @@
 				// console.log("onBLECharacteristicValueChange");
 				uni.onBLECharacteristicValueChange(function(res) {
 
+					console.log(
+						`update ${res.serviceId} characteristic ${res.characteristicId} has changed, now is ${res.value}`
+					);
+
 					if (res.characteristicId.toLocaleLowerCase() === _self.UUID_IDENTFY) {
 						//如果硬件的版本获取版本
 						var resValue = ab2hext(res.value); //16进制字符串
@@ -409,7 +507,8 @@
 						_self.devicesList[0].currentVersion = resValue.substr(0, 4);
 
 						//读取到硬件版本,判断是否需要更新
-						if (_self.devicesList[0].currentVersion === _self.devicesList[0].latestVersion && _self.devicesList[0].currentRomVersion ===
+						if (_self.devicesList[0].currentVersion === _self.devicesList[0].latestVersion && _self
+							.devicesList[0].currentRomVersion ===
 							_self.devicesList[0].latestRomVersion) {
 							uni.showToast({
 								title: '版本一致,无需升级',
@@ -433,7 +532,7 @@
 						//成功发送头文件会走一个回调
 						let uint8_buf = new DataView(res.value);
 						_self.send_index = ((uint8_buf.getUint8(1) << 8) | uint8_buf.getUint8(0));
-						console.log("val===>> data:" + ab2hext(res.value) + ",rv index:" + _self.send_index + _self.sending_file)
+						// console.log("val===>> data:" + ab2hext(res.value) + ",rv index:" + _self.send_index + _self.sending_file)
 
 						if (_self.sending_file == false) {
 							_self.sending_file = true;
@@ -458,7 +557,8 @@
 					success: (res) => {
 						//记录二进制数据
 						this.bin_buffer = res.data;
-						let binData = new Uint8Array(this.bin_buffer, 0, 16); //new Uint8Array(this.bin_buffer);
+						let binData = new Uint8Array(this.bin_buffer, 0,
+							16); //new Uint8Array(this.bin_buffer);
 						this.bin_file_len = (binData[7] << 8) | binData[6]
 						this.bin_total = (this.bin_file_len) / 4
 						this.bin_byteLength = this.bin_buffer.byteLength;
@@ -477,8 +577,10 @@
 						// 		binData[14]) +
 						// 	uint8_to_hex_str(binData[15]));
 						//显示信息
-						this.devicesList[0].latestRomVersion = uint8_to_hex_str(binData[14]) + uint8_to_hex_str(binData[15]); //str.substr(28, 2);
-						this.devicesList[0].latestVersion = uint8_to_hex_str(binData[4]) + uint8_to_hex_str(binData[5]); //str.substr(8, 2);
+						this.devicesList[0].latestRomVersion = uint8_to_hex_str(binData[14]) +
+							uint8_to_hex_str(binData[15]); //str.substr(28, 2);
+						this.devicesList[0].latestVersion = uint8_to_hex_str(binData[4]) + uint8_to_hex_str(
+							binData[5]); //str.substr(8, 2);
 
 					},
 					fail: (fail) => {
@@ -514,29 +616,29 @@
 							title: '准备更新数据...',
 							icon: 'none',
 							duration: 3000,
-							mask:true
+							mask: true
 						})
 						console.log('开始发送文件success', _self.sending_file)
 						// _self.SendBlePkg()
 					},
 					fail: function(err) {
-						console.log('read version fail! ' + JSON.stringify(err)+retryCount)
-						
-						if(retryCount>0){
+						console.log('read version fail! ' + JSON.stringify(err) + retryCount)
+
+						if (retryCount > 0) {
 							retryCount--;
-							setTimeout(()=>{
+							setTimeout(() => {
 								_self.sendFileHeader(retryCount);
-							},300);
+							}, 300);
 							return;
 						}
-						
+
 						uni.showModal({
-							title:'请求更新',
-							content:'请求更新失败,是否重新尝试继续。',
+							title: '请求更新',
+							content: '请求更新失败,是否重新尝试继续。',
 							success: (resValue) => {
-								if(resValue.confirm){
+								if (resValue.confirm) {
 									_self.sendFileHeader(retryCount);
-								}else if(resValue.cancel){
+								} else if (resValue.cancel) {
 									_self.bStart = false;
 								}
 							}
@@ -569,7 +671,7 @@
 					this.backTimeout = setTimeout(() => {
 						//更新成功后设备会断开,此时回退出此页面
 						uni.hideToast();
-						_self.onBack();
+						_self.onBack(true);
 					}, 1500)
 
 					return;
@@ -686,7 +788,8 @@
 							console.log("_buffer1:" + JSON.stringify(_arrayBuffer));
 							let _buffer = uni.base64ToArrayBuffer(_arrayBuffer);
 							console.log("_buffer2:", JSON.stringify(_buffer));
-							console.log("_buffer:", _buffer.length, _buffer.byteLength, _buffer.byteOffset);
+							console.log("_buffer:", _buffer.length, _buffer.byteLength, _buffer
+								.byteOffset);
 
 						}
 					});

+ 2 - 2
pages/personal-page/personal/personal.vue

@@ -526,8 +526,8 @@
 			updateData(newValue, oldValue, ownerInstance, instance) {
 				// newValue: 新数据
 				// oldValue: 老数据
-				var log = console.log.bind(console);
-				log(newValue)
+				// var log = console.log.bind(console);
+				// log(newValue)
 			}
 		}
 	}

+ 2 - 3
pages/personal-page/plan/plan.vue

@@ -147,7 +147,7 @@
 			this.startTime = this.currentPlanData.startTime;
 			this.endTime = this.currentPlanData.endTime;
 			this.currentDays = this.days;
-
+			console.log('this.currentPlanData:',this.currentPlanData);
 			// 用累计的卡路里来计算当前累计的重量
 			// let weight = this.currentPlanData.cumulativeCalorie *2 / 7000;
 			let weight = utilData.calorieConversionKg(this.currentPlanData.cumulativeCalorie);
@@ -161,7 +161,7 @@
 			},
 			onConfirm(args) {
 				this.hasUpdate = true;
-				console.log('onConfirm', args);
+				// console.log('onConfirm', args);
 				// detail.__args__[0]
 				// let args = data;
 				//月0~11
@@ -337,7 +337,6 @@
 				this.startTime = this.currentPlanData.startTime;
 				this.endTime = this.currentPlanData.endTime;
 				this.currentDays = date.datedifference(this.startTime, this.endTime);
-				// console.log("this.defaultPlanData=",this.defaultPlanData);
 			},
 			onBack() {
 				uni.navigateBack({

+ 5 - 4
platform/app-plus/subNVue/guide.nvue

@@ -29,12 +29,13 @@
 						</image>
 					</view>
 					<view class="position-absolute-center">
-						<text class="text-white text-14px" style="top: -30rpx;left:90rpx;">运动开始前设置一下计划</text>
+						<text class="text-white text-14px text-lines2" style="top: -30rpx;left:90rpx; width: 300rpx;">开始关卡前定制自己的卡路里,目标计划吧</text>
 					</view>
 				</view>
 				<view style="width: 750rpx;height: 120px;" class="flex flex-direction-row">
-					<view style="width: 30px;" class="mask-bg-07"></view>
-					<image style="width: 150px;height: 150px; opacity: 0.7;"
+					<!-- 32+ 60/2 -->
+					<view style="width: 62px;" class="mask-bg-07"></view>
+					<image style="width: 90px;height: 150px; opacity: 0.7;"
 						src="../../../static/common/subNVue/guide/guide-rect-mask.png"></image>
 					<view class="mask-bg-07 flex-sub"></view>
 				</view>
@@ -57,7 +58,7 @@
 						</image>
 					</view>
 					<view class="position-absolute-center">
-						<text class="text-white text-14px" style="top: -30rpx;left:80rpx;">点击开始进行</text>
+						<text class="text-white text-14px" style="top: -30rpx;left:80rpx;">点击播放体验关卡对应关卡</text>
 					</view>
 				</view>
 				<view style="width: 750rpx;height: 150px;" class="flex flex-direction-row">

+ 32 - 0
util/util-css/main.css

@@ -4525,3 +4525,35 @@ scroll-view.cu-steps .cu-item {
 /* .my-column-cu-steps>.cu-item>.content+.content {
 	margin-top: 20upx;
 } */
+
+/**
+ * 定位
+ */
+.position-relative {
+	position: relative;
+}
+.position-absolute-center {
+	position: absolute;
+	top: 0;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	margin: auto;
+	justify-content: center;
+	align-items: center;
+}
+
+/* 100 - Thin
+200 - Extra Light (Ultra Light)
+300 - Light
+400 - Regular (Normal、Book、Roman)
+500 - Medium
+600 - Semi Bold (Demi Bold)
+700 - Bold
+800 - Extra Bold (Ultra Bold)
+900 - Black (Heavy) */
+
+.text-regular{
+	font-weight: 400;
+}
+

+ 9 - 2
util/util-js/date.js

@@ -61,8 +61,15 @@ const dateAddDays=(dateStr,dayCount) => {
  */
 const addDaysFromNewDate=(tempDate,dayCount) => {
     var resultDate=new Date((tempDate/1000+(86400*dayCount))*1000);//增加n天后的日期
-    var resultDateStr=resultDate.getFullYear()+"/"+(resultDate.getMonth()+1)+"/"+(resultDate.getDate());//将日期转化为字符串格式
-    return resultDateStr;
+ //    var resultDateStr=resultDate.getFullYear()+"/"+(resultDate.getMonth()+1)+"/"+(resultDate.getDate());//将日期转化为字符串格式
+	// return resultDateStr;
+	
+	const year = resultDate.getFullYear();
+	const month = resultDate.getMonth() + 1;
+	const day = resultDate.getDate();
+	
+	return [year, month, day].map(formatNumber).join('/')
+	
 }
 
 const getWeightDate = date => {

+ 1 - 1
util/util-js/devices.js

@@ -82,7 +82,7 @@ const getDeviceList = function() {
 				mIcon: "/static/devicesIconSimple/rope_icon@2x.png",
 				bRatio: false,
 				usageMode: "ropeSkipping", //通用情况,根据需求处理
-				describe: '跳绳模式下使用',
+				describe: '*长按开机键至蓝灯正常闪烁\n*蓝灯正常闪烁后,点击灰色选中按钮匹配手柄',
 				limitType: 'rebound', //app处理蓝牙发送的数据
 				deviceType: 'BLERope', //指的是外部蓝牙,目前定义为BLERope
 				deviceName: 'Rope', //连接的设备名称

+ 46 - 15
util/util-js/store.js

@@ -194,6 +194,7 @@ const store = new Vuex.Store({
 
 		//phoneNumber
 		phoneNumber: '',
+		mailboxNumber: '',
 		openid: '',
 		appleid: '',
 
@@ -325,6 +326,17 @@ const store = new Vuex.Store({
 		bListenerMac: false,
 		bListenerAccArray: false,
 
+
+
+		/**
+		 * OTA config
+		 */
+		UUID_OTA_SERVICE: "f000ffc0-0451-4000-b000-000000000000", //OTA 服务对应的服务的 UUID
+		UUID_IDENTFY: "f000ffc1-0451-4000-b000-000000000000", //OTA 版本特征值的UUID,读取版本就是写向这个特征值写入:0x00
+		UUID_BLOCK: "f000ffc2-0451-4000-b000-000000000000", //OTA 写bin文件特征值UUID,发送bin文件就是写这个特征值
+		/*****/
+
+
 		/**
 		 * 发送16进制时候,返回的刷新数据
 		 */
@@ -389,7 +401,7 @@ const store = new Vuex.Store({
 		 * 签到列表
 		 */
 		signInList: [],
-		isSignIn:false,
+		isSignIn: false,
 
 	},
 	mutations: {
@@ -877,8 +889,16 @@ const store = new Vuex.Store({
 
 		},
 
-		//验证码操作
-		countDown(state, phoneNumber) {
+		/**
+		 * 验证码操作 区分手机号和邮箱
+		 * @param {Object} state
+		 * @param {Object} context
+		 */
+		countDown(state, context) {
+			let {
+				count,
+				type
+			} = context;
 			//限制验证码操作
 			state.bCodeDisabled = true;
 			state.interval = setInterval(() => {
@@ -895,8 +915,10 @@ const store = new Vuex.Store({
 				state.count = 59;
 				state.bCodeDisabled = false;
 			}, 60000);
-			reqUtil.requestData(config.URL.GETCODE, {
-				"phoneNumber": phoneNumber
+			//GETCODE "phoneNumber": phoneNumber; GETCODEACCORDINGTYPE
+			reqUtil.requestData(config.URL.GETCODEACCORDINGTYPE, {
+				count,
+				type
 			}).then(res => {
 					console.log('requestData GETCODE =====', res);
 					uni.showToast({
@@ -1205,6 +1227,7 @@ const store = new Vuex.Store({
 					if (res.code == 0) {
 						let userInfo = res.data.userInfo;
 						state.phoneNumber = res.data.phoneNumber || '';
+						state.mailboxNumber = res.data.mailboxNumber || '';
 						state.openid = res.data.openid || '';
 						self.commit('login', userInfo);
 					} else if (res.code = 201) {
@@ -1337,6 +1360,7 @@ const store = new Vuex.Store({
 			state.hasLogin = false;
 
 			state.phoneNumber = '';
+			state.mailboxNumber = '';
 			state.openid = '';
 			state.appleid = '';
 
@@ -2455,7 +2479,6 @@ const store = new Vuex.Store({
 					this.commit('B_OnBLECharacteristicValueChange', {
 						callback: callback
 					});
-					// _self.onBLECharacteristicValueChange(callback); //监听特征值变化
 				},
 				fail: (res) => {
 					uni.showToast({
@@ -2480,6 +2503,13 @@ const store = new Vuex.Store({
 				})
 			}
 			uni.onBLECharacteristicValueChange(function(res) {
+				//如果是ota 更新服务,这里处理通知ota更新数据
+				if (res.serviceId.toLocaleLowerCase() === state.UUID_OTA_SERVICE) {
+					uni.$emit("OTAValueChange", res);
+					return;
+				}
+				//serviceId 0000FFF0-0000-1000-8000-00805F9B34FB characteristic 0000FFF1-0000-1000-8000-00805F9B34FB
+				// console.log(`store ${res.serviceId} characteristic ${res.characteristicId} has changed, now is ${res.value}`);
 				let box = {};
 				var resValue = BLE.ab2hext(res.value); //16进制字符串
 				if (state.currentInstruction == "V" && state.showToast) {
@@ -3310,7 +3340,7 @@ const store = new Vuex.Store({
 					});
 					break;
 				case 'signIn':
-					this.commit("onSendSignInPopup",context);
+					this.commit("onSendSignInPopup", context);
 					break;
 				case 'pkFinish':
 					// 向 popup 传递消息
@@ -3384,9 +3414,10 @@ const store = new Vuex.Store({
 								mask: true
 							})
 							//根据dayType 计算最近一个flag
-							for(let i=0;i<state.signInList.length;i++){
-								if(res.data.signIn.dayType == state.signInList[i].dayType){
-									state.signInList[i] = Object.assign({},state.signInList[i],res.data.signIn);
+							for (let i = 0; i < state.signInList.length; i++) {
+								if (res.data.signIn.dayType == state.signInList[i].dayType) {
+									state.signInList[i] = Object.assign({}, state.signInList[i], res.data
+										.signIn);
 									break;
 								}
 							}
@@ -3405,7 +3436,7 @@ const store = new Vuex.Store({
 					}
 				);
 		},
-		onSendSignInPopup(state,context){
+		onSendSignInPopup(state, context) {
 			let {
 				type,
 				item
@@ -3431,7 +3462,7 @@ const store = new Vuex.Store({
 					isSelect: false
 				}
 			];
-			
+
 			let list = state.signInList;
 			let lists = [];
 			for (let i = 0; i < list.length; i++) {
@@ -3444,16 +3475,16 @@ const store = new Vuex.Store({
 						value: list[i].diamond
 					}))
 				}
-				lists[i].isSelect = list[i].flag == 1?true:false;
+				lists[i].isSelect = list[i].flag == 1 ? true : false;
 			}
-			
+
 			// 向 popup 传递消息
 			uni.$emit('reward-popup', {
 				title: '每日签到',
 				content: '',
 				type: type,
 				lists: lists,
-				isSignIn:state.isSignIn
+				isSignIn: state.isSignIn
 			});
 		}