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
4f3ca04f
Commit
4f3ca04f
authored
Mar 26, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-photo-v2' of
https://git.banshouhui.com/heyinchen/take_order
into dev-photo-v2
parents
8938ec36
9ed6abef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
90 deletions
+89
-90
list.vue
take-order/pages/photo/list.vue
+27
-80
product.vue
take-order/pages/photo/product.vue
+8
-4
index.js
...niCloud-tcb/cloudfunctions/getRelationDictionary/index.js
+0
-3
index.js
...Cloud-tcb/cloudfunctions/getRelationDictionaryV2/index.js
+45
-0
db_init.json
take-order/uniCloud-tcb/database/db_init.json
+9
-3
No files found.
take-order/pages/photo/list.vue
View file @
4f3ca04f
<
template
>
<view
class=
"backView"
>
<view
class=
"topView"
>
<view
class=
"topItemView"
@
click=
"topItemClick
(ikey,item)"
v-for=
"(item,ikey) in dataList"
:key=
"ikey"
>
<view
:class=
"['topItemView',
{'active':activeTop===ikey}]" @click="handleTopItemChange
(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<text
:class=
"['ph-lst-top-index',
activeTop == ikey ? 'active-index-text' : 'index-text'
]"
>
{{
ikey
+
1
}}
</text>
<text
:class=
"activeTop == ikey ? 'topActiveItemTitle' : 'topItemTitle'
"
>
{{
item
.
type
}}
</text>
:class=
"['ph-lst-top-index',
{'active':activeTop===ikey}
]">
{{
ikey
+
1
}}
</text>
<text
class=
"topItemTitle
"
>
{{
item
.
type
}}
</text>
</view>
</view>
<view
class=
"rightView"
>
<view
class=
"right-view-title"
>
拍照项有:
</view>
<template
v-for=
"(item,ikey) in rightList"
>
<view
class=
"rightItemView"
@
click=
"rightItemClick(item,ikey)"
:key=
"ikey"
>
<view
:class=
"['rightContentView',
item.images.length > 0 ? 'gray666Color' : 'rightTitle'
]"
>
<view
:class=
"['rightContentView',
{'active':item.images.length > 0}
]">
<text
class=
"ph-lst-item-index"
>
{{
ikey
+
1
}}
</text>
<text
class=
""
>
{{
item
.
name
}}
(
{{
item
.
image_count
}}
张)
</text>
<image
class=
"ph-list-item-arrow"
src=
"/static/photo/arrow.png"
></image>
...
...
@@ -19,7 +19,7 @@
</view>
<view
class=
"rightImageView"
v-if=
"item.images"
>
<image
class=
"rightImage"
v-for=
"(image, index) in item.images"
:src=
"image"
:key=
"image"
@
click
=
"handleClickImage(item, image
, index)"
mode=
""
></image>
@
click
.
stop=
"handleClickImage(item
, index)"
mode=
""
></image>
</view>
</view>
</
template
>
...
...
@@ -89,23 +89,23 @@
}).
then
(
res
=>
{
console
.
log
(
'获取规范标准数据:'
)
console
.
log
(
res
)
if
(
res
.
result
&&
res
.
result
.
length
)
{
that
.
handleData
(
res
)
if
(
res
&&
res
.
result
)
{
that
.
handleData
(
res
.
result
)
}
})
},
handleData
:
function
(
res
)
{
handleData
:
function
(
res
ult
)
{
const
globalData
=
getApp
().
globalData
globalData
.
photo
.
productList
=
res
.
res
ult
this
.
dataList
=
res
.
res
ult
var
item
=
res
.
res
ult
[
0
]
globalData
.
photo
.
productList
=
result
this
.
dataList
=
result
var
item
=
result
[
0
]
this
.
rightList
=
item
.
list
},
//顶部点击
topItemClick
:
function
(
ikey
,
item
)
{
handleTopItemChange
:
function
(
ikey
,
item
)
{
this
.
activeTop
=
ikey
this
.
rightList
=
item
.
list
uni
.
pageScrollTo
({
...
...
@@ -115,15 +115,7 @@
},
// 点击图片
handleClickImage
(
item
,
image
,
index
)
{
// uni.navigateTo({
// url: '/pages/photo/detail' +
// '?current_image=' + image +
// '&image_count=' + item.images.length +
// '¤t_count=' + (index + 1) +
// '&images=' + JSON.stringify(item.images) +
// '&title=' + item.name,
// })
handleClickImage
(
item
,
index
)
{
uni
.
previewImage
({
urls
:
item
.
images
,
current
:
index
...
...
@@ -132,24 +124,6 @@
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
// for (let i = 0; i
<
this
.
rightList
.
length
;
i
++
)
{
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
// this.$set(this.rightList[ikey],'clickable',true)
// var current_image = item.images[0]
// var current_count = 1
// uni.navigateTo({
// url:'/pages/photo/standard'
// // +'?current_image=' + current_image
// // +'&image_count=' + item.image_count
// // +'¤t_count=' + current_count
// // +'&images=' + JSON.stringify(item.images)
// // +'&title=' + item.name,
// })
console
.
log
(
item
,
'item'
)
const
photo
=
getApp
().
globalData
.
photo
photo
.
currentItem
=
item
...
...
@@ -195,13 +169,10 @@
text-align
:
center
;
}
.
active-index-text
{
.
ph-lst-top-index.active
{
background-color
:
#2272FF
;
}
.index-text
{
background-color
:
#999999
;
}
.rightView
{
background-color
:
#F4F5F7
;
...
...
@@ -248,9 +219,15 @@
.rightContentView
{
display
:
flex
;
align-items
:
center
;
width
:
100%
;
width
:
100%
;
font-size
:
30
rpx
;
color
:
#2272FF
;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.rightContentView.active
{
color
:
#666666
;
border-color
:
#666666
;
}
.ph-list-item-arrow
{
...
...
@@ -260,27 +237,6 @@
right
:
30
rpx
;
}
/* .rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.width_50{
width: 480rpx;
}
.width_100{
width: 100%;
} */
.rightTitle
{
font-size
:
30
rpx
;
color
:
#2272FF
;
}
.rightContent
{
font-size
:
30
rpx
;
color
:
#333333
;
...
...
@@ -323,30 +279,21 @@
justify-content
:
center
;
-webkit-flex
:
1
;
flex
:
1
;
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
color
:
#999999
;
}
.topItemView.active
{
color
:
#2272FF
;
}
.topItemTitle
{
font-size
:
36
rpx
;
color
:
#999999
;
font-weight
:
bold
;
padding-left
:
30
rpx
;
}
.topActiveItemTitle
{
font-size
:
36
rpx
;
font-weight
:
bold
;
color
:
#2272FF
;
padding-left
:
30
rpx
;
}
.greenBackColor
{
background-color
:
#4CD964
;
}
.gray666Color
{
color
:
#666666
;
border-color
:
#666666
;
}
</
style
>
take-order/pages/photo/product.vue
View file @
4f3ca04f
...
...
@@ -12,8 +12,8 @@
</view>
</
template
>
</view>
<button
class=
"ph-pr-button"
type=
"primary"
@
click=
"handleClick"
:style=
"
selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'
"
>
下一步
</button>
<button
class=
"ph-pr-button"
type=
"primary"
@
click=
"handleClick"
:disabled=
"!selectedAll"
:style=
"
buttonStyle
"
>
下一步
</button>
</view>
</template>
...
...
@@ -51,6 +51,10 @@
data
:
this
.
brandList
}
]
},
buttonStyle
()
{
return
this
.
selectedAll
?
'color: #FFFFFF;background-color: #2272FF;'
:
'color: #FFFFFF;background-color: #D1D4D4;'
}
},
onLoad
(
e
)
{
...
...
@@ -143,8 +147,8 @@
handleClick
()
{
// 点击下一步设置全局拍照品牌品类
const
globalData
=
getApp
().
globalData
let
keys
=
[
'brandId'
,
'brandName'
,
'classifyId'
,
'systemId'
]
keys
.
map
(
key
=>
{
let
keys
=
[
'brandId'
,
'brandName'
,
'classifyId'
,
'systemId'
]
keys
.
map
(
key
=>
{
globalData
.
photo
.
product
[
key
]
=
this
[
key
]
||
this
.
param
[
key
]
})
uni
.
navigateTo
({
...
...
take-order/uniCloud-tcb/cloudfunctions/getRelationDictionary/index.js
View file @
4f3ca04f
'use strict'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
const
field_name
=
event
.
field
const
param
=
{
"classify_id"
:
event
.
classify_id
,
"system_id"
:
event
.
system_id
,
...
...
@@ -11,7 +9,6 @@ exports.main = async (event, context) => {
let
res
=
await
db
.
collection
(
"standardV2"
).
aggregate
().
match
(
param
).
group
({
_id
:
"$"
+
event
.
field
}).
end
();
res
=
await
db
.
collection
(
'dictionary'
).
field
({
"_id"
:
true
,
"name"
:
true
...
...
take-order/uniCloud-tcb/cloudfunctions/getRelationDictionaryV2/index.js
0 → 100644
View file @
4f3ca04f
'use strict'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
//event为客户端上传的参数
const
db
=
uniCloud
.
database
()
let
res
=
await
db
.
collection
(
"standardV2"
).
field
({
"classify_id"
:
true
,
"system_id"
:
true
,
"brand_id"
:
true
}).
get
();
let
data
=
{}
let
id
=
[]
res
.
data
.
map
(
item
=>
{
id
.
push
(
item
.
classify_id
)
id
.
push
(
item
.
system_id
)
id
.
push
(
item
.
brand_id
)
if
(
data
[
item
.
classify_id
])
{
if
(
data
[
item
.
classify_id
][
item
.
system_id
])
{
if
(
data
[
item
.
classify_id
][
item
.
system_id
].
indexOf
(
item
.
brand_id
)
<
0
)
data
[
item
.
classify_id
][
item
.
system_id
].
push
(
item
.
brand_id
)
}
else
{
data
[
item
.
classify_id
][
item
.
system_id
]
=
[
item
.
brand_id
]
}
}
else
{
let
obj
=
{}
obj
[
item
.
system_id
]
=
[
item
.
brand_id
]
data
[
item
.
classify_id
]
=
obj
}
})
let
dic
=
await
db
.
collection
(
"dictionary"
).
where
({
_id
:
db
.
command
.
in
(
id
)
}).
get
()
let
dic_data
=
{}
dic
.
data
.
map
(
item
=>
{
dic_data
[
item
.
_id
]
=
item
.
name
})
let
result
=
[]
for
(
let
first
in
data
)
{
let
secondArr
=
[]
for
(
let
second
in
data
[
first
])
{
let
thirdArr
=
[]
data
[
first
][
second
].
map
(
third
=>
{
thirdArr
.
push
({
id
:
third
,
name
:
dic_data
[
third
]})
})
secondArr
.
push
({
id
:
second
,
name
:
dic_data
[
second
],
child
:
thirdArr
})
}
result
.
push
({
id
:
first
,
name
:
dic_data
[
first
],
child
:
secondArr
})
}
return
result
;
};
take-order/uniCloud-tcb/database/db_init.json
View file @
4f3ca04f
...
...
@@ -77,7 +77,8 @@
"classify_id"
:
"79550af260555cc20afb34146966a2c4"
,
"system_id"
:
"79550af260555cc20afb34156c94b32c"
,
"brand_id"
:
"79550af260555cc20afb3417731a827c"
,
"describe"
:
"已经报装新能源专用电表,不用签此放弃声明,且不用上传"
,
"main_point"
:
[
"图片清晰"
,
"图片正对"
],
"note"
:
"已经报装新能源专用电表,不用签此放弃声明,且不用上传"
,
"image_count"
:
"1"
,
"images"
:
"https://cloud-bak.banshouhui.com/FkxetdqtVgCN_Xz53w6KqQsEC3K-"
,
"name"
:
"不需要报装声明(不需要报装必填)"
,
...
...
@@ -88,7 +89,8 @@
"classify_id"
:
"79550af260555cc20afb34146966a2c4"
,
"system_id"
:
"79550af260555cc20afb34156c94b32c"
,
"brand_id"
:
"79550af260555cc20afb341875d0f7ba"
,
"describe"
:
"已经报装新能源专用电表,不用签此放弃声明,且不用上传"
,
"main_point"
:
[],
"note"
:
"已经报装新能源专用电表,不用签此放弃声明,且不用上传"
,
"image_count"
:
"1"
,
"images"
:
"https://cloud-bak.banshouhui.com/FkxetdqtVgCN_Xz53w6KqQsEC3K-"
,
"name"
:
"不需要报装声明(不需要报装必填)"
,
...
...
@@ -133,7 +135,11 @@
"bsonType"
:
"string"
,
"description"
:
"名称"
},
"describe"
:
{
"main_point"
:{
"bsonType"
:
"array"
,
"description"
:
"描述、要求"
},
"note"
:
{
"bsonType"
:
"string"
,
"description"
:
"描述、要求"
},
...
...
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