找回丢失的代码片段

This commit is contained in:
abu 2025-05-25 13:51:37 +08:00
parent 27c06ebf78
commit 8e7d5605a3
5 changed files with 88 additions and 86 deletions

77
App.vue
View File

@ -95,43 +95,42 @@ export default {
},
methods: {
onRequestPermissionListener() {
this.permissionListener = uni.createRequestPermissionListener();
this.permissionListener.onRequest(async (e) => {
console.log(e);
if (this.flag) {
return;
}
this.flag = true;
console.log('权限-1', e);
var item = e[0];
const { isSuc, msg } = await requestPermissions({
title: PermissionTips[item].title, //
content: PermissionTips[item].content, //
permissionID: item // ID
});
console.log(msg);
if (!isSuc) {
if (msg != 'close') {
this.popupView = showModal({
title: PermissionTips[item].title, //
content: PermissionTips[item].content, //
permissionID: item // ID
});
} else {
console.log('用户永久拒绝');
}
}
});
this.permissionListener.onComplete((e) => {
console.log('权限-2', e);
if (this.popupView) {
this.popupView.close();
}
setTimeout(() => {
this.flag = false;
}, 5000);
});
// this.permissionListener = uni.createRequestPermissionListener();
// this.permissionListener.onRequest(async (e) => {
// console.log(e);
// if (this.flag) {
// return;
// }
// this.flag = true;
// console.log('-1', e);
// var item = e[0];
// const { isSuc, msg } = await requestPermissions({
// title: PermissionTips[item].title, //
// content: PermissionTips[item].content, //
// permissionID: item // ID
// });
// console.log(msg);
// if (!isSuc) {
// if (msg != 'close') {
// this.popupView = showModal({
// title: PermissionTips[item].title, //
// content: PermissionTips[item].content, //
// permissionID: item // ID
// });
// } else {
// console.log('');
// }
// }
// });
// this.permissionListener.onComplete((e) => {
// console.log('-2', e);
// if (this.popupView) {
// this.popupView.close();
// }
// setTimeout(() => {
// this.flag = false;
// }, 5000);
// });
// #ifndef APP-HARMONY
//
// APP使APIapp.vue
@ -175,9 +174,7 @@ export default {
// });
// }
// #endif
// { isSuc : true} ,
// if (!isSuc) {
// return false
// }
@ -393,4 +390,4 @@ body {
// height: 100% ;
// overflow: hidden;
// }
</style>
</style>

View File

@ -1005,7 +1005,7 @@ export default {
tozuozhe(userId) {
var myInfo = storage.getVlogUserInfo();
var myId = '';
if (myId != null) {
if (myInfo != null) {
myId = myInfo.id;
}
if (userId == myId) {

View File

@ -869,7 +869,12 @@ export default {
if (myUserInfo != null) {
userId = myUserInfo.id;
}
const res = await vlogList(this.page, 10, userId);
let cityCode = storage.getCityCode();
if (cityCode == '') {
this.noData = '获取位置信息失败';
return;
}
const res = await vlogList(this.page, 10, userId, cityCode);
console.log(res);
if (res.data.status == 200) {
var msg = res.data.data.rows;
@ -1011,7 +1016,7 @@ export default {
tozuozhe(userId) {
var myInfo = storage.getVlogUserInfo();
var myId = '';
if (myId != null) {
if (myInfo != null) {
myId = myInfo.id;
}
if (userId == myId) {

View File

@ -25,7 +25,7 @@ const dev = {
const prod = {
// common: "http://192.168.1.40:8890",
// buyer: "http://192.168.1.40:8888",
// vlog: "http://192.168.1.40:8099",
// vlog: "http://192.168.1.7:8099",
// web: "http://192.168.1.40:8099",
// seller: "http://192.168.1.40:8889",

View File

@ -1,43 +1,43 @@
<template>
<view class="container">
<!-- 用于显示二维码的容器 -->
<view id="qrcode"></view>
</view>
</template>
<script>
import QRCode from 'qrcodejs2';
import config from "@/config/config.js";
export default {
data() {
return {
// ... existing code ...
};
},
onReady() {
this.generateQRCode();
},
methods: {
generateQRCode() {
if (config.downloadLink) {
new QRCode(document.getElementById('qrcode'), {
text: config.downloadLink,
width: 200,
height: 200,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
}
}
}
};
</script>
<style scoped>
#qrcode {
margin: 20px auto;
text-align: center;
}
</style>
<view class="container">
<!-- 用于显示二维码的容器 -->
<view id="qrcode"></view>
</view>
</template>
<script>
// import QRCode from 'qrcodejs2';
import config from '@/config/config.js';
export default {
data() {
return {
// ... existing code ...
};
},
onReady() {
// this.generateQRCode();
},
methods: {
generateQRCode() {
if (config.downloadLink) {
new QRCode(document.getElementById('qrcode'), {
text: config.downloadLink,
width: 200,
height: 200,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
});
}
}
}
};
</script>
<style scoped>
#qrcode {
margin: 20px auto;
text-align: center;
}
</style>