Browse Source

对接宠物

master
longjieli 2 weeks ago
parent
commit
02891d8790
10 changed files with 467 additions and 434 deletions
  1. +7
    -7
      api/pet/index.js
  2. +12
    -0
      api/receivingHall/index.js
  3. +5
    -0
      otherPages/myOrdersManage/service/detail.vue
  4. +6
    -6
      otherPages/orderTakingManage/detail/index.vue
  5. +41
    -34
      otherPages/userManage/pet/components/petBaseInfo.vue
  6. +235
    -219
      otherPages/userManage/pet/components/petHealthInfo.vue
  7. +52
    -67
      otherPages/userManage/pet/index.vue
  8. +72
    -83
      otherPages/userManage/pet/petInfo.vue
  9. +11
    -4
      pages/myOrdersManage/components/systemOrder.vue
  10. +26
    -14
      pages/myOrdersManage/index.vue

+ 7
- 7
api/pet/index.js View File

@ -24,14 +24,14 @@ export function getByPetId(params) {
}
// 根据宠物标识删除宠物信息
export function delByPetId(params) {
export function delByPetId(data) {
return request({
headers: {
"isToken": true
},
url: "/applet/pet/getByPetId",
method: 'get',
params
url: "/applet/pet/delete",
method: 'post',
data
})
}
@ -41,19 +41,19 @@ export function addPet(data) {
headers: {
"isToken": true
},
url: "/applet/pet/getByPetId",
url: "/applet/pet/add",
method: 'post',
data
})
}
// 更新宠物信息
// 修改宠物信息
export function updatePet(data) {
return request({
headers: {
"isToken": true
},
url: "/applet/pet/getByPetId",
url: "/applet/pet/edit",
method: 'post',
data
})


+ 12
- 0
api/receivingHall/index.js View File

@ -37,6 +37,18 @@ export function orderList(params) {
})
}
// 小程序-我的订单流程
export function myList(params) {
return request({
headers: {
"isToken": true
},
url: "/applet/order/myList",
method: 'get',
params
})
}
// 接单大厅 - 立即接单
export function startByOrderId(data) {
return request({


+ 5
- 0
otherPages/myOrdersManage/service/detail.vue View File

@ -1,6 +1,11 @@
<template>
<!-- <div>服务档案</div> -->
<view class="box box-size">
<!-- <up-steps current="0">
<up-steps-item title="已下单"></up-steps-item>
<up-steps-item title="已出库"></up-steps-item>
<up-steps-item title="运输中"></up-steps-item>
</up-steps> -->
<view class="top box-size" :style="{borderRadius:'16rpx'}">
<view class="form-title">
本次喂养过程中您需要喂养的食品包括


+ 6
- 6
otherPages/orderTakingManage/detail/index.vue View File

@ -52,7 +52,7 @@
服务地址
</view>
<view >
{{ orderDetail.address }}
{{ orderDetail.order?.address }}
</view>
</view>
</view>
@ -68,7 +68,7 @@
</view>
<view class="line1">
</view>
<view v-for="pet in orderDetail.appletPetList" :key="pet.id" class="pet_information box-size">
<view v-for="pet in orderDetail.petList" :key="pet.id" class="pet_information box-size">
<view class="flex pet_item box-size">
<view class="img" :style="{borderRadius:'100rpx'}">
<image :src="pet.headImage" mode=""></image>
@ -101,7 +101,7 @@
合计
</view>
<view class="money_text">
¥&nbsp;{{ orderDetail.price }}
¥&nbsp;{{ orderDetail.order?.price }}
</view>
</view>
</view>
@ -126,7 +126,7 @@
下单时间
</view>
<view>
{{ orderDetail.createTime }}
{{ orderDetail.order?.createTime }}
</view>
</view>
<view class="line1">
@ -136,7 +136,7 @@
支付时间
</view>
<view>
{{ orderDetail.payTime }}
{{ orderDetail.order?.payTime }}
</view>
</view>
</view>
@ -278,13 +278,13 @@
const showConfirmOrder = ref(false);
const showOrderSuccess = ref(false);
const value = ref("45619491656")
const petList = ref([])
const userInfo = computed(() => {
return store.getters.userInfo
})
const configList = computed(() => {
return store.getters.configList;
})
//
const rushToBuyAnOrder = () => {
open()


+ 41
- 34
otherPages/userManage/pet/components/petBaseInfo.vue View File

@ -1,47 +1,54 @@
<template>
<view >
<view>
<view class="personal-pet-basic-info">
<view class="personal-pet-info-title border-bottom">
宠物基本信息
</view>
<u--form labelPosition="left" :model="model" ref="uForm">
<u-form-item required label="昵称" :prop="`petBaseInfo.name`" labelWidth="80" borderBottom>
<u--input v-model="petBaseInfo.name" placeholder="请输入宠物昵称" @change="nameChange"
<u-form-item required label="昵称" :prop="`petBaseInfo.nickName`" labelWidth="80" borderBottom>
<u--input v-model="petBaseInfo.nickName" placeholder="请输入宠物昵称" @change="nameChange"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="性别" :prop="`petBaseInfo.gender`" labelWidth="80" borderBottom
@click="showSex = true">
<u--input v-model="petBaseInfo.gender" disabled disabledColor="#ffffff" placeholder="请选择"
<u-form-item label="性别" :prop="`petBaseInfo.sex`" labelWidth="80" borderBottom @click="showSex = true">
<u--input v-model="petBaseInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item required label="品种" :prop="`petBaseInfo.breed`" labelWidth="80" borderBottom
@click="breedSelectOpen">
<u--input v-model="petBaseInfo.breed" disabled disabledColor="#ffffff" placeholder="请选择"
<!-- 后台获取品种数据 赶进度这里先注释 -->
<!-- <u-form-item required label="品种" :prop="`petBaseInfo.breed`" labelWidth="80" borderBottom
@click="breedSelectOpen"> -->
<u-form-item required label="品种" :prop="`petBaseInfo.type`" labelWidth="80" borderBottom>
<u--input v-model="petBaseInfo.type" disabledColor="#ffffff" placeholder="请输入"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item required label="体重" :prop="`petBaseInfo.bodyType`" labelWidth="80" borderBottom
@click="showWeight = true" ref="item1">
<u--input v-model="petBaseInfo.bodyType" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<!-- 赶进度先注释 -->
<!-- <u-form-item required label="体重" :prop="`petBaseInfo.weight`" labelWidth="80" borderBottom
@click="showWeight = true" ref="item1"> -->
<u-form-item required label="体重" :prop="`petBaseInfo.weight`" labelWidth="80" borderBottom ref="item1">
<u--input v-model="petBaseInfo.weight" disabledColor="#ffffff" placeholder="请输入(单位kg)"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right" type="number"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item label="出生年月" :prop="`petBaseInfo.birthDate`" labelWidth="80" borderBottom
<u-form-item label="出生年月" :prop="`petBaseInfo.birthday`" labelWidth="80" borderBottom
@click="yearMonthOpen">
<u--input v-model="petBaseInfo.birthDate" disabled disabledColor="#ffffff" placeholder="请选择"
<u--input v-model="petBaseInfo.birthday" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item required label="性格" :prop="`petBaseInfo.personality`" labelWidth="80" borderBottom
@click="dispositionSelectOpen">
<u--input v-model="petBaseInfo.personality" disabled disabledColor="#ffffff" placeholder="请选择"
<!-- 后台获取性格选择数据 感进度这里先注释 -->
<!-- <u-form-item required label="性格" :prop="`petBaseInfo.personality`" labelWidth="80" borderBottom
@click="dispositionSelectOpen"> -->
<u-form-item required label="性格" :prop="`petBaseInfo.personality`" labelWidth="80" borderBottom>
<u--input v-model="petBaseInfo.personality" disabledColor="#ffffff" placeholder="请输入"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
</u--form>
</view>
<view style="background-color: #fffcf2;padding: 10px 20px;" v-show="showDisposition">
<!-- 后台获取性格选择数据 感进度这里先注释 -->
<!-- <view style="background-color: #fffcf2;padding: 10px 20px;" v-show="showDisposition">
<view style="height: 85%;">
<u-checkbox-group v-model="petBaseInfo.personality" @change="checkboxChange" iconPlacement="left"
placement="row" style="flex-wrap: wrap;" activeColor="#ffbf60">
@ -50,15 +57,15 @@
</u-checkbox>
</u-checkbox-group>
</view>
</view>
</view> -->
<u-picker :show="showSex" :showToolbar='false' :columns="sexActions" @cancel="showSex = false"
:immediateChange="true" @change="sexSelect"></u-picker>
<u-picker :show="showWeight" :showToolbar='false' :columns="weightActions" @cancel="showWeight = false"
:immediateChange="true" @change="weightSelect"></u-picker>
<u-overlay :show="showBreed">
<view class="breed-select" style="height: 60%;">
<u-search shape="round" :show-action="false" v-model="searchValue" @change="searchBreed"></u-search>
<view style="padding: 10px;height: 80%;overflow: auto;">
@ -106,11 +113,11 @@
petBaseInfo: {
type: Object,
default: () => ({
name: '',
gender: '',
breed: '',
bodyType: '',
birthDate: '',
nickName: '',
sex: '',
type: '',
weight: '',
birthday: '',
personality: ''
})
}
@ -147,13 +154,13 @@
};
const sexSelect = (e) => {
props.petBaseInfo.gender = e.value[0];
props.petBaseInfo.sex = e.index;
showSex.value = false;
updatePetBaseInfo();
};
const weightSelect = (e) => {
props.petBaseInfo.bodyType = e.value[0];
props.petBaseInfo.weight = e.value[0];
showWeight.value = false;
updatePetBaseInfo();
};
@ -179,14 +186,14 @@
};
const breedSelectConfirm = () => {
props.petBaseInfo.breed = tempBreed.value;
props.petBaseInfo.type = tempBreed.value;
showBreed.value = false;
updatePetBaseInfo();
};
const yearMonthOpen = () => {
if (props.petBaseInfo.birthDate) {
tempBirthday.value = Number(new Date(props.petBaseInfo.birthDate));
if (props.petBaseInfo.birthday) {
tempBirthday.value = Number(new Date(props.petBaseInfo.birthday));
} else {
tempBirthday.value = Number(new Date());
}
@ -199,7 +206,7 @@
const yearMonthConfirm = (e) => {
const timeFormat = uni.$u.timeFormat;
props.petBaseInfo.birthDate = timeFormat(e.value, 'yyyy-mm');
props.petBaseInfo.birthday = timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss');
showBirthday.value = false;
updatePetBaseInfo();
};


+ 235
- 219
otherPages/userManage/pet/components/petHealthInfo.vue View File

@ -1,226 +1,242 @@
<template>
<view >
<view class="personal-pet-health-info">
<view class="personal-pet-info-title border-bottom">
宠物健康情况
</view>
<u--form labelPosition="left" :model="petHealthInfo" ref="uForm">
<u-form-item required label="疫苗" :prop="`petHealthInfo.vaccineStatus`" labelWidth="80" borderBottom
@click="showVaccine = true">
<u--input v-model="petHealthInfo.vaccineStatus" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item required label="驱虫" :prop="`petHealthInfo.dewormingStatus`" labelWidth="80" borderBottom
@click="showExpelling = true">
<u--input v-model="petHealthInfo.dewormingStatus" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item label="绝育" :prop="`petHealthInfo.sterilization`" labelWidth="80" borderBottom
@click="showSterilization = true" ref="item1">
<u--input v-model="petHealthInfo.sterilization" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item v-if="petType === 'dog' || petType === '狗狗' " label="狗证" :prop="`petHealthInfo.doglicenseStatus`" labelWidth="80" borderBottom
@click="showDog = true" ref="item1">
<u--input v-model="petHealthInfo.doglicenseStatus" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<view class="dog-tips" v-if="petType === 'dog' || petType === '狗狗'">
<u-icon name="info-circle" color="#A94F20" size="12"></u-icon>
<view style="margin-left: 3px;">
未办理养犬许可证且需要外出遛狗, 犬只存在被相关单位收缴
甚至捕杀的可能请您遵守当地养犬规范合法文明养犬具体
请您查看当地养犬条例
</view>
</view>
<u-form-item required label="健康" :prop="`petHealthInfo.healths`" labelWidth="80"
@click="healthsSelect">
<u--input disabled disabledColor="#ffffff" placeholder="请选择(多选)" :value="petHealthInfo.healthStatus && petHealthInfo.healthStatus.join(',')"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<view slot="right">
<u-icon v-if="showHealths" name="arrow-down" color="#AAA"></u-icon>
<u-icon v-else name="arrow-right" color="#AAA" ></u-icon>
</view>
</u-form-item>
</u--form>
</view>
<view class="health-select" v-show="showHealths">
<view style="padding: 10px;height: 85%;">
<u-checkbox-group v-model="petHealthInfo.healthStatus" @change="checkboxChange" placement="column" activeColor="#ffbf60">
<u-checkbox :customStyle="{marginBottom: '8px'}" v-for="(item, index) in healthData"
:key="index" :label="item" :name="item">
</u-checkbox>
</u-checkbox-group>
<u--input placeholder="请输入其他健康特征"
:disabled="!(petHealthInfo.healthStatus && petHealthInfo.healthStatus.includes('其他'))"
border="surround" maxlength='20'
:customStyle="{backgroundColor: '#fff'}"
@change="updatePetHealthInfo()"
v-model="petHealthInfo.remark"></u--input>
</view>
</view>
<u-picker :show="showVaccine" :showToolbar='false' :columns="vaccineActions" @cancel="showVaccine = false" :immediateChange="true"
:defaultIndex="defaultVaccine"
@change="vaccineSelect"></u-picker>
<u-picker :show="showExpelling" :showToolbar='false' :columns="expellingActions" @cancel="showExpelling = false" :immediateChange="true"
:defaultIndex="defaultDeworming"
@change="expellingSelect"></u-picker>
<u-picker :show="showSterilization" :showToolbar='false' :columns="sterilizationActions" @cancel="showSterilization = false" :immediateChange="true"
:defaultIndex="defaultSterilization"
@change="sterilizationSelect"></u-picker>
<u-picker :show="showDog" :showToolbar='false' :columns="dogActions" @cancel="showDog = false" :immediateChange="true"
:defaultIndex="defaultDoglicense"
@change="dogSelect"></u-picker>
</view>
<view>
<view class="personal-pet-health-info">
<view class="personal-pet-info-title border-bottom">
宠物健康情况
</view>
<u--form labelPosition="left" :model="petHealthInfo" ref="uForm">
<u-form-item required label="疫苗" :prop="`petHealthInfo.vaccine`" labelWidth="80" borderBottom
@click="showVaccine = true">
<u--input v-model="petHealthInfo.vaccine" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item required label="驱虫" :prop="`petHealthInfo.deworm`" labelWidth="80" borderBottom
@click="showExpelling = true">
<u--input v-model="petHealthInfo.deworm" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item label="绝育" :prop="`petHealthInfo.neutered`" labelWidth="80" borderBottom
@click="showSterilization = true" ref="item1">
<u--input v-model="petHealthInfo.neutered" disabled disabledColor="#ffffff" placeholder="请选择"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<u-form-item v-if="petType === 'dog' || petType === '狗狗' " label="狗证"
:prop="`petHealthInfo.doglicenseStatus`" labelWidth="80" borderBottom @click="showDog = true"
ref="item1">
<u--input v-model="petHealthInfo.doglicenseStatus" disabled disabledColor="#ffffff"
placeholder="请选择" placeholderStyle="text-align:right;color:#AAA" border="none"
inputAlign="right"></u--input>
<u-icon slot="right" name="arrow-right" color="#AAA"></u-icon>
</u-form-item>
<view class="dog-tips" v-if="petType === 'dog' || petType === '狗狗'">
<u-icon name="info-circle" color="#A94F20" size="12"></u-icon>
<view style="margin-left: 3px;">
未办理养犬许可证且需要外出遛狗, 犬只存在被相关单位收缴
甚至捕杀的可能请您遵守当地养犬规范合法文明养犬具体
请您查看当地养犬条例
</view>
</view>
<!-- 赶进度先注释 -->
<!-- <u-form-item required label="健康" :prop="`petHealthInfo.healths`" labelWidth="80" @click="healthsSelect"> -->
<u-form-item required label="健康" :prop="`petHealthInfo.health`" labelWidth="80">
<u--input disabledColor="#ffffff" placeholder="请输入"
:v-model="petHealthInfo.health"
placeholderStyle="text-align:right;color:#AAA" border="none" inputAlign="right"></u--input>
<view slot="right">
<u-icon v-if="showHealths" name="arrow-down" color="#AAA"></u-icon>
<u-icon v-else name="arrow-right" color="#AAA"></u-icon>
</view>
</u-form-item>
</u--form>
</view>
<!-- 赶进度先注释 -->
<!-- <view class="health-select" v-show="showHealths">
<view style="padding: 10px;height: 85%;">
<u-checkbox-group v-model="petHealthInfo.healthStatus" @change="checkboxChange" placement="column"
activeColor="#ffbf60">
<u-checkbox :customStyle="{marginBottom: '8px'}" v-for="(item, index) in healthData" :key="index"
:label="item" :name="item">
</u-checkbox>
</u-checkbox-group>
<u--input placeholder="请输入其他健康特征"
:disabled="!(petHealthInfo.healthStatus && petHealthInfo.healthStatus.includes('其他'))"
border="surround" maxlength='20' :customStyle="{backgroundColor: '#fff'}"
@change="updatePetHealthInfo()" v-model="petHealthInfo.remark"></u--input>
</view>
</view> -->
<u-picker :show="showVaccine" :showToolbar='false' :columns="vaccineActions" @cancel="showVaccine = false"
:immediateChange="true" :defaultIndex="defaultVaccine" @change="vaccineSelect"></u-picker>
<u-picker :show="showExpelling" :showToolbar='false' :columns="expellingActions" @cancel="showExpelling = false"
:immediateChange="true" :defaultIndex="defaultDeworming" @change="expellingSelect"></u-picker>
<u-picker :show="showSterilization" :showToolbar='false' :columns="sterilizationActions"
@cancel="showSterilization = false" :immediateChange="true" :defaultIndex="defaultSterilization"
@change="sterilizationSelect"></u-picker>
<u-picker :show="showDog" :showToolbar='false' :columns="dogActions" @cancel="showDog = false"
:immediateChange="true" :defaultIndex="defaultDoglicense" @change="dogSelect"></u-picker>
</view>
</template>
<script setup>
import { ref, onMounted, watch } from 'vue';
// props
const props = defineProps({
petType: {
type: String,
default: 'dog'
},
petHealthInfo: {
type: Object,
default: () => ({
vaccineStatus: '',
dewormingStatus: '',
sterilization: '',
doglicenseStatus: '',
healthStatus: [],
remark: ''
})
},
defaultVaccine: {
type: Number,
default: 0
},
defaultDeworming: {
type: Number,
default: 0
},
defaultSterilization: {
type: Number,
default: 0
},
defaultDoglicense: {
type: Number,
default: 0
}
});
// emits
const emits = defineEmits(['update:petHealthInfo']);
//
const showVaccine = ref(false);
const showExpelling = ref(false);
const showSterilization = ref(false);
const showDog = ref(false);
const showHealths = ref(false);
const vaccineActions = ref([[ '每年都免疫','有免疫史','未免疫']]);
const expellingActions = ref([['未驱虫', '定期驱虫', '有驱虫史']]);
const sterilizationActions = ref([['已绝育','未绝育']]);
const dogActions = ref([[ '是','否']]);
const healthData = ref([]);
const tempHealths = ref([]);
const uForm = ref(null);
const item1 = ref(null);
//
const getHealthDataList = () => {
// getDictList('pet_health_status').then(res => {
// if (res.code === 200) {
// healthData.value = res.data.map(e => e.dictLabel);
// } else {
// uni.showToast({
// title: '',
// icon: 'none'
// });
// }
// });
};
const vaccineSelect = (e) => {
props.petHealthInfo.vaccineStatus = e.value[0];
showVaccine.value = false;
updatePetHealthInfo();
};
const expellingSelect = (e) => {
props.petHealthInfo.dewormingStatus = e.value[0];
showExpelling.value = false;
updatePetHealthInfo();
};
const sterilizationSelect = (e) => {
props.petHealthInfo.sterilization = e.value[0];
showSterilization.value = false;
updatePetHealthInfo();
};
const dogSelect = (e) => {
props.petHealthInfo.doglicenseStatus = e.value[0];
showDog.value = false;
updatePetHealthInfo();
};
const healthsSelect = () => {
showHealths.value = !showHealths.value;
uni.pageScrollTo({
scrollTop: 2000,
duration: 300
});
};
const checkboxChange = (n) => {
console.log('change', n);
updatePetHealthInfo();
};
const changeRemark = (e) => {
props.petHealthInfo.remark = e;
updatePetHealthInfo();
};
const updatePetHealthInfo = () => {
// update petHealthInfo
emits('update:petHealthInfo', props.petHealthInfo);
};
//
onMounted(() => {
// getHealthDataList();
// defaultVaccine.value = vaccineActions.value[0].indexOf(props.petHealthInfo.vaccineStatus);
// defaultDeworming.value = expellingActions.value[0].indexOf(props.petHealthInfo.dewormingStatus);
// defaultSterilization.value = sterilizationActions.value[0].indexOf(props.petHealthInfo.sterilization);
// defaultDoglicense.value = dogActions.value[0].indexOf(props.petHealthInfo.doglicenseStatus);
});
import {
ref,
onMounted,
watch
} from 'vue';
// props
const props = defineProps({
petType: {
type: String,
default: 'dog'
},
petHealthInfo: {
type: Object,
default: () => ({
vaccine: '',
deworm: '',
neutered: '',
doglicenseStatus: '',
health: [],
remark: ''
})
},
defaultVaccine: {
type: Number,
default: 0
},
defaultDeworming: {
type: Number,
default: 0
},
defaultSterilization: {
type: Number,
default: 0
},
defaultDoglicense: {
type: Number,
default: 0
}
});
// emits
const emits = defineEmits(['update:petHealthInfo']);
//
const showVaccine = ref(false);
const showExpelling = ref(false);
const showSterilization = ref(false);
const showDog = ref(false);
const showHealths = ref(false);
const vaccineActions = ref([
['每年都免疫', '有免疫史', '未免疫']
]);
const expellingActions = ref([
['未驱虫', '定期驱虫', '有驱虫史']
]);
const sterilizationActions = ref([
['已绝育', '未绝育']
]);
const dogActions = ref([
['是', '否']
]);
const healthData = ref([]);
const tempHealths = ref([]);
const uForm = ref(null);
const item1 = ref(null);
//
const getHealthDataList = () => {
// getDictList('pet_health_status').then(res => {
// if (res.code === 200) {
// healthData.value = res.data.map(e => e.dictLabel);
// } else {
// uni.showToast({
// title: '',
// icon: 'none'
// });
// }
// });
};
const vaccineSelect = (e) => {
props.petHealthInfo.vaccine = e.index;
showVaccine.value = false;
updatePetHealthInfo();
};
const expellingSelect = (e) => {
props.petHealthInfo.deworm = e.index;
showExpelling.value = false;
updatePetHealthInfo();
};
const sterilizationSelect = (e) => {
props.petHealthInfo.neutered = e.index;
showSterilization.value = false;
updatePetHealthInfo();
};
const dogSelect = (e) => {
props.petHealthInfo.doglicenseStatus = e.value[0];
showDog.value = false;
updatePetHealthInfo();
};
const healthsSelect = () => {
showHealths.value = !showHealths.value;
uni.pageScrollTo({
scrollTop: 2000,
duration: 300
});
};
const checkboxChange = (n) => {
console.log('change', n);
updatePetHealthInfo();
};
const changeRemark = (e) => {
props.petHealthInfo.remark = e;
updatePetHealthInfo();
};
const updatePetHealthInfo = () => {
// update petHealthInfo
emits('update:petHealthInfo', props.petHealthInfo);
};
//
onMounted(() => {
// getHealthDataList();
// defaultVaccine.value = vaccineActions.value[0].indexOf(props.petHealthInfo.vaccineStatus);
// defaultDeworming.value = expellingActions.value[0].indexOf(props.petHealthInfo.dewormingStatus);
// defaultSterilization.value = sterilizationActions.value[0].indexOf(props.petHealthInfo.sterilization);
// defaultDoglicense.value = dogActions.value[0].indexOf(props.petHealthInfo.doglicenseStatus);
});
</script>
<style lang="scss">
.personal-pet-health-info{
background-color: #fff;
padding: 10px 20px 0 20px;
margin-top: 10px;
}
.health-select{
background-color: #fffcf2;
padding: 10px 20px;
}
.dog-tips{
color: #A94F20;
font-size: 12px;
display: flex;
align-items: baseline;
margin-top: 5px;
}
</style>
.personal-pet-health-info {
background-color: #fff;
padding: 10px 20px 0 20px;
margin-top: 10px;
}
.health-select {
background-color: #fffcf2;
padding: 10px 20px;
}
.dog-tips {
color: #A94F20;
font-size: 12px;
display: flex;
align-items: baseline;
margin-top: 5px;
}
</style>

+ 52
- 67
otherPages/userManage/pet/index.vue View File

@ -3,7 +3,7 @@
<view v-if="petList.length > 0" class="personal-pet-list">
<view v-for="(item, index) in petList" :key="index">
<view
:class="['personal-pet-list-item', item.gender === '男生' ? 'personal-pet-list-item_backgroud_m' : 'personal-pet-list-item_backgroud_f' ]">
:class="['personal-pet-list-item', item.sex === 0 ? 'personal-pet-list-item_backgroud_m' : 'personal-pet-list-item_backgroud_f' ]">
<view class="personal-pet-info">
<view>
<u-avatar :src="item.headImage || defaultPhoto" size="60" shape="circle"></u-avatar>
@ -19,13 +19,13 @@
</view>
</view>
<view class="personal-pet-info-3" style="width: 100%;">
<view style="max-width: 35%;">
<view style="max-width: 35%;">
{{ item.type || '未知' }}
</view>
<view class="personal-pet-info-age" style="max-width: 90px;">
{{ item.age || '未知' }}
</view>
<view style="max-width: 25%;">
<view style="max-width: 25%;">
体重{{ item.weight }}kg
</view>
</view>
@ -65,10 +65,11 @@
</button>
</view>
<!-- <view >
<u-picker :showToolbar='false' :show="show" :columns="petTypes" @change="petTypeChange" @cancel="cancel"
@confirm="confirm"></u-picker>
</view> -->
<view>
<u-picker :showToolbar='true' :show="show" :columns="petTypes" @change="petTypeChange" @cancel="cancel"
@confirm="confirm" :immediateChange="true"></u-picker>
</view>
<u-modal :show="showDel" @confirm="confirmDel" @cancel="cancelDel" ref="uModal" showCancelButton
:asyncClose="true" :content="delContent"></u-modal>
</view>
@ -100,7 +101,11 @@
const petList = ref([]);
const show = ref(false);
const showDel = ref(false);
const petTypes = ref([]);
const petTypes = ref([
[
'猫咪', '狗狗'
]
]);
const delContent = ref('');
const deleteId = ref('');
const petType = ref('');
@ -133,9 +138,7 @@
// };
const addPet = () => {
uni.navigateTo({
url: "/otherPages/userManage/pet/petInfo"
})
show.value = true;
};
const cancel = () => {
@ -148,79 +151,61 @@
const confirm = (e) => {
show.value = false;
console.log(petType.value);
if (petType.value === '猫猫') {
router.push({
path: `/pages/personalCenter/petInfo`,
query: {
petType: 'cat',
optionType: 'add'
}
});
if (petType.value === '猫咪') {
uni.navigateTo({
url: "/otherPages/userManage/pet/petInfo?petType=0&optionType=add"
})
}
if (petType.value === '狗狗') {
router.push({
path: `/pages/personalCenter/petInfo`,
query: {
petType: 'dog',
optionType: 'add'
}
});
}
if (!petType.value) {
if (e.value[0] === '猫猫') {
router.push({
path: `/pages/personalCenter/petInfo`,
query: {
petType: 'cat',
optionType: 'add'
}
});
}
if (e.value[0] === '狗狗') {
router.push({
path: `/pages/personalCenter/petInfo`,
query: {
petType: 'dog',
optionType: 'add'
}
});
}
uni.navigateTo({
url: "/otherPages/userManage/pet/petInfo?petType=1&optionType=add"
})
}
// if (!petType.value) {
// if (e.value[0] === '') {
// router.push({
// path: `/pages/personalCenter/petInfo`,
// query: {
// petType: 'cat',
// optionType: 'add'
// }
// });
// }
// if (e.value[0] === '') {
// router.push({
// path: `/pages/personalCenter/petInfo`,
// query: {
// petType: 'dog',
// optionType: 'add'
// }
// });
// }
// }
};
const editPet = (item) => {
if (item.petType === '猫猫' || item.petType === 'cat') {
router.push({
path: `/pages/personalCenter/petInfo`,
query: {
petType: 'cat',
optionType: 'edit',
petId: item.id
}
});
console.log(item)
if (item.petType === '猫咪' || item.petType === 0) {
uni.navigateTo({
url: `/otherPages/userManage/pet/petInfo?petType=0&optionType=edit&petId=${item.id}`
})
}
if (item.petType === '狗狗' || item.petType === 'dog') {
router.push({
path: `/pages/personalCenter/petInfo`,
query: {
petType: 'dog',
optionType: 'edit',
petId: item.id
}
});
if (item.petType === '狗狗' || item.petType === 1) {
uni.navigateTo({
url: `/otherPages/userManage/pet/petInfo?petType=1&optionType=edit&petId=${item.id}`
})
}
};
const deletePet = (item) => {
delContent.value = "确定要删除" + item.name + '?';
delContent.value = "确定要删除" + item.nickName + '?';
showDel.value = true;
deleteId.value = item.id;
};
const confirmDel = async () => {
try {
await delByPetId(deleteId.value);
await delByPetId({ id : deleteId.value });
console.log('删除成功');
getPetList();
} catch (error) {


+ 72
- 83
otherPages/userManage/pet/petInfo.vue View File

@ -12,16 +12,16 @@
</u-upload>
</view>
</view>
<PetBaseInfo :petType="petType" v-model:petBaseInfo="petBaseInfo" />
<PetHealthInfo :petType="petType" v-model:petHealthInfo="petHealthInfo" />
<view class="personal-pet-info-btns">
<view class="personal-pet-btns">
<view class="personal-pet-btn">
<u-button :disabled="optionType!='edit'" color="#FFF4E4" @click="deletePet">
<u-button :disabled="optionType!='edit'" color="#FFF4E4" @click="cancelPet">
<view style="color: #A9A9A9;">
删除
取消
</view>
</u-button>
</view>
@ -71,21 +71,21 @@
const optionType = ref('add');
const isNewOrder = ref(false);
const delContent = ref('');
const photo = ref('');
const headImage = ref('');
const petBaseInfo = ref({
name: '',
gender: '',
breed: '',
bodyType: '',
birthDate: '',
nickName: '',
sex: '',
type: '',
weight: '',
birthday: '',
personality: ''
});
const petHealthInfo = ref({
vaccineStatus: '',
dewormingStatus: '',
sterilization: '',
vaccine: '',
deworm: '',
neutered: '',
doglicenseStatus: '',
healthStatus: [],
health: '',
remark: ''
});
const showDel = ref(false);
@ -152,41 +152,42 @@
};
const getPetDetailsFunc = (petId) => {
getPetDetails(petId).then((res) => {
if (res && res.id) {
getPetDetails({ id : petId }).then((res) => {
if (res.code == 200) {
const {
photo,
name,
gender,
breed,
bodyType,
birthDate,
headImage,
nickName,
sex,
type,
weight,
birthday,
personality,
vaccineStatus,
dewormingStatus,
sterilization,
vaccine,
deworm,
neutered,
doglicenseStatus,
healthStatus,
health,
remark
} = res;
} = res.data;
petBaseInfo.value = {
name,
gender,
breed,
bodyType,
birthDate,
nickName,
sex,
type,
weight,
birthday,
personality
};
petHealthInfo.value = {
vaccineStatus,
dewormingStatus,
sterilization,
vaccine,
deworm,
neutered,
doglicenseStatus,
healthStatus,
health,
remark
};
fileList.value = [{
url: photo
url: headImage
}];
} else {
uni.showToast({
@ -207,17 +208,17 @@
});
return;
}
photo.value = fileList.value[0].url;
headImage.value = fileList.value[0].url;
let params = {
...{
petType: petType.value,
photo: photo.value
headImage: headImage.value
},
...petBaseInfo.value,
...petHealthInfo.value
};
if (!params.name) {
if (!params.nickName) {
uni.showToast({
title: '请填写宠物昵称!',
duration: 3000,
@ -225,15 +226,15 @@
});
return;
}
// if (!params.breed) {
// uni.showToast({
// title: '!',
// duration: 3000,
// icon: "none"
// });
// return;
// }
if (!params.bodyType) {
if (!params.type) {
uni.showToast({
title: '请输入宠物品种!',
duration: 3000,
icon: "none"
});
return;
}
if (!params.weight) {
uni.showToast({
title: '请选择宠物体重!',
duration: 3000,
@ -241,15 +242,15 @@
});
return;
}
// if (!params.personality) {
// uni.showToast({
// title: '!',
// duration: 3000,
// icon: "none"
// });
// return;
// }
if (!params.vaccineStatus) {
if (!params.personality) {
uni.showToast({
title: '请输入宠物性格!',
duration: 3000,
icon: "none"
});
return;
}
if (!params.vaccine) {
uni.showToast({
title: '请选择宠物疫苗情况!',
duration: 3000,
@ -257,7 +258,7 @@
});
return;
}
if (!params.dewormingStatus) {
if (!params.deworm) {
uni.showToast({
title: '请选择宠物驱虫情况!',
duration: 3000,
@ -265,15 +266,14 @@
});
return;
}
// if (params.healthStatus == null || !params.healthStatus.length) {
// uni.showToast({
// title: '!',
// duration: 3000,
// icon: "none"
// });
// return;
// }
console.log(params)
if (params.health) {
uni.showToast({
title: '请填写宠物健康情况',
duration: 3000,
icon: "none"
});
return;
}
loading.value = true;
if (optionType.value === 'edit') {
params.id = petId.value;
@ -308,7 +308,7 @@
});
} else if (optionType.value === 'add') {
addPet(params).then((res) => {
if (res && res === 1) {
if (res.code == 200) {
uni.showToast({
title: '保存成功',
duration: 3000,
@ -316,16 +316,7 @@
});
setTimeout(() => {
loading.value = false;
if (isNewOrder.value) {
router.push('/pages/newOrder/petList');
} else {
const len = getCurrentPages().length;
if (len >= 2) {
uni.navigateBack();
} else {
router.push('/pages/personalCenter/pet');
}
}
uni.navigateBack();
}, 1000);
} else {
loading.value = false;
@ -339,14 +330,12 @@
}
};
const deletePet = () => {
delContent.value = `确定要删除${petBaseInfo.value.name}?`;
showDel.value = true;
const cancelPet = () => {
uni.navigateBack(-1);
};
const confirmDel = () => {
delByPetId(petId.value).then((res) => {
console.log(res);
uni.showToast({
title: '删除成功',
duration: 3000,


+ 11
- 4
pages/myOrdersManage/components/systemOrder.vue View File

@ -1,11 +1,11 @@
<template>
<up-list @scrolltolower="scrolltolower">
<up-list-item>
<view class="mb28 container-list-item" v-for="(item, index) in 1">
<view class="mb28 container-list-item" v-for="(item, index) in list" :key="item.id">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>{{ orderStatus[item.status] }}</view>
<view>本单酬劳
<text style="color: #FF530A">{{ item.orderAmount }}</text>
<text style="color: #FF530A">{{ item.price }}</text>
</view>
</view>
<view class="container-list">
@ -23,7 +23,7 @@
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button type="primary" v-if="true" :text="btnTexts[current]" @click="toClock" shape="circle"
<up-button type="primary" v-if="true" :text="btnTexts[current]" @click="toClock(item.id)" shape="circle"
class="mr20" color="#FFAA48"></up-button>
<up-button type="primary" text="宠物档案" @click="toPet" shape="circle" class="mr20"
@ -38,9 +38,15 @@
</up-list>
</template>
<script setup>
import { onMounted } from 'vue';
const scrolltolower = () => {
}
onMounted(() => {
console.log(props)
})
const props = defineProps({
list: {
@ -53,6 +59,7 @@
}
});
const btnTexts = ['订单详情', '打卡', '打开记录']
const orderStatus = ['待接单','进行中','已完成']
function toClock(id) {


+ 26
- 14
pages/myOrdersManage/index.vue View File

@ -9,14 +9,14 @@
<up-sticky bgColor="#fff" v-if="activeIndex == 1">
<view class="container-tabs">
<up-tabs :list="tabList1" lineWidth="68rpx" :activeStyle="{
<up-tabs @click="classIfyClickTab" :list="tabList1" lineWidth="68rpx" :activeStyle="{
color: '#FFFFFF',
fontWeight: 'bold',
transform: 'scale(1.05)'
}" :inactiveStyle="{
color: '#FFFFFF',
transform: 'scale(1)'
}" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#FFFFFF" @click="activeIndex1Click"></up-tabs>
}" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#FFFFFF"></up-tabs>
</view>
</up-sticky>
@ -42,6 +42,7 @@
<script setup>
import {
computed,
reactive,
ref
} from "vue";
@ -50,22 +51,31 @@
import {
onShow
} from "@dcloudio/uni-app"
import { getLoginStatus } from "@/utils/useMixin.js"
import {
getLoginStatus
} from "@/utils/useMixin.js"
// import personOrder from "./components/personOrder.vue";
// import lossOrder from "./components/lossOrder.vue";
import {
getAppOrderList,
} from "@/api/order/order.js"
myList
} from "@/api/receivingHall/index.js"
import {
useStore
} from "vuex"
onShow(() => {
if (!getLoginStatus())return;
if (!getLoginStatus()) return;
getList();
})
const current = ref(0)
const activeIndex = ref(1)
const list = ref([])
const store = useStore();
const userInfo = computed(() => {
return store.getters.userInfo;
})
const tabList1 = reactive([{
name: '待服务',
@ -102,19 +112,21 @@
])
function getList() {
getAppOrderList()
myList({
type: current.value,
userId: userInfo.value.userId
})
.then(res => {
if (res.code == 200) {
list.value = res.rows
list.value = res.data
}
})
}
getList()
const activeIndex1Click = (item) => {
const classIfyClickTab = (item) => {
current.value = item.index;
}
getList();
}
</script>
<style scoped lang="scss">


Loading…
Cancel
Save