feat:商城收获地址

This commit is contained in:
dzc committed 2026-06-08 12:41:09 +08:00
1 parent 0733ab54db
commit d904d27b67
10 files changed
+249 -21

No files matched your search

+4 -4
View File
@@ -18,11 +18,11 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
# 是否开启websocket 消息接受,
VITE_WEBSOCKET_ENABLE = true
# --------------------------- start 开发环境 start ----------------------------------
VITE_APP_DEV_SERVICE = https://www.zianxin.com/api
# VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc
# VITE_APP_DEV_SERVICE = https://www.zianxin.com/api
VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc
VITE_IMAGE_DEV_PATH = https://www.zianxin.com/api
# VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc
# VITE_IMAGE_DEV_PATH = https://www.zianxin.com/api
VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc
# ----------------------------- end 开发环境 end ------------------------------------
# --------------------------- start 生产环境 start ----------------------------------
+14 -1
View File
@@ -23,7 +23,8 @@
"modules" : {
"Push" : {},
"Payment" : {},
"OAuth" : {}
"OAuth" : {},
"Maps" : {}
},
/* 应用发布信息 */
"distribute" : {
@@ -109,6 +110,11 @@
"appid" : "wx9f2c53067b4520a4",
"UniversalLinks" : "https://static-mp-5da4bdfd-05f7-4908-a555-711be4dd5835.next.bspapp.com/uni-universallinks/__UNI__1BFE88F/"
}
},
"maps" : {
"tencent" : {
"key" : "WOCBZ-2TFCI-CEOGX-UXQGP-YF7RO-QMB5Z"
}
}
},
"icons" : {
@@ -176,6 +182,13 @@
"h5" : {
"uniStatistics" : {
"enable" : true
},
"sdkConfigs" : {
"maps" : {
"tencent" : {
"key" : "WOCBZ-2TFCI-CEOGX-UXQGP-YF7RO-QMB5Z"
}
}
}
},
"uniStatistics" : {
+7
View File
@@ -51,6 +51,13 @@
"disableScroll": true
}
},
{
"path": "pages/user/map-address/index",
"style": {
"navigationBarTitleText": "我的地址",
"disableScroll": true
}
},
{
"path": "pages/tabbar/find",
"style": {
@@ -0,0 +1,41 @@
<template>
<cover-view class="map-address-tag flex flex-wrap">
<cover-view v-for="(v, i) in mapAddressTag" :key="i"
class="map-address-tag__item sub-text-20 px-28rpx py-8rpx rounded-8rpx"
:class="{ 'map-address-tag__item--active': modelValue === v }" @tap="handleSelect(v)">
{{ v }}
</cover-view>
</cover-view>
</template>
<script setup lang="ts">
import { serviceEnum } from "@@/constant/index"
const { mapAddressTag } = serviceEnum
const modelValue = defineModel<string | undefined>("modelValue", { default: undefined })
const handleSelect = (value: string) => {
modelValue.value = modelValue.value === value ? undefined : value
}
</script>
<style scoped lang="scss">
.map-address-tag {
margin-right: -16rpx;
margin-bottom: -16rpx;
}
.map-address-tag__item {
background: #fafafa;
border: 2rpx solid transparent;
color: #666666;
margin-right: 16rpx;
margin-bottom: 16rpx;
}
.map-address-tag__item--active {
background: rgba(0, 148, 255, 0.08);
border-color: #0094ff;
color: #0094ff;
}
</style>
+129
View File
@@ -0,0 +1,129 @@
<template>
<crud-layout tabBarType="just-flot-back" mainNoPadding title="我的地址" mainIsScroll bg="/static/page/blue-bg.png">
<map :latitude="position.latitude" :longitude="position.longitude" style="width: 100%; height: 100%;" />
<view class="absolute bottom-[-28rpx] left-0 right-0 bg-#f8f8f8 rounded-t-14rpx">
<cover-view class="address mx-30rpx relative top-[-56rpx]">
<cover-view class="address-item select">
<cover-view class="address-item_label">地址</cover-view>
<cover-view class="flex-1">
<cover-view class="flex items-center justify-between">
<cover-view class="sub-text-30">选择收货地址</cover-view>
<cover-view class="iconfont icon-youjiantou pr-24rpx font-size-26rpx! color-#656565" />
</cover-view>
</cover-view>
</cover-view>
<cover-view class="address-item">
<cover-view class="address-item_label">门牌号</cover-view>
<cover-view class="address-item_input">
<tm-input class="w-full" type="number" showClear color="transparent" inputPadding="0"
inputStyle="border: none; font-size: 26rpx;" fontSize="26rpx" :focus-highlight="false"
placeholder="输入楼栋、楼层、门牌号,例A座101" focusFontColor="#333333" fontColor="#333333" />
</cover-view>
</cover-view>
<cover-view class="address-item">
<cover-view class="address-item_label">联系人</cover-view>
<cover-view class="address-item_input">
<tm-input class="w-full" type="number" showClear color="transparent" inputPadding="0"
inputStyle="border: none; font-size: 26rpx;" fontSize="26rpx" :focus-highlight="false"
placeholder="输入收获人姓名" focusFontColor="#333333" fontColor="#333333" />
</cover-view>
</cover-view>
<cover-view class="address-item">
<cover-view class="address-item_label">手机号</cover-view>
<cover-view class="address-item_input">
<tm-input class="w-full" type="number" showClear color="transparent" inputPadding="0"
inputStyle="border: none; font-size: 26rpx;" fontSize="26rpx" :focus-highlight="false"
placeholder="输入收获人手机号" focusFontColor="#333333" fontColor="#333333" />
</cover-view>
</cover-view>
<cover-view class="address-item">
<cover-view class="address-item_label">标签</cover-view>
<cover-view class="address-item_input">
<map-address-tag v-model="state.tag" />
</cover-view>
</cover-view>
</cover-view>
</view>
<template #main-bottom>
<cover-view class="flex justify-between items-center gap-16rpx px-26rpx py-24rpx">
<cover-view v-if="pageStatus === 'edit'" class="px-36rpx py-20rpx rounded-full border border-gray">
删除地址
</cover-view>
<cover-view v-if="isValidate"
class="flex-1 px-36rpx py-20rpx main-text-28 text-center text-center color-white bg-blue! rounded-full">
保存地址
</cover-view>
<cover-view v-else
class="flex-1 px-36rpx py-20rpx main-text-28 text-center color-#7f7f7f! bg-#f7f7f7 rounded-full">
保存地址
</cover-view>
</cover-view>
</template>
</crud-layout>
</template>
<script setup lang="ts">
import { reactive, ref, onMounted, computed } from "vue"
import { onShow, onLoad } from "@dcloudio/uni-app"
import MapAddressTag from "./components/map-address-tag.vue"
import { serviceEnum } from "@@/constant/index"
const { mapAddressTag } = serviceEnum
const pageStatus = ref<'edit' | 'add'>("add")
const isValidate = ref(false)
const position = ref<any>({
latitude: 39.909,
longitude: 116.39742,
})
const state = reactive({
tag: ''
})
onLoad((options: any) => {
if (options.status) {
pageStatus.value = options.status
}
})
onShow(async () => {
})
</script>
<style scoped lang="scss">
.address {
background: white;
border-radius: 14rpx;
padding: 16rpx 14rpx;
.select {
background: rgba(255, 255, 255, 0.72);
border-radius: 14rpx;
backdrop-filter: blur(8rpx);
}
&-item {
display: flex;
align-items: center;
&_label {
width: 120rpx;
padding: 40rpx 18rpx;
font-size: 26rpx;
text-align: left;
}
&_input {
flex: 1;
}
&:not(:last-child) {
border-bottom: 1px solid #fafafa;
}
}
}
</style>
+1
View File
@@ -10,6 +10,7 @@ export { default as canteenDeliveryApi } from "./canteen-delivery"
export { default as faceApi } from "./face"
export { default as foodApi } from "./food"
export { default as integralApi } from "./integral"
export { default as mapAddressApi } from "./map-address"
export { default as merchantApi } from "./merchant"
export { default as orderApi } from "./order"
export { default as orderingFoodApi } from "./ordering-food"
+32
View File
@@ -0,0 +1,32 @@
import request from "@/sheep/utils/request"
export default {
// app分页查询
getOrCreate: (params: any) =>
request({
url: "/hard/hard-user-map-address/app/page",
method: "GET",
params,
}),
// app新增地址
create: (data: any) =>
request({
url: "/hard/hard-user-map-address/app/create",
method: "POST",
data,
}),
// app修改地址
update: (data: any) =>
request({
url: "/hard/hard-user-map-address/app/edit",
method: "POST",
data,
}),
// app删除地址
delete: (data: any) =>
request({
url: "/hard/hard-user-map-address/app/del",
method: "DELETE",
data,
}),
}
@@ -104,10 +104,7 @@ function initBackStyle() {
<template>
<view class="layout">
<!-- 外送 WS 顶部通知(商户/骑手):App.vue 叠不住业务页,须挂在布局层 -->
<view
v-if="riderPushVisible"
class="rider-push-wrap"
:style="{ top: riderPushTopPx + 'px' }">
<view v-if="riderPushVisible" class="rider-push-wrap" :style="{ top: riderPushTopPx + 'px' }">
<view class="rider-push-card" @tap="riderPushStore.goDetail">
<view class="rider-push-head">
<text class="rider-push-label">外送通知</text>
@@ -129,7 +126,8 @@ function initBackStyle() {
</view>
<view class="rider-push-foot">
<text class="rider-push-hint">点击查看详情 · {{ riderPushRemain }}s 后关闭</text>
<text v-if="riderPushPending > 0" class="rider-push-queue">还有 {{ riderPushPending }} 条,本条关闭后继续提示</text>
<text v-if="riderPushPending > 0" class="rider-push-queue">还有 {{ riderPushPending }}
条,本条关闭后继续提示</text>
</view>
</view>
</view>
@@ -137,7 +135,8 @@ function initBackStyle() {
<image class="layout_bg" v-if="props.bg" :src="props.bg" mode="aspectFill" />
<view class="layout_header">
<base-safe-height :bgColor="props.navBgColor" v-if="state.visble.topSafe" type="top" />
<base-nav v-if="state.visble.topNav" :titleColor="props.navBgTitleColor" :titleFontWeight="props.navTitleFontWeight" :bgColor="props.navBgColor"
<base-nav v-if="state.visble.topNav" :titleColor="props.navBgTitleColor"
:titleFontWeight="props.navTitleFontWeight" :bgColor="props.navBgColor"
:title="props.title || defaultPage()" :rightIcon="props.navRightIcon"
@rightClick="emit('navRightClick')" />
<base-just-flot-nav :bgColor="props.navBgColor" :titleColor="props.navBgTitleColor"
@@ -147,12 +146,8 @@ function initBackStyle() {
<view class="layout_main_top">
<slot name="main-top"></slot>
</view>
<scroll-view
:scroll-y="mainIsScroll"
:class="{ 'layout_main_scroll--flush': props.mainNoPadding }"
@scroll="scroll"
@scrolltolower="emit('scrolltolower')"
:lower-threshold="100">
<scroll-view :scroll-y="mainIsScroll" :class="{ 'layout_main_scroll--flush': props.mainNoPadding }"
@scroll="scroll" @scrolltolower="emit('scrolltolower')" :lower-threshold="100">
<slot></slot>
</scroll-view>
<view class="layout_main_bottom">
@@ -204,8 +199,7 @@ page {
flex-direction: column;
z-index: 99;
&_top {
}
&_top {}
scroll-view {
flex: 1;
@@ -223,8 +217,7 @@ page {
}
}
&_foot {
}
&_foot {}
}
.rider-push-wrap {
@@ -242,6 +235,7 @@ page {
opacity: 0;
transform: translateY(-24rpx);
}
to {
opacity: 1;
transform: translateY(0);
+8
View File
@@ -80,6 +80,13 @@ const appPlusPlatformTypeEnum = {
"20": "支付宝",
}
const mapAddressTag = {
"10": "家",
"20": "公司",
"30": "学校",
"40": "父母家",
}
export default {
hardwareOrderStatusEnum,
hardwareOrderTypeEnum,
@@ -93,4 +100,5 @@ export default {
thirdPayOrderStatusEnum,
thirdPayOrderBizTypeEnum,
appPlusPlatformTypeEnum,
mapAddressTag,
}
+3
View File
@@ -30,6 +30,9 @@ export default {
yellow: {
DEFAULT: "#F2A817",
},
gray: {
DEFAULT: "#eaeaea",
},
},
},
rules: [