Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
c10f4b12
提交
c10f4b12
authored
11月 12, 2025
作者:
方治民
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitlab.yiring.com/digital-agri/agri-app
上级
2b898779
9a530bba
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
531 行增加
和
847 行删除
+531
-847
chanxiao.ts
src/api/model/chanxiao.ts
+1
-1
dict.ts
src/api/model/dict.ts
+17
-0
nongjifuwu.ts
src/api/model/nongjifuwu.ts
+0
-12
chanxiao.vue
src/pages/chanxiao/chanxiao.vue
+3
-2
purchaseXuQiu.vue
src/pages/chanxiao/purchaseXuQiu.vue
+61
-130
supplyXuQiu.vue
src/pages/chanxiao/supplyXuQiu.vue
+178
-173
fuwu.vue
src/pages/fuwu/fuwu.vue
+25
-124
register-dialog.vue
src/pages/linghuoyonggong/components/register-dialog.vue
+4
-8
form.vue
src/pages/linghuoyonggong/form.vue
+50
-59
linghuoyonggong.vue
src/pages/linghuoyonggong/linghuoyonggong.vue
+14
-110
nongchang.vue
src/pages/nongchang/nongchang.vue
+21
-27
apply-dialog.vue
src/pages/nongjifuwu/components/apply-dialog.vue
+34
-7
farm-form.vue
src/pages/nongjifuwu/farm-form.vue
+13
-104
machine-form.vue
src/pages/nongjifuwu/machine-form.vue
+25
-52
nongjifuwu.vue
src/pages/nongjifuwu/nongjifuwu.vue
+7
-38
shouye.vue
src/pages/shouye/shouye.vue
+2
-0
area.ts
src/utils/dict/area.ts
+76
-0
没有找到文件。
src/api/model/chanxiao.ts
浏览文件 @
c10f4b12
...
...
@@ -4,7 +4,7 @@ import { otherHttp } from '/@/utils/http/axios'
enum
Api
{
purchaseList
=
'/purchaseSell/bizPurchase/list'
,
// 采购需求列表
supplyList
=
'/purchaseSell/bizSupply/list'
,
// 供应需求列表
purchaseSellDetails
=
'/purchaseSell/bizPurchase/queryBy
l
d'
,
// 产销详情
purchaseSellDetails
=
'/purchaseSell/bizPurchase/queryBy
I
d'
,
// 产销详情
purchaseSell
=
'/purchaseSell/bizPurchase/add'
,
// 发布采购需求
supplyAdd
=
'/purchaseSell/bizSupply/add'
,
// 发布供应需求
bizPurchaseSupplyRecord
=
'/purchaseSell/bizPurchaseSupplyRecord/add'
,
// 报价
...
...
src/api/model/dict.ts
0 → 100644
浏览文件 @
c10f4b12
// 上传请求
import
{
otherHttp
}
from
'/@/utils/http/axios'
enum
Api
{
cascaderHn
=
'/region/cascader/hn'
,
// 获取湖南省内 市/区县/乡镇级联数据
}
/**
* 查询湖南省 市/区县/乡镇
* @returns 市/区县/乡镇
*/
export
function
cascaderHn
()
{
return
otherHttp
.
get
({
url
:
Api
.
cascaderHn
,
})
}
\ No newline at end of file
src/api/model/nongjifuwu.ts
浏览文件 @
c10f4b12
...
...
@@ -8,7 +8,6 @@ enum Api {
farmMachineAddFarm
=
'/farmMachine/machineWork/app/addFarm'
,
// 发布农活服务
farmMachineEdit
=
'/farmMachine/machineWork/edit'
,
// 编辑农机服务
farmMachineRegister
=
'/farmMachine/machineWork/app/register'
,
// 参与服务
cascaderHn
=
'/region/cascader/hn'
,
}
/**
...
...
@@ -80,14 +79,4 @@ export function farmMachineRegister(params = {}) {
url
:
Api
.
farmMachineRegister
,
params
,
})
}
/**
* 查询湖南省 市/区县/乡镇
* @returns 市/区县/乡镇
*/
export
function
cascaderHn
()
{
return
otherHttp
.
get
({
url
:
Api
.
cascaderHn
,
})
}
\ No newline at end of file
src/pages/chanxiao/chanxiao.vue
浏览文件 @
c10f4b12
...
...
@@ -4,6 +4,7 @@
import
PriceDialog
from
'./components/price-dialog.vue'
import
Navigate
from
'@/utils/page/navigate'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
{
getText
}
from
'@/utils/dict/area'
// 下拉刷新
onPullDownRefresh
(()
=>
{
...
...
@@ -92,7 +93,7 @@
pageData
.
purchaseDemands
=
[...
pageData
.
purchaseDemands
,
...
records
]
pageData
.
purchaseDemands
=
pageData
.
purchaseDemands
.
map
((
item
)
=>
({
...
item
,
location
:
`
${
item
.
province
}${
item
.
city
}
`
,
location
:
getText
(
`
${
item
.
province
}
,
${
item
.
city
}
,
${
item
.
country
}
`
,
' / '
)
,
}))
pageData
.
total
=
total
})
...
...
@@ -109,7 +110,7 @@
pageData
.
supplyInfos
=
[...
pageData
.
supplyInfos
,
...
records
]
pageData
.
supplyInfos
=
pageData
.
supplyInfos
.
map
((
item
)
=>
({
...
item
,
location
:
`
${
item
.
province
}${
item
.
city
}
`
,
location
:
getText
(
`
${
item
.
province
}
,
${
item
.
city
}
,
${
item
.
country
}
`
,
' / '
)
,
}))
pageData
.
total
=
total
})
...
...
src/pages/chanxiao/purchaseXuQiu.vue
浏览文件 @
c10f4b12
...
...
@@ -5,7 +5,7 @@
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
{
areaTree
,
getCodeByText
,
getTextByCode
}
from
'@/utils/areaDat
a'
import
{
getDictData
,
getText
}
from
'@/utils/dict/are
a'
import
{
useDictStore
}
from
'@/store/modules/dict'
const
dictStore
=
useDictStore
()
...
...
@@ -60,9 +60,17 @@
},
rules
:
[
{
name
:
'classify'
,
rule
:
[
'required'
],
msg
:
[
'请选择采购类别'
],
},
{
name
:
'title'
,
rule
:
[
'required'
],
msg
:
[
'请输入标题'
],
msg
:
[
'请输入采购标题'
],
},
{
name
:
'count'
,
rule
:
[
'required'
],
msg
:
[
'请输入数量'
],
},
{
name
:
'count'
,
...
...
@@ -94,11 +102,7 @@
rule
:
[
'required'
],
msg
:
[
'请选择省/市/区县'
],
},
{
name
:
'classify'
,
rule
:
[
'required'
],
msg
:
[
'请选择分类'
],
},
{
name
:
'image'
,
rule
:
[
'required'
],
...
...
@@ -109,14 +113,14 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
async
function
initDict
()
{
pageData
.
options
.
classify
=
dictStore
.
getDictList
.
classify
.
map
((
item
)
=>
{
return
{
value
:
item
.
value
,
text
:
item
.
text
,
}
})
pageData
.
options
.
address
=
a
reaTree
pageData
.
options
.
address
=
a
wait
getDictData
()
}
function
getCurrentAddressInfo
()
{
...
...
@@ -138,7 +142,7 @@ return
function
getDetails
(
id
)
{
ChanxiaoAPI
.
purchaseSellDetails
({
id
}).
then
((
res
)
=>
{
pageData
.
form
=
res
pageData
.
form
.
address
=
`
${
getTextByCode
(
res
.
province
)}
/
${
getTextByCode
(
res
.
city
)}
/
${
getTextByCode
(
res
.
country
)
}
`
pageData
.
form
.
address
=
`
${
res
.
province
}
,
${
res
.
city
}
,
${
res
.
country
}
`
pageData
.
form
.
classifyText
=
pageData
.
options
.
classify
.
find
((
item
)
=>
item
.
value
==
res
.
classify
)?.
text
pageData
.
form
.
imageObj
=
pageData
.
form
.
image
&&
parseUrlInfo
(
pageData
.
form
.
image
)
})
...
...
@@ -170,7 +174,7 @@ return
pageData
.
show
.
classify
=
false
}
function
handleChangeAddress
(
e
)
{
pageData
.
form
.
address
=
e
.
text
.
join
(
'/
'
)
pageData
.
form
.
address
=
e
.
value
.
join
(
',
'
)
pageData
.
show
.
address
=
false
}
...
...
@@ -239,11 +243,19 @@ return
function
changeAddressValue
(
formData
)
{
const
addressValue
=
formData
.
address
.
split
(
'/'
)
if
(
addressValue
.
length
===
3
)
{
formData
.
province
=
getCodeByText
(
addressValue
[
0
])
formData
.
city
=
getCodeByText
(
addressValue
[
1
])
formData
.
country
=
getCodeByText
(
addressValue
[
2
])
formData
.
province
=
addressValue
[
0
]
formData
.
city
=
addressValue
[
1
]
formData
.
country
=
addressValue
[
2
]
}
}
function
getCurrentDate
()
{
const
date
=
new
Date
()
const
year
=
date
.
getFullYear
()
const
month
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
day
=
String
(
date
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
year
}
-
${
month
}
-
${
day
}
`
}
</
script
>
<
template
>
...
...
@@ -251,21 +263,17 @@ return
<view
class=
"formBox"
>
<fui-form
ref=
"formRef"
label-weight=
"auto"
top=
"60"
>
<view
class=
"mt20"
>
<fui-input
required
label=
"采购标题"
placeholder=
"请输入采购标题"
v-model=
"form.title"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
label=
"说明"
placeholder=
"请输入规格说明"
v-model=
"form.inputTextArea"
labelSize=
"28"
label-width=
"180"
/>
<view
class=
"form-section"
style=
"padding: 0 10rpx"
>
<view
class=
"form-item required flex align-center"
>
<text
class=
"label"
>
采购类别
</text>
<view
class=
"time-input"
@
click=
"show.classify = true"
>
<text
class=
"select-text"
:class=
"
{ placeholder: !form.classifyText }">
{{
form
.
classifyText
||
'请选择采购类别'
}}
</text>
</view>
</view>
</view>
<fui-input
required
label=
"采购标题"
placeholder=
"请输入需求名称"
v-model=
"form.title"
labelSize=
"28"
label-width=
"180"
maxlength=
"16"
size=
"28"
/>
</view>
<view
class=
"mt20"
>
<!-- 价格区间 -->
...
...
@@ -273,136 +281,59 @@ return
<view
class=
"form-item required flex align-center"
>
<text
class=
"label"
>
价格区间
</text>
<view
class=
"price-range"
>
<input
type=
"number"
class=
"price-input"
v-model=
"form.priceStart"
placeholder=
"最低价"
:min=
"0"
/>
<text
class=
"price-separator"
>
-
</text>
<input
type=
"number"
class=
"price-input"
v-model=
"form.priceEnd"
placeholder=
"最高价"
:min=
"0"
/>
<input
type=
"number"
class=
"price-input"
v-model=
"form.priceStart"
placeholder=
"最低价"
:min=
"0"
maxlength=
"6"
/>
<text
class=
"price-separator"
>
至
</text>
<input
type=
"number"
class=
"price-input"
v-model=
"form.priceEnd"
placeholder=
"最高价"
:min=
"0"
maxlength=
"6"
>
<view
slot=
"suffix"
class=
"unit-slot"
style=
"font-size: 28rpx;"
>
元
</view>
</input>
</view>
</view>
</view>
<fui-input
type=
"number"
required
label=
"数量"
placeholder=
"请输入数量"
v-model=
"form.count"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
label=
"单位"
placeholder=
"请输入计量单位"
v-model=
"form.unit"
labelSize=
"28"
label-width=
"180"
/>
</view>
<view
class=
"mt20"
>
<fui-input
type=
"number"
required
label=
"采购数量"
placeholder=
"请输入采购数量"
v-model=
"form.count"
labelSize=
"28"
label-width=
"180"
maxlength=
"8"
size=
"28"
/>
<fui-input
required
label=
"单位"
placeholder=
"请输入单位(如:个、kg、袋等)"
v-model=
"form.unit"
labelSize=
"28"
label-width=
"180"
maxlength=
"4"
size=
"28"
/>
<view
class=
"form-item required flex align-center"
style=
"padding: 20rpx 10rpx"
>
<text
class=
"label"
>
省/市/区县
</text>
<text
class=
"label"
>
区域
</text>
<view
class=
"time-input"
@
click=
"show.address = true"
>
<text
class=
"select-text"
:class=
"
{ placeholder: !form.address }">
{{
form
.
address
||
'请选择省/市/区县
'
}}
{{
getText
(
form
.
address
,
' / '
)
||
'请选择区域
'
}}
</text>
</view>
</view>
</view>
<view
class=
"mt20"
>
<!-- 截至时间 -->
<view
class=
"form-section"
style=
"padding: 0 10rpx"
>
<view
class=
"form-item required flex align-center"
>
<text
class=
"label"
>
截
至
时间
</text>
<text
class=
"label"
>
截
止
时间
</text>
<view
class=
"time-input"
@
click=
"show.time = true"
>
<text
class=
"time-text"
:class=
"
{ placeholder: !form.deadLine }">
{{
form
.
deadLine
||
'请选择截止时间'
}}
{{
form
.
deadLine
||
'请选择
采购
截止时间'
}}
</text>
</view>
</view>
</view>
<view
class=
"form-section"
style=
"padding: 0 10rpx"
>
<view
class=
"form-item required flex align-center"
>
<text
class=
"label"
>
分类
</text>
<view
class=
"time-input"
@
click=
"show.classify = true"
>
<text
class=
"select-text"
:class=
"
{ placeholder: !form.classifyText }">
{{
form
.
classifyText
||
'请选择分类'
}}
</text>
</view>
</view>
<view
class=
"mb-1 flex justify-start"
style=
"font-size: 28rpx;"
>
<span
style=
"color: red;margin-left: 10rpx;"
>
*
</span>
<span>
图片
</span>
</view>
</view>
<view
class=
"bg-white mt20"
style=
"padding: 0.875rem 1rem"
>
<view
class=
"mb-1 flex justify-start"
>
示例图片
</view>
<uni-file-picker
:value=
"form.imageObj"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
/>
<uni-file-picker
:value=
"form.imageObj"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
style=
"margin-left:35rpx"
/>
</view>
<view
class=
"fui-btn__box"
v-if=
"!form.id"
style=
"margin-top: 30rpx"
>
<fui-button
text=
"发布
需求
"
bold
radius=
"96rpx"
@
click=
"submit"
/>
<fui-button
text=
"发布"
bold
radius=
"96rpx"
@
click=
"submit"
/>
</view>
</fui-form>
<fui-date-picker
:show=
"show.time"
type=
"3"
@
change=
"handleChangeTime"
@
cancel=
"show.time = false"
/>
<fui-picker
:show=
"show.classify"
:layer=
"1"
:linkage=
"true"
:options=
"options.classify"
@
change=
"handleChangeClassify"
@
cancel=
"show.classify = false"
/>
<fui-picker
:show=
"show.address"
:options=
"options.address"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"show.address = false"
/>
<fui-picker
:show=
"show.classify"
:layer=
"1"
:linkage=
"true"
:options=
"options.classify"
@
change=
"handleChangeClassify"
@
cancel=
"show.classify = false"
/>
<fui-picker
:show=
"show.address"
:options=
"options.address"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"show.address = false"
/>
<fui-toast
ref=
"toastRef"
/>
</view>
</view>
<fui-date-picker
:show=
"show.time"
type=
"3"
@
change=
"handleChangeTime"
@
cancel=
"show.time = false"
minDate=
"2025-01-01"
/>
<fui-picker
:show=
"show.classify"
:layer=
"1"
:linkage=
"true"
:options=
"options.classify"
@
change=
"handleChangeClassify"
@
cancel=
"show.classify = false"
/>
<fui-picker
:show=
"show.address"
:options=
"options.address"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"show.address = false"
/>
<fui-date-picker
:show=
"show.time"
type=
"3"
@
change=
"handleChangeTime"
@
cancel=
"show.time = false"
minDate=
"2025-01-01"
/>
<fui-picker
:show=
"show.classify"
:layer=
"1"
:linkage=
"true"
:options=
"options.classify"
@
change=
"handleChangeClassify"
@
cancel=
"show.classify = false"
/>
<fui-picker
:show=
"show.address"
:options=
"options.address"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"show.address = false"
/>
<fui-toast
ref=
"toastRef"
/>
</
template
>
...
...
src/pages/chanxiao/supplyXuQiu.vue
浏览文件 @
c10f4b12
...
...
@@ -5,7 +5,7 @@
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
{
areaTree
,
getCodeByText
,
getTextByCode
}
from
'@/utils/areaDat
a'
import
{
getDictData
,
getText
}
from
'@/utils/dict/are
a'
import
{
useDictStore
}
from
'@/store/modules/dict'
const
dictStore
=
useDictStore
()
...
...
@@ -123,9 +123,8 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
pageData
.
options
.
address
=
areaTree
console
.
log
(
dictStore
.
getDictList
.
purchase_status
)
async
function
initDict
()
{
pageData
.
options
.
address
=
await
getDictData
()
pageData
.
options
.
status
=
dictStore
.
getDictList
.
purchase_status
.
map
((
item
)
=>
{
return
{
...
...
@@ -159,7 +158,7 @@
function
getDetails
(
id
)
{
ChanxiaoAPI
.
purchaseSellDetails
({
id
}).
then
((
res
)
=>
{
pageData
.
form
=
res
pageData
.
form
.
address
=
`
${
getTextByCode
(
res
.
province
)}
/
${
getTextByCode
(
res
.
city
)}
/
${
getTextByCode
(
res
.
country
)
}
`
pageData
.
form
.
address
=
`
${
res
.
province
}
/
${
res
.
city
}
/
${
res
.
country
}
`
pageData
.
form
.
statusText
=
pageData
.
options
.
status
.
find
((
item
)
=>
item
.
value
==
res
.
status
).
text
pageData
.
form
.
classifyText
=
pageData
.
options
.
classify
.
find
((
item
)
=>
item
.
value
==
res
.
classify
).
text
pageData
.
form
.
imageObj
=
pageData
.
form
.
image
&&
parseUrlInfo
(
pageData
.
form
.
image
)
...
...
@@ -196,7 +195,7 @@
pageData
.
show
.
classify
=
false
}
function
handleChangeAddress
(
e
)
{
pageData
.
form
.
address
=
e
.
text
.
join
(
'/
'
)
pageData
.
form
.
address
=
e
.
value
.
join
(
',
'
)
pageData
.
show
.
address
=
false
}
function
handleChangeStatus
(
e
)
{
...
...
@@ -268,11 +267,11 @@
* @param formData 表单数据
*/
function
changeAddressValue
(
formData
)
{
const
addressValue
=
formData
.
address
.
split
(
'
/
'
)
const
addressValue
=
formData
.
address
.
split
(
'
,
'
)
if
(
addressValue
.
length
===
3
)
{
formData
.
province
=
getCodeByText
(
addressValue
[
0
])
formData
.
city
=
getCodeByText
(
addressValue
[
1
])
formData
.
country
=
getCodeByText
(
addressValue
[
2
])
formData
.
province
=
addressValue
[
0
]
formData
.
city
=
addressValue
[
1
]
formData
.
country
=
addressValue
[
2
]
}
}
...
...
@@ -315,7 +314,7 @@
<text
class=
"label"
style=
"font-size: 28rpx"
>
请选择区域
</text>
<view
class=
"select-input"
@
click=
"show.address = true"
>
<text
class=
"time-text"
:class=
"
{ placeholder: !form.address }">
{{
form
.
address
||
'请选择区域
'
}}
{{
getText
(
form
.
address
,
' / '
)
||
'请选择省/市/区县
'
}}
</text>
</view>
</view>
...
...
@@ -327,12 +326,16 @@
<text
class=
"label"
style=
"font-size: 28rpx"
>
供应时间
</text>
<view
class=
"time-range"
>
<view
class=
"time-input"
@
click=
"show.time1 = true"
>
<text
class=
"time-text"
:class=
"
{ placeholder: !form.supplyStartDate }">
{{
form
.
supplyStartDate
||
'开始时间'
}}
<text
class=
"time-text"
:class=
"
{ placeholder: !form.supplyStartDate }" style="font-size: 26rpx">
{{
form
.
supplyStartDate
||
'开始时间'
}}
</text>
</view>
<text
class=
"time-separator"
>
-
</text>
<view
class=
"time-input"
@
click=
"show.time2 = true"
>
<text
class=
"time-text"
:class=
"
{ placeholder: !form.supplyEndDate }">
{{
form
.
supplyEndDate
||
'结束时间'
}}
<text
class=
"time-text"
:class=
"
{ placeholder: !form.supplyEndDate }" style="font-size: 26rpx">
{{
form
.
supplyEndDate
||
'结束时间'
}}
</text>
...
...
@@ -380,6 +383,7 @@
background-color
:
#e6f5e8
;
width
:
750
rpx
;
overflow-x
:
hidden
;
.mt20
{
margin-top
:
30
rpx
;
background
:
#fff
;
...
...
@@ -392,7 +396,7 @@
margin
:
30
rpx
auto
;
}
.
supply
-form
{
.
purchase
-form
{
background
:
transparent
;
}
...
...
@@ -422,193 +426,194 @@
//
添加点击区域样式
.select-input
{
position
:
relative
;
}
}
.form-row
{
display
:
flex
;
justify-content
:
space-between
;
}
.form-row
{
display
:
flex
;
justify-content
:
space-between
;
}
.half-width
{
width
:
48%
;
}
.half-width
{
width
:
48%
;
}
.align-center
{
align-items
:
center
;
}
.align-center
{
align-items
:
center
;
}
.label
{
display
:
block
;
font-size
:
28
rpx
;
color
:
#333333
;
font-weight
:
500
;
width
:
180
rpx
;
//
margin-right
:
20
rpx
;
}
.label
{
display
:
block
;
font-size
:
28
rpx
;
color
:
#333333
;
font-weight
:
500
;
width
:
180
rpx
;
//
margin-right
:
20
rpx
;
}
.input
{
width
:
100%
;
height
:
80
rpx
;
background
:
#f8f9fa
;
border-radius
:
8
rpx
;
padding
:
0
20
rpx
;
font-size
:
28
rpx
;
color
:
#333333
;
&::placeholder
{
color
:
#999999
;
}
}
.input
{
width
:
100%
;
height
:
80
rpx
;
background
:
#f8f9fa
;
border-radius
:
8
rpx
;
padding
:
0
20
rpx
;
font-size
:
28
rpx
;
color
:
#333333
;
&::placeholder
{
color
:
#999999
;
}
}
.price-range
{
display
:
flex
;
align-items
:
center
;
//
justify-content
:
space-between
;
}
.price-range
{
display
:
flex
;
align-items
:
center
;
//
justify-content
:
space-between
;
}
.price-input
{
width
:
15%
;
//
height
:
80
rpx
;
//
background
:
#f8f9fa
;
//
border-radius
:
8
rpx
;
padding
:
0
10
rpx
;
font-size
:
28
rpx
;
text-align
:
center
;
}
.price-input
{
width
:
15%
;
//
height
:
80
rpx
;
//
background
:
#f8f9fa
;
//
border-radius
:
8
rpx
;
padding
:
0
10
rpx
;
font-size
:
28
rpx
;
text-align
:
center
;
}
.price-separator
{
color
:
#666666
;
font-size
:
28
rpx
;
margin
:
0
10
rpx
;
}
.price-separator
{
color
:
#666666
;
font-size
:
28
rpx
;
margin
:
0
10
rpx
;
}
.select-input
{
flex
:
1
;
border-radius
:
8
rpx
;
padding
:
0
20
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
cursor
:
pointer
;
}
.select-input
{
flex
:
1
;
border-radius
:
8
rpx
;
padding
:
0
20
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
cursor
:
pointer
;
}
.select-text
{
font-size
:
28
rpx
;
color
:
#333333
;
padding
:
0
20
rpx
;
&.placeholder
{
color
:
#999999
;
}
}
.select-text
{
font-size
:
28
rpx
;
color
:
#333333
;
padding
:
0
20
rpx
;
&.placeholder
{
color
:
#999999
;
}
}
.select-arrow
{
color
:
#999999
;
font-size
:
24
rpx
;
line-height
:
1
;
}
.select-arrow
{
color
:
#999999
;
font-size
:
24
rpx
;
line-height
:
1
;
}
.time-range
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.time-range
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.time-input
{
width
:
45%
;
//
height
:
80
rpx
;
//
background
:
#f8f9fa
;
border-radius
:
8
rpx
;
display
:
flex
;
align-items
:
center
;
}
.time-input
{
width
:
45%
;
//
height
:
80
rpx
;
//
background
:
#f8f9fa
;
border-radius
:
8
rpx
;
display
:
flex
;
align-items
:
center
;
}
.time-text
{
font-size
:
28
rpx
;
color
:
#333333
;
.time-text
{
font-size
:
28
rpx
;
color
:
#333333
;
&.placeholder
{
color
:
#999999
;
}
}
&.placeholder
{
color
:
#999999
;
}
}
.time-separator
{
color
:
#666666
;
font-size
:
28
rpx
;
margin
:
0
10
rpx
;
}
.time-separator
{
color
:
#666666
;
font-size
:
28
rpx
;
margin
:
0
10
rpx
;
}
.upload-area
{
margin-top
:
10
rpx
;
}
.upload-area
{
margin-top
:
10
rpx
;
}
.custom-uploader
{
:deep(.uni-file-picker__container)
{
border
:
2
rpx
dashed
#d9d9d9
;
border-radius
:
8
rpx
;
background
:
#f8f9fa
;
}
}
.custom-uploader
{
:deep(.uni-file-picker__container)
{
border
:
2
rpx
dashed
#d9d9d9
;
border-radius
:
8
rpx
;
background
:
#f8f9fa
;
}
}
.upload-placeholder
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
height
:
200
rpx
;
color
:
#999999
;
}
.upload-placeholder
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
height
:
200
rpx
;
color
:
#999999
;
}
.upload-icon
{
font-size
:
48
rpx
;
margin-bottom
:
10
rpx
;
}
.upload-icon
{
font-size
:
48
rpx
;
margin-bottom
:
10
rpx
;
}
.upload-text
{
font-size
:
24
rpx
;
}
.upload-text
{
font-size
:
24
rpx
;
}
.submit-section
{
background
:
transparent
;
padding
:
40
rpx
0
;
}
.submit-section
{
background
:
transparent
;
padding
:
40
rpx
0
;
}
.submit-btn
{
width
:
100%
;
height
:
88
rpx
;
background
:
#5db66f
;
border-radius
:
44
rpx
;
color
:
#ffffff
;
font-size
:
32
rpx
;
font-weight
:
500
;
border
:
none
;
&:active
{
background
:
#4ca85c
;
opacity
:
0.9
;
}
}
}
::v-deep
.uni-input-placeholder
{
font-size
:
28
rpx
!important
;
color
:
#999999
!important
;
.submit-btn
{
width
:
100%
;
height
:
88
rpx
;
background
:
#5db66f
;
border-radius
:
44
rpx
;
color
:
#ffffff
;
font-size
:
32
rpx
;
font-weight
:
500
;
border
:
none
;
&:active
{
background
:
#4ca85c
;
opacity
:
0.9
;
}
}
}
:deep
(
.fui-button
)
{
width
:
690
rpx
;
border-color
:
#5db66f
!important
;
background
:
#5db66f
!important
;
}
::v-deep
.uni-input-placeholder
{
font-size
:
28
rpx
!important
;
color
:
#999999
!important
;
}
//
移除
fui-form
的默认样式
:deep
(
.fui-form
)
{
background
:
transparent
;
}
:deep
(
.fui-button
)
{
width
:
690
rpx
;
border-color
:
#5db66f
!important
;
background
:
#5db66f
!important
;
}
:deep
(
.fui-form__item
)
{
background
:
transparent
;
border
:
none
;
margin-bottom
:
0
;
padding
:
0
;
}
}
//
移除
fui-form
的默认样式
:deep
(
.fui-form
)
{
background
:
transparent
;
}
:deep
(
.fui-form__item
)
{
background
:
transparent
;
border
:
none
;
margin-bottom
:
0
;
padding
:
0
;
}
</
style
>
src/pages/fuwu/fuwu.vue
浏览文件 @
c10f4b12
...
...
@@ -75,7 +75,7 @@
title
:
'季节性用工'
,
description
:
'三农区域灵活用工服务'
,
actionText
:
'去发布'
,
url
:
'/pages/
nongjifuwu/farm-form
'
,
url
:
'/pages/
linghuoyonggong/linghuoyonggong?type=1
'
,
},
{
id
:
2
,
...
...
@@ -208,42 +208,10 @@
// 技能培训日历
trainingCalendar
:
{
days
:
[
{
id
:
1
,
month
:
'09月'
,
day
:
'10'
},
{
id
:
2
,
month
:
'09月'
,
day
:
'11'
},
{
id
:
3
,
month
:
'09月'
,
day
:
'12'
,
active
:
true
},
{
id
:
4
,
month
:
'09月'
,
day
:
'13'
},
{
id
:
5
,
month
:
'09月'
,
day
:
'14'
},
{
id
:
6
,
month
:
'09月'
,
day
:
'15'
},
{
id
:
7
,
month
:
'09月'
,
day
:
'16'
},
],
trainings
:
[
{
id
:
1
,
time
:
'09:30'
,
title
:
'有机农业种植技术'
,
description
:
'农技专家指导授课'
,
actionText
:
'报名'
,
badge
:
'机'
,
badgeType
:
'orange'
,
},
{
id
:
2
,
time
:
'14:00'
,
title
:
'有机农业种植技术'
,
description
:
'拖拉机专用技能'
,
actionText
:
'查看'
,
badge
:
'政'
,
badgeType
:
'blue'
,
},
{
id
:
3
,
time
:
'09:30'
,
title
:
'有机农业种植技术'
,
description
:
'农技专家指导授课'
,
actionText
:
'报名'
,
badge
:
'证'
,
badgeType
:
'green'
,
},
],
},
})
...
...
@@ -389,15 +357,6 @@
<view
class=
"codefun-flex-col section"
>
<view
class=
"codefun-flex-col group_2"
>
<view
class=
"codefun-flex-col"
>
<!--
<view
class=
"codefun-flex-row codefun-justify-center codefun-items-center codefun-relative group_3"
>
<text
class=
"font text"
>
{{
pageData
.
header
.
title
}}
</text>
<image
class=
"image_6 pos_2"
src=
"/static/images/codefun/2d7ca3ba49afaa9f885afb0ba601a403.png"
/>
</view>
-->
<view
class=
"codefun-flex-col"
>
<view
class=
"codefun-flex-row codefun-items-center section_2"
>
<text
class=
"codefun-shrink-0 font_2"
>
岗位
</text>
...
...
@@ -476,43 +435,29 @@
</view>
<view
class=
"codefun-flex-row equal-division_2 section_1"
>
<template
v-for=
"(product, index) in pageData.financialProducts"
:key=
"product.id"
>
<view
class=
"codefun-flex-col group_12"
:class=
"
{
<view
class=
"codefun-flex-col group_12"
:class=
"
{
group_36: product.id === 1,
group_32: product.id === 2,
group_33: product.id === 3,
}"
@click="onFinancialProductClick(product)"
>
}" @click="onFinancialProductClick(product)">
<image
class=
"codefun-self-center image_10"
:src=
"product.image"
/>
<template
v-if=
"product.name"
>
<text
class=
"codefun-self-center font_11"
:class=
"`text_$
{19 + product.id}`">
{{
product
.
name
}}
</text>
<text
class=
"codefun-self-center font_11"
:class=
"`text_$
{19 + product.id}`">
{{
product
.
name
}}
</text>
<text
class=
"codefun-self-center font_11"
>
{{
product
.
subName
}}
</text>
</
template
>
<
template
v-else
>
<text
class=
"codefun-self-stretch font_11 text_22"
>
{{
product
.
description
}}
</text>
</
template
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-self-stretch"
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-self-stretch"
:class=
"{
'text-wrapper_2 view_1': product.id === 1,
'text-wrapper_14': product.id === 2,
'text-wrapper_2 view_2': product.id === 3,
}"
>
<text
class=
"font_12"
:class=
"`text_${24 + product.id}`"
>
{{
product.actionText
}}
</text>
}"
>
<text
class=
"font_12"
:class=
"`text_${24 + product.id}`"
>
{{product.actionText}}
</text>
</view>
</view>
<view
v-if=
"index < pageData.financialProducts.length - 1"
class=
"section_5 horiz-divider"
/>
<view
v-if=
"index < pageData.financialProducts.length - 1"
class=
"section_5 horiz-divider"
/>
</template>
</view>
</view>
...
...
@@ -520,32 +465,17 @@
<text
class=
"codefun-self-start font_5 text_26"
>
农资交易
</text>
<view
class=
"codefun-flex-col codefun-self-stretch section_6 codefun-mt-16"
>
<view
class=
"grid"
>
<view
v-for=
"product in pageData.agriculturalProducts"
:key=
"product.id"
class=
"codefun-flex-col grid-item_3"
@
click=
"onAgriculturalProductClick(product)"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch section_10"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_3"
>
<view
v-for=
"product in pageData.agriculturalProducts"
:key=
"product.id"
class=
"codefun-flex-col grid-item_3"
@
click=
"onAgriculturalProductClick(product)"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch section_10"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_3"
>
<text
class=
"font_13"
>
{{ product.labels_dictText.split(',')[0] }}
</text>
</view>
</view>
<text
class=
"codefun-self-start font text_27 codefun-mt-10 ellipsis"
>
{{
product.name
}}
</text>
<text
class=
"codefun-self-start font_1 text_27 codefun-mt-10"
>
¥{{ product.sellPrice }}
</text
>
<text
class=
"codefun-self-start font text_27 codefun-mt-10 ellipsis"
style=
"font-size: 28rpx;"
>
{{product.name}}
</text>
<text
class=
"codefun-self-start font_1 text_27 codefun-mt-10"
style=
"font-size: 28rpx;"
>
¥{{ product.sellPrice }}
</text>
</view>
</view>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4 codefun-mt-14 !hidden"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4 codefun-mt-14 !hidden"
>
<text
class=
"font_15 text_29"
>
作业预约
</text>
</view>
</view>
...
...
@@ -554,54 +484,26 @@
<text
class=
"codefun-self-start font_5"
>
一站式解决农机问题
</text>
<view
class=
"codefun-flex-col codefun-self-stretch section_11"
>
<view
class=
"codefun-flex-row equal-division_3"
>
<view
v-for=
"service in pageData.farmMachineryServices"
:key=
"service.id"
class=
"codefun-flex-col equal-division-item_3"
:class=
"{
section_12: service.id === 1,
'section_13 ml-11': service.id === 2,
}"
@
click=
"onFarmMachineryServiceClick(service)"
>
<view
v-for=
"service in pageData.farmMachineryServices"
:key=
"service.id"
class=
"codefun-flex-col equal-division-item_3"
:class=
"{section_12: service.id === 1, 'section_13 ml-11': service.id === 2,}"
@
click=
"onFarmMachineryServiceClick(service)"
>
<view
class=
"codefun-flex-row codefun-items-center codefun-self-stretch"
>
<image
class=
"image_11"
:src=
"service.image"
/>
<text
class=
"font_5 text_33 ml-7"
>
{{ service.title }}
</text>
</view>
<text
class=
"codefun-self-start font_10"
:class=
"`text_${31 + service.id} codefun-mt-10`"
>
{{ service.description }}
</text
>
<view
class=
"codefun-flex-row codefun-justify-end codefun-items-center codefun-self-stretch"
:class=
"{
'group_13 codefun-mt-10': service.id === 1,
'codefun-mt-10': service.id === 2,
}"
>
<image
class=
"image_12"
:class=
"{ image_13: service.id === 1, image_14: service.id === 2 }"
:src=
"service.actionImage"
/>
<text
class=
"font_10"
:class=
"`text_${33 + service.id}`"
>
{{
service.actionText
}}
</text>
<text
class=
"codefun-self-start font_10"
:class=
"`text_${31 + service.id} codefun-mt-10`"
>
{{ service.description }}
</text>
<view
class=
"codefun-flex-row codefun-justify-end codefun-items-center codefun-self-stretch"
:class=
"{'group_13 codefun-mt-10': service.id === 1, 'codefun-mt-10': service.id === 2,}"
>
<image
class=
"image_12"
:class=
"{ image_13: service.id === 1, image_14: service.id === 2 }"
:src=
"service.actionImage"
/>
<text
class=
"font_10"
:class=
"`text_${33 + service.id}`"
>
{{service.actionText}}
</text>
</view>
</view>
</view>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-self-stretch text-wrapper_4 codefun-mt-14"
@
click=
"Navigate.to('/pages/nongjifuwu/nongjifuwu')"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-self-stretch text-wrapper_4 codefun-mt-14"
@
click=
"Navigate.to('/pages/nongjifuwu/nongjifuwu')"
>
<text
class=
"font_15 text_29"
>
作业预约
</text>
</view>
<text
class=
"codefun-self-center font_10 text_36 codefun-mt-14"
>
紧急报修30分钟响应
</text>
</view>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch group_14"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch group_14"
>
<text
class=
"font_5"
>
一站式解决农机问题
</text>
<!-- <text class="font_6 text_37" @click="onViewAllMachineryCases">全部案例</text> -->
</view>
...
...
@@ -659,7 +561,6 @@
</view>
</view>
<view
class=
"codefun-flex-col codefun-mt-24"
>
<text
class=
"codefun-self-start font_5 text_40"
>
技能培训
</text>
<view
class=
"codefun-flex-col codefun-self-stretch codefun-mt-18"
>
<view
class=
"codefun-flex-col codefun-justify-start section_17"
>
<view
class=
"codefun-flex-row equal-division_4"
>
...
...
src/pages/linghuoyonggong/components/register-dialog.vue
浏览文件 @
c10f4b12
...
...
@@ -28,6 +28,7 @@
],
})
function
open
(
params
)
{
reset
()
pageData
.
form
.
employmentId
=
params
.
id
pageData
.
form
.
userId
=
getUserInfo
.
id
pageData
.
show
=
true
...
...
@@ -72,15 +73,10 @@
</view>
<view
class=
"text-left"
>
<fui-form
ref=
"formRef"
>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写预留姓名"
v-model=
"pageData.form.reservedname"
/>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写预留手机"
v-model=
"pageData.form.reservedmobile"
/>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写姓名"
v-model=
"pageData.form.reservedname"
required
maxlength=
"16"
placeholderStyle=
"margin-left: 10rpx"
/>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写预留手机"
v-model=
"pageData.form.reservedmobile"
required
type=
"number"
maxlength=
"11"
placeholderStyle=
"margin-left: 10rpx"
/>
<view
style=
"margin-top: 30rpx"
>
<fui-button
text=
"
确定
"
bold
radius=
"96rpx"
@
click=
"submit"
/>
<fui-button
text=
"
提交
"
bold
radius=
"96rpx"
@
click=
"submit"
/>
</view>
</fui-form>
</view>
...
...
src/pages/linghuoyonggong/form.vue
浏览文件 @
c10f4b12
...
...
@@ -7,6 +7,7 @@
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
{
areaTree
,
getCodeByText
,
getTextByCode
}
from
'@/utils/areaData'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
{
getDictData
}
from
'@/utils/dict/area'
const
dictStore
=
useDictStore
()
const
userStore
=
useUserStore
()
...
...
@@ -63,56 +64,46 @@
},
rules
:
[
{
name
:
'
nam
e'
,
name
:
'
typ
e'
,
rule
:
[
'required'
],
msg
:
[
'请输入名称'
],
},
{
name
:
'workers'
,
msg
:
[
'请选择用工类型'
],
},{
name
:
'name'
,
rule
:
[
'required'
],
msg
:
[
'请输入工作内容'
],
},
{
msg
:
[
'请输入标题'
],
},
{
name
:
'workers'
,
rule
:
[
'required'
],
msg
:
[
'请输入工人数量'
],
},
{
},
{
name
:
'price'
,
rule
:
[
'required'
],
msg
:
[
'请输入价钱'
],
},
{
name
:
'type'
,
msg
:
[
'请输入用工单价'
],
},
{
name
:
'starttime'
,
rule
:
[
'required'
],
msg
:
[
'请选择类型'
],
},
{
msg
:
[
'请选择开始时间'
],
},
{
name
:
'estimatedendtime'
,
rule
:
[
'required'
],
msg
:
[
'请选择预计结束时间'
],
},
{
name
:
'content'
,
rule
:
[
'required'
],
msg
:
[
'请输入工作内容'
],
},
{
name
:
'area'
,
rule
:
[
'required'
],
msg
:
[
'请选择地区'
],
},
{
},
{
name
:
'address'
,
rule
:
[
'required'
],
msg
:
[
'请选择详细地址'
],
},
{
msg
:
[
'请输入详细地址'
],
},
{
name
:
'urgentdegree'
,
rule
:
[
'required'
],
msg
:
[
'请选择紧急程度'
],
},
{
name
:
'starttime'
,
rule
:
[
'required'
],
msg
:
[
'请选择开始时间'
],
},
{
name
:
'estimatedendtime'
,
rule
:
[
'required'
],
msg
:
[
'请选择预计结束时间'
],
},
{
},
{
name
:
'picture'
,
rule
:
[
'required'
],
msg
:
[
'请上传图片'
],
...
...
@@ -122,10 +113,8 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
pageData
.
options
.
area
=
areaTree
console
.
log
(
dictStore
.
getDictList
.
purchase_status
)
async
function
initDict
()
{
pageData
.
options
.
area
=
await
getDictData
()
pageData
.
options
.
urgentdegree
=
dictStore
.
getDictList
.
employment_urgent
.
map
((
item
)
=>
{
return
{
value
:
item
.
value
,
...
...
@@ -142,7 +131,7 @@
function
getCurrentAddressInfo
()
{
if
(
!
uni
.
getStorageSync
(
'location'
))
return
return
const
{
lon
,
lat
}
=
uni
.
getStorageSync
(
'location'
)
UserInfoAPI
.
location
({
...
...
@@ -288,18 +277,16 @@ return
<view
class=
"formBox"
>
<fui-form
ref=
"formRef"
label-weight=
"auto"
top=
"60"
:disabled=
"form.id ? true : false"
>
<view
class=
"mt20"
>
<fui-input
required
label=
"
名称"
placeholder=
"请输入名称"
v-model=
"form.name"
labelSize=
"28"
label-width=
"180
"
/>
<fui-input
required
label=
"
工作内容"
placeholder=
"请输入工作内容"
v-model=
"form.content"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
label=
"
用工类型"
placeholder=
"请选择用工类型"
v-model=
"form.typeText"
labelSize=
"28"
size=
"28"
label-width=
"180"
@
click=
"show.type = true
"
/>
<fui-input
required
label=
"
标题"
placeholder=
"请输入标题"
v-model=
"form.name"
labelSize=
"28"
label-width=
"180"
maxlength=
"16"
size=
"28"
/>
</view>
<view
class=
"mt20"
>
<fui-input
required
type=
"number"
:min=
"0"
label=
"工人数量"
placeholder=
"请输入工人数量"
v-model=
"form.workers"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
type=
"number"
label=
"价钱"
:min=
"0"
placeholder=
"请输入价钱"
v-model=
"form.price"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
label=
"类型"
placeholder=
"请选择类型"
v-model=
"form.typeText"
labelSize=
"28"
label-width=
"180"
@
click=
"show.type = true"
/>
</view>
<view
class=
"mt20"
>
<fui-input
required
label=
"地区"
placeholder=
"请选择地区"
v-model=
"form.areaText"
labelSize=
"28"
label-width=
"180"
@
click=
"show.area = true"
/>
<fui-input
required
label=
"详细地址"
placeholder=
"请输入详细地址"
v-model=
"form.address"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
label=
"紧急程度"
placeholder=
"请选择紧急程度"
v-model=
"form.urgentdegreeText"
labelSize=
"28"
label-width=
"180"
@
click=
"show.urgentdegree = true"
/>
<fui-input
required
type=
"number"
:min=
"0"
label=
"工人数量"
placeholder=
"请输入工人数量"
v-model=
"form.workers"
labelSize=
"28"
label-width=
"180"
maxlength=
"4"
size=
"28"
>
<view
slot=
"suffix"
class=
"unit-slot"
>
人
</view>
</fui-input>
<fui-input
required
type=
"number"
label=
"用工单价"
:min=
"0"
placeholder=
"请输入用工单价"
v-model=
"form.price"
labelSize=
"28"
label-width=
"180"
maxlength=
"6"
size=
"28"
>
<view
slot=
"suffix"
class=
"unit-slot"
>
元/人
</view>
</fui-input>
<!-- 时间范围 -->
<view
class=
"form-section"
style=
"padding: 0 30rpx"
>
<view
class=
"form-item flex align-center"
>
...
...
@@ -310,7 +297,7 @@ return
{{
form
.
starttime
||
'开始时间'
}}
</text>
</view>
<text
class=
"time-separator"
>
-
</text>
<text
class=
"time-separator"
>
至
</text>
<view
class=
"time-input"
@
click=
"show.time2 = true"
>
<text
class=
"time-text"
:class=
"
{ placeholder: !form.estimatedendtime }">
{{
form
.
estimatedendtime
||
'结束时间'
}}
...
...
@@ -319,17 +306,16 @@ return
</view>
</view>
</view>
<fui-input
required
label=
"工作内容"
placeholder=
"请输入工作内容"
v-model=
"form.content"
labelSize=
"28"
label-width=
"180"
maxlength=
"32"
size=
"28"
/>
</view>
<view
class=
"mt20"
>
<fui-input
required
label=
"地区"
placeholder=
"请选择地区"
v-model=
"form.areaText"
labelSize=
"28"
label-width=
"180"
@
click=
"show.area = true"
size=
"28"
/>
<fui-input
required
label=
"详细地址"
placeholder=
"请输入详细地址"
v-model=
"form.address"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-input
required
label=
"紧急程度"
placeholder=
"请选择紧急程度"
v-model=
"form.urgentdegreeText"
labelSize=
"28"
label-width=
"180"
size=
"28"
@
click=
"show.urgentdegree = true"
/>
</view>
<view
class=
"bg-white mt20"
style=
"padding: 0.875rem 1rem"
>
<view
class=
"mb-1 flex justify-start"
><span
style=
"color: red;"
>
*
</span>
图片
</view>
<uni-file-picker
:value=
"form.pictureObj"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
/>
<view
class=
"mb-1 flex justify-start"
style=
"font-size: 28rpx;"
><span
style=
"color: red;"
>
*
</span>
图片
</view>
<uni-file-picker
:value=
"form.pictureObj"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
/>
</view>
<view
class=
"fui-btn__box"
v-if=
"!form.id"
style=
"margin-top: 30rpx"
>
<fui-button
text=
"发布用工"
bold
radius=
"96rpx"
@
click=
"submit"
/>
...
...
@@ -517,4 +503,9 @@ return
margin-bottom
:
0
;
padding
:
0
;
}
.unit-slot
{
padding
:
0
16
rpx
;
color
:
#333
;
font-size
:
28
rpx
;
}
</
style
>
src/pages/linghuoyonggong/linghuoyonggong.vue
浏览文件 @
c10f4b12
...
...
@@ -5,13 +5,13 @@
import
{
getTextByCode
}
from
'@/utils/areaData'
import
*
as
LinghuoyonggongAPI
from
'@/api/model/linghuoyonggong'
import
Navigate
from
'@/utils/page/navigate'
import
{
getText
}
from
'@/utils/dict/area'
onLoad
((
option
)
=>
{
pageData
.
currentEmploymentId
=
Number
(
option
.
type
)
||
1
})
onShow
(()
=>
{
// pageData.purchaseDemands = []
pageData
.
search
.
pageNo
=
1
if
(
pageData
.
currentEmploymentId
===
1
)
{
pageData
.
search
.
publishstatu
=
1
...
...
@@ -51,65 +51,7 @@
currentEmploymentId
:
1
,
// 用工列表
employmentList
:
[
// {
// id: 1,
// image: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=f33c4419bab5b0fb3a63b5b3006059f2.png',
// title: '蔬菜种植',
// duration: '预计3天',
// people: '需要5人',
// price: '150元/天',
// distance: '3.2km',
// rating: '4',
// actionText: '我想去',
// icons: {
// duration:
// 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=56353ebdea095baedbcb33fc53f68a03.png',
// people: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=85c3b17d5049630ed51fd57b701f047f.png',
// price: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=9e806e0315ec11c12ec9e2b6870dd395.png',
// location:
// 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=39c448ae66659127e7bcd035ea16e0de.png',
// },
// },
// {
// id: 2,
// image: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=f33c4419bab5b0fb3a63b5b3006059f2.png',
// title: '果树修剪',
// duration: '预计5天',
// people: '需要3人',
// price: '180元/天',
// distance: '2.1km',
// rating: '5',
// actionText: '我想去',
// icons: {
// duration:
// 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=56353ebdea095baedbcb33fc53f68a03.png',
// people: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=85c3b17d5049630ed51fd57b701f047f.png',
// price: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=9e806e0315ec11c12ec9e2b6870dd395.png',
// location:
// 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=39c448ae66659127e7bcd035ea16e0de.png',
// },
// },
// {
// id: 3,
// image: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=f33c4419bab5b0fb3a63b5b3006059f2.png',
// title: '水稻插秧',
// duration: '预计7天',
// people: '需要8人',
// price: '120元/天',
// distance: '5.6km',
// rating: '3',
// actionText: '我想去',
// icons: {
// duration:
// 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=56353ebdea095baedbcb33fc53f68a03.png',
// people: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=85c3b17d5049630ed51fd57b701f047f.png',
// price: 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=9e806e0315ec11c12ec9e2b6870dd395.png',
// location:
// 'https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=39c448ae66659127e7bcd035ea16e0de.png',
// },
// },
],
employmentList
:
[],
total
:
0
,
})
...
...
@@ -176,15 +118,7 @@
// 批量处理数据,避免多次DOM操作
const
processedRecords
=
records
.
map
((
item
)
=>
{
// 缓存区域处理结果
const
cacheKey
=
item
.
area
if
(
areaCache
.
has
(
cacheKey
))
{
item
.
area
=
areaCache
.
get
(
cacheKey
)
}
else
{
const
areaCodes
=
item
.
area
.
split
(
','
)
const
areaText
=
`
${
getTextByCode
(
areaCodes
[
0
])}
${
getTextByCode
(
areaCodes
[
1
])}
`
areaCache
.
set
(
cacheKey
,
areaText
)
item
.
area
=
areaText
}
item
.
area
=
getText
(
item
.
area
,
' / '
)
// 计算天数并缓存结果
if
(
item
.
starttime
&&
item
.
estimatedendtime
)
{
...
...
@@ -298,27 +232,18 @@ return
<view
class=
"codefun-flex-col page"
>
<view
class=
"codefun-flex-col codefun-self-stretch"
>
<view
class=
"codefun-mt-14 codefun-flex-row group_2 gap-2"
>
<view
v-for=
"tab in pageData.categoryTabs"
:key=
"tab.id"
class=
"codefun-flex-col codefun-justify-start codefun-items-center"
:class=
"[tab.id === pageData.search.type ? 'text-wrapper' : 'text-wrapper_2']"
@
click=
"onCategoryTabClick(tab)"
>
<view
v-for=
"tab in pageData.categoryTabs"
:key=
"tab.id"
class=
"codefun-flex-col codefun-justify-start codefun-items-center"
:class=
"[tab.id === pageData.search.type ? 'text-wrapper' : 'text-wrapper_2']"
@
click=
"onCategoryTabClick(tab)"
>
<text
class=
"font_2 text_2"
>
{{
tab
.
name
}}
</text>
</view>
</view>
<view
class=
"codefun-mt-14 codefun-flex-col group_3"
>
<view
class=
"codefun-flex-row section_2"
>
<view
v-for=
"tab in pageData.employmentTabs"
:key=
"tab.id"
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-50p"
:class=
"[tab.id === pageData.currentEmploymentId ? 'text-wrapper_3' : 'codefun-self-start']"
@
click=
"onEmploymentTabClick(tab)"
>
<view
v-for=
"tab in pageData.employmentTabs"
:key=
"tab.id"
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-50p"
:class=
"[tab.id === pageData.currentEmploymentId ? 'text-wrapper_3' : 'codefun-self-start']"
@
click=
"onEmploymentTabClick(tab)"
>
<text
class=
"font_2"
>
{{
tab
.
name
}}
</text>
...
...
@@ -329,35 +254,21 @@ return
<fui-empty
marginTop=
"100"
src=
"/src/static/images/no-data.png"
title=
"暂无数据"
/>
</view>
<template
v-else
>
<view
class=
"codefun-flex-col list-item"
v-for=
"item in pageData.employmentList"
:key=
"item.id"
@
click=
"onEmploymentItemClick(item)"
>
<view
class=
"codefun-flex-col list-item"
v-for=
"item in pageData.employmentList"
:key=
"item.id"
@
click=
"onEmploymentItemClick(item)"
>
<view
class=
"codefun-flex-row"
>
<image
class=
"image_7"
:src=
"item.picture"
lazy-load
/>
<view
class=
"codefun-flex-col codefun-flex-1 codefun-self-center group_4"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
>
<text
class=
"codefun-self-start font"
>
{{
item
.
name
}}
</text>
<view>
<image
class=
"codefun-self-start image_8"
src=
"/src/static/images/codefun/c98744e63719b5413f260ec6a899ee20.png"
/>
<image
class=
"codefun-self-start image_8"
src=
"/src/static/images/codefun/c98744e63719b5413f260ec6a899ee20.png"
/>
<text
class=
"codefun-self-start font_3 text_9"
>
{{
item
.
area
}}
</text>
</view>
</view>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch mt-11"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch mt-11"
>
<view
class=
"flex codefun-items-center gap-1"
>
<image
class=
"image_9"
src=
"/src/static/images/time.svg"
/>
<text
class=
"font_4"
>
预计
{{
item
.
daysDiff
||
getDaysDiff
(
item
.
starttime
,
item
.
estimatedendtime
)
}}
天
</text
>
<text
class=
"font_4"
>
预计
{{
item
.
daysDiff
||
getDaysDiff
(
item
.
starttime
,
item
.
estimatedendtime
)
}}
天
</text>
</view>
<view
class=
"flex codefun-items-center gap-1"
>
<image
class=
"image_9"
src=
"/src/static/images/person.svg"
/>
...
...
@@ -371,15 +282,10 @@ return
</view>
</view>
<view
class=
"codefun-mt-8 codefun-flex-row codefun-justify-between codefun-items-center"
>
<view
class=
"flex-center"
>
<fui-rate
:score=
"item.urgentdegree"
:size=
"36"
/>
<view
class=
"flex-center"
>
<fui-rate
:score=
"item.urgentdegree"
:size=
"36"
/>
<text
class=
"font_5 ml-1"
>
{{
item
.
urgentdegree
}}
</text>
</view>
<view
v-if=
"pageData.currentEmploymentId !== 2"
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4"
@
click
.
stop=
"onQuoteClick(item)"
>
<view
v-if=
"pageData.currentEmploymentId !== 2"
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4"
@
click
.
stop=
"onQuoteClick(item)"
>
<text
class=
"font_6 text_12"
>
我想去
</text>
</view>
</view>
...
...
@@ -388,12 +294,10 @@ return
</view>
</view>
</view>
<!-- <image class="codefun-self-end image_7 image_12 mt-269" :src="pageData.bottomImage" /> -->
</view>
<fui-fab
position=
"right"
distance=
"10"
bottom=
"240"
width=
"96"
@
click=
"handlePublish"
>
<view
class=
"text-white text-center"
>
<!-- <image src="/src/static/images/chanxiao/notepad.svg" style="width: 40rpx" mode="widthFix"></image> -->
<view
class=
"fab-icon"
/>
<view
style=
"font-size: 24rpx"
>
发布
</view>
</view>
...
...
src/pages/nongchang/nongchang.vue
浏览文件 @
c10f4b12
...
...
@@ -19,6 +19,8 @@
getCommonToolsList
()
// 农技课堂
getAgricultureClassList
()
// 智能设备
getDeviceList
()
})
// 下拉刷新
...
...
@@ -176,28 +178,11 @@
],
// 智能设备
smartDevices
:
[
{
id
:
1
,
name
:
'土壤监测仪'
,
image
:
'/static/images/codefun/8bd62352939b47e71f09a93a6ab344b2.png'
,
status
:
'在线'
,
statusColor
:
'#13e000'
,
},
{
id
:
2
,
name
:
'监测仪A'
,
image
:
'/static/images/codefun/81937c2666c800cf5966c29c2891b7c4.png'
,
status
:
'掉线'
,
statusColor
:
'#75777c'
,
},
{
id
:
3
,
name
:
'监测仪B'
,
image
:
'/static/images/codefun/8bd62352939b47e71f09a93a6ab344b2.png'
,
status
:
'在线'
,
statusColor
:
'#13e000'
,
},
smartDevices
:
[],
smartDeviceIcon
:
[
'/static/images/codefun/8bd62352939b47e71f09a93a6ab344b2.png'
,
'/static/images/codefun/81937c2666c800cf5966c29c2891b7c4.png'
,
],
// 信用中心
...
...
@@ -272,6 +257,12 @@
})
}
function
getDeviceList
()
{
NongChangAPI
.
getDeviceList
({}).
then
((
res
)
=>
{
pageData
.
smartDevices
=
res
.
records
})
}
// 菜单点击事件
function
onMenuItemClick
(
item
:
any
)
{
console
.
log
(
'点击菜单项:'
,
item
)
...
...
@@ -738,9 +729,12 @@
:key=
"device.id"
class=
"section_16 codefun-flex-row codefun-justify-center codefun-items-center codefun-shrink-0 codefun-relative"
>
<image
class=
"image_13"
:src=
"device.image"
/>
<image
class=
"image_13"
:src=
"device.isOnline === 1 ? pageData.smartDeviceIcon[0] : pageData.smartDeviceIcon[1]"
/>
<view
class=
"codefun-ml-8 codefun-flex-col"
>
<text
class=
"font_1
4"
:class=
"`text_${58 + index}`"
>
{{ device.n
ame }}
</text>
<text
class=
"font_1
0"
>
{{ device.deviceN
ame }}
</text>
<view
class=
"codefun-mt-10 codefun-flex-row codefun-items-center"
>
<view
class=
"section_17"
v-if=
"index !== 1"
/>
<view
class=
"section_18"
v-if=
"index === 1"
/>
...
...
@@ -749,7 +743,7 @@
:class=
"index !== 1 ? 'text_59' : 'text_60'"
:style=
"{ color: device.statusColor }"
>
{{ device.
status
}}
{{ device.
isOnline_dictText
}}
</text>
</view>
</view>
...
...
@@ -1773,8 +1767,8 @@
.image_13
{
border-radius
:
24
rpx
;
width
:
92
rpx
;
height
:
92
rpx
;
width
:
75
rpx
;
height
:
75
rpx
;
}
.font_14
{
...
...
src/pages/nongjifuwu/components/apply-dialog.vue
浏览文件 @
c10f4b12
...
...
@@ -2,11 +2,19 @@
import
{
reactive
}
from
'vue'
import
*
as
NongjifuwuAPI
from
'@/api/model/nongjifuwu'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
const
{
getUserInfo
}
=
useUserStore
()
const
pageData
=
reactive
({
show
:
false
,
areaShow
:
{
time
:
false
,
classify
:
false
,
address
:
false
,
},
options
:
null
,
scopeText
:
null
,
content
:
''
,
form
:
{
machineId
:
''
,
...
...
@@ -65,6 +73,7 @@
}
function
open
(
params
)
{
reset
()
pageData
.
form
.
machineId
=
params
.
id
pageData
.
form
.
serviceType
=
params
.
serviceType
pageData
.
form
.
userId
=
getUserInfo
.
id
...
...
@@ -72,6 +81,7 @@
}
function
close
()
{
pageData
.
show
=
false
pageData
.
areaShow
.
address
=
false
}
function
reset
()
{
pageData
.
form
=
{
...
...
@@ -86,6 +96,7 @@
phone
:
''
,
demand
:
''
,
}
pageData
.
scopeText
=
null
}
const
formRef
=
ref
()
function
submit
()
{
...
...
@@ -102,6 +113,14 @@
}
})
}
function
handleChangeAddress
(
e
)
{
pageData
.
form
.
scope
=
e
.
value
.
join
(
','
)
pageData
.
scopeText
=
getText
(
pageData
.
form
.
scope
,
' / '
)
pageData
.
areaShow
.
address
=
false
}
onShow
(()
=>
{
pageData
.
options
=
getDictData
()
})
defineExpose
({
open
,
close
,
...
...
@@ -111,23 +130,31 @@
<
template
>
<fui-dialog
title=
""
:buttons=
"[]"
:show=
"pageData.show"
maskClosable
>
<view
class=
"title flex justify-center"
>
<view
class=
"flex-1"
>
我有需要
</view>
<view
class=
"flex-1"
>
预约表单
</view>
<fui-icon
class=
"close flex-basis"
name=
"close"
size=
"46"
color=
"#999999"
@
click=
"close"
/>
</view>
<view
class=
"text-left"
>
<fui-form
ref=
"formRef"
>
<fui-input
marginTop=
"30"
size=
"24"
placeholder=
"请填写手机号码"
v-model=
"pageData.form.phone"
required
/>
<fui-input
marginTop=
"30"
size=
"24"
placeholder=
"请选择作业区域"
v-model=
"pageData.form.scope"
required
/>
<fui-input
marginTop=
"30"
size=
"24"
placeholder=
"请填写详细地址"
v-model=
"pageData.form.address"
required
/>
<fui-input
marginTop=
"30"
size=
"24"
placeholder=
"请选择作业时间"
v-model=
"pageData.form.time"
@
click=
"dict.show.time = true"
required
/>
<fui-textarea
v-model=
"pageData.form.demand"
:marginTop=
"30"
size=
"24"
placeholder=
"简要说明作业
需求"
required
/>
<fui-input
marginTop=
"30"
size=
"24"
type=
"number"
maxlength=
"11"
placeholder=
"请填写手机号码"
v-model=
"pageData.form.phone"
required
placeholderStyle=
"margin-left: 10rpx;"
/>
<fui-input
marginTop=
"30"
size=
"24"
disabled
@
click=
"pageData.areaShow.address = true"
placeholder=
"请选择作业区域"
v-model=
"pageData.scopeText"
required
placeholderStyle=
"margin-left: 10rpx;"
/>
<fui-input
marginTop=
"30"
size=
"24"
placeholder=
"请填写详细地址"
v-model=
"pageData.form.address"
required
placeholderStyle=
"margin-left: 10rpx;"
/>
<fui-input
marginTop=
"30"
size=
"24"
placeholder=
"请选择作业时间"
v-model=
"pageData.form.time"
@
click=
"dict.show.time = true"
required
placeholderStyle=
"margin-left: 10rpx;"
/>
<fui-textarea
v-model=
"pageData.form.demand"
:marginTop=
"30"
size=
"24"
placeholder=
"简要说明作业
要求"
flexStart
required
placeholderStyle=
"margin-left: 10rpx;"
height=
"100rpx"
/>
<view
style=
"margin-top: 30rpx"
>
<fui-button
type=
"warning"
text=
"
确定
"
bold
radius=
"96rpx"
@
click=
"submit"
/>
<fui-button
type=
"warning"
text=
"
提交
"
bold
radius=
"96rpx"
@
click=
"submit"
/>
</view>
</fui-form>
</view>
</fui-dialog>
<fui-date-picker
:show=
"dict.show.time"
type=
"3"
range
@
change=
"handleTimeChange"
@
cancel=
"handleTimeCancel"
/>
<fui-picker
:show=
"pageData.areaShow.address"
:options=
"pageData.options"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"pageData.areaShow.address = false"
/>
</
template
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/nongjifuwu/farm-form.vue
浏览文件 @
c10f4b12
...
...
@@ -4,6 +4,7 @@
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
nongjifuwu
from
'@/api/model/nongjifuwu'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
const
userStore
=
useUserStore
()
const
globSetting
=
useGlobSetting
()
...
...
@@ -91,42 +92,8 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
nongjifuwu
.
cascaderHn
().
then
((
res
)
=>
{
pageData
.
options
.
address
=
JSON
.
parse
(
JSON
.
stringify
(
res
[
0
].
children
).
replaceAll
(
'label'
,
'text'
))
})
}
function
getScope
(
scope
:
any
)
{
if
(
!
scope
||
!
pageData
.
options
.
address
)
{
return
''
}
const
values
=
scope
.
split
(
','
)
const
labels
=
[]
// 递归查找label
const
findLabel
=
(
nodes
,
value
)
=>
{
for
(
const
node
of
nodes
)
{
if
(
node
.
value
===
value
)
{
return
node
.
text
}
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
const
found
=
findLabel
(
node
.
children
,
value
)
if
(
found
)
{
return
found
}
}
}
return
null
// 如果没找到,返回原始value
}
for
(
const
value
of
values
)
{
const
text
=
findLabel
(
pageData
.
options
.
address
,
value
.
trim
())
labels
.
push
(
text
)
}
return
labels
?
labels
.
join
(
' / '
)
:
''
async
function
initDict
()
{
pageData
.
options
.
address
=
await
getDictData
()
}
function
getDetails
(
id
)
{
...
...
@@ -244,50 +211,20 @@
<view
class=
"formBox"
>
<fui-form
ref=
"formRef"
label-weight=
"auto"
top=
"60"
:disabled=
"form.id ? true : false"
>
<view
class=
"mt20"
>
<fui-input
required
label=
"服务名称"
placeholder=
"请输入服务名称"
v-model=
"form.name"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
label=
"服务名称"
placeholder=
"请输入服务名称"
v-model=
"form.name"
labelSize=
"28"
label-width=
"180"
maxlength=
"16"
/>
<view
class=
"form-item required flex align-center"
style=
"padding: 20rpx 10rpx"
>
<text
class=
"label"
>
服务范围
</text>
<view
class=
"time-input"
@
click=
"show.address = true"
>
<text
class=
"select-text"
:class=
"
{ placeholder: !pageData.form.scope }">
{{
get
Scope
(
pageData
.
form
.
scope
)
||
'请选择市/区县/乡镇'
}}
{{
get
Text
(
pageData
.
form
.
scope
,
' / '
)
||
'请选择市/区县/乡镇'
}}
</text>
</view>
</view>
<fui-input
required
label=
"详细地址"
placeholder=
"请输入详细地址"
v-model=
"form.address"
labelSize=
"28"
label-width=
"180"
/>
<fui-input
required
type=
"number"
label=
"联系方式"
placeholder=
"请填写联系方式"
v-model=
"form.phone"
labelSize=
"28"
label-width=
"180"
:maxlength=
"11"
/>
<fui-input
required
label=
"详细地址"
placeholder=
"请输入详细地址"
v-model=
"form.address"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-input
required
type=
"number"
label=
"联系方式"
placeholder=
"请填写联系方式"
v-model=
"form.phone"
labelSize=
"28"
label-width=
"180"
:maxlength=
"11"
/>
</view>
<view
class=
"mt20"
>
<fui-input
required
label=
"作业需求"
placeholder=
"请输入作业需求"
v-model=
"form.demand"
labelSize=
"28"
label-width=
"180"
/>
<fui-textarea
flexStart
required
label=
"作业需求"
placeholder=
"请输入作业需求"
v-model=
"form.demand"
labelSize=
"28"
label-width=
"180"
placeholder-style=
"font-size: 28rpx;"
/>
<!-- 作业时间 -->
<view
class=
"form-section"
style=
"padding: 0 10rpx"
>
<view
class=
"form-item flex align-center"
>
...
...
@@ -310,46 +247,18 @@
</view>
<view
class=
"bg-white mt20"
style=
"padding: 0.875rem 1rem"
>
<view
class=
"mb-1 flex justify-start"
>
图片
</view>
<uni-file-picker
:value=
"form.pictureObj"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
/>
<view
class=
"mb-1 flex justify-start"
style=
"font-size:28rpx;"
><span
class=
"text-red"
>
*
</span>
图片
</view>
<uni-file-picker
:value=
"form.pictureObj"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
/>
</view>
<view
class=
"fui-btn__box"
v-if=
"!form.id"
style=
"margin-top: 30rpx"
>
<fui-button
text=
"发布作业"
bold
radius=
"96rpx"
@
click=
"submit"
/>
</view>
</fui-form>
<fui-date-picker
:show=
"show.time1"
type=
"3"
@
change=
"handleChangeTime1"
@
cancel=
"show.time1 = false"
:minDate=
"getCurrentDate()"
/>
<fui-date-picker
:show=
"show.time2"
type=
"3"
@
change=
"handleChangeTime2"
@
cancel=
"show.time2 = false"
:minDate=
"getCurrentDate()"
/>
<fui-date-picker
:show=
"show.time1"
type=
"3"
@
change=
"handleChangeTime1"
@
cancel=
"show.time1 = false"
:minDate=
"getCurrentDate()"
/>
<fui-date-picker
:show=
"show.time2"
type=
"3"
@
change=
"handleChangeTime2"
@
cancel=
"show.time2 = false"
:minDate=
"getCurrentDate()"
/>
<fui-toast
ref=
"toastRef"
/>
<fui-loading
isFixed
v-if=
"pageData.loading"
backgroundColor=
"rgba(0, 0, 0, 0.4)"
/>
<fui-picker
:show=
"show.address"
:options=
"options.address"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"show.address = false"
/>
<fui-picker
:show=
"show.address"
:options=
"options.address"
:linkage=
"true"
:layer=
"3"
@
change=
"handleChangeAddress"
@
cancel=
"show.address = false"
/>
</view>
</view>
</
template
>
...
...
src/pages/nongjifuwu/machine-form.vue
浏览文件 @
c10f4b12
...
...
@@ -4,6 +4,7 @@
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
nongjifuwu
from
'@/api/model/nongjifuwu'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
const
userStore
=
useUserStore
()
const
globSetting
=
useGlobSetting
()
...
...
@@ -52,7 +53,7 @@
{
name
:
'name'
,
rule
:
[
'required'
],
msg
:
[
'请填写
农机名称
'
],
msg
:
[
'请填写
作业标题
'
],
},
{
name
:
'name'
,
...
...
@@ -78,42 +79,8 @@
})
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
nongjifuwu
.
cascaderHn
().
then
((
res
)
=>
{
pageData
.
options
.
address
=
JSON
.
parse
(
JSON
.
stringify
(
res
[
0
].
children
).
replaceAll
(
'label'
,
'text'
))
})
}
function
getScope
(
scope
:
any
)
{
if
(
!
scope
||
!
pageData
.
options
.
address
)
{
return
''
}
const
values
=
scope
.
split
(
','
)
const
labels
=
[]
// 递归查找label
const
findLabel
=
(
nodes
,
value
)
=>
{
for
(
const
node
of
nodes
)
{
if
(
node
.
value
===
value
)
{
return
node
.
text
}
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
const
found
=
findLabel
(
node
.
children
,
value
)
if
(
found
)
{
return
found
}
}
}
return
null
// 如果没找到,返回原始value
}
for
(
const
value
of
values
)
{
const
text
=
findLabel
(
pageData
.
options
.
address
,
value
.
trim
())
labels
.
push
(
text
)
}
return
labels
?
labels
.
join
(
' / '
)
:
''
async
function
initDict
()
{
pageData
.
options
.
address
=
await
getDictData
()
}
function
getDetails
(
id
)
{
...
...
@@ -217,11 +184,13 @@
<view
class=
"mt20"
>
<fui-input
required
label=
"
农机名称
"
placeholder=
"请输入
农机名称
"
label=
"
作业标题
"
placeholder=
"请输入
作业标题
"
v-model=
"form.name"
labelSize=
"28"
label-width=
"180"
maxlength=
"16"
size=
"28"
/>
<fui-input
required
...
...
@@ -230,38 +199,37 @@
v-model=
"form.phone"
labelSize=
"28"
label-width=
"180"
type=
"number"
maxlength=
"11"
size=
"28"
/>
<view
class=
"form-item required flex align-center"
style=
"padding: 20rpx 10rpx"
>
<text
class=
"label"
>
服务范围
</text>
<view
class=
"time-input"
@
click=
"show.address = true"
>
<text
class=
"select-text"
:class=
"
{ placeholder: !pageData.form.scope }">
{{
get
Scope
(
pageData
.
form
.
scope
)
||
'请选择市/区县/乡镇'
}}
{{
get
Text
(
pageData
.
form
.
scope
,
' / '
)
||
'请选择市/区县/乡镇'
}}
</text>
</view>
</view>
<!--
<fui-input
required
label=
"服务范围"
placeholder=
"请输入服务范围"
v-model=
"form.scope"
labelSize=
"28"
label-width=
"180"
></fui-input>
-->
<fui-input
required
type=
"number"
label=
"价格
(元/亩)
"
label=
"价格"
placeholder=
"请输入价格"
number
v-model=
"form.price"
labelSize=
"28"
label-width=
"180"
/>
maxlength=
"6"
>
<view
slot=
"suffix"
class=
"unit-slot"
>
元/亩
</view>
<!--
<slot
name=
"right"
style=
"font-size:28rpx;"
></slot>
-->
</fui-input>
</view>
<view
class=
"bg-white mt20"
style=
"padding: 0.875rem 1rem"
>
<view
class=
"mb-1 flex justify-start"
>
图片
</view>
<view
class=
"mb-1 flex justify-start"
style=
"font-size:28rpx;"
><span
class=
"text-red"
>
*
</span
>
图片
</view>
<uni-file-picker
:value=
"form.pictureObj"
:max-size=
"1024"
...
...
@@ -505,4 +473,9 @@
color
:
#999999
;
}
}
.unit-slot
{
padding
:
0
16
rpx
;
color
:
#333
;
font-size
:
28
rpx
;
}
</
style
>
src/pages/nongjifuwu/nongjifuwu.vue
浏览文件 @
c10f4b12
...
...
@@ -6,6 +6,7 @@
import
*
as
NongjifuwuAPI
from
'@/api/model/nongjifuwu'
import
Navigate
from
'@/utils/page/navigate'
import
{
s
}
from
'vite/dist/node/types.d-aGj9QkWt'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
onLoad
((
option
)
=>
{
pageData
.
search
.
serviceType
=
Number
(
option
.
type
)
||
1
...
...
@@ -67,10 +68,8 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
})
}
function
getCascader
()
{
NongjifuwuAPI
.
cascaderHn
().
then
((
res
)
=>
{
pageData
.
options
=
JSON
.
parse
(
JSON
.
stringify
(
res
[
0
].
children
).
replaceAll
(
'label'
,
'text'
))
})
async
function
getCascader
()
{
pageData
.
options
=
await
getDictData
()
}
// 分类标签点击事件
...
...
@@ -106,37 +105,7 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
applyDialogRef
.
value
.
open
(
item
)
}
function
getScope
(
scope
:
any
)
{
if
(
!
scope
||
!
pageData
.
options
||
pageData
.
options
.
length
===
0
)
{
return
''
}
const
values
=
scope
.
split
(
','
)
const
labels
=
[]
// 递归查找label
const
findLabel
=
(
nodes
,
value
)
=>
{
for
(
const
node
of
nodes
)
{
if
(
node
.
value
===
value
)
{
return
node
.
text
}
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
const
found
=
findLabel
(
node
.
children
,
value
)
if
(
found
)
{
return
found
}
}
}
return
null
// 如果没找到,返回原始value
}
for
(
const
value
of
values
)
{
const
text
=
findLabel
(
pageData
.
options
,
value
.
trim
())
labels
.
push
(
text
)
}
return
labels
?
labels
.
join
(
' / '
)
:
''
}
function
handleChangeAddress
(
e
)
{
pageData
.
search
.
scope
=
e
.
value
.
join
(
','
)
...
...
@@ -165,7 +134,7 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
<view
class=
"codefun-flex-row codefun-justify-between section_2"
>
<text
class=
"font_2 text_2"
>
服务区域
</text>
<view
class=
"codefun-flex-row codefun-items-center"
@
click=
"pageData.show.address = true"
>
<text
class=
"font_2 text_3"
>
{{
get
Scope
(
pageData
.
search
.
scope
)
||
'选择区域'
}}
</text>
<text
class=
"font_2 text_3"
>
{{
get
Text
(
pageData
.
search
.
scope
,
' / '
)
||
'选择区域'
}}
</text>
<image
class=
"codefun-shrink-0 image_7 codefun-ml-4"
src=
"/static/images/codefun/774cfe989f8417dc655fb301635f5893.png"
...
...
@@ -206,7 +175,7 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
>
<text
class=
"font text_6"
>
{{
item
.
name
}}
</text>
<text
class=
"font_3 text_7 ellipsis"
style=
"width: 100%; margin: 26rpx 0"
>
服务范围:
{{
get
Scope
(
item
.
scope
)
}}
</text
>
服务范围:
{{
get
Text
(
item
.
scope
,
' / '
)
}}
</text
>
</view>
<view
class=
"flex justify-between"
style=
"width: 100%"
>
...
...
@@ -219,7 +188,7 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-shrink-0 codefun-self-start text-wrapper_2"
@
click=
"handleApply(item)"
>
<text
class=
"font_5"
>
我有需要
</text>
<text
class=
"font_5"
>
去预约
</text>
</view>
</view>
</view>
...
...
src/pages/shouye/shouye.vue
浏览文件 @
c10f4b12
...
...
@@ -8,6 +8,7 @@
import
*
as
UserAPI
from
'@/api/model/userInfo'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
Navigate
from
'@/utils/page/navigate'
import
*
as
AreaDict
from
'@/utils/dict/area'
const
dictStore
=
useDictStore
()
const
model
=
reactive
({
...
...
@@ -127,6 +128,7 @@
// 获取字典列表
dictStore
.
setDictList
()
AreaDict
.
refreshDictData
()
// 查询金刚区数据
getServiceItems
()
...
...
src/utils/dict/area.ts
0 → 100644
浏览文件 @
c10f4b12
import
{
cascaderHn
}
from
'/@/api/model/dict'
const
storageKey
=
'app_dict_data_area_cascaderHn'
;
export
const
getDictData
=
async
()
=>
{
// 先从本地加载数据
let
dictData
=
getLocalDict
();
if
(
!
dictData
)
{
// 如果本地没有数据,则从接口获取
const
res
=
await
cascaderHn
();
const
data
=
JSON
.
stringify
(
res
[
0
].
children
).
replaceAll
(
'label'
,
'text'
);
uni
.
setStorageSync
(
storageKey
,
data
);
dictData
=
JSON
.
parse
(
data
);
}
return
dictData
;
}
/**
* 获取本地数据
*/
export
const
getLocalDict
=
()
=>
{
const
data
=
uni
.
getStorageSync
(
storageKey
);
if
(
data
)
{
return
data
?
JSON
.
parse
(
data
)
:
null
;
}
return
null
;
}
/**
* 刷新数据
*/
export
const
refreshDictData
=
()
=>
{
// 删除本地数据
uni
.
removeStorageSync
(
storageKey
);
// 重新获取数据
getDictData
();
}
const
areaOptions
=
await
getDictData
();
export
const
getText
=
(
scope
:
string
,
spliced
:
string
)
=>
{
if
(
!
scope
||
!
areaOptions
||
areaOptions
.
length
===
0
)
{
return
''
}
const
values
=
scope
.
split
(
','
)
const
labels
=
[]
// 递归查找label
const
findLabel
=
(
nodes
,
value
)
=>
{
for
(
const
node
of
nodes
)
{
if
(
node
.
value
===
value
)
{
return
node
.
text
}
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
const
found
=
findLabel
(
node
.
children
,
value
)
if
(
found
)
{
return
found
}
}
}
return
null
// 如果没找到,返回原始value
}
for
(
const
value
of
values
)
{
const
text
=
findLabel
(
areaOptions
,
value
.
trim
())
labels
.
push
(
text
)
}
if
(
spliced
)
{
return
labels
?
labels
.
join
(
spliced
)
:
''
}
else
{
return
labels
?
labels
.
join
(
''
)
:
''
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论