master
王文杰 8 months ago
parent fe684bd7df
commit d658017ff8

@ -11,7 +11,14 @@
"^Xtx(.*)": "@/components/Xtx$1.vue"
}
},
"pages": [{
"pages": [
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/my/my",
"style": {
"navigationStyle": "custom",
@ -55,13 +62,6 @@
"navigationBarTitleText": "商品分类"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/login/protocal",
"style": {
@ -94,9 +94,9 @@
},
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F8F8F8",
"navigationBarBackgroundColor": "#3775F6",
"backgroundColor": "#F8F8F8"
},
// TabBar

@ -3,21 +3,24 @@ import { computed, ref } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import TimePopup from './components/timePopup.vue'
import AddressPopup from './components/addressPopup.vue'
import SitePopup from './components/sitePopup.vue'
import { postBookingAPI } from '@/services/booking'
const activeMenuKey = ref(0)
const activeWeightKey = ref(0)
//
const longitude = ref(0)
const latitude = ref(0)
//
const timeChildPopup = ref<UniHelper.UniPopupInstance>()
const addressChildPopup = ref<UniHelper.UniPopupInstance>()
//
const longitude = ref(121.404032)
const latitude = ref(31.163973)
//
const isShowTimePop = ref(false)
const isShowAddressPop = ref(false)
const isShowSitePop = ref(false)
const addressLabel = ref('取件地址')
const timdeLabel = ref('取件时间')
const appointmentTime = ref('')
const siteLabel = ref('回收站点')
const recycleStationId = ref('')
//
const leiList = [
@ -63,13 +66,6 @@ const handleMenuChange = (val) => {
const handleWeightChange = (val) => {
activeWeightKey.value = val
}
const handleBooking = async () => {
const params = {}
const res = await postBookingAPI(params)
if (res.code) {
uni.navigateTo({ url: '/pages/booking/booking-success' })
}
}
// -
const getLocationInfo = () => {
uni.getLocation({
@ -139,19 +135,53 @@ const getSettingInfo = () => {
onReady(() => {
getSettingInfo()
})
//
const openTimePop = () => {
timeChildPopup.value?.show?.()
isShowTimePop.value = true
}
const openAdressPop = () => {
addressChildPopup.value?.show?.()
const openAddressPop = () => {
isShowAddressPop.value = true
}
const openSitePop = () => {
isShowSitePop.value = true
}
//
const handleTimePopChange = (val) => {
timdeLabel.value ='收货时间: ' + val
isShowTimePop.value = false
appointmentTime.value = val
}
const handleAddressPopChange = (val) => {
isShowAddressPop.value = false
addressLabel.value ='收货地址: ' + val
}
const handleSitePopChange = (obj) => {
isShowSitePop.value = false
siteLabel.value ='回收站点: ' + obj.stationName
recycleStationId.value = obj.recycleStationId
}
//
const handleBooking = async () => {
const arr = appointmentTime.value.split(' ')
const yymmdd = arr[0]
const appointmentTimeStart = yymmdd + arr[1].split('-')[0]
const appointmentTimeEnd = yymmdd + arr[1].split('-')[1]
const params = {
appointmentTimeStart,
appointmentTimeEnd,
location: {
longitude: longitude.value,
latitude: latitude.value,
},
recycleAddress: "xxx市yyy区",
recycleStationId: recycleStationId.value || 521632060801030597
}
const res = await postBookingAPI(params)
if (res.code == 200) {
uni.navigateTo({ url: '/pages/booking/booking-success' })
}
}
</script>
<template>
<view class="booking">
@ -164,7 +194,7 @@ const handleAddressPopChange = (val) => {
:longitude="longitude"
></map>
</view>
<view class="module lei">
<!-- <view class="module lei">
<view class="module-title">回收品类</view>
<view class="module-menu">
<view
@ -176,18 +206,13 @@ const handleAddressPopChange = (val) => {
>{{ item.name }}</view
>
</view>
</view>
</view> -->
<view class="module info">
<view class="module-title">取件信息</view>
<view class="list">
<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>
<button hover-class="none" class="item arrow" @click="openTimePop"> {{appointmentTime}}</button>
<button hover-class="none" class="item arrow" @click="openAddressPop">{{addressLabel}}</button>
<button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button>
</view>
<view class="weight">
<view class="weight-title"
@ -205,8 +230,9 @@ const handleAddressPopChange = (val) => {
</view>
</view>
</view>
<time-popup ref="timeChildPopup" @change="handleTimePopChange" />
<address-popup ref="addressChildPopup" @change="handleAddressPopChange" />
<time-popup v-if="isShowTimePop" @change="handleTimePopChange" />
<address-popup v-if="isShowAddressPop" @change="handleAddressPopChange" />
<site-popup v-if="isShowSitePop" @change="handleSitePopChange" />
<view class="submit" @click="handleBooking"></view>
<!-- 底部占位空盒子 -->

@ -0,0 +1,124 @@
<script setup lang="ts">
// const handlePhone = () => {
// uni.makePhoneCall({
// phoneNumber: '400-123-000', //
// })
// }
// props
defineProps<{
siteVal: Object
}>()
const handleToto = () => {
emit('change',siteVal)
}
</script>
<template>
<view class="item-site">
<view class="module-cont">
<image
class="left"
src="https://img.36krcdn.com/20200410/v2_41365a0f26a244fdab8e3f5be081ed2b_img_000"
/>
<view class="md">
<view class="name"> <span class="zuijin"> 最近 </span>{{siteVal.stationName}} </view>
<view class="time">营业时间{{siteVal.appointmentTimeStart}} - {{siteVal.appointmentTimeEnd}}</view>
<view class="loction">{{siteVal.address}}</view>
</view>
<view class="right">
<view class="num">{{siteVal.distance}}m</view>
<image
class="img"
src="https://img.36krcdn.com/20200410/v2_41365a0f26a244fdab8e3f5be081ed2b_img_000"
/>
</view>
</view>
<view class="md-tag"
><span class="tag-before">回收品类</span>旧衣·纸品·金属·家电·塑料·玻璃</view
>
<view class="foot-desc">
<view class="item">特色服务上门服务家电维修</view>
<view class="item">优惠活动预约回收立享双倍积分</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.item-site {
padding: 32rpx 20rpx;
margin: 16rpx;
background-color: #fff;
border-radius: 4rpx;
.module-cont {
padding: 20rpx 0;
display: flex;
flex-direction: row;
.left {
width: 140rpx;
height: 140rpx;
border-radius: 12rpx;
}
.md {
flex: 1;
margin: 0 10rpx;
font-size: 24rpx;
color: #0d0d26;
.name {
font-size: 30rpx;
.zuijin {
font-size: 24rpx;
color: #ff7d00;
background: #fff7e8;
padding: 4rpx 4rpx;
margin-right: 6rpx;
border-radius: 4rpx;
}
}
.time {
color: #95969d;
margin: 8rpx 0;
}
.loction {
color: #0d0d26;
}
}
.right {
.num {
font-size: 28rpx;
color: #95969d;
}
.img {
width: 72rpx;
height: 72rpx;
margin-top: 20rpx;
border-radius: 10rpx;
}
}
}
.md-tag {
background: #e8fffb;
color: #0fc6c2;
margin: 10rpx 0;
font-weight: 400;
font-size: 24rpx;
padding: 6rpx 0rpx;
.tag-before {
background: #0fc6c2;
color: #fff;
font-size: 24rpx;
font-weight: 500;
padding: 4rpx 8rpx;
border-radius: 4rpx;
margin-right: 10rpx;
}
}
.foot-desc {
.item {
font-size: 24rpx;
color: #95969d;
margin: 10rpx 0;
}
}
}
</style>

@ -1,10 +1,11 @@
<script setup lang="ts">
import { ref, reactive } from 'vue'
const addressPopup2 = ref<UniHelper.UniPopupInstance>()
import { onReady } from '@dcloudio/uni-app'
const addressPopup = ref<UniHelper.UniPopupInstance>()
//
const addressList = ref<AddressItem[]>([])
const addressList = ref<any[]>([])
//
const emit = defineEmits(['change'])
@ -30,30 +31,30 @@ const getMemberAddressData = async () => {
},
]
resolve(dataList)
}, 1000);
}, 0);
})
addressList.value = res
}
const show = ()=> {
addressPopup2.value?.open?.()
addressPopup.value?.open?.()
getMemberAddressData()
}
const hide = ()=> {
addressPopup2.value?.close?.()
addressPopup.value?.close?.()
const str = addressList.value[0].fullLocation
emit('change', str)
}
//
defineExpose({
show
//
onReady(async () => {
show()
})
</script>
<template>
<uni-popup class="time-popup" :is-mask-click="false" ref="addressPopup2" type="bottom" background-color="#fff">
<uni-popup class="time-popup" :is-mask-click="false" ref="addressPopup" type="bottom" background-color="#fff">
<view class="popup-root">
<view class="title">
<view class="text">取件地址</view>
@ -110,7 +111,7 @@ defineExpose({
background-color: #fff;
.title {
line-height: 1;
padding: 40rpx 20rpx;
padding: 40rpx;
font-size: 32rpx;
font-weight: normal;
border-bottom: 1rpx solid #ddd;
@ -119,6 +120,9 @@ defineExpose({
position: absolute;
right: 24rpx;
top: 40rpx;
height: 60rpx;
weight: 60rpx;
text-align: center;
}
}
page {
@ -221,7 +225,7 @@ defineExpose({
color: #fff;
border-radius: 80rpx;
font-size: 30rpx;
background-color: #27ba9b;
background-color: #3775F6;
}
}
</style>

@ -0,0 +1,234 @@
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import { getListSiteAPI } from '@/services/site'
import SiteItem from './siteItem.vue'
const siteSelected = ref(null)
const sitePopup = ref<UniHelper.UniPopupInstance>()
//
const queryParams: Required<siteParams> = {
pageNo: 1,
pageSize: 10,
location: {
latitude: 31.163973,
longitude: 121.404032,
}
}
//
const dataList = ref<any[]>([])
//
const isLoading = ref(false)
//
const isFinish = ref(false)
//
const emit = defineEmits(['change'])
const getDataList = async () => {
// 退
if (isLoading.value) return
// 退
if (isFinish.value === true) {
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
}
//
isLoading.value = true
//
const res = await getListSiteAPI(queryParams)
//
isLoading.value = false
//
dataList.value.push(...res.data.list)
//
if (queryParams.pageNo < res.data.pages) {
//
queryParams.pageNo++
} else {
//
isFinish.value = true
}
}
const show = async ()=> {
await getDataList()
sitePopup.value?.open?.()
}
const hide = ()=> {
emit('change', siteSelected.value)
}
const isTriggered = ref(false)
//
const onRefresherrefresh = async () => {
//
isTriggered.value = true
//
queryParams.page = 1
dataList.value = []
isFinish.value = false
//
await getDataList()
//
isTriggered.value = false
}
const handleSelected = (e) => {
const item = e.target.dataset.val
siteSelected.value = item
hide()
}
//
onReady(async () => {
show()
})
</script>
<template>
<uni-popup class="time-popup" :is-mask-click="false" ref="sitePopup" 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
scroll-y
class="scroll-view"
:refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getDataList"
@click="handleSelected"
>
<siteItem class="item" :site-val="item" :data-val="item" v-for="item in dataList" :key="item.id" />
</scroll-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;
font-size: 32rpx;
font-weight: normal;
border-bottom: 1rpx solid #ddd;
color: #444;
.close {
position: absolute;
right: 24rpx;
top: 40rpx;
height: 60rpx;
weight: 60rpx;
text-align: center;
}
}
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>

@ -1,163 +1,215 @@
<script setup lang="ts">
import { ref, reactive } from 'vue'
const timePopup2 = ref<UniHelper.UniPopupInstance>()
const activeDayIndex = ref(0)
const activeTimeIndex = ref(0)
import { onReady } from '@dcloudio/uni-app'
const popup = ref<UniHelper.UniPopupInstance>()
//
const emit = defineEmits(['change'])
const dayList = reactive([
{
label: '今天',
val: "today",
active: false
},
{
label: '明天',
val: 'tommrow',
active: false
}
const jmhDay = ref('')
const sendTime = ref('')
const sRightDate = ref('')
const sLDate = ref('')
let timeList = reactive([
{disabled:false,time:'11:00-13:00', id:1},
{disabled:false,time:'13:00-15:00', id:2},
{disabled:false,time:'15:00-17:00', id:3},
{disabled:false,time:'17:00-19:00',id:4},
{disabled:false,time:'19:00-21:00',id:5},
{disabled:false,time:'21:00-23:00',id:6}
])
const timeList = reactive([
{
id: 1,
label: '09:00-11:00',
val: '09:00-11:00',
active: false
},
{
id: 2,
label: '11:00-13:00',
val: '11:00-13:00',
active: false
},
{
id: 3,
label: '13:00-15:00',
val: '13:00-15:00',
active: false
},
{
id: 4,
label: '15:00-17:00',
val: '15:00-17:00',
active: false
},
{
id: 5,
label: '17:00-19:00',
val: '17:00-19:00',
active: false
}
])
const show = ()=> {
timePopup2.value?.open?.()
}
const hide = ()=> {
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) => {
const idx = e.target.dataset.val
activeDayIndex.value = idx
}
const handleTimeChange = (e) => {
const idx = e.target.dataset.val
activeTimeIndex.value = idx
const getDate = (date, AddDayCount = 0) => {
if (!date) {
date = new Date()
}
if (typeof date !== 'object'){
date = date.replace(/-/g, '/')
}
const dd = new Date(date)
dd.setDate(dd.getDate() + AddDayCount) // AddDayCount
const y = dd.getFullYear()
const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 100
const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 100
return {
fullDate: y + '-' + m + '-' + d,
year: y,
month: m,
date: d,
day: dd.getDay()
}
}
//
const getNextDay = () => {
const day = getWeekDate(new Date().getDay());
const newDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(new Date())
const isDay = getDate().fullDate;
const nextDay = getWeekDate(new Date(new Date().getTime() + 24 * 60 * 60 * 1000).getDay());
const nDate = getDate(new Date(new Date().getTime()+ 24 * 60 * 60 * 1000)).fullDate;
console.log(nDate);
const HDay = getWeekDate(new Date(new Date().getTime() + 48 * 60 * 60 * 1000).getDay());
const hDate=getDate(new Date(new Date().getTime()+ 48 * 60 * 60 * 1000)).fullDate;
let d1 = hDate.substr(hDate.indexOf('-')+1)
sLDate.value = isDay;
selectLDate(1);
jmhDay.value = [{name:day,id:1,formatDate:isDay,desc:'今天'},{name:nextDay,id:2,formatDate:nDate,desc:'明天'},
{name:HDay,id:3,formatDate:hDate,desc:d1.substr(0,d1.indexOf('-'))+'月'+d1.substr(d1.indexOf('-')+1)+'日'}]
}
const getWeekDate = (day) => {
const weeks = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六");
const week = weeks[day];
return week;
}
const selectRDate = (item) => {
if(item.disabled){
return;
}
sRightDate.value = item.time;
sendTime.value = sLDate.value +' ' +item.time;
debugger
popup.value?.close?.()
emit('change', sendTime.value)
}
const selectLDate = (val) => {
console.log(val);
if(val!=1){
sLDate.value = val.formatDate;
}
let t = [
{disabled:false,time:'11:00-13:00', id:1 },
{disabled:false,time:'13:00-15:00', id:2 },
{disabled:false,time:'15:00-17:00', id:3 },
{disabled:false,time:'17:00-19:00',id:4},
{disabled:false,time:'19:00-21:00',id:5},
{disabled:false,time:'21:00-23:00',id:6}
]
if(val.desc=='今天'||val==1){
if(new Date().getHours()<=10){
timeList = t;
}else if(new Date().getHours()<=12){
t[0].disabled=true;
timeList = t;
}else if(new Date().getHours()<=14){
t[0].disabled=true;
t[1].disabled=true;
timeList = t;
}else if(new Date().getHours()<=16){
t[0].disabled=true;
t[1].disabled=true;
t[2].disabled=true;
timeList = t;
}else if(new Date().getHours()<=18){
t[0].disabled=true;
t[1].disabled=true;
t[2].disabled=true;
t[3].disabled=true;
timeList = t;
}else if(new Date().getHours()<=20){
t[0].disabled=true;
t[1].disabled=true;
t[2].disabled=true;
t[3].disabled=true;
t[4].disabled=true;
timeList = t;
}
console.log('最终的时间列表');
console.log(timeList);
} else {
timeList = t;
}
sRightDate.value = '';
}
//
defineExpose({
show
//
onReady(async () => {
getNextDay()
popup.value?.open?.()
})
</script>
const hide = ()=> {
popup.value?.close?.()
}
</script>
<template>
<uni-popup class="time-popup" :is-mask-click="false" ref="timePopup2" type="bottom">
<view class="popup-root">
<view class="title">
<view class="text">期望上门时间</view>
<view class="close" @click="hide">X</view>
<uni-popup ref="popup" type="bottom">
<view class="pBoxUp">
<view class="textCenter f32 psTitle border-bottom">
请选择取件时间
</view>
<view class="time-cont">
<view class="left" @click="handleDayChange">
<view v-for="(item, index) in dayList" :class="[{ active: index == activeDayIndex }, 'item']" :key="item.id" :data-val="index">
{{item.label}}
<view class="shopPopup bgff justify-between default-flex">
<view class="f30 t666 lBox">
<view v-for="(item,index) in jmhDay" @click="selectLDate(item)" :class="sLDate==item.formatDate?'ed':''" class="boxLDate"
:key="index">{{item.desc}}({{item.name}})
</view>
</view>
<view class="right" @click="handleTimeChange">
<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 >
<view v-for="(item,index) in timeList" @click="selectRDate(item)"
:class="[sRightDate==item.time?'ed':'',item.disabled?'disabled':'']" :key="index" class="rBox"
>
{{item.time}}{{item.disabled?' (超出配送时间)':''}}
</view>
<view class="empty f28 text-center" style="color: #999;margin-top: 40rpx;"
v-if="timeList.length<1">
今天没有时间了,看看明天吧
</view>
</view>
</view>
<view class="cancelButton" @click="hide()">
取消
</view>
</view>
</uni-popup>
</template>
<style lang="scss">
.time-popup {
padding: 0 30rpx;
border-radius: 10rpx 10rpx 0 0;
position: relative;
.title {
line-height: 1;
padding: 40rpx 20rpx;
<style lang="scss" scoped>
.pBoxUp{
background: #f5f5f5;
.psTitle{
line-height: 100rpx;
text-align: center;
border-bottom: 1rpx solid #f7f7f7;
}
.shopPopup{
backgound:#ffffff;
font-size: 32rpx;
font-weight: normal;
border-bottom: 1rpx solid #ddd;
color: #444;
background-color:#fff;
.close {
position: absolute;
right: 24rpx;
top: 40rpx;
}
}
.time-cont {
min-height: 300rpx;
display: flex;
justify-content: space-between;
.left {
width: 300rpx;
background-color: #F1F1F7;
.item {
margin: 10rpx 0;
padding: 20rpx 20rpx;
&:first-child {
margin-top: 0;
}
&.active {
background-color: #fff;
color: #3775F6;
}
}
}
.right {
flex: 1;
background-color: #fff;
padding: 0 20rpx;
.item {
margin: 10rpx 0;
padding: 40rpx 0;
&.active {
color: #3775F6;
display: flex;
justify-content: space-between;
}
}
}
.boxLDate{
font-size: 24rpx;
height:80rpx;
line-height: 80rpx;
width:273rpx;
text-align: center;
}
.lBox{
color:#666666;
background: #f5f5f5;
font-size: 30rpx;
}
.boxLDate.ed{
color:#1DA337;
background: #fff;
}
.rBox.ed{
color:#1DA337;
}
.rBox{
width: 239px;
padding-left: 20rpx;
font-size: 24rpx;
color: #333;
height:80rpx;
background: #fff;
line-height: 80rpx;
}
.cancelButton{
font-size: 36rpx;
color: #999;
text-align: center;
height: 100rpx;
line-height: 100rpx;
border-top: 1px solid #e5e5e5;
background: #FFF;
}
}
</style>

@ -14,10 +14,10 @@ const { safeAreaInsets } = uni.getSystemInfoSync()
<template>
<view class="navbar" :style="{ paddingTop: safeAreaInsets!.top + 10 + 'px' }">
<!-- logo文字 -->
<!-- <view class="logo">
<image class="logo-image" src="/static/images/logo.png"></image>
<text class="logo-text">新鲜 · 亲民 · 快捷</text>
</view> -->
<view class="logo">
<!-- <image class="logo-image" src="/static/images/logo.png"></image> -->
<!-- <text class="logo-text">新鲜 · 亲民 · 快捷</text> -->
</view>
<!-- 搜索条 -->
<!-- <view class="search">
<text class="icon-search">搜索商品</text>

@ -24,6 +24,9 @@ const servicesList = reactive([
name: '客户热线',
},
])
const handleOrderList = () => {
uni.navigateTo({ url: '/pages/orerdList/orerdList' })
}
@ -36,8 +39,9 @@ const handleNewsList = () => {
</script>
<template>
<scroll-view enable-back-to-top class="viewport" scroll-y>
<view class="viewport">
<!-- 个人资料 -->
<view class="default"></view>
<view class="profile" :style="{ paddingTop: safeAreaInsets!.top + 'px' }">
<!-- 情况1已登录 -->
<view class="overview" v-if="memberStore.profile.token">
@ -167,7 +171,7 @@ const handleNewsList = () => {
<view class="text"> 订单 </view>
</navigator>
</view>
</scroll-view>
</view>
</template>
<style lang="scss">
@ -179,14 +183,16 @@ page {
.viewport {
height: 100%;
background-repeat: no-repeat;
background-image: url('http://174.137.59.38/static/bg.png');
background-size: 100% auto;
}
.default {
position: absolute;
background: #3775F6;
width: 100vw;
height: 400rpx;
}
/* 用户信息 */
.profile {
margin-top: 30rpx;
padding-top: 30rpx;
position: relative;
.overview {

@ -4,6 +4,11 @@
// phoneNumber: '400-123-000', //
// })
// }
// props
defineProps<{
siteVal: Object
}>()
const handleToto = () => {
uni.navigateTo({ url: '/pages/siteDetail/siteDetail' })
}
@ -16,12 +21,12 @@ const handleToto = () => {
src="https://img.36krcdn.com/20200410/v2_41365a0f26a244fdab8e3f5be081ed2b_img_000"
/>
<view class="md">
<view class="name"> <span class="zuijin"> 最近 </span>上海市松江区佘山镇 </view>
<view class="time">营业时间09-18:00</view>
<view class="loction">上海市松江区新松江路92弄开元地中海园区</view>
<view class="name"> <span class="zuijin"> 最近 </span>{{siteVal.stationName}} </view>
<view class="time">营业时间{{siteVal.appointmentTimeStart}} - {{siteVal.appointmentTimeEnd}}</view>
<view class="loction">{{siteVal.address}}</view>
</view>
<view class="right">
<view class="num">1.03km</view>
<view class="num">{{siteVal.distance}}m</view>
<image
class="img"
src="https://img.36krcdn.com/20200410/v2_41365a0f26a244fdab8e3f5be081ed2b_img_000"

@ -14,11 +14,11 @@ type siteParams = {
}
//
const queryParams: Required<siteParams> = {
page: 1,
pageNo: 1,
pageSize: 10,
location: {
latitude: 37.966944,
longitude: 119.643888,
latitude: 31.163973,
longitude: 121.404032,
}
}
//
@ -42,9 +42,9 @@ const getDataList = async () => {
//
isLoading.value = false
//
dataList.value.push(...res.result)
dataList.value.push(...res.data.list)
//
if (queryParams.pageNo < res.result.pages) {
if (queryParams.pageNo < res.data.pages) {
//
queryParams.pageNo++
} else {
@ -70,16 +70,6 @@ getDataList()
</script>
<template>
<view class="service-site">
<!-- <view class="menu-list">
<view
class="item"
@tap="handleMenuChange(index)"
:class="{ active: activeMenuKey == index }"
v-for="(item, index) in menuList"
:key="item.id"
>{{ item.name }} >
</view>
</view> -->
<scroll-view
enable-back-to-top
scroll-y
@ -88,7 +78,7 @@ getDataList()
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getDataList"
>
<siteItem class="item" v-for="item in dataList" :key="item.id" />
<siteItem class="item" :site-val="item" v-for="item in dataList" :key="item.id" />
</scroll-view>
</view>
<!-- 底部占位空盒子 -->

@ -10,13 +10,14 @@ import { ref } from 'vue'
const { safeAreaInsets } = uni.getSystemInfoSync()
//
const profile = ref({} as ProfileDetail)
// const profile = ref({} as ProfileDetail)
const profile = ref({} as any)
const getMemberProfileData = async () => {
const res = await getMemberProfileAPI()
profile.value = res.result
profile.value = res.data
// Store
memberStore.profile!.avatar = res.result.avatar
memberStore.profile!.nickname = res.result.nickname
memberStore.profile!.avatar = res.data.avatar
memberStore.profile!.nickname = res.data.nickname
}
onLoad(() => {
@ -26,21 +27,6 @@ onLoad(() => {
const memberStore = useMemberStore()
//
const onAvatarChange = () => {
// /
//
// #ifdef H5 || APP-PLUS
// 2.21.0 wx.chooseImage 使 uni.chooseMedia
uni.chooseImage({
count: 1,
success: (res) => {
//
const tempFilePaths = res.tempFilePaths
//
uploadFile(tempFilePaths[0])
},
})
// #endif
// #ifdef MP-WEIXIN
// uni.chooseMedia
uni.chooseMedia({
@ -90,14 +76,14 @@ const onBirthdayChange: UniHelper.DatePickerOnChange = (ev) => {
profile.value.birthday = ev.detail.value
}
//
let fullLocationCode: [string, string, string] = ['', '', '']
const onFullLocationChange: UniHelper.RegionPickerOnChange = (ev) => {
//
profile.value.fullLocation = ev.detail.value.join(' ')
//
fullLocationCode = ev.detail.code!
}
// //
// let fullLocationCode: [string, string, string] = ['', '', '']
// const onFullLocationChange: UniHelper.RegionPickerOnChange = (ev) => {
// //
// profile.value.fullLocation = ev.detail.value.join(' ')
// //
// fullLocationCode = ev.detail.code!
// }
//
const onSubmit = async () => {
@ -106,10 +92,10 @@ const onSubmit = async () => {
nickname,
gender,
birthday,
profession,
provinceCode: fullLocationCode[0] || undefined,
cityCode: fullLocationCode[1] || undefined,
countyCode: fullLocationCode[2] || undefined,
// profession,
// provinceCode: fullLocationCode[0] || undefined,
// cityCode: fullLocationCode[1] || undefined,
// countyCode: fullLocationCode[2] || undefined,
})
// Store
memberStore.profile!.nickname = res.result.nickname
@ -150,11 +136,11 @@ const onSubmit = async () => {
<text class="label">性别</text>
<radio-group @change="onGenderChange">
<label class="radio">
<radio value="男" color="#27ba9b" :checked="profile?.gender === '男'" />
<radio value="男" color="#3271E5" :checked="profile?.gender === '男'" />
</label>
<label class="radio">
<radio value="女" color="#27ba9b" :checked="profile?.gender === '女'" />
<radio value="女" color="#3271E5" :checked="profile?.gender === '女'" />
</label>
</radio-group>
@ -188,10 +174,10 @@ const onSubmit = async () => {
</picker>
</view>
<!-- #endif -->
<view class="form-item">
<!-- <view class="form-item">
<text class="label">职业</text>
<input class="input" type="text" placeholder="请填写职业" v-model="profile.profession" />
</view>
</view> -->
</view>
<!-- 提交按钮 -->
<button @tap="onSubmit" class="form-button"> </button>
@ -208,7 +194,7 @@ page {
display: flex;
flex-direction: column;
height: 100%;
background-image: url(https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/images/order_bg.png);
background: linear-gradient(158deg, #51B6FF -10%, #3775F6 129%);
background-size: auto 420rpx;
background-repeat: no-repeat;
}

@ -1,5 +1,6 @@
<script setup lang="ts">
import { useMemberStore } from '@/stores'
import { getLogoutWxMinAPI } from '@/services/login'
const memberStore = useMemberStore()
// 退
@ -8,10 +9,11 @@ const onLogout = () => {
uni.showModal({
content: '是否退出登录?',
confirmColor: '#3775F6',
success: (res) => {
success: async (res) => {
if (res.confirm) {
//
memberStore.clearProfile()
const res = await getLogoutWxMinAPI()
//
uni.navigateBack()
}
@ -28,8 +30,7 @@ const onLogout = () => {
<button hover-class="none" class="item arrow" open-type="contact">联系我们</button>
</view>
<!-- 操作按钮 -->
<!-- <view class="action" v-if="memberStore.profile"> -->
<view class="action">
<view class="action" v-if="memberStore.profile">
<view @tap="onLogout" class="button">退出登录</view>
</view>
</view>

@ -15,7 +15,7 @@ import { http } from '@/utils/http'
export const postBookingAPI = (data: any) => {
return http<PageResult>({
method: 'POST',
url: `/order/create`,
url: `/recycle-order/create`,
data,
})
}

@ -49,3 +49,12 @@ export const postLoginAPI = (data: LoginParams) => {
data,
})
}
/**
* 退
*/
export const getLogoutWxMinAPI = () => {
return http<HotResult>({
method: 'GET',
url: '/common/logout'
})
}

@ -1,3 +1,11 @@
/*
* @Author:
* @Date: 2024-01-04 12:54:56
* @LastEditors:
* @LastEditTime: 2024-03-06 09:55:46
* @FilePath: /app-nx-personal/src/services/profile.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import type { ProfileDetail, ProfileParams } from '@/types/member'
import { http } from '@/utils/http'
@ -7,7 +15,7 @@ import { http } from '@/utils/http'
export const getMemberProfileAPI = () => {
return http<ProfileDetail>({
method: 'GET',
url: '/member/profile',
url: '/client/info',
})
}
@ -18,7 +26,7 @@ export const getMemberProfileAPI = () => {
export const putMemberProfileAPI = (data: ProfileParams) => {
return http<ProfileDetail>({
method: 'PUT',
url: '/member/profile',
url: '/client/update',
data,
})
}

Loading…
Cancel
Save