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