王文杰 8 months ago
parent 74a75e5c21
commit ff8b5c137a

3974
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -12,6 +12,12 @@
}
},
"pages": [
{
"path": "pages/booking/booking",
"style": {
"navigationBarTitleText": "一键预约",
}
},
//pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
@ -33,12 +39,7 @@
"navigationBarTitleText": "服务站详情"
}
},
{
"path": "pages/booking/booking",
"style": {
"navigationBarTitleText": "一键预约"
}
},
{
"path": "pages/category/category",
"style": {
@ -93,7 +94,7 @@
// TabBar
"tabBar": {
"color": "#333",
"selectedColor": "#27ba9b",
"selectedColor": "#3775F6",
"backgroundColor": "#fff",
"borderStyle": "white",
"list": [

@ -1,7 +1,8 @@
<script setup lang="ts">
import { ref } from 'vue'
import { computed, ref } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import TimePopup from './components/timePopup.vue'
import AddressPopup from './components/addressPopup.vue'
const activeMenuKey = ref(0)
const activeWeightKey = ref(0)
@ -12,9 +13,12 @@ const latitude = ref(0)
//
const timeChildPopup = ref<UniHelper.UniPopupInstance>()
const addressPopup = ref<UniHelper.UniPopupInstance>()
const addressChildPopup = ref<UniHelper.UniPopupInstance>()
const addressLabel = ref('取件地址')
const timdeLabel = ref('取件时间')
//
const leiList = [
{
@ -144,7 +148,14 @@ const openTimePop = () => {
timeChildPopup.value?.show?.()
}
const openAdressPop = () => {
addressPopup.value?.open?.()
addressChildPopup.value?.show?.()
}
const handleTimePopChange = (val) => {
timdeLabel.value ='取件时间: ' + val
}
const handleAddressPopChange = (e) => {
debugger
}
</script>
<template>
@ -174,8 +185,14 @@ const openAdressPop = () => {
<view class="module info">
<view class="module-title">取件信息</view>
<view class="list">
<button hover-class="none" class="item arrow" @click="openTimePop"></button>
<button hover-class="none" class="item arrow" @click="openAdressPop"></button>
<u-cell
size="large"
title="单元格"
value="内容"
isLink
></u-cell>
<button hover-class="none" class="item arrow" @click="openTimePop">{{timdeLabel}}</button>
<button hover-class="none" class="item arrow" @click="openAdressPop">{{addressLabel}}</button>
</view>
<view class="weight">
<view class="weight-title"
@ -193,23 +210,9 @@ const openAdressPop = () => {
</view>
</view>
</view>
<time-popup ref="timeChildPopup" />
<!-- <uni-popup ref="timePopup" type="bottom" background-color="#fff">
<view class="popup-root">
<view class="title">
<view class="text">订单详情</view>
<view class="close" @click="handleDetailPopupClose">X</view>
</view>
</view>
</uni-popup> -->
<uni-popup ref="addressPopup" type="bottom" background-color="#fff">
<view class="popup-root">
<view class="title">
<view class="text">订单详情</view>
<view class="close" @click="handleDetailPopupClose">X</view>
</view>
</view>
</uni-popup>
<time-popup ref="timeChildPopup" @change="handleTimePopChange" />
<address-popup ref="addressChildPopup" @change="handleAddressPopChange" />
<view class="submit" @click="handleToto"></view>
<!-- 底部占位空盒子 -->
<view class="toolbar-height" safe-area-inset-bottom></view>

@ -0,0 +1,228 @@
<script setup lang="ts">
import { ref, reactive } from 'vue'
const addressPopup2 = ref<UniHelper.UniPopupInstance>()
//
const addressList = ref<AddressItem[]>([])
const getMemberAddressData = async () => {
const res = await new Promise((resolve, reject) => {
setTimeout(() => {
const dataList = [
{
'id': '1764537730823360514',
'receiver': '656',
'contact': '1',
'provinceCode': '120000',
'cityCode': '120100',
'countyCode': '120101',
'address': '22',
'isDefault': 1,
'fullLocation': '天津市 天津市 和平区',
'postalCode': null,
'addressTags': null
},
]
resolve(dataList)
}, 1000);
})
addressList.value = res
}
const show = ()=> {
addressPopup2.value?.open?.()
getMemberAddressData()
}
const hide = ()=> {
addressPopup2.value?.close?.()
}
const handleDayChange = (e) => {
const idx = e.target.dataset.val
activeDayIndex.value = idx
}
const handleTimeChange = (e) => {
const idx = e.target.dataset.val
activeTimeIndex.value = idx
}
//
defineExpose({
show
})
</script>
<template>
<uni-popup class="time-popup" :is-mask-click="false" ref="addressPopup2" type="bottom" background-color="#fff">
<view class="popup-root">
<view class="title">
<view class="text">取件地址</view>
<view class="close" @click="hide">X</view>
</view>
<!-- 地址列表 -->
<scroll-view enable-back-to-top class="scroll-view" scroll-y>
<view v-if="addressList.length" class="address">
<uni-swipe-action class="address-list">
<!-- 收货地址项 -->
<uni-swipe-action-item class="item" v-for="item in addressList" :key="item.id">
<view class="item-content" @tap="onChangeAddress(item)">
<view class="user">
{{ item.receiver }}
<text class="contact">{{ item.contact }}</text>
<text v-if="item.isDefault" class="badge"></text>
</view>
<view class="locate">{{ item.fullLocation }} {{ item.address }}</view>
<!-- H5 端需添加 .prevent 阻止链接的默认行为 -->
<navigator
class="edit"
hover-class="none"
:url="`/pagesMember/address-form/address-form?id=${item.id}`"
@tap.stop="() => {}"
@tap.prevent="() => {}"
>
修改
</navigator>
</view>
<!-- 右侧插槽 -->
<template #right>
<button @tap="onDeleteAddress(item.id)" class="delete-button">删除</button>
</template>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view v-else class="blank">暂无收货地址</view>
</scroll-view>
<!-- 添加按钮 -->
<view class="add-btn">
<navigator hover-class="none" url="/pagesMember/address-form/address-form">
新建地址
</navigator>
</view>
</view>
</uni-popup>
</template>
<style lang="scss">
.time-popup {
padding: 0 30rpx;
border-radius: 10rpx 10rpx 0 0;
position: relative;
background-color: #fff;
.title {
line-height: 1;
padding: 40rpx 20rpx;
font-size: 32rpx;
font-weight: normal;
border-bottom: 1rpx solid #ddd;
color: #444;
.close {
position: absolute;
right: 24rpx;
top: 40rpx;
}
}
page {
height: 100%;
overflow: hidden;
}
/* 删除按钮 */
.delete-button {
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 100%;
font-size: 28rpx;
color: #fff;
border-radius: 0;
padding: 0;
background-color: #cf4444;
}
.viewport {
display: flex;
flex-direction: column;
height: 100%;
background-color: #f4f4f4;
.scroll-view {
padding-top: 20rpx;
}
}
.address {
padding: 0 20rpx;
margin: 0 20rpx;
border-radius: 10rpx;
background-color: #fff;
.item-content {
line-height: 1;
padding: 40rpx 10rpx 38rpx;
border-bottom: 1rpx solid #ddd;
position: relative;
.edit {
position: absolute;
top: 36rpx;
right: 30rpx;
padding: 2rpx 0 2rpx 20rpx;
border-left: 1rpx solid #666;
font-size: 26rpx;
color: #666;
line-height: 1;
}
}
.item:last-child .item-content {
border: none;
}
.user {
font-size: 28rpx;
margin-bottom: 20rpx;
color: #333;
.contact {
color: #666;
}
.badge {
display: inline-block;
padding: 4rpx 10rpx 2rpx 14rpx;
margin: 2rpx 0 0 10rpx;
font-size: 26rpx;
color: #27ba9b;
border-radius: 6rpx;
border: 1rpx solid #27ba9b;
}
}
.locate {
line-height: 1.6;
font-size: 26rpx;
color: #333;
}
}
.blank {
margin-top: 300rpx;
text-align: center;
font-size: 32rpx;
color: #888;
}
.add-btn {
height: 80rpx;
text-align: center;
line-height: 80rpx;
margin: 30rpx 20rpx;
color: #fff;
border-radius: 80rpx;
font-size: 30rpx;
background-color: #27ba9b;
}
}
</style>

@ -4,45 +4,64 @@ const timePopup2 = ref<UniHelper.UniPopupInstance>()
const activeDayIndex = ref(0)
const activeTimeIndex = ref(0)
//
const emit = defineEmits(['change'])
const dayList = reactive([
{
label: '今天',
val: "today"
val: "today",
active: false
},
{
label: '明天',
val: 'tommrow'
val: 'tommrow',
active: false
}
])
const timeList = reactive([
{
id: 1,
label: '09:00-11:00',
val: '09:00-11:00'
val: '09:00-11:00',
active: false
},
{
id: 2,
label: '11:00-13:00',
val: '11:00-13:00'
val: '11:00-13:00',
active: false
},
{
id: 3,
label: '13:00-15:00',
val: '13:00-15:00'
val: '13:00-15:00',
active: false
},
{
id: 4,
label: '15:00-17:00',
val: '15:00-17:00'
val: '15:00-17:00',
active: false
},
{
id: 5,
label: '17:00-19:00',
val: '17:00-19:00'
val: '17:00-19:00',
active: false
}
])
const show = ()=> {
timePopup2.value?.open?.()
}
const hide = ()=> {
timePopup2.value?.close?.()
const daylabel = dayList[activeDayIndex.value].label
const timelabel = timeList[activeTimeIndex.value].label
const str = daylabel + ' ' + timelabel
emit('change', str)
timePopup2.value?.close?.()
}
const handleDayChange = (e) => {
@ -53,6 +72,7 @@ const handleTimeChange = (e) => {
const idx = e.target.dataset.val
activeTimeIndex.value = idx
}
//
defineExpose({
show
@ -61,7 +81,7 @@ defineExpose({
</script>
<template>
<uni-popup class="time-popup" ref="timePopup2" type="bottom" background-color="#fff">
<uni-popup class="time-popup" :is-mask-click="false" ref="timePopup2" type="bottom" background-color="#fff">
<view class="popup-root">
<view class="title">
<view class="text">期望上门时间</view>
@ -70,12 +90,12 @@ defineExpose({
<view class="time-cont">
<view class="left" @click="handleDayChange">
<view v-for="(item, index) in dayList" :class="[{ active: index == activeDayIndex }, 'item']" :key="item.val" :data-val="index">
<view v-for="(item, index) in dayList" :class="[{ active: index == activeDayIndex }, 'item']" :key="item.id" :data-val="index">
{{item.label}}
</view>
</view>
<view class="right" @click="handleTimeChange">
<view v-for="(item, index) in timeList" :class="[{ active: index == activeTimeIndex }, 'item']" :key="item.val" :data-val="index">
<view v-for="(item, index2) in timeList" :class="[{ active: index2 == activeTimeIndex }, 'item']" :key="item.id" :data-val="index2">
<view>{{item.label}}</view>
<!-- <uni-icons type="checkmarkempty" v-if="index == activeTimeIndex" size="30"></uni-icons> -->
</view>
@ -113,6 +133,7 @@ defineExpose({
background-color: #F1F1F7;
// padding: 20rpx 0rpx;
.item {
margin: 10rpx 0;
padding: 20rpx 20rpx;
&.active {
background-color: #fff;
@ -125,7 +146,7 @@ defineExpose({
background-color: #fff;
padding: 0 20rpx;
.item {
// margin: 40rpx 0;
margin: 10rpx 0;
padding: 40rpx 0;
&.active {
color: #3775F6;

@ -11,7 +11,7 @@ defineProps<{
<view class="category">
<view class="module-title"> 预约上门回收 </view>
<view class="cont">
<view class="category-items">
<navigator
class="category-item"
hover-class="none"

@ -10,8 +10,6 @@ import PageSkeleton from './components/PageSkeleton.vue'
import PhoneContact from './components/PhoneContact.vue'
import NeighborhoodSite from './components/NeighborhoodSite.vue'
import { useGuessList } from '@/composables'
const memberStore = useMemberStore()
//
const bannerList = ref<BannerItem[]>([
@ -171,7 +169,7 @@ const getSettingInfo = () => {
<PageSkeleton v-if="isLoading" />
<template v-else>
<!-- 自定义轮播图 -->
<!-- <XtxSwiper :list="bannerList" /> -->
<XtxSwiper :list="bannerList" />
<!-- 分类面板 -->
<CategoryPanel :list="categoryList" />
<!-- 电话联系> -->

@ -11,7 +11,7 @@
padding-bottom: 20rpx;
border-bottom: 2rpx solid #F2F2F2;
}
.cont {
.category-items {
// margin: 20rpx 0 0;
padding: 10rpx 0;
display: flex;
@ -19,7 +19,7 @@
flex-wrap: wrap;
min-height: 328rpx;
.category-item {
width: 46%;
width: 45%;
border-radius: 16rpx;
margin: 8rpx;
padding: 16rpx 0;
@ -27,7 +27,6 @@
justify-content: center; // flex-direction: row;
align-items: center;
box-sizing: border-box;
background: #FCF4FB;
.left {
.title {
font-size: 26rpx;

@ -1,37 +1,26 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { getListSiteAPI } from '@/services/site'
import SiteItem from './components/siteItem.vue'
const activeMenuKey = ref(0)
const menuList = [
{
id: 1,
name: '地区',
},
{
id: 2,
name: '回收品类',
},
{
id: 3,
name: '服务',
},
{
id: 4,
name: '筛选',
},
]
type location = {
latitude: Number,
longitude: Number,
}
type siteParams = {
page: Number
location: location
pageNo: Number
pageSize: Number
menuState: String
}
//
const queryParams: Required<siteParams> = {
page: 1,
pageSize: 5,
menuState: '1',
pageSize: 10,
location: {
latitude: 37.966944,
longitude: 119.643888,
}
}
//
const dataList = ref<any[]>([])
//
@ -49,50 +38,15 @@ const getDataList = async () => {
//
isLoading.value = true
//
// const res = await getMemberOrderAPI(queryParams)
const res = await new Promise((resolve, reject) => {
setTimeout(() => {
const data = [
{
id: 1,
},
{
id: 2,
},
{
id: 3,
},
{
id: 4,
},
{
id: 5,
},
{
id: 6,
},
{
id: 7,
},
{
id: 8,
},
]
const obj = {
result: data,
pages: 4,
}
resolve(obj)
}, 100)
})
const res = await getListSiteAPI(queryParams)
//
isLoading.value = false
//
dataList.value.push(...res.result)
//
if (queryParams.page < res.result.pages) {
if (queryParams.pageNo < res.result.pages) {
//
queryParams.page++
queryParams.pageNo++
} else {
//
isFinish.value = true
@ -112,17 +66,13 @@ const onRefresherrefresh = async () => {
//
isTriggered.value = false
}
const handleMenuChange = (val) => {
activeMenuKey.value = val
getDataList()
}
onMounted(() => {
getDataList()
})
</script>
<template>
<view class="service-site">
<view class="menu-list">
<!-- <view class="menu-list">
<view
class="item"
@tap="handleMenuChange(index)"
@ -131,14 +81,14 @@ onMounted(() => {
:key="item.id"
>{{ item.name }} >
</view>
</view>
</view> -->
<scroll-view
enable-back-to-top
scroll-y
class="scroll-view"
:refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getDataListList"
@scrolltolower="getDataList"
>
<siteItem class="item" v-for="item in dataList" :key="item.id" />
</scroll-view>

@ -0,0 +1,13 @@
import type { PageResult } from '@/types/global'
import { http } from '@/utils/http'
/**
*
* @param data orderState
*/
export const getListSiteAPI = (data: any) => {
return http<PageResult>({
method: 'POST',
url: `/recycle-station/page`,
data,
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@ -10,29 +10,15 @@
export type PageResult<T> = {
/** 列表数据 */
list: T[]
pagination: pagination
}
/** 二级分类项 */
export type pagination = {
/** 二级分类id */
currentPage: number
/** 二级分类名称 */
pageSize: number
/** 总条数 */
total: number
pages: string,
}
/** 通用分页参数类型 */
export type PageParams = {
/** 页码:默认值为 1 */
currentPage?: number
pageNo?: number
/** 页大小:默认值为 10 */
pageSize?: number,
/** 订单状态 */
orderStafstatusId: String,
/** 员工id */
staffId: String
}
/** 通用商品类型 */

Loading…
Cancel
Save