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
8c8010f8
Commit
8c8010f8
authored
Dec 29, 2020
by
李超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加云函数
parent
8ad2fcb0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1541 additions
and
3 deletions
+1541
-3
db_init.json
take-order/cloudfunctions-tcb/db_init.json
+1518
-0
index.js
take-order/cloudfunctions-tcb/getGroupStandard/index.js
+16
-0
cloud_rules.js
take-order/common/api/cloud_rules.js
+4
-0
manifest.json
take-order/manifest.json
+2
-2
index.vue
take-order/pages/index/index.vue
+1
-1
No files found.
take-order/cloudfunctions-tcb/db_init.json
0 → 100644
View file @
8c8010f8
This diff is collapsed.
Click to expand it.
take-order/cloudfunctions-tcb/getGroupStandard/index.js
0 → 100644
View file @
8c8010f8
'use strict'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
const
db
=
uniCloud
.
database
();
let
res
=
await
db
.
collection
(
"standard"
).
where
(
event
).
get
();
let
data
=
res
.
data
const
map
=
new
Map
()
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
let
key
=
data
[
i
].
type
if
(
map
.
has
(
key
)){
map
.
get
(
key
).
list
.
push
(
data
[
i
])
}
else
{
map
.
set
(
key
,{
type
:
key
,
list
:[
data
[
i
]]})
}
}
return
[...
map
.
values
()]
};
take-order/common/api/cloud_rules.js
View file @
8c8010f8
...
@@ -12,11 +12,15 @@ const db = uniCloud.database({
...
@@ -12,11 +12,15 @@ const db = uniCloud.database({
/* 查询规范项目 {product_code:"P0001"}*/
/* 查询规范项目 {product_code:"P0001"}*/
let
getstandard
=
async
(
params
=
{})
=>
await
db
.
collection
(
"standard"
).
where
(
params
).
get
();
let
getstandard
=
async
(
params
=
{})
=>
await
db
.
collection
(
"standard"
).
where
(
params
).
get
();
/* 查询分组规范项目 */
let
getGroupStandard
=
async
(
params
=
{})
=>
await
uniCloud
.
callFunction
({
name
:
'getGroupStandard'
,
data
:
params
});
const
rulesApi
=
{
const
rulesApi
=
{
getAllProduct
,
getAllProduct
,
getBrand
,
getBrand
,
getstandard
,
getstandard
,
getGroupStandard
,
}
}
return
rulesApi
return
rulesApi
}
}
...
...
take-order/manifest.json
View file @
8c8010f8
{
{
"name"
:
"take-order"
,
"name"
:
"take-order"
,
"appid"
:
""
,
"appid"
:
"
__UNI__BA775F5
"
,
"description"
:
""
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"versionCode"
:
"100"
,
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
"quickapp"
:
{},
"quickapp"
:
{},
/*
小程序特有相关
*/
/*
小程序特有相关
*/
"mp-weixin"
:
{
"mp-weixin"
:
{
"appid"
:
""
,
"appid"
:
"
wxd1d6eede324b0465
"
,
"setting"
:
{
"setting"
:
{
"urlCheck"
:
false
"urlCheck"
:
false
},
},
...
...
take-order/pages/index/index.vue
View file @
8c8010f8
...
@@ -190,7 +190,7 @@
...
@@ -190,7 +190,7 @@
console
.
log
(
res
,
"品牌"
)
console
.
log
(
res
,
"品牌"
)
}
}
)
)
this
.
$u
.
cloudApi
.
get
standard
({
brand_code
:
"B0001"
}).
then
(
res
=>
{
this
.
$u
.
cloudApi
.
get
GroupStandard
({
product_code
:
"P0001"
,
brand_code
:
"B0001"
}).
then
(
res
=>
{
console
.
log
(
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