完成80%
This commit is contained in:
@@ -14,7 +14,10 @@
|
||||
</view>
|
||||
<view class="publish-field">
|
||||
<text class="publish-field__label">动态类型</text>
|
||||
<input v-model="form.feedType" placeholder="留空时服务端默认为 text" placeholder-class="publish-placeholder" @input="submitError = ''" />
|
||||
<view class="publish-field__value publish-field__value--readonly">
|
||||
<text>文字动态</text>
|
||||
<text>当前仅支持此类型</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="publish-field publish-field--media">
|
||||
<view>
|
||||
@@ -65,7 +68,7 @@ import { isImagePickCancelled, pickAndUploadImage } from "@/utils/resumable-imag
|
||||
import { goBack, handleBackPress, returnTo, runBackGuard } from "@/utils/navigation.js";
|
||||
|
||||
const genealogyId = ref("");
|
||||
const form = reactive({ feedContent: "", feedType: "", sortOrder: "" });
|
||||
const form = reactive({ feedContent: "", feedType: "text", sortOrder: "" });
|
||||
const mediaReceipts = ref([]);
|
||||
const publishState = ref("form");
|
||||
const isSubmitting = ref(false);
|
||||
@@ -76,7 +79,7 @@ const discardVisible = ref(false);
|
||||
const requestController = createRequestController();
|
||||
const mediaOssIds = computed(() => mediaReceipts.value.map((item) => item.ossId).join(","));
|
||||
const isDirty = computed(() => Boolean(
|
||||
form.feedContent.trim() || form.feedType.trim() || form.sortOrder.trim() || mediaReceipts.value.length,
|
||||
form.feedContent.trim() || form.sortOrder.trim() || mediaReceipts.value.length,
|
||||
));
|
||||
const hasValidContext = computed(() => /^[1-9]\d*$/.test(genealogyId.value));
|
||||
const resultCopy = computed(() => ({
|
||||
@@ -139,7 +142,7 @@ const submit = async () => {
|
||||
mediaOssIds: mediaOssIds.value,
|
||||
sortOrder: form.sortOrder,
|
||||
}, { requestController });
|
||||
Object.assign(form, { feedContent: "", feedType: "", sortOrder: "" });
|
||||
Object.assign(form, { feedContent: "", feedType: "text", sortOrder: "" });
|
||||
mediaReceipts.value = [];
|
||||
publishState.value = "success";
|
||||
} catch (error) {
|
||||
@@ -191,10 +194,13 @@ onUnmounted(() => {
|
||||
.required-mark { display: inline-block; margin-right: 4rpx; color: $brand-red; font-size: 26rpx; line-height: 1; transform: translateY(-3rpx); }
|
||||
.publish-field input, .publish-field textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 12rpx; color: $ink; font-size: 24rpx; }
|
||||
.publish-field input { min-height: 64rpx; }
|
||||
.publish-field__value--readonly { display:flex; min-height:76rpx; align-items:center; justify-content:space-between; margin-top:12rpx; padding:0 20rpx; border:1rpx solid rgba(128,89,49,.22); border-radius:10rpx; background:rgba(255,252,245,.48); }
|
||||
.publish-field__value--readonly text:first-child { color:$ink; font-size:24rpx; }
|
||||
.publish-field__value--readonly text:last-child { color:$ink-muted; font-size:20rpx; }
|
||||
.publish-field--content textarea { min-height: 200rpx; line-height: 1.7; }
|
||||
.publish-field--media { display: grid; gap: 12rpx; }
|
||||
.publish-field__hint { display: block; margin-top: 6rpx; color: $ink-muted; font-size: 20rpx; line-height: 1.45; }
|
||||
.upload-button { justify-self: start; min-height: 60rpx; margin: 0; padding: 0 20rpx; border: 1rpx solid rgba(159, 23, 15, .42); border-radius: 8rpx; background: transparent; color: $brand-red; font-size: 22rpx; }
|
||||
.upload-button { justify-self: start; min-height: 88rpx; margin: 0; padding: 0 20rpx; border: 1rpx solid rgba(159, 23, 15, .42); border-radius: 8rpx; background: transparent; color: $brand-red; font-size: 22rpx; }
|
||||
.upload-receipt { color: $ink-muted; font-size: 21rpx; overflow-wrap: anywhere; }
|
||||
.publish-placeholder { color: #8e806e; }
|
||||
.publish-error { margin-top: 12rpx; color: $brand-red; font-size: 22rpx; line-height: 1.5; }
|
||||
|
||||
Reference in New Issue
Block a user