Skip to content

Commit

Permalink
fix: 捏脸码
Browse files Browse the repository at this point in the history
  • Loading branch information
TiAmo-code committed Jun 25, 2024
1 parent 6068856 commit 040439f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 22 deletions.
6 changes: 6 additions & 0 deletions src/assets/css/face/single.less
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@
&:hover {
cursor: pointer;
}
&.m-face-buy-btn_copy {
background: linear-gradient(266deg, rgba(255, 255, 255, 0.2) 38.61%, rgba(255, 255, 255, 0) 100%), #ff7991;
}
}
.m-face-pay {
.pr;
Expand Down Expand Up @@ -445,6 +448,9 @@
.fz(14px);
.bold;
}
.u-face__code {
display: none;
}
.u-update-time {
.fz(10px);
.bold(400);
Expand Down
11 changes: 11 additions & 0 deletions src/assets/css/face/single_phone.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
flex-direction: column;
align-items: center;
justify-content: center;
.h(auto);
padding: 14px 0;
.m-face-buy-btn {
margin: 0;
}
Expand All @@ -38,6 +40,15 @@
}
}
}
.m-face-pay .m-face-buy .u-face__code {
display: block;
background-color: #ffffff;
.w(269px);
.mt(10px);
padding: 5px 15px;
box-sizing: border-box;
.r(10px);
}
}

@media screen and (max-width: @phone) {
Expand Down
6 changes: 6 additions & 0 deletions src/assets/img/face/bxs_copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 46 additions & 22 deletions src/views/face/Single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,24 @@
<div class="u-price" v-if="post.price_type == 2">售价:{{ post.price_count }} 金箔</div>
<div class="u-buy"><img :src="require('@/assets/img/face/shopcart.svg')" alt="" />购买</div>
</div>
<div class="m-face-buy-btn" v-else @click="downloadAll">
<div class="u-buy"><img :src="require('@/assets/img/face/download.svg')" alt="" />下载数据</div>
<div
class="m-face-buy-btn"
v-else
@click="downloadAll"
:class="{
'm-face-buy-btn_copy': post.code_mode,
}"
>
<div class="u-buy" v-if="post.code_mode">
<img :src="require('@/assets/img/face/bxs_copy.svg')" alt="" />复制捏脸码
</div>
<div class="u-buy" v-else>
<img :src="require('@/assets/img/face/download.svg')" alt="" />下载数据
</div>
</div>
<div class="u-face__code" v-if="post.code_mode">
{{ post.code }}
</div>

<div class="u-update-time">更新时间: {{ post.updated_at }}</div>
<img class="u-box-img" :src="require('@/assets/img/face/face_stroke.svg')" />
</div>
Expand Down Expand Up @@ -460,26 +474,36 @@ export default {
}
},
downloadAll() {
if (this.downFileList.length === 1) {
const item = this.downFileList[0];
this.getDownUrl(item.uuid, item.name);
return;
}
const urlArr = [];
this.downFileList.forEach((item) => {
urlArr.push(getDownUrl(this.id, item.uuid));
});
let p = Promise.all(urlArr);
let downloadFiles = [];
p.then((arr) => {
downloadFiles = arr.map((item, index) => {
return {
name: this.downFileList[index].name,
url: item.data.data?.url,
};
if (this.post.code_mode) {
navigator.clipboard.writeText(this.post.code).then(() => {
this.$notify({
title: "复制成功",
message: "内容:" + this.post.code,
type: "success",
});
});
downloadZip(downloadFiles, `face_${this.id}.zip`, "url", "name");
});
} else {
if (this.downFileList.length === 1) {
const item = this.downFileList[0];
this.getDownUrl(item.uuid, item.name);
return;
}
const urlArr = [];
this.downFileList.forEach((item) => {
urlArr.push(getDownUrl(this.id, item.uuid));
});
let p = Promise.all(urlArr);
let downloadFiles = [];
p.then((arr) => {
downloadFiles = arr.map((item, index) => {
return {
name: this.downFileList[index].name,
url: item.data.data?.url,
};
});
downloadZip(downloadFiles, `face_${this.id}.zip`, "url", "name");
});
}
},
facePay() {
if (!User.isLogin()) {
Expand Down

0 comments on commit 040439f

Please sign in to comment.