Merge branch 'fanpeng' into 'master'
1. 首页分组名称修改英文昵称过长时的显示bug See merge request StarlockTeam/wx-starlock!9
This commit is contained in:
commit
711912b6d0
2
App.vue
2
App.vue
@ -37,6 +37,8 @@
|
|||||||
onLaunch: async function() {
|
onLaunch: async function() {
|
||||||
// 检查强制升级
|
// 检查强制升级
|
||||||
this.updateMiniProgram()
|
this.updateMiniProgram()
|
||||||
|
// 监听蓝牙开关状态
|
||||||
|
this.onBluetoothState()
|
||||||
// 检查蓝牙权限
|
// 检查蓝牙权限
|
||||||
const checkResult = await this.checkSetting()
|
const checkResult = await this.checkSetting()
|
||||||
console.log(checkResult)
|
console.log(checkResult)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"appid" : "__UNI__933D519",
|
"appid" : "__UNI__933D519",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "12",
|
"versionCode" : "14",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/updateSafeQuestion/updateSafeQuestion",
|
"path": "pages/updateSafeQuestion/updateSafeQuestion",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "修改安全问题"
|
"navigationBarTitleText": "安全问题"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -605,6 +605,7 @@ page {
|
|||||||
|
|
||||||
.group-name-text {
|
.group-name-text {
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-name-line {
|
.group-name-line {
|
||||||
|
|||||||
@ -279,6 +279,7 @@ export default {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
padding: 32rpx 32rpx 0 32rpx;
|
padding: 32rpx 32rpx 0 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
|
|||||||
@ -7,8 +7,7 @@
|
|||||||
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<input class="input" :value="item.answer" maxlength="16" placeholder="请输入答案"
|
<view class="input">{{item.answer}}</view>
|
||||||
placeholder-class="input-placeholder" :disabled="true"></input>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="button" @click="updateAnswer">修改</view>
|
<view class="button" @click="updateAnswer">修改</view>
|
||||||
</view>
|
</view>
|
||||||
@ -51,8 +50,10 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.routeJump({
|
this.routeJump({
|
||||||
type: 'redirectTo',
|
name: 'updateSafeQuestion',
|
||||||
name: 'updateSafeQuestion'
|
params: {
|
||||||
|
questionAnswer: JSON.stringify(this.questionAnswer)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,17 +96,10 @@ page {
|
|||||||
|
|
||||||
.input {
|
.input {
|
||||||
border-radius: 0 0 32rpx 32rpx;
|
border-radius: 0 0 32rpx 32rpx;
|
||||||
height: 100rpx;
|
line-height: 40rpx;
|
||||||
line-height: 100rpx;
|
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
padding: 0 32rpx;
|
padding: 20rpx 32rpx;
|
||||||
}
|
word-break: break-all;
|
||||||
|
|
||||||
.input-placeholder {
|
|
||||||
height: 100rpx;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 100rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<view class="view-button">
|
<view class="view-button">
|
||||||
<view style="width: 350rpx">名称</view>
|
<view style="width: 350rpx">名称</view>
|
||||||
<view class="view-button" style="padding: 20rpx 0">
|
<view class="view-button" style="padding: 20rpx 0">
|
||||||
<view class="info" style="line-height: 40rpx">{{currentLockInfo.lockAlias}}</view>
|
<view class="info" style="line-height: 40rpx;word-break: break-all;">{{currentLockInfo.lockAlias}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="view-line"></view>
|
<view class="view-line"></view>
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<input class="input" :value="answer[0].answer" maxlength="16" placeholder="请输入答案"
|
<input class="input" :value="answer[0].answer" maxlength="50" placeholder="请输入答案"
|
||||||
placeholder-class="input-placeholder" @input="changeFirstAnswer"></input>
|
placeholder-class="input-placeholder" @input="changeFirstAnswer"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="safe-question">
|
<view class="safe-question">
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<input class="input" :value="answer[1].answer" maxlength="16" placeholder="请输入答案"
|
<input class="input" :value="answer[1].answer" maxlength="50" placeholder="请输入答案"
|
||||||
placeholder-class="input-placeholder" @input="changeSecondAnswer"></input>
|
placeholder-class="input-placeholder" @input="changeSecondAnswer"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="safe-question">
|
<view class="safe-question">
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
<image class="icon-arrow" src="/static/images/icon_arrow.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<input class="input" :value="answer[2].answer" maxlength="16" placeholder="请输入答案"
|
<input class="input" :value="answer[2].answer" maxlength="50" placeholder="请输入答案"
|
||||||
placeholder-class="input-placeholder" @input="changeThirdAnswer"></input>
|
placeholder-class="input-placeholder" @input="changeThirdAnswer"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="button" @click="updateAnswer">保存</view>
|
<view class="button" @click="updateAnswer">保存</view>
|
||||||
@ -65,14 +65,29 @@ export default {
|
|||||||
answer: ''
|
answer: ''
|
||||||
}],
|
}],
|
||||||
show: false,
|
show: false,
|
||||||
pending: false
|
pending: false,
|
||||||
|
questionAnswer: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useUserStore, ['userInfo'])
|
...mapState(useUserStore, ['userInfo'])
|
||||||
},
|
},
|
||||||
onLoad() {
|
async onLoad (data) {
|
||||||
this.getQuestionList()
|
this.getQuestionList()
|
||||||
|
const questionAnswer = JSON.parse(data.questionAnswer)
|
||||||
|
if (questionAnswer) {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '安全问题设置'
|
||||||
|
})
|
||||||
|
this.questionAnswer = questionAnswer
|
||||||
|
this.answer = questionAnswer.map(item => {
|
||||||
|
return {
|
||||||
|
question: item.question,
|
||||||
|
answer: item.answer,
|
||||||
|
questionId: item.questionId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useUserStore, ['updateUserInfo']),
|
...mapActions(useUserStore, ['updateUserInfo']),
|
||||||
@ -113,7 +128,7 @@ export default {
|
|||||||
...this.userInfo,
|
...this.userInfo,
|
||||||
haveSafeAnswer: 1
|
haveSafeAnswer: 1
|
||||||
})
|
})
|
||||||
this.backAndToast('设置成功')
|
this.backAndToast('设置成功', 2)
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: message,
|
title: message,
|
||||||
@ -151,6 +166,18 @@ export default {
|
|||||||
this.show = true
|
this.show = true
|
||||||
},
|
},
|
||||||
async getQuestionList() {
|
async getQuestionList() {
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '未获取到问题列表,请退出重试',
|
||||||
|
showCancel: false,
|
||||||
|
success: () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
const { code, data, message } = await getQuestionListRequest()
|
const { code, data, message } = await getQuestionListRequest()
|
||||||
if(code === 0) {
|
if(code === 0) {
|
||||||
this.questionList = data
|
this.questionList = data
|
||||||
|
|||||||
@ -121,8 +121,6 @@ export const useBluetoothStore = defineStore('ble', {
|
|||||||
if (initResult) {
|
if (initResult) {
|
||||||
// 更新蓝牙初始化状态
|
// 更新蓝牙初始化状态
|
||||||
this.updateInitBluetooth(true)
|
this.updateInitBluetooth(true)
|
||||||
// 监听蓝牙开关状态
|
|
||||||
this.onBluetoothState()
|
|
||||||
// 监听蓝牙连接状态
|
// 监听蓝牙连接状态
|
||||||
this.onBluetoothConnectStatus()
|
this.onBluetoothConnectStatus()
|
||||||
// 监听设备特征值变化
|
// 监听设备特征值变化
|
||||||
@ -542,30 +540,33 @@ export const useBluetoothStore = defineStore('ble', {
|
|||||||
uni.stopBluetoothDevicesDiscovery()
|
uni.stopBluetoothDevicesDiscovery()
|
||||||
},
|
},
|
||||||
// 蓝牙状态提示
|
// 蓝牙状态提示
|
||||||
getBluetoothStatus() {
|
async getBluetoothStatus () {
|
||||||
if(this.bluetoothStatus === 1) {
|
if (this.bluetoothStatus === 1) {
|
||||||
uni.showModal({
|
const initResult = await this.initBluetooth()
|
||||||
title: '提示',
|
if (!initResult) {
|
||||||
content: '蓝牙尚未打开,请先打开蓝牙',
|
uni.showModal({
|
||||||
showCancel: false,
|
title: '提示',
|
||||||
success(res) {
|
content: '蓝牙尚未打开,请先打开蓝牙',
|
||||||
if (res.confirm) {
|
showCancel: false,
|
||||||
wx.openSystemBluetoothSetting({
|
success (res) {
|
||||||
success (res) {
|
if (res.confirm) {
|
||||||
console.log(res)
|
wx.openSystemBluetoothSetting({
|
||||||
}
|
success (res) {
|
||||||
})
|
console.log(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
} else if(this.bluetoothStatus === 2 || this.bluetoothStatus === 3) {
|
} else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '小程序蓝牙功能被禁用,请打开小程序蓝牙权限',
|
content: '小程序蓝牙功能被禁用,请打开小程序蓝牙权限',
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
confirmText: '去设置',
|
confirmText: '去设置',
|
||||||
success(res) {
|
success (res) {
|
||||||
if(res.confirm) {
|
if (res.confirm) {
|
||||||
uni.openSetting()
|
uni.openSetting()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -594,8 +595,6 @@ export const useBluetoothStore = defineStore('ble', {
|
|||||||
await that.initBluetooth()
|
await that.initBluetooth()
|
||||||
} else if(that.bluetoothStatus === 3 && bluetooth !== false) {
|
} else if(that.bluetoothStatus === 3 && bluetooth !== false) {
|
||||||
that.bluetoothStatus = 1
|
that.bluetoothStatus = 1
|
||||||
await that.initBluetooth()
|
|
||||||
that.onBluetoothState()
|
|
||||||
}
|
}
|
||||||
console.log('蓝牙权限', bluetooth, that.bluetoothStatus)
|
console.log('蓝牙权限', bluetooth, that.bluetoothStatus)
|
||||||
resolve(bluetooth)
|
resolve(bluetooth)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user