提交 0fb18627 作者: 廖在望

feat: 功能修改

上级 083562c2
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,7 +3,7 @@ import { otherHttp } from '/@/utils/http/axios'
enum Api {
cascaderHn = '/region/cascader/hn', // 获取湖南省内 市/区县/乡镇级联数据
queryByType = '/banner/queryByType', // 获取开屏页背景图片
queryByType = '/banner/queryByType', // 获取开屏页背景图片
}
/**
......@@ -23,8 +23,8 @@ export function getQueryByType(params = {}) {
return otherHttp.get({
url: Api.queryByType,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
}
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
\ No newline at end of file
}
......@@ -7,10 +7,9 @@ enum Api {
serviceStatsList = '/online/cgform/api/getData/491863dde351404da63a1a6e8c699c4c', // 服务展示窗
agricultureClassList = '/online/cgform/api/getData/311c300e05694ba69a063d04c8572e9e', // 农技课堂
warning = '/warningInfo/list',
postConsultRecordAdd = '/server/consultRecord/add', // 添加咨询信息
getNewsList = '/news/list', // 分页列表查询
postConsultRecordAdd = '/server/consultRecord/add', // 添加咨询信息
getNewsList = '/news/list', // 分页列表查询
}
/**
......@@ -20,7 +19,7 @@ enum Api {
export function postConsultRecordAdd(params = {}) {
return otherHttp.post({
url: Api.postConsultRecordAdd,
params
params,
})
}
......
......@@ -29,7 +29,7 @@ export function addViewCount(params) {
url: Api.viewCount,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......@@ -7,14 +7,14 @@ enum Api {
employmentDetails = '/employment/queryById', // 查看用工详情
employmentEdit = '/employment/app/edit', // 编辑用工
employmentRegister = '/employment/app/register', // 报名用工
queryConditions = '/sys/region/queryConditions', // 组合条件查询市——村
gitListByCodeDict = '/sys/dictItem/listByCode', // 查询字典
queryByCategoryAndCode = '/sys/labelCategory/queryByCategoryAndCode', // 查询字典
postLaborAdd = '/server/labor/add', // 新增
getLaborAppList = '/server/labor/appList', // APP用工列表查询
getLaborAppDetail = '/server/labor/appDetail', // APP用工详情查询
getLaborAppDel = '/server/labor/delete', // APP用工通过id删除
queryConditions = '/sys/region/queryConditions', // 组合条件查询市——村
gitListByCodeDict = '/sys/dictItem/listByCode', // 查询字典
queryByCategoryAndCode = '/sys/labelCategory/queryByCategoryAndCode', // 查询字典
postLaborAdd = '/server/labor/add', // 新增
getLaborAppList = '/server/labor/appList', // APP用工列表查询
getLaborAppDetail = '/server/labor/appDetail', // APP用工详情查询
getLaborAppDel = '/server/labor/delete', // APP用工通过id删除
}
/**
* 删除设备
......@@ -24,10 +24,10 @@ enum Api {
export function getLaborAppDel(params = {}) {
return otherHttp.delete({
url: Api.getLaborAppDel,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
}
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......@@ -78,9 +78,9 @@ export function queryByCategoryAndCode(params = {}) {
return otherHttp.get({
url: Api.queryByCategoryAndCode,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......@@ -92,9 +92,9 @@ export function gitListByCodeDict(params = {}) {
return otherHttp.get({
url: Api.gitListByCodeDict,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......
......@@ -29,7 +29,7 @@ export function addViewCount(params) {
url: Api.viewCount,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......@@ -161,9 +161,9 @@ export function farmsAdd(params = {}) {
})
}
/**
* @param params
* @param params
* @description: 编辑农场
* @returns
* @returns
*/
export function farmsEdit(params = {}) {
return otherHttp.post({
......
......@@ -8,10 +8,9 @@ enum Api {
farmMachineAddFarm = '/farmMachine/machineWork/app/addFarm', // 发布农活服务
farmMachineEdit = '/farmMachine/machineWork/edit', // 编辑农机服务
farmMachineRegister = '/farmMachine/machineWork/app/register', // 参与服务
postMachineryAdd = '/server/machinery/add', // 农机商品管理-添加
postMachineryQueryById = '/server/machinery/listByEnterpriseId', // 按企业ID查询未删除农机
postMachineryAdd = '/server/machinery/add', // 农机商品管理-添加
postMachineryQueryById = '/server/machinery/listByEnterpriseId', // 按企业ID查询未删除农机
}
/**
* @param params 请求参数
......@@ -107,4 +106,4 @@ export function farmMachineRegister(params = {}) {
url: Api.farmMachineRegister,
params,
})
}
\ No newline at end of file
}
......@@ -2,11 +2,11 @@ import { otherHttp } from '/@/utils/http/axios'
enum Api {
goodsList = '/trade/goods/list', // 农资列表
getEnterpriseList = '/server/enterprise/list', // 可信农资列表
postEnterpriseAdd = '/server/enterprise/add', // 入驻申请
getEnterpriseDetail= '/server/enterprise/detail', // 企业详情
postGoodsAdd = '/trade/goods/add', // 农资商品管理-添加
getGoodsQueryById = '/trade/goods/listByEnterpriseId', // 农资商品管理-通过id查询
getEnterpriseList = '/server/enterprise/list', // 可信农资列表
postEnterpriseAdd = '/server/enterprise/add', // 入驻申请
getEnterpriseDetail = '/server/enterprise/detail', // 企业详情
postGoodsAdd = '/trade/goods/add', // 农资商品管理-添加
getGoodsQueryById = '/trade/goods/listByEnterpriseId', // 农资商品管理-通过id查询
}
/**
* @param params 请求参数
......@@ -81,4 +81,4 @@ export function getEnterpriseList(params = {}) {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
\ No newline at end of file
}
......@@ -17,12 +17,15 @@ enum Api {
* @description: 查询登录用户信息
*/
export function getUserInfo(params = {}) {
return otherHttp.get({
url: Api.getUserInfo,
data: params,
}, {
errorMessageMode: null
})
return otherHttp.get(
{
url: Api.getUserInfo,
data: params,
},
{
errorMessageMode: null,
},
)
}
/**
......@@ -43,7 +46,7 @@ export function sysLogin(params = {}) {
export function phoneLogin(params = {}) {
return otherHttp.post({
url: Api.phoneLogin,
data: params
data: params,
})
}
......@@ -54,7 +57,7 @@ export function phoneLogin(params = {}) {
export function sysSms(params = {}) {
return otherHttp.post({
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>
<view v-if="show" class="confirm-dialog-overlay" @click="handleCancel">
<view class="confirm-dialog-container" @click.stop>
......@@ -5,13 +39,13 @@
<view class="close-btn" @click="handleCancel">
<text class="close-icon"></text>
</view>
<!-- 标题 -->
<view class="dialog-title">{{ title }}</view>
<!-- 内容 -->
<view class="dialog-content">{{ content }}</view>
<!-- 按钮组 -->
<view class="dialog-buttons">
<view class="cancel-btn" @click="handleCancel">
......@@ -25,141 +59,107 @@
</view>
</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>
.confirm-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
}
.confirm-dialog-container {
position: relative;
width: 600rpx;
background: linear-gradient(180deg, #E8F5E9 0%, #FFFFFF 30%);
border-radius: 32rpx;
padding: 60rpx 48rpx 48rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
}
.close-btn {
position: absolute;
top: 24rpx;
right: 24rpx;
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.close-icon {
font-size: 36rpx;
color: #999999;
font-weight: 300;
}
.dialog-title {
font-size: 36rpx;
font-weight: 600;
color: #333333;
text-align: center;
margin-bottom: 32rpx;
}
.dialog-content {
font-size: 28rpx;
color: #666666;
text-align: center;
line-height: 40rpx;
margin-bottom: 48rpx;
}
.dialog-buttons {
display: flex;
gap: 24rpx;
}
.cancel-btn,
.confirm-btn {
flex: 1;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.cancel-btn {
background-color: #FFFFFF;
border: 2rpx solid #5DB66F;
}
.cancel-text {
font-size: 28rpx;
color: #5DB66F;
font-weight: 500;
}
.confirm-btn {
background: linear-gradient(135deg, #5DB66F 0%, #4CAF50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
}
.confirm-text {
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
}
.cancel-btn:active {
opacity: 0.8;
}
.confirm-btn:active {
opacity: 0.9;
transform: scale(0.98);
}
.confirm-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
}
.confirm-dialog-container {
position: relative;
width: 600rpx;
background: linear-gradient(180deg, #e8f5e9 0%, #ffffff 30%);
border-radius: 32rpx;
padding: 60rpx 48rpx 48rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
}
.close-btn {
position: absolute;
top: 24rpx;
right: 24rpx;
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.close-icon {
font-size: 36rpx;
color: #999999;
font-weight: 300;
}
.dialog-title {
font-size: 36rpx;
font-weight: 600;
color: #333333;
text-align: center;
margin-bottom: 32rpx;
}
.dialog-content {
font-size: 28rpx;
color: #666666;
text-align: center;
line-height: 40rpx;
margin-bottom: 48rpx;
}
.dialog-buttons {
display: flex;
gap: 24rpx;
}
.cancel-btn,
.confirm-btn {
flex: 1;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.cancel-btn {
background-color: #ffffff;
border: 2rpx solid #5db66f;
}
.cancel-text {
font-size: 28rpx;
color: #5db66f;
font-weight: 500;
}
.confirm-btn {
background: linear-gradient(135deg, #5db66f 0%, #4caf50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
}
.confirm-text {
font-size: 28rpx;
color: #ffffff;
font-weight: 500;
}
.cancel-btn:active {
opacity: 0.8;
}
.confirm-btn:active {
opacity: 0.9;
transform: scale(0.98);
}
</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>
<view v-if="show" class="confirm-dialog-overlay" @click="handleCancel">
<view class="confirm-dialog-container" @click.stop>
<view class="confirm-dialog-content">
<image class="apply_success_icon" src="/static/images/comm/apply_success_icon.png" />
</view>
<view class="confirm-dialog-content">
<image class="apply_success_icon" src="/static/images/comm/apply_success_icon.png" />
</view>
<!-- 标题 -->
<view class="dialog-title">{{ title }}</view>
<!-- 内容 -->
<view class="dialog-content">{{ content }}</view>
<!-- 按钮组 -->
<view class="dialog-buttons">
<!-- <view class="cancel-btn" @click="handleCancel">
......@@ -24,159 +57,126 @@
</view>
</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>
.confirm-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.confirm-dialog-container {
position: relative;
width: 600rpx;
background: #FFFFFF;
border-radius: 32rpx;
box-sizing: border-box;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
padding-bottom: 28rpx;
}
.confirm-dialog-content{
width: 600rpx;
height: 240rpx;
border-radius: 32rpx;
opacity: 1;
background: linear-gradient(0deg, rgba(93, 182, 111, 0) 0%, rgba(93, 182, 111, 0.25) 100%);
position: relative;
display: flex;
justify-content: center;
.apply_success_icon{
width: 240rpx;
height: 162rpx;
margin-top: 54rpx;
}
}
.close-btn {
position: absolute;
top: 24rpx;
right: 24rpx;
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.close-icon {
font-size: 36rpx;
color: #999999;
font-weight: 300;
}
.dialog-title {
margin-top: -32rpx;
font-size: 36rpx;
font-weight: 600;
color: #333333;
text-align: center;
margin-bottom: 32rpx;
}
.dialog-content {
font-size: 28rpx;
color: #666666;
text-align: center;
line-height: 40rpx;
margin-bottom: 48rpx;
}
.dialog-buttons {
display: flex;
gap: 24rpx;
padding-left: 30rpx;
padding-right: 30rpx;
}
.cancel-btn,
.confirm-btn {
flex: 1;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.cancel-btn {
background-color: #FFFFFF;
border: 2rpx solid #5DB66F;
}
.cancel-text {
font-size: 28rpx;
color: #5DB66F;
font-weight: 500;
}
.confirm-btn {
background: linear-gradient(135deg, #5DB66F 0%, #4CAF50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
}
.confirm-text {
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
}
.cancel-btn:active {
opacity: 0.8;
}
.confirm-btn:active {
opacity: 0.9;
transform: scale(0.98);
}
.confirm-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.confirm-dialog-container {
position: relative;
width: 600rpx;
background: #ffffff;
border-radius: 32rpx;
box-sizing: border-box;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
padding-bottom: 28rpx;
}
.confirm-dialog-content {
width: 600rpx;
height: 240rpx;
border-radius: 32rpx;
opacity: 1;
background: linear-gradient(0deg, rgba(93, 182, 111, 0) 0%, rgba(93, 182, 111, 0.25) 100%);
position: relative;
display: flex;
justify-content: center;
.apply_success_icon {
width: 240rpx;
height: 162rpx;
margin-top: 54rpx;
}
}
.close-btn {
position: absolute;
top: 24rpx;
right: 24rpx;
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.close-icon {
font-size: 36rpx;
color: #999999;
font-weight: 300;
}
.dialog-title {
margin-top: -32rpx;
font-size: 36rpx;
font-weight: 600;
color: #333333;
text-align: center;
margin-bottom: 32rpx;
}
.dialog-content {
font-size: 28rpx;
color: #666666;
text-align: center;
line-height: 40rpx;
margin-bottom: 48rpx;
}
.dialog-buttons {
display: flex;
gap: 24rpx;
padding-left: 30rpx;
padding-right: 30rpx;
}
.cancel-btn,
.confirm-btn {
flex: 1;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.cancel-btn {
background-color: #ffffff;
border: 2rpx solid #5db66f;
}
.cancel-text {
font-size: 28rpx;
color: #5db66f;
font-weight: 500;
}
.confirm-btn {
background: linear-gradient(135deg, #5db66f 0%, #4caf50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
}
.confirm-text {
font-size: 28rpx;
color: #ffffff;
font-weight: 500;
}
.cancel-btn:active {
opacity: 0.8;
}
.confirm-btn:active {
opacity: 0.9;
transform: scale(0.98);
}
</style>
......@@ -20,7 +20,7 @@
// 将函数转换为字符串,在视图层重新构建
option.tooltip.formatter = option.tooltip.formatter.toString()
}
this.option = {
id: this.id,
...option,
......
<template>
<iframe :onload="onloadCode" style="width: 100%; height: 100%; border: 1px solid #fff; background: #000"></iframe>
</template>
<script>
export default {
props: {
......@@ -16,4 +13,9 @@
},
}
</script>
<template>
<iframe :onload="onloadCode" style="width: 100%; height: 100%; border: 1px solid #fff; background: #000"></iframe>
</template>
<style lang="scss"></style>
......@@ -80,8 +80,14 @@ export function useMapbox<T extends MapboxInstance, P extends MapboxConfig>(
getInstance()?.setLayoutProperty(layerId, name, value),
setFilter: (layerId: string, filter: any[]) => getInstance()?.setFilter(layerId, filter),
flyTo: (options: mapboxgl.FlyToOptions) => getInstance()?.flyTo(options),
addMarker: (id: string, lnglat: [number, number], popup?: string, popupDefaultOpen?: boolean, imageUrl?: string, iconSize?: [number, number]) =>
getInstance()?.addMarker(id, lnglat, popup, popupDefaultOpen, imageUrl, iconSize),
addMarker: (
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),
removePopup: () => getInstance()?.removePopup(),
loadImage: (url: string, callback: (error: Error | null, image: HTMLImageElement) => void) =>
......@@ -194,14 +200,14 @@ export function flyTo(
zoom,
essential: true,
}
// 如果提供了时长,使用 duration 参数
if (duration !== undefined) {
flyOptions.duration = duration * 1000 // 转换为毫秒
} else {
flyOptions.speed = 0.2
}
map.flyTo(flyOptions)
}
......
......@@ -16,7 +16,7 @@ export const tk = 'aa0ccd36f2dbb86dbb16cbf63f0034a6'
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 `${host}/api/tdt/cache/${id}/{z}/{y}/{x}/${tk}?v=2022`
}
......@@ -41,13 +41,13 @@ export const defaultStyle: mapboxgl.Style = {
sources: {
'wms-vec_w-source': {
type: 'raster',
tiles: [buildTdtTileUrl('vec_w','vec')],
tiles: [buildTdtTileUrl('vec_w', 'vec')],
tileSize: 256,
maxzoom: 18,
},
'wms-cva_w-source': {
type: 'raster',
tiles: [buildTdtTileUrl('cva_w','cva')],
tiles: [buildTdtTileUrl('cva_w', 'cva')],
tileSize: 256,
maxzoom: 18,
},
......@@ -59,7 +59,7 @@ export const defaultStyle: mapboxgl.Style = {
// },
'wms-img_w-source': {
type: 'raster',
tiles: [buildTdtTileUrl('img_w','img')],
tiles: [buildTdtTileUrl('img_w', 'img')],
tileSize: 256,
maxzoom: 18,
},
......@@ -405,11 +405,11 @@ export interface MapControlOptions {
}
// 图层控制
layer?:
| boolean
| {
tk: string
layers: LayerOption[]
}
| boolean
| {
tk: string
layers: LayerOption[]
}
// 重置控件
reset?: boolean | mapboxgl.FlyToOptions
// 全屏控件
......@@ -554,17 +554,17 @@ export function toPointGeoJSON(
features: !data
? []
: data.map((item) => {
return {
type: 'Feature',
properties: {
...item,
},
geometry: {
type: 'Point',
coordinates: [item.lon, item.lat],
},
}
}),
return {
type: 'Feature',
properties: {
...item,
},
geometry: {
type: 'Point',
coordinates: [item.lon, item.lat],
},
}
}),
}
}
......@@ -850,7 +850,14 @@ export interface MapboxInstance {
* @param iconSize 图标大小 [width, height]
* @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
* @param id Marker ID
......@@ -986,8 +993,9 @@ export const HandlerUtil = {
popup: HandlerUtil.createDefaultPopupHtml(
station,
{
'{key}': `${(additional?.valueName ? station[additional.valueName] : station.value) || '-'
}{suffix}`,
'{key}': `${
(additional?.valueName ? station[additional.valueName] : station.value) || '-'
}{suffix}`,
...map,
},
isStation,
......@@ -1008,7 +1016,8 @@ export const HandlerUtil = {
if (isPlainObject(station) && isStation) {
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>`,
)
htmls.push(`<div class="popup-row"><span class="popup-title">发生时间:</span>${station.occurTime}</div>`)
......@@ -1024,7 +1033,8 @@ export const HandlerUtil = {
for (const key in map) {
const len = String(key === '{key}' ? station.key : key).length
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>`,
)
}
......@@ -1039,7 +1049,8 @@ export const HandlerUtil = {
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.city || ''} ${station.cnty || ''
`<div class="popup-row"><span class="popup-title">站名:</span>${station.city || ''} ${
station.cnty || ''
} ${station.stationName || ''}</div>`,
)
}
......@@ -1068,7 +1079,8 @@ export const HandlerUtil = {
const len = String(key === '{key}' ? station.key : key).length
if (key !== '{key}') {
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>`,
)
}
......
<template>
</template>
<script>
export default {
}
export default {}
</script>
<style>
<template></template>
</style>
<style></style>
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270433254", // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: '2004840258270433254', // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle: '',
applyMessageText: '',
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 洽谈合作
function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
</script>
......@@ -105,13 +106,13 @@
</view>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
</template>
<style scoped lang="scss">
......
......@@ -188,8 +188,10 @@
pageData.search.pageNo = 1
pageData.purchaseDemands = []
pageData.supplyInfos = []
if (pageData.currentTransactionTab === 1) getPurchaseList()
if (pageData.currentTransactionTab === 2) getSupplyList()
if (pageData.currentTransactionTab === 1)
getPurchaseList()
if (pageData.currentTransactionTab === 2)
getSupplyList()
}
// 采购/供应标签点击事件
......@@ -199,8 +201,10 @@
pageData.search.pageNo = 1
pageData.purchaseDemands = []
pageData.supplyInfos = []
if (pageData.currentTransactionTab === 1) getPurchaseList()
if (pageData.currentTransactionTab === 2) getSupplyList()
if (pageData.currentTransactionTab === 1)
getPurchaseList()
if (pageData.currentTransactionTab === 2)
getSupplyList()
}
// 新需求提醒点击事件
......@@ -234,7 +238,7 @@
// 发布需求
function handlePublish() {
if (pageData.currentTransactionTab === 1) {
Navigate.to('/pages/chanxiao/supplyXuQiu')
Navigate.to('/pages/chanxiao/supplyXuQiu')
return
}
if (pageData.currentTransactionTab === 2) {
......@@ -245,12 +249,14 @@
onReachBottom(() => {
console.log('触底了')
if (pageData.currentTransactionTab === 1) {
if (pageData.total <= pageData.purchaseDemands.length) return
if (pageData.total <= pageData.purchaseDemands.length)
return
pageData.search.pageNo++
getPurchaseList()
}
if (pageData.currentTransactionTab === 2) {
if (pageData.total <= pageData.supplyInfos.length) return
if (pageData.total <= pageData.supplyInfos.length)
return
pageData.search.pageNo++
getSupplyList()
}
......
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270488953", // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: '2004840258270488953', // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle: '',
applyMessageText: '',
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 洽谈合作
function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
</script>
......@@ -123,13 +124,13 @@
</view>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
</view>
</template>
......
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270471548", // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: '2004840258270471548', // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle: '',
applyMessageText: '',
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 洽谈合作
function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
</script>
......@@ -147,13 +148,13 @@
</view>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
</template>
<style scoped lang="scss">
......
......@@ -132,7 +132,7 @@
}
function getCurrentAddressInfo() {
if (!uni.getStorageSync('location'))
if (!uni.getStorageSync('location'))
return
const { lon, lat } = uni.getStorageSync('location')
......@@ -291,8 +291,10 @@ return
<view class="price-range">
<input :disabled="!isSave" type="number" class="price-input" v-model="form.priceStart" placeholder="最低价" :min="0" maxlength="6" />
<text class="price-separator"></text>
<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>
<input :disabled="!isSave" type="number" class="price-input" v-model="form.priceEnd" placeholder="最高价" :min="0" maxlength="6" />
<template #suffix>
<view class="unit-slot" style="font-size: 28rpx;"></view>
</template>
</input>
</view>
</view>
......@@ -321,8 +323,8 @@ return
</view>
</view>
<view class="mb-1 flex justify-start" style="font-size: 28rpx;">
<span style="color: red;margin-left: 10rpx;">*&nbsp;</span>
<span>图片</span>
<span style="color: red;margin-left: 10rpx;">*&nbsp;</span>
<span>图片</span>
</view>
<uni-file-picker :readonly="!isSave" :value="form.imageObj" ref="uploadRef" limit="1" :auto-upload="false" @select="handleUpload" @delete="handleDelete" style="margin-left:35rpx"/>
</view>
......
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270471581", // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: '2004840258270471581', // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle: '',
applyMessageText: '',
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 洽谈合作
function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime();
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
</script>
......@@ -107,13 +108,13 @@
</view>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
</template>
<style scoped lang="scss">
......
......@@ -12,24 +12,24 @@
const userStore = useUserStore()
const globSetting = useGlobSetting()
const isSave = ref(false)
const pageText = ref('采购')
const pageText = ref('采购')
onLoad((option) => {
// 获取数据详情
if (option.id) {
isSave.value = false
getDetails(option.id)
uni.setNavigationBarTitle({
title: '采购需求',
})
pageText.value = '采购'
uni.setNavigationBarTitle({
title: '采购需求',
})
pageText.value = '采购'
} else {
isSave.value = true
// 获取当前位置
getCurrentAddressInfo()
uni.setNavigationBarTitle({
title: '发布供应需求',
})
pageText.value = '供应'
uni.setNavigationBarTitle({
title: '发布供应需求',
})
pageText.value = '供应'
}
})
......@@ -150,7 +150,8 @@
}
function getCurrentAddressInfo() {
if (!uni.getStorageSync('location')) return
if (!uni.getStorageSync('location'))
return
const { lon, lat } = uni.getStorageSync('location')
UserInfoAPI.location({
......@@ -416,7 +417,7 @@
<!-- 供应时间 -->
<view class="form-section" style="padding: 0 30rpx">
<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-input"
......
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270437514", // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: '2004840258270437514', // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle: '',
applyMessageText: '',
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 洽谈合作
function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
</script>
......@@ -104,7 +105,10 @@
src="/static/images/codefun/ca51ef39a15d5c8414c9a427b3c4434b.png"
/>
</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/ecb55b953a8e07a17301bcd12aec591f.png" />
<view class="codefun-flex-row codefun-justify-center codefun-items-center section_6 pos">
......@@ -116,13 +120,13 @@
</view>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
</template>
<style scoped lang="scss">
......
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:"2004840258270474551", // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: '2004840258270474551', // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle: '',
applyMessageText: '',
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 洽谈合作
function onCooperationClick() {
// Message.alert('洽谈合作功能暂不可用,敬请期待~', '温馨提示')
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
</script>
<template>
<view class="codefun-flex-col page">
<view class="codefun-flex-col section">
......@@ -113,13 +115,13 @@
</view>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="pageData.showLogoutDialog = false"
/>
</template>
<style scoped lang="scss">
......
<script setup lang="ts">
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
const consultRecord = reactive({
id: '',
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:1, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:1324324324, // 意向企业
feedbackRemark:"" // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const consultRecord = reactive({
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 1, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: 1324324324, // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
})
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 立即申请
function onApplyClick() {
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.showLogoutDialog = true
})
}
// 提交申请
function handleConfirmLogout(){
pageData.showLogoutDialog = false;
}
function handleConfirmLogout() {
pageData.showLogoutDialog = false
}
// 查看大图
function onViewImage(imageUrl) {
uni.previewImage({
urls: [imageUrl]
urls: [imageUrl],
})
}
</script>
......@@ -222,14 +223,14 @@
<text class="font_8 text_32">立即申请</text>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
title="申请成功"
content="平台已收到申请,将尽快与您取得联系!"
confirmText="我知道了"
@confirm="handleConfirmLogout"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
title="申请成功"
content="平台已收到申请,将尽快与您取得联系!"
confirmText="我知道了"
@confirm="handleConfirmLogout"
/>
</view>
</template>
......
......@@ -4,8 +4,9 @@
import * as NongzhiAPI from '@/api/model/nongzhi'
import * as HomeAPI from '@/api/model/home'
import Navigate from '@/utils/page/navigate'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore();
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
// 下拉刷新
onPullDownRefresh(() => {
getGoodsList()
......@@ -227,25 +228,33 @@
// 查询服务列表
function getServiceItems() {
// '灵活用工','农机租赁','惠农金融','助农保险'
const testLimitContent = ['1983075690694692866','1983077495298183170','1983077763284848642','1983077932298522625','1985038053803876354','1985038211056721921','1985038680680357889'];
const testLimitContent = [
'1983075690694692866',
'1983077495298183170',
'1983077763284848642',
'1983077932298522625',
'1985038053803876354',
'1985038211056721921',
'1985038680680357889',
]
HomeAPI.zoneList({
pageNo: 1,
pageSize: 5,
status: 1,
type: 3,
}).then((res) => {
const { records } = res;
if(userStore.isAuditMode){
let arrData = [];
for(let i = 0; i < records.length; i++){
if(!testLimitContent.includes(records[i].id)){
arrData.push(records[i]);
}
}
pageData.menuItems = arrData;
}else{
pageData.menuItems = [...records]
}
const { records } = res
if (userStore.isAuditMode) {
const arrData = []
for (let i = 0; i < records.length; i++) {
if (!testLimitContent.includes(records[i].id)) {
arrData.push(records[i])
}
}
pageData.menuItems = arrData
} else {
pageData.menuItems = [...records]
}
})
}
......@@ -302,11 +311,11 @@
// 跳转到灵活用工界面
Navigate.to('/pages/linghuoyonggong/linghuoyonggong')
}
// 查看更多农资交易
function onViewMoreKexinnongzi() {
Navigate.to('/pages/kexinnongzi/kexinnongzi')
}
// 查看更多农资交易
function onViewMoreKexinnongzi() {
Navigate.to('/pages/kexinnongzi/kexinnongzi')
}
// 助农金融产品点击事件
function onFinancialProductClick(product: any) {
......@@ -403,7 +412,10 @@
</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_6 text_9" @click="onViewMoreFlexibleEmployment">更多</text>
</view>
......@@ -485,14 +497,12 @@
</view>
</view>
<view class="codefun-flex-col codefun-mt-24">
<view
class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch"
>
<text class="font_5">农资交易</text>
<text class="text-28 font-extralight color-#5DB66F" @click="onViewMoreKexinnongzi">
更多<fui-icon name="right" size="30" color="#5DB66F" />
</text>
</view>
<view class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch">
<text class="font_5">农资交易</text>
<text class="text-28 font-extralight color-#5DB66F" @click="onViewMoreKexinnongzi">
更多<fui-icon name="right" size="30" color="#5DB66F" />
</text>
</view>
<view class="codefun-flex-col codefun-self-stretch section_6 codefun-mt-16">
<view class="grid">
<view
......@@ -521,7 +531,10 @@
>{{ product.name }}</text
>
<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>
......
......@@ -30,7 +30,7 @@
})
})
function getList() {
if (!paging.value)
if (!paging.value)
return
NongchangAPI.getFarmbaseList(pageData.param)
.then((res) => {
......
<script setup lang="ts">
import { onLoad, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import Navigate from '@/utils/page/navigate'
import { reactive, ref } from 'vue'
import * as NongzhiAPI from '@/api/model/nongzhi'
onPullDownRefresh(() => {
resetData()
getList(pageData.params)
})
onShow(() => {
resetData()
getList(pageData.params)
})
onNavigationBarButtonTap(() => {
Navigate.to('/pages/kexinnongzi/shenqingruzhu')
})
import { onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { reactive } from 'vue'
import Navigate from '@/utils/page/navigate'
import * as NongzhiAPI from '@/api/model/nongzhi'
onPullDownRefresh(() => {
resetData()
getList(pageData.params)
})
onShow(() => {
resetData()
getList(pageData.params)
})
onNavigationBarButtonTap(() => {
Navigate.to('/pages/kexinnongzi/shenqingruzhu')
})
const pageData = reactive({
params: {
pageNo: 1,
pageSize: 10,
bizCategory:2,
reviewStatus:1
bizCategory: 2,
reviewStatus: 1,
}, // 分页参数
hasMore: true, // 是否还有更多数据
loading: false, // 是否正在加载
dataList:[]
dataList: [],
})
async function getList(params) {
if (pageData.loading) return
if (pageData.loading)
return
pageData.loading = true
await NongzhiAPI.getEnterpriseList(params).then((res) => {
if (res.records.length > 0) {
......@@ -48,10 +50,9 @@
pageData.loading = false
}
function toDetail(item) {
let param = encodeURIComponent(JSON.stringify({id:item.id,name:item.enterpriseName}));
Navigate.to(`/pages/kexinnongzi/detail?param=${param}`)
const param = encodeURIComponent(JSON.stringify({ id: item.id, name: item.enterpriseName }))
Navigate.to(`/pages/kexinnongzi/detail?param=${param}`)
}
function resetData() {
......@@ -71,25 +72,24 @@
@scrolltolower="getList(pageData.params)"
:show-scrollbar="false"
>
<view class="top_img">
<image class="agr_sup_img" src="/static/images/comm/agr_sup_img.png" />
</view>
<view class="page_content">
<view class="item_list" v-for="item in pageData.dataList" :key="item.id">
<view class="item_left">
<image class="enterprise_logo" mode="aspectFit" :src="item.enterpriseLogoUrl" />
</view>
<view class="item_right">
<view class="item_name ellipsis">{{item.enterpriseName}}</view>
<view class="item_description ellipsis">{{item.businessScope}}</view>
<view class="item_details">
<view class="detail_btn" @click="toDetail(item)">查看详情</view>
</view>
</view>
</view>
</view>
<view class="top_img">
<image class="agr_sup_img" src="/static/images/comm/agr_sup_img.png" />
</view>
<view class="page_content">
<view class="item_list" v-for="item in pageData.dataList" :key="item.id">
<view class="item_left">
<image class="enterprise_logo" mode="aspectFit" :src="item.enterpriseLogoUrl" />
</view>
<view class="item_right">
<view class="item_name ellipsis">{{ item.enterpriseName }}</view>
<view class="item_description ellipsis">{{ item.businessScope }}</view>
<view class="item_details">
<view class="detail_btn" @click="toDetail(item)">查看详情</view>
</view>
</view>
</view>
</view>
<!-- 加载状态 -->
<view class="loading-status">
<text v-if="pageData.loading">加载中...</text>
......@@ -101,79 +101,78 @@
</template>
<style lang="less" scoped>
.yr_page_view{
padding: 28rpx;
.top_img,.agr_sup_img{
height: 280rpx;
width: 690rpx;
}
.top_img{
margin-bottom: 24rpx;
}
.page_content{
border-radius: 16rpx;
background: #FFFFFF;
}
.ellipsis{
width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.yr_page_view {
padding: 28rpx;
.top_img,
.agr_sup_img {
height: 280rpx;
width: 690rpx;
}
.top_img {
margin-bottom: 24rpx;
}
.page_content {
border-radius: 16rpx;
background: #ffffff;
}
.ellipsis {
width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item_list{
display: flex;
align-items:flex-start;
justify-content: space-between;
padding-left: 24rpx;
padding-right: 30rpx;
padding-bottom: 24rpx;
padding-top: 24rpx;
border-bottom: 2rpx solid #EEEEEE;
.item_left,.enterprise_logo{
width: 192rpx;
max-height: 160rpx;
}
.item_right{
width: 436rpx;
.item_name{
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
.item_description{
font-size: 24rpx;
font-weight: 400;
color: #999999;
margin-top: 16rpx;
margin-bottom: 12rpx;
}
.item_details{
display: flex;
justify-content: flex-end;
}
.detail_btn{
border-radius: 100rpx;
background: #5DB66F;
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx;
width: 136rpx;
height: 48rpx;
font-size: 24rpx;
font-weight: 400;
color: #FFFFFF;
}
}
}
.item_list:last-child{
border-bottom: none;
}
}
.item_list {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding-left: 24rpx;
padding-right: 30rpx;
padding-bottom: 24rpx;
padding-top: 24rpx;
border-bottom: 2rpx solid #eeeeee;
.item_left,
.enterprise_logo {
width: 192rpx;
max-height: 160rpx;
}
.item_right {
width: 436rpx;
.item_name {
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
.item_description {
font-size: 24rpx;
font-weight: 400;
color: #999999;
margin-top: 16rpx;
margin-bottom: 12rpx;
}
.item_details {
display: flex;
justify-content: flex-end;
}
.detail_btn {
border-radius: 100rpx;
background: #5db66f;
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx;
width: 136rpx;
height: 48rpx;
font-size: 24rpx;
font-weight: 400;
color: #ffffff;
}
}
}
.item_list:last-child {
border-bottom: none;
}
}
.loading-status {
text-align: center;
......
......@@ -15,24 +15,25 @@
const videoList = ref([])
function getVideoList(params) {
if (model.loading) return
if (model.loading)
return
model.loading = true
videoApi.getList(params).then((res) => {
if (res.records.length > 0) {
const { records } = res;
let scale:any = 0;
for(let i = 0; i < records.length;i++){
if(records[i].width){
scale = (340 / records[i].width).toFixed(1);
records[i].videoWidth = 340;
records[i].videoHeight = Math.floor(records[i].height * scale);
}else{
records[i].videoWidth = 0;
records[i].videoHeight = 0;
}
}
const { records } = res
let scale: any = 0
for (let i = 0; i < records.length; i++) {
if (records[i].width) {
scale = (340 / records[i].width).toFixed(1)
records[i].videoWidth = 340
records[i].videoHeight = Math.floor(records[i].height * scale)
} else {
records[i].videoWidth = 0
records[i].videoHeight = 0
}
}
if (model.params.pageNo === 1) {
videoList.value = records
} else {
......@@ -118,9 +119,9 @@
v-for="(item, index) in videoList"
:key="index"
:src="item.thumbnailPath"
:imgWidth="item.videoWidth"
:imgHeight="item.videoHeight"
:videoDuration="item.totalTime"
:imgWidth="item.videoWidth"
:imgHeight="item.videoHeight"
:videoDuration="item.totalTime"
@click="toPlay(item.id)"
>
<view class="flex flex-col justify-between pl-2 pr-2 pb-2">
......
......@@ -73,8 +73,25 @@
</view>
<view class="text-left">
<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 marginTop="30" size="28" placeholder="请填写预留手机" v-model="pageData.form.reservedmobile" required type="number" maxlength="11" placeholderStyle="margin-left: 10rpx"/>
<fui-input
marginTop="30"
size="28"
placeholder="请填写姓名"
v-model="pageData.form.reservedname"
required
maxlength="16"
placeholderStyle="margin-left: 10rpx"
/>
<fui-input
marginTop="30"
size="28"
placeholder="请填写预留手机"
v-model="pageData.form.reservedmobile"
required
type="number"
maxlength="11"
placeholderStyle="margin-left: 10rpx"
/>
<view style="margin-top: 30rpx">
<fui-button text="提交" bold radius="96rpx" @click="submit" />
</view>
......
<script setup lang="ts">
import { reactive, toRefs } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getCalculateAge } from '@/utils/date'
import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong';
import ConfirmDialog from '@/components/ConfirmDialog/index.vue'
const pageData = reactive({
loading: false,
workersParam:[],
contactMobile:"",
contactName:"",
showConfirmDialog:false,
})
// 字典值
const DictData = reactive({
sexArr:[],// 性别
educationArr:[]// 学历
})
import { reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getCalculateAge } from '@/utils/date'
import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong'
import ConfirmDialog from '@/components/ConfirmDialog/index.vue'
const pageData = reactive({
loading: false,
workersParam: [],
contactMobile: '',
contactName: '',
showConfirmDialog: false,
})
// 字典值
const DictData = reactive({
sexArr: [], // 性别
educationArr: [], // 学历
})
onLoad((options) => {
let param = JSON.parse(decodeURIComponent(options.param));
uni.setNavigationBarTitle({
title: param.villageName
});
getLaborAppDetail(param.id);
const param = JSON.parse(decodeURIComponent(options.param))
uni.setNavigationBarTitle({
title: param.villageName,
})
getLaborAppDetail(param.id)
})
async function getLaborAppDetail(id: string) {
await LinghuoyonggongAPI.gitListByCodeDict({ code : 'sex'}).then(res=>{
DictData.sexArr = res;
})
await LinghuoyonggongAPI.gitListByCodeDict({ code : 'education'}).then(res=>{
DictData.educationArr = res;
})
await LinghuoyonggongAPI.getLaborAppDetail({ id }).then((res) => {
pageData.workersParam = res.workers;
pageData.contactMobile = res.contactMobile;
pageData.contactName = res.contactName.substring(0,1) + new Array(res.contactName.length).join('*');
})
}
// 返回字典中的中文值
function returnDictZhVel(type:any,val:any){
let valText = "";
if(type == 'gender'){
let arr = DictData.sexArr;
for(let i = 0; i < arr.length;i++){
if(val == parseInt(arr[i].itemValue)){
valText = arr[i].itemText;
break;
}
}
}
if(type == 'edu'){
let arr = DictData.educationArr;
for(let i = 0; i < arr.length;i++){
if(val == parseInt(arr[i].itemValue)){
valText = arr[i].itemText;
break;
}
}
}
return valText;
}
function makePhoneCall(){
uni.makePhoneCall({
phoneNumber: pageData.contactMobile
});
}
async function getLaborAppDetail(id: string) {
await LinghuoyonggongAPI.gitListByCodeDict({ code: 'sex' }).then((res) => {
DictData.sexArr = res
})
await LinghuoyonggongAPI.gitListByCodeDict({ code: 'education' }).then((res) => {
DictData.educationArr = res
})
await LinghuoyonggongAPI.getLaborAppDetail({ id }).then((res) => {
pageData.workersParam = res.workers
pageData.contactMobile = res.contactMobile
pageData.contactName =
res.contactName.substring(0, 1) + Array.from({ length: res.contactName.length }).join('*')
})
}
// 返回字典中的中文值
function returnDictZhVel(type: any, val: any) {
let valText = ''
if (type == 'gender') {
const arr = DictData.sexArr
for (let i = 0; i < arr.length; i++) {
if (val == Number.parseInt(arr[i].itemValue)) {
valText = arr[i].itemText
break
}
}
}
if (type == 'edu') {
const arr = DictData.educationArr
for (let i = 0; i < arr.length; i++) {
if (val == Number.parseInt(arr[i].itemValue)) {
valText = arr[i].itemText
break
}
}
}
return valText
}
function makePhoneCall() {
uni.makePhoneCall({
phoneNumber: pageData.contactMobile,
})
}
</script>
<template>
<view class="details_page">
<view class="details-content">
<view v-if="!pageData.workersParam || pageData.workersParam.length == 0" style="height: 700rpx">
<fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" />
</view>
<view class="yr-person-item" v-for="(item,index) in pageData.workersParam" :key="index">
<view class="yr-person-info">
<view class="person_name_attr">{{item.name}}<text class="person_attr">{{item.attr}}</text></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 v-if="pageData.workersParam.length" class="make-phone-view">
<fui-button text="电话沟通" bold radius="96rpx" @click="pageData.showConfirmDialog = true" height="80rpx"/>
</view>
<!-- 确认对话框 -->
<ConfirmDialog
v-model:show="pageData.showConfirmDialog"
title="温馨提示"
:content="`你将与${pageData.contactName}进行电话沟通,若继续,请点击确认按钮!`"
cancelText="取消"
confirmText="确认"
@confirm="makePhoneCall"
/>
<view class="details-content">
<view v-if="!pageData.workersParam || pageData.workersParam.length == 0" style="height: 700rpx">
<fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" />
</view>
<view class="yr-person-item" v-for="(item, index) in pageData.workersParam" :key="index">
<view class="yr-person-info">
<view class="person_name_attr"
>{{ item.name }}<text class="person_attr">{{ item.attr }}</text></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 v-if="pageData.workersParam.length" class="make-phone-view">
<fui-button text="电话沟通" bold radius="96rpx" @click="pageData.showConfirmDialog = true" height="80rpx" />
</view>
<!-- 确认对话框 -->
<ConfirmDialog
v-model:show="pageData.showConfirmDialog"
title="温馨提示"
:content="`你将与${pageData.contactName}进行电话沟通,若继续,请点击确认按钮!`"
cancelText="取消"
confirmText="确认"
@confirm="makePhoneCall"
/>
</view>
<fui-loading isFixed v-if="pageData.loading" backgroundColor="rgba(0, 0, 0, 0.4)" />
<fui-loading isFixed v-if="pageData.loading" backgroundColor="rgba(0, 0, 0, 0.4)" />
</template>
<style lang="scss" scoped>
.details_page{
background: rgba(230, 245, 232, 1);
min-height: 100vh;
width: 750rpx;
padding-top: 24rpx;
position: relative;
.details-content{
width: 694rpx;
background-color: #FFFFFF;
margin-left: 28rpx;
border-radius: 12rpx;
padding: 24rpx;
.yr-person-item{
border-bottom: 2rpx solid #EEEEEE;
margin-bottom: 24rpx;
.yr-person-info{
.person_name_attr{
font-size: 28rpx;
font-weight: 500;
color: #333333;
.person_attr{
font-size: 24rpx;
font-weight: 400;
color: #5DB66F;
margin-left: 12rpx;
}
}
.person-info{
font-size: 24rpx;
color: #999999;
vertical-align: middle;
margin-bottom: 24rpx;
margin-top: 24rpx;
}
}
}
.yr-person-item:last-child{
border-bottom: none;
}
}
.make-phone-view{
width: 690rpx;
height: 80rpx;
position: fixed;
left: 30rpx;
bottom: 62rpx;
}
}
.details_page {
background: rgba(230, 245, 232, 1);
min-height: 100vh;
width: 750rpx;
padding-top: 24rpx;
position: relative;
.details-content {
width: 694rpx;
background-color: #ffffff;
margin-left: 28rpx;
border-radius: 12rpx;
padding: 24rpx;
.yr-person-item {
border-bottom: 2rpx solid #eeeeee;
margin-bottom: 24rpx;
.yr-person-info {
.person_name_attr {
font-size: 28rpx;
font-weight: 500;
color: #333333;
.person_attr {
font-size: 24rpx;
font-weight: 400;
color: #5db66f;
margin-left: 12rpx;
}
}
.person-info {
font-size: 24rpx;
color: #999999;
vertical-align: middle;
margin-bottom: 24rpx;
margin-top: 24rpx;
}
}
}
.yr-person-item:last-child {
border-bottom: none;
}
}
.make-phone-view {
width: 690rpx;
height: 80rpx;
position: fixed;
left: 30rpx;
bottom: 62rpx;
}
}
</style>
......@@ -56,16 +56,16 @@
},
],
rules: [
{
name: 'username',
rule: ['required'],
msg: ['请输入账号'],
},
{
name: 'password',
rule: ['required'],
msg: ['请输入密码'],
},
{
name: 'username',
rule: ['required'],
msg: ['请输入账号'],
},
{
name: 'password',
rule: ['required'],
msg: ['请输入密码'],
},
/* {
name: 'username',
rule: ['required'],
......@@ -91,7 +91,7 @@
],
data: {
username: '',
password:'',
password: '',
// code: '',
read: false,
deviceId: '',
......@@ -103,7 +103,7 @@
if (isDevMode()) {
model.form.data.username = ''
// model.form.data.code = ''
model.form.data.password = ''
model.form.data.password = ''
model.form.data.read = false
}
......@@ -118,14 +118,14 @@
mobile: model.form.data.username,
captcha: model.form.data.code,
} */
const params = {
username: model.form.data.username,
password: model.form.data.password,
}
const params = {
username: model.form.data.username,
password: model.form.data.password,
}
// 短信登录
model.loading = true
// API.phoneLogin(params)
API.sysLogin(params)
API.sysLogin(params)
.then(async (body) => {
console.log('body', body)
if (body) {
......@@ -236,48 +236,47 @@
<fui-form class="form" ref="form" top="0" :padding="['0rpx', '0rpx']" background="#e46962">
<view class="login_content">
<view class="login-input-area">
<view class="user_phone">
<image class="user_phone_img" src="/static/images/register/user.png" />
<view class="user_text_view"><text class="view_text">账号</text></view>
</view>
<view class="input-bottom-border">
<fui-input
height="94rpx"
:padding="['0rpx', '0rpx', '0rpx', '12rpx']"
class="input"
autocomplete="off"
:required="false"
clearable
trim
placeholder="请输入账号"
v-model="model.form.data.username"
name="mobile"
backgroundColor="transparent"
borderColor="transparent"
maxlength="11"
/>
</view>
<view class="user_phone mt50">
<image class="user_phone_img" src="/static/images/register/pwd.png" />
<view class="user_text_view"><text class="view_text">密码</text></view>
</view>
<view class="input-bottom-border">
<fui-input
height="94rpx"
:padding="['0rpx', '0rpx', '0rpx', '12rpx']"
class="input"
password
clearable
trim
placeholder="请输入密码"
v-model="model.form.data.password"
backgroundColor="transparent"
borderColor="transparent"
>
</fui-input>
</view>
</view>
<view class="login-input-area">
<view class="user_phone">
<image class="user_phone_img" src="/static/images/register/user.png" />
<view class="user_text_view"><text class="view_text">账号</text></view>
</view>
<view class="input-bottom-border">
<fui-input
height="94rpx"
:padding="['0rpx', '0rpx', '0rpx', '12rpx']"
class="input"
autocomplete="off"
:required="false"
clearable
trim
placeholder="请输入账号"
v-model="model.form.data.username"
name="mobile"
backgroundColor="transparent"
borderColor="transparent"
maxlength="11"
/>
</view>
<view class="user_phone mt50">
<image class="user_phone_img" src="/static/images/register/pwd.png" />
<view class="user_text_view"><text class="view_text">密码</text></view>
</view>
<view class="input-bottom-border">
<fui-input
height="94rpx"
:padding="['0rpx', '0rpx', '0rpx', '12rpx']"
class="input"
password
clearable
trim
placeholder="请输入密码"
v-model="model.form.data.password"
backgroundColor="transparent"
borderColor="transparent"
/>
</view>
</view>
<!-- <view class="login-input-area">
<view class="user_phone">
<image class="user_phone_img" src="/static/images/register/user.png" />
......
<script setup lang="ts">
import { reactive, ref } from 'vue'
import * as NewsApi from '@/api/model/news'
import dayjs from 'dayjs'
import * as NewsApi from '@/api/model/news'
interface News {
id: number
......@@ -34,7 +34,8 @@
const navigateName = ref(['热点新闻', '农业政策'])
async function getNewsList(params) {
if (model.loading) return
if (model.loading)
return
model.loading = true
NewsApi.getList(params).then((res) => {
if (res.records.length > 0) {
......@@ -129,7 +130,7 @@
<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>
<view v-show="!news.posterUrl" class="w-4%"></view>
<view v-show="!news.posterUrl" class="w-4%" />
</view>
</view>
<view v-show="news.posterUrl" class="w-30% h-130">
......
<script setup lang="ts">
import { reactive, toRefs } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { useUserStore } from '@/store/modules/user'
import { useGlobSetting } from '/@/hooks/setting'
......@@ -23,7 +22,13 @@ onLoad((pageOptions) => {
pageData.form[key] = res[key]
}
})
pageData.form.provinceText = res.provinceName + '/' + res.cityName + '/' + res.districtName
// 回显省市区名称
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
}
// 编辑模式下,如果已有示例图片,需要设置到上传组件中
if (res.coverImage) {
......@@ -99,6 +104,7 @@ const pageData = reactive({
districtName: '',
addressDetail: '',
coverImage: '',
slogan: '',
},
rules: [
{
......@@ -139,7 +145,17 @@ const pageData = reactive({
{
name: 'provinceName',
rule: ['required'],
msg: ['请选择归属省份'],
msg: ['请填写省市区信息!'],
},
{
name: 'cityName',
rule: ['required'],
msg: ['请填写省市区信息!'],
},
{
name: 'districtName',
rule: ['required'],
msg: ['请填写省市区信息!'],
},
{
name: 'addressDetail',
......@@ -231,15 +247,43 @@ function submit() {
formRef.value.validator(pageData.form, pageData.rules, true).then((res) => {
if (res.isPassed) {
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
apiCall(pageData.form)
.then(() => {
.then((res) => {
toastRef.value.show({
type: 'success',
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(() => {
uni.navigateBack()
if (targetId) {
// 跳转到农场详情页,注意路径需要是绝对路径
uni.redirectTo({
url: `/pages/nongchang/detail/index?id=${targetId}`
})
} else {
// 如果没有ID,回退上一页
uni.navigateBack()
}
}, 500);
})
.finally(() => {
......@@ -326,6 +370,19 @@ function submit() {
class="block-textarea"
/>
</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>
<!-- 第二组表单 -->
......@@ -333,14 +390,14 @@ function submit() {
<fui-form-item
required
asterisk
label="归属省份"
label="归属地区"
labelSize="28"
:labelWeight="400"
labelWidth="auto"
>
<view class="time-input" @click="pageData.show.address = true">
<text class="select-text" :class="{ placeholder: !pageData.form.provinceText }">
{{ pageData.form.provinceText || '请选择归属省份' }}
{{ pageData.form.provinceText || '请选择归属地区' }}
</text>
</view>
</fui-form-item>
......@@ -351,8 +408,8 @@ function submit() {
labelWidth="auto"
labelSize="28"
:labelWeight="400"
label="归属省份"
placeholder="请选择归属省份"
label="归属地区"
placeholder="请选择归属地区"
:value="pageData.form.provinceText"
/>
</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>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -33,23 +33,28 @@
name: 'phone',
rule: ['required'],
msg: ['请填写手机号码'],
}, {
},
{
name: 'scope',
rule: ['required'],
msg: ['请选择作业区域'],
}, {
},
{
name: 'startTime',
rule: ['required'],
msg: ['请选择开始时间'],
}, {
},
{
name: 'endTime',
rule: ['required'],
msg: ['请选择结束时间'],
}, {
},
{
name: 'address',
rule: ['required'],
msg: ['请填写详细地址'],
}, {
},
{
name: 'demand',
rule: ['required'],
msg: ['请填写需求'],
......@@ -135,11 +140,53 @@
</view>
<view class="text-left">
<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 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" />
<fui-input
marginTop="30"
size="24"
type="number"
maxlength="11"
placeholder="请填写手机号码"
v-model="pageData.form.phone"
required
placeholderStyle="margin-left: 10rpx;"
/>
<fui-input
marginTop="30"
size="24"
disabled
@click="pageData.areaShow.address = true"
placeholder="请选择作业区域"
v-model="pageData.scopeText"
required
placeholderStyle="margin-left: 10rpx;"
/>
<fui-input
marginTop="30"
size="24"
placeholder="请填写详细地址"
v-model="pageData.form.address"
required
placeholderStyle="margin-left: 10rpx;"
/>
<fui-input
marginTop="30"
size="24"
placeholder="请选择作业时间"
v-model="pageData.form.time"
@click="dict.show.time = true"
required
placeholderStyle="margin-left: 10rpx;"
/>
<fui-textarea
v-model="pageData.form.demand"
:marginTop="30"
size="24"
placeholder="简要说明作业要求"
flexStart
required
placeholderStyle="margin-left: 10rpx;"
height="100rpx"
/>
<view style="margin-top: 30rpx">
<fui-button type="warning" text="提交" bold radius="96rpx" @click="submit" />
</view>
......
......@@ -5,7 +5,7 @@
import { useGlobSetting } from '/@/hooks/setting'
import * as nongjifuwu from '@/api/model/nongjifuwu'
import { getDictData, getText } from '@/utils/dict/area'
const userStore = useUserStore()
const globSetting = useGlobSetting()
onLoad((option) => {
......@@ -222,14 +222,17 @@
label-width="180"
maxlength="6"
>
<view slot="suffix" class="unit-slot">元/亩</view>
<!-- <slot name="right" style="font-size:28rpx;"></slot> -->
</fui-input>
<template #suffix>
<view class="unit-slot">元/亩</view>
</template>
<!-- <slot name="right" style="font-size:28rpx;"></slot> -->
</fui-input>
</view>
<view class="bg-white mt20" style="padding: 0.875rem 1rem">
<view class="mb-1 flex justify-start" 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
:value="form.pictureObj"
:max-size="1024"
......
......@@ -115,8 +115,7 @@
// 加载编辑数据
function loadEditData() {
if (!props.editData)
return
if (!props.editData) return
formData.fileName = props.editData.fileName || ''
formData.fileType = props.editData.fileType || ''
......
......@@ -16,7 +16,8 @@
})
function getList() {
if (!paging.value) return
if (!paging.value)
return
// API留空,使用模拟数据 - 根据图片内容调整
API.getResourceList(pageData.param).then((res) => {
paging.value.complete(res.records)
......@@ -50,8 +51,7 @@
// 格式化时间显示
function formatTime(time) {
if (!time)
return ''
if (!time) return ''
// 如果是完整的时间字符串,可以格式化为图片中的样式
return time.includes(' ') ? time : `${time} 14:00`
}
......@@ -75,8 +75,7 @@ return ''
// 格式化文件大小
function formatFileSize(bytes) {
if (!bytes)
return '125kb'
if (!bytes) return '125kb'
const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
......
<template>
<view class="webview-container">
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(options) {
if (options.url) {
this.url = decodeURIComponent(options.url)
} else {
uni.showToast({
title: '网址不存在',
icon: 'none'
})
uni.navigateBack()
export default {
data() {
return {
url: '',
}
},
onLoad(options) {
if (options.url) {
this.url = decodeURIComponent(options.url)
} else {
uni.showToast({
title: '网址不存在',
icon: 'none',
})
uni.navigateBack()
}
},
}
}
}
</script>
\ No newline at end of file
</script>
<template>
<view class="webview-container">
<web-view :src="url" />
</view>
</template>
......@@ -239,7 +239,8 @@
function onAddClick(feature: any) {
console.log('点击功能模块:', feature)
if (feature.id === 2) showAddDialog()
if (feature.id === 2)
showAddDialog()
}
// 常用资源点击事件
function onResourceClick(resource: any) {
......
......@@ -103,7 +103,7 @@
}
const policyInfoTitle = computed(() => {
return (pageData.buttons.filter((btn) => btn.active)?.[0]?.name || '惠农贷款') + '政策'
return `${pageData.buttons.filter((btn) => btn.active)?.[0]?.name || '惠农贷款'}政策`
})
</script>
......
<!-- src/pages/zhunongjinrong/zhunongjinrong.vue -->
<script setup lang="ts">
import { reactive, ref } from 'vue'
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue';
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo;
consultRecord.id = id;
consultRecord.mobile = phone;
consultRecord.feedbackRemark = realname;
})
import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
import { getCurrentDateTime } from '@/utils/date'
import * as HomeAPI from '@/api/model/home'
import { useUserStore } from '@/store/modules/user'
onShow(() => {
const { id, realname, phone } = userStore.getUserInfo
consultRecord.id = id
consultRecord.mobile = phone
consultRecord.feedbackRemark = realname
})
// 定义银行类型
type BankKey = 'nongye' | 'youzheng' | 'nongshang'
......@@ -167,33 +168,33 @@
currentBank.value = bank
}
const userStore = useUserStore();
const userStore = useUserStore()
const consultRecord = reactive({
id: "",
mobile: '',// 咨询人号码
consultTime:"" ,// 咨询时间
bizType:4, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId:1324324324, // 意向企业
feedbackRemark:"" // 反馈备注
id: '',
mobile: '', // 咨询人号码
consultTime: '', // 咨询时间
bizType: 4, // 业务类型(1代理记账,2农资,3农机,4金融)
enterpriseId: 1324324324, // 意向企业
feedbackRemark: '', // 反馈备注
})
const pageData = reactive({
showLogoutDialog: false,
allpyMessageTitle:"",
applyMessageText:"",
allpyMessageTitle: '',
applyMessageText: '',
})
// 立即申请
function onApplyClick() {
consultRecord.consultTime = getCurrentDateTime();
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = "申请成功";
pageData.applyMessageText = "平台已收到申请,将尽快与您取得联系!";
pageData.showLogoutDialog = true;
})
consultRecord.consultTime = getCurrentDateTime()
HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
pageData.allpyMessageTitle = '申请成功'
pageData.applyMessageText = '平台已收到申请,将尽快与您取得联系!'
pageData.showLogoutDialog = true
})
}
// 提交申请
function handleConfirmLogout(){
pageData.showLogoutDialog = false;
function handleConfirmLogout() {
pageData.showLogoutDialog = false
}
</script>
......@@ -287,7 +288,7 @@
v-if="bankInfo[currentBank].processType === 'simple'"
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 v-else class="codefun-flex-col codefun-self-stretch section_8">
<view
......@@ -302,7 +303,7 @@
>
<text class="font_8">{{ step.number }}</text>
</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 v-if="step.desc" class="codefun-flex-row group_5">
<view class="codefun-self-center section_9" />
......@@ -359,13 +360,13 @@
<text class="font_2 text_20">立即申请</text>
</view>
</view>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="handleConfirmLogout"
/>
<successfulDialog
v-model:show="pageData.showLogoutDialog"
:title="pageData.allpyMessageTitle"
:content="pageData.applyMessageText"
confirmText="我知道了"
@confirm="handleConfirmLogout"
/>
</view>
</template>
......
......@@ -37,17 +37,17 @@ export function formatDate(date: Date | number | string): string {
*/
export function getCalculateAge(birthDate: Date | string): number {
// 解析出生日期字符串为Date对象
const birthDateObj = new Date(birthDate);
// 获取当前日期
const currentDate = new Date();
// 计算两个日期之间的年份差异
let age = currentDate.getFullYear() - birthDateObj.getFullYear();
// 检查是否还没到生日,如果是,则年龄减1
const m = currentDate.getMonth() - birthDateObj.getMonth();
if (m < 0 || (m === 0 && currentDate.getDate() < birthDateObj.getDate())) {
age--;
}
return age;
const birthDateObj = new Date(birthDate)
// 获取当前日期
const currentDate = new Date()
// 计算两个日期之间的年份差异
let age = currentDate.getFullYear() - birthDateObj.getFullYear()
// 检查是否还没到生日,如果是,则年龄减1
const m = currentDate.getMonth() - birthDateObj.getMonth()
if (m < 0 || (m === 0 && currentDate.getDate() < birthDateObj.getDate())) {
age--
}
return age
}
/**
......@@ -62,12 +62,12 @@ export function getCurrentDateTime(): string {
const month = String(now.getMonth() + 1).padStart(2, '0')
// 获取日期,确保两位数格式
const day = String(now.getDate()).padStart(2, '0');
const hour = String(now.getHours()).padStart(2, '0');
const minute = String(now.getMinutes()).padStart(2, '0');
const second = String(now.getSeconds()).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0')
const hour = String(now.getHours()).padStart(2, '0')
const minute = String(now.getMinutes()).padStart(2, '0')
const second = String(now.getSeconds()).padStart(2, '0')
// 返回格式化后的日期字符串
return `${year}-${month}-${day} ${hour}:${minute}:${second}`
}
\ No newline at end of file
}
import { cascaderHn } from '/@/api/model/dict'
const storageKey = 'app_dict_data_area_cascaderHn';
const storageKey = 'app_dict_data_area_cascaderHn'
let areaOptions = [];
export const getDictData = async () => {
let areaOptions = []
export async function getDictData() {
// 先从本地加载数据
let dictData = getLocalDict();
let dictData = getLocalDict()
if (!dictData) {
// 如果本地没有数据,则从接口获取
const res = await cascaderHn();
const data = JSON.stringify(res[0].children).replace(/label/g, 'text');
uni.setStorageSync(storageKey, data);
dictData = JSON.parse(data);
const res = await cascaderHn()
const data = JSON.stringify(res[0].children).replace(/label/g, 'text')
uni.setStorageSync(storageKey, data)
dictData = JSON.parse(data)
}
areaOptions = dictData;
return dictData;
areaOptions = dictData
return dictData
}
/**
* 获取本地数据
*/
export const getLocalDict = () => {
const data = uni.getStorageSync(storageKey);
export function getLocalDict() {
const data = uni.getStorageSync(storageKey)
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) {
return ''
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论