123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- "use strict";
- const common_vendor = require("../../../common/vendor.js");
- const _sfc_main = {
- data() {
- return {
- ismore: false,
- msg: ""
- };
- },
- methods: {
- //获取高度方法
- getElementHeight() {
- const query = common_vendor.index.createSelectorQuery().in(this);
- query.select(".submit").boundingClientRect((data) => {
- this.$emit("heights", data.height);
- }).exec();
- },
- //文字发送
- inputs() {
- if (this.msg.length > 0) {
- let msg = this.msg.replace(/[\r\n]/g, "");
- this.send(msg, "0");
- }
- },
- // 输入框聚焦
- focus() {
- this.ismore = false;
- setTimeout(() => {
- this.getElementHeight();
- }, 10);
- },
- //更多功能
- more() {
- this.ismore = !this.ismore;
- setTimeout(() => {
- this.getElementHeight();
- }, 10);
- },
- //图片发送
- sendImg(e) {
- const that = this;
- let serverUrl = that.$config.serverFile;
- that.$emit("choseImg", true);
- common_vendor.index.chooseImage({
- count: 1,
- sizeType: ["original", "compressed"],
- sourceType: ["album", "camera"],
- success: async function(res) {
- that.$emit("choseImg", true);
- let tempFile = JSON.parse(JSON.stringify(res.tempFilePaths));
- const arr = await that.$apifile(`/travel/applet/upload`, "file", tempFile[0], "file");
- if (arr.errcode == "0") {
- let filePaths = serverUrl + arr.uri;
- that.send(filePaths, "1");
- } else {
- that.$emit("choseImg", false);
- common_vendor.index.showToast({
- title: arr.errmsg,
- icon: "none"
- });
- }
- }
- });
- },
- //发送
- send(msg, type) {
- let data = {
- message: msg,
- type
- };
- this.$emit("inputs", data);
- setTimeout(() => {
- this.msg = "";
- }, 0);
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: common_vendor.o((...args) => $options.focus && $options.focus(...args)),
- b: $data.msg,
- c: common_vendor.o(($event) => $data.msg = $event.detail.value),
- d: common_vendor.o((...args) => $options.more && $options.more(...args)),
- e: $data.msg
- }, $data.msg ? {
- f: common_vendor.o((...args) => $options.inputs && $options.inputs(...args))
- } : {}, {
- g: common_vendor.o(($event) => $options.sendImg("album")),
- h: !$data.ismore ? 1 : ""
- });
- }
- const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cccf71ac"], ["__file", "D:/project/赋强公证/notarization_applet/pagesHome/customer/common/submit_1.vue"]]);
- wx.createComponent(Component);
|