Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
99dd98b7
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
99dd98b7
编写于
12月 06, 2023
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 移除无用的泛型
上级
2f1703ab
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
33 addition
and
34 deletion
+33
-34
pages/API/unicloud-call-function/unicloud-call-function.uvue
pages/API/unicloud-call-function/unicloud-call-function.uvue
+3
-3
pages/API/unicloud-database/unicloud-database.uvue
pages/API/unicloud-database/unicloud-database.uvue
+18
-19
pages/API/unicloud-file-api/unicloud-file-api.uvue
pages/API/unicloud-file-api/unicloud-file-api.uvue
+3
-3
pages/API/unicloud-import-object/unicloud-import-object.uvue
pages/API/unicloud-import-object/unicloud-import-object.uvue
+9
-9
未找到文件。
pages/API/unicloud-call-function/unicloud-call-function.uvue
浏览文件 @
99dd98b7
...
@@ -55,13 +55,13 @@
...
@@ -55,13 +55,13 @@
num: 1,
num: 1,
str: 'ABC'
str: 'ABC'
}
}
}).then
<void>
(res => {
}).then(res => {
const result = res.result
const result = res.result
this.callFunctionResult = result
this.callFunctionResult = result
console.log(JSON.stringify(result))
console.log(JSON.stringify(result))
uni.hideLoading()
uni.hideLoading()
this.notify(result['showMessage'] as string, '提示')
this.notify(result['showMessage'] as string, '提示')
}).catch
<void>
((err : any | null) => {
}).catch((err : any | null) => {
const error = err as UniCloudError
const error = err as UniCloudError
this.callFunctionError = {
this.callFunctionError = {
errCode: error.errCode,
errCode: error.errCode,
...
...
pages/API/unicloud-database/unicloud-database.uvue
浏览文件 @
99dd98b7
...
@@ -67,16 +67,15 @@
...
@@ -67,16 +67,15 @@
.add({
.add({
num: 1,
num: 1,
tag: 'default-tag',
tag: 'default-tag',
date: new Date(),
date: new Date()
point: new db.Geo.Point(116, 38)
})
})
.then
<void>
(res => {
.then(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
this.addId = res.id
this.addId = res.id
this.notify(`新增成功,id: ${res.id}`, '提示')
this.notify(`新增成功,id: ${res.id}`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
@@ -95,7 +94,7 @@
...
@@ -95,7 +94,7 @@
num: 3,
num: 3,
tag: 'default-tag',
tag: 'default-tag',
}])
}])
.then
<void>
((res) => {
.then((res) => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
console.log('JSON.stringify(res.inserted)', JSON.stringify(res.inserted))
console.log('JSON.stringify(res.inserted)', JSON.stringify(res.inserted))
...
@@ -103,7 +102,7 @@
...
@@ -103,7 +102,7 @@
this.batchAddinserted = res.inserted
this.batchAddinserted = res.inserted
this.notify(`新增成功条数${res.inserted}, id列表: ${res.ids.join(',')}`, '提示')
this.notify(`新增成功条数${res.inserted}, id列表: ${res.ids.join(',')}`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
@@ -123,13 +122,13 @@
...
@@ -123,13 +122,13 @@
.skip(1)
.skip(1)
.limit(2)
.limit(2)
.get()
.get()
.then
<void>
(res => {
.then(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
this.getData = res.data
this.getData = res.data
this.notify(`获取成功,取到了${res.data.length}条数据`, '提示')
this.notify(`获取成功,取到了${res.data.length}条数据`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
@@ -149,13 +148,13 @@
...
@@ -149,13 +148,13 @@
.skip(1)
.skip(1)
.limit(2)
.limit(2)
.get()
.get()
.then
<void>
(res => {
.then(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
this.getWithCommandData = res.data
this.getWithCommandData = res.data
this.notify(`获取成功,取到了${res.data.length}条数据`, '提示')
this.notify(`获取成功,取到了${res.data.length}条数据`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
@@ -173,13 +172,13 @@
...
@@ -173,13 +172,13 @@
.update({
.update({
num: 4
num: 4
})
})
.then
<void>
(res => {
.then(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
this.updateUpdated = res.updated
this.updateUpdated = res.updated
this.notify(`更新成功,更新了${res.updated}条数据`, '提示')
this.notify(`更新成功,更新了${res.updated}条数据`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
@@ -195,13 +194,13 @@
...
@@ -195,13 +194,13 @@
'tag == "default-tag"'
'tag == "default-tag"'
)
)
.remove()
.remove()
.then
<void>
(res => {
.then(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
this.removeDeleted = res.deleted
this.removeDeleted = res.deleted
this.notify(`删除成功,删掉了${res.deleted}条数据`, '提示')
this.notify(`删除成功,删掉了${res.deleted}条数据`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
@@ -246,11 +245,11 @@
...
@@ -246,11 +245,11 @@
tag: "default-tag"
tag: "default-tag"
}])
}])
})
})
.then
<void>
((_) : void => {
.then((_) : void => {
uni.hideLoading()
uni.hideLoading()
this.notify('数据初始化成功', '提示')
this.notify('数据初始化成功', '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
console.error(err)
console.error(err)
const error = err as UniCloudError
const error = err as UniCloudError
...
@@ -270,13 +269,13 @@
...
@@ -270,13 +269,13 @@
.getTemp()
.getTemp()
db.collection(local, foreign)
db.collection(local, foreign)
.get()
.get()
.then
<void>
(res => {
.then(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
this.lookupData = res.data
this.lookupData = res.data
this.notify(`联表查询成功,取到了${res.data.length}条数据`, '提示')
this.notify(`联表查询成功,取到了${res.data.length}条数据`, '提示')
})
})
.catch
<void>
((err : any | null) => {
.catch((err : any | null) => {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
this.notify(error.errMsg, '错误')
this.notify(error.errMsg, '错误')
...
...
pages/API/unicloud-file-api/unicloud-file-api.uvue
浏览文件 @
99dd98b7
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
filePath: tempFilePath,
filePath: tempFilePath,
cloudPath: 'test.jpg'
cloudPath: 'test.jpg'
})
})
.then
<void>
(function (res) {
.then(function (res) {
uni.hideLoading()
uni.hideLoading()
console.log(res)
console.log(res)
uni.showModal({
uni.showModal({
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
showCancel: false
showCancel: false
});
});
})
})
.catch
<void>
(function (err : any | null) {
.catch(function (err : any | null) {
uni.hideLoading()
uni.hideLoading()
const error = err as UniCloudError
const error = err as UniCloudError
uni.showModal({
uni.showModal({
...
...
pages/API/unicloud-import-object/unicloud-import-object.uvue
浏览文件 @
99dd98b7
...
@@ -63,11 +63,11 @@
...
@@ -63,11 +63,11 @@
})
})
const title = this.todoTitle
const title = this.todoTitle
const content = this.todoContent
const content = this.todoContent
todo.add(title, content).then
<void>
((res : UTSJSONObject) : void => {
todo.add(title, content).then((res : UTSJSONObject) : void => {
this.returnTodoTitle = res['title'] as string
this.returnTodoTitle = res['title'] as string
this.returnTodoContent = res['content'] as string
this.returnTodoContent = res['content'] as string
this.notify(res['showMessage'] as string, '提示')
this.notify(res['showMessage'] as string, '提示')
}).catch
<void>
((err : any | null) : void => {
}).catch((err : any | null) : void => {
const error = err as UniCloudError
const error = err as UniCloudError
console.error(error)
console.error(error)
})
})
...
@@ -78,9 +78,9 @@
...
@@ -78,9 +78,9 @@
retry: true
retry: true
}
}
})
})
todoObj.randomFail().then
<void>
((res : UTSJSONObject) : void => {
todoObj.randomFail().then((res : UTSJSONObject) : void => {
this.notify(res['showMessage'] as string, '提示')
this.notify(res['showMessage'] as string, '提示')
}).catch
<void>
((err : any | null) : void => {
}).catch((err : any | null) : void => {
const error = err as UniCloudError
const error = err as UniCloudError
console.error(error)
console.error(error)
})
})
...
@@ -89,10 +89,10 @@
...
@@ -89,10 +89,10 @@
const todo = uniCloud.importObject('todo', {
const todo = uniCloud.importObject('todo', {
customUI: this.isUniTest
customUI: this.isUniTest
})
})
todo.fail().then
<void>
((res : UTSJSONObject) : void => {
todo.fail().then((res : UTSJSONObject) : void => {
this.notify('todo.fail应调用失败,此处错误的触发了成功回调', '错误')
this.notify('todo.fail应调用失败,此处错误的触发了成功回调', '错误')
console.log('todo.fail: ', res);
console.log('todo.fail: ', res);
}).catch
<void>
((err : any | null) : void => {
}).catch((err : any | null) : void => {
const error = err as UniCloudError
const error = err as UniCloudError
this.failErrCode = error.errCode as string
this.failErrCode = error.errCode as string
console.error(error)
console.error(error)
...
@@ -107,10 +107,10 @@
...
@@ -107,10 +107,10 @@
const todo = uniCloud.importObject('todo', {
const todo = uniCloud.importObject('todo', {
customUI: this.isUniTest
customUI: this.isUniTest
})
})
todo.success().then
<void>
((res : UTSJSONObject) : void => {
todo.success().then((res : UTSJSONObject) : void => {
this.successErrCode = res['errCode'] as number
this.successErrCode = res['errCode'] as number
this.notify(res['showMessage'] as string, '提示')
this.notify(res['showMessage'] as string, '提示')
}).catch
<void>
((err : any | null) : void => {
}).catch((err : any | null) : void => {
const error = err as UniCloudError
const error = err as UniCloudError
console.error(error)
console.error(error)
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录