完善未完成功能:修复关注列表/评论发布/编辑器草稿等页面
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
</view>
|
||||
|
||||
<view class="tab">
|
||||
住在大城市里,“军民鱼水情”只是句日常的用语,并没有真正切实的体会。
|
||||
住在大城市里,"军民鱼水情"只是句日常的用语,并没有真正切实的体会。
|
||||
</view>
|
||||
<image
|
||||
src="https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/static/wz1.png?expire_at=1741142112&er_sign=639352a13dd5bb04b7fa46bb8e3f5f93"
|
||||
@@ -39,18 +39,18 @@
|
||||
1952年的冬天,我团接到上级命令,前往朝鲜战场。这兴奋劲像个麻雀,跳跃不停。经过战前培训,我们坐着向北驰去的列车。一路上歌声不断,当列车到达山东济南时,站台上摆着热气腾腾的饭菜,我们狼吞虎咽地吃着可口的饭菜,这比在列车上吃饼干要好百倍了。经过一天多的劳累,在大年除夕的那天,我们到达了安东。快速转移到一个街坊后,多数人都安排好了住所,可我们班还剩六名战士没法安排,连长还在为难。
|
||||
</view>
|
||||
<view class="tab">
|
||||
这时,一一间小屋走出了一对年轻夫妇,他们说:“志愿军同志,不要在外面过夜,零下三十度是冻不起的。我俩今晚到她娘家去,腾出这间屋,给志愿军战士住。”这是一对当天结婚的新婚夫妇,是第一夜,人生能有几个第一夜呢?一辈子,不就这一个吗?
|
||||
这时,一一间小屋走出了一对年轻夫妇,他们说:"志愿军同志,不要在外面过夜,零下三十度是冻不起的。我俩今晚到她娘家去,腾出这间屋,给志愿军战士住。"这是一对当天结婚的新婚夫妇,是第一夜,人生能有几个第一夜呢?一辈子,不就这一个吗?
|
||||
|
||||
</view>
|
||||
<image
|
||||
src="https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/static/wz2.jpg?expire_at=1741142127&er_sign=05178b7851f3216a45b7badf85b1c7d3"
|
||||
mode=""></image>
|
||||
<view class="tab">
|
||||
我们住进小屋,六个人挤在一张床上睡觉,可怎么都睡不着。平时说的“军民鱼水情”,今天真的出现了吗?老乡说:“志愿军出国作战,到了安东,哪能汽车16团汽车修理工叫他们在野外露营?我俩到我娘那里住一张建群宿就行。”这几句朴实无华的话,真是“鱼水情”的真实体验。
|
||||
我们住进小屋,六个人挤在一张床上睡觉,可怎么都睡不着。平时说的"军民鱼水情",今天真的出现了吗?老乡说:"志愿军出国作战,到了安东,哪能汽车16团汽车修理工叫他们在野外露营?我俩到我娘那里住一张建群宿就行。"这几句朴实无华的话,真是"鱼水情"的真实体验。
|
||||
|
||||
</view>
|
||||
<view class="tab">
|
||||
通过这一事件,我真心体会到,人民军队爱人民,人民爱护子弟兵的“鱼水情”。
|
||||
通过这一事件,我真心体会到,人民军队爱人民,人民爱护子弟兵的"鱼水情"。
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="font-size: 20rpx;color: #999;margin-left: 50rpx;margin-top: 20rpx;">
|
||||
@@ -169,35 +169,23 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, onShow } from 'vue'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const hbComment = ref(null)
|
||||
const avatar = ref("")
|
||||
const templateSrc = ref("https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/bg.jpg?expire_at=1741101988&er_sign=c9732cddaaead925cf110d9a11751231")
|
||||
const commentData = ref(null)
|
||||
const reqFlag = ref(false)
|
||||
|
||||
data() {
|
||||
return {
|
||||
avatar: "",
|
||||
templateSrc: "https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/bg.jpg?expire_at=1741101988&er_sign=c9732cddaaead925cf110d9a11751231",
|
||||
"commentData": null,
|
||||
"reqFlag": false,
|
||||
onShow(() => {
|
||||
getComment()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
this.getComment();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
// 登录校验
|
||||
checkLogin() {
|
||||
// TODO 此处填写登录校验逻辑
|
||||
function checkLogin() {
|
||||
if (true) {
|
||||
return true;
|
||||
return true
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
@@ -207,109 +195,111 @@
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 输入框聚焦
|
||||
focusOn() {
|
||||
this.checkLogin();
|
||||
},
|
||||
// 获取评论
|
||||
getComment() {
|
||||
}
|
||||
|
||||
// 下边假装请求成功
|
||||
function focusOn() {
|
||||
checkLogin()
|
||||
}
|
||||
|
||||
function getComment() {
|
||||
let res = {
|
||||
"readNumer": 193,
|
||||
"commentList": []
|
||||
};
|
||||
this.commentData = {
|
||||
}
|
||||
commentData.value = {
|
||||
"readNumer": res.readNumer,
|
||||
"commentSize": res.commentList.length,
|
||||
"comment": this.getTree(res.commentList)
|
||||
};
|
||||
},
|
||||
// 新增评论
|
||||
add(req) {
|
||||
if (!this.checkLogin()) {
|
||||
return
|
||||
"comment": getTree(res.commentList)
|
||||
}
|
||||
if (this.reqFlag) {
|
||||
uni.showToast({
|
||||
title: '操作频繁',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
console.log(111);
|
||||
this.reqFlag = true;
|
||||
// 下边假装请求成功
|
||||
this.reqFlag = false;
|
||||
this.$refs.hbComment.addComplete();
|
||||
this.getComment();
|
||||
},
|
||||
// 点赞评论
|
||||
like(commentId) {
|
||||
if (!this.checkLogin()) {
|
||||
return
|
||||
}
|
||||
if (this.reqFlag) {
|
||||
uni.showToast({
|
||||
title: '操作频繁',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.reqFlag = true;
|
||||
// 下边假装请求成功
|
||||
this.reqFlag = false;
|
||||
this.$refs.hbComment.likeComplete(commentId);
|
||||
},
|
||||
// 删除评论
|
||||
del(commentId) {
|
||||
if (!this.checkLogin()) {
|
||||
return
|
||||
}
|
||||
if (this.reqFlag) {
|
||||
uni.showToast({
|
||||
title: '操作频繁',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.reqFlag = true;
|
||||
// TODO 接入真实接口
|
||||
// this.$u.api.commentDelete(commentId).then(res => {
|
||||
// this.reqFlag = false;
|
||||
// this.$refs.hbComment.deleteComplete(commentId);
|
||||
// }).catch(res => {
|
||||
// this.reqFlag = false;
|
||||
// })
|
||||
// 下边假装请求成功
|
||||
this.reqFlag = false;
|
||||
this.$refs.hbComment.deleteComplete(commentId);
|
||||
},
|
||||
// 列表按照父子转换成树
|
||||
getTree(data) {
|
||||
let result = [];
|
||||
let map = {};
|
||||
data.forEach(item => {
|
||||
map[item.id] = item;
|
||||
});
|
||||
data.forEach(item => {
|
||||
let parent = map[item.parentId];
|
||||
if (parent) {
|
||||
(parent.children || (parent.children = [])).push(item);
|
||||
} else {
|
||||
result.push(item);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function add(req) {
|
||||
if (!checkLogin()) return
|
||||
if (reqFlag.value) {
|
||||
uni.showToast({
|
||||
title: '操作频繁',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
reqFlag.value = true
|
||||
reqFlag.value = false
|
||||
hbComment.value.addComplete()
|
||||
getComment()
|
||||
}
|
||||
|
||||
function like(commentId) {
|
||||
if (!checkLogin()) return
|
||||
if (reqFlag.value) {
|
||||
uni.showToast({
|
||||
title: '操作频繁',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
reqFlag.value = true
|
||||
reqFlag.value = false
|
||||
hbComment.value.likeComplete(commentId)
|
||||
}
|
||||
|
||||
function del(commentId) {
|
||||
if (!checkLogin()) return
|
||||
if (reqFlag.value) {
|
||||
uni.showToast({
|
||||
title: '操作频繁',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
reqFlag.value = true
|
||||
reqFlag.value = false
|
||||
hbComment.value.deleteComplete(commentId)
|
||||
}
|
||||
|
||||
function getTree(data) {
|
||||
let result = []
|
||||
let map = {}
|
||||
data.forEach(item => {
|
||||
map[item.id] = item
|
||||
})
|
||||
data.forEach(item => {
|
||||
let parent = map[item.parentId]
|
||||
if (parent) {
|
||||
(parent.children || (parent.children = [])).push(item)
|
||||
} else {
|
||||
result.push(item)
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
function toIndex() {
|
||||
uni.switchTab({
|
||||
url: '/uni_modules/uni-cms-article/pages/list/list'
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
hbComment,
|
||||
avatar,
|
||||
templateSrc,
|
||||
commentData,
|
||||
reqFlag,
|
||||
checkLogin,
|
||||
focusOn,
|
||||
getComment,
|
||||
add,
|
||||
like,
|
||||
del,
|
||||
getTree,
|
||||
toIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -397,7 +387,6 @@
|
||||
margin-left: 10rpx;
|
||||
|
||||
&::before {
|
||||
// border-left: 2px solid #f44336;
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -411,4 +400,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user