onAdd:
function
() {
console.log(
"data:"
,
this
.data)
const db = wx.cloud.database()
db.collection(
'MtTrip'
).add({
data: {
tripDriver: app.globalData.userInfo.nickName,
cTime:
new
Date(),
tripTime:
this
.data.time,
tripFrom:
this
.data.placeFrom[
this
.data.index1],
tripTo:
this
.data.placeTo[
this
.data.index2],
tripSeat:
this
.data.seat[
this
.data.index4],
tripState:
"new"
,
tripOpenid: app.globalData.openid
}
})
.then(res => {
console.log(res)
})
},
上面其中"tripOpenid: app.globalData.openid"这一个数据怎么都添加不到数据库中,没有报错,也没有提示,就是从云开发控制台看数据写入结果没有这一条.
求解~