diff --git a/src/assets/images/workshop/creation-details.png b/src/assets/images/workshop/creation-details.png new file mode 100644 index 0000000..629d7d5 Binary files /dev/null and b/src/assets/images/workshop/creation-details.png differ diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 066911f..769c4aa 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -45,4 +45,51 @@ const getMousePosition = (e:any,bor:any) => { export { getUniversalZoomLevel, getMousePosition, -} \ No newline at end of file +} + + +/** + * 下载图片 + * @param list 图片列表 + * @param onProgress 下载进度回调 + * @param onError 下载错误回调 + * @param onSuccess 下载成功回调 +*/ +export async function DownloadImages(list:Array<{url:string,name:string}>, onProgress?:(count:number,total:number,item:any)=>void, onError?:(count:number,total:number,item:any)=>void, onSuccess?:(successCount:number,errCount:number)=>void) { + const total = list.length; + var count = 0; + var successCount = 0; + var errCount = 0; + for (let i = 0; i < list.length; i++) { + await new Promise((resolve) => { + let xhr = new XMLHttpRequest(); + xhr.open("GET", list[i].url); + xhr.responseType = "blob" + xhr.onload = function () { + count++; + if (this.status === 200) { + let blob = this.response; + const a = document.createElement('a'); + a.href = URL.createObjectURL(blob); + a.download = list[i].name || list[i].url; + a.click(); + successCount++; + typeof onProgress === "function" && onProgress(count,total,list[i]); + resolve(blob); + } else { + errCount++; + typeof onError === "function" && onError(count,total,list[i]); + resolve(true); + } + }; + xhr.onerror = function () { + count++; + errCount++; + typeof onError === "function" && onError(count,total,list[i]); + resolve(true); + }; + xhr.send(); + }) + } + typeof onSuccess === "function" && onSuccess(successCount,errCount); +} diff --git a/src/views/Workshop/creation/creation-details.vue b/src/views/Workshop/creation/creation-details.vue index 81f6b42..bf0f453 100644 --- a/src/views/Workshop/creation/creation-details.vue +++ b/src/views/Workshop/creation/creation-details.vue @@ -1,15 +1,32 @@ @@ -17,12 +34,73 @@ .creation-details { width: 100%; flex: 1; - overflow: hidden; - background-color: #e3e3e3; + overflow-y: auto; + background-color: #f3f3f3; border-radius: 1rem; - position: relative; color: #000; display: flex; flex-direction: column; + padding: 0 16.3rem; + display: flex; + flex-direction: column; + align-items: center; + > .title { + font-family: satoshiBold; + font-size: 9.6rem; + line-height: 124%; + margin-top: 12rem; + } + > .tip { + margin-top: 2rem; + font-family: satoshiRegular; + font-size: 4rem; + line-height: 124%; + color: rgba(0, 0, 0, 0.6); + } + > .image { + margin-top: 13.7rem; + width: 100%; + height: 73.5rem; + border: 0.1rem solid #acacac; + background-color: #fff; + > img { + width: 100%; + height: 100%; + object-fit: contain; + } + } + > .btns { + margin-top: 4.4rem; + margin-left: auto; + display: flex; + align-items: center; + > * { + margin-left: 1.7rem; + } + > .icon { + width: 7rem; + height: 7rem; + border-radius: 50%; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + } + > button { + box-sizing: content-box; + font-family: satoshiBold; + // margin: 0 1.8rem; + border: none; + width: 14.6rem; + height: 7rem; + border-radius: 7rem; + background: #000; + font-size: 2.75rem; + color: #fff; + &:active { + opacity: 0.7; + } + } + } } diff --git a/src/views/Workshop/creation/creation-list.vue b/src/views/Workshop/creation/creation-list.vue index 8b4004e..dd9abde 100644 --- a/src/views/Workshop/creation/creation-list.vue +++ b/src/views/Workshop/creation/creation-list.vue @@ -1,55 +1,121 @@ @@ -102,8 +182,10 @@ flex: 1; margin: 0 3.8rem; overflow: hidden; + --border-radius: 2rem; > .my-list { padding: 0 6rem; + --my-list-footer-margin: 0 0 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; @@ -111,8 +193,8 @@ .item { width: 47%; height: 52.9rem; - overflow: hidden; - border-radius: 2rem; + // overflow: hidden; + border-radius: var(--border-radius); background-color: #fff; margin-bottom: 4rem; border: 0.1rem solid #000; @@ -135,6 +217,7 @@ font-family: satoshiBold; font-size: 1.6rem; border-bottom-left-radius: 1.6rem; + border-top-right-radius: var(--border-radius); background-color: #000; color: #fff; @@ -173,6 +256,27 @@ justify-content: center; } } + > .icon-selected { + position: absolute; + bottom: -2rem; + right: -2rem; + width: 5rem; + height: 5rem; + } + > .download-state { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(0, 0, 0, 0.5); + border-radius: var(--border-radius); + color: #fff; + font-size: 4rem; + } } } } @@ -187,6 +291,7 @@ width: 35rem; height: 8rem; border-radius: 1.3rem; + border: none; background: #000; font-weight: 400; font-size: 4.2rem; diff --git a/src/views/Workshop/creation/index.vue b/src/views/Workshop/creation/index.vue index 0d77b92..7cdd2e3 100644 --- a/src/views/Workshop/creation/index.vue +++ b/src/views/Workshop/creation/index.vue @@ -22,7 +22,7 @@ diff --git a/src/views/Workshop/customize.vue b/src/views/Workshop/customize.vue index 48b5de1..270c83a 100644 --- a/src/views/Workshop/customize.vue +++ b/src/views/Workshop/customize.vue @@ -1,14 +1,18 @@