Skip to content

Commit 56b5c7b

Browse files
committed
fix bugs
1 parent 7b6935d commit 56b5c7b

File tree

14 files changed

+208
-73
lines changed

14 files changed

+208
-73
lines changed

cloud/addGroupMember/config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"permissions": {
3+
"openapi": [
4+
]
5+
}
6+
}

cloud/addGroupMember/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// 云函数入口文件
2+
const cloud = require('wx-server-sdk')
3+
4+
cloud.init()
5+
6+
// 云函数入口函数
7+
exports.main = async (event, context) => {
8+
const wxContext = cloud.getWXContext()
9+
const _ = cloud.database().command
10+
let openid = event.openid
11+
let _groupid = event.groupid
12+
return cloud.database().collection('group').doc(_groupid).update({
13+
data: {
14+
'member': _.push(openid),
15+
}
16+
})
17+
18+
}

cloud/addGroupMember/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "addGroupMember",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"wx-server-sdk": "~2.3.3"
13+
}
14+
}

pages/about/about.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<image src="/source/main.png" mode="widthFix"></image>
55
<view class="head_text">
66
<text>简洁,轻量化的任务管理工具</text>
7-
<text class="version">HoloTask 1.6.0.210222_beta</text>
7+
<text class="version">HoloTask 1.6.1.210222_beta</text>
88
</view>
99
</view>
1010
<view class="content">

pages/account/account.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Page({
4242
})
4343
},
4444

45+
share: function() {
46+
47+
},
48+
4549
joinGroup: function () {
4650
var that = this
4751
wx.showModal({
@@ -55,12 +59,13 @@ Page({
5559
title: '处理中',
5660
})
5761
var inputcontent = res.content
58-
console.log(res.content.length)
59-
if (res.content.length == 8) {
62+
console.log(inputcontent)
63+
if (inputcontent.length == 8) {
6064
wx.cloud.database().collection('group').where({
61-
groupid: res.content
65+
groupid: inputcontent
6266
}).get()
6367
.then(res => {
68+
console.log(res)
6469
if (res.data.length == 0) {
6570
wx.hideLoading({
6671
success: (res) => {},
@@ -77,10 +82,10 @@ Page({
7782
})
7883
})
7984
} else {
80-
var _groupid = res.data._id
85+
var _groupid = res.data[0]._id
8186
wx.cloud.database().collection('group').where({
8287
groupid: inputcontent,
83-
member: that.openid
88+
member: [that.data.openid]
8489
}).get()
8590
.then(res => {
8691
if(res.data.length != 0){
@@ -92,10 +97,17 @@ Page({
9297
icon: "none"
9398
})
9499
} else {
95-
const _ = wx.cloud.database().command
96-
wx.cloud.database().collection('group').doc(_groupid).update({
100+
// const _ = wx.cloud.database().command
101+
// wx.cloud.database().collection('group').doc(_groupid).update({
102+
// data: {
103+
// 'member': _.push(that.data.openid),
104+
// }
105+
// })
106+
wx.cloud.callFunction({
107+
name: 'addGroupMember',
97108
data: {
98-
'member': _.push(that.openid),
109+
groupid: _groupid,
110+
openid: that.data.openid
99111
}
100112
})
101113
wx.cloud.database().collection('user').where({
@@ -119,6 +131,9 @@ Page({
119131
}
120132
})
121133
} else {
134+
wx.hideLoading({
135+
success: (res) => {},
136+
})
122137
wx.showModal({
123138
title: "错误",
124139
content: "输入格式有误",

pages/account/account.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<text class="subtitle">功能选项设置</text>
5959
</view>
6060
</view>
61-
<view class="setting_box">
61+
<view class="setting_box" bindtap="share">
6262
<image class="icon" src="/source/icon/account/share-gray-24dp.svg"></image>
6363
<view class="text">
6464
<text class="title">分享</text>

pages/add/add.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Page({
1515
tempImgs: [],
1616
tempFiles: [],
1717
file_style: null,
18-
file_helptext: "可添加一个大小不超过 10 MiB 的附件。",
18+
file_helptext: "可添加一个大小不超过 10 MiB 的附件。仅支持从会话文件中选择",
1919
input: [{
2020
main: "",
2121
placeholder: "",
@@ -72,7 +72,7 @@ Page({
7272
} else {
7373
that.setData({
7474
tempFiles: tempFilePaths,
75-
file_helptext: "可添加一个大小不超过 10 MiB 的附件。",
75+
file_helptext: "可添加一个大小不超过 10 MiB 的附件。仅支持从会话文件中选择",
7676
file_style: ""
7777
})
7878
}

0 commit comments

Comments
 (0)