Browse Source

style: 调整样式和表单验证逻辑

- 移除petInfo.vue中图片的width属性
- 调整workbenchManage的容器样式和swiper指示器样式
- 为train.vue的头部添加z-index
- 更新getUrl.js中的开发环境API地址
- 注释掉systemOrder.vue中的跳转逻辑
- 在connectAddress/detail.vue中增加接单范围验证
- 在serve/upload.vue中添加表单验证逻辑和错误提示
- 调整workbenchManage/index.vue中的swiper样式和认证逻辑
master
前端-胡立永 3 weeks ago
parent
commit
7ce4893b67
8 changed files with 90 additions and 24 deletions
  1. +11
    -2
      otherPages/authentication/connectAddress/detail.vue
  2. +1
    -1
      otherPages/authentication/examination/train.vue
  3. +44
    -3
      otherPages/authentication/serve/upload.vue
  4. +1
    -1
      otherPages/userManage/pet/petInfo.vue
  5. +3
    -3
      pages/myOrdersManage/components/systemOrder.vue
  6. +3
    -1
      pages/workbenchManage/index.scss
  7. +25
    -11
      pages/workbenchManage/index.vue
  8. +2
    -2
      utils/getUrl.js

+ 11
- 2
otherPages/authentication/connectAddress/detail.vue View File

