当前位置: 首页 > news >正文

无锡seo公司网站安论坛网站建设

无锡seo公司网站,安论坛网站建设,广西网站建设,网站开发的项目内容笔记 20240710 未验证&#xff0c;现在还没有阿里云空间&#xff0c;等买个sit环境就可以验证一下。 前端 页面 <!--页面--> <el-form-item label"优惠券图片" prop"couponImg"><single-upload v-model"dataForm.couponImg"&g…

 笔记

20240710   未验证,现在还没有阿里云空间,等买个sit环境就可以验证一下。

 前端

        页面
<!--页面-->
<el-form-item label="优惠券图片" prop="couponImg"><single-upload v-model="dataForm.couponImg"></single-upload>
</el-form-item><!--vue引入-->
import SingleUpload from "@/components/upload/singleUpload";<!--vue对象里加组件-->
components: { SingleUpload },<!--保存方法,couponImg就是url路径-->
        组件
<template> <div><!-- action必选参数,上传地址,bucket的外网访问域名 --><el-uploadaction="https://vivi-gulimall.oss-cn-hangzhou.aliyuncs.com":data="dataObj"list-type="picture":multiple="false" :show-file-list="showFileList":file-list="fileList":before-upload="beforeUpload":on-remove="handleRemove":on-success="handleUploadSuccess":on-preview="handlePreview"><el-button size="small" type="primary">点击上传</el-button><div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过10MB</div></el-upload><el-dialog :visible.sync="dialogVisible"><img width="100%" :src="fileList[0].url" alt=""></el-dialog></div>
</template>
<script>import {policy} from './policy'import { getUUID } from '@/utils'export default {name: 'singleUpload',props: {value: String},computed: {imageUrl() {return this.value;},imageName() {if (this.value != null && this.value !== '') {return this.value.substr(this.value.lastIndexOf("/") + 1);} else {return null;}},fileList() {return [{name: this.imageName,url: this.imageUrl}]},showFileList: {get: function () {return this.value !== null && this.value !== ''&& this.value!==undefined;},set: function (newValue) {}}},data() {return {dataObj: {policy: '',signature: '',key: '',ossaccessKeyId: '',dir: '',host: '',// callback:'',},dialogVisible: false};},methods: {emitInput(val) {this.$emit('input', val)},handleRemove(file, fileList) {this.emitInput('');},handlePreview(file) {this.dialogVisible = true;},beforeUpload(file) {let _self = this;return new Promise((resolve, reject) => {policy().then(response => {_self.dataObj.policy = response.data.policy;_self.dataObj.signature = response.data.signature;_self.dataObj.ossaccessKeyId = response.data.accessid;_self.dataObj.key = response.data.dir + getUUID() + '_${filename}';_self.dataObj.dir = response.data.dir;_self.dataObj.host = response.data.host;console.log("上传前请求服务端签名,得到结果:", _self.dataObj)resolve(true)}).catch(err => {reject(false)})})},handleUploadSuccess(res, file) {console.log("上传成功...")this.showFileList = true;this.fileList.pop();this.fileList.push({name: file.name, url: this.dataObj.host + '/' + this.dataObj.key.replace("${filename}",file.name) });this.emitInput(this.fileList[0].url);}}}
</script>
<style></style>

http://www.yayakq.cn/news/225581/

相关文章:

  • 怎么创作自己的网站网站关键词之间
  • dw表格怎么做网站搜索网上手机商城网站建设
  • 石家庄市城乡建设学校网站wordpress 动画主题
  • 外国人学做中国菜的网站北京 网站建设 招标信息
  • 东营有做网站的公司网络服务都有哪些
  • 淄博seo网站排名优化个人建站教程
  • 网站建设策划需要涉及中文wordpress博客模板下载
  • 深圳建设工程交易服务网老网站广州安全教育平台入口登录
  • 阜阳网站建设推广html好看的网站
  • 企业国际网站建设广告公司简介范文大全
  • 黑龙江省建设教育信息网网站wordpress版本号
  • 厦门网站建设价格网络广告营销的案例
  • 怎么找外贸公司合作合肥网站seo整站优化
  • 做兼职的设计网站有哪些月牙河做网站公司
  • 西安企业门户网站建设重庆市招投标公共资源交易中心
  • 网站维护得多久加强网站建设的措施
  • 花钱也可以哪些网站可以做推广广告网站平台搭建和维护需要什么
  • weui做购物网站的案例简单三栏网站
  • 个人网站建设目的微信公众号运营助手
  • 网站用户注册怎么建长沙网站拓谋网络
  • 苏州住房建设局网站网站服务器维护需要多久
  • 网站开发需要读的书籍frontpage可以做网站吗
  • 惠州地区网站建设公司网站开发的英文文献
  • apmserv 设置网站目录广告推广怎么找客户
  • 常熟建设设银行网站公司里面有人员增减要去哪个网站做登记
  • 东莞大型网站建设哪家好网站ui设计是什么
  • 网站建设公司成都网站的页面布局
  • 免费网站推广文章培训教育网站建设
  • 湖南网站seo个人博客免费模板
  • 现在做个网站大概多少钱小程序代理加盟有哪些大品牿