123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- "use strict";
- var common_vendor = require("../common/vendor.js");
- var api_test = require("../api/test.js");
- require("../common/request.js");
- const _sfc_main = {
- name: "Poster",
- components: {},
- props: {},
- data: function() {
- return {
- url: null
- };
- },
- mounted: function() {
- this.getTestReportImg();
- },
- methods: {
- shareImg: function() {
- wx.downloadFile({
- url: this.url,
- success: (res) => {
- wx.showShareImageMenu({
- path: res.tempFilePath
- });
- }
- });
- },
- getTestReportImg: function() {
- let that = this;
- var data = {
- reportId: this.reportId
- };
- api_test.getTestReportImg(data).then((res) => {
- that.url = res.url;
- }, (err) => {
- common_vendor.index.showToast({
- title: err.msg,
- icon: "none",
- duration: 2e3
- });
- });
- },
- downloadIamge(imgsrc, name) {
- var that = this;
- this.isDown = true;
- var downloadUrl = imgsrc;
- that.downloadFile(downloadUrl);
- },
- saveImg: function() {
- this.downloadIamge(this.url, "poster");
- },
- downloadFile(url) {
- console.log(url);
- common_vendor.index.showLoading({
- title: "\u56FE\u7247\u4FDD\u5B58\u4E2D..."
- });
- common_vendor.index.downloadFile({
- url,
- fail: function(res) {
- common_vendor.index.showModal({
- title: "\u63D0\u793A",
- content: "\u4FDD\u5B58\u5931\u8D25"
- });
- },
- success: function(res) {
- console.log(res);
- var tempFilePath = res.tempFilePath;
- common_vendor.index.saveImageToPhotosAlbum({
- filePath: tempFilePath,
- success: () => {
- common_vendor.index.showToast({
- title: "\u4FDD\u5B58\u6210\u529F",
- duration: 2e3
- });
- },
- fail: () => {
- console.log("saveImageToPhotosAlbum \u5931\u8D25");
- common_vendor.index.hideLoading();
- },
- complete: function() {
- common_vendor.index.hideLoading();
- }
- });
- }
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: _ctx.url,
- b: common_vendor.o(($event) => $options.shareImg())
- };
- }
- var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/testResultImg.vue"]]);
- wx.createPage(MiniProgramPage);
|