comments function

dev
温雍敬 2 years ago
parent 27ee2e6871
commit cdcc21bc72

@ -1,6 +0,0 @@
{
"permissions": {
"openapi": [
]
}
}

@ -1,17 +0,0 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
// 获取openId云函数入口函数
exports.main = async (event, context) => {
// 获取基础信息
const wxContext = cloud.getWXContext();
return {
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
};
};

@ -1,14 +0,0 @@
{
"name": "getOpenId",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.6.3"
}
}

@ -1,6 +0,0 @@
{
"permissions": {
"openapi": [
]
}
}

@ -1,25 +0,0 @@
// 云函数入口文件
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
//const db = cloud.database();
// 云函数入口函数
exports.main = async (val, comment) => {
  return await cloud.database().collection("comment").doc(event.id)
  .update({
      data:{  
comment: comment_text      
      }
  }) 
  .then(res =>{
      console.log("改变评论状态成功1",res)
      return res
  })
  .catch(res =>{
      console.log("改变评论状态失败",res)
      return res
  })
}

@ -1,14 +0,0 @@
{
"name": "sendComment",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.6.3"
}
}

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="8px" height="14px" viewBox="0 0 8 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>☀ iOS/☀ 图标/线型/icons_outlined_arrow@3x</title>
<g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.3">
<g id="4.列表/z.覆盖层/右边/箭头" transform="translate(-334.000000, -21.000000)" fill="#000000">
<g id="☀-iOS/☀-图标/线型/icons_outlined_arrow" transform="translate(332.000000, 16.000000)">
<path d="M2.45405845,6.58064919 L3.51471863,5.51998901 L9.29361566,11.298886 C9.68374096,11.6890113 9.6872014,12.318069 9.29361566,12.7116547 L3.51471863,18.4905518 L2.45405845,17.4298916 L7.87867966,12.0052704 L2.45405845,6.58064919 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 906 B

@ -1,70 +0,0 @@
// pages/Detailed/detailed.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
Page({
/**
* 页面的初始数据
*/
data:{
avatarUrl: defaultAvatarUrl,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
var index = options.index; // 第一个页面传递过来的教师索引
var teacherInfo = this.data.teacher[index];
// 使用索引在教师数组中获取对应的教师信息
// var teacherInfo = this.data.teacher[index];
// 继续处理教师信息
// 调用云函数获取教师信息
wx.cloud.callFunction({
name: "detailed",
success: (res) => {
this.setData({
teacher: res.result.data
})
// console.log(this.data.teacher[1]);
}
})
},
changeTab(e) {
const index = e.currentTarget.dataset.index;
this.setData({
currentTab: parseInt(index)
});
},
onAddButtonTap: function() {
this.setData({
showPopup: true
});
},
onBackButtonTap: function() {
this.setData({
showPopup: false
});
},
handleSubmit: function() {
// 处理....
// 提交成功后隐藏弹窗
this.setData({
showPopup: false
});
},
navToComments: () => {
wx.navigateTo({
url: '/pages/Comments/Comments',
})
},
inputChange(e) {
this.setData({
inputValue: e.detail.value
});
},
})

@ -1,3 +0,0 @@
{
"usingComponents": {}
}

@ -1,15 +0,0 @@
<!--pages/Detailed/detailed.wxml-->
<view style="background-color: #FFFFFF; margin: 15rpx; border-radius: 25rpx;">
<view class="avatar-wrapper">
<image class="avatar" src="{{avatarUrl}}"></image>
<text>
姓名: 老师
科目: NULL
空闲时间: NULL
学历: NULL
时薪: NULL
</text>
</view>
<view style="margin: 20rpx;">综合评分: 10.0</view>
</view>

@ -1,15 +0,0 @@
/* pages/Detailed/detailed.wxss */
.avatar-wrapper {
display: flex;
justify-content: left;
}
/* 子元素选择器 */
.avatar-wrapper > image {
height: 100px;
width: 100px;
border-style: solid;
border-color: #000;
border-width: 1px;
margin: 20px;
}

@ -68,10 +68,10 @@
"tabIndent": "insertSpaces",
"tabSize": 2
},
"appid": "wxa443f40488e954d4",
"libVersion": "2.14.1",
"packOptions": {
"ignore": [],
"include": []
}
},
"appid": "wxa443f40488e954d4"
}
Loading…
Cancel
Save