提交 8dded24c 作者: 王定

feat: 优化一些细节

上级 054cd02b
# API 接口地址 # API 接口地址
# VITE_GLOB_API_URL=http://111.22.182.169:49600 VITE_GLOB_API_URL=http://111.22.182.169:49600
VITE_GLOB_API_URL=http://36.133.16.81:42111 # VITE_GLOB_API_URL=http://36.133.16.81:42111
# API 接口地址前缀 # API 接口地址前缀
# VITE_GLOB_API_URL_PREFIX=/jeecgboot VITE_GLOB_API_URL_PREFIX=/jeecgboot
VITE_GLOB_API_URL_PREFIX=/jeecg-boot # VITE_GLOB_API_URL_PREFIX=/jeecg-boot
...@@ -74,3 +74,20 @@ ...@@ -74,3 +74,20 @@
.uni-picker-container .uni-picker-action.uni-picker-action-confirm { .uni-picker-container .uni-picker-action.uni-picker-action-confirm {
color: #5DB66F !important; color: #5DB66F !important;
} }
.yr-select-area {
padding-top: 30rpx;
position: relative;
.fui-title {
font-size: 30rpx;
font-weight: bold;
text-align: center;
padding-bottom: 24rpx;
}
.fui-icon__close {
position: absolute;
top: 24rpx;
right: 24rpx;
}
}
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
} }
</script> </script>
<template> <template>
<view class="w-full h-95vh bg-#E6F5E8 detail_page"> <view class="w-full bg-#E6F5E8 detail_page">
<view class="module_width top_content"> <view class="module_width top_content">
<view class="enterprise_logo_view"><image class="enterprise_logo" mode="heightFix" :src="pageData.data.enterpriseLogoUrl" /></view> <view class="enterprise_logo_view"><image class="enterprise_logo" mode="heightFix" :src="pageData.data.enterpriseLogoUrl" /></view>
<view class="enterprise_business">主营:{{pageData.data.businessScope}}</view> <view class="enterprise_business">主营:{{pageData.data.businessScope}}</view>
...@@ -357,6 +357,7 @@ ...@@ -357,6 +357,7 @@
align-items: flex-start; align-items: flex-start;
align-content: flex-start; align-content: flex-start;
padding-bottom: 40rpx; padding-bottom: 40rpx;
min-height: calc(100vh - 88rpx);
.module_width{ .module_width{
width: 690rpx; width: 690rpx;
margin-top: 24rpx; margin-top: 24rpx;
...@@ -454,7 +455,9 @@ ...@@ -454,7 +455,9 @@
} }
} }
.footer_content{
margin-bottom: 100rpx;
}
.module_business{ .module_business{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -468,8 +471,9 @@ ...@@ -468,8 +471,9 @@
border-radius: 16rpx; border-radius: 16rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-wrap: wrap;
justify-content: center; justify-content: center;
align-items: center;
flex-direction: column;
background: #F9FAFB; background: #F9FAFB;
.business_img{ .business_img{
width: 310rpx; width: 310rpx;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import { onLoad, onShow } from '@dcloudio/uni-app' import { onLoad, 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 LinghuoyonggongAPI from '@/api/model/linghuoyonggong'
import * as nongjifuwu from '@/api/model/nongjifuwu' import * as nongjifuwu from '@/api/model/nongjifuwu'
import { getDictData, getText } from '@/utils/dict/area' import { getDictData, getText } from '@/utils/dict/area'
...@@ -17,15 +18,16 @@ ...@@ -17,15 +18,16 @@
} else { } else {
pageData.title = '新增农活作业' pageData.title = '新增农活作业'
} }
getProvince(43,null);
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: pageData.title, title: pageData.title,
}) })
}) })
onShow(() => { /* onShow(() => {
// 数据字典赋值 // 数据字典赋值
initDict() initDict()
}) }) */
const pageData = reactive({ const pageData = reactive({
title: '农活表单', title: '农活表单',
...@@ -35,9 +37,10 @@ ...@@ -35,9 +37,10 @@
time2: false, time2: false,
address: false, address: false,
}, },
options: { options: [],
address: [], optionsVal:[],
}, optionsValText:"",
form: { form: {
id: '', id: '',
name: '', name: '',
...@@ -91,10 +94,51 @@ ...@@ -91,10 +94,51 @@
}) })
const { show, options, form } = toRefs(pageData) const { show, options, form } = toRefs(pageData)
async function initDict() { const areaPopupRef = ref(null);
pageData.options.address = await getDictData() // 选择地区完成
} function selectCompleteArea(e){
let text = e.text;
let value = e.value;
let areaText = "",areaVal="";
for(let i = 0; i < (text.length-1);i++){
areaText += text[i]+'/';
areaVal += value[i]+',';
}
pageData.form.scope = areaVal.slice(0, -1);; // code
pageData.optionsValText = areaText.slice(0, -1);;
pageData.show.address = false;
}
// 在选择地区
function changeArea(e){
let val = e.value;
getProvince(val,e);
}
// 获取下一级地区
function getProvince(code,e) {
LinghuoyonggongAPI.queryConditions({ parentCode : code}).then(res=>{
if(res.length){
let dataArr = [];
for(let i = 0; i < res.length; i++){
let obj = {text:"",value:""};
obj.text = res[i].name;
obj.value = res[i].code;
dataArr.push(obj);
}
if(!pageData.options.length){
pageData.options = dataArr;
}else{
console.log("e.layer= "+ e.layer);
areaPopupRef.value.setRequestData(dataArr, e.layer);
if(e.layer >= 2){
areaPopupRef.value.end();
}
}
}else{
areaPopupRef.value.end();
}
})
}
function getDetails(id) { function getDetails(id) {
pageData.loading = true pageData.loading = true
...@@ -216,7 +260,7 @@ ...@@ -216,7 +260,7 @@
<text class="label">服务范围</text> <text class="label">服务范围</text>
<view class="time-input" @click="show.address = true"> <view class="time-input" @click="show.address = true">
<text class="select-text" :class="{ placeholder: !pageData.form.scope }"> <text class="select-text" :class="{ placeholder: !pageData.form.scope }">
{{ getText(pageData.form.scope, ' / ') || '请选择市/区县/乡镇' }} {{ pageData.optionsValText || '请选择市/区县/乡镇' }}
</text> </text>
</view> </view>
</view> </view>
...@@ -258,7 +302,20 @@ ...@@ -258,7 +302,20 @@
<fui-date-picker :show="show.time2" type="3" @change="handleChangeTime2" @cancel="show.time2 = false" :minDate="getCurrentDate()" /> <fui-date-picker :show="show.time2" type="3" @change="handleChangeTime2" @cancel="show.time2 = false" :minDate="getCurrentDate()" />
<fui-toast ref="toastRef" /> <fui-toast ref="toastRef" />
<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)" />
<fui-picker :show="show.address" :options="options.address" :linkage="true" :layer="3" @change="handleChangeAddress" @cancel="show.address = false" />
<!-- <fui-picker :show="show.address" :options="options.address" :linkage="true" :layer="3" @change="handleChangeAddress" @cancel="show.address = false" />
-->
<fui-bottom-popup :show="pageData.show.address">
<view class="fui-scroll__wrap yr-select-area">
<view class="fui-title">请选择</view>
<fui-cascader ref="areaPopupRef" :value="pageData.optionsVal" stepLoading @change="changeArea" @complete="selectCompleteArea" :options="pageData.options"></fui-cascader>
<view class="fui-icon__close" @tap.stop="pageData.show.address = false">
<fui-icon name="close" :size="48"></fui-icon>
</view>
</view>
</fui-bottom-popup>
</view> </view>
</view> </view>
</template> </template>
......
...@@ -127,9 +127,10 @@ ...@@ -127,9 +127,10 @@
function getGoodsList() { function getGoodsList() {
NongzhiAPI.goodsList(pageData.search).then((res) => { NongzhiAPI.goodsList(pageData.search).then((res) => {
console.log("pageData.products******************")
console.log(res) console.log(res)
const { records, total } = res const { records, total } = res
pageData.products = [...pageData.products, ...records] pageData.products = [...pageData.products, ...records];
pageData.total = total pageData.total = total
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论