@ -31,7 +31,7 @@
</view> </view>
</up-form-item> </up-form-item>
<up-form-item label="接单范围" prop="rangeNo"> <up-form-item label="接单范围" prop="rangeNo">
<up-input v-model="form.rangeNo" placeholder="请输入内容" inputAlign="right" border="none">
<up-input v-model="form.rangeNo" type="number" placeholder="请输入内容" inputAlign="right" border="none">
<template #suffix> <template #suffix>
<text>Km</text> <text>Km</text>
</template> </template>
@ -105,7 +105,7 @@
longitude: null, longitude: null,
address: null, address: null,
status: true, status: true,
distance: null,
rangeNo: null,
disabledDate: [], disabledDate: [],
}) })
@ -163,6 +163,15 @@
} }
const onSave = async () => { const onSave = async () => {
// 3-15
if (form.value.rangeNo < 3 || form.value.rangeNo > 15) {
uni.showToast({
title: '接单范围必须在3-15公里之间',
icon: 'none'
})
return
}
let code = null; let code = null;
if (eidtItem?.value?.id) { if (eidtItem?.value?.id) {
let result = await udpateAddress({ let result = await udpateAddress({


+ 1
- 1
otherPages/authentication/examination/train.vue View File

@ -106,7 +106,7 @@ onShow(() => {
position: sticky; position: sticky;
top: 0; top: 0;
background-image: linear-gradient(180deg, #FFBF60 0, #ffbf60 2%, #ffbf60 8%, #f2f2f2 90%); background-image: linear-gradient(180deg, #FFBF60 0, #ffbf60 2%, #ffbf60 8%, #f2f2f2 90%);
z-index: 99;
.progress { .progress {
margin-top: 19rpx; margin-top: 19rpx;
} }


+ 44
- 3
otherPages/authentication/serve/upload.vue View File

@ -4,6 +4,8 @@
</view> </view>
<!-- style="margin: 20rpx;border-radius: 20rpx;" -->
<view class="tips color-ffb size-22"> <view class="tips color-ffb size-22">
注意:这段内容将会在您的喂养员个人主页做为"服务案例展示并开放给其他铲屎官查看请认真编辑哟 注意:这段内容将会在您的喂养员个人主页做为"服务案例展示并开放给其他铲屎官查看请认真编辑哟
</view> </view>
@ -198,7 +200,6 @@
const onSave = async () => { const onSave = async () => {
try { try {
const { const {
serviceType, serviceType,
serviceTime, serviceTime,
@ -207,6 +208,42 @@
fileList, fileList,
} = form } = form
//
if (!serviceType || serviceType.length === 0) {
return uni.showToast({
title: '请选择服务类型',
icon: 'none'
})
}
if (!serviceTime) {
return uni.showToast({
title: '请选择服务时间',
icon: 'none'
})
}
if (!serviceSpot) {
return uni.showToast({
title: '请选择服务地点',
icon: 'none'
})
}
if (!text) {
return uni.showToast({
title: '请输入服务描述',
icon: 'none'
})
}
if (!fileList || fileList.length === 0) {
return uni.showToast({
title: '请上传服务图片',
icon: 'none'
})
}
const data = { const data = {
userId: store.getters.userInfo.userId, userId: store.getters.userInfo.userId,
serviceType: serviceType.join(','), serviceType: serviceType.join(','),
@ -232,7 +269,10 @@
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)
} catch (err) { } catch (err) {
uni.showToast({
title: '提交失败,请重试',
icon: 'none'
})
} }
} }
@ -264,7 +304,8 @@
.tips { .tips {
padding: 8rpx 16rpx; padding: 8rpx 16rpx;
background-color: rgb(255, 250, 242);
background-color: #FFFAF2;
color: #FFBF60;
} }
.li { .li {


+ 1
- 1
otherPages/userManage/pet/petInfo.vue View File

@ -399,10 +399,10 @@
} }
.personal-pet-img { .personal-pet-img {
width: 100%;
height: 118px; height: 118px;
background-color: #fff; background-color: #fff;
padding: 10px 20px; padding: 10px 20px;
} }
.personal-pet-basic-info { .personal-pet-basic-info {


+ 3
- 3
pages/myOrdersManage/components/systemOrder.vue View File

@ -114,9 +114,9 @@ import PetServicePopup from './petServicePopup.vue';
// //
const toOrderDetail = (id) => { const toOrderDetail = (id) => {
uni.navigateTo({
url: `/otherPages/orderTakingManage/detail/index?id=${id}&type=my`
});
// uni.navigateTo({
// url: `/otherPages/orderTakingManage/detail/index?id=${id}&type=my`
// });
} }
// //


+ 3
- 1
pages/workbenchManage/index.scss View File

@ -3,7 +3,9 @@
} }
.container{ .container{
padding: 0 20rpx 20rpx; padding: 0 20rpx 20rpx;
margin-top: 20rpx;
margin-top: 28rpx;
position: relative;
z-index: 9;
&-list{ &-list{
padding: 26rpx 20rpx; padding: 26rpx 20rpx;
background: #FFFFFF; background: #FFFFFF;


+ 25
- 11
pages/workbenchManage/index.vue View File

@ -1,7 +1,15 @@
<template> <template>
<view> <view>
<view class="swiper-container"> <view class="swiper-container">
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" style="height: 370rpx;">
<swiper
:indicator-dots="true"
:autoplay="true"
:interval="3000"
:duration="1000"
indicatorActiveColor="#FFAA48"
:indicatorStyle="{bottom: '150rpx'}"
indicatorInactiveColor="#fff"
style="height: 412rpx;">
<swiper-item class="w-100 h-100" v-for="item in state.banner" :key="item.id"> <swiper-item class="w-100 h-100" v-for="item in state.banner" :key="item.id">
<image class="w-100 h-100" :src="item.image" mode=""></image> <image class="w-100 h-100" :src="item.image" mode=""></image>
</swiper-item> </swiper-item>
@ -92,6 +100,7 @@
} from "vuex" } from "vuex"
import configPopup from '@/components/configPopup.vue' import configPopup from '@/components/configPopup.vue'
import { answeBaseIsFinish, answeTrainIsFinish } from '@/api/examination' import { answeBaseIsFinish, answeTrainIsFinish } from '@/api/examination'
import { code } from "../../uni_modules/uview-plus/libs/function/test";
const configPopupRef = ref(null) const configPopupRef = ref(null)
const store = useStore(); const store = useStore();
@ -222,19 +231,24 @@
title: '加载中...' title: '加载中...'
}) })
let code1 = await answeBaseIsFinish({userId : userInfo.value.userId})
let code2 = await answeTrainIsFinish({userId : userInfo.value.userId})
uni.hideLoading()
if(code1 && code2){
uni.navigateTo({
url: `/otherPages/authentication/examination/trainCompleted/index?status=0`
})
}else{
try{
let code1 = await answeBaseIsFinish({userId : userInfo.value.userId})
let code2 = await answeTrainIsFinish({userId : userInfo.value.userId})
if(code1 && code2){
uni.navigateTo({
url: `/otherPages/authentication/examination/trainCompleted/index?status=0`
})
}else{
uni.navigateTo({
url: "/otherPages/authentication/list/index"
})
}
}catch(e){
uni.navigateTo({ uni.navigateTo({
url: "/otherPages/authentication/list/index" url: "/otherPages/authentication/list/index"
}) })
}finally{
uni.hideLoading()
} }
} }
</script> </script>


+ 2
- 2
utils/getUrl.js View File

@ -3,8 +3,8 @@ const accountInfo = wx.getAccountInfoSync();
current = accountInfo.miniProgram.envVersion; current = accountInfo.miniProgram.envVersion;
const api = { const api = {
develop:"http://h5.xzaiyp.top",
// develop:"https://api.catmdogd.com/prod-api",
// develop:"http://h5.xzaiyp.top",
develop:"https://api.catmdogd.com/prod-api",
// develop:"http://pet-admin.hhlm1688.com/api", // develop:"http://pet-admin.hhlm1688.com/api",
// develop: "http://youyi-test.natapp1.cc/prod-api", // 开发 // develop: "http://youyi-test.natapp1.cc/prod-api", // 开发
trial: "https://api.catmdogd.com/prod-api", //测试 trial: "https://api.catmdogd.com/prod-api", //测试


Loading…
Cancel
Save