123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- "use strict";
- var common_vendor = require("../common/vendor.js");
- var api_user = require("../api/user.js");
- require("../common/request.js");
- const _sfc_main = {
- data() {
- return {
- baseUrl: common_vendor.index.getStorageSync("requestPath"),
- userId: null,
- imgurl: ""
- };
- },
- onLoad(options) {
- this.userId = options.userId;
- console.log(options.userId);
- this.getQRCode();
- },
- methods: {
- getQRCode() {
- api_user.getAppContactWay(this.userId).then((res) => {
- if (res.code == 200) {
- this.imgurl = res.data || "";
- } else {
- common_vendor.index.showToast({
- title: res.msg,
- icon: ""
- });
- }
- });
- },
- downImg() {
- common_vendor.index.showLoading({
- title: "\u56FE\u7247\u4FDD\u5B58\u4E2D..."
- });
- common_vendor.index.downloadFile({
- url: this.imgurl,
- fail: function(res) {
- common_vendor.index.showModal({
- title: "\u63D0\u793A",
- content: "\u4FDD\u5B58\u5931\u8D25"
- });
- common_vendor.index.hideLoading();
- },
- success: function(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("\u56FE\u7247\u5931\u8D25");
- common_vendor.index.showToast({
- title: "\u56FE\u7247\u5931\u8D25",
- duration: 2e3,
- icon: "error"
- });
- common_vendor.index.hideLoading();
- },
- complete: function() {
- common_vendor.index.hideLoading();
- }
- });
- }
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: $data.imgurl
- };
- }
- var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/addHealthButler.vue"]]);
- wx.createPage(MiniProgramPage);
|