feat: 对接真实数据并移除前端假数据
本次提交完成多模块真实数据对接,移除前端硬编码假数据: - 新增后端接口:区域列表、未读消息数、详情页评价列表、最低提现金额 - 前端对应修改:移除首页/列表/详情页硬编码区域选项、未读消息数、评价内容,分销页最低提现金额 - 修复登录页微信授权不伪造code、营业执照不伪造文件名,避免绕过校验 - 新增集成测试用例,验证真实数据对接正确性
这个提交包含在:
@@ -239,10 +239,13 @@ export default {
|
||||
try {
|
||||
const res = await postApi.detail(this.id)
|
||||
this.post = res
|
||||
this.comments = [
|
||||
{ id: 5001, user: '小王同学', score: 5, content: '联系很及时,沟通顺畅。', reply: '' },
|
||||
{ id: 5002, user: '果果', score: 4, content: '信息真实,价格合理。', reply: '感谢支持~' },
|
||||
]
|
||||
// 用户评价:来自后端 /post/:id/comments(原先写死两条假评价)
|
||||
try {
|
||||
const cs = await postApi.comments(this.id)
|
||||
this.comments = Array.isArray(cs) ? cs : []
|
||||
} catch (e) {
|
||||
this.comments = []
|
||||
}
|
||||
this.contact = { phone: maskPhone(res.contact), wechat: '' }
|
||||
// 契约:详情出参已带 faved/followed,先用返回值回显;
|
||||
// 兼容旧后端:缺失时再用 /favorite/status 批量回显。
|
||||
@@ -327,8 +330,12 @@ export default {
|
||||
}
|
||||
try {
|
||||
await postApi.comment(this.id, { score: this.score, content: this.commentText })
|
||||
this.comments.unshift({ id: Date.now(), user: '我', score: this.score, content: this.commentText, reply: '' })
|
||||
this.commentText = ''
|
||||
// 重新拉取评价列表,确保展示后台真实数据(含昵称)
|
||||
try {
|
||||
const cs = await postApi.comments(this.id)
|
||||
this.comments = Array.isArray(cs) ? cs : this.comments
|
||||
} catch (e) {}
|
||||
this.showComment = false
|
||||
uni.showToast({ title: '评价成功', icon: 'none' })
|
||||
} catch (e) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户