小程序刷新

This commit is contained in:
lxz 2024-01-17 18:11:54 +08:00
parent 7b55a4ca99
commit b42cb5a8ce
2 changed files with 40 additions and 40 deletions

View File

@ -3,8 +3,8 @@
// "appid" : "__UNI__3A527D1",
"appid": "__UNI__A495155",
"description": "",
"versionName": "1.0.2",
"versionCode": 102,
"versionName": "1.0.6",
"versionCode": 106,
"transformPx": false,
/* 5+App */
"app-plus": {

View File

@ -3,7 +3,7 @@
<view class="" style="background-color: #2B63E3;height: var(--status-bar-height);" />
<view class="head">
<view class="" style="float: right;margin-top: 20rpx;">
<Myindex url='/pages/index/index' />
<Myindex url='/pages/oaHome/oaHome' />
</view>
<view class="head-content ">
<view class="identity">
@ -380,9 +380,10 @@
await this.$onLaunched;
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO") || '{}')?.is_captain
this.options.data = bj;
this.initTask()
// this.initTask()
},
async onShow() {
this.initTask()
await this.$onLaunched;
if (uni.getStorageSync('uniMP')) this.uniMP = true;
userInfo().then(({
@ -466,44 +467,43 @@
});
},
saveCode() {
// this.$refs.uqrcode.save({
// success: () => {
// uni.showToast({
// icon: 'success',
// title: ''
// });
// }
// });
var pages = getCurrentPages();
var page = pages[pages.length - 1];
console.log("当前页" + pages.length - 1);
var bitmap = null;
var currentWebview = page.$getAppWebview();
bitmap = new plus.nativeObj.Bitmap('amway_img');
// webviewBitmap
currentWebview.draw(bitmap, function() {
console.log('截屏绘制图片成功');
bitmap.save("_doc/a.jpg", {}, function(i) {
console.log('保存图片成功:' + JSON.stringify(i));
uni.saveImageToPhotosAlbum({
filePath: i.target,
success: function() {
bitmap.clear(); //Bitmap
uni.showToast({
title: '保存图片成功',
mask: false,
duration: 1500
});
}
this.$refs.uqrcode.save({
success: () => {
uni.showToast({
icon: 'success',
title: '保存成功'
});
}, function(e) {
console.log('保存图片失败:' + JSON.stringify(e));
});
}, function(e) {
console.log('截屏绘制图片失败:' + JSON.stringify(e));
}
});
//currentWebview.append(amway_bit);
// var pages = getCurrentPages();
// var page = pages[pages.length - 1];
// console.log("" + pages.length - 1);
// var bitmap = null;
// var currentWebview = page.$getAppWebview();
// bitmap = new plus.nativeObj.Bitmap('amway_img');
// // webviewBitmap
// currentWebview.draw(bitmap, function() {
// console.log('');
// bitmap.save("_doc/a.jpg", {}, function(i) {
// console.log('' + JSON.stringify(i));
// uni.saveImageToPhotosAlbum({
// filePath: i.target,
// success: function() {
// bitmap.clear(); //Bitmap
// uni.showToast({
// title: '',
// mask: false,
// duration: 1500
// });
// }
// });
// }, function(e) {
// console.log('' + JSON.stringify(e));
// });
// }, function(e) {
// console.log('' + JSON.stringify(e));
// });
// //currentWebview.append(amway_bit);
},
leftClick(e) {