Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
54dd796e
Commit
54dd796e
authored
Aug 27, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 物料选择接口对接
parent
91483a06
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
56 deletions
+129
-56
.env.dev.js
.env.dev.js
+1
-1
.env.js
.env.js
+1
-1
.env.prod.js
.env.prod.js
+1
-1
.env.test.js
.env.test.js
+1
-1
parts.js
src/common/api/parts.js
+11
-1
addParts.vue
src/pages/parts/addParts.vue
+114
-51
No files found.
.env.dev.js
View file @
54dd796e
...
...
@@ -11,6 +11,6 @@ const UNI_APP = {
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
argoDebugMode
:
1
,
version
:
'v1.
3.9
'
version
:
'v1.
5.0
'
}
module
.
exports
=
UNI_APP
;
.env.js
View file @
54dd796e
;(
function
()
{
let
NODE_ENV
=
'test'
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
let
VERSION_NUMBER
=
'1.
4
.0'
//版本号
let
VERSION_NUMBER
=
'1.
5
.0'
//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
if
(
NODE_ENV
===
'dev'
)
{
...
...
.env.prod.js
View file @
54dd796e
...
...
@@ -10,7 +10,7 @@ const UNI_APP = {
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'https://qn-static.banshouhui.com'
,
argoDebugMode
:
0
,
version
:
'v1.
3.9
'
version
:
'v1.
5.0
'
}
module
.
exports
=
UNI_APP
;
.env.test.js
View file @
54dd796e
...
...
@@ -11,6 +11,6 @@ const UNI_APP = {
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'https://qn-static.banshouhui.com'
,
argoDebugMode
:
1
,
version
:
'v1.
3.9
'
version
:
'v1.
5.0
'
}
module
.
exports
=
UNI_APP
;
src/common/api/parts.js
View file @
54dd796e
...
...
@@ -19,10 +19,18 @@ let partsApiFun = function (vm) {
* 配件过滤-品类列表
*/
let
getCategoryList
=
async
()
=>
await
vm
.
$u
.
get
(
base
+
vm
.
vuex_token
+
'/allow/category/list'
);
/**
* 配件过滤-一级分类
*/
let
getClassify
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/type/classify/'
+
params
.
id
);
/**
* 配件过滤-品牌列表
*/
let
getBrandList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
base
+
vm
.
vuex_token
+
'/allow/brand/list'
,
params
);
let
getBrandList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/type/towLevel/'
+
params
.
categoryId
+
'/'
+
params
.
classifyId
);
/**
* 配件过滤-三级分类列表
*/
let
getThreeLevel
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/type/threeLevel/'
+
params
.
categoryId
+
'/'
+
params
.
classifyId
+
'?partnerCompanyId = '
+
params
.
partnerCompanyId
+
'&speciesId='
+
params
.
speciesId
);
/**
* 查询配件列表
*/
...
...
@@ -50,7 +58,9 @@ let partsApiFun = function (vm) {
getSiteAddress
,
updateAddress
,
getCategoryList
,
getClassify
,
getBrandList
,
getThreeLevel
,
getPartsList
,
applyParts
,
getMyReserve
,
...
...
src/pages/parts/addParts.vue
View file @
54dd796e
...
...
@@ -3,10 +3,10 @@
<view
class=
"categary"
v-if=
"type === '2'"
>
<view
class=
"u-flex u-col-center"
>
<view
:class=
"['txt',
{'active': c
ategoryId === item.categoryI
d }]"
v-for="item in c
ategar
y"
:key="item.
categoryI
d"
@click="changeC
ategar
y(item)"
:class=
"['txt',
{'active': c
lassifyId === item.i
d }]"
v-for="item in c
lassif
y"
:key="item.
i
d"
@click="changeC
lassif
y(item)"
>
{{
item
.
label
}}
</view>
</view>
</view>
...
...
@@ -32,8 +32,8 @@
:scroll-into-view=
"scrollId"
>
<view
:id=
"`brand$
{item.
brandI
d}`"
:class="['label-title', { selected: item.
brandI
d == brandId }]"
:id=
"`brand$
{item.
i
d}`"
:class="['label-title', { selected: item.
i
d == brandId }]"
v-for="(item, index) in brand"
:key="index"
@click="selectBrand(item, index)"
...
...
@@ -41,27 +41,25 @@
</scroll-view>
</view>
<view
class=
"more u-flex"
@
click=
"handleClick"
>
<!--
<picker
mode=
"selector"
:value=
"brandIndex"
range-key=
"label"
:range=
"brand"
@
click=
"show = true"
@
change=
"changeBrand"
>
-->
<view
class=
"more-text"
>
更多
</view>
<!--
</picker>
-->
<u-icon
class=
"input-icon"
color=
"#2272FF"
name=
"arrow-right"
></u-icon>
</view>
</view>
<view
class=
"model u-flex"
v-
show=
"showMore !== true
"
>
<view
class=
"model u-flex"
v-
if=
"showMore !== true && model.length > 0
"
>
<view
class=
"label-content u-flex"
>
<scroll-view
style=
"width:100%;white-space: nowrap;"
scroll-x=
"true"
class=
"u-flex"
:scroll-into-view=
"scrollId"
:scroll-into-view=
"scroll
Model
Id"
>
<view
:id=
"`
brand$
{item.brandI
d}`"
:class="['label-title', { selected: item.
brandId == brand
Id }]"
v-for="(item, index) in
brand
"
:id=
"`
model$
{item.i
d}`"
:class="['label-title', { selected: item.
id == model
Id }]"
v-for="(item, index) in
model
"
:key="index"
@click="select
Brand
(item, index)"
@click="select
Model
(item, index)"
>
{{
item
.
label
}}
</view>
</scroll-view>
</view>
...
...
@@ -70,20 +68,20 @@
</view>
</view>
<view
class=
"allModel u-flex"
v-
show=
"showMore === true
"
>
<view
class=
"allModel u-flex"
v-
if=
"showMore === true && model.length > 0
"
>
<view
class=
"label-content u-flex"
>
<scroll-view
style=
"width:100%;height: 320rpx;"
scroll-y=
"true"
class=
"u-flex"
:scroll-into-view=
"scrollId"
:scroll-into-view=
"scroll
Model
Id"
>
<view
:id=
"`
brand$
{item.brandI
d}`"
:class="['label-title', { selected: item.
brandId == brand
Id }]"
v-for="(item, index) in
brand
"
:id=
"`
model$
{item.i
d}`"
:class="['label-title', { selected: item.
id == model
Id }]"
v-for="(item, index) in
model
"
:key="index"
@click="select
Brand
(item, index)"
@click="select
Model
(item, index)"
>
{{
item
.
label
}}
</view>
</scroll-view>
</view>
...
...
@@ -93,7 +91,7 @@
</view>
<view
class=
"lists"
>
<view
class=
"mask"
v-
show
=
"showMore === true"
@
click=
"showMore = false"
></view>
<view
class=
"mask"
v-
if
=
"showMore === true"
@
click=
"showMore = false"
></view>
<scroll-view
style=
"height:100%;"
:scroll-top=
"scrollTop"
...
...
@@ -143,13 +141,16 @@ export default {
show
:
false
,
showMore
:
false
,
categary
:
[],
classify
:
[],
brand
:
[],
model
:
[],
categaryIndex
:
0
,
categoryId
:
''
,
brandIndex
:
0
,
classifyId
:
''
,
brandId
:
0
,
scrollId
:
''
,
scrollModelId
:
''
,
modelId
:
0
,
loadStatus
:
'loadmore'
,
lists
:
[],
submitList
:
[],
...
...
@@ -218,15 +219,25 @@ export default {
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
if
(
data
.
length
>
0
)
{
this
.
categary
=
data
.
map
((
v
)
=>
{
v
.
label
=
v
.
categoryName
this
.
categoryId
=
data
[
0
].
categoryId
this
.
getClassify
()
}
else
{
this
.
getPartsList
()
}
}
})
},
// 获取一级分类
getClassify
()
{
this
.
$u
.
api
.
getClassify
({
id
:
this
.
categoryId
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
if
(
data
.
length
>
0
)
{
this
.
classify
=
data
.
map
((
v
)
=>
{
v
.
label
=
v
.
name
return
v
})
this
.
categary
.
push
({
categoryId
:
2
,
label
:
'非桩类'
,
})
this
.
categoryId
=
this
.
categary
[
0
].
categoryId
this
.
classifyId
=
this
.
classify
[
0
].
id
this
.
getBrandList
()
}
else
{
this
.
getPartsList
()
...
...
@@ -234,26 +245,69 @@ export default {
}
})
},
// 获取
品牌
// 获取
二级分类
getBrandList
(
id
)
{
this
.
$u
.
api
.
getBrandList
({
categoryId
:
this
.
categoryId
}).
then
((
res
)
=>
{
this
.
$u
.
api
.
getBrandList
({
categoryId
:
this
.
categoryId
,
classifyId
:
this
.
classifyId
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
let
lists
if
(
this
.
classifyId
===
1
)
{
lists
=
data
.
partnerCompany
}
else
{
lists
=
data
.
classify
}
let
item
,
index
this
.
brand
=
data
.
map
((
v
,
i
)
=>
{
if
(
id
&&
parseInt
(
id
)
===
v
.
brandI
d
)
{
this
.
brand
=
lists
.
map
((
v
,
i
)
=>
{
if
(
id
&&
parseInt
(
id
)
===
v
.
i
d
)
{
item
=
v
index
=
i
}
v
.
label
=
v
.
brandN
ame
v
.
label
=
v
.
n
ame
return
v
})
if
(
item
&&
index
)
{
this
.
selectBrand
(
item
,
index
)
this
.
scrollId
=
`brand
${
item
.
brandId
}
`
this
.
scrollId
=
`brand
${
item
.
id
}
`
}
else
{
this
.
brandId
=
this
.
brand
?.[
0
]?.
id
this
.
lists
=
[]
this
.
getThreeLevel
()
}
}
})
},
// 获取三级分类
getThreeLevel
()
{
const
params
=
{
categoryId
:
this
.
categoryId
,
classifyId
:
this
.
classifyId
,
partnerCompanyId
:
''
,
speciesId
:
''
}
if
(
this
.
classifyId
===
1
)
{
params
.
partnerCompanyId
=
this
.
brandId
}
else
{
params
.
speciesId
=
this
.
brandId
}
this
.
$u
.
api
.
getThreeLevel
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
let
item
,
index
this
.
model
=
data
.
map
((
v
,
i
)
=>
{
// if (id && parseInt(id) === v.id) {
// item = v
// index = i
// }
v
.
label
=
v
.
name
return
v
})
if
(
item
&&
index
)
{
this
.
selectModel
(
item
,
index
)
this
.
scrollModelId
=
`model
${
item
.
id
}
`
}
else
{
this
.
brandId
=
this
.
brand
?.[
0
]?.
brandI
d
this
.
modelId
=
this
.
model
?.[
0
]?.
i
d
this
.
lists
=
[]
this
.
getPartsList
()
}
...
...
@@ -268,9 +322,19 @@ export default {
pageNumber
:
this
.
pageNumber
,
pageSize
:
this
.
pageSize
,
categoryId
:
this
.
categoryId
||
''
,
brandId
:
this
.
brandId
||
''
,
keyword
:
this
.
keyword
,
classifyId
:
this
.
classifyId
,
brandId
:
this
.
modelId
,
speciesId
:
''
,
partnerCompanyId
:
''
,
}
if
(
this
.
classifyId
===
1
)
{
params
.
partnerCompanyId
=
this
.
brandId
}
else
{
params
.
speciesId
=
this
.
brandId
}
this
.
$u
.
api
.
getPartsList
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
...
...
@@ -301,27 +365,26 @@ export default {
this
.
getPartsList
()
},
// 选择品类
changeCategary
(
data
)
{
this
.
categoryId
=
data
.
categoryId
this
.
brandIndex
=
''
changeClassify
(
data
)
{
this
.
classifyId
=
data
.
id
this
.
show
=
false
this
.
brand
=
[]
this
.
pageNumber
=
1
this
.
getBrandList
()
},
// 下拉选择品牌
changeBrand
(
data
)
{
this
.
brandIndex
=
data
.
detail
.
value
this
.
brandId
=
this
.
brand
[
this
.
brandIndex
].
brandId
this
.
scrollId
=
`brand
${
this
.
brandId
}
`
this
.
lists
=
[]
this
.
pageNumber
=
1
this
.
getPartsList
()
},
// 点击选择品牌
selectBrand
(
item
,
index
)
{
this
.
scrollId
=
''
this
.
brandIndex
=
index
this
.
brandId
=
item
.
brandId
this
.
brandId
=
item
.
id
this
.
model
=
[]
this
.
lists
=
[]
this
.
pageNumber
=
1
this
.
getThreeLevel
()
},
// 点击选择三级分类
selectModel
(
item
,
index
)
{
this
.
scrollModelId
=
''
this
.
modelId
=
item
.
id
this
.
lists
=
[]
this
.
pageNumber
=
1
this
.
getPartsList
()
...
...
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