diff --git a/App.vue b/App.vue index 022a39e..9b4d691 100644 --- a/App.vue +++ b/App.vue @@ -1,55 +1,63 @@ diff --git a/BLEPages/adult/H01pro.vue b/BLEPages/adult/H01pro.vue index 17c66c7..eb1a490 100644 --- a/BLEPages/adult/H01pro.vue +++ b/BLEPages/adult/H01pro.vue @@ -41,7 +41,7 @@ } }, computed: { - ...mapState(["user", "isConnected", "isBluetoothTyle"]), + ...mapState(["user", "isConnected", "isBluetoothTyle","appTheme"]), info() { return this.user } @@ -74,12 +74,19 @@ }, onLoad(options) { let that = this + // 导航栏颜色 + uni.setNavigationBarColor({ + frontColor: '#ffffff', + backgroundColor: this.appTheme, + }) + // that.textW = "" that.textH = "" if (options && options.deviceId) { - that.macAddr = options.deviceId that.deviceId = options.deviceId - that.createBLEConnection() + that.closeBLEConnection() + that.closeBluetoothAdapter() + that.openBluetoothAdapter() } that.onBLEConnectionStateChange() uni.onBluetoothAdapterStateChange(function(res) { @@ -139,22 +146,26 @@ var that = this; that.isConnection = 0 uni.onBluetoothDeviceFound(res => { - console.log('开始监听寻找到新设备的事件', res); res.devices.forEach(device => { if (!device.name && !device.localName) { return } - if (device.deviceId.indexOf(that.deviceId) != -1) { - that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索 + console.log('开始监听寻找到新设备的事件', device); + if (device.name.indexOf('My') != -1) { clearTimeout(myTime); let buff = device.advertisData.slice(-6) device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址 let tempMac = Array.from(device.mac) + console.log('开始监听寻找到新设备的事件0', device) device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase() - that.deviceId = device.macAddr - that.macAddr = device.macAddr - that.createBLEConnection() - return; + if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) { + console.log('开始监听寻找到新设备的事件1', that.deviceId) + that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索 + that.deviceId = device.deviceId + that.macAddr = device.macAddr + that.createBLEConnection() + return; + } } }) }); diff --git a/BLEPages/adult/H09B.vue b/BLEPages/adult/H09B.vue index 7e5fd8c..8ae2196 100644 --- a/BLEPages/adult/H09B.vue +++ b/BLEPages/adult/H09B.vue @@ -1,448 +1,457 @@ diff --git a/components/signup/signup.vue b/components/signup/signup.vue index 97a0596..d3ce04a 100644 --- a/components/signup/signup.vue +++ b/components/signup/signup.vue @@ -29,7 +29,7 @@ 出生日期 - + {{info.birthday?info.birthday:"请选择"}} @@ -65,6 +65,9 @@ userInfo: function() { return this.user }, + endDate() { + return this.$tools.getDate("start") + } }, mounted() { var agedata = [] @@ -114,10 +117,13 @@ height: that.userInfo.height, sex: that.userInfo.sex, }).then((res) => { - that.$store.dispatch("getUserInfo", { - familyid: that.userInfo.familyid, - }) - that.$store.dispatch("getFamilyList"); + if (res.code == 0) { + that.$store.commit('changeMeasureResult', res.data) + that.$store.dispatch("getUserInfo", { + familyid: that.userInfo.familyid, + }) + that.$store.dispatch("getFamilyList"); + } }) }, }, diff --git a/components/userLogin.vue b/components/userLogin.vue index bf7d3e0..0bd8f9e 100644 --- a/components/userLogin.vue +++ b/components/userLogin.vue @@ -44,7 +44,10 @@ uni.getUserProfile({ desc: '登录', success: (infoRes) => { - console.log("getUserProfile授权成功", infoRes, that.url); + console.log("getUserProfile授权成功", infoRes, uni.getStorageSync('tenantid')); + that.$store.dispatch("getConfig", { + tenantId: uni.getStorageSync('tenantid') + }) uni.redirectTo({ url: `/pageTwo/login/login?name=` + infoRes.userInfo.nickName + "&headimg=" + infoRes.userInfo.avatarUrl + "&url=" + that.url diff --git a/config.js b/config.js index 7d71987..06388d6 100644 --- a/config.js +++ b/config.js @@ -1,29 +1,17 @@ - const accountInfo = wx.getAccountInfoSync(); const appid = accountInfo.miniProgram.appId uni.setStorageSync('appid', appid) let host = "" if (process.env.NODE_ENV === 'development') { - console.log("开发环境") - // host = "https://ttybapi.pcxbc.com" - host = "https://ttybapi.pcxbc.com" + console.log("开发环境") + // host = "https://ttybapi.pcxbc.com" + host = "https://ybapi.pcxbc.com" } else { - console.log("生产环境") - host = "https://ybapi.pcxbc.com" + console.log("生产环境") + host = "https://ybapi.pcxbc.com" } -// // 设备管理 -// let baseUrl = {} -// if (appid === 'wx3e83b37ba682faf5') { -// console.log("每日一称儿童") -// baseUrl.adult = "wxd230a93791c03259" -// baseUrl.device = "wx6f48cc32c5c0a4a2" -// } else if (appid === 'wx44df5e42ddf16203') { -// console.log("小秤匠") -// baseUrl.adult = "wx39cf431caa22b5c8" -// baseUrl.device = "wx6f48cc32c5c0a4a2" -// } console.log("appid", appid) module.exports = { - appid, - host + appid, + host, }; diff --git a/main.js b/main.js index d3646b8..cba18b8 100644 --- a/main.js +++ b/main.js @@ -22,14 +22,14 @@ Vue.prototype.$model = model; // 环境配置 import config from './config.js' Vue.prototype.config = config; - +console.log("uni.setStorageSync", store) Vue.config.productionTip = false App.mpType = 'app' //让页面onLoad在onLaunch后执行 Vue.prototype.$onLaunched = new Promise(resolve => { - Vue.prototype.$isResolve = resolve + Vue.prototype.$isResolve = resolve }) const app = new Vue({ - ...App + ...App }) app.$mount() diff --git a/manifest.json b/manifest.json index ddd8e2d..2bf64ec 100644 --- a/manifest.json +++ b/manifest.json @@ -57,7 +57,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx3e83b37ba682faf5", + "appid" : "wxd230a93791c03259", "setting" : { "urlCheck" : true, "minified" : true, diff --git a/pageTwo/compk/pkdetail.vue b/pageTwo/compk/pkdetail.vue index e0af234..0be8000 100644 --- a/pageTwo/compk/pkdetail.vue +++ b/pageTwo/compk/pkdetail.vue @@ -85,6 +85,11 @@ export default { onLoad(options) { let that = this + // 导航栏颜色 + uni.setNavigationBarColor({ + frontColor: '#ffffff', + backgroundColor: this.appTheme, + }) console.log("options", options) if (options.info) { that.infoID = JSON.parse(options.info) @@ -92,7 +97,7 @@ } }, computed: { - ...mapState(["user"]), + ...mapState(["user","appTheme"]), }, methods: { handleSharepic(id) { diff --git a/pageTwo/home/index.vue b/pageTwo/home/index.vue deleted file mode 100644 index 17b3bfa..0000000 --- a/pageTwo/home/index.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - diff --git a/pageTwo/login/detail.vue b/pageTwo/login/detail.vue index 927ba25..438dbfe 100644 --- a/pageTwo/login/detail.vue +++ b/pageTwo/login/detail.vue @@ -1,76 +1,88 @@ diff --git a/pageTwo/login/login.vue b/pageTwo/login/login.vue index d25996c..bef8808 100644 --- a/pageTwo/login/login.vue +++ b/pageTwo/login/login.vue @@ -1,340 +1,351 @@ diff --git a/pageTwo/login/userinfo.vue b/pageTwo/login/userinfo.vue index 6de41e9..d9aa4e1 100644 --- a/pageTwo/login/userinfo.vue +++ b/pageTwo/login/userinfo.vue @@ -1,262 +1,268 @@ diff --git a/pageTwo/me/adduser.vue b/pageTwo/me/adduser.vue index e63817f..e4bbbc2 100644 --- a/pageTwo/me/adduser.vue +++ b/pageTwo/me/adduser.vue @@ -1,253 +1,258 @@ diff --git a/pageTwo/me/detail.vue b/pageTwo/me/detail.vue index 40f4958..de4482f 100644 --- a/pageTwo/me/detail.vue +++ b/pageTwo/me/detail.vue @@ -1,319 +1,325 @@ diff --git a/pageTwo/me/feedBack.vue b/pageTwo/me/feedBack.vue index 8ce97f6..5caa798 100644 --- a/pageTwo/me/feedBack.vue +++ b/pageTwo/me/feedBack.vue @@ -1,103 +1,115 @@