diff --git a/api/address/address.js b/api/address/address.js
index c670e81..80cb0bf 100644
--- a/api/address/address.js
+++ b/api/address/address.js
@@ -47,4 +47,15 @@ export const udpateAddress = (data) => {
method: "post",
data
})
+}
+
+// 地址-地址修改
+export const addressDetail = (data) => {
+ return request({
+ url: '/applet/address/addressDetail/' + data,
+ headers: {
+ isToken: true
+ },
+ method: "get",
+ })
}
\ No newline at end of file
diff --git a/api/date/index.js b/api/date/index.js
index b4e5ae3..a922bb5 100644
--- a/api/date/index.js
+++ b/api/date/index.js
@@ -20,10 +20,11 @@ export function insertOutDate(data) {
}
// 接单地址-不接单日期列表数据查询
-export function outDateList() {
+export function outDateList(params) {
return request({
'url': '/applet/outDate/outDateList',
'method': 'get',
+ params
})
}
diff --git a/api/pet/index.js b/api/pet/index.js
index f9adfa3..2f622e4 100644
--- a/api/pet/index.js
+++ b/api/pet/index.js
@@ -1,13 +1,14 @@
import request from '@/utils/request'
// 查询我的宠物列表
-export function getpetList() {
+export function getpetList(params) {
return request({
headers: {
"isToken": true
},
url: "/applet/pet/list",
- method: 'get'
+ method: 'get',
+ params
})
}
diff --git a/otherPages/authentication/connectAddress/detail.vue b/otherPages/authentication/connectAddress/detail.vue
index a906987..cc60d8d 100644
--- a/otherPages/authentication/connectAddress/detail.vue
+++ b/otherPages/authentication/connectAddress/detail.vue
@@ -30,21 +30,37 @@
{{ !!form.status ? '开启' : '关闭' }}
-
-
+
+
Km
-
+
+
+
+ {{ getDisabledDateDesc(eidtItem.appletOutDate) }}
+
+
+
+ 暂无不可接单日期
+
+ >
+
-
+
{
+ return store.getters.userInfo;
+ })
+
const rules = ref({})
const eidtItem = ref(null);
+ const addressId = ref(0)
onLoad((options) => {
- eidtItem.value = options?.item ? JSON.parse(options.item) : null;
- form.value = {
- id: eidtItem?.value?.id || null,
- area: eidtItem?.value?.area || null,
- address: eidtItem?.value?.address || null,
- status: eidtItem?.value?.status == 'true' || null,
- latitude: eidtItem?.value?.latitude || null,
- longitude: eidtItem?.value?.longitude || null
- }
+ addressId.value = options.addressId
+
+ // eidtItem.value = options?.item ? JSON.parse(options.item) : null;
+ // form.value = {
+ // id: eidtItem?.value?.id || null,
+ // area: eidtItem?.value?.area || null,
+ // address: eidtItem?.value?.address || null,
+ // status: eidtItem?.value?.status == 'true' || null,
+ // latitude: eidtItem?.value?.latitude || null,
+ // longitude: eidtItem?.value?.longitude || null
+ // }
});
+ onShow(() => {
+ getDetail()
+ })
const setAddress = (res) => {
form.value.latitude = res.latitude
@@ -136,13 +167,15 @@
let code = null;
if (eidtItem?.value?.id) {
let result = await udpateAddress({
- ...form.value
+ ...form.value,
+ userId : userInfo.value.userId,
})
code = result.code
} else {
// 新增地址
let result = await insertAddress({
- ...form.value
+ ...form.value,
+ userId : userInfo.value.userId,
})
code = result.code
}
@@ -150,6 +183,30 @@
uni.navigateBack()
}
}
+
+ function getDetail(){
+ addressDetail(addressId.value).
+ then(res => {
+ console.log(res.data);
+ eidtItem.value = res.data
+ form.value = {
+ id: eidtItem?.value?.id || null,
+ area: eidtItem?.value?.area || null,
+ address: eidtItem?.value?.address || null,
+ status: eidtItem?.value?.status == 'true' || null,
+ latitude: eidtItem?.value?.latitude || null,
+ longitude: eidtItem?.value?.longitude || null
+ }
+ })
+ }
+
+ const getDisabledDateDesc = (dateArr) => {
+ if (!dateArr?.length) {
+ return '暂无不可接单日期'
+ }
+
+ return dateArr.map(date => dayjs(date.date).format('MM-DD')).join('、')
+ }
const toNoOrderDate = () => {
if (eidtItem?.value?.id) {
@@ -191,4 +248,11 @@
color: #707070;
}
}
+ .text-ellipsis {
+ text-align: right;
+ overflow: hidden; //超出的文本隐藏
+ text-overflow: ellipsis; //溢出用省略号显示
+ white-space: nowrap; //溢出不换行
+ width: 330rpx;
+ }
\ No newline at end of file
diff --git a/otherPages/authentication/connectAddress/index.vue b/otherPages/authentication/connectAddress/index.vue
index 9cbdd2f..1f2af55 100644
--- a/otherPages/authentication/connectAddress/index.vue
+++ b/otherPages/authentication/connectAddress/index.vue
@@ -16,8 +16,8 @@
{{ item.area }}
-
- {{ `接单范围:${item.searchValue}km` }}
+
+ {{ `接单范围:${item.rangeNo}km` }}
接单范围:未设置
@@ -31,11 +31,11 @@
-
- {{ `共${item.disabledDate?.length}天:` }}
+
+ {{ `共${item.appletOutDate?.length}天:` }}
- {{ getDisabledDateDesc(item.disabledDate) }}
+ {{ getDisabledDateDesc(item.appletOutDate) }}
@@ -112,6 +112,9 @@
const configList = computed(() => {
return store.getters.configList
})
+ const userInfo = computed(() => {
+ return store.getters.userInfo;
+ })
const list = ref([])
const modal = ref(null)
@@ -119,7 +122,9 @@
const fetchAddressList = async () => {
try {
- let response = await getAddressList();
+ let response = await getAddressList({
+ userId : userInfo.value.userId
+ });
list.value = response.data || []
} catch (err) {
@@ -144,13 +149,13 @@
return '暂无不可接单日期'
}
- return dateArr.map(date => dayjs(date).format('MM-DD')).join('、')
+ return dateArr.map(date => dayjs(date.date).format('MM-DD')).join('、')
}
const toAdd = (item) => {
if (item) {
uni.navigateTo({
- url: `/otherPages/authentication/connectAddress/detail?item=${JSON.stringify(item)}`
+ url: `/otherPages/authentication/connectAddress/detail?addressId=${item.id}`
})
} else {
uni.navigateTo({
diff --git a/otherPages/authentication/serve/index.vue b/otherPages/authentication/serve/index.vue
index 1b69a5a..4d1f6a7 100644
--- a/otherPages/authentication/serve/index.vue
+++ b/otherPages/authentication/serve/index.vue
@@ -24,7 +24,27 @@
-
+
+ 昵称
+
+
+
+
+
+
+ 手机号
+
+ {{baseInfo.info.userTelephone || ''}}
+
+
+
+
+ 性别
+
+ {{form.gender || '请选择'}}
+
+
+
@@ -34,6 +54,28 @@
(重要)
+
+ 个人简介
+
+
+
+
+
+
+ 养宠经验
+
+
+ 年
+
+
+
+
+ 服务记录
+
+ {{ `${serviceCount}条` }}
+
+
+
@@ -42,6 +84,28 @@
服务资料
+
+ 服务宠物类型
+
+ {{ typeDesc }}
+
+
+
+
+
+ 基础服务
+
+ 宠物喂养 上门遛狗
+
+
+
+
+ 增值服务
+
+ {{ serveDesc }}
+
+
+
@@ -88,6 +152,10 @@
const form = reactive({
headImage: null,
+ nickname: '',
+ gender: '',
+ introduction: '',
+ petExperience: '',
type: [],
serve: [],
})
@@ -105,84 +173,6 @@
const displayInfoRef = ref(null)
const serveInfoRef = ref(null)
- const state = reactive({
- baseInfoList: [{
- type: "input",
- label: "昵称",
- key: "userName",
- placeholder: "请输入",
- },
- {
- type: "input",
- label: "手机号",
- key: "userTelephone",
- placeholder: "请输入",
- },
- {
- type: "select",
- label: "性别",
- key: "sex",
- placeholder: "请选择",
- options: [
- {
- name: "男",
- value : '男',
- },
- {
- name: "女",
- value : '男',
- }
- ]
- }
- ],
- displayInfoList: [{
- type: "input",
- label: "个人简介",
- key: "jianjie",
- placeholder: "请输入",
- },
- {
- type: "input",
- label: "养宠经验",
- unit: "年",
- key: "jingyan",
- placeholder: "请输入",
- },
- {
- type: "custom",
- label: "服务记录",
- key: "jilu",
- placeholder: "请选择",
- options: [{
- name: "男"
- },
- {
- name: "女"
- }
- ]
- }
- ],
- serveInfoList: [{
- type: "custom",
- label: "服务宠物类型",
- key: "type",
- placeholder: "请选择",
- },
- {
- type: "input",
- label: "基础服务",
- key: "base",
- placeholder: "宠物喂养上门遛狗",
- },
- {
- type: "custom",
- label: "增值服务",
- key: "zenz",
- placeholder: "请选择",
- }
- ],
- })
-
const jumpToServeRecord = () => {
uni.navigateTo({
url: "/otherPages/authentication/serve/record"
@@ -246,7 +236,42 @@
})
}
+ const genderOptions = [
+ { text: '男', value: '男' },
+ { text: '女', value: '女' }
+ ]
+
+ const openGenderSelect = () => {
+ uni.showActionSheet({
+ itemList: genderOptions.map(item => item.text),
+ success: function (res) {
+ form.gender = genderOptions[res.tapIndex].value
+ fetchUpdate()
+ }
+ })
+ }
+
+ const fetchUpdate = () => {
+ // 这里可以添加更新数据的逻辑
+ console.log('更新数据', form)
+ }
+
function submit(){
+ // 表单验证
+ if (!form.nickname) {
+ uni.showToast({
+ title: '请输入昵称',
+ icon: 'none'
+ })
+ return
+ }
+
+ // 提交表单数据
+ console.log('提交表单数据', form)
+ uni.showToast({
+ title: '保存成功',
+ icon: 'success'
+ })
}
onShow(() => {
@@ -258,8 +283,11 @@
onMounted(()=> {
// todo: fetch data and init data
-
- serveInfoRef.value.setDataByKey('base', configList.value.pet_basic_services.paramValueText)
+ // 初始化表单数据
+ if (baseInfo.value && baseInfo.value.info) {
+ form.nickname = baseInfo.value.info.userName || ''
+ form.gender = baseInfo.value.info.gender || ''
+ }
})
@@ -280,9 +308,26 @@
align-items: center;
}
+ .flex-rowb {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 20rpx 0;
+ }
+
.ml10 {
margin-left: 10rpx;
}
+
+ .input-right {
+ text-align: right;
+ }
+
+ .textarea-full {
+ width: 100%;
+ min-height: 120rpx;
+ text-align: right;
+ }
}
.page {
diff --git a/otherPages/myOrdersManage/date/detail.vue b/otherPages/myOrdersManage/date/detail.vue
index 5657cf5..64b333e 100644
--- a/otherPages/myOrdersManage/date/detail.vue
+++ b/otherPages/myOrdersManage/date/detail.vue
@@ -21,7 +21,7 @@
共不接单时间
-
+
修改
@@ -46,8 +46,19 @@
-
+
+
+
+
+