| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- "use strict";
- const common_vendor = require("../../../common/vendor.js");
- const ErpNavBar = () => "../../../components/erp-nav-bar.js";
- const _sfc_main = {
- components: { ErpNavBar },
- data() {
- return {
- types: [
- { label: "系统投诉", value: "complaint" },
- { label: "改进建议", value: "suggestion" },
- { label: "其他反馈", value: "other" }
- ],
- formData: {
- type: "complaint",
- content: "",
- images: []
- }
- };
- },
- computed: {
- isFormValid() {
- return this.formData.content && this.formData.content.trim().length >= 5;
- }
- },
- methods: {
- goBack() {
- common_vendor.index.navigateBack();
- },
- chooseImage() {
- const count = 6 - this.formData.images.length;
- common_vendor.index.chooseImage({
- count,
- sizeType: ["compressed"],
- success: (res) => {
- this.formData.images = [...this.formData.images, ...res.tempFilePaths];
- }
- });
- },
- removeImage(index) {
- this.formData.images.splice(index, 1);
- },
- previewImage(index) {
- common_vendor.index.previewImage({
- urls: this.formData.images,
- current: index
- });
- },
- handleSubmit() {
- common_vendor.index.showLoading({ title: "提交中" });
- setTimeout(() => {
- common_vendor.index.hideLoading();
- common_vendor.index.showToast({ title: "反馈成功" });
- setTimeout(() => {
- common_vendor.index.navigateBack();
- }, 1500);
- }, 1e3);
- }
- }
- };
- if (!Array) {
- const _component_erp_nav_bar = common_vendor.resolveComponent("erp-nav-bar");
- _component_erp_nav_bar();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: common_vendor.p({
- title: "投诉与建议"
- }),
- b: common_vendor.f($data.types, (item, k0, i0) => {
- return {
- a: common_vendor.t(item.label),
- b: item.value,
- c: $data.formData.type === item.value ? 1 : "",
- d: common_vendor.o(($event) => $data.formData.type = item.value, item.value)
- };
- }),
- c: $data.formData.content,
- d: common_vendor.o(($event) => $data.formData.content = $event.detail.value, "dd"),
- e: common_vendor.t($data.formData.content.length),
- f: common_vendor.f($data.formData.images, (img, index, i0) => {
- return {
- a: img,
- b: common_vendor.o(($event) => $options.previewImage(index), index),
- c: common_vendor.o(($event) => $options.removeImage(index), index),
- d: index
- };
- }),
- g: $data.formData.images.length < 6
- }, $data.formData.images.length < 6 ? {
- h: common_vendor.o((...args) => $options.chooseImage && $options.chooseImage(...args), "94")
- } : {}, {
- i: !$options.isFormValid,
- j: common_vendor.o((...args) => $options.handleSubmit && $options.handleSubmit(...args), "eb")
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6497fc4f"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/mine/complaint/index.js.map
|