code review:商品评论

(cherry picked from commit 84c5eb9942)
This commit is contained in:
YunaiV 2023-08-26 11:19:29 +08:00 committed by shizhong
parent e97a62fe06
commit 0e36aea9ff
5 changed files with 8 additions and 1 deletions

View File

@ -36,6 +36,7 @@
<el-form-item label="评论内容" prop="content">
<el-input type="textarea" v-model="formData.content" />
</el-form-item>
<!-- TODO @疯狂formData.scores 是通过后端计算的哈不要前端传递 -->
<el-form-item label="评分星级" prop="scores">
<el-rate v-model="formData.scores" />
</el-form-item>

View File

@ -37,6 +37,7 @@ import { ElTable } from 'element-plus'
import * as ProductSpuApi from '@/api/mall/product/spu'
import { propTypes } from '@/utils/propTypes'
// TODO @ spu components
defineOptions({ name: 'SkuTableSelect' })
const props = defineProps({

View File

@ -86,6 +86,7 @@ import { defaultProps, handleTree } from '@/utils/tree'
import * as ProductCategoryApi from '@/api/mall/product/category'
import * as ProductSpuApi from '@/api/mall/product/spu'
// TODO @ spu components
defineOptions({ name: 'SpuTableSelect' })
const message = useMessage() //

View File

@ -60,6 +60,7 @@
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="false">
<el-table-column label="评论编号" align="center" prop="id" min-width="60" />
<!-- TODO @疯狂后端貌似没读取 -->
<el-table-column label="用户名称" align="center" prop="userNickname" width="80" />
<el-table-column label="商品信息" align="center" min-width="210">
<template #default="scope">
@ -210,7 +211,7 @@ const getList = async () => {
loading.value = true
try {
const data = await CommentApi.getCommentPage(queryParams)
// visible nulle-switchchange
// visible null e-switch change
data.list.forEach((item) => {
if (!item.visible) {
item.visible = false
@ -241,6 +242,7 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
// TODO @
/** 回复 **/
const replyFormRef = ref()
const replyDialog = reactive({

View File

@ -44,6 +44,8 @@ import { BasicInfoForm, DescriptionForm, OtherSettingsForm } from './components'
import * as ProductSpuApi from '@/api/mall/product/spu'
import { convertToInteger, floatToFixed2, formatToFraction } from '@/utils'
// TODO @
defineOptions({ name: 'ProductSpuForm' })
const { t } = useI18n() //