提交 0fb18627 作者: 廖在望

feat: 功能修改

上级 083562c2
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -25,6 +25,6 @@ export function getQueryByType(params = {}) { ...@@ -25,6 +25,6 @@ export function getQueryByType(params = {}) {
params, params,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
} },
}) })
} }
...@@ -10,7 +10,6 @@ enum Api { ...@@ -10,7 +10,6 @@ enum Api {
postConsultRecordAdd = '/server/consultRecord/add', // 添加咨询信息 postConsultRecordAdd = '/server/consultRecord/add', // 添加咨询信息
getNewsList = '/news/list', // 分页列表查询 getNewsList = '/news/list', // 分页列表查询
} }
/** /**
...@@ -20,7 +19,7 @@ enum Api { ...@@ -20,7 +19,7 @@ enum Api {
export function postConsultRecordAdd(params = {}) { export function postConsultRecordAdd(params = {}) {
return otherHttp.post({ return otherHttp.post({
url: Api.postConsultRecordAdd, url: Api.postConsultRecordAdd,
params params,
}) })
} }
......
...@@ -29,7 +29,7 @@ export function addViewCount(params) { ...@@ -29,7 +29,7 @@ export function addViewCount(params) {
url: Api.viewCount, url: Api.viewCount,
params, params,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
} },
}) })
} }
...@@ -27,7 +27,7 @@ export function getLaborAppDel(params = {}) { ...@@ -27,7 +27,7 @@ export function getLaborAppDel(params = {}) {
params, params,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
} },
}) })
} }
......
...@@ -29,7 +29,7 @@ export function addViewCount(params) { ...@@ -29,7 +29,7 @@ export function addViewCount(params) {
url: Api.viewCount, url: Api.viewCount,
params, params,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
} },
}) })
} }
...@@ -11,7 +11,6 @@ enum Api { ...@@ -11,7 +11,6 @@ enum Api {
postMachineryAdd = '/server/machinery/add', // 农机商品管理-添加 postMachineryAdd = '/server/machinery/add', // 农机商品管理-添加
postMachineryQueryById = '/server/machinery/listByEnterpriseId', // 按企业ID查询未删除农机 postMachineryQueryById = '/server/machinery/listByEnterpriseId', // 按企业ID查询未删除农机
} }
/** /**
* @param params 请求参数 * @param params 请求参数
......
...@@ -4,7 +4,7 @@ enum Api { ...@@ -4,7 +4,7 @@ enum Api {
goodsList = '/trade/goods/list', // 农资列表 goodsList = '/trade/goods/list', // 农资列表
getEnterpriseList = '/server/enterprise/list', // 可信农资列表 getEnterpriseList = '/server/enterprise/list', // 可信农资列表
postEnterpriseAdd = '/server/enterprise/add', // 入驻申请 postEnterpriseAdd = '/server/enterprise/add', // 入驻申请
getEnterpriseDetail= '/server/enterprise/detail', // 企业详情 getEnterpriseDetail = '/server/enterprise/detail', // 企业详情
postGoodsAdd = '/trade/goods/add', // 农资商品管理-添加 postGoodsAdd = '/trade/goods/add', // 农资商品管理-添加
getGoodsQueryById = '/trade/goods/listByEnterpriseId', // 农资商品管理-通过id查询 getGoodsQueryById = '/trade/goods/listByEnterpriseId', // 农资商品管理-通过id查询
} }
......
...@@ -17,12 +17,15 @@ enum Api { ...@@ -17,12 +17,15 @@ enum Api {
* @description: 查询登录用户信息 * @description: 查询登录用户信息
*/ */
export function getUserInfo(params = {}) { export function getUserInfo(params = {}) {
return otherHttp.get({ return otherHttp.get(
{
url: Api.getUserInfo, url: Api.getUserInfo,
data: params, data: params,
}, { },
errorMessageMode: null {
}) errorMessageMode: null,
},
)
} }
/** /**
...@@ -43,7 +46,7 @@ export function sysLogin(params = {}) { ...@@ -43,7 +46,7 @@ export function sysLogin(params = {}) {
export function phoneLogin(params = {}) { export function phoneLogin(params = {}) {
return otherHttp.post({ return otherHttp.post({
url: Api.phoneLogin, url: Api.phoneLogin,
data: params data: params,
}) })
} }
...@@ -54,7 +57,7 @@ export function phoneLogin(params = {}) { ...@@ -54,7 +57,7 @@ export function phoneLogin(params = {}) {
export function sysSms(params = {}) { export function sysSms(params = {}) {
return otherHttp.post({ return otherHttp.post({
url: Api.sms, url: Api.sms,
data: params data: params,
}) })
} }
......
<script setup lang="ts">
interface Props {
show?: boolean
title?: string
content?: string
cancelText?: string
confirmText?: string
}
const props = withDefaults(defineProps<Props>(), {
show: false,
title: '提示',
content: '',
cancelText: '取消',
confirmText: '确认',
})
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
(e: 'cancel'): void
(e: 'confirm'): void
}>()
function handleCancel() {
emit('update:show', false)
emit('cancel')
}
function handleConfirm() {
emit('update:show', false)
emit('confirm')
}
</script>
<template> <template>
<view v-if="show" class="confirm-dialog-overlay" @click="handleCancel"> <view v-if="show" class="confirm-dialog-overlay" @click="handleCancel">
<view class="confirm-dialog-container" @click.stop> <view class="confirm-dialog-container" @click.stop>
...@@ -25,42 +59,8 @@ ...@@ -25,42 +59,8 @@
</view> </view>
</template> </template>
<script setup lang="ts">
interface Props {
show?: boolean
title?: string
content?: string
cancelText?: string
confirmText?: string
}
const props = withDefaults(defineProps<Props>(), {
show: false,
title: '提示',
content: '',
cancelText: '取消',
confirmText: '确认',
})
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
(e: 'cancel'): void
(e: 'confirm'): void
}>()
function handleCancel() {
emit('update:show', false)
emit('cancel')
}
function handleConfirm() {
emit('update:show', false)
emit('confirm')
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.confirm-dialog-overlay { .confirm-dialog-overlay {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -71,18 +71,18 @@ function handleConfirm() { ...@@ -71,18 +71,18 @@ function handleConfirm() {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 99999; z-index: 99999;
} }
.confirm-dialog-container { .confirm-dialog-container {
position: relative; position: relative;
width: 600rpx; width: 600rpx;
background: linear-gradient(180deg, #E8F5E9 0%, #FFFFFF 30%); background: linear-gradient(180deg, #e8f5e9 0%, #ffffff 30%);
border-radius: 32rpx; border-radius: 32rpx;
padding: 60rpx 48rpx 48rpx; padding: 60rpx 48rpx 48rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1); box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
} }
.close-btn { .close-btn {
position: absolute; position: absolute;
top: 24rpx; top: 24rpx;
right: 24rpx; right: 24rpx;
...@@ -92,37 +92,37 @@ function handleConfirm() { ...@@ -92,37 +92,37 @@ function handleConfirm() {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
} }
.close-icon { .close-icon {
font-size: 36rpx; font-size: 36rpx;
color: #999999; color: #999999;
font-weight: 300; font-weight: 300;
} }
.dialog-title { .dialog-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
text-align: center; text-align: center;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.dialog-content { .dialog-content {
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
margin-bottom: 48rpx; margin-bottom: 48rpx;
} }
.dialog-buttons { .dialog-buttons {
display: flex; display: flex;
gap: 24rpx; gap: 24rpx;
} }
.cancel-btn, .cancel-btn,
.confirm-btn { .confirm-btn {
flex: 1; flex: 1;
height: 80rpx; height: 80rpx;
border-radius: 40rpx; border-radius: 40rpx;
...@@ -130,36 +130,36 @@ function handleConfirm() { ...@@ -130,36 +130,36 @@ function handleConfirm() {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
} }
.cancel-btn { .cancel-btn {
background-color: #FFFFFF; background-color: #ffffff;
border: 2rpx solid #5DB66F; border: 2rpx solid #5db66f;
} }
.cancel-text { .cancel-text {
font-size: 28rpx; font-size: 28rpx;
color: #5DB66F; color: #5db66f;
font-weight: 500; font-weight: 500;
} }
.confirm-btn { .confirm-btn {
background: linear-gradient(135deg, #5DB66F 0%, #4CAF50 100%); background: linear-gradient(135deg, #5db66f 0%, #4caf50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3); box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
} }
.confirm-text { .confirm-text {
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #ffffff;
font-weight: 500; font-weight: 500;
} }
.cancel-btn:active { .cancel-btn:active {
opacity: 0.8; opacity: 0.8;
} }
.confirm-btn:active { .confirm-btn:active {
opacity: 0.9; opacity: 0.9;
transform: scale(0.98); transform: scale(0.98);
} }
</style> </style>
<script setup lang="ts">
interface Props {
show?: boolean
title?: string
content?: string
cancelText?: string
confirmText?: string
}
const props = withDefaults(defineProps<Props>(), {
show: false,
title: '提示',
content: '',
cancelText: '取消',
confirmText: '确认',
})
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
(e: 'cancel'): void
(e: 'confirm'): void
}>()
function handleCancel() {
emit('update:show', false)
emit('cancel')
}
function handleConfirm() {
emit('confirm')
}
</script>
<template> <template>
<view v-if="show" class="confirm-dialog-overlay" @click="handleCancel"> <view v-if="show" class="confirm-dialog-overlay" @click="handleCancel">
<view class="confirm-dialog-container" @click.stop> <view class="confirm-dialog-container" @click.stop>
...@@ -24,41 +57,8 @@ ...@@ -24,41 +57,8 @@
</view> </view>
</template> </template>
<script setup lang="ts">
interface Props {
show?: boolean
title?: string
content?: string
cancelText?: string
confirmText?: string
}
const props = withDefaults(defineProps<Props>(), {
show: false,
title: '提示',
content: '',
cancelText: '取消',
confirmText: '确认',
})
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
(e: 'cancel'): void
(e: 'confirm'): void
}>()
function handleCancel() {
emit('update:show', false)
emit('cancel')
}
function handleConfirm() {
emit('confirm')
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.confirm-dialog-overlay { .confirm-dialog-overlay {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -69,18 +69,18 @@ function handleConfirm() { ...@@ -69,18 +69,18 @@ function handleConfirm() {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 9999; z-index: 9999;
} }
.confirm-dialog-container { .confirm-dialog-container {
position: relative; position: relative;
width: 600rpx; width: 600rpx;
background: #FFFFFF; background: #ffffff;
border-radius: 32rpx; border-radius: 32rpx;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1); box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
padding-bottom: 28rpx; padding-bottom: 28rpx;
} }
.confirm-dialog-content{ .confirm-dialog-content {
width: 600rpx; width: 600rpx;
height: 240rpx; height: 240rpx;
border-radius: 32rpx; border-radius: 32rpx;
...@@ -89,14 +89,14 @@ function handleConfirm() { ...@@ -89,14 +89,14 @@ function handleConfirm() {
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
.apply_success_icon{ .apply_success_icon {
width: 240rpx; width: 240rpx;
height: 162rpx; height: 162rpx;
margin-top: 54rpx; margin-top: 54rpx;
} }
} }
.close-btn { .close-btn {
position: absolute; position: absolute;
top: 24rpx; top: 24rpx;
right: 24rpx; right: 24rpx;
...@@ -106,40 +106,40 @@ function handleConfirm() { ...@@ -106,40 +106,40 @@ function handleConfirm() {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
} }
.close-icon { .close-icon {
font-size: 36rpx; font-size: 36rpx;
color: #999999; color: #999999;
font-weight: 300; font-weight: 300;
} }
.dialog-title { .dialog-title {
margin-top: -32rpx; margin-top: -32rpx;
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
text-align: center; text-align: center;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.dialog-content { .dialog-content {
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
margin-bottom: 48rpx; margin-bottom: 48rpx;
} }
.dialog-buttons { .dialog-buttons {
display: flex; display: flex;
gap: 24rpx; gap: 24rpx;
padding-left: 30rpx; padding-left: 30rpx;
padding-right: 30rpx; padding-right: 30rpx;
} }
.cancel-btn, .cancel-btn,
.confirm-btn { .confirm-btn {
flex: 1; flex: 1;
height: 80rpx; height: 80rpx;
border-radius: 40rpx; border-radius: 40rpx;
...@@ -147,36 +147,36 @@ function handleConfirm() { ...@@ -147,36 +147,36 @@ function handleConfirm() {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
} }
.cancel-btn { .cancel-btn {
background-color: #FFFFFF; background-color: #ffffff;
border: 2rpx solid #5DB66F; border: 2rpx solid #5db66f;
} }
.cancel-text { .cancel-text {
font-size: 28rpx; font-size: 28rpx;
color: #5DB66F; color: #5db66f;
font-weight: 500; font-weight: 500;
} }
.confirm-btn { .confirm-btn {
background: linear-gradient(135deg, #5DB66F 0%, #4CAF50 100%); background: linear-gradient(135deg, #5db66f 0%, #4caf50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3); box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
} }
.confirm-text { .confirm-text {
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #ffffff;
font-weight: 500; font-weight: 500;
} }
.cancel-btn:active { .cancel-btn:active {
opacity: 0.8; opacity: 0.8;
} }
.confirm-btn:active { .confirm-btn:active {
opacity: 0.9; opacity: 0.9;
transform: scale(0.98); transform: scale(0.98);
} }
</style> </style>
<template>
<iframe :onload="onloadCode" style="width: 100%; height: 100%; border: 1px solid #fff; background: #000"></iframe>
</template>
<script> <script>
export default { export default {
props: { props: {
...@@ -16,4 +13,9 @@ ...@@ -16,4 +13,9 @@
}, },
} }
</script> </script>
<template>
<iframe :onload="onloadCode" style="width: 100%; height: 100%; border: 1px solid #fff; background: #000"></iframe>
</template>
<style lang="scss"></style> <style lang="scss"></style>
...@@ -80,8 +80,14 @@ export function useMapbox<T extends MapboxInstance, P extends MapboxConfig>( ...@@ -80,8 +80,14 @@ export function useMapbox<T extends MapboxInstance, P extends MapboxConfig>(
getInstance()?.setLayoutProperty(layerId, name, value), getInstance()?.setLayoutProperty(layerId, name, value),
setFilter: (layerId: string, filter: any[]) => getInstance()?.setFilter(layerId, filter), setFilter: (layerId: string, filter: any[]) => getInstance()?.setFilter(layerId, filter),
flyTo: (options: mapboxgl.FlyToOptions) => getInstance()?.flyTo(options), flyTo: (options: mapboxgl.FlyToOptions) => getInstance()?.flyTo(options),
addMarker: (id: string, lnglat: [number, number], popup?: string, popupDefaultOpen?: boolean, imageUrl?: string, iconSize?: [number, number]) => addMarker: (
getInstance()?.addMarker(id, lnglat, popup, popupDefaultOpen, imageUrl, iconSize), id: string,
lnglat: [number, number],
popup?: string,
popupDefaultOpen?: boolean,
imageUrl?: string,
iconSize?: [number, number],
) => getInstance()?.addMarker(id, lnglat, popup, popupDefaultOpen, imageUrl, iconSize),
removeMarker: (id: string) => getInstance()?.removeMarker(id), removeMarker: (id: string) => getInstance()?.removeMarker(id),
removePopup: () => getInstance()?.removePopup(), removePopup: () => getInstance()?.removePopup(),
loadImage: (url: string, callback: (error: Error | null, image: HTMLImageElement) => void) => loadImage: (url: string, callback: (error: Error | null, image: HTMLImageElement) => void) =>
......
...@@ -16,7 +16,7 @@ export const tk = 'aa0ccd36f2dbb86dbb16cbf63f0034a6' ...@@ -16,7 +16,7 @@ export const tk = 'aa0ccd36f2dbb86dbb16cbf63f0034a6'
const host = 'https://foxgis.app.yiring.com' const host = 'https://foxgis.app.yiring.com'
// 构建天地图图层地址 // 构建天地图图层地址
export function buildTdtTileUrl(id: string,layer:string) { export function buildTdtTileUrl(id: string, layer: string) {
return `http://t0.tianditu.gov.cn/${id}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${layer}&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tk}` return `http://t0.tianditu.gov.cn/${id}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${layer}&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tk}`
return `${host}/api/tdt/cache/${id}/{z}/{y}/{x}/${tk}?v=2022` return `${host}/api/tdt/cache/${id}/{z}/{y}/{x}/${tk}?v=2022`
} }
...@@ -41,13 +41,13 @@ export const defaultStyle: mapboxgl.Style = { ...@@ -41,13 +41,13 @@ export const defaultStyle: mapboxgl.Style = {
sources: { sources: {
'wms-vec_w-source': { 'wms-vec_w-source': {
type: 'raster', type: 'raster',
tiles: [buildTdtTileUrl('vec_w','vec')], tiles: [buildTdtTileUrl('vec_w', 'vec')],
tileSize: 256, tileSize: 256,
maxzoom: 18, maxzoom: 18,
}, },
'wms-cva_w-source': { 'wms-cva_w-source': {
type: 'raster', type: 'raster',
tiles: [buildTdtTileUrl('cva_w','cva')], tiles: [buildTdtTileUrl('cva_w', 'cva')],
tileSize: 256, tileSize: 256,
maxzoom: 18, maxzoom: 18,
}, },
...@@ -59,7 +59,7 @@ export const defaultStyle: mapboxgl.Style = { ...@@ -59,7 +59,7 @@ export const defaultStyle: mapboxgl.Style = {
// }, // },
'wms-img_w-source': { 'wms-img_w-source': {
type: 'raster', type: 'raster',
tiles: [buildTdtTileUrl('img_w','img')], tiles: [buildTdtTileUrl('img_w', 'img')],
tileSize: 256, tileSize: 256,
maxzoom: 18, maxzoom: 18,
}, },
...@@ -850,7 +850,14 @@ export interface MapboxInstance { ...@@ -850,7 +850,14 @@ export interface MapboxInstance {
* @param iconSize 图标大小 [width, height] * @param iconSize 图标大小 [width, height]
* @link https://docs.mapbox.com/mapbox-gl-js/api/markers/#marker * @link https://docs.mapbox.com/mapbox-gl-js/api/markers/#marker
*/ */
addMarker(id: string, lngLat: number[], popup?: string, popupDefaultOpen?: boolean, imageUrl?: string, iconSize?: [number, number]): void addMarker(
id: string,
lngLat: number[],
popup?: string,
popupDefaultOpen?: boolean,
imageUrl?: string,
iconSize?: [number, number],
): void
/** /**
* 移除 Marker * 移除 Marker
* @param id Marker ID * @param id Marker ID
...@@ -986,7 +993,8 @@ export const HandlerUtil = { ...@@ -986,7 +993,8 @@ export const HandlerUtil = {
popup: HandlerUtil.createDefaultPopupHtml( popup: HandlerUtil.createDefaultPopupHtml(
station, station,
{ {
'{key}': `${(additional?.valueName ? station[additional.valueName] : station.value) || '-' '{key}': `${
(additional?.valueName ? station[additional.valueName] : station.value) || '-'
}{suffix}`, }{suffix}`,
...map, ...map,
}, },
...@@ -1008,7 +1016,8 @@ export const HandlerUtil = { ...@@ -1008,7 +1016,8 @@ export const HandlerUtil = {
if (isPlainObject(station) && isStation) { if (isPlainObject(station) && isStation) {
htmls.push( htmls.push(
`<div class="popup-row"><span class="popup-title">地点:</span>${station.city || ''} ${station.cnty || '' `<div class="popup-row"><span class="popup-title">地点:</span>${station.city || ''} ${
station.cnty || ''
} ${station.town || ''}</div>`, } ${station.town || ''}</div>`,
) )
htmls.push(`<div class="popup-row"><span class="popup-title">发生时间:</span>${station.occurTime}</div>`) htmls.push(`<div class="popup-row"><span class="popup-title">发生时间:</span>${station.occurTime}</div>`)
...@@ -1024,7 +1033,8 @@ export const HandlerUtil = { ...@@ -1024,7 +1033,8 @@ export const HandlerUtil = {
for (const key in map) { for (const key in map) {
const len = String(key === '{key}' ? station.key : key).length const len = String(key === '{key}' ? station.key : key).length
htmls.push( htmls.push(
`<div class="popup-row"><span class="popup-title" style="min-width: ${len + 1}em">${key}: </span>${wrap ? '</br>' : '' `<div class="popup-row"><span class="popup-title" style="min-width: ${len + 1}em">${key}: </span>${
wrap ? '</br>' : ''
} ${map[key] || '-'}</div>`, } ${map[key] || '-'}</div>`,
) )
} }
...@@ -1039,7 +1049,8 @@ export const HandlerUtil = { ...@@ -1039,7 +1049,8 @@ export const HandlerUtil = {
if (isPlainObject(station) && isStation) { if (isPlainObject(station) && isStation) {
htmls.push(`<div class="popup-row"><span class="popup-title">站号:</span>${station.stationCode}</div>`) htmls.push(`<div class="popup-row"><span class="popup-title">站号:</span>${station.stationCode}</div>`)
htmls.push( htmls.push(
`<div class="popup-row"><span class="popup-title">站名:</span>${station.city || ''} ${station.cnty || '' `<div class="popup-row"><span class="popup-title">站名:</span>${station.city || ''} ${
station.cnty || ''
} ${station.stationName || ''}</div>`, } ${station.stationName || ''}</div>`,
) )
} }
...@@ -1068,7 +1079,8 @@ export const HandlerUtil = { ...@@ -1068,7 +1079,8 @@ export const HandlerUtil = {
const len = String(key === '{key}' ? station.key : key).length const len = String(key === '{key}' ? station.key : key).length
if (key !== '{key}') { if (key !== '{key}') {
htmls.push( htmls.push(
`<div class="popup-row"><span class="popup-title" style="min-width: ${len + 1}em">${key} </span>${wrap ? '</br>' : '' `<div class="popup-row"><span class="popup-title" style="min-width: ${len + 1}em">${key} </span>${
wrap ? '</br>' : ''
} ${map[key] || '-'}</div>`, } ${map[key] || '-'}</div>`,
) )
} }
......
<template>
</template>
<script> <script>
export default { export default {}
}
</script> </script>
<style> <template></template>
</style> <style></style>
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270433254", // 意向企业 enterpriseId: '2004840258270433254', // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 洽谈合作 // 洽谈合作
function onCooperationClick() { function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示') // Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
</script> </script>
......
...@@ -188,8 +188,10 @@ ...@@ -188,8 +188,10 @@
pageData.search.pageNo = 1 pageData.search.pageNo = 1
pageData.purchaseDemands = [] pageData.purchaseDemands = []
pageData.supplyInfos = [] pageData.supplyInfos = []
if (pageData.currentTransactionTab === 1) getPurchaseList() if (pageData.currentTransactionTab === 1)
if (pageData.currentTransactionTab === 2) getSupplyList() getPurchaseList()
if (pageData.currentTransactionTab === 2)
getSupplyList()
} }
// 采购/供应标签点击事件 // 采购/供应标签点击事件
...@@ -199,8 +201,10 @@ ...@@ -199,8 +201,10 @@
pageData.search.pageNo = 1 pageData.search.pageNo = 1
pageData.purchaseDemands = [] pageData.purchaseDemands = []
pageData.supplyInfos = [] pageData.supplyInfos = []
if (pageData.currentTransactionTab === 1) getPurchaseList() if (pageData.currentTransactionTab === 1)
if (pageData.currentTransactionTab === 2) getSupplyList() getPurchaseList()
if (pageData.currentTransactionTab === 2)
getSupplyList()
} }
// 新需求提醒点击事件 // 新需求提醒点击事件
...@@ -245,12 +249,14 @@ ...@@ -245,12 +249,14 @@
onReachBottom(() => { onReachBottom(() => {
console.log('触底了') console.log('触底了')
if (pageData.currentTransactionTab === 1) { if (pageData.currentTransactionTab === 1) {
if (pageData.total <= pageData.purchaseDemands.length) return if (pageData.total <= pageData.purchaseDemands.length)
return
pageData.search.pageNo++ pageData.search.pageNo++
getPurchaseList() getPurchaseList()
} }
if (pageData.currentTransactionTab === 2) { if (pageData.currentTransactionTab === 2) {
if (pageData.total <= pageData.supplyInfos.length) return if (pageData.total <= pageData.supplyInfos.length)
return
pageData.search.pageNo++ pageData.search.pageNo++
getSupplyList() getSupplyList()
} }
......
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270488953", // 意向企业 enterpriseId: '2004840258270488953', // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 洽谈合作 // 洽谈合作
function onCooperationClick() { function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示') // Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
</script> </script>
......
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270471548", // 意向企业 enterpriseId: '2004840258270471548', // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 洽谈合作 // 洽谈合作
function onCooperationClick() { function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示') // Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
</script> </script>
......
...@@ -291,8 +291,10 @@ return ...@@ -291,8 +291,10 @@ return
<view class="price-range"> <view class="price-range">
<input :disabled="!isSave" type="number" class="price-input" v-model="form.priceStart" placeholder="最低价" :min="0" maxlength="6" /> <input :disabled="!isSave" type="number" class="price-input" v-model="form.priceStart" placeholder="最低价" :min="0" maxlength="6" />
<text class="price-separator"></text> <text class="price-separator"></text>
<input :disabled="!isSave" type="number" class="price-input" v-model="form.priceEnd" placeholder="最高价" :min="0" maxlength="6" > <input :disabled="!isSave" 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> <template #suffix>
<view class="unit-slot" style="font-size: 28rpx;"></view>
</template>
</input> </input>
</view> </view>
</view> </view>
......
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270471581", // 意向企业 enterpriseId: '2004840258270471581', // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 洽谈合作 // 洽谈合作
function onCooperationClick() { function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示') // Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
</script> </script>
......
...@@ -150,7 +150,8 @@ ...@@ -150,7 +150,8 @@
} }
function getCurrentAddressInfo() { function getCurrentAddressInfo() {
if (!uni.getStorageSync('location')) return if (!uni.getStorageSync('location'))
return
const { lon, lat } = uni.getStorageSync('location') const { lon, lat } = uni.getStorageSync('location')
UserInfoAPI.location({ UserInfoAPI.location({
...@@ -416,7 +417,7 @@ ...@@ -416,7 +417,7 @@
<!-- 供应时间 --> <!-- 供应时间 -->
<view class="form-section" style="padding: 0 30rpx"> <view class="form-section" style="padding: 0 30rpx">
<view class="form-item flex align-center"> <view class="form-item flex align-center">
<text class="label" style="font-size: 28rpx">{{pageText}}时间</text> <text class="label" style="font-size: 28rpx">{{ pageText }}时间</text>
<view class="time-range"> <view class="time-range">
<view <view
class="time-input" class="time-input"
......
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270437514", // 意向企业 enterpriseId: '2004840258270437514', // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 洽谈合作 // 洽谈合作
function onCooperationClick() { function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示') // Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
</script> </script>
...@@ -104,7 +105,10 @@ ...@@ -104,7 +105,10 @@
src="/static/images/codefun/ca51ef39a15d5c8414c9a427b3c4434b.png" src="/static/images/codefun/ca51ef39a15d5c8414c9a427b3c4434b.png"
/> />
</view> </view>
<view class="codefun-flex-row codefun-justify-between codefun-relative group_6" @click="onCooperationClick"> <view
class="codefun-flex-row codefun-justify-between codefun-relative group_6"
@click="onCooperationClick"
>
<image class="image_8" src="/static/images/codefun/979b55187f885f1b302dd29760bb516b.png" /> <image class="image_8" src="/static/images/codefun/979b55187f885f1b302dd29760bb516b.png" />
<image class="image_8" src="/static/images/codefun/ecb55b953a8e07a17301bcd12aec591f.png" /> <image class="image_8" src="/static/images/codefun/ecb55b953a8e07a17301bcd12aec591f.png" />
<view class="codefun-flex-row codefun-justify-center codefun-items-center section_6 pos"> <view class="codefun-flex-row codefun-justify-center codefun-items-center section_6 pos">
......
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270474551", // 意向企业 enterpriseId: '2004840258270474551', // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 洽谈合作 // 洽谈合作
function onCooperationClick() { function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示') // Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
</script> </script>
<template> <template>
<view class="codefun-flex-col page"> <view class="codefun-flex-col page">
<view class="codefun-flex-col section"> <view class="codefun-flex-col section">
......
<script setup lang="ts"> <script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue' import { computed, reactive, ref, watch } from 'vue'
import { useDictStore } from '@/store/modules/dict' import { useDictStore } from '@/store/modules/dict'
import * as NongchangAPI from '@/api/model/nongchang' import * as NongchangAPI from '@/api/model/nongchang'
// 定义Props // 定义Props
interface Props { interface Props {
show: boolean show: boolean
editData?: any editData?: any
farmId: any farmId: any
farmBaseId: any farmBaseId: any
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
show: false, show: false,
editData: null, editData: null,
farmId: 0, farmId: 0,
farmBaseId: 0, farmBaseId: 0,
}) })
// 定义Emits // 定义Emits
const emit = defineEmits<{ const emit = defineEmits<{
'update:show': [value: boolean] 'update:show': [value: boolean]
submit: [data: any] submit: [data: any]
close: [] close: []
}>() }>()
// 表单引用 // 表单引用
const formRef = ref() const formRef = ref()
const loading = ref(false) const loading = ref(false)
const showDeviceTypePicker = ref(false) const showDeviceTypePicker = ref(false)
// 字典存储 // 字典存储
const dictStore = useDictStore() const dictStore = useDictStore()
// 表单数据 // 表单数据
const formData = reactive({ const formData = reactive({
deviceName: '', deviceName: '',
deviceType: '', deviceType: '',
deviceTypeText: '', deviceTypeText: '',
deviceIdentifier: '', deviceIdentifier: '',
}) })
// 设备类型选项 - 使用字典数据 // 设备类型选项 - 使用字典数据
const deviceTypeOptions = computed(() => { const deviceTypeOptions = computed(() => {
return ( return (
dictStore.getDictList.deviceType?.map((item: any) => ({ dictStore.getDictList.deviceType?.map((item: any) => ({
value: item.value, value: item.value,
text: item.text, text: item.text,
})) || [] })) || []
) )
}) })
// 设备类型选择器数据 (不再需要,因为fui-picker使用options属性) // 设备类型选择器数据 (不再需要,因为fui-picker使用options属性)
// 计算属性 // 计算属性
const dialogTitle = computed(() => { const dialogTitle = computed(() => {
return props.editData ? '编辑设备' : '添加设备' return props.editData ? '编辑设备' : '添加设备'
}) })
const submitButtonText = computed(() => { const submitButtonText = computed(() => {
return props.editData ? '保存' : '确认' return props.editData ? '保存' : '确认'
}) })
// 表单验证规则 // 表单验证规则
const rules = { const rules = {
deviceName: [ deviceName: [
{ required: true, message: '请输入设备名称', trigger: 'blur' }, { required: true, message: '请输入设备名称', trigger: 'blur' },
{ min: 2, max: 50, message: '设备名称长度在2-50个字符之间', trigger: 'blur' }, { min: 2, max: 50, message: '设备名称长度在2-50个字符之间', trigger: 'blur' },
...@@ -83,10 +83,10 @@ const rules = { ...@@ -83,10 +83,10 @@ const rules = {
trigger: 'blur', trigger: 'blur',
}, },
], ],
} }
// 监听显示状态 // 监听显示状态
watch( watch(
() => props.show, () => props.show,
(newVal) => { (newVal) => {
if (newVal && props.editData) { if (newVal && props.editData) {
...@@ -98,10 +98,10 @@ watch( ...@@ -98,10 +98,10 @@ watch(
resetFormData() resetFormData()
} }
}, },
) )
// 重置表单数据 // 重置表单数据
function resetFormData() { function resetFormData() {
formData.deviceName = '' formData.deviceName = ''
formData.deviceType = '' formData.deviceType = ''
formData.deviceTypeText = '' formData.deviceTypeText = ''
...@@ -111,11 +111,12 @@ function resetFormData() { ...@@ -111,11 +111,12 @@ function resetFormData() {
if (formRef.value) { if (formRef.value) {
formRef.value.resetFields() formRef.value.resetFields()
} }
} }
// 加载编辑数据 // 加载编辑数据
function loadEditData() { function loadEditData() {
if (!props.editData) return if (!props.editData)
return
formData.deviceName = props.editData.deviceName || '' formData.deviceName = props.editData.deviceName || ''
formData.deviceType = props.editData.deviceType || '' formData.deviceType = props.editData.deviceType || ''
...@@ -133,17 +134,17 @@ function loadEditData() { ...@@ -133,17 +134,17 @@ function loadEditData() {
} else { } else {
formData.deviceTypeText = '' formData.deviceTypeText = ''
} }
} }
// 设备类型选择确认 // 设备类型选择确认
function handleDeviceTypeConfirm(e: any) { function handleDeviceTypeConfirm(e: any) {
formData.deviceType = e.value formData.deviceType = e.value
formData.deviceTypeText = e.text formData.deviceTypeText = e.text
showDeviceTypePicker.value = false showDeviceTypePicker.value = false
} }
// 提交表单 // 提交表单
async function handleSubmit() { async function handleSubmit() {
try { try {
console.log(formData) console.log(formData)
// 先进行表单验证 // 先进行表单验证
...@@ -190,21 +191,21 @@ async function handleSubmit() { ...@@ -190,21 +191,21 @@ async function handleSubmit() {
} finally { } finally {
loading.value = false loading.value = false
} }
} }
// 关闭弹窗 // 关闭弹窗
function handleClose() { function handleClose() {
emit('update:show', false) emit('update:show', false)
emit('close') emit('close')
} }
// 暴露方法给父组件 // 暴露方法给父组件
defineExpose({ defineExpose({
resetFormData, resetFormData,
setLoading: (value: boolean) => { setLoading: (value: boolean) => {
loading.value = value loading.value = value
}, },
}) })
</script> </script>
<template> <template>
...@@ -269,23 +270,23 @@ defineExpose({ ...@@ -269,23 +270,23 @@ defineExpose({
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-content { .dialog-content {
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
width: 90%; width: 90%;
max-height: 80vh; max-height: 80vh;
overflow-y: auto; overflow-y: auto;
} }
.section-title { .section-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
margin: 20rpx 0 30rpx 0; margin: 20rpx 0 30rpx 0;
padding-left: 20rpx; padding-left: 20rpx;
border-left: 6rpx solid #5db66f; border-left: 6rpx solid #5db66f;
} }
.dialog-buttons { .dialog-buttons {
display: flex; display: flex;
gap: 20rpx; gap: 20rpx;
margin-top: 40rpx; margin-top: 40rpx;
...@@ -308,10 +309,10 @@ defineExpose({ ...@@ -308,10 +309,10 @@ defineExpose({
border: 2rpx solid #dcdfe6; border: 2rpx solid #dcdfe6;
} }
} }
} }
// uview-plus 表单样式调整 // uview-plus 表单样式调整
::v-deep .u-form-item { ::v-deep .u-form-item {
margin-bottom: 40rpx; margin-bottom: 40rpx;
.u-form-item__body { .u-form-item__body {
...@@ -334,8 +335,8 @@ defineExpose({ ...@@ -334,8 +335,8 @@ defineExpose({
flex: 1; flex: 1;
min-width: 0; min-width: 0;
} }
} }
.address-display { .address-display {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
...@@ -355,15 +356,15 @@ defineExpose({ ...@@ -355,15 +356,15 @@ defineExpose({
.placeholder-text { .placeholder-text {
color: #c0c4cc; color: #c0c4cc;
} }
} }
::v-deep .u-form-item__body__left__content__required { ::v-deep .u-form-item__body__left__content__required {
position: static; position: static;
padding-right: 10rpx; padding-right: 10rpx;
} }
// 输入框样式优化 // 输入框样式优化
::v-deep .u-input { ::v-deep .u-input {
.u-input__content { .u-input__content {
padding: 0; padding: 0;
...@@ -388,10 +389,10 @@ defineExpose({ ...@@ -388,10 +389,10 @@ defineExpose({
} }
} }
} }
} }
// 模态框样式调整 // 模态框样式调整
::v-deep .u-modal { ::v-deep .u-modal {
.u-modal__content { .u-modal__content {
border-radius: 20rpx; border-radius: 20rpx;
padding: 20rpx 0rpx; padding: 20rpx 0rpx;
...@@ -407,5 +408,5 @@ defineExpose({ ...@@ -407,5 +408,5 @@ defineExpose({
color: #333; color: #333;
} }
} }
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: '', id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:1, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 1, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:1324324324, // 意向企业 enterpriseId: 1324324324, // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
}) })
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 立即申请 // 立即申请
function onApplyClick() { function onApplyClick() {
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
// 提交申请 // 提交申请
function handleConfirmLogout(){ function handleConfirmLogout() {
pageData.showLogoutDialog = false; pageData.showLogoutDialog = false
} }
// 查看大图 // 查看大图
function onViewImage(imageUrl) { function onViewImage(imageUrl) {
uni.previewImage({ uni.previewImage({
urls: [imageUrl] urls: [imageUrl],
}) })
} }
</script> </script>
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import Navigate from '@/utils/page/navigate' import Navigate from '@/utils/page/navigate'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const userStore = useUserStore()
// 下拉刷新 // 下拉刷新
onPullDownRefresh(() => { onPullDownRefresh(() => {
getGoodsList() getGoodsList()
...@@ -227,23 +228,31 @@ ...@@ -227,23 +228,31 @@
// 查询服务列表 // 查询服务列表
function getServiceItems() { function getServiceItems() {
// '灵活用工','农机租赁','惠农金融','助农保险' // '灵活用工','农机租赁','惠农金融','助农保险'
const testLimitContent = ['1983075690694692866','1983077495298183170','1983077763284848642','1983077932298522625','1985038053803876354','1985038211056721921','1985038680680357889']; const testLimitContent = [
'1983075690694692866',
'1983077495298183170',
'1983077763284848642',
'1983077932298522625',
'1985038053803876354',
'1985038211056721921',
'1985038680680357889',
]
HomeAPI.zoneList({ HomeAPI.zoneList({
pageNo: 1, pageNo: 1,
pageSize: 5, pageSize: 5,
status: 1, status: 1,
type: 3, type: 3,
}).then((res) => { }).then((res) => {
const { records } = res; const { records } = res
if(userStore.isAuditMode){ if (userStore.isAuditMode) {
let arrData = []; const arrData = []
for(let i = 0; i < records.length; i++){ for (let i = 0; i < records.length; i++) {
if(!testLimitContent.includes(records[i].id)){ if (!testLimitContent.includes(records[i].id)) {
arrData.push(records[i]); arrData.push(records[i])
} }
} }
pageData.menuItems = arrData; pageData.menuItems = arrData
}else{ } else {
pageData.menuItems = [...records] pageData.menuItems = [...records]
} }
}) })
...@@ -403,7 +412,10 @@ ...@@ -403,7 +412,10 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="!userStore.isAuditMode" class="codefun-flex-row codefun-justify-between codefun-items-baseline codefun-mt-24"> <view
v-if="!userStore.isAuditMode"
class="codefun-flex-row codefun-justify-between codefun-items-baseline codefun-mt-24"
>
<text class="font_5 text_8">灵活用工</text> <text class="font_5 text_8">灵活用工</text>
<text class="font_6 text_9" @click="onViewMoreFlexibleEmployment">更多</text> <text class="font_6 text_9" @click="onViewMoreFlexibleEmployment">更多</text>
</view> </view>
...@@ -485,9 +497,7 @@ ...@@ -485,9 +497,7 @@
</view> </view>
</view> </view>
<view class="codefun-flex-col codefun-mt-24"> <view class="codefun-flex-col codefun-mt-24">
<view <view class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch">
class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch"
>
<text class="font_5">农资交易</text> <text class="font_5">农资交易</text>
<text class="text-28 font-extralight color-#5DB66F" @click="onViewMoreKexinnongzi"> <text class="text-28 font-extralight color-#5DB66F" @click="onViewMoreKexinnongzi">
更多<fui-icon name="right" size="30" color="#5DB66F" /> 更多<fui-icon name="right" size="30" color="#5DB66F" />
...@@ -521,7 +531,10 @@ ...@@ -521,7 +531,10 @@
>{{ product.name }}</text >{{ product.name }}</text
> >
<text class="codefun-self-start font_1 text_27 codefun-mt-10" style="font-size: 32rpx" <text class="codefun-self-start font_1 text_27 codefun-mt-10" style="font-size: 32rpx"
>¥{{ product.minSellPrice }}<text v-if="product.unit" style="font-size: 24rpx;color:#999999;">/{{ product.unit }}</text></text >¥{{ product.minSellPrice
}}<text v-if="product.unit" style="font-size: 24rpx; color: #999999"
>/{{ product.unit }}</text
></text
> >
</view> </view>
</view> </view>
......
<script setup lang="ts"> <script setup lang="ts">
import { reactive, toRefs } from 'vue' import { reactive } from 'vue'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { useGlobSetting } from '/@/hooks/setting' import { useGlobSetting } from '/@/hooks/setting'
import * as NongchangAPI from '@/api/model/nongchang' import * as NongchangAPI from '@/api/model/nongchang'
import { areaTree } from '@/utils/areaData' import { areaTree } from '@/utils/areaData'
import { useDictStore } from '@/store/modules/dict' import { useDictStore } from '@/store/modules/dict'
import { useFarmStore } from '@/store/modules/farm' import { useFarmStore } from '@/store/modules/farm'
const dictStore = useDictStore() const dictStore = useDictStore()
const userStore = useUserStore() const userStore = useUserStore()
const globSetting = useGlobSetting() const globSetting = useGlobSetting()
const farmStore = useFarmStore() const farmStore = useFarmStore()
onLoad((pageOptions) => { onLoad((pageOptions) => {
// 页面加载时的初始化操作 // 页面加载时的初始化操作
const farmInfo = farmStore.getFarm const farmInfo = farmStore.getFarm
if (farmInfo) { if (farmInfo) {
pageData.form.farmId = farmInfo.id pageData.form.farmId = farmInfo.id
} }
pageData.form.farmId = pageOptions.farmId pageData.form.farmId = pageOptions.farmId
}) })
onShow(() => { onShow(() => {
// 数据字典赋值 // 数据字典赋值
initDict() initDict()
pageData.form.userId = userStore.getUserInfo.id pageData.form.userId = userStore.getUserInfo.id
}) })
const pageData = reactive({ const pageData = reactive({
loading: false, loading: false,
show: { show: {
growCrops: false, growCrops: false,
...@@ -75,9 +75,9 @@ const pageData = reactive({ ...@@ -75,9 +75,9 @@ const pageData = reactive({
msg: ['请选择种植作物'], msg: ['请选择种植作物'],
}, },
], ],
}) })
function initDict() { function initDict() {
pageData.options.address = areaTree pageData.options.address = areaTree
pageData.options.growCrops = dictStore.getDictList.crops_type.map((item) => { pageData.options.growCrops = dictStore.getDictList.crops_type.map((item) => {
return { return {
...@@ -85,16 +85,16 @@ function initDict() { ...@@ -85,16 +85,16 @@ function initDict() {
text: item.text, text: item.text,
} }
}) })
} }
function handleChangeGrowCrops(e) { function handleChangeGrowCrops(e) {
pageData.form.growCrops = e.value pageData.form.growCrops = e.value
pageData.form.growCropsText = e.text pageData.form.growCropsText = e.text
pageData.show.growCrops = false pageData.show.growCrops = false
} }
const toastRef = ref() const toastRef = ref()
const formRef = ref() const formRef = ref()
function submit() { function submit() {
formRef.value.validator(pageData.form, pageData.rules, true).then((res) => { formRef.value.validator(pageData.form, pageData.rules, true).then((res) => {
if (res.isPassed) { if (res.isPassed) {
pageData.loading = true pageData.loading = true
...@@ -118,7 +118,7 @@ function submit() { ...@@ -118,7 +118,7 @@ function submit() {
}) })
} }
}) })
} }
</script> </script>
<template> <template>
...@@ -209,113 +209,113 @@ function submit() { ...@@ -209,113 +209,113 @@ function submit() {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
background: #e8f5e9; background: #e8f5e9;
min-height: 100vh; min-height: 100vh;
} }
.page-container { .page-container {
padding: 28rpx; padding: 28rpx;
} }
.form-card { .form-card {
background-color: #ffffff; background-color: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
} }
.upload-title { .upload-title {
padding: 28rpx; padding: 28rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
font-weight: 400; font-weight: 400;
} }
.upload-content { .upload-content {
padding: 0 32rpx 32rpx; padding: 0 32rpx 32rpx;
} }
.submit-btn-box { .submit-btn-box {
padding: 32rpx 0; padding: 32rpx 0;
} }
:deep(.fui-button) { :deep(.fui-button) {
border-color: #ff9800 !important; border-color: #ff9800 !important;
background: #ff9800 !important; background: #ff9800 !important;
} }
:deep(.fui-input__wrap), :deep(.fui-input__wrap),
:deep(.fui-textarea__wrap) { :deep(.fui-textarea__wrap) {
padding: 28rpx 32rpx; padding: 28rpx 32rpx;
// border-bottom: 1px solid #e5e5e5; // border-bottom: 1px solid #e5e5e5;
} }
:deep(.fui-input__label), :deep(.fui-input__label),
:deep(.fui-textarea__label) { :deep(.fui-textarea__label) {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
min-width: 160rpx; min-width: 160rpx;
font-weight: 400; font-weight: 400;
} }
:deep(.fui-input__self), :deep(.fui-input__self),
:deep(.fui-textarea__self) { :deep(.fui-textarea__self) {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
} }
:deep(.fui-input__placeholder), :deep(.fui-input__placeholder),
:deep(.fui-textarea__placeholder) { :deep(.fui-textarea__placeholder) {
color: #d0d0d0; color: #d0d0d0;
font-size: 28rpx; font-size: 28rpx;
} }
.form-card :deep(.fui-input__wrap:last-child), .form-card :deep(.fui-input__wrap:last-child),
.form-card :deep(.fui-textarea__wrap:last-child) { .form-card :deep(.fui-textarea__wrap:last-child) {
border-bottom: none; border-bottom: none;
} }
::v-deep .uni-input-placeholder { ::v-deep .uni-input-placeholder {
font-size: 28rpx !important; font-size: 28rpx !important;
color: #999999 !important; color: #999999 !important;
} }
:deep(.uni-textarea-placeholder) { :deep(.uni-textarea-placeholder) {
font-size: 28rpx !important; font-size: 28rpx !important;
color: #999999 !important; color: #999999 !important;
} }
:deep(.fui-button) { :deep(.fui-button) {
width: 690rpx; width: 690rpx;
border-color: #5db66f !important; border-color: #5db66f !important;
background: #5db66f !important; background: #5db66f !important;
} }
// 移除fui-form的默认样式 // 移除fui-form的默认样式
:deep(.fui-form) { :deep(.fui-form) {
background: transparent; background: transparent;
} }
:deep(.fui-form__item) { :deep(.fui-form__item) {
background: transparent; background: transparent;
border: none; border: none;
margin-bottom: 0; margin-bottom: 0;
padding: 0; padding: 0;
} }
:deep(.fui-input__border-bottom) { :deep(.fui-input__border-bottom) {
right: 32rpx !important; right: 32rpx !important;
} }
.form-item-block { .form-item-block {
padding: 24rpx 12rpx; padding: 24rpx 12rpx;
// border-bottom: 1px solid #e5e5e5; // border-bottom: 1px solid #e5e5e5;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
} }
} }
.form-item-label { .form-item-label {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
font-weight: 400; font-weight: 400;
...@@ -326,14 +326,14 @@ function submit() { ...@@ -326,14 +326,14 @@ function submit() {
color: #ff4d4f; color: #ff4d4f;
margin-right: 8rpx; margin-right: 8rpx;
} }
} }
.block-textarea { .block-textarea {
width: 100%; width: 100%;
padding: 0rpx 12rpx !important; padding: 0rpx 12rpx !important;
} }
.block-upload { .block-upload {
width: 100%; width: 100%;
padding: 0 20rpx; padding: 0 20rpx;
:deep(.uni-file-picker__container) { :deep(.uni-file-picker__container) {
...@@ -344,17 +344,17 @@ function submit() { ...@@ -344,17 +344,17 @@ function submit() {
display: flex; display: flex;
justify-content: left !important; justify-content: left !important;
} }
} }
.select-text { .select-text {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
padding: 0 20rpx; padding: 0 20rpx;
&.placeholder { &.placeholder {
color: #999999; color: #999999;
} }
} }
.fui-input-wrapper { .fui-input-wrapper {
cursor: pointer; cursor: pointer;
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { onLoad, onPullDownRefresh, onShow } from '@dcloudio/uni-app' import { onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { reactive } from 'vue'
import Navigate from '@/utils/page/navigate' import Navigate from '@/utils/page/navigate'
import { reactive, ref } from 'vue'
import * as NongzhiAPI from '@/api/model/nongzhi' import * as NongzhiAPI from '@/api/model/nongzhi'
onPullDownRefresh(() => { onPullDownRefresh(() => {
resetData() resetData()
getList(pageData.params) getList(pageData.params)
...@@ -20,16 +21,17 @@ ...@@ -20,16 +21,17 @@
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
bizCategory:2, bizCategory: 2,
reviewStatus:1 reviewStatus: 1,
}, // 分页参数 }, // 分页参数
hasMore: true, // 是否还有更多数据 hasMore: true, // 是否还有更多数据
loading: false, // 是否正在加载 loading: false, // 是否正在加载
dataList:[] dataList: [],
}) })
async function getList(params) { async function getList(params) {
if (pageData.loading) return if (pageData.loading)
return
pageData.loading = true pageData.loading = true
await NongzhiAPI.getEnterpriseList(params).then((res) => { await NongzhiAPI.getEnterpriseList(params).then((res) => {
if (res.records.length > 0) { if (res.records.length > 0) {
...@@ -48,9 +50,8 @@ ...@@ -48,9 +50,8 @@
pageData.loading = false pageData.loading = false
} }
function toDetail(item) { function toDetail(item) {
let param = encodeURIComponent(JSON.stringify({id:item.id,name:item.enterpriseName})); const param = encodeURIComponent(JSON.stringify({ id: item.id, name: item.enterpriseName }))
Navigate.to(`/pages/kexinnongzi/detail?param=${param}`) Navigate.to(`/pages/kexinnongzi/detail?param=${param}`)
} }
...@@ -81,14 +82,13 @@ ...@@ -81,14 +82,13 @@
<image class="enterprise_logo" mode="aspectFit" :src="item.enterpriseLogoUrl" /> <image class="enterprise_logo" mode="aspectFit" :src="item.enterpriseLogoUrl" />
</view> </view>
<view class="item_right"> <view class="item_right">
<view class="item_name ellipsis">{{item.enterpriseName}}</view> <view class="item_name ellipsis">{{ item.enterpriseName }}</view>
<view class="item_description ellipsis">{{item.businessScope}}</view> <view class="item_description ellipsis">{{ item.businessScope }}</view>
<view class="item_details"> <view class="item_details">
<view class="detail_btn" @click="toDetail(item)">查看详情</view> <view class="detail_btn" @click="toDetail(item)">查看详情</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 加载状态 --> <!-- 加载状态 -->
<view class="loading-status"> <view class="loading-status">
...@@ -101,60 +101,62 @@ ...@@ -101,60 +101,62 @@
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>
.yr_page_view{ .yr_page_view {
padding: 28rpx; padding: 28rpx;
.top_img,.agr_sup_img{ .top_img,
.agr_sup_img {
height: 280rpx; height: 280rpx;
width: 690rpx; width: 690rpx;
} }
.top_img{ .top_img {
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.page_content{ .page_content {
border-radius: 16rpx; border-radius: 16rpx;
background: #FFFFFF; background: #ffffff;
} }
.ellipsis{ .ellipsis {
width: 200px; width: 200px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.item_list{ .item_list {
display: flex; display: flex;
align-items:flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
padding-left: 24rpx; padding-left: 24rpx;
padding-right: 30rpx; padding-right: 30rpx;
padding-bottom: 24rpx; padding-bottom: 24rpx;
padding-top: 24rpx; padding-top: 24rpx;
border-bottom: 2rpx solid #EEEEEE; border-bottom: 2rpx solid #eeeeee;
.item_left,.enterprise_logo{ .item_left,
.enterprise_logo {
width: 192rpx; width: 192rpx;
max-height: 160rpx; max-height: 160rpx;
} }
.item_right{ .item_right {
width: 436rpx; width: 436rpx;
.item_name{ .item_name {
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }
.item_description{ .item_description {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
margin-top: 16rpx; margin-top: 16rpx;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.item_details{ .item_details {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.detail_btn{ .detail_btn {
border-radius: 100rpx; border-radius: 100rpx;
background: #5DB66F; background: #5db66f;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
...@@ -163,18 +165,15 @@ ...@@ -163,18 +165,15 @@
height: 48rpx; height: 48rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #ffffff;
} }
} }
} }
.item_list:last-child{ .item_list:last-child {
border-bottom: none; border-bottom: none;
} }
} }
.loading-status { .loading-status {
text-align: center; text-align: center;
padding: 20rpx; padding: 20rpx;
......
...@@ -15,21 +15,22 @@ ...@@ -15,21 +15,22 @@
const videoList = ref([]) const videoList = ref([])
function getVideoList(params) { function getVideoList(params) {
if (model.loading) return if (model.loading)
return
model.loading = true model.loading = true
videoApi.getList(params).then((res) => { videoApi.getList(params).then((res) => {
if (res.records.length > 0) { if (res.records.length > 0) {
const { records } = res; const { records } = res
let scale:any = 0; let scale: any = 0
for(let i = 0; i < records.length;i++){ for (let i = 0; i < records.length; i++) {
if(records[i].width){ if (records[i].width) {
scale = (340 / records[i].width).toFixed(1); scale = (340 / records[i].width).toFixed(1)
records[i].videoWidth = 340; records[i].videoWidth = 340
records[i].videoHeight = Math.floor(records[i].height * scale); records[i].videoHeight = Math.floor(records[i].height * scale)
}else{ } else {
records[i].videoWidth = 0; records[i].videoWidth = 0
records[i].videoHeight = 0; records[i].videoHeight = 0
} }
} }
......
...@@ -73,8 +73,25 @@ ...@@ -73,8 +73,25 @@
</view> </view>
<view class="text-left"> <view class="text-left">
<fui-form ref="formRef"> <fui-form ref="formRef">
<fui-input marginTop="30" size="28" placeholder="请填写姓名" v-model="pageData.form.reservedname" required maxlength="16" placeholderStyle="margin-left: 10rpx"/> <fui-input
<fui-input marginTop="30" size="28" placeholder="请填写预留手机" v-model="pageData.form.reservedmobile" required type="number" maxlength="11" placeholderStyle="margin-left: 10rpx"/> 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"> <view style="margin-top: 30rpx">
<fui-button text="提交" bold radius="96rpx" @click="submit" /> <fui-button text="提交" bold radius="96rpx" @click="submit" />
</view> </view>
......
<script setup lang="ts"> <script setup lang="ts">
import { reactive, toRefs } from 'vue' import { reactive } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { getCalculateAge } from '@/utils/date' import { getCalculateAge } from '@/utils/date'
import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong'; import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong'
import ConfirmDialog from '@/components/ConfirmDialog/index.vue' import ConfirmDialog from '@/components/ConfirmDialog/index.vue'
const pageData = reactive({ const pageData = reactive({
loading: false, loading: false,
workersParam:[], workersParam: [],
contactMobile:"", contactMobile: '',
contactName:"", contactName: '',
showConfirmDialog:false, showConfirmDialog: false,
}) })
// 字典值 // 字典值
const DictData = reactive({ const DictData = reactive({
sexArr:[],// 性别 sexArr: [], // 性别
educationArr:[]// 学历 educationArr: [], // 学历
}) })
onLoad((options) => { onLoad((options) => {
let param = JSON.parse(decodeURIComponent(options.param)); const param = JSON.parse(decodeURIComponent(options.param))
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: param.villageName title: param.villageName,
}); })
getLaborAppDetail(param.id); getLaborAppDetail(param.id)
}) })
async function getLaborAppDetail(id: string) { async function getLaborAppDetail(id: string) {
await LinghuoyonggongAPI.gitListByCodeDict({ code : 'sex'}).then(res=>{ await LinghuoyonggongAPI.gitListByCodeDict({ code: 'sex' }).then((res) => {
DictData.sexArr = res; DictData.sexArr = res
}) })
await LinghuoyonggongAPI.gitListByCodeDict({ code : 'education'}).then(res=>{ await LinghuoyonggongAPI.gitListByCodeDict({ code: 'education' }).then((res) => {
DictData.educationArr = res; DictData.educationArr = res
}) })
await LinghuoyonggongAPI.getLaborAppDetail({ id }).then((res) => { await LinghuoyonggongAPI.getLaborAppDetail({ id }).then((res) => {
pageData.workersParam = res.workers; pageData.workersParam = res.workers
pageData.contactMobile = res.contactMobile; pageData.contactMobile = res.contactMobile
pageData.contactName = res.contactName.substring(0,1) + new Array(res.contactName.length).join('*'); pageData.contactName =
res.contactName.substring(0, 1) + Array.from({ length: res.contactName.length }).join('*')
}) })
} }
// 返回字典中的中文值 // 返回字典中的中文值
function returnDictZhVel(type:any,val:any){ function returnDictZhVel(type: any, val: any) {
let valText = ""; let valText = ''
if(type == 'gender'){ if (type == 'gender') {
let arr = DictData.sexArr; const arr = DictData.sexArr
for(let i = 0; i < arr.length;i++){ for (let i = 0; i < arr.length; i++) {
if(val == parseInt(arr[i].itemValue)){ if (val == Number.parseInt(arr[i].itemValue)) {
valText = arr[i].itemText; valText = arr[i].itemText
break; break
} }
} }
} }
if(type == 'edu'){ if (type == 'edu') {
let arr = DictData.educationArr; const arr = DictData.educationArr
for(let i = 0; i < arr.length;i++){ for (let i = 0; i < arr.length; i++) {
if(val == parseInt(arr[i].itemValue)){ if (val == Number.parseInt(arr[i].itemValue)) {
valText = arr[i].itemText; valText = arr[i].itemText
break; break
} }
} }
} }
return valText; return valText
} }
function makePhoneCall(){ function makePhoneCall() {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: pageData.contactMobile phoneNumber: pageData.contactMobile,
}); })
} }
</script> </script>
...@@ -73,16 +74,22 @@ ...@@ -73,16 +74,22 @@
<view v-if="!pageData.workersParam || pageData.workersParam.length == 0" style="height: 700rpx"> <view v-if="!pageData.workersParam || pageData.workersParam.length == 0" style="height: 700rpx">
<fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" /> <fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" />
</view> </view>
<view class="yr-person-item" v-for="(item,index) in pageData.workersParam" :key="index"> <view class="yr-person-item" v-for="(item, index) in pageData.workersParam" :key="index">
<view class="yr-person-info"> <view class="yr-person-info">
<view class="person_name_attr">{{item.name}}<text class="person_attr">{{item.attr}}</text></view> <view class="person_name_attr"
<view class="person-info">{{getCalculateAge(item.birthday)}}{{ returnDictZhVel('gender',item.gender) }}{{ returnDictZhVel('edu',item.edu)}}</view> >{{ item.name }}<text class="person_attr">{{ item.attr }}</text></view
<view class="person-info text_overflow_ellipsis">技能:{{item.skill}}</view> >
<view class="person-info"
>{{ getCalculateAge(item.birthday) }}{{ returnDictZhVel('gender', item.gender) }}{{
returnDictZhVel('edu', item.edu)
}}</view
>
<view class="person-info text_overflow_ellipsis">技能:{{ item.skill }}</view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="pageData.workersParam.length" class="make-phone-view"> <view v-if="pageData.workersParam.length" class="make-phone-view">
<fui-button text="电话沟通" bold radius="96rpx" @click="pageData.showConfirmDialog = true" height="80rpx"/> <fui-button text="电话沟通" bold radius="96rpx" @click="pageData.showConfirmDialog = true" height="80rpx" />
</view> </view>
<!-- 确认对话框 --> <!-- 确认对话框 -->
<ConfirmDialog <ConfirmDialog
...@@ -98,35 +105,35 @@ ...@@ -98,35 +105,35 @@
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.details_page{ .details_page {
background: rgba(230, 245, 232, 1); background: rgba(230, 245, 232, 1);
min-height: 100vh; min-height: 100vh;
width: 750rpx; width: 750rpx;
padding-top: 24rpx; padding-top: 24rpx;
position: relative; position: relative;
.details-content{ .details-content {
width: 694rpx; width: 694rpx;
background-color: #FFFFFF; background-color: #ffffff;
margin-left: 28rpx; margin-left: 28rpx;
border-radius: 12rpx; border-radius: 12rpx;
padding: 24rpx; padding: 24rpx;
.yr-person-item{ .yr-person-item {
border-bottom: 2rpx solid #EEEEEE; border-bottom: 2rpx solid #eeeeee;
margin-bottom: 24rpx; margin-bottom: 24rpx;
.yr-person-info{ .yr-person-info {
.person_name_attr{ .person_name_attr {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
.person_attr{ .person_attr {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #5DB66F; color: #5db66f;
margin-left: 12rpx; margin-left: 12rpx;
} }
} }
.person-info{ .person-info {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
vertical-align: middle; vertical-align: middle;
...@@ -135,17 +142,17 @@ ...@@ -135,17 +142,17 @@
} }
} }
} }
.yr-person-item:last-child{ .yr-person-item:last-child {
border-bottom: none; border-bottom: none;
} }
} }
.make-phone-view{ .make-phone-view {
width: 690rpx; width: 690rpx;
height: 80rpx; height: 80rpx;
position: fixed; position: fixed;
left: 30rpx; left: 30rpx;
bottom: 62rpx; bottom: 62rpx;
} }
} }
</style> </style>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
], ],
data: { data: {
username: '', username: '',
password:'', password: '',
// code: '', // code: '',
read: false, read: false,
deviceId: '', deviceId: '',
...@@ -274,8 +274,7 @@ ...@@ -274,8 +274,7 @@
v-model="model.form.data.password" v-model="model.form.data.password"
backgroundColor="transparent" backgroundColor="transparent"
borderColor="transparent" borderColor="transparent"
> />
</fui-input>
</view> </view>
</view> </view>
<!-- <view class="login-input-area"> <!-- <view class="login-input-area">
......
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import * as NewsApi from '@/api/model/news'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import * as NewsApi from '@/api/model/news'
interface News { interface News {
id: number id: number
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
const navigateName = ref(['热点新闻', '农业政策']) const navigateName = ref(['热点新闻', '农业政策'])
async function getNewsList(params) { async function getNewsList(params) {
if (model.loading) return if (model.loading)
return
model.loading = true model.loading = true
NewsApi.getList(params).then((res) => { NewsApi.getList(params).then((res) => {
if (res.records.length > 0) { if (res.records.length > 0) {
...@@ -129,7 +130,7 @@ ...@@ -129,7 +130,7 @@
<image class="mt-0.5 mr-1 w-30 h-26" src="/static/images/news/views.png" /> <image class="mt-0.5 mr-1 w-30 h-26" src="/static/images/news/views.png" />
<view class="flex-center text-24 lh-24rpx">{{ news.viewCount }}</view> <view class="flex-center text-24 lh-24rpx">{{ news.viewCount }}</view>
</view> </view>
<view v-show="!news.posterUrl" class="w-4%"></view> <view v-show="!news.posterUrl" class="w-4%" />
</view> </view>
</view> </view>
<view v-show="news.posterUrl" class="w-30% h-130"> <view v-show="news.posterUrl" class="w-30% h-130">
......
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import dayjs from 'dayjs'
import * as WeatherAPI from '@/api/model/weather' import * as WeatherAPI from '@/api/model/weather'
import { Echarts, useEcharts } from '@/components/Echarts' import { Echarts, useEcharts } from '@/components/Echarts'
import { getDayLabelValue, getWeatherIcon } from '@/utils/weather' import { getDayLabelValue, getWeatherIcon } from '@/utils/weather'
// 逐 7 天预报图表 // 逐 7 天预报图表
const [register7Forecast, Forecast7Chart] = useEcharts() const [register7Forecast, Forecast7Chart] = useEcharts()
const model = reactive({ const model = reactive({
days: 15, days: 15,
updateTime: '-', updateTime: '-',
}) })
onLoad(async () => { onLoad(async () => {
const location = uni.getStorageSync('location') const location = uni.getStorageSync('location')
const forecasts = await WeatherAPI.forecast(`${location.lon},${location.lat}`, model.days).then((res) => { const forecasts = await WeatherAPI.forecast(`${location.lon},${location.lat}`, model.days).then((res) => {
model.updateTime = dayjs(res.data.updateTime).format('YYYY-MM-DD HH:mm') model.updateTime = dayjs(res.data.updateTime).format('YYYY-MM-DD HH:mm')
...@@ -44,22 +44,24 @@ onLoad(async () => { ...@@ -44,22 +44,24 @@ onLoad(async () => {
}, },
formatter: (params) => { formatter: (params) => {
// 过滤掉星期标签、日期标签和天气图标 // 过滤掉星期标签、日期标签和天气图标
const filteredParams = params.filter(param => { const filteredParams = params.filter((param) => {
return param.seriesName !== '星期标签' && return (
param.seriesName !== '星期标签' &&
param.seriesName !== '日期标签' && param.seriesName !== '日期标签' &&
param.seriesName !== '天气图标'; param.seriesName !== '天气图标'
}); )
if (filteredParams.length === 0) return ''; })
if (filteredParams.length === 0) return ''
let result = ''; let result = ''
filteredParams.forEach(param => { filteredParams.forEach((param) => {
// 只显示有意义的数值信息 // 只显示有意义的数值信息
if (param.seriesName === '最高温度' || param.seriesName === '最低温度') { if (param.seriesName === '最高温度' || param.seriesName === '最低温度') {
result += `${param.seriesName}: ${param.value}°<br/>`; result += `${param.seriesName}: ${param.value}°<br/>`
}
});
return result;
} }
})
return result
},
}, },
grid: { grid: {
top: '5%', top: '5%',
...@@ -194,7 +196,7 @@ onLoad(async () => { ...@@ -194,7 +196,7 @@ onLoad(async () => {
}, },
], ],
}) })
}) })
</script> </script>
<template> <template>
...@@ -213,5 +215,5 @@ onLoad(async () => { ...@@ -213,5 +215,5 @@ onLoad(async () => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
// //
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, toRefs } from 'vue'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { useGlobSetting } from '/@/hooks/setting' import { useGlobSetting } from '/@/hooks/setting'
...@@ -23,7 +22,13 @@ onLoad((pageOptions) => { ...@@ -23,7 +22,13 @@ onLoad((pageOptions) => {
pageData.form[key] = res[key] pageData.form[key] = res[key]
} }
}) })
// 回显省市区名称
if (res.provinceName && res.cityName && res.districtName) {
pageData.form.provinceName = res.provinceName
pageData.form.cityName = res.cityName
pageData.form.districtName = res.districtName
pageData.form.provinceText = res.provinceName + '/' + res.cityName + '/' + res.districtName pageData.form.provinceText = res.provinceName + '/' + res.cityName + '/' + res.districtName
}
// 编辑模式下,如果已有示例图片,需要设置到上传组件中 // 编辑模式下,如果已有示例图片,需要设置到上传组件中
if (res.coverImage) { if (res.coverImage) {
...@@ -99,6 +104,7 @@ const pageData = reactive({ ...@@ -99,6 +104,7 @@ const pageData = reactive({
districtName: '', districtName: '',
addressDetail: '', addressDetail: '',
coverImage: '', coverImage: '',
slogan: '',
}, },
rules: [ rules: [
{ {
...@@ -139,7 +145,17 @@ const pageData = reactive({ ...@@ -139,7 +145,17 @@ const pageData = reactive({
{ {
name: 'provinceName', name: 'provinceName',
rule: ['required'], rule: ['required'],
msg: ['请选择归属省份'], msg: ['请填写省市区信息!'],
},
{
name: 'cityName',
rule: ['required'],
msg: ['请填写省市区信息!'],
},
{
name: 'districtName',
rule: ['required'],
msg: ['请填写省市区信息!'],
}, },
{ {
name: 'addressDetail', name: 'addressDetail',
...@@ -231,15 +247,43 @@ function submit() { ...@@ -231,15 +247,43 @@ function submit() {
formRef.value.validator(pageData.form, pageData.rules, true).then((res) => { formRef.value.validator(pageData.form, pageData.rules, true).then((res) => {
if (res.isPassed) { if (res.isPassed) {
pageData.loading = true pageData.loading = true
// 提交前处理:通过对provinceText值按/分隔,分别赋值给provinceName、cityName和districtName
if (pageData.form.provinceText) {
const addressParts = pageData.form.provinceText.split('/')
if (addressParts.length >= 3) {
pageData.form.provinceName = addressParts[0]
pageData.form.cityName = addressParts[1]
pageData.form.districtName = addressParts[2]
}
}
const apiCall = pageData.form.id ? NongchangAPI.farmsEdit : NongchangAPI.farmsAdd const apiCall = pageData.form.id ? NongchangAPI.farmsEdit : NongchangAPI.farmsAdd
apiCall(pageData.form) apiCall(pageData.form)
.then(() => { .then((res) => {
toastRef.value.show({ toastRef.value.show({
type: 'success', type: 'success',
text: pageData.form.id ? '保存修改成功' : '添加农场成功', text: pageData.form.id ? '保存修改成功' : '添加农场成功',
}) })
// 获取农场ID:编辑时使用当前ID,新增时从返回值获取(假设返回的是ID或包含ID的对象)
// 根据后端接口惯例,如果返回的是ID字符串直接使用,如果是对象则取id字段
// 暂时假设res为ID或者不影响跳转,优先使用pageData.form.id,如果是新增则尝试从res获取
// 如果res不是id,则需要确认接口返回值结构。通常新增接口返回ID比较合理。
// 鉴于不确定接口返回值,这里先假设编辑时id已知,新增时尝试从res获取,如果获取不到则回退到列表页
const targetId = pageData.form.id || (typeof res === 'string' ? res : res?.id);
setTimeout(() => { setTimeout(() => {
if (targetId) {
// 跳转到农场详情页,注意路径需要是绝对路径
uni.redirectTo({
url: `/pages/nongchang/detail/index?id=${targetId}`
})
} else {
// 如果没有ID,回退上一页
uni.navigateBack() uni.navigateBack()
}
}, 500); }, 500);
}) })
.finally(() => { .finally(() => {
...@@ -326,6 +370,19 @@ function submit() { ...@@ -326,6 +370,19 @@ function submit() {
class="block-textarea" class="block-textarea"
/> />
</view> </view>
<!-- 农场标语 -->
<view class="form-item-block">
<view class="form-item-label">农场标语</view>
<fui-textarea
height="100rpx"
size="28"
:borderTop="false"
:borderBottom="false"
placeholder="请输入农场标语"
v-model="pageData.form.slogan"
class="block-textarea"
/>
</view>
</view> </view>
<!-- 第二组表单 --> <!-- 第二组表单 -->
...@@ -333,14 +390,14 @@ function submit() { ...@@ -333,14 +390,14 @@ function submit() {
<fui-form-item <fui-form-item
required required
asterisk asterisk
label="归属省份" label="归属地区"
labelSize="28" labelSize="28"
:labelWeight="400" :labelWeight="400"
labelWidth="auto" labelWidth="auto"
> >
<view class="time-input" @click="pageData.show.address = true"> <view class="time-input" @click="pageData.show.address = true">
<text class="select-text" :class="{ placeholder: !pageData.form.provinceText }"> <text class="select-text" :class="{ placeholder: !pageData.form.provinceText }">
{{ pageData.form.provinceText || '请选择归属省份' }} {{ pageData.form.provinceText || '请选择归属地区' }}
</text> </text>
</view> </view>
</fui-form-item> </fui-form-item>
...@@ -351,8 +408,8 @@ function submit() { ...@@ -351,8 +408,8 @@ function submit() {
labelWidth="auto" labelWidth="auto"
labelSize="28" labelSize="28"
:labelWeight="400" :labelWeight="400"
label="归属省份" label="归属地区"
placeholder="请选择归属省份" placeholder="请选择归属地区"
:value="pageData.form.provinceText" :value="pageData.form.provinceText"
/> />
</view> --> </view> -->
......
<script setup lang="ts">
import { computed, reactive, ref } from 'vue'
import dayjs from 'dayjs'
const nowText = ref('')
function tick() {
nowText.value = dayjs().format('YYYY年MM月DD日 dddd HH:mm:ss')
}
tick()
setInterval(tick, 1000)
const pageData = reactive({
banner: {
image: '/static/images/codefun/farm.jpg',
name: '西区茶油基地',
},
search: '',
categories: [
{ id: 'all', name: '全部' },
{ id: 'irrigation', name: '灌溉系统' },
{ id: 'soil', name: '土壤监测' },
{ id: 'camera', name: '摄像监控' },
{ id: 'weather', name: '气象站' },
],
currentCategory: 'all',
areas: [
{ id: 1, name: '北区灌溉系统', type: 'irrigation' },
{ id: 2, name: '南区灌溉系统', type: 'irrigation' },
{ id: 3, name: '西区灌溉系统', type: 'irrigation' },
{ id: 4, name: '东区灌溉系统', type: 'irrigation' },
{ id: 5, name: '南区土壤监测', type: 'soil' },
{ id: 6, name: '北区土壤监测', type: 'soil' },
{ id: 7, name: '北区土壤监测', type: 'soil' },
{ id: 8, name: '西区摄像监控', type: 'camera' },
{ id: 9, name: '东区摄像监控', type: 'camera' },
{ id: 10, name: '南区摄像监控', type: 'camera' },
{ id: 11, name: '北区摄像监控', type: 'camera' },
{ id: 12, name: '东区摄像监控', type: 'camera' },
{ id: 13, name: '北区气象站', type: 'weather' },
{ id: 14, name: '南区气象站', type: 'weather' },
{ id: 15, name: '西区气象站', type: 'weather' },
],
})
const filteredAreas = computed(() => {
const kw = pageData.search.trim()
return pageData.areas.filter((a) => {
const byCat = pageData.currentCategory === 'all' || a.type === pageData.currentCategory
const byKw = !kw || a.name.includes(kw)
return byCat && byKw
})
})
function selectCategory(id: string) {
pageData.currentCategory = id
}
function onSearchConfirm() {}
function openArea(item: any) {
uni.navigateTo({ url: `/pages/device/device?area=${encodeURIComponent(item.name)}` })
}
</script>
<template>
<view class="page">
<view class="banner">
<image class="banner-img" :src="pageData.banner.image" mode="aspectFill" />
<view class="banner-time">{{ nowText }}</view>
<view class="banner-label">
<text class="label-text">{{ pageData.banner.name }}</text>
<fui-icon name="share" :size="36" color="#fff" />
</view>
</view>
<view class="section">
<fui-search-bar
v-model="pageData.search"
:height="72"
:radius="80"
placeholder="请输入搜索内容"
inputBackground="#fff"
:cancel="false"
@search="onSearchConfirm"
/>
<scroll-view class="chip-row" scroll-x show-scrollbar="false">
<view class="chip-wrap">
<fui-tag
v-for="c in pageData.categories"
:key="c.id"
:text="c.name"
:theme="pageData.currentCategory === c.id ? 'dark' : 'light'"
type="success"
:padding="['16rpx', '32rpx']"
:radius="40"
:marginRight="16"
@click="selectCategory(c.id)"
/>
</view>
</scroll-view>
<view class="grid-box">
<fui-grid :columns="3" :showBorder="false" :square="false">
<fui-grid-item
v-for="(item, idx) in filteredAreas"
:key="item.id"
:index="idx"
backgroundColor="#FFFFFF"
@click="() => openArea(item)"
>
<view class="card" :class="{ active: item.name.includes('西区摄像监控') }">
<text class="card-text">{{ item.name }}</text>
</view>
</fui-grid-item>
</fui-grid>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.page {
background: #e6f5e8;
min-height: 100vh;
}
.banner {
position: relative;
margin: 24rpx;
border-radius: 16rpx;
overflow: hidden;
height: 280rpx;
}
.banner-img {
width: 100%;
height: 100%;
}
.banner-time {
position: absolute;
left: 24rpx;
top: 20rpx;
color: #fff;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
font-size: 24rpx;
}
.banner-label {
position: absolute;
right: 16rpx;
bottom: 16rpx;
display: flex;
align-items: center;
gap: 12rpx;
}
.label-text {
color: #fff;
font-size: 28rpx;
}
.section {
padding: 24rpx;
}
.chip-row {
width: 100%;
}
.chip-wrap {
display: flex;
flex-direction: row;
gap: 16rpx;
}
.grid-box {
margin-top: 24rpx;
}
.card {
height: 120rpx;
margin: 12rpx;
border-radius: 16rpx;
border: 1rpx solid #eaeef1;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.card.active {
background: #5db66f;
color: #fff;
border-color: #5db66f;
}
.card-text {
font-size: 28rpx;
color: #2a2a2a;
}
</style>
...@@ -33,23 +33,28 @@ ...@@ -33,23 +33,28 @@
name: 'phone', name: 'phone',
rule: ['required'], rule: ['required'],
msg: ['请填写手机号码'], msg: ['请填写手机号码'],
}, { },
{
name: 'scope', name: 'scope',
rule: ['required'], rule: ['required'],
msg: ['请选择作业区域'], msg: ['请选择作业区域'],
}, { },
{
name: 'startTime', name: 'startTime',
rule: ['required'], rule: ['required'],
msg: ['请选择开始时间'], msg: ['请选择开始时间'],
}, { },
{
name: 'endTime', name: 'endTime',
rule: ['required'], rule: ['required'],
msg: ['请选择结束时间'], msg: ['请选择结束时间'],
}, { },
{
name: 'address', name: 'address',
rule: ['required'], rule: ['required'],
msg: ['请填写详细地址'], msg: ['请填写详细地址'],
}, { },
{
name: 'demand', name: 'demand',
rule: ['required'], rule: ['required'],
msg: ['请填写需求'], msg: ['请填写需求'],
...@@ -135,11 +140,53 @@ ...@@ -135,11 +140,53 @@
</view> </view>
<view class="text-left"> <view class="text-left">
<fui-form ref="formRef"> <fui-form ref="formRef">
<fui-input marginTop="30" size="24" type="number" maxlength="11" placeholder="请填写手机号码" v-model="pageData.form.phone" required placeholderStyle="margin-left: 10rpx;"/> <fui-input
<fui-input marginTop="30" size="24" disabled @click="pageData.areaShow.address = true" placeholder="请选择作业区域" v-model="pageData.scopeText" required placeholderStyle="margin-left: 10rpx;"/> marginTop="30"
<fui-input marginTop="30" size="24" placeholder="请填写详细地址" v-model="pageData.form.address" required placeholderStyle="margin-left: 10rpx;"/> size="24"
<fui-input marginTop="30" size="24" placeholder="请选择作业时间" v-model="pageData.form.time" @click="dict.show.time = true" required placeholderStyle="margin-left: 10rpx;"/> type="number"
<fui-textarea v-model="pageData.form.demand" :marginTop="30" size="24" placeholder="简要说明作业要求" flexStart required placeholderStyle="margin-left: 10rpx;" height="100rpx" /> 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"> <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> </view>
......
...@@ -222,14 +222,17 @@ ...@@ -222,14 +222,17 @@
label-width="180" label-width="180"
maxlength="6" maxlength="6"
> >
<view slot="suffix" class="unit-slot">元/亩</view> <template #suffix>
<view class="unit-slot">元/亩</view>
</template>
<!-- <slot name="right" style="font-size:28rpx;"></slot> --> <!-- <slot name="right" style="font-size:28rpx;"></slot> -->
</fui-input> </fui-input>
</view> </view>
<view class="bg-white mt20" style="padding: 0.875rem 1rem"> <view class="bg-white mt20" style="padding: 0.875rem 1rem">
<view class="mb-1 flex justify-start" style="font-size:28rpx;"><span class="text-red">*&nbsp;</span> 图片 </view> <view class="mb-1 flex justify-start" style="font-size: 28rpx"
><span class="text-red">*&nbsp;</span> 图片
</view>
<uni-file-picker <uni-file-picker
:value="form.pictureObj" :value="form.pictureObj"
:max-size="1024" :max-size="1024"
......
<!-- src/pages/zhunongjinrong/zhunongjinrong.vue --> <!-- src/pages/zhunongjinrong/zhunongjinrong.vue -->
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as NewsApi from '@/api/model/news'
import dayjs from 'dayjs' import dayjs from 'dayjs'
let currentTab = ref('redian'); import * as NewsApi from '@/api/model/news'
const currentTab = ref('redian')
const pageData = reactive({ const pageData = reactive({
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
category:1, category: 1,
/* news:{ /* news:{
category:1 category:1
} */ } */
}, // 分页参数 }, // 分页参数
hasMore: true, // 是否还有更多数据 hasMore: true, // 是否还有更多数据
loading: false, // 是否正在加载 loading: false, // 是否正在加载
dataList:[] dataList: [],
}) })
onLoad((options) => { onLoad((options) => {
if(options && options.category==1){ if (options && options.category == 1) {
pageData.params.category = options.category; pageData.params.category = options.category
currentTab.value = 'redian'; currentTab.value = 'redian'
}else{ } else {
pageData.params.category = 2; pageData.params.category = 2
currentTab.value = 'nongye'; currentTab.value = 'nongye'
} }
}) })
onShow(() => { onShow(() => {
getListData(); getListData()
}) })
async function getListData() { async function getListData() {
if (pageData.loading) return if (pageData.loading)
return
pageData.loading = true pageData.loading = true
await NewsApi.getList(pageData.params).then((res) => { await NewsApi.getList(pageData.params).then((res) => {
if (res.records.length > 0) { if (res.records.length > 0) {
...@@ -55,22 +55,22 @@ ...@@ -55,22 +55,22 @@
url: `/pages/news/detail?id=${news.id}`, url: `/pages/news/detail?id=${news.id}`,
}) })
} }
function switchTab(type){ function switchTab(type) {
pageData.dataList = []; pageData.dataList = []
pageData.hasMore = true; pageData.hasMore = true
pageData.params.pageNo = 1; pageData.params.pageNo = 1
currentTab.value = type; currentTab.value = type
if(type == 'redian'){ if (type == 'redian') {
pageData.params.category = 1; pageData.params.category = 1
getListData(); getListData()
} }
if(type == 'nongye'){ if (type == 'nongye') {
pageData.params.category = 2; pageData.params.category = 2
getListData(); getListData()
} }
if(type == 'butie'){ if (type == 'butie') {
pageData.params.category = 3; pageData.params.category = 3
pageData.dataList = []; pageData.dataList = []
} }
} }
</script> </script>
...@@ -78,18 +78,42 @@ ...@@ -78,18 +78,42 @@
<template> <template>
<view class="nongyezhengce-page"> <view class="nongyezhengce-page">
<view class="nongyezhengce-content"> <view class="nongyezhengce-content">
<scroll-view class="page-content" scroll-y @scrolltolower="getListData()" :show-scrollbar="false" > <scroll-view class="page-content" scroll-y @scrolltolower="getListData()" :show-scrollbar="false">
<view class="top-tab"> <view class="top-tab">
<view class="tab-btn" :class="currentTab == 'redian' ? 'tab-active' : ''" @click="switchTab('redian')"> <view
<image class="tab-icon" mode="heightFix" :src="`/static/images/home/${currentTab == 'redian' ?'redian_active':'redian_icon'}.png`" /> class="tab-btn"
:class="currentTab == 'redian' ? 'tab-active' : ''"
@click="switchTab('redian')"
>
<image
class="tab-icon"
mode="heightFix"
:src="`/static/images/home/${currentTab == 'redian' ? 'redian_active' : 'redian_icon'}.png`"
/>
<text class="tab-text">热点新闻</text> <text class="tab-text">热点新闻</text>
</view> </view>
<view class="tab-btn" :class="currentTab == 'nongye' ? 'tab-active' : ''" @click="switchTab('nongye')"> <view
<image class="tab-icon" mode="heightFix" :src="`/static/images/home/${currentTab == 'nongye' ?'nongye_active':'nongye_icon'}.png`" /> class="tab-btn"
:class="currentTab == 'nongye' ? 'tab-active' : ''"
@click="switchTab('nongye')"
>
<image
class="tab-icon"
mode="heightFix"
:src="`/static/images/home/${currentTab == 'nongye' ? 'nongye_active' : 'nongye_icon'}.png`"
/>
<text class="tab-text">农业政策</text> <text class="tab-text">农业政策</text>
</view> </view>
<view class="tab-btn" :class="currentTab == 'butie' ? 'tab-active' : ''" @click="switchTab('butie')"> <view
<image class="tab-icon" mode="heightFix" :src="`/static/images/home/${currentTab == 'butie' ?'butie_active':'butie_icon'}.png`" /> class="tab-btn"
:class="currentTab == 'butie' ? 'tab-active' : ''"
@click="switchTab('butie')"
>
<image
class="tab-icon"
mode="heightFix"
:src="`/static/images/home/${currentTab == 'butie' ? 'butie_active' : 'butie_icon'}.png`"
/>
<text class="tab-text">购置补贴</text> <text class="tab-text">购置补贴</text>
</view> </view>
</view> </view>
...@@ -97,11 +121,22 @@ ...@@ -97,11 +121,22 @@
<view v-if="!pageData.dataList || pageData.dataList.length == 0" style="height: 700rpx"> <view v-if="!pageData.dataList || pageData.dataList.length == 0" style="height: 700rpx">
<fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" /> <fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" />
</view> </view>
<view class="content-item" v-for="item in pageData.dataList" :key="item.id" @click="toNewsDetail(item)"> <view
<view class="item-content">{{item.title}}</view> class="content-item"
v-for="item in pageData.dataList"
:key="item.id"
@click="toNewsDetail(item)"
>
<view class="item-content">{{ item.title }}</view>
<view class="item-info"> <view class="item-info">
<view class="item-time">{{ dayjs(item.publishDate).format('YYYY-MM-DD') }}</view> <view class="item-time">{{ dayjs(item.publishDate).format('YYYY-MM-DD') }}</view>
<view class="item-views"><image class="views-icon" mode="widthFix" src="/static/images/home/views_icon.png" /><text>{{item.viewCount}}</text></view> <view class="item-views"
><image
class="views-icon"
mode="widthFix"
src="/static/images/home/views_icon.png"
/><text>{{ item.viewCount }}</text></view
>
</view> </view>
</view> </view>
</view> </view>
...@@ -116,61 +151,61 @@ ...@@ -116,61 +151,61 @@
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.nongyezhengce-page{ .nongyezhengce-page {
background-color: #e6f5e8; background-color: #e6f5e8;
overflow-y: auto; overflow-y: auto;
} }
.nongyezhengce-content{ .nongyezhengce-content {
width: 100vw; width: 100vw;
height: calc(100vh - 88rpx); height: calc(100vh - 88rpx);
display: flex; display: flex;
justify-content: center; justify-content: center;
.page-content{ .page-content {
width: 690rpx; width: 690rpx;
padding-top: 24rpx; padding-top: 24rpx;
padding-bottom: 24rpx; padding-bottom: 24rpx;
.top-tab{ .top-tab {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.tab-btn{ .tab-btn {
width: 220rpx; width: 220rpx;
height: 72rpx; height: 72rpx;
border-radius: 9999px; border-radius: 9999px;
background: #FFFFFF; background: #ffffff;
color: #333333; color: #333333;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.tab-icon{ .tab-icon {
height: 36rpx; height: 36rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
.tab-text{ .tab-text {
font-size: 28rpx; font-size: 28rpx;
} }
} }
.tab-active{ .tab-active {
background: #5DB66F; background: #5db66f;
color: #FFFFFF; color: #ffffff;
} }
} }
.list-content{ .list-content {
margin-top: 4rpx; margin-top: 4rpx;
} }
.content-item{ .content-item {
width: 690rpx; width: 690rpx;
border-radius: 8rpx; border-radius: 8rpx;
background: #FFFFFF; background: #ffffff;
padding:20rpx; padding: 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
.item-content{ .item-content {
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
text-align: justify; text-align: justify;
color: #333333; color: #333333;
} }
.item-info{ .item-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
...@@ -179,19 +214,19 @@ ...@@ -179,19 +214,19 @@
font-size: 24rpx; font-size: 24rpx;
line-height: 40rpx; line-height: 40rpx;
font-weight: 400; font-weight: 400;
.views-icon{ .views-icon {
width: 28rpx; width: 28rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
} }
} }
} }
} }
.loading-status { .loading-status {
background-color: #e6f5e8; background-color: #e6f5e8;
text-align: center; text-align: center;
padding: 20rpx; padding: 20rpx;
color: #999; color: #999;
font-size: 28rpx; font-size: 28rpx;
} }
</style> </style>
...@@ -115,8 +115,7 @@ ...@@ -115,8 +115,7 @@
// 加载编辑数据 // 加载编辑数据
function loadEditData() { function loadEditData() {
if (!props.editData) if (!props.editData) return
return
formData.fileName = props.editData.fileName || '' formData.fileName = props.editData.fileName || ''
formData.fileType = props.editData.fileType || '' formData.fileType = props.editData.fileType || ''
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
}) })
function getList() { function getList() {
if (!paging.value) return if (!paging.value)
return
// API留空,使用模拟数据 - 根据图片内容调整 // API留空,使用模拟数据 - 根据图片内容调整
API.getResourceList(pageData.param).then((res) => { API.getResourceList(pageData.param).then((res) => {
paging.value.complete(res.records) paging.value.complete(res.records)
...@@ -50,8 +51,7 @@ ...@@ -50,8 +51,7 @@
// 格式化时间显示 // 格式化时间显示
function formatTime(time) { function formatTime(time) {
if (!time) if (!time) return ''
return ''
// 如果是完整的时间字符串,可以格式化为图片中的样式 // 如果是完整的时间字符串,可以格式化为图片中的样式
return time.includes(' ') ? time : `${time} 14:00` return time.includes(' ') ? time : `${time} 14:00`
} }
...@@ -75,8 +75,7 @@ return '' ...@@ -75,8 +75,7 @@ return ''
// 格式化文件大小 // 格式化文件大小
function formatFileSize(bytes) { function formatFileSize(bytes) {
if (!bytes) if (!bytes) return '125kb'
return '125kb'
const k = 1024 const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB'] const sizes = ['B', 'KB', 'MB', 'GB']
const i = Math.floor(Math.log(bytes) / Math.log(k)) const i = Math.floor(Math.log(bytes) / Math.log(k))
......
<template>
<view class="webview-container">
<web-view :src="url"></web-view>
</view>
</template>
<script> <script>
export default { export default {
data() { data() {
return { return {
url: '' url: '',
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -17,10 +11,16 @@ export default { ...@@ -17,10 +11,16 @@ export default {
} else { } else {
uni.showToast({ uni.showToast({
title: '网址不存在', title: '网址不存在',
icon: 'none' icon: 'none',
}) })
uni.navigateBack() uni.navigateBack()
} }
},
} }
}
</script> </script>
<template>
<view class="webview-container">
<web-view :src="url" />
</view>
</template>
...@@ -239,7 +239,8 @@ ...@@ -239,7 +239,8 @@
function onAddClick(feature: any) { function onAddClick(feature: any) {
console.log('点击功能模块:', feature) console.log('点击功能模块:', feature)
if (feature.id === 2) showAddDialog() if (feature.id === 2)
showAddDialog()
} }
// 常用资源点击事件 // 常用资源点击事件
function onResourceClick(resource: any) { function onResourceClick(resource: any) {
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
} }
const policyInfoTitle = computed(() => { const policyInfoTitle = computed(() => {
return (pageData.buttons.filter((btn) => btn.active)?.[0]?.name || '惠农贷款') + '政策' return `${pageData.buttons.filter((btn) => btn.active)?.[0]?.name || '惠农贷款'}政策`
}) })
</script> </script>
......
<!-- src/pages/zhunongjinrong/zhunongjinrong.vue --> <!-- src/pages/zhunongjinrong/zhunongjinrong.vue -->
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'; import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date' import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home' import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
onShow(() => { onShow(() => {
const { id, realname, phone } = userStore.getUserInfo; const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id; consultRecord.id = id
consultRecord.mobile = phone; consultRecord.mobile = phone
consultRecord.feedbackRemark = realname; consultRecord.feedbackRemark = realname
}) })
// 定义银行类型 // 定义银行类型
type BankKey = 'nongye' | 'youzheng' | 'nongshang' type BankKey = 'nongye' | 'youzheng' | 'nongshang'
...@@ -167,33 +168,33 @@ ...@@ -167,33 +168,33 @@
currentBank.value = bank currentBank.value = bank
} }
const userStore = useUserStore(); const userStore = useUserStore()
const consultRecord = reactive({ const consultRecord = reactive({
id: "", id: '',
mobile: '',// 咨询人号码 mobile: '', // 咨询人号码
consultTime:"" ,// 咨询时间 consultTime: '', // 咨询时间
bizType:4, // 业务类型(1代理记账,2农资,3农机,4金融) bizType: 4, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:1324324324, // 意向企业 enterpriseId: 1324324324, // 意向企业
feedbackRemark:"" // 反馈备注 feedbackRemark: '', // 反馈备注
}) })
const pageData = reactive({ const pageData = reactive({
showLogoutDialog: false, showLogoutDialog: false,
allpyMessageTitle:"", allpyMessageTitle: '',
applyMessageText:"", applyMessageText: '',
}) })
// 立即申请 // 立即申请
function onApplyClick() { function onApplyClick() {
consultRecord.consultTime = getCurrentDateTime(); consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => { HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功"; pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!"; pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true; pageData.showLogoutDialog = true
}) })
} }
// 提交申请 // 提交申请
function handleConfirmLogout(){ function handleConfirmLogout() {
pageData.showLogoutDialog = false; pageData.showLogoutDialog = false
} }
</script> </script>
...@@ -287,7 +288,7 @@ ...@@ -287,7 +288,7 @@
v-if="bankInfo[currentBank].processType === 'simple'" v-if="bankInfo[currentBank].processType === 'simple'"
class="codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch text-wrapper" class="codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch text-wrapper"
> >
<text class=" font_6 text_13 fontsize_28">线下咨询,已实际办理流程为准。</text> <text class="font_6 text_13 fontsize_28">线下咨询,已实际办理流程为准。</text>
</view> </view>
<view v-else class="codefun-flex-col codefun-self-stretch section_8"> <view v-else class="codefun-flex-col codefun-self-stretch section_8">
<view <view
...@@ -302,7 +303,7 @@ ...@@ -302,7 +303,7 @@
> >
<text class="font_8">{{ step.number }}</text> <text class="font_8">{{ step.number }}</text>
</view> </view>
<text class="font_9 text_15 ml-11 ">{{ step.title }}</text> <text class="font_9 text_15 ml-11">{{ step.title }}</text>
</view> </view>
<view v-if="step.desc" class="codefun-flex-row group_5"> <view v-if="step.desc" class="codefun-flex-row group_5">
<view class="codefun-self-center section_9" /> <view class="codefun-self-center section_9" />
......
...@@ -37,17 +37,17 @@ export function formatDate(date: Date | number | string): string { ...@@ -37,17 +37,17 @@ export function formatDate(date: Date | number | string): string {
*/ */
export function getCalculateAge(birthDate: Date | string): number { export function getCalculateAge(birthDate: Date | string): number {
// 解析出生日期字符串为Date对象 // 解析出生日期字符串为Date对象
const birthDateObj = new Date(birthDate); const birthDateObj = new Date(birthDate)
// 获取当前日期 // 获取当前日期
const currentDate = new Date(); const currentDate = new Date()
// 计算两个日期之间的年份差异 // 计算两个日期之间的年份差异
let age = currentDate.getFullYear() - birthDateObj.getFullYear(); let age = currentDate.getFullYear() - birthDateObj.getFullYear()
// 检查是否还没到生日,如果是,则年龄减1 // 检查是否还没到生日,如果是,则年龄减1
const m = currentDate.getMonth() - birthDateObj.getMonth(); const m = currentDate.getMonth() - birthDateObj.getMonth()
if (m < 0 || (m === 0 && currentDate.getDate() < birthDateObj.getDate())) { if (m < 0 || (m === 0 && currentDate.getDate() < birthDateObj.getDate())) {
age--; age--
} }
return age; return age
} }
/** /**
...@@ -62,11 +62,11 @@ export function getCurrentDateTime(): string { ...@@ -62,11 +62,11 @@ export function getCurrentDateTime(): string {
const month = String(now.getMonth() + 1).padStart(2, '0') const month = String(now.getMonth() + 1).padStart(2, '0')
// 获取日期,确保两位数格式 // 获取日期,确保两位数格式
const day = String(now.getDate()).padStart(2, '0'); const day = String(now.getDate()).padStart(2, '0')
const hour = String(now.getHours()).padStart(2, '0'); const hour = String(now.getHours()).padStart(2, '0')
const minute = String(now.getMinutes()).padStart(2, '0'); const minute = String(now.getMinutes()).padStart(2, '0')
const second = String(now.getSeconds()).padStart(2, '0'); const second = String(now.getSeconds()).padStart(2, '0')
// 返回格式化后的日期字符串 // 返回格式化后的日期字符串
return `${year}-${month}-${day} ${hour}:${minute}:${second}` return `${year}-${month}-${day} ${hour}:${minute}:${second}`
......
import { cascaderHn } from '/@/api/model/dict' import { cascaderHn } from '/@/api/model/dict'
const storageKey = 'app_dict_data_area_cascaderHn'; const storageKey = 'app_dict_data_area_cascaderHn'
let areaOptions = []; let areaOptions = []
export const getDictData = async () => { export async function getDictData() {
// 先从本地加载数据 // 先从本地加载数据
let dictData = getLocalDict(); let dictData = getLocalDict()
if (!dictData) { if (!dictData) {
// 如果本地没有数据,则从接口获取 // 如果本地没有数据,则从接口获取
const res = await cascaderHn(); const res = await cascaderHn()
const data = JSON.stringify(res[0].children).replace(/label/g, 'text'); const data = JSON.stringify(res[0].children).replace(/label/g, 'text')
uni.setStorageSync(storageKey, data); uni.setStorageSync(storageKey, data)
dictData = JSON.parse(data); dictData = JSON.parse(data)
} }
areaOptions = dictData; areaOptions = dictData
return dictData; return dictData
} }
/** /**
* 获取本地数据 * 获取本地数据
*/ */
export const getLocalDict = () => { export function getLocalDict() {
const data = uni.getStorageSync(storageKey); const data = uni.getStorageSync(storageKey)
if (data) { if (data) {
return data ? JSON.parse(data) : null; return data ? JSON.parse(data) : null
} }
return null; return null
} }
/** /**
* 刷新数据 * 刷新数据
*/ */
export const refreshDictData = () => { export function refreshDictData() {
// 删除本地数据 // 删除本地数据
uni.removeStorageSync(storageKey); uni.removeStorageSync(storageKey)
// 重新获取数据 // 重新获取数据
getDictData(); getDictData()
} }
export const getText = (scope: string, spliced: string) => { export function getText(scope: string, spliced: string) {
if (!scope || !areaOptions || areaOptions.length === 0) { if (!scope || !areaOptions || areaOptions.length === 0) {
return '' return ''
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论