"use strict"; var common_vendor = require("../../../common/vendor.js"); var api_healthTongue = require("../../../api/healthTongue.js"); require("../../../common/request.js"); const _sfc_main = { data() { return { baseUrl: common_vendor.index.getStorageSync("requestPath"), cameraHeight: "", optionsHeight: "", counts: 0, url: null }; }, onLoad() { this.getCount(); }, methods: { switchCamera() { this.$emit("switchCamera"); }, getCount() { api_healthTongue.getCount().then((res) => { if (res.code == 200) { this.counts = res.data; } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }, (rej) => { }); }, takePhoto() { const ctx = wx.createCameraContext(); console.log("ctx", ctx); ctx.takePhoto({ quality: "high", success: (res) => { common_vendor.index.setStorageSync("tongueUrl", res.tempImagePath); console.log("res", res.tempImagePath); this.$emit("takePhoto"); } }); }, handleClikFn(instruct) { this.$emit("instruct", instruct); } }, mounted() { const query = common_vendor.index.createSelectorQuery().in(this); query.select("#camera-footer").boundingClientRect((data) => { this.cameraHeight = common_vendor.index.getSystemInfoSync().screenHeight - data.height; }).exec(); } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return { a: $data.cameraHeight + "px", b: common_vendor.t($data.counts || 0), c: $data.baseUrl + "/images/album_icon.png", d: common_vendor.o(($event) => $options.handleClikFn("album")), e: common_vendor.o(($event) => $options.takePhoto()), f: $data.baseUrl + "/images/tongue_info.png", g: common_vendor.o(($event) => $options.handleClikFn("reportlist")), h: common_vendor.o(($event) => $options.switchCamera()) }; } var Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0404ee55"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/components/CustomCamera/WeChat/Layout.vue"]]); wx.createComponent(Component);