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 @@
-
+
@@ -13,24 +14,26 @@
-
+
-
+
-
+
-
+
{{item.name}}
@@ -45,7 +48,7 @@
-
-
+
@@ -74,6 +77,28 @@
+
@@ -94,7 +119,7 @@
getLocalHome,
getLocalList
} from '@/api/store.js'
-
+
export default {
mixins: [MescrollMixin],
data() {
@@ -131,7 +156,7 @@
} catch (e) {}
// 选择城市后是否刷新
if (options?.refresh) await this.getHomeFun()
-
+
this.getLocal()
},
onShow(options) {
@@ -145,28 +170,30 @@
methods: {
...mapActions(['initLocationFunc', 'getCartNum']),
...mapMutations(['setCityInfo']),
-
+
handleCancel() {
- this.keyword = '';
- this.mescroll.resetUpScroll()
+ this.keyword = '';
+ this.mescroll.resetUpScroll()
},
-
+
async getLocal() {
- const {data} = await getLocalHome()
+ const {
+ data
+ } = await getLocalHome()
this.navList = [data]
-
- if (this.navList[0].length == 0) {
- this.navSwiperH = 0
+
+ if (this.navList[0].length == 0) {
+ this.navSwiperH = 0
return
}
-
+
if (this.navList[0].length <= 5) {
this.navSwiperH = 200
} else {
this.navSwiperH = 374
}
},
-
+
// 位置
async reLocationFunc() {
await this.initLocationFunc();
@@ -185,9 +212,13 @@
menuJump(item)
},
- upCallback(page) {
+ // 下拉刷新
+ downCallback() {
this.getLocal()
-
+ this.mescroll.resetUpScroll()
+ },
+
+ upCallback(page) {
const pageNum = page.num;
const pageSize = page.size;
if (this.cityInfo && this.cityInfo.gcj02_lng) {
@@ -195,7 +226,7 @@
page_size: pageSize,
page_no: pageNum,
type: 'all',
- c_name: this.cityInfo.name,
+ c_name: this.cityInfo.name,
longitude: this.cityInfo.gcj02_lng ?? 0,
latitude: this.cityInfo.gcj02_lat ?? 0,
keyword: this.keyword
@@ -208,14 +239,31 @@
const hasNext = !!data.more;
this.list = this.list.concat(curPageData);
this.mescroll.endSuccess(curPageLen, hasNext);
+
+ // if (page.num == 1) this.list = [];
+ // const curPageData = data.list;
+ // const curPageLen = curPageData.length;
+ // const hasNext = !!data.more;
+ // this.list = this.list.concat(JSON.parse(JSON.stringify(curPageData)));
+ // this.mescroll.endSuccess(curPageLen, hasNext);
}).catch(() => {
this.mescroll.endErr()
})
}
},
-
+
search() {
+ this.$refs.uWaterfall.clear()
this.mescroll.resetUpScroll()
+ },
+
+ toPage(id) {
+ this.$Router.push({
+ path: '/bundle_b/pages/local_shop/local_shop_detail',
+ query: {
+ id
+ }
+ })
}
},
computed: {
@@ -241,6 +289,14 @@
padding: 0;
}
+ .demo-warter {
+ border-radius: 8px;
+ margin: 5px;
+ background-color: #ffffff;
+ padding: 8px;
+ position: relative;
+ }
+
.index {
min-height: calc(100vh - var(--window-bottom));
@@ -303,24 +359,24 @@
.swiper {
margin: 20rpx 0;
}
-
+
.filter {
display: flex;
align-items: center;
padding: 30rpx;
-
+
.arrow-icon {
transform: scale(0.5);
}
-
+
view {
margin-right: 20rpx;
}
-
+
.mr-0 {
margin-right: 0;
}
-
+
.active {
color: $-color-primary;
}
@@ -334,13 +390,13 @@
align-items: stretch;
margin-top: 20rpx;
padding: 0 20rpx 20rpx 20rpx;
-
+
.list-block {
background-color: #fff;
-
+
.goods-image {
position: relative;
-
+
.goods-distance {
position: absolute;
bottom: 0;
@@ -352,16 +408,17 @@
border-radius: 6rpx;
}
}
+
.shop-name {
padding: 20rpx 0 2rpx 10rpx;
}
}
-
+
.info {
background-color: #fff;
padding: 0 20rpx;
margin-bottom: 20rpx;
-
+
.info-header {
padding: 20rpx 0;
}
@@ -390,7 +447,7 @@
}
}
}
-
+
.search {
color: #fff;
margin-right: 20rpx;