Skip to content

Commit 2241ef5

Browse files
committed
fix:捏脸+体型CURD
1 parent 82751f7 commit 2241ef5

12 files changed

Lines changed: 89 additions & 65 deletions

File tree

src/bucket/body.vue

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@
4747

4848
<el-button-group class="u-action">
4949
<el-button icon="Edit" @click="edit(item.id)" :title="$t('publish.common.edit')"></el-button>
50-
<el-button
51-
v-if="item.status == 1"
52-
icon="Download"
53-
@click="handleOffline(item.id)"
54-
:title="$t('publish.common.takeOffline')"
55-
></el-button>
56-
<el-button v-else icon="Upload" @click="handleOnline(item.id)" :title="$t('publish.common.putOnline')"></el-button>
50+
<el-button icon="Delete" @click="del(item.id)" :title="$t('publish.common.delete')"></el-button>
5751
</el-button-group>
5852
</li>
5953
</ul>
@@ -80,7 +74,7 @@
8074
</template>
8175

8276
<script>
83-
import { getBodyList, bodyOnline, bodyOffline } from "@/service/publish/body.js";
77+
import { delBody, getBodyList } from "@/service/publish/body.js";
8478
import publishListSearch from "@/mixins/publishListSearch";
8579
export default {
8680
name: "pvxBody",
@@ -143,20 +137,14 @@ export default {
143137
postLink: function (id) {
144138
return "/body/" + id;
145139
},
146-
handleOnline: function (id) {
147-
bodyOnline(id).then((res) => {
148-
this.$message.success(this.$t("publish.message.onlineSucceeded"));
149-
this.loadPosts();
150-
});
151-
},
152-
handleOffline: function (id) {
153-
this.$confirm(this.$t("publish.confirm.takeOffline"), this.$t("publish.common.prompt"), {
140+
del(id) {
141+
this.$confirm(this.$t("publish.confirm.permanentDelete"), this.$t("publish.common.prompt"), {
154142
confirmButtonText: this.$t("publish.common.confirm"),
155143
cancelButtonText: this.$t("publish.common.cancel"),
156144
type: "warning",
157145
}).then(() => {
158-
bodyOffline(id).then((res) => {
159-
this.$message.success(this.$t("publish.message.offlineSucceeded"));
146+
delBody(id).then(() => {
147+
this.$message.success(this.$t("publish.message.deleteSucceeded"));
160148
this.loadPosts();
161149
});
162150
});

src/bucket/face.vue

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@
4747

4848
<el-button-group class="u-action">
4949
<el-button icon="Edit" @click="edit(item.id)" :title="$t('publish.common.edit')"></el-button>
50-
<el-button
51-
v-if="item.status == 1"
52-
icon="Download"
53-
@click="handleOffline(item.id)"
54-
:title="$t('publish.common.takeOffline')"
55-
></el-button>
56-
<el-button v-else icon="Upload" @click="handleOnline(item.id)" :title="$t('publish.common.putOnline')"></el-button>
50+
<el-button icon="Delete" @click="del(item.id)" :title="$t('publish.common.delete')"></el-button>
5751
</el-button-group>
5852
</li>
5953
</ul>
@@ -80,7 +74,7 @@
8074
</template>
8175

8276
<script>
83-
import { getFaceList, faceOnline, faceOffline, delFace } from "@/service/publish/face.js";
77+
import { getFaceList, delFace } from "@/service/publish/face.js";
8478
export default {
8579
name: "face",
8680
props: [],
@@ -141,24 +135,6 @@ export default {
141135
postLink: function (id) {
142136
return "/face/" + id;
143137
},
144-
handleOnline: function (id) {
145-
faceOnline(id).then((res) => {
146-
this.$message.success(this.$t("publish.message.onlineSucceeded"));
147-
this.loadPosts();
148-
});
149-
},
150-
handleOffline: function (id) {
151-
this.$confirm(this.$t("publish.confirm.takeOffline"), this.$t("publish.common.prompt"), {
152-
confirmButtonText: this.$t("publish.common.confirm"),
153-
cancelButtonText: this.$t("publish.common.cancel"),
154-
type: "warning",
155-
}).then(() => {
156-
faceOffline(id).then((res) => {
157-
this.$message.success(this.$t("publish.message.offlineSucceeded"));
158-
this.loadPosts();
159-
});
160-
});
161-
},
162138
del(id) {
163139
this.$confirm(this.$t("publish.confirm.permanentDelete"), this.$t("publish.common.prompt"), {
164140
confirmButtonText: this.$t("publish.common.confirm"),

src/components/publish/face_attachment.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ export default {
109109
const result = load(e.target.result);
110110
if (!result)
111111
return vm.$notify.error({
112-
title: this.$t("publish.common.error"),
113-
message: this.$t("publish.face.parseTypeFailed"),
112+
title: vm.$t("publish.common.error"),
113+
message: vm.$t("publish.face.parseTypeFailed"),
114114
});
115115
if (vm.type === "body" && result.type.startsWith("face")) {
116116
return vm.$notify.error({
117-
title: this.$t("publish.common.error"),
118-
message: this.$t("publish.face.importBodyData"),
117+
title: vm.$t("publish.common.error"),
118+
message: vm.$t("publish.face.importBodyData"),
119119
});
120120
}
121121
if (vm.type === "face" && result.type === "body") {
122122
return vm.$notify.error({
123-
title: this.$t("publish.common.error"),
124-
message: this.$t("publish.face.importFaceData"),
123+
title: vm.$t("publish.common.error"),
124+
message: vm.$t("publish.face.importFaceData"),
125125
});
126126
}
127127
object = result.data;
@@ -132,8 +132,8 @@ export default {
132132
} catch (ex) {
133133
console.log(ex);
134134
vm.$notify.error({
135-
title: this.$t("publish.common.error"),
136-
message: this.$t("publish.upload.cannotReadData"),
135+
title: vm.$t("publish.common.error"),
136+
message: vm.$t("publish.upload.cannotReadData"),
137137
});
138138
return;
139139
}
@@ -143,8 +143,8 @@ export default {
143143
setTimeout(
144144
() =>
145145
vm.$notify({
146-
title: this.$t("publish.common.success"),
147-
message: this.$t("publish.upload.readSucceeded"),
146+
title: vm.$t("publish.common.success"),
147+
message: vm.$t("publish.upload.readSucceeded"),
148148
type: "success",
149149
}),
150150
0
@@ -156,8 +156,8 @@ export default {
156156
};
157157
fr.onerror = function (e) {
158158
vm.$notify.error({
159-
title: this.$t("publish.common.error"),
160-
message: this.$t("publish.upload.readFailed"),
159+
title: vm.$t("publish.common.error"),
160+
message: vm.$t("publish.upload.readFailed"),
161161
});
162162
};
163163
fr.readAsArrayBuffer(file);

src/locale/en-US/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ export default {
10531053
acceptGiftsTip: "Allow other users to gift you mall virtual goods",
10541054
normalSubscription: "Standard Subscription",
10551055
subscriptionTip: "Receive a direct message when an author you follow or a work you subscribe to is updated.",
1056-
advancedSubscription: "Advanced Subscription",
1056+
advancedSubscription: "Timely Subscription",
10571057
subscriptionMethodTip: "Receive notifications through the selected platforms when a priority work is updated. WeChat Official Accounts are limited to 20 notifications per day.",
10581058
subscriptionMethods: { wxmp: "WeChat Official Account", feishu: "Feishu", dingtalk: "DingTalk", wecom: "WeCom" },
10591059
loverFeature: "Bond function",

src/locale/vi/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ export default {
10521052
acceptGiftsTip: "Cho phép người dùng khác tặng quà ảo cho trung tâm mua sắm của bạn",
10531053
normalSubscription: "Đăng ký thông thường",
10541054
subscriptionTip: "Nhận tin nhắn trực tiếp khi tác giả bạn theo dõi hoặc tác phẩm bạn đăng ký được cập nhật.",
1055-
advancedSubscription: "Đăng ký nâng cao",
1055+
advancedSubscription: "Đăng ký kịp thời",
10561056
subscriptionMethodTip: "Nhận thông báo qua nền tảng tương ứng khi tác phẩm ưu tiên được cập nhật. Tài khoản chính thức WeChat giới hạn 20 thông báo mỗi ngày.",
10571057
subscriptionMethods: { wxmp: "Tài khoản chính thức WeChat", feishu: "Feishu", dingtalk: "DingTalk", wecom: "WeCom" },
10581058
loverFeature: "Chức năng Duyên",

src/locale/zh-CN/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ export default {
10031003
acceptGiftsTip: "允许其他用户向你赠送商城虚拟商品",
10041004
normalSubscription: "普通订阅",
10051005
subscriptionTip: "你关注的作者或订阅的作品更新时,将收到短消息通知。",
1006-
advancedSubscription: "高级订阅",
1006+
advancedSubscription: "及时订阅",
10071007
subscriptionMethodTip: "你重点关注的作品更新时,将收到对应平台通知。微信公众号一天上限20条。",
10081008
subscriptionMethods: { wxmp: "微信公众号", feishu: "飞书", dingtalk: "钉钉", wecom: "企微" },
10091009
loverFeature: "情缘功能",

src/locale/zh-TW/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ export default {
10331033
acceptGiftsTip: "允許其他用戶贈送你商城虛擬商品",
10341034
normalSubscription: "普通訂閱",
10351035
subscriptionTip: "你關注的作者或訂閱的作品更新時,將收到短訊息通知。",
1036-
advancedSubscription: "高級訂閱",
1036+
advancedSubscription: "即時訂閱",
10371037
subscriptionMethodTip: "你重點關注的作品更新時,將收到對應平台通知。微信公眾號一天上限20則。",
10381038
subscriptionMethods: { wxmp: "微信公眾號", feishu: "飛書", dingtalk: "釘釘", wecom: "企業微信" },
10391039
loverFeature: "情緣功能",

src/post/body.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@
6666
</el-form-item>
6767

6868
<el-divider content-position="left">{{ $t("publish.form.extension") }}</el-divider>
69+
<el-form-item :label="$t('publish.form.visibility')">
70+
<el-radio-group v-model="post.status">
71+
<el-radio :value="1">{{ $t("publish.visibility.public") }}</el-radio>
72+
<el-radio :value="0">{{ $t("publish.visibility.privateShort") }}</el-radio>
73+
</el-radio-group>
74+
</el-form-item>
6975
<!-- 原创 -->
7076
<publish-original v-model="post.original"></publish-original>
7177
<el-form-item :label="$t('publish.form.firstPublished')" prop="is_fr">
@@ -174,6 +180,7 @@ export default {
174180
// 体型码
175181
code_mode: 0, // 是否是体型码
176182
code: "", // 体型码
183+
status: 1, // 1公开,0私有
177184
},
178185
179186
loading: false,

src/post/face.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@
9292
</el-form-item>
9393

9494
<el-divider content-position="left">{{ $t("publish.form.extension") }}</el-divider>
95+
<el-form-item :label="$t('publish.form.visibility')">
96+
<el-radio-group v-model="post.status">
97+
<el-radio :value="1">{{ $t("publish.visibility.public") }}</el-radio>
98+
<el-radio :value="0">{{ $t("publish.visibility.privateShort") }}</el-radio>
99+
</el-radio-group>
100+
</el-form-item>
95101
<!-- 首发 -->
96102
<el-form-item :label="$t('publish.form.firstPublished')" prop="is_fr">
97103
<el-switch
@@ -204,6 +210,7 @@ export default {
204210
// 捏脸码
205211
code_mode: 0, // 是否是捏脸码
206212
code: "", // 捏脸码
213+
status: 1, // 1公开,0私有
207214
},
208215
options: {
209216
bodyMap,

src/service/publish/body.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ export function uploadBodyFile(data) {
1616

1717
// 添加体型
1818
export function addBody(data) {
19-
return $next().post("/api/pvxbody", data);
19+
return $next().post("/api/next2/pvxbody", data);
2020
}
2121

2222
// 更新体型
2323
export function updateBody(id, data) {
24-
return $next().put(`/api/pvxbody/${id}`, data);
24+
return $next().put(`/api/next2/pvxbody/${id}`, data);
25+
}
26+
27+
// 删除体型
28+
export function delBody(id) {
29+
return $next().delete(`/api/next2/pvxbody/${id}`);
2530
}
2631

2732
// 上架

0 commit comments

Comments
 (0)