master
王文杰 8 months ago
parent ff8b5c137a
commit 171d9fffda

@ -18,6 +18,14 @@
"navigationBarTitleText": "一键预约", "navigationBarTitleText": "一键预约",
} }
}, },
{
"path": "pages/booking/booking-success",
"style": {
"navigationBarTitleText": "预约成功",
}
},
//pageshttps://uniapp.dcloud.io/collocation/pages //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",

@ -0,0 +1,72 @@
<script setup lang="ts">
const handleHome = () => {
uni.switchTab({ url: '/pages/index/index' })
}
const handleOrder = () => {
uni.switchTab({ url: '/pages/index/index' })
}
</script>
<template>
<view class="booking-success">
<view class="status">
<image
src="/static/images/success_result.png"
mode="scaleToFill"
class="image" />
<view class="text">预约成功</view>
<view class="desc">预约上门时间今天上午 10:30</view>
</view>
<view class="action">
<view class="home button" @click="handleHome"></view>
<view class="order button" @click="handleOrder"></view>
</view>
</view>
</template>
<style lang="scss">
page {
height: 100%;
background-color: #f2f2fa;
}
.booking-success {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.status {
margin: 100rpx 0;
text-align: center;
.image {
width: 120rpx;
height: 120rpx;
margin: 20rpx 0;
}
.text {
color: #3D3D3D;
margin: 20rpx 0;
}
.desc {
color: #999A9F;
font-size: 30rpx;
}
}
.action {
display: flex;
.button {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 264rpx;
height: 96rpx;
background: linear-gradient(158deg, #51B6FF 10%, #3775F6 97%);
color: #fff;
margin: 0 20rpx;
font-size: 36rpx;
border-radius: 10rpx;
}
}
}
</style>

@ -45,20 +45,16 @@ const leiList = [
const weightMenuList = [ const weightMenuList = [
{ {
id: 1, id: 1,
name: '5-10kg', name: '10kg以下',
}, },
{ {
id: 2, id: 2,
name: '10-15kg', name: '10-20kg',
}, },
{ {
id: 3, id: 3,
name: '15-20kg', name: '20kg以上',
}, }
{
id: 4,
name: '20-50kg',
},
] ]
const handleMenuChange = (val) => { const handleMenuChange = (val) => {
@ -68,11 +64,7 @@ const handleWeightChange = (val) => {
activeWeightKey.value = val activeWeightKey.value = val
} }
const handleToto = () => { const handleToto = () => {
uni.showToast({ uni.navigateTo({ url: '/pages/booking/booking-success' })
title: 'todo...',
icon: 'none',
duration: 1000,
})
} }
// - // -
@ -152,10 +144,10 @@ const openAdressPop = () => {
} }
const handleTimePopChange = (val) => { const handleTimePopChange = (val) => {
timdeLabel.value ='取件时间: ' + val timdeLabel.value ='收货时间: ' + val
} }
const handleAddressPopChange = (e) => { const handleAddressPopChange = (val) => {
debugger addressLabel.value ='收货地址: ' + val
} }
</script> </script>
<template> <template>
@ -324,17 +316,18 @@ page {
} }
.weight-menu { .weight-menu {
display: flex; display: flex;
flex-direction: row; flex-direction: column;
.item { .item {
flex: 1; flex: 1;
text-align: center; text-align: center;
margin: 0 10rpx; margin: 10rpx;
font-size: 28rpx; font-size: 28rpx;
border-radius: 8rpx; border-radius: 8rpx;
padding: 30rpx 10rpx; padding: 30rpx 10rpx;
background: #f2f2fa; background: #f2f2fa;
&.active { &.active {
background: #fff7e8; background: #fff7e8;
border: 2rpx solid #FF7D00;
} }
} }
} }

@ -5,6 +5,11 @@ const addressPopup2 = ref<UniHelper.UniPopupInstance>()
// //
const addressList = ref<AddressItem[]>([]) const addressList = ref<AddressItem[]>([])
//
const emit = defineEmits(['change'])
const getMemberAddressData = async () => { const getMemberAddressData = async () => {
const res = await new Promise((resolve, reject) => { const res = await new Promise((resolve, reject) => {
@ -36,15 +41,9 @@ const show = ()=> {
} }
const hide = ()=> { const hide = ()=> {
addressPopup2.value?.close?.() addressPopup2.value?.close?.()
} const str = addressList.value[0].fullLocation
emit('change', str)
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({ defineExpose({

@ -81,7 +81,7 @@ defineExpose({
</script> </script>
<template> <template>
<uni-popup class="time-popup" :is-mask-click="false" ref="timePopup2" type="bottom" background-color="#fff"> <uni-popup class="time-popup" :is-mask-click="false" ref="timePopup2" type="bottom">
<view class="popup-root"> <view class="popup-root">
<view class="title"> <view class="title">
<view class="text">期望上门时间</view> <view class="text">期望上门时间</view>
@ -110,7 +110,7 @@ defineExpose({
padding: 0 30rpx; padding: 0 30rpx;
border-radius: 10rpx 10rpx 0 0; border-radius: 10rpx 10rpx 0 0;
position: relative; position: relative;
background-color: #fff;
.title { .title {
line-height: 1; line-height: 1;
padding: 40rpx 20rpx; padding: 40rpx 20rpx;
@ -118,6 +118,7 @@ defineExpose({
font-weight: normal; font-weight: normal;
border-bottom: 1rpx solid #ddd; border-bottom: 1rpx solid #ddd;
color: #444; color: #444;
background-color:#fff;
.close { .close {
position: absolute; position: absolute;
right: 24rpx; right: 24rpx;
@ -131,10 +132,12 @@ defineExpose({
.left { .left {
width: 300rpx; width: 300rpx;
background-color: #F1F1F7; background-color: #F1F1F7;
// padding: 20rpx 0rpx;
.item { .item {
margin: 10rpx 0; margin: 10rpx 0;
padding: 20rpx 20rpx; padding: 20rpx 20rpx;
&:first-child {
margin-top: 0;
}
&.active { &.active {
background-color: #fff; background-color: #fff;
color: #3775F6; color: #3775F6;

@ -5,19 +5,22 @@ import type { CategoryItem } from '@/types/home'
defineProps<{ defineProps<{
list: CategoryItem[] list: CategoryItem[]
}>() }>()
const handleToBooking = (e) => {
uni.switchTab({ url: '/pages/booking/booking' })
}
</script> </script>
<template> <template>
<view class="category"> <view class="category">
<view class="module-title"> 预约上门回收 </view> <view class="module-title"> 预约上门回收 </view>
<view class="category-items" @click="handleToBooking">
<view class="category-items"> <view
<navigator
class="category-item" class="category-item"
hover-class="none" hover-class="none"
url="/pages/index/index"
v-for="item in list" v-for="item in list"
:key="item.id" :key="item.id"
:data-val="item"
> >
<view class="left"> <view class="left">
<view class="title">{{ item.name }}</view> <view class="title">{{ item.name }}</view>
@ -26,7 +29,7 @@ defineProps<{
<view class="right"> <view class="right">
<image class="icon" :src="item.icon"></image> <image class="icon" :src="item.icon"></image>
</view> </view>
</navigator> </view>
</view> </view>
</view> </view>
</template> </template>

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

@ -190,157 +190,7 @@ page {
.viewport { .viewport {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
margin-bottom: 300rpx;
.cont {
height: 100%;
background-color: #3775f6;
display: flex;
flex-direction: column;
.navbar {
width: 750rpx;
color: #000;
position: fixed;
top: 0;
left: 0;
z-index: 9;
/* background-color: #f8f8f8; */
background-color: #3775f6;
.wrap {
position: relative;
background-color: #3775f6;
.title {
height: 44px;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
/* color: #000; */
color: #fff;
}
.back {
position: absolute;
left: 0;
height: 44px;
width: 44px;
font-size: 44rpx;
display: flex;
align-items: center;
justify-content: center;
/* color: #000; */
color: #fff;
}
}
}
.popup-root {
padding: 30rpx 30rpx 0rpx;
border-radius: 10rpx 10rpx 0 0;
overflow: hidden;
background: linear-gradient(180deg, #d2eeff -7%, rgba(255, 255, 255, 0) 38%), #ffffff;
box-shadow: 0px -2px 8px 0px rgba(133, 155, 180, 0.4);
position: relative;
.title {
text-align: left;
margin-bottom: 30rpx;
padding-bottom: 20rpx;
border-bottom: 2rpx solid #e1e7f2;
.text {
font-size: 30rpx;
}
.close {
position: absolute;
right: 0;
top: 0;
padding: 23rpx 50rpx;
color: #333;
font-size: 30rpx;
text-align: center;
}
}
.description {
min-height: 400rpx;
.tips {
margin: 20rpx 0;
}
.date {
margin: 60rpx 0;
}
}
.footer {
display: flex;
justify-content: space-between;
padding: 30rpx 0 20rpx;
font-size: 28rpx;
color: #444;
.button {
flex: 1;
height: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx;
color: #444;
border-radius: 72rpx;
border: 1rpx solid #ccc;
}
.primary {
color: #fff;
background-color: #27ba9b;
border: none;
}
}
}
// tabs
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #3775f6;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
margin-top: 128rpx;
.item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #fff;
}
.cursor {
position: absolute;
left: 13%;
bottom: 0;
width: 20%;
height: 6rpx;
padding: 0 50rpx;
background-color: #fff;
/* 过渡效果 */
transition: all 0.4s;
}
}
// swiper
.swiper {
background-color: #f7f7f8;
}
}
.noLogin { .noLogin {
position: absolute; position: absolute;

@ -1,6 +1,7 @@
.neighborhood-site { .neighborhood-site {
padding: 32rpx 20rpx; padding: 32rpx 20rpx;
margin: 16rpx; margin: 16rpx;
padding-bottom: 120rpx;
background-color: #fff; background-color: #fff;
border-radius: 4rpx; border-radius: 4rpx;
.module-title { .module-title {

@ -31,17 +31,11 @@ const onGetphonenumber: UniHelper.ButtonOnGetphonenumber = async (ev) => {
} }
} }
//
const onGetphonenumberSimple = async () => {
await checkedAgreePrivacy()
const res = await postLoginWxMinSimpleAPI('13123456789')
loginSuccess(res.result)
}
const loginSuccess = (profile: LoginResult) => { const loginSuccess = (profile: LoginResult) => {
// //
const memberStore = useMemberStore() const memberStore = useMemberStore()
memberStore.setProfile(profile) memberStore.setProfile(profile)
debugger
// //
uni.showToast({ icon: 'success', title: '登录成功' }) uni.showToast({ icon: 'success', title: '登录成功' })
setTimeout(() => { setTimeout(() => {

@ -24,7 +24,7 @@ const handleNewsList = () => {
<!-- 个人资料 --> <!-- 个人资料 -->
<view class="profile" :style="{ paddingTop: safeAreaInsets!.top + 'px' }"> <view class="profile" :style="{ paddingTop: safeAreaInsets!.top + 'px' }">
<!-- 情况1已登录 --> <!-- 情况1已登录 -->
<view class="overview" v-if="memberStore.profile"> <view class="overview" v-if="memberStore.profile.token">
<navigator url="/pagesMember/profile/profile" hover-class="none"> <navigator url="/pagesMember/profile/profile" hover-class="none">
<image class="avatar" :src="memberStore.profile.avatar" mode="aspectFill"></image> <image class="avatar" :src="memberStore.profile.avatar" mode="aspectFill"></image>
</navigator> </navigator>
@ -111,9 +111,9 @@ const handleNewsList = () => {
</button> </button>
</view> </view>
<!-- 猜你喜欢 --> <!-- 猜你喜欢 -->
<view class="guess"> <!-- <view class="guess">
<XtxGuess ref="guessRef" /> <XtxGuess ref="guessRef" />
</view> </view> -->
</scroll-view> </scroll-view>
</template> </template>

@ -29,6 +29,7 @@ const isLoading = ref(false)
const isFinish = ref(false) const isFinish = ref(false)
const getDataList = async () => { const getDataList = async () => {
debugger
// 退 // 退
if (isLoading.value) return if (isLoading.value) return
// 退 // 退
@ -66,9 +67,7 @@ const onRefresherrefresh = async () => {
// //
isTriggered.value = false isTriggered.value = false
} }
onMounted(() => { getDataList()
getDataList()
})
</script> </script>
<template> <template>
<view class="service-site"> <view class="service-site">

@ -12,12 +12,13 @@ type BaseProfile = {
} }
/** 小程序登录 登录用户信息 */ /** 小程序登录 登录用户信息 */
export type LoginResult = BaseProfile & { export type LoginResult = {
id: string id: string
openid: string
phone: string phone: string
/** 登录凭证 */ /** 登录凭证 */
token: string token: string
userType: number userType: Object
username: string username: string
} }

@ -10,7 +10,6 @@
* 3. * 3.
* 4. token * 4. token
*/ */
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
const baseURL = 'http://192.168.0.166:8808/api' const baseURL = 'http://192.168.0.166:8808/api'
@ -27,12 +26,11 @@ const httpInterceptor = {
// 3. 添加小程序端请求头标识 // 3. 添加小程序端请求头标识
options.header = { options.header = {
...options.header, ...options.header,
'source-client': 'miniapp',
'jnpf-origin': 'app',
} }
// 4. 添加 token 请求头标识 // 4. 添加 token 请求头标识
const memberStore = useMemberStore() const memberStore = useMemberStore()
const token = memberStore.profile?.token const token = memberStore.profile?.token
debugger
if (token) { if (token) {
options.header.authorization = token options.header.authorization = token
} }

Loading…
Cancel
Save