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
84d0ff86
Commit
84d0ff86
authored
Dec 29, 2020
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
云开发环境集成
parent
067d504b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
23 deletions
+70
-23
pages.json
take-order/pages.json
+15
-11
brand.vue
take-order/pages/photo/brand.vue
+21
-9
product.vue
take-order/pages/photo/product.vue
+34
-3
No files found.
take-order/pages.json
View file @
84d0ff86
...
...
@@ -7,21 +7,30 @@
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/
index/index
"
,
"path"
:
"pages/
photo/product
"
,
"style"
:
{
"navigationBarTitleText"
:
"
下单
"
"navigationBarTitleText"
:
"
选择产品
"
}
},
{
"path"
:
"pages/photo/try"
,
"style"
:
{
"navigationBarTitleText"
:
"拍照"
}
},
{
"path"
:
"pages/
photo/product
"
,
"path"
:
"pages/
index/index
"
,
"style"
:
{
"navigationBarTitleText"
:
"
选择产品
"
"navigationBarTitleText"
:
"
下单
"
}
},
{
"path"
:
"pages/photo/detail"
,
"style"
:
{
...
...
@@ -52,12 +61,7 @@
},
{
"path"
:
"pages/photo/try"
,
"style"
:
{
"navigationBarTitleText"
:
"拍照"
}
},
...
...
take-order/pages/photo/brand.vue
View file @
84d0ff86
...
...
@@ -14,25 +14,37 @@
export
default
{
data
()
{
return
{
code
:
''
,
brandList
:[]
}
},
onLoad
(
e
)
{
if
(
e
&&
e
.
code
){
this
.
code
=
e
.
code
}
this
.
getBrandList
()
},
methods
:
{
getBrandList
:
function
()
{
this
.
brandList
=
[
{
'title'
:
'广汽'
,
'id'
:
0
},
{
'title'
:
'比亚迪'
,
'id'
:
1
this
.
$u
.
cloudApi
.
getBrand
({
product_code
:
this
.
code
}).
then
(
res
=>
{
console
.
log
(
res
,
"品牌"
)
}
]
)
// this.brandList = [
// {
// 'title':'广汽',
// 'id':0
// },
// {
// 'title':'比亚迪',
// 'id':1
// }
// ]
},
//选择 点击
...
...
take-order/pages/photo/product.vue
View file @
84d0ff86
...
...
@@ -3,7 +3,7 @@
<text
class=
"topTitle"
>
选择产品
</text>
<view
class=
""
>
<view
class=
"itemView u-m-t-80"
v-for=
"(item,ikey) in productList"
:key=
"ikey"
>
<text
class=
"itemTitle"
@
click=
"itemClick(item)"
>
{{
item
.
titl
e
}}
</text>
<text
class=
"itemTitle"
@
click=
"itemClick(item)"
>
{{
item
.
nam
e
}}
</text>
</view>
</view>
...
...
@@ -14,15 +14,42 @@
export
default
{
data
()
{
return
{
productList
:[]
productList
:[],
code
:
''
,
}
},
onLoad
(
e
)
{
this
.
getProductList
()
},
methods
:
{
getProductList
:
function
(){
let
that
=
this
this
.
$u
.
cloudApi
.
getAllProduct
().
then
(
res
=>
{
console
.
log
(
'获取产品数据:'
)
console
.
log
(
res
)
if
(
res
.
result
.
data
){
that
.
productList
=
res
.
result
.
data
}
})
/*
const db = uniCloud.database({
spaceId: 'tcb-nikbzhlwnpd5n913e1c5e-50f4bbo'
})
const collection = db.collection("config").where({type: "brand"}).get()
console.log('collection:')
console.log(collection)
this.productList = [
{
'title':'新风机',
...
...
@@ -33,12 +60,16 @@
'id':1
}
]
*/
},
//选择 点击
itemClick
:
function
(
item
)
{
if
(
item
.
code
){
this
.
code
=
item
.
code
}
uni
.
navigateTo
({
url
:
'/pages/photo/brand'
url
:
'/pages/photo/brand'
+
'?code='
+
this
.
code
})
},
...
...
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