From 7655e5d157dd12fc339b936b62f6ecbfbf52ff99 Mon Sep 17 00:00:00 2001 From: 396316021 <396316021@qq.com> Date: Mon, 11 Sep 2023 18:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=B1=E5=93=8D=E6=A0=B7=E5=BC=8F,=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E6=8E=A5=E5=8F=A3,=E6=97=A5=E5=8E=86=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MzButton/index.vue | 6 +- config/image.js | 13 +- pages/Addr/components/index.scss | 2 +- pages/Addr/index.vue | 21 +- pages/AddrDetail/index.vue | 53 +++- pages/ChatDetail/components/index.scss | 1 - pages/ChatDetail/index.vue | 10 +- pages/Index/components/HomePage/index.vue | 312 +++++++++++----------- pages/Index/components/UserPage/index.vue | 35 ++- pages/Index/index.vue | 2 + pages/Login/index.vue | 6 +- pages/OrderPage/index.vue | 111 +++++--- 12 files changed, 335 insertions(+), 237 deletions(-) diff --git a/components/MzButton/index.vue b/components/MzButton/index.vue index 1f8aadc..7a020ad 100644 --- a/components/MzButton/index.vue +++ b/components/MzButton/index.vue @@ -1,5 +1,5 @@ @@ -223,7 +238,9 @@ import MzButton from '../../components/MzButton/Index.vue'; import PetPage from '../../components/PetPage/Index.vue'; import api from '@/utils/functions.js'; - import {cardDetail} from "../../api/card"; + import {cardDetail} from "@/api/card"; + import {getAddressList} from "@/api/address"; + import image from "@/config/image"; export default { components: { HeaderNav, @@ -240,35 +257,10 @@ id:'', title: 'Hello', loading: true, - staticImage: { - screenActiveImg: imghost + '/static/image/screen-active.png', - cardBackground: imghost + '/static/image/order-card-background.png', - wallpaperBgImage:imghost +'/static/image/background.png', - dogImage:imghost+'/static/image/index-user-title-dog.png', - cardDetailCard:imghost+'/static/image/card-detail-card.png', - couponsBackground:imghost+'/static/image/card-detail-coupons.png', - addrBg:imghost+'/static/image/order-create-addr-bg.png', - addrAvatar:imghost+'/static/image/order-create-addr-avatar.png', - addrFw:imghost+'/static/image/order-create-addr-fw.png', - addrBook:imghost+'/static/image/order-create-addr-book.png', - tagClose:imghost+'/static/image/order-create-tag-close.png', - selectPet:imghost+'/static/image/order-create-select-pet.png', - selectService:imghost+'/static/image/order-create-select-service.png', - groupImg:imghost+'/static/image/order-create-group-1.png', - }, - indexBanner: [{ - image: imghost + '/static/image/banner.png', - url: '', - }], - user: { - avatar: imghost + '/static/image/banner.png', - nickname: '清晨的风', - coupons: 221, - id: 88685 - }, + timeList:[], + staticImage: image.OrderPage, isTop: false, pagePadding: 100, - petImage: imghost + '/static/image/pet_avatar1.jpeg', orderCardList:[ { title:'成都市武侯区丰德国际4栋...', @@ -290,14 +282,45 @@ coupons_number:10, time: '满0.01元使用仅限线上预约下单使用', is_timeout: false, - }] + }], + address:{}, } }, onLoad(options) { this.id = options.id; this.getCardDetail(); }, + onShow(){ + this.getDefaultAddress(); + }, methods: { + getDefaultAddress() { + let cacheAddress = uni.getStorageSync('address'); + if (cacheAddress) { + console.log('hasCacheAddress') + console.log(cacheAddress) + this.address = cacheAddress; + } else { + getAddressList({}).then(res => { + res.data.forEach(item => { + if (item.is_default === 1) { + this.address = item; + } + }); + }) + console.log(this.address) + } + }, + delTime(index){ + this.timeList.splice(index,1); + }, + timeSelect(e){ + this.timeList = this.$refs.calendar.selected; + this.$refs.calendar.close(); + }, + showAgreement(){ + this.$refs.agreement.open(); + }, navTo(url){ uni.navigateTo({ url:url