Commit ab092009 authored by 徐一鸣's avatar 徐一鸣

应用构建接口调试

parent d90cb6d6
......@@ -499,6 +499,7 @@ width: 620px!important;
/* 应用超市详情页公共样式 */
.sevice_detail {
max-width: 1200px;
padding-top: 1px;
margin: 0 auto;
}
......@@ -535,6 +536,11 @@ width: 620px!important;
background-color: #e1e4fb;
border-color: #e1e4fb;
}
.apass_button .el-button.is-disabled,
.apass_button .el-button.is-disabled:focus,
.apass_button .el-button.is-disabled:hover {
cursor: not-allowed;
}
.apass_table .el-table th > .cell {
color: #1a2236;
}
......
<template>
<div class="apass_table">
<el-table :data="data">
<el-table-column :width="paddingLeft - 10"></el-table-column>
<el-table-column :width="Math.max(paddingLeft - 10, 0)"></el-table-column>
<el-table-column
v-for="(item, index) in header"
:label="item.label"
......
......@@ -7,7 +7,7 @@
id="uploads"
class="up_input"
accept="image/png, image/jpeg, image/gif, image/jpg"
@change="uploadImg($event,1)"
@change="uploadImg($event, 1)"
/>
</div>
<!-- 弹出层-裁剪 -->
......@@ -41,8 +41,12 @@
</div>
</div>
<el-row class="footerBtn" align="center">
<el-button type="primary" size="small" round @click="cut('blob')">确认</el-button>
<el-button type="primary" size="small" round @click="handleClose">取消</el-button>
<el-button type="primary" size="small" round @click="cut('blob')"
>确认</el-button
>
<el-button type="primary" size="small" round @click="handleClose"
>取消</el-button
>
</el-row>
</div>
</el-dialog>
......@@ -53,7 +57,7 @@
import { VueCropper } from "vue-cropper";
export default {
components: {
VueCropper
VueCropper,
},
data() {
return {
......@@ -64,7 +68,7 @@ export default {
canMoveBox: true, //截图框不能拖动
autoCropWidth: 200, //截图框宽度
autoCropHeight: 200, //截图框高度
centerBox: false //截图框被限制在图片里面
centerBox: false, //截图框被限制在图片里面
},
previews: {}, //实时预览图数据
attach: {
......@@ -72,10 +76,10 @@ export default {
userId: "",
customaryUrl: "", //原图片路径
laterUrl: "", //裁剪后图片路径
attachType: "photo" //附件类型
attachType: "photo", //附件类型
},
fileName: "", //本机文件地址
uploadImgRelaPath: "" //上传后图片地址
uploadImgRelaPath: "", //上传后图片地址
};
},
methods: {
......@@ -90,7 +94,7 @@ export default {
//加载图片信息
find() {
this.userId = sessionStorage.getItem("userId");
this.$http.post("ssapi", this.attach).then(res => {
this.$http.post("ssapi", this.attach).then((res) => {
console.log(res);
});
},
......@@ -105,7 +109,7 @@ export default {
//fileReader 接口,用于异步读取文件数据
var reader = new FileReader();
reader.readAsDataURL(file); //重要 以dataURL形式读取文件
reader.onload = e => {
reader.onload = (e) => {
// data = window.URL.createObjectURL(new Blob([e.target.result])) 转化为blob格式
let data = e.target.result;
......@@ -120,25 +124,23 @@ export default {
//确认截图,上传
cut(type) {
var formData = new FormData();
this.$refs.cropper.getCropBlob(res => {
this.$refs.cropper.getCropBlob((res) => {
//res是裁剪后图片的bolb对象
formData.append("file", res, this.userId);
formData.append("directory", "image");
let url = "/awecloud/static/image/upload";
this.$http
.post(url, formData, {
contentType: false,
processData: false,
headers: { "Content-Type": "multipart/form-data" }
headers: { "Content-Type": "multipart/form-data" },
})
.then(res => {
.then((res) => {
// 上传图片后服务器返回访问路径
this.$emit("getNewUrl", res.data.data);
this.handleClose();
});
});
}
}
},
},
};
</script>
......@@ -191,4 +193,4 @@ export default {
.cropper_dia .el-dialog {
width: 860px;
}
</style>
\ No newline at end of file
</style>
......@@ -42,27 +42,19 @@ export default {
},
},
methods: {
getDataFromApi(_url) {
return new Promise((resolve, reject) => {
this.$http
.get(_url)
.then((response) => {
resolve(response.body);
})
.catch(function(error) {
reject(error);
});
});
},
init() {
this.getDataFromApi(`/static/serviceBaseInfo.json`).then(
({ sjfw }) => {
this.baseInfo = sjfw;
},
(error) => {
this.$http
.get("/apaas/serviceapp/v3/servicemarket/detail", {
params: {
serviceId: 666,
},
})
.then((response) => {
console.log(response.data);
})
.catch(function(error) {
console.log(error);
}
);
});
},
},
mounted() {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment