Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
fc48313c
提交
fc48313c
authored
12月 23, 2025
作者:
王定
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 完成可信农资申请入驻的添加,列表接口对接,详情页接口对接
上级
227bef02
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
851 行增加
和
24 行删除
+851
-24
.env.development
.env.development
+4
-4
nongzhi.ts
src/api/model/nongzhi.ts
+39
-0
pages.json
src/pages.json
+22
-1
detail.vue
src/pages/kexinnongzi/detail.vue
+202
-8
kexinnongzi.vue
src/pages/kexinnongzi/kexinnongzi.vue
+14
-11
shenqingruzhu.vue
src/pages/kexinnongzi/shenqingruzhu.vue
+570
-0
没有找到文件。
.env.development
浏览文件 @
fc48313c
# API 接口地址
VITE_GLOB_API_URL=http://111.22.182.169:49600
#
VITE_GLOB_API_URL=http://36.133.16.81:42111
#
VITE_GLOB_API_URL=http://111.22.182.169:49600
VITE_GLOB_API_URL=http://36.133.16.81:42111
# API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/jeecgboot
#
VITE_GLOB_API_URL_PREFIX=/jeecg-boot
#
VITE_GLOB_API_URL_PREFIX=/jeecgboot
VITE_GLOB_API_URL_PREFIX=/jeecg-boot
src/api/model/nongzhi.ts
浏览文件 @
fc48313c
...
...
@@ -3,6 +3,45 @@ import { otherHttp } from '/@/utils/http/axios'
enum
Api
{
goodsList
=
'/trade/goods/list'
,
// 农资列表
getEnterpriseList
=
'/server/enterprise/list'
,
// 可信农资列表
postEnterpriseAdd
=
'/server/enterprise/add'
,
// 入驻申请
getEnterpriseDetail
=
'/server/enterprise/detail'
,
// 企业详情
postGoodsAdd
=
'/trade/goods/add'
,
// 农资商品管理-添加
}
/**
* @param params 请求参数
* @description: 农资商品管理-添加
*/
export
function
postGoodsAdd
(
params
=
{})
{
return
otherHttp
.
post
({
url
:
Api
.
postGoodsAdd
,
params
,
})
}
/**
* @param params 请求参数
* @description: APP可信农资列表
*/
export
function
getEnterpriseDetail
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
getEnterpriseDetail
,
params
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
,
},
})
}
/**
* @param params 请求参数
* @description: 农贸入驻 新增
*/
export
function
postEnterpriseAdd
(
params
=
{})
{
return
otherHttp
.
post
({
url
:
Api
.
postEnterpriseAdd
,
params
,
})
}
/**
...
...
src/pages.json
浏览文件 @
fc48313c
...
...
@@ -690,7 +690,21 @@
"path"
:
"pages/kexinnongzi/kexinnongzi"
,
"style"
:
{
"navigationBarTitleText"
:
"可信农资"
"navigationBarTitleText"
:
"可信农资"
,
"app-plus"
:
{
"titleNView"
:
{
"buttons"
:
[
{
"text"
:
"
\u
E674 申请入驻"
,
"fontSrc"
:
"/static/fonts/tihuan.ttf"
,
"color"
:
"#fff"
,
"fontSize"
:
"26rpx"
,
"width"
:
"auto"
,
"icon"
:
"map"
}
]
}
}
}
},
{
...
...
@@ -699,6 +713,13 @@
{
"navigationBarTitleText"
:
"详情"
}
},
{
"path"
:
"pages/kexinnongzi/shenqingruzhu"
,
"style"
:
{
"navigationBarTitleText"
:
"农贸入驻申请"
}
}
],
"easycom"
:
{
...
...
src/pages/kexinnongzi/detail.vue
浏览文件 @
fc48313c
...
...
@@ -2,12 +2,141 @@
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
Navigate
from
'@/utils/page/navigate'
import
{
reactive
,
ref
}
from
'vue'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
NongzhiAPI
from
'@/api/model/nongzhi'
import
*
as
LinghuoyonggongAPI
from
'@/api/model/linghuoyonggong'
const
userStore
=
useUserStore
()
const
globSetting
=
useGlobSetting
()
onLoad
((
options
)
=>
{
let
param
=
JSON
.
parse
(
decodeURIComponent
(
options
.
param
));
uni
.
setNavigationBarTitle
({
title
:
param
.
name
});
getDetailData
(
param
.
id
);
queryByCategoryAndCode
(
0
,
null
)
})
const
toastRef
=
ref
()
const
unitPopupRef
=
ref
(
null
);
const
uploadRef
=
ref
()
const
bgColorData
=
[
"#EEFAEB"
,
"#EFF1FF"
,
"#FFF3F1"
,
"#E8F7F7"
,
"#FFF3E7"
,
"#FAF8EA"
];
let
testDataList
=
[
'营业执照'
,
'食品经营许可证'
,
'有机产品认证书'
,
'无公害农产品证书'
,
'有机产品认证书'
,
'营业执照'
,
'营业执照2'
,
'营业执照3'
]
const
pageData
=
reactive
({
data
:
null
,
enterpriseCers
:[],
isPopupShow
:
false
,
unitPopup
:
false
,
unitOptions
:[],
unitVal
:[],
unitText
:
""
,
productImageArr
:[],
})
let
productInfo
=
reactive
({
id
:
""
,
name
:
""
,
// 商品名称
category
:
""
,
// 分类
minSellPrice
:
""
,
// 最小销售价
maxSellPrice
:
""
,
// 最大销售价
unit
:
""
,
// 单位
unitCode
:
""
,
// 单位编码
enterpriseId
:
""
,
// 企业ID
})
// 文件上传
function
handleUpload
(
file
)
{
const
tempFilePaths
=
file
.
tempFilePaths
;
// 处理每张选中的图片
for
(
let
i
=
0
;
i
<
tempFilePaths
.
length
;
i
++
){
uni
.
uploadFile
({
url
:
`
${
globSetting
.
apiUrl
+
globSetting
.
urlPrefix
}
/sys/common/upload`
,
// 直接使用上传接口URL
filePath
:
tempFilePaths
[
i
],
name
:
'file'
,
formData
:
{
biz
:
'temp'
,
},
header
:
{
'X-Access-Token'
:
userStore
.
getToken
,
},
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
const
data
=
JSON
.
parse
(
res
.
data
)
if
(
data
.
code
===
200
||
data
.
code
===
0
)
{
toastRef
.
value
.
show
({
type
:
'success'
,
text
:
'上传成功'
,
})
pageData
.
productImageArr
[
0
]
=
data
.
message
// 保存返回的图片信息
}
}
},
fail
:
(
err
)
=>
{
toastRef
.
value
.
show
({
type
:
'error'
,
text
:
'上传失败'
,
})
uploadRef
.
value
.
clearFiles
()
pageData
.
productImageArr
[
0
]
=
null
},
})
}
}
// 文件删除
function
handleDelete
(
file
,
type
)
{
uploadRef
.
value
.
clearFiles
()
pageData
.
productImageArr
[
0
]
=
null
}
function
selectCompleteUnit
(
e
){
productInfo
.
unit
=
e
.
text
[
e
.
text
.
length
-
1
];
pageData
.
unitPopup
=
false
;
}
function
handleSelectUnit
(){
pageData
.
unitPopup
=
true
;
}
function
changeUnit
(
e
){
let
val
=
e
.
value
;
queryByCategoryAndCode
(
val
,
e
);
}
function
queryByCategoryAndCode
(
code
,
e
){
LinghuoyonggongAPI
.
queryByCategoryAndCode
({
category
:
2
,
code
:
code
}).
then
(
res
=>
{
if
(
res
.
length
){
let
dataArr
=
[];
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
){
let
obj
=
{
text
:
""
,
value
:
""
};
obj
.
text
=
res
[
i
].
name
;
obj
.
value
=
res
[
i
].
code
;
dataArr
.
push
(
obj
);
}
if
(
!
pageData
.
unitOptions
.
length
){
pageData
.
unitOptions
=
dataArr
;
}
else
{
unitPopupRef
.
value
.
setRequestData
(
dataArr
,
e
.
layer
);
}
}
else
{
unitPopupRef
.
value
.
end
();
}
})
}
// 发布
function
addData
(){
NongzhiAPI
.
postGoodsAdd
(
productInfo
).
then
((
res
)
=>
{
console
.
log
(
"发布成功了"
);
console
.
log
(
res
);
/* pageData.enterpriseCers = res.enterpriseCers.split(",");
pageData.data = res; */
})
}
function
getDetailData
(
id
){
NongzhiAPI
.
getEnterpriseDetail
({
id
}).
then
((
res
)
=>
{
pageData
.
enterpriseCers
=
res
.
enterpriseCers
.
split
(
","
);
pageData
.
data
=
res
;
productInfo
.
unitCode
=
res
.
enterpriseCode
;
productInfo
.
enterpriseId
=
res
.
id
;
})
}
function
getBgColor
(
index
:
any
){
if
(
index
<
6
){
return
bgColorData
[
index
];
...
...
@@ -16,23 +145,23 @@
}
}
function
handlePublish
()
{
Navigate
.
to
(
'/pages/linghuoyonggong/publishEmployment'
)
pageData
.
isPopupShow
=
true
;
}
</
script
>
<
template
>
<view
class=
"w-full h-95vh bg-#E6F5E8 detail_page"
>
<view
class=
"module_width top_content"
>
<view
class=
"enterprise_logo_view"
><image
class=
"enterprise_logo"
mode=
"heightFix"
src=
"/static/images/test/test_logo.png
"
/></view>
<view
class=
"enterprise_business"
>
主营:
粮、油、糖、棉、肉、乳等品类的全球一体化运营
</view>
<view
class=
"enterprise_description"
>
中粮集团下设中粮粮油、中国粮油、中国食品、地产酒店、中国土畜、中粮屯河、中粮包装、中粮发展、金融等9大业务板块,拥有中国食品、中粮控股两家香港上市公司,中粮屯河、中粮地产和丰原生化3家内地上市公司。福临门食用油、长城葡萄酒、金帝巧克力、屯河番茄制品、家佳康肉制品以及大悦城Shopping Mall、亚龙湾度假区、凯莱酒店、雪莲羊绒、中茶茶叶、中英人寿保险农村金融服务等等。
</view>
<view
class=
"enterprise_logo_view"
><image
class=
"enterprise_logo"
mode=
"heightFix"
:src=
"pageData.data.enterpriseLogoUrl
"
/></view>
<view
class=
"enterprise_business"
>
主营:
{{
pageData
.
data
.
businessScope
}}
</view>
<view
class=
"enterprise_description"
>
{{
pageData
.
data
.
profile
}}
</view>
</view>
<view
class=
"module_width middle_content"
>
<view
class=
"module_title"
>
资质证书
</view>
<view
class=
"module_separate"
></view>
<view
class=
"module_qualification"
>
<view
class=
"qualification_item"
:style=
"`background:$
{getBgColor(index)}`" v-for="(item,index) in
testDataList
" :key="index">
<image
class=
"enterprise_logo"
mode=
"heightFix"
src=
"/static/images/test/test_business.png
"
/>
<
view
class=
"qualification_name ellipsis"
>
{{
item
}}
</view
>
<view
class=
"qualification_item"
:style=
"`background:$
{getBgColor(index)}`" v-for="(item,index) in
pageData.enterpriseCers
" :key="index">
<image
class=
"enterprise_logo"
mode=
"heightFix"
:src=
"item
"
/>
<
!--
<view
class=
"qualification_name ellipsis"
>
{{
item
}}
</view>
--
>
</view>
</view>
</view>
...
...
@@ -54,6 +183,53 @@
<view
style=
"font-size: 24rpx"
>
发布产品
</view>
</view>
</fui-fab>
<fui-bottom-popup
:show=
"pageData.isPopupShow"
@
close=
"pageData.isPopupShow = false"
>
<view
class=
"fui-custom__wrap yr_person_popup"
>
<view
class=
"popup_top"
>
<uni-icons
type=
"left"
size=
"24"
color=
"#333333"
@
click=
"pageData.isPopupShow = false"
></uni-icons>
<view
class=
"add_person_text"
>
产品信息
</view>
<view
class=
"del_person_btn"
></view>
</view>
<view
class=
"popup_content"
>
<fui-form
error-position=
"1"
ref=
"form"
top=
"0"
:show=
"false"
>
<fui-form-item
asterisk
label=
"商品名称"
labelSize=
"28"
label-width=
"180"
size=
"28"
>
<fui-input
:borderBottom=
"false"
v-model=
"productInfo.name"
:padding=
"[0]"
placeholder=
"请输入商品名称"
></fui-input>
</fui-form-item>
<fui-form-item
asterisk
label=
"联系方式"
labelSize=
"28"
label-width=
"180"
size=
"28"
>
<fui-input
:borderBottom=
"false"
:padding=
"[0]"
placeholder=
"请输入联系方式"
></fui-input>
</fui-form-item>
<fui-form-item
asterisk
label=
"价格(元)"
labelSize=
"28"
label-width=
"180"
size=
"28"
>
<fui-input
v-model=
"productInfo.minSellPrice"
style=
"width: 120rpx !important"
:borderBottom=
"false"
:padding=
"[0]"
placeholder=
"最低价"
></fui-input>
<template
v-slot:right
>
<view
style=
"color: #CCCCCC;margin-right: 40rpx;"
>
—
</view>
<fui-input
v-model=
"productInfo.maxSellPrice"
style=
"width: 120rpx !important;"
:borderBottom=
"false"
:padding=
"[0]"
placeholder=
"最高价"
></fui-input>
<fui-text
v-if=
"productInfo.unit==''"
text=
"单位"
color=
"#cccccc"
@
click=
"handleSelectUnit()"
></fui-text>
<fui-text
v-else
:text=
"productInfo.unit"
@
click=
"handleSelectUnit()"
></fui-text>
</
template
>
</fui-form-item>
<fui-form-item
asterisk
label=
"产品图片"
:bottomBorder=
"false"
prop=
"descr"
error-align=
"left"
>
<
template
v-slot:vertical
>
<uni-file-picker
:value=
"pageData.productImageArr"
ref=
"uploadRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload"
@
delete=
"handleDelete"
/>
</
template
>
</fui-form-item>
</fui-form>
</view>
<fui-button
text=
"保存"
bold
radius=
"96rpx"
@
click=
"addData"
height=
"80rpx"
/>
</view>
</fui-bottom-popup>
<fui-bottom-popup
:show=
"pageData.unitPopup"
>
<view
class=
"fui-scroll__wrap"
>
<view
class=
"fui-title"
>
请选择
</view>
<fui-cascader
ref=
"unitPopupRef"
:value=
"pageData.unitVal"
stepLoading
@
change=
"changeUnit"
@
complete=
"selectCompleteUnit"
:options=
"pageData.unitOptions"
></fui-cascader>
<view
class=
"fui-icon__close"
@
tap
.
stop=
"pageData.unitPopup=false"
>
<fui-icon
name=
"close"
:size=
"48"
></fui-icon>
</view>
</view>
</fui-bottom-popup>
<fui-toast
ref=
"toastRef"
/>
</template>
<
style
lang=
"less"
scoped
>
...
...
@@ -216,4 +392,22 @@
background
:
linear-gradient
(
124.25deg
,
#a5d63f
0%
,
#5db66f
100%
)
!important
;
box-shadow
:
0px
1px
8px
#5db66f
;
}
.fui-scroll__wrap
{
padding-top
:
30
rpx
;
position
:
relative
;
}
.fui-title
{
font-size
:
30
rpx
;
font-weight
:
bold
;
text-align
:
center
;
padding-bottom
:
24
rpx
;
}
.fui-icon__close
{
position
:
absolute
;
top
:
24
rpx
;
right
:
24
rpx
;
}
</
style
>
src/pages/kexinnongzi/kexinnongzi.vue
浏览文件 @
fc48313c
...
...
@@ -3,7 +3,19 @@
import
Navigate
from
'@/utils/page/navigate'
import
{
reactive
,
ref
}
from
'vue'
import
*
as
NongzhiAPI
from
'@/api/model/nongzhi'
onPullDownRefresh
(()
=>
{
resetData
()
getList
(
pageData
.
params
)
})
onShow
(()
=>
{
resetData
()
getList
(
pageData
.
params
)
})
onNavigationBarButtonTap
(()
=>
{
Navigate
.
to
(
'/pages/kexinnongzi/shenqingruzhu'
)
})
const
pageData
=
reactive
({
params
:
{
pageNo
:
1
,
...
...
@@ -41,7 +53,8 @@
function
toDetail
(
item
)
{
let
param
=
encodeURIComponent
(
JSON
.
stringify
({
id
:
1
,
name
:
"中粮集团"
}));
console
.
log
(
item
);
let
param
=
encodeURIComponent
(
JSON
.
stringify
({
id
:
item
.
id
,
name
:
item
.
enterpriseName
}));
Navigate
.
to
(
`/pages/kexinnongzi/detail?param=
${
param
}
`
)
}
...
...
@@ -50,16 +63,6 @@
pageData
.
hasMore
=
true
pageData
.
loading
=
false
}
onPullDownRefresh
(()
=>
{
resetData
()
getList
(
pageData
.
params
)
})
onShow
(()
=>
{
resetData
()
getList
(
pageData
.
params
)
})
</
script
>
<
template
>
...
...
src/pages/kexinnongzi/shenqingruzhu.vue
0 → 100644
浏览文件 @
fc48313c
<
script
setup
lang=
"ts"
>
import
{
reactive
,
toRefs
,
ref
}
from
'vue'
import
{
onLoad
,
onShow
}
from
'@dcloudio/uni-app'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
LinghuoyonggongAPI
from
'@/api/model/linghuoyonggong'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
*
as
NongzhiAPI
from
'@/api/model/nongzhi'
import
{
useDictStore
}
from
'@/store/modules/dict'
const
dictStore
=
useDictStore
()
const
userStore
=
useUserStore
()
const
globSetting
=
useGlobSetting
()
onLoad
((
option
)
=>
{
// 获取数据详情
getProvince
(
0
,
null
);
})
//勾选协议校验
function
checkAgree
(
agree
)
{
return
agree
}
const
areaPopupRef
=
ref
(
null
);
const
pageData
=
reactive
({
loading
:
false
,
show
:
{
time1
:
false
,
time2
:
false
,
area
:
false
,
urgentdegree
:
false
,
type
:
false
,
},
options
:
{
area
:
[],
areaVal
:[],
urgentdegree
:
[],
type
:
[],
},
cersImageIndex
:
0
,
cersImageArr
:[],
enterpriseLogoArr
:[],
selectAreaVal
:[],
form
:
{
id
:
''
,
enterpriseName
:
""
,
// 企业名称
enterpriseCode
:
""
,
// 企业编码
businessScope
:
""
,
// 企业经营范围
contactPerson
:
""
,
// 联系人
contactMobile
:
""
,
// 联系人手机号
profile
:
""
,
// 企业简介
provinceName
:
""
,
// 省
cityName
:
""
,
// 市
districtName
:
""
,
// 区县
townName
:
""
,
// 乡镇
provinceCode
:
""
,
// 省
cityCode
:
""
,
// 市
districtCode
:
""
,
// 区县
townCode
:
""
,
// 乡镇
addr
:
""
,
// 详细地址
lon
:
"110"
,
// 经度
lat
:
'29'
,
// 纬度
bizCategory
:
2
,
// 业务分类【1:代理记账、2:农资、3:农机、4:金融】
enterpriseLogoUrl
:
null
,
// 企业logo url
enterpriseCers
:
null
,
// 企业资质url
areaText
:
''
,
agree
:
false
,
},
position
:
[],
rules
:
[
{
name
:
'enterpriseName'
,
rule
:
[
'required'
],
msg
:
[
'请输入公司名称'
],
},
{
name
:
'enterpriseCode'
,
rule
:
[
'required'
],
msg
:
[
'请输入企业编码'
],
},
{
name
:
'businessScope'
,
rule
:
[
'required'
],
msg
:
[
'请输入经营业务'
],
},{
name
:
'profile'
,
rule
:
[
'required'
],
msg
:
[
'请输入平台介绍'
],
},{
name
:
'areaText'
,
rule
:
[
'required'
],
msg
:
[
'请选择地区'
],
},{
name
:
'addr'
,
rule
:
[
'required'
],
msg
:
[
'请输入详细地址'
],
},{
name
:
'contactPerson'
,
rule
:
[
'required'
],
msg
:
[
'请输入联系人'
],
},{
name
:
"contactMobile"
,
rule
:
[
"required"
,
"isMobile"
],
msg
:
[
"请输入联系电话"
,
"请输入正确的联系电话"
]
},{
name
:
'enterpriseLogoUrl'
,
rule
:
[
'required'
],
msg
:
[
'请上传公司logo'
],
},{
name
:
'enterpriseCers'
,
rule
:
[
'required'
],
msg
:
[
'请上传公司资质证件'
],
},{
name
:
"agree"
,
validator
:
[{
msg
:
"请勾选并同意《入驻协议》与《服务条款》"
,
method
:
checkAgree
}]
}
],
})
function
agreeChange
(
e
)
{
pageData
.
form
.
agree
=
e
.
checked
;
}
// 选择地区完成
function
selectCompleteArea
(
e
){
let
areaAttr
=
[
'province'
,
'city'
,
'district'
,
'town'
];
let
text
=
e
.
text
;
let
value
=
e
.
value
;
let
formData
=
pageData
.
form
;
for
(
let
i
=
0
;
i
<
text
.
length
;
i
++
){
formData
[
areaAttr
[
i
]
+
'Name'
]
=
text
[
i
];
formData
[
areaAttr
[
i
]
+
'Code'
]
=
value
[
i
];
}
pageData
.
form
.
areaText
=
text
.
join
(
''
);
pageData
.
show
.
area
=
false
;
}
// 在选择地区
function
changeArea
(
e
){
let
val
=
e
.
value
;
getProvince
(
val
,
e
);
}
// 获取下一级地区
function
getProvince
(
code
,
e
)
{
LinghuoyonggongAPI
.
queryConditions
({
parentCode
:
code
}).
then
(
res
=>
{
if
(
res
.
length
){
let
dataArr
=
[];
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
){
let
obj
=
{
text
:
""
,
value
:
""
};
obj
.
text
=
res
[
i
].
name
;
obj
.
value
=
res
[
i
].
code
;
dataArr
.
push
(
obj
);
}
if
(
!
pageData
.
options
.
area
.
length
){
pageData
.
options
.
area
=
dataArr
;
}
else
{
areaPopupRef
.
value
.
setRequestData
(
dataArr
,
e
.
layer
);
}
}
else
{
areaPopupRef
.
value
.
end
();
}
})
}
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
const
toastRef
=
ref
()
const
uploadLogoRef
=
ref
()
const
uploadCersRef
=
ref
()
// 文件上传
function
handleUpload
(
file
,
type
)
{
const
tempFilePaths
=
file
.
tempFilePaths
;
// 处理每张选中的图片
for
(
let
i
=
0
;
i
<
tempFilePaths
.
length
;
i
++
){
uni
.
uploadFile
({
url
:
`
${
globSetting
.
apiUrl
+
globSetting
.
urlPrefix
}
/sys/common/upload`
,
// 直接使用上传接口URL
filePath
:
tempFilePaths
[
i
],
name
:
'file'
,
formData
:
{
biz
:
'temp'
,
},
header
:
{
'X-Access-Token'
:
userStore
.
getToken
,
},
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
const
data
=
JSON
.
parse
(
res
.
data
)
if
(
data
.
code
===
200
||
data
.
code
===
0
)
{
toastRef
.
value
.
show
({
type
:
'success'
,
text
:
'上传成功'
,
})
if
(
type
==
'logo'
){
pageData
.
enterpriseLogoArr
[
0
]
=
data
.
message
// 保存返回的图片信息
}
else
{
pageData
.
cersImageIndex
++
;
pageData
.
cersImageArr
.
push
(
data
.
message
);
}
}
}
},
fail
:
(
err
)
=>
{
toastRef
.
value
.
show
({
type
:
'error'
,
text
:
'上传失败'
,
})
if
(
type
==
'logo'
){
uploadLogoRef
.
value
.
clearFiles
()
pageData
.
enterpriseLogoArr
[
0
]
=
null
}
else
{
uploadCersRef
.
value
.
clearFiles
(
pageData
.
cersImageIndex
)
pageData
.
form
.
enterpriseCers
=
null
}
},
})
}
}
// 文件删除
function
handleDelete
(
file
,
type
)
{
if
(
type
=
"logo"
){
uploadLogoRef
.
value
.
clearFiles
()
pageData
.
enterpriseLogoArr
[
0
]
=
null
}
else
{
const
num
=
pageData
.
cersImageArr
.
findIndex
(
v
=>
v
.
url
===
file
.
tempFilePath
);
pageData
.
cersImageArr
.
splice
(
num
,
1
);
}
}
const
formRef
=
ref
()
function
submit
()
{
pageData
.
form
.
enterpriseLogoUrl
=
pageData
.
enterpriseLogoArr
.
join
(
''
);
pageData
.
form
.
enterpriseCers
=
pageData
.
cersImageArr
.
join
(
','
);
/* if (pageData.position.length == 0) {
toastRef.value.show({
type: 'error',
text: '无法获取位置',
})
return
}
pageData.form.lon = pageData.position[0]
pageData.form.lat = pageData.position[1] */
formRef
.
value
.
validator
(
pageData
.
form
,
pageData
.
rules
,
true
).
then
((
res
)
=>
{
if
(
res
.
isPassed
)
{
NongzhiAPI
.
postEnterpriseAdd
(
pageData
.
form
).
then
((
res
)
=>
{
toastRef
.
value
.
show
({
type
:
'success'
,
text
:
'发布成功'
,
})
setTimeout
(()
=>
{
uni
.
navigateBack
({
delta
:
1
// 返回的页面数
})
},
1000
)
})
}
})
}
function
getCurrentDate
(){
const
date
=
new
Date
()
const
year
=
date
.
getFullYear
()
const
month
=
date
.
getMonth
()
+
1
const
day
=
date
.
getDate
()
return
`
${
year
}
-
${
month
}
-
${
day
}
`
}
</
script
>
<
template
>
<view
class=
"page"
>
<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.enterpriseName"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-input
required
label=
"企业编码"
placeholder=
"请输入企业编码"
v-model=
"form.enterpriseCode"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-input
required
label=
"经营业务"
placeholder=
"请输入经营业务"
v-model=
"form.businessScope"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-form-item
asterisk
label=
"平台介绍"
:bottomBorder=
"false"
prop=
"descr"
error-align=
"left"
>
<template
v-slot:vertical
>
<fui-textarea
isCounter
maxlength=
"-1"
:padding=
"['0','32rpx','32rpx']"
:border-bottom=
"false"
:border-top=
"false"
placeholder=
"请输入平台介绍..."
v-model=
"form.profile"
></fui-textarea>
</
template
>
</fui-form-item>
</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.addr"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-input
required
label=
"联系人"
placeholder=
"请输入联系人"
v-model=
"form.contactPerson"
labelSize=
"28"
label-width=
"180"
size=
"28"
/>
<fui-input
required
label=
"联系电话"
placeholder=
"请输入联系电话"
v-model=
"form.contactMobile"
labelSize=
"28"
label-width=
"180"
size=
"28"
></fui-input>
</view>
<view
class=
"bg-white mt20"
style=
"padding: 0.875rem 1rem"
>
<view
class=
"mb-1 flex justify-start"
style=
"font-size: 28rpx;"
><span
style=
"color: red;"
>
*
</span>
公司logo
</view>
<uni-file-picker
:value=
"pageData.enterpriseLogoArr"
ref=
"uploadLogoRef"
limit=
"1"
:auto-upload=
"false"
@
select=
"handleUpload($event,'logo')"
@
delete=
"handleDelete($event,'logo')"
/>
</view>
<view
class=
"bg-white mt20"
style=
"padding: 0.875rem 1rem"
>
<view
class=
"mb-1 flex justify-start"
style=
"font-size: 28rpx;"
><span
style=
"color: red;"
>
*
</span>
公司资质证件
</view>
<view
class=
"mb-1 flex justify-start"
style=
"font-size: 24rpx;color: #CCCCCC;"
>
前6张资质证件将展示在详情页,拖拽图片可自定义排序。
</view>
<uni-file-picker
limit=
"9"
:value=
"pageData.cersImageArr"
ref=
"uploadCersRef"
:auto-upload=
"false"
@
select=
"handleUpload($event,'cers')"
@
delete=
"handleDelete($event,'cers')"
/>
</view>
<view
class=
"fui-clause--cell fui-clause--wrap"
>
<fui-label>
<view
class=
"fui-clause--cell"
>
<fui-checkbox
:scaleRatio=
"0.8"
@
change=
"agreeChange"
></fui-checkbox>
<text
class=
"fui-clause--text"
>
我已阅读并同意
</text>
</view>
</fui-label>
<fui-text
class=
"fui-color__link"
>
《入驻协议》
</fui-text>
<text>
与
</text>
<fui-text
class=
"fui-color__link"
>
《服务条款》
</fui-text>
</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>
</view>
</view>
<!-- <fui-date-picker :show="show.time1" type="3" @change="handleChangeTime1" :min-date="getCurrentDate()" @cancel="show.time1 = false" />
<fui-date-picker :show="show.time2" type="3" @change="handleChangeTime2" :min-date="getCurrentDate()" @cancel="show.time2 = false" />
<fui-picker :show="show.type" :layer="1" :linkage="true" :options="options.type" @change="handleChangetype" @cancel="show.type = false" />
<fui-picker :show="show.urgentdegree" :layer="1" :linkage="true" :options="options.urgentdegree" @change="handleChangeUrgentdegree" @cancel="show.urgentdegree = false"/>
--><!-- <fui-picker :show="show.area" :options="options.area" :linkage="true" :layer="3" @change="handleChangeAddress" @cancel="show.area = false" /> -->
<!-- 地区的选择 -->
<fui-bottom-popup
:show=
"show.area"
>
<view
class=
"fui-scroll__wrap"
>
<view
class=
"fui-title"
>
请选择
</view>
<fui-cascader
ref=
"areaPopupRef"
:value=
"pageData.options.areaVal"
stepLoading
@
change=
"changeArea"
@
complete=
"selectCompleteArea"
:options=
"pageData.options.area"
></fui-cascader>
<view
class=
"fui-icon__close"
@
tap
.
stop=
"pageData.show.area=false"
>
<fui-icon
name=
"close"
:size=
"48"
></fui-icon>
</view>
</view>
</fui-bottom-popup>
<fui-toast
ref=
"toastRef"
/>
<fui-loading
isFixed
v-if=
"pageData.loading"
backgroundColor=
"rgba(0, 0, 0, 0.4)"
/>
</template>
<
style
lang=
"scss"
scoped
>
body
{
background-color
:
#e6f5e8
;
}
.page
{
background-color
:
#e6f5e8
;
width
:
750
rpx
;
overflow-x
:
hidden
;
.mt20
{
margin-top
:
30
rpx
;
background
:
#fff
;
padding
:
20
rpx
;
border-radius
:
10
rpx
;
}
.formBox
{
width
:
690
rpx
;
margin
:
30
rpx
auto
;
}
.form-section
{
//
border-bottom
:
1
rpx
solid
#f5f5f5
;
}
.form-item
{
padding
:
30
rpx
0
;
border-bottom
:
1
rpx
solid
#f5f5f5
;
&:last-child
{
border-bottom
:
none
;
}
&
.required
.label
::before
{
content
:
'*'
;
color
:
#ff4d4f
;
margin-right
:
8
rpx
;
}
}
.form-row
{
display
:
flex
;
justify-content
:
space-between
;
}
.half-width
{
width
:
48%
;
}
.align-center
{
align-items
:
center
;
}
.label
{
display
:
block
;
font-size
:
28
rpx
;
color
:
#333333
;
font-weight
:
500
;
width
:
180
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
;
}
}
.time-range
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.time-input
{
width
:
45%
;
border-radius
:
8
rpx
;
display
:
flex
;
align-items
:
center
;
}
.time-text
{
font-size
:
28
rpx
;
color
:
#333333
;
&.placeholder
{
color
:
#999999
;
}
}
.time-separator
{
color
:
#666666
;
font-size
:
28
rpx
;
margin
:
0
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
;
}
}
.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-text
{
font-size
:
24
rpx
;
}
.submit-section
{
background
:
transparent
;
padding
:
40
rpx
0
;
}
.submit-btn
{
width
:
100%
;
height
:
88
rpx
;
background
:
#ff9800
;
border-radius
:
44
rpx
;
color
:
#ffffff
;
font-size
:
32
rpx
;
font-weight
:
500
;
border
:
none
;
&:active
{
background
:
#e68900
;
opacity
:
0.9
;
}
}
}
::v-deep
.uni-input-placeholder
{
font-size
:
28
rpx
!important
;
color
:
#999999
!important
;
}
//
移除
fui-form
的默认样式
:deep
(
.fui-form
)
{
background
:
transparent
;
}
:deep
(
.fui-form__item
)
{
background
:
transparent
;
border
:
none
;
margin-bottom
:
0
;
padding
:
0
;
}
.unit-slot
{
padding
:
0
16
rpx
;
color
:
#333
;
font-size
:
28
rpx
;
}
.fui-clause--cell
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
24
rpx
;
color
:
#999999
;
}
.fui-clause--wrap
{
width
:
100%
;
margin-top
:
64
rpx
;
}
.fui-clause--text
{
padding-left
:
16
rpx
;
/* #ifdef H5 */
cursor
:
pointer
;
/* #endif */
}
.fui-color__link
{
color
:
#5FB771
;
/* #ifdef H5 */
cursor
:
pointer
;
/* #endif */
}
.fui-color__link
:active
{
opacity
:
.5
;
}
.fui-scroll__wrap
{
padding-top
:
30
rpx
;
position
:
relative
;
}
.fui-title
{
font-size
:
30
rpx
;
font-weight
:
bold
;
text-align
:
center
;
padding-bottom
:
24
rpx
;
}
.fui-icon__close
{
position
:
absolute
;
top
:
24
rpx
;
right
:
24
rpx
;
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论