|
|
@@ -111,12 +111,36 @@
|
|
|
if (res.status == 1) {
|
|
|
this.workName = res.data.name || "";
|
|
|
this.content = res.data.description || "";
|
|
|
- this.workImages = res.data.images || [];
|
|
|
+ this.setWorkImages(res.data);
|
|
|
this.workUrl = res.data.url || ""
|
|
|
}
|
|
|
});
|
|
|
// this.content = "123";
|
|
|
},
|
|
|
+
|
|
|
+ setWorkImages(data) {
|
|
|
+ let images = data.images;
|
|
|
+ if (images && images.length > 0) {
|
|
|
+ images.forEach((image, index) => {
|
|
|
+ let imageName = this.getImageName(image.url);
|
|
|
+ console.log("imageName", imageName);
|
|
|
+ this.workImages.push({name: imageName + index, url: image.url});
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(this.workImages);
|
|
|
+ },
|
|
|
+ getImageName(imageName) {
|
|
|
+ if (imageName) {
|
|
|
+ try {
|
|
|
+ const lastquotaIndex = imageName.lastIndexOf("/");
|
|
|
+ const lastDotIndex = imageName.lastIndexOf('.');
|
|
|
+ return imageName.substring(lastquotaIndex + 1, lastDotIndex);
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ },
|
|
|
getHejiList() {
|
|
|
this.$axios.post("/api/jishuquan/get_collections", {uid: this.$store.state.userinfo.uid, page: 1, size: 200}).then(res => {
|
|
|
if (res.data.status === 1) {
|