From ef37c59e055a990ce247b265b27d3fcef430a243 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期五, 15 八月 2025 10:19:18 +0800 Subject: [PATCH] first submit --- src/views/authorServices/index.vue | 293 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 293 insertions(+), 0 deletions(-) diff --git a/src/views/authorServices/index.vue b/src/views/authorServices/index.vue new file mode 100644 index 0000000..4b69d47 --- /dev/null +++ b/src/views/authorServices/index.vue @@ -0,0 +1,293 @@ +<template> + <div class="minWidth"> + <el-carousel :height="screenheight + 'px'" v-loading="bannerLoading"> + <template v-if="!bannerLoading"> + <el-carousel-item v-for="item in bannerList" :key="item.id"> + <div class="bannerBox imgBox" :style="item.caupress_link ? 'cursor: pointer' : ''"> + <img class="bannerImg" :src="item.icon" @click="bannerLink(item)" /> + </div> + </el-carousel-item> + </template> + </el-carousel> + <div class="contentBox"> + <div class="content"> + <div class="notice"> + 濡傛灉鎮ㄥ鎴戜滑鐨勫伐浣滃拰鏈嶅姟鏈変换浣曟剰瑙併�佸缓璁紝鍙~鍐欎竴浜涘唴瀹硅繘琛屽弽棣堛�備负浜嗘槸鎮ㄧ殑鍙嶉寰楀埌鍗虫椂鍥炲鍜屽鐞嗭紝璇锋偍鍔″繀瀹屾暣濉啓浠ヤ笅淇℃伅銆傝阿璋紒 + </div> + <div class="area"> + <el-form + :model="form" + ref="form" + label-position="left" + :rules="rules" + label-width="130px" + > + <el-form-item label="濮撳悕锛�" prop="name"> + <el-input + v-model="form.name" + placeholder="璇疯緭鍏ユ偍鐨勫鍚�" + ></el-input> + </el-form-item> + <el-form-item label="鐢佃瘽锛�" prop="phone"> + <el-input + v-model="form.phone" + placeholder="璇疯緭鍏ユ偍鐨勭數璇�" + ></el-input> + </el-form-item> + <el-form-item label="閭锛�" prop="email"> + <el-input + v-model="form.email" + placeholder="璇疯緭鍏ユ偍鐨勯偖绠�" + ></el-input> + </el-form-item> + <el-form-item label="鎰忚鍜屽缓璁細" prop="content"> + <el-input + type="textarea" + v-model="form.content" + :autosize="{ minRows: 5, maxRows: 15 }" + placeholder="璇疯緭鍏ユ偍鐨勬剰瑙佸拰寤鸿" + ></el-input> + </el-form-item> + <el-form-item label="鍥惧舰楠岃瘉鐮侊細" prop="imgCode"> + <div class="flex"> + <el-input + v-model="form.imgCode" + placeholder="璇疯緭鍏ュ浘褰㈤獙璇佺爜" + ></el-input> + <div class="imgCodeBox"> + <img :src="imgCode" alt="" @click="getImgCapcha" /> + </div> + </div> + </el-form-item> + <el-form-item> + <div + class="addAddressButton greenButton" + type="primary" + @click="successful()" + > + 鎻愪氦 + </div> + </el-form-item> + </el-form> + </div> + </div> + </div> + </div> +</template> +<script> +export default { + data() { + return { + form: { + name: "", + phone: "", + email: "", + content: "", + imgCode: "", + }, + rules: { + name: [ + { + required: true, + message: "濮撳悕涓哄繀濉」锛岃杈撳叆鎮ㄧ殑濮撳悕", + trigger: "blur", + }, + ], + phone: [ + { + required: true, + message: "鐢佃瘽涓哄繀濉」锛岃杈撳叆鎮ㄧ殑鐢佃瘽", + trigger: "blur", + }, + { + pattern: + /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, + message: "璇疯緭鍏ユ纭墜鏈哄彿", + trigger: "blur", + }, + ], + email: [ + { required: true, message: "璇峰~鍐欓偖绠�", trigger: "blur" }, + { + pattern: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/, + message: "閭鏍煎紡鏍¢獙澶辫触锛岃杈撳叆閭", + trigger: "blur", + }, + ], + imgCode: [ + { required: true, message: "璇峰~鍐欏浘褰㈤獙璇佺爜", trigger: "blur" }, + ], + content: [ + { required: true, message: "璇疯緭鍏ユ偍鐨勬剰瑙佸拰寤鸿", trigger: "blur" }, + ], + }, + imgCode: "", + bannerList: [], + bannerLoading: false, + screenheight: document.documentElement.clientWidth / 2.628, + }; + }, + mounted() { + window.onresize = () => { + let c = 2.628; + if (document.documentElement.clientWidth >= 1220) { + this.screenheight = document.documentElement.clientWidth / c; + } + }; + if(!this.tool.getCookie(this.config.tokenKey)){ + this.$router.push({ + path: "/login", + query: { + redirectPath: this.$route.fullPath + } + }); + } + this.getImgCapcha(); + this.getBanner(); + }, + methods: { + bannerLink(val) { + if (val.caupress_link) { + window.open(val.caupress_link); + } + }, + getBanner() { + this.bannerLoading = true; + this.MG.resource + .getItem({ + path: "caupress_banner\\caupress_authorServices", + fields: { + caupress_link: [], + }, + coverSize: { + height: 750, + }, + paging: { + start: 0, + size: 999, + }, + }) + .then((res) => { + this.bannerLoading = false; + this.bannerList = res.datas; + }); + }, + getImgCapcha() { + this.MG.identity.getImgCode().then((res) => { + this.imgCode = "data:image/png;base64," + res; + }); + }, + successful() { + // + this.$refs["form"].validate((valid) => { + if (valid) { + // 鍒ゆ柇鍥惧舰楠岃瘉鐮� + let query = { + captcha: this.form.imgCode, + }; + this.MG.identity.verificationImgCode(query).then((res) => { + if (res) { + // 鎻愪氦鐨勬暟鎹� + let submitData = { + content: this.form.content, + name: this.form.name, + email: this.form.email, + phone: this.form.phone, + }; + const data = { + topicIdOrRefCode: this.config.refCodes.Feedback, + name: "鎰忚鍙嶉", + content: JSON.stringify(submitData), + state: "Normal", + type: "worksApproval", + cmsTypeRefCode: "", + newDataListRequest: [], + }; + this.MG.ugc.newTopicMessage(data).then((res) => { + if (res) { + this.$message.success("鍙嶉鎰忚鎻愪氦鎴愬姛锛�"); + this.form.name = ""; + this.form.email = ""; + this.form.phone = ""; + this.form.content = ""; + this.form.imgCode = ""; + } + }); + } else { + this.$message.error("鍥惧舰楠岃瘉鐮佸~鍐欓敊璇紝璇峰~鍐欐纭獙璇佺爜"); + } + }); + } else { + return false; + } + }); + }, + }, +}; +</script> +<style lang="less" scoped> +.autoImg { + max-height: none; +} +.minWidth { + min-width: 1220px; +} +.bannerBox { + background: #f3f3f3; +} +.imgBox { + position: relative; + width: 100%; + height: 100%; +} +.contentBox { + margin-top: 60px; + margin-bottom: 60px; + background-color: #ffffff; + .content { + background-color: #fff; + padding: 20px 40px; + .notice { + font-size: 14px; + line-height: 50px; + background-color: #f2f7f4; + border-radius: 4px; + padding: 0 20px; + color: #666666; + } + .area { + width: 750px; + margin: 0 auto; + padding-top: 30px; + .imgCodeBox { + margin-left: 20px; + height: 40px; + width: 140px; + cursor: pointer; + img { + width: 140px; + height: 100%; + } + } + .addAddressButton { + width: 120px; + height: 38px; + border-radius: 4px; + font-size: 16px; + text-align: center; + line-height: 40px; + border: 1px solid #00873c; + color: #101d16; + cursor: pointer; + margin: 0 auto; + margin-top: 80px; + margin-bottom: 120px; + } + .greenButton { + color: #fff; + background: linear-gradient(0deg, #00873c 0%, #00aa4c 100%); + } + } + } +} +</style> -- Gitblit v1.9.1