From 2aae9027a0ff03bf81039d050032bb0bdf7b190d Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Wed, 9 Oct 2024 17:34:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8F=90=E7=82=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=B5=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/local_store.js | 4 + bundle_b/pages/local_map/index.vue | 102 +++++++++++--- bundle_b/pages/local_shop/local_pay.vue | 29 ++-- .../components/order-list.vue | 9 ++ pages/local_life/local_life.vue | 129 +++++++++++++----- 5 files changed, 207 insertions(+), 66 deletions(-) diff --git a/api/local_store.js b/api/local_store.js index 38cc918..eaa6d56 100644 --- a/api/local_store.js +++ b/api/local_store.js @@ -8,6 +8,10 @@ export function addPostStation(data) { return request.post("LocalStore/addPostStation", data); } +export function editPostStationPhone(data) { + return request.post("LocalStore/editPostStationPhone", data); +} + export function delPostStation(data) { return request.post("LocalStore/delPostStation", data); } diff --git a/bundle_b/pages/local_map/index.vue b/bundle_b/pages/local_map/index.vue index 4592f50..435a8b5 100644 --- a/bundle_b/pages/local_map/index.vue +++ b/bundle_b/pages/local_map/index.vue @@ -14,12 +14,20 @@ - + {{area || '选择'}} - + + + + + + 电话 + + + @@ -32,13 +40,28 @@ 自提点列表 + class="m-b-20"> - {{item.province}} {{item.city}} {{item.area}} {{item.address}} + {{item.province}} {{item.city}} {{item.area}} {{item.address}} - - 删除 + + + {{item.phone}} + + + + + + 删除 + + + + + + 编辑电话 + + @@ -46,6 +69,17 @@ + + + 修改电话 +
+ + + + +
+
+
@@ -63,21 +97,13 @@ getPostStationList, getLocation, addPostStation, + editPostStationPhone, delPostStation } from '@/api/local_store.js' export default { data() { return { - // poiList: [{ - // id: 1, - // latitude: 0, - // longitude: 0, - // iconPath: '/bundle_b/static/mark.png', - // width: 40, - // height: 40, - // alpha: 1 - // }], poiList: [], lat: 0, lng: 0, @@ -92,7 +118,12 @@ lstore_id: 0, location: [], info: [], - postStationList: [] + postStationList: [], + phone: '', + showEdit: false, + editId: 0, + editPhone: '', + editIndex: 0 } }, onLoad(e) { @@ -167,13 +198,18 @@ if (!this.address) return this.$toast({ title: "请输入地址" }) + + if (!this.phone) return this.$toast({ + title: "请输入自提点联系电话" + }) const address = `${this.province}${this.city}${this.area}${this.address}` const { code, data } = await getLocation({ - address + address, + phone: this.phone }) if (code == 1) { @@ -240,9 +276,35 @@ }) } }) - } }); + }, + + editItem(index, id) { + this.editIndex = index + this.editId = id + this.showEdit = true + this.editPhone = this.postStationList[index].phone + }, + + changeNameConfirm(e) { + if (!e.detail.value.editPhone) return this.$toast({ + title: '请输入联系电话' + }) + + const phone = e.detail.value.editPhone + editPostStationPhone({ + id: this.editId, + phone + }).then((res) => { + if (res.code == 1) { + this.$toast({ + title: '修改成功' + }) + this.postStationList[this.editIndex].phone = phone + this.editPhone = phone + } + }) } }, computed: { @@ -299,8 +361,4 @@ border-radius: 50%; box-shadow: 8rpx 8rpx 28rpx rgba(0, 0, 0, 0.4); } - - .del { - text-decoration: underline; - } \ No newline at end of file diff --git a/bundle_b/pages/local_shop/local_pay.vue b/bundle_b/pages/local_shop/local_pay.vue index ddf9204..9a761c7 100644 --- a/bundle_b/pages/local_shop/local_pay.vue +++ b/bundle_b/pages/local_shop/local_pay.vue @@ -10,7 +10,8 @@ ¥ + placeholder-style="font-size:28rpx;color: #6c757d;font-weight:normal;" + style="height: 120rpx;">
@@ -121,7 +122,13 @@ @click="changePostStation(index)"> - {{item.province}} {{item.city}} {{item.area}} {{item.address}} + + {{item.province}} {{item.city}} {{item.area}} {{item.address}} + + + + {{item.phone}} + @@ -309,7 +316,7 @@ if (this.goods_id && !this.post_station_id) return this.$toast({ title: "请选择自提点" }) - + if (this.goods_id && !this.post_station_time) return this.$toast({ title: "请选择自提时间" }) @@ -499,20 +506,26 @@ yesterday.setDate(today.getDate() - 1); const year = yesterday.getFullYear() const date1 = yesterday.toISOString().split('T')[0] - + const date2 = `${year}-${e.month}-${e.day}` - + const yeateray = new Date(date1).getTime(); // 使用一个固定的年份 const chooseday = new Date(date2).getTime(); // 使用一个固定的年份 - + if (chooseday <= yeateray) { return this.$toast({ title: '所选日期不能小于今日日期' }) - } - + } + this.post_station_time_text = `${e.month}月${e.day}日` this.post_station_time = `${e.month}-${e.day}` + }, + + call(phone) { + uni.makePhoneCall({ + phoneNumber: phone + }); } } } diff --git a/bundle_b/pages/local_shop_order/components/order-list.vue b/bundle_b/pages/local_shop_order/components/order-list.vue index 0d07406..106339a 100644 --- a/bundle_b/pages/local_shop_order/components/order-list.vue +++ b/bundle_b/pages/local_shop_order/components/order-list.vue @@ -44,6 +44,9 @@ + + 自提点联系电话: {{item.post_station.phone}} + 自提时间: {{item.post_station_time}} @@ -272,6 +275,12 @@ this.ercodeUrl = data.url this.showPopup = true } + }, + + call(phone) { + uni.makePhoneCall({ + phoneNumber: phone + }); } }, computed: { diff --git a/pages/local_life/local_life.vue b/pages/local_life/local_life.vue index 5cb6c9a..3143fbb 100644 --- a/pages/local_life/local_life.vue +++ b/pages/local_life/local_life.vue @@ -1,5 +1,6 @@