Merge branch 'dev' into kongweiyu_branch

kongweiyu_branch
孔维屿 1 year ago
commit e59bd68d97

@ -1,119 +1,191 @@
Page({
//评论数据
comment_list:[
{
comment_id:1, //评论id
comment_pr_id:1, //评论所属文章id
comment_user_name:'九月', //评论人姓名
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg', //评论人头像
comment_text:"做的不错嘛", //评论内容
comment_time:'2019年3月20日', //评论时间
reply_id: 0, //回复谁的评论评论表全部默认为0
parent_id: 0, //评论所属哪个评论id下面的评论表全部默认为0
reply_name:'' //回复评论人的昵称 评论表全部默认为''
},
{
comment_id: 4,
comment_pr_id: 1,
comment_user_name: '九月',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "可以可以",
comment_time: '2019年3月20日',
reply_id:0,
parent_id: 0,
},
{
comment_id: 5,
comment_pr_id: 1,
comment_user_name: '九月',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "学习学习",
comment_time: '2019年3月20日',
reply_id: 0,
parent_id: 0,
},
],
//回复数据
comment_list2: [
{
comment_id: 2,
comment_pr_id: 1,
comment_user_name: '九月时',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "谢谢",
comment_time: '2019年3月20日',
reply_id: 1, //
parent_id:1, //
reply_name:'' //
},
{
comment_id: 3,
comment_pr_id: 1,
comment_user_name: '四月天',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "我也想这么夸他",
comment_time: '2019年3月20日',
reply_id: 2,
parent_id: 1,
reply_name: ''
},
{
comment_id: 6,
comment_pr_id: 1,
comment_user_name: '九月时',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "你也可以跟我学学",
comment_time: '2019年3月20日',
reply_id: 2,
parent_id: 1,
reply_name: '九月'
},
{
comment_id: 7,
comment_pr_id: 1,
comment_user_name: '九月',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "不用谢,做的真是不错",
comment_time: '2019年3月20日',
reply_id: 2,
parent_id: 1,
reply_name: '九月时'
},
{
comment_id: 8,
comment_pr_id: 1,
comment_user_name: '九月时',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "你们也太会拍马屁了",
comment_time: '2019年3月20日',
reply_id: 2,
parent_id: 1,
reply_name: '四月天'
data: {
//评论数据
comment_list: [
{
comment_id: 1, //评论id
comment_pr_id: 1 ,//评论文章所属id
comment_user_avatar: 'cloud://cloud1-7gyjwcyfbdf819da.636c-cloud1-7gyjwcyfbdf819da-1321167991/1678762683308.png', //评论用户头像(路径替换为你的图片路径)
comment_user_name: '高同学', //评论人昵称
comment_text: '您觉得这位老师的讲课方式是什么样的呢', //评论内容
comment_time: '2020年8月18日', //评论时间
reply_id: 0, //回复谁的评论默认为0
parent_id: 0, //评论所属评论id默认为0
reply_name: '' //回复评论用户的昵称 默认为''
},
{
comment_id: 2,
comment_pr_id: 1,
comment_user_avatar: 'cloud://cloud1-7gyjwcyfbdf819da.636c-cloud1-7gyjwcyfbdf819da-1321167991/photo/70eb920703ebdb368681f011c75aef3.jpg',
comment_user_name: '王同学',
comment_text: '强烈推荐这位老师,讲课幽默生动,容易接受',
comment_time: '2020年8月18日',
reply_id: 0,
parent_id: 0,
reply_name: ''
},
{
comment_id: 3,
comment_pr_id: 1,
comment_user_avatar: 'cloud://cloud1-7gyjwcyfbdf819da.636c-cloud1-7gyjwcyfbdf819da-1321167991/photo/4494c78cc34e0567b59bd6431df61f6.jpg',
comment_user_name: '张剑锋',
comment_text: '老师讲的比较仔细,但好像不太适合我',
comment_time: '2020年8月18日',
reply_id: 0,
parent_id: 0,
reply_name: ''
}
],
//回复数据
comment_list2: [
{
comment_id: 4,
comment_pr_id: 1,
comment_user_name: '张同学',
comment_user_avatar: '/images/assemblyNumber/discoveryDetails/per3.png',
comment_text: "为什么呢?",
comment_time: '2020年8月18日',
reply_id: 3,
parent_id: 3,
reply_name: ''
},
{
comment_id: 5,
comment_pr_id: 1,
comment_user_name: '沈非隆',
comment_user_avatar: '/images/assemblyNumber/discoveryDetails/per4.png',
comment_text: "办理优待证大概需要多长时间呢会不会需要特别长时间",
comment_time: '2020年8月18日',
reply_id: 3,
parent_id: 3,
reply_name: '张剑锋'
}
],
/*定义一些数据*/
focus: false, //输入框是否聚焦
placeholder: '说点什么...', //底部输入框占字符
placeholder2: '说点什么让ta也认识看笔记的你', //顶部输入框占字符
value: null, //顶部输入框内容
comment_text: null, //底部评论框内容
/*
*以下初始化数据是用户点击任意一条评论或回复时需要设置的数据
*然后将设置好的数据传递给评论时新创建的评论数据对象
*/
now_reply_name: null, //当前点击的评论或回复评论的用户昵称
now_reply_type: 0, //当前回复类型 默认为0 1为回复评论 2为回复回复
now_parent_id: 0, //当前点击的评论或回复评论的所属评论id
now_reply: 0, //当前点击的评论或回复评论的id
//模拟用户信息
userinfo: {
nickName: '马飞', //用户昵称
avatarUrl: '/images/assemblyNumber/discoveryDetails/per5.png' //用户头像
}
},
{
comment_id: 9,
comment_pr_id: 1,
comment_user_name: '九月时',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "那就跟我好好学",
comment_time: '2019年3月20日',
reply_id: 5,
parent_id: 5,
reply_name: ''
//点击用户评论或回复时触发
replyComment(e) {
var cid = e.currentTarget.dataset.cid; //当前点击的评论id
var name = e.currentTarget.dataset.name; //当前点击的评论昵称
var pid = e.currentTarget.dataset.pid; //当前点击的评论所属评论id
var type = e.currentTarget.dataset.type; //当前回复类型
this.setData({
focus: true, //输入框获取焦点
placeholder: '回复' + name + '', //更改底部输入框占字符
now_reply: cid, //当前点击的评论或回复评论id
now_reply_name: name, //当前点击的评论或回复评论的用户名
now_parent_id: pid, //当前点击的评论或回复评论所属id
now_reply_type: type, //获取类型(1回复评论/2回复-回复评论)
})
},
{
comment_id: 10,
comment_pr_id: 1,
comment_user_name: '九月',
comment_user_avatar: 'https://image.weilanwl.com/img/square-2.jpg',
comment_text: "是的,你是大佬啊",
comment_time: '2019年3月20日',
reply_id: 9,
parent_id: 5,
reply_name: '九月时',
//底部输入框提交内容时触发
confirm(e){
//获取输入框输入的内容
var comment_text = e.detail.value;
//判断用户是否输入内容为空
if (comment_text == '') {
//用户评论输入内容为空时弹出
wx.showToast({
title: '请输入内容', //提示内容
icon: 'none' //提示图标
})
} else {
var date = new Date(); //创建时间对象
var year = date.getFullYear(); //获取年
var month = date.getMonth() + 1; //获取月
var day = date.getDate(); //获取日
var hour = date.getHours(); //获取时
var minute = date.getMinutes(); //获取分
var second = date.getSeconds(); //获取秒
var time = `${year}${month}${day}${hour}${minute}${second}`; //当前时间
var comment_list = this.data.comment_list; //获评论数据
var comment_list2 = this.data.comment_list2; //获取回复数据
var comment_list_length = comment_list.length; //获取当前评论数组的长度
var last_id = comment_list[comment_list_length - 1].comment_id; //获取最后一个评论的id
var comment_list2_length = comment_list2.length; //获取回复数组的长度
var last_id2 = comment_list2[comment_list2_length - 1].comment_id; //获取最后回复的id
var new_id = last_id > last_id2 ? last_id + 1 : last_id2 + 1; //当前将要发表的评论的id
var userinfo = this.data.userinfo; //获取当前的用户信息
var comment_user_name = userinfo.nickName //用户昵称
var comment_user_avatar = userinfo.avatarUrl //用户头像
var reply_name = null; //回复评论用户的昵称
var parent_id = 0; //评论所属哪个评论的id
var reply_id = this.data.now_reply; //回复谁的评论id
//通过回复谁的评论id判断现在是评论还是回复
if(reply_id != 0) {
//现在是回复
var reply_type = this.data.now_reply_type; //回复类型
//通过回复类型判断是回复评论还是回复回复
if (reply_type == 1) {
//回复评论
parent_id = this.data.now_reply; //回复评论所属评论id
reply_name = this.data.now_reply_name; //回复评论用户昵称
} else {
//回复回复
parent_id = this.data.now_parent_id; //回复评论所属评论id
reply_name = this.data.now_reply_name; //回复评论用户昵称
}
} else {
//现在是评论
}
var comment_detail = {} //评论/回复对象
comment_detail.comment_id = new_id; //评论Id
comment_detail.comment_user_name = comment_user_name; //用户昵称
comment_detail.comment_user_avatar = comment_user_avatar; //用户头像
comment_detail.comment_text = comment_text; //评论内容
comment_detail.comment_time = time; //评论时间
comment_detail.reply_id = reply_id; //回复谁的评论的id
comment_detail.parent_id = parent_id; //评论所属哪个评论id
comment_detail.reply_name = reply_name; //回复评论人的昵称
//判断parent_id是否为0 为0就是评论 不为0就是回复
if(comment_detail.parent_id > 0) {
//回复
comment_list2.unshift(comment_detail);
} else {
//评论
comment_list.unshift(comment_detail);
}
//动态渲染
ths.setData({
//发表评论后将以下数据初始化 为下次发表评论做准备
comment_text: null, //评论内容
now_reply: 0, //当前点击的评论id
now_reply_name: null, //当前点击的评论的用户昵称
now_reply_type: 0, //评论类型
now_parent_id: 0, //当前点击的评论所属哪个评论id
placeholder: "说点什么...", //输入框占字符
//将加入新数据的数组渲染到页面
comment_list, //评论列表
comment_list2 //回复列表
})
}
},
],
//下面的方法可以绑定在输入框的bindblur属性上
//下面的方法可以绑定在输入框的bindblur属性上
blur(e) {
const text = e.detail.value.trim();
if( text == ''){
@ -127,14 +199,22 @@ blur(e) {
})
}
},
//获取输入框内容
//获取输入框内容
getCommentText(e) {
var val = e.detail.value;
this.setData({
comment_text: val
})
},
//顶部评论框提交内容时触发
bindconfirm(e) {
var comment_text = e.detail.value
var comment_list = this.data.comment_list;
var comment_detail = {}
comment_list.unshift(comment_detail);
this.setData({
value: null })
}
})
})

