增加新模块
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
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);
|
||||
// },
|
||||
saveHeadImgFile(base64Data) {
|
||||
if (!base64Data) {
|
||||
return;
|
||||
}
|
||||
const fsm = common_vendor.index.getFileSystemManager();
|
||||
const filePath = `${common_vendor.index.env.USER_DATA_PATH}/your-image-name.png`;
|
||||
fsm.writeFile({
|
||||
filePath,
|
||||
data: base64Data.split(",")[1],
|
||||
// 去掉base64的头部信息
|
||||
encoding: "base64",
|
||||
success: function(res) {
|
||||
common_vendor.index.saveImageToPhotosAlbum({
|
||||
filePath,
|
||||
success: function() {
|
||||
common_vendor.index.showToast({
|
||||
title: "图片保存到相册成功",
|
||||
icon: "success"
|
||||
});
|
||||
},
|
||||
fail: function(err) {
|
||||
common_vendor.index.showToast({
|
||||
title: "图片保存失败",
|
||||
icon: "error"
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(err) {
|
||||
common_vendor.index.showToast({
|
||||
title: "图片保存失败",
|
||||
icon: "error"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
|
||||
_easycom_up_image2();
|
||||
}
|
||||
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
|
||||
if (!Math) {
|
||||
_easycom_up_image();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
src: "/static/invite/bg.png",
|
||||
width: "60",
|
||||
height: "60",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
b: common_vendor.o(($event) => $options.saveHeadImgFile(null))
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2c3d3045"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/invite_friends/invite_friends.js.map
|
||||
Reference in New Issue
Block a user