暂存代码
This commit is contained in:
@@ -1,26 +1,35 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const utils_inviteBase64 = require("../../utils/inviteBase64.js");
|
||||
const api_common = require("../../api/common.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
inviteImage: null,
|
||||
imageLoading: false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getSharePoster();
|
||||
},
|
||||
methods: {
|
||||
// 保存图片
|
||||
// async saveImage(){
|
||||
// const shareImagesObj = this.shareImagesArr[this.shareImagesIndex];
|
||||
// const params = {
|
||||
// id:this.shareId,
|
||||
// imgId:shareImagesObj.id,
|
||||
// }
|
||||
// const response = await uni.$httpHeader.post(mergeImage,params);
|
||||
// this.saveHeadImgFile(response.data);
|
||||
// },
|
||||
// 查询分享模版
|
||||
async getSharePoster() {
|
||||
this.imageLoading = true;
|
||||
const resp = await api_common.getSharePoster();
|
||||
if (resp && resp.bizcode === 100) {
|
||||
const data = resp.data[0];
|
||||
const generateResp = await api_common.generateSharePoster({ id: data.id });
|
||||
if (generateResp && generateResp.bizcode === 100) {
|
||||
this.inviteImage = generateResp.data;
|
||||
}
|
||||
}
|
||||
this.imageLoading = false;
|
||||
},
|
||||
saveBaseImgFile() {
|
||||
common_vendor.index.showLoading({
|
||||
title: "保存中..."
|
||||
});
|
||||
const currentBase64 = utils_inviteBase64.base64;
|
||||
const currentBase64 = this.inviteImage;
|
||||
const bitmap = new plus.nativeObj.Bitmap("base64");
|
||||
bitmap.loadBase64Data(
|
||||
currentBase64,
|
||||
@@ -30,8 +39,7 @@ const _sfc_main = {
|
||||
url,
|
||||
{
|
||||
overwrite: false
|
||||
// 是否覆盖
|
||||
// quality: 'quality' // 图片清晰度
|
||||
// 是否覆盖
|
||||
},
|
||||
(i) => {
|
||||
common_vendor.index.saveImageToPhotosAlbum({
|
||||
@@ -48,7 +56,7 @@ const _sfc_main = {
|
||||
},
|
||||
(e) => {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("log", "at pages/invite_friends/invite_friends.vue:74", "图片保存失败", e);
|
||||
common_vendor.index.__f__("log", "at pages/invite_friends/invite_friends.vue:72", "图片保存失败", e);
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "图片保存失败"
|
||||
@@ -59,7 +67,7 @@ const _sfc_main = {
|
||||
},
|
||||
(e) => {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("log", "at pages/invite_friends/invite_friends.vue:85", "图片保存失败", e);
|
||||
common_vendor.index.__f__("log", "at pages/invite_friends/invite_friends.vue:83", "图片保存失败", e);
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "图片保存失败"
|
||||
@@ -83,7 +91,8 @@ if (!Math) {
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
src: "/static/invite/bg.png",
|
||||
loading: $data.imageLoading,
|
||||
src: $data.inviteImage,
|
||||
width: "100%",
|
||||
height: "460",
|
||||
bgColor: "#f1f6ff00",
|
||||
|
||||
Reference in New Issue
Block a user