@ -1,2 +1,4 @@
<!--pages/Detailed/detailed.wxml-->
<text>pages/Detailed/detailed.wxml</text>

@ -15,8 +15,13 @@
<view class="tab">
<<<<<<< HEAD
<view class="tab-item" bindtap="changeTab" data-index="0">教员列表</view>
<view class="tab-item" bindtap="changeTab" data-index="1">系统推荐</view>
=======
<view class="tab-item" bindtap="changeTab" data-index="0">教员风采</view>
<view class="tab-item" bindtap="changeTab" data-index="1">学员情况</view>
>>>>>>> dev
</view>
<view class="content">
@ -59,11 +64,26 @@
</view>
<!-- 学员发布的要求界面 -->
<view wx:if="{{currentTab === 1}}">
<<<<<<< HEAD
<view>需求科目</view>
<view>教师资历</view>
<view>上课时间</view>
=======
<view class="show_information" wx:for="{{[1,2,3,4,5,6]}}">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
</view>
</view>
</view>
>>>>>>> dev
<view class="page-container">
<!-- 页面内容 -->
<view class="popup" hidden="{{!showPopup}}">

@ -31,7 +31,7 @@
width: 90%;
margin: 20rpx auto;
padding: 20rpx;
background-color: #bce3fa;
background-color: #83acc4;
border-radius: 25rpx;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
}
@ -86,15 +86,6 @@
padding: 20rpx;
}
.text-container > button {
display: inline;
position: relative;
left: 300rpx;
top: 35rpx;
border-radius: 10px;
background-color: #4CAF50;
}
.title {
font-size: 32rpx;
font-weight: bold;
@ -537,7 +528,7 @@ page {
width: 60px;
height: 60px;
border-radius: 50%;
background-color: #FFFFFF;
background-color: #8a727a;
z-index: 999;
}

@ -5,7 +5,6 @@ Page({
* 页面的初始数据
*/
data: {
currentTab: 0
},
/**

@ -7,18 +7,20 @@
<view class="tab-item" bindtap="changeTab" data-index="2">已完成</view>
</view>
<view class="reserved" wx:if="{{currentTab==0}}">
<view class="content-container">
<image class="image" src="/images/user.png"></image>
<view class="text-container">
<text class="title">已预约订单名称</text>
<view>
<text class="description">
电话号码:{{item.phone}}
email{{item.email}}
其他信息null
</text>
</view>
<view wx:if="{{currentTab==0}}">
<view class="reserved">
<view class="content-container">
<image class="image" src="/images/user.png"></image>
<view class="text-container">
<text class="title">已预约订单名称</text>
<view>
<text class="description">
电话号码:{{item.phone}}
email{{item.email}}
其他信息null
</text>
</view>
</view>
</view>
</view>
</view>

@ -3,7 +3,7 @@
.tab{
display: flex;
justify-content: space-around;
background-color: #c9d9f5;
background-color: #838d9e;
height: 45px;
border-radius: 0 0 30rpx 30rpx;
}
@ -44,7 +44,7 @@
/* height: 10%; */
margin: 10rpx auto;
padding: 25rpx;
background-color: #abdefc;
background-color: #83acc4;
border-radius: 10rpx;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
}
Loading…
Cancel
Save