"use strict"; const common_vendor = require("../../../common/vendor.js"); const utils_msgtype = require("../../../utils/msgtype.js"); const components_public_Mixins = require("../../../components/public/Mixins.js"); if (!Array) { const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons"); const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput"); const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup"); (_easycom_uni_icons2 + _easycom_uni_easyinput2 + _easycom_uni_popup2)(); } const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js"; const _easycom_uni_easyinput = () => "../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js"; const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"; if (!Math) { (_easycom_uni_icons + _easycom_uni_easyinput + common_vendor.unref(JyCommodityInformation) + _easycom_uni_popup + JyRedPopup)(); } const JyRedPopup = () => "./components/red-envelope/popup.js"; const JyCommodityInformation = () => "../../../components/public/jy-commodity-information/index.js"; const _sfc_main = { __name: "jy-plus", emits: ["plusClick"], setup(__props, { emit: __emit }) { const emit = __emit; const popupRef = common_vendor.ref(null); const popupRE = common_vendor.ref(null); const { checkLink } = common_vendor.inject("util"); common_vendor.reactive({ name: "" }); common_vendor.reactive({ show: false, title: "选择订单" }); const plusList = [{ type: "order.png", label: "订单", value: "chooseOrder" }, { type: "shop.png", label: "商品", value: "chooseShop" }, { type: "picture.png", label: "照片", value: "chooseImage" }, { type: "photograph.png", label: "拍摄", value: "takePhoto" }, { type: "red-envelope.png", label: "红包", value: "redEnvelope" }, { type: "news-voice.png", label: "音视频", value: "voice" }]; const plusClickObj = { voice: () => { common_vendor.index.showActionSheet({ itemList: ["语音通话", "视频通话"], success: (rs) => { switch (rs.tapIndex) { case 0: checkLink(`pages/news/audio-video/audio?type=audio`); break; case 1: checkLink(`pages/news/audio-video/video?type=video`); break; } } }); }, // 选择订单 chooseOrder: () => { common_vendor.nextTick$1().then(() => { popupRef.value.open(); }); }, // 选择商品 chooseShop: () => { checkLink("pages/mine/browsed/index"); }, redEnvelope() { popupRE.value.open(); }, // 上传 upload: (tempFilePath) => { let token = common_vendor.index.getStorageSync("WebIMAccessToken"); let str = common_vendor.index.WebIM.config.appkey.split("#"); console.log(str); common_vendor.index.uploadFile({ url: "https://a1.easemob.com/" + str[0] + "/" + str[1] + "/chatfiles", filePath: tempFilePath, fileType: "image", name: "file", header: { // "Content-Type": "multipart/form-data", "Content-Type": "application/x-www-form-urlencoded", Authorization: "Bearer " + token }, success: (res) => { const data = JSON.parse(res.data); console.log("2434", data); let obj = { content: data.uri + "/" + data.entities[0].uuid, type: utils_msgtype.msgType.IMAGE, time: data.timestamp }; emit("plusClick", obj); } }); }, // 压缩图片 ys(tempFilePath) { }, //拍照 takePhoto: () => { common_vendor.index.chooseImage({ sourceType: ["camera"], success: (res) => { plusClickObj.ys(res.tempFilePaths[0]); } }); }, //选择图片 chooseImage: () => { common_vendor.index.chooseImage({ sourceType: ["album"], success: (res) => { res.tempFiles.forEach((content) => { plusClickObj.ys(content.path); }); } }); } }; const consult = (content) => { let obj = { content, type: "order" }; emit("plusClick", obj); popupRef.value.close(); }; return (_ctx, _cache) => { return { a: common_vendor.f(plusList, (item, index, i0) => { return { a: `/static/new-${item.type}`, b: common_vendor.t(item.label), c: index, d: common_vendor.o$1(plusClickObj[item.value], index) }; }), b: common_vendor.o$1(($event) => popupRef.value.close()), c: common_vendor.p({ type: "search", size: "20" }), d: common_vendor.p({ placeholder: "搜索你要查询的订单" }), e: common_vendor.f(2, (item, index, i0) => { return { a: "1db42d85-3-" + i0 + ",1db42d85-0" }; }), f: common_vendor.o$1(consult), g: common_vendor.p({ showType: 4 }), h: `${common_vendor.unref(components_public_Mixins.screenHeight)(true) * 0.7}px`, i: common_vendor.sr(popupRef, "1db42d85-0", { "k": "popupRef" }), j: common_vendor.p({ type: "bottom" }), k: common_vendor.sr(popupRE, "1db42d85-4", { "k": "popupRE" }) }; }; } }; const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1db42d85"]]); wx.createComponent(Component);