Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
和慭琛
take_order
Commits
a908ee3d
Commit
a908ee3d
authored
Dec 23, 2020
by
李超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口
parent
f445953e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
cloud_rules.js
take-order/common/api/cloud_rules.js
+11
-3
index.vue
take-order/pages/index/index.vue
+11
-3
No files found.
take-order/common/api/cloud_rules.js
View file @
a908ee3d
...
...
@@ -4,11 +4,19 @@ const db = uniCloud.database({
let
cloudRulesApiFun
=
function
(
vm
){
/* 通过unionid查询用户 */
let
getAllBrand
=
async
()
=>
await
db
.
collection
(
"config"
).
where
({
type
:
"brand"
}).
get
();
/* 查询所有产品*/
let
getAllProduct
=
async
()
=>
await
db
.
collection
(
"product"
).
get
();
/* 查询产品下的品牌 {product_code:"P0001"}*/
let
getBrand
=
async
(
params
=
{})
=>
await
db
.
collection
(
"brand"
).
where
(
params
).
get
();
/* 查询规范项目 {product_code:"P0001"}*/
let
getstandard
=
async
(
params
=
{})
=>
await
db
.
collection
(
"standard"
).
where
(
params
).
get
();
const
rulesApi
=
{
getAllBrand
,
getAllProduct
,
getBrand
,
getstandard
,
}
return
rulesApi
}
...
...
take-order/pages/index/index.vue
View file @
a908ee3d
...
...
@@ -178,12 +178,20 @@
// });
},
onShow
()
{
async
onShow
()
{
//this.getWorkerType()
//this.getPerson()
console
.
log
(
'onShow'
)
this
.
$u
.
cloudApi
.
getAllBrand
().
then
(
res
=>
{
console
.
log
(
res
,
"执行"
)
this
.
$u
.
cloudApi
.
getAllProduct
().
then
(
res
=>
{
console
.
log
(
res
,
"产品"
)
}
)
this
.
$u
.
cloudApi
.
getBrand
({
product_code
:
"P0001"
}).
then
(
res
=>
{
console
.
log
(
res
,
"品牌"
)
}
)
this
.
$u
.
cloudApi
.
getstandard
({
brand_code
:
"B0001"
}).
then
(
res
=>
{
console
.
log
(
res
,
"规范标准"
)
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment