找回丢失的代码片段

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

View File

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

View File

@ -869,7 +869,12 @@ export default {
if (myUserInfo != null) { if (myUserInfo != null) {
userId = myUserInfo.id; 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); console.log(res);
if (res.data.status == 200) { if (res.data.status == 200) {
var msg = res.data.data.rows; var msg = res.data.data.rows;
@ -1011,7 +1016,7 @@ export default {
tozuozhe(userId) { tozuozhe(userId) {
var myInfo = storage.getVlogUserInfo(); var myInfo = storage.getVlogUserInfo();
var myId = ''; var myId = '';
if (myId != null) { if (myInfo != null) {
myId = myInfo.id; myId = myInfo.id;
} }
if (userId == myId) { if (userId == myId) {

View File

@ -25,7 +25,7 @@ const dev = {
const prod = { const prod = {
// common: "http://192.168.1.40:8890", // common: "http://192.168.1.40:8890",
// buyer: "http://192.168.1.40:8888", // 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", // web: "http://192.168.1.40:8099",
// seller: "http://192.168.1.40:8889", // seller: "http://192.168.1.40:8889",

View File

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