This commit is contained in:
weipengfei 2024-02-03 16:18:17 +08:00
parent d9b1c67c76
commit 3df69f6381
6 changed files with 39 additions and 29 deletions

View File

@ -452,8 +452,8 @@
const tips = ref('获取验证码')
const countDown = ref(0); //
const formData = reactive({
account: "15680975703",
password: "123456",
account: "",
password: "",
code: '',
scene: "2",
terminal: ''
@ -590,7 +590,6 @@
num ? loginType.value = 1 : loginType.value = 2
formData.scene = loginType.value
console.log(formData.scene)
lineX.value = num
}
const u = (name) => {

View File

@ -94,7 +94,7 @@
const pwdShow = ref(false)
const pwdShow1 = ref(false)
const formData = reactive({
mobile: "19130550023",
mobile: "",
verify_code: "",
password: "",
password_confirm: "",

View File

@ -22,7 +22,7 @@
<up-input input-align="right" placeholder="请输入养殖种类" border="none"
v-model="data.formData.breed_type"></up-input>
</up-form-item> -->
<up-form-item label="养殖种类" prop="farm_type" borderBottom required @click="isshowBreed">
<up-form-item label="养殖种类" prop="breed_type" borderBottom required @click="isshowBreed">
<up-input input-align="right" placeholder="请选择养殖种类" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" border="none" v-model="breed_type_name" readonly
style="pointer-events: none;"></up-input>
@ -58,15 +58,15 @@
suffix-icon-style="color: #b6b6b6;" border="none" v-model="area_name" readonly
style="pointer-events: none;"></up-input>
</up-form-item>
<up-form-item label="所在镇街" prop="formData.street" borderBottom required @click="isshow3">
<up-form-item label="所在镇街" prop="street" borderBottom required @click="isshow3">
<up-input input-align="right" placeholder="请选择所在镇街" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" border="none" v-model="street_name"></up-input>
</up-form-item>
<up-form-item label="所在乡村" prop="formData.village" borderBottom required @click="isshow4">
<up-form-item label="所在乡村" prop="village" borderBottom required @click="isshow4">
<up-input input-align="right" placeholder="请选择所在乡村" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" border="none" v-model="village_name"></up-input>
</up-form-item>
<up-form-item label="所在小队" prop="formData.bridge" borderBottom required @click="isshow5">
<up-form-item label="所在小队" prop="bridge" borderBottom required @click="isshow5">
<up-input input-align="right" placeholder="请选择所在小队" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" border="none" v-model="bridge_name"></up-input>
</up-form-item>
@ -188,10 +188,10 @@
village: '',
bridge: '',
address: '',
lat: "",
lon: "",
latitude: "",
longitude: "",
master_name: '',
image: []
pic: []
},
rules: {
farm_name: [{
@ -546,8 +546,8 @@
e = JSON.parse(e||'{}');
console.log('选择地址', e);
data.formData.address = e.address;
data.formData.lat = e.lat;
data.formData.lon = e.lon;
data.formData.latitude = e.lat;
data.formData.longitude = e.lon;
})
}
})
@ -566,13 +566,22 @@
const submit = async () => {
try {
const valid = await form1.value.validate();
if(!data.formData.latitude||!data.formData.longitude) {
uni.showToast({
title: '检测到您还没有获取具体位置信息, 正在跳转获取位置',
icon: 'none'
})
setTimeout(()=>{
location();
}, 800)
}
if (valid) {
// console.log('', data.formData);
if (pic.length == 0) {
uni.$u.toast('请上传图片')
return
}
data.formData.image = JSON.stringify(pic)
data.formData.pic = JSON.stringify(pic)
//
farmAdd(data.formData).then((res) => {

View File

@ -148,7 +148,8 @@
item = {
...item.detail,
create_time: item.create_time,
type_text: item.type_text
type_text: item.type_text,
type: item.type
};
if(item) item.pic = JSON.parse(item.pic||'[]');
return item ?? null;
@ -238,31 +239,31 @@
})
}
const navFeed = (item, index)=>{
if(index==2) uni.navigateTo({
if(item.type==3) uni.navigateTo({
url: `/pages/feedDetail/feedDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==4) uni.navigateTo({
if(item.type==5) uni.navigateTo({
url: `/pages/feedDetail/waterDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==1) uni.navigateTo({
if(item.type==1) uni.navigateTo({
url: `/pages/feedDetail/sterilizeDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==3) uni.navigateTo({
if(item.type==4) uni.navigateTo({
url: `/pages/feedDetail/vaccineDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==0) uni.navigateTo({
if(item.type==2) uni.navigateTo({
url: `/pages/feedDetail/expellingDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);

View File

@ -91,8 +91,8 @@
<u--image @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
height="200rpx"></u--image>
</view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, index)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navFeed(item, index)">
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navFeed(item)">
<view class="r-item">
<view class="item-title">操作类型:</view>
<view>{{item.type_text}}</view>
@ -242,7 +242,8 @@
item = {
...item.detail,
create_time: item.create_time,
type_text: item.type_text
type_text: item.type_text,
type: item.type
};
if(item!=null) item.pic = JSON.parse(item.pic||'[]');
return item;
@ -345,31 +346,31 @@
})
}
const navFeed = (item, index)=>{
if(index==2) uni.navigateTo({
if(item.type==3) uni.navigateTo({
url: `/pages/feedDetail/feedDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==4) uni.navigateTo({
if(item.type==5) uni.navigateTo({
url: `/pages/feedDetail/waterDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==1) uni.navigateTo({
if(item.type==1) uni.navigateTo({
url: `/pages/feedDetail/sterilizeDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==3) uni.navigateTo({
if(item.type==4) uni.navigateTo({
url: `/pages/feedDetail/vaccineDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==0) uni.navigateTo({
if(item.type==2) uni.navigateTo({
url: `/pages/feedDetail/expellingDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);

File diff suppressed because one or more lines are too long