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 @@
-
+
-
-
-
+
+
+
-
+
{{item.name}}
{{item.phone}}
@@ -87,6 +87,7 @@
import MzButton from '@/components/MzButton/Index.vue';
import {delAddress, getAddressList} from "@/api/address";
import functions from "@/utils/functions";
+ import log from "@/utils/log";
export default {
components: {
HeaderNav,
@@ -126,16 +127,22 @@
isTop: false,
pagePadding: 100,
petImage: imghost + '/static/image/pet_avatar1.jpeg',
- addrList: []
+ addrList: [],
+ type:'',
}
},
- onLoad() {
-
+ onLoad(option) {
+ this.type = option.type||'lists'
},
onShow() {
this.getAddressList();
},
methods: {
+ navBack(item) {
+ item.select = true;
+ uni.setStorageSync('address',item)
+ uni.navigateBack();
+ },
touchstart(e) {
console.log(e)
diff --git a/pages/AddrDetail/index.vue b/pages/AddrDetail/index.vue
index 40c1d8a..d47158f 100644
--- a/pages/AddrDetail/index.vue
+++ b/pages/AddrDetail/index.vue
@@ -7,12 +7,16 @@
-
+
-
+
-
+
+
+
+
+
@@ -64,7 +68,7 @@
>
-
+
@@ -89,6 +93,7 @@
import log from "@/utils/log";
import {getDetail, saveAddress} from "@/api/address";
import functions from "@/utils/functions";
+ import api from "@/utils/functions";
export default {
components: {
HeaderNav,
@@ -203,6 +208,46 @@
this.address = data.data;
})
},
+ selectAddress() {
+ let that = this;
+ uni.getLocation({
+ type: 'gcj02',
+ success: function (res1) {
+ uni.chooseLocation({
+ latitude:res1.latitude||'',
+ longitude:res1.longitude||'',
+ success: (res) => {
+ // that.lat = res.latitude;
+ // that.lng = res.longitude;
+ // that.model.line.coordinate = res.latitude+','+res.longitude;
+ // that.model.line.address = res.name+res.address;
+
+ // this.getRegionFn(res);
+ api.getloction({activedeta:{
+ city:'',
+ address:res.address
+ }}).then(data => {
+ let address = data.address_components;
+ console.log('address',address)
+ that.address.province = address.province;
+ that.address.city = address.city;
+ that.address.district = address.district;
+ that.address.position = res.address;
+ that.address.info = res.name;
+ });
+
+ },
+ fail: (err) => {
+ console.log(err)
+ }
+ });
+ },
+ fail: (err) => {
+ console.log(err)
+ }
+ });
+
+ },
submit(){
log(this.address);
saveAddress(this.address).then(() => {
diff --git a/pages/ChatDetail/components/index.scss b/pages/ChatDetail/components/index.scss
index c555fb2..21debe0 100644
--- a/pages/ChatDetail/components/index.scss
+++ b/pages/ChatDetail/components/index.scss
@@ -134,7 +134,6 @@
border-radius: 45rpx;
z-index: 1;
.detail-input{
- flex:1;
background: #FFFFFF;
box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(179,181,181,0.1);
border-radius: 45rpx;
diff --git a/pages/ChatDetail/index.vue b/pages/ChatDetail/index.vue
index d590f86..83470c4 100644
--- a/pages/ChatDetail/index.vue
+++ b/pages/ChatDetail/index.vue
@@ -48,16 +48,18 @@
-
-
+
+
+
+ class="detail-input-button"
+ @click="sendMessage"
+ >
-
diff --git a/pages/Index/components/HomePage/index.vue b/pages/Index/components/HomePage/index.vue
index d6bc7a6..d8a9e80 100644
--- a/pages/Index/components/HomePage/index.vue
+++ b/pages/Index/components/HomePage/index.vue
@@ -1,174 +1,178 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{user.nickname}}
-
-
-
-
- 会员编号:{{user.id}}
-
-
-
-
-
-
- {{user.coupon_count}}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 会员编号:{{ user.id }}
+
+
+
+
+
+
+ {{ userExtends.coupon_count }}
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/Index/components/UserPage/index.vue b/pages/Index/components/UserPage/index.vue
index 4fa95fc..5d52a18 100644
--- a/pages/Index/components/UserPage/index.vue
+++ b/pages/Index/components/UserPage/index.vue
@@ -151,7 +151,7 @@
import FooterNav from '@/components/FooterNav/Index.vue';
import RightNav from '@/components/RightNav/Index.vue';
import api from '@/utils/functions.js';
- import {userExtends} from "@/api/user";
+ import {userDetail, userExtends} from "@/api/user";
import log from "@/utils/log";
export default {
components: {
@@ -196,19 +196,17 @@
}
},
user:{
- avatar:imghost+'/static/image/banner.png',
- nickname:'清晨的风',
- coupon_count:221,
- id:88685
+ avatar:'',
+ nickname:'',
+ coupon_count:0,
+ id:0,
+ feed_count:0
},
isTop:false,
pagePadding:100,
userInfo:{},
userExtends:{},
}
- },
- onLoad() {
-
},
methods: {
navTo(url){
@@ -228,7 +226,9 @@
userExtends().then(data => {
log(data);
this.userExtends = data.data;
- })
+ uni.setStorageSync('userExtends',data.data);
+ this.$store.commit('userExtends',data.data);
+ });
},
userCouponsPage(){
uni.navigateTo({
@@ -240,19 +240,18 @@
this.user.id = this.userInfo.id
this.user.nickname = this.userInfo.name
this.user.avatar = this.userInfo.avatar
- this.user.coupon_count = this.userInfo.coupon_count
+ this.user.coupon_count = this.userExtends.coupon_count
}
+ },
+ showUserInfo(){
+ userDetail().then(res => {
+ uni.setStorageSync('user',res.data);
+ this.$store.commit('userInfo',res.data);
+ })
}
- },
- onPageScroll(res) {
- if(res.scrollTop <= 20){
- uni.$emit('isTop', true);
- }else{
- uni.$emit('isTop', false);
- }
-
},
mounted() {
+ this.showUserInfo();
this.showNumber();
},
created() {
diff --git a/pages/Index/index.vue b/pages/Index/index.vue
index 9933da5..a712a07 100644
--- a/pages/Index/index.vue
+++ b/pages/Index/index.vue
@@ -108,6 +108,8 @@
}else{
let user = uni.getStorageSync('user');
this.$store.commit('userInfo', user);
+ let userExtends = uni.getStorageSync('userExtends');
+ this.$store.commit('userExtends', userExtends);
}
},
watch: {
diff --git a/pages/Login/index.vue b/pages/Login/index.vue
index 2fba4c4..bf2c874 100644
--- a/pages/Login/index.vue
+++ b/pages/Login/index.vue
@@ -108,7 +108,7 @@ import {
imghost
} from '@/config/host.js'
import api from '@/utils/functions.js';
-import {appletLogin, testLogin, userDetail} from "@/api/user";
+import {appletLogin, testLogin, userDetail, userExtends} from "@/api/user";
export default {
data() {
@@ -144,6 +144,10 @@ export default {
uni.setStorageSync('user',res.data);
this.$store.commit('userInfo',res.data);
});
+ userExtends().then((res) => {
+ uni.setStorageSync('userExtends',res.data);
+ this.$store.commit('userExtends',res.data);
+ });
});
},
wxLogin(phoneCode) {
diff --git a/pages/OrderPage/index.vue b/pages/OrderPage/index.vue
index 2984f02..66e9086 100644
--- a/pages/OrderPage/index.vue
+++ b/pages/OrderPage/index.vue
@@ -15,8 +15,8 @@
-
- 请输入具体地址
+
+
@@ -46,21 +46,16 @@
服务日期
-
+
- 2023/5/25
+ {{ item }}
-
+
-
-
- 2023/5/25
-
-
-
-
+
+
@@ -93,7 +88,7 @@
-
+
选择优惠
@@ -195,7 +190,7 @@
@@ -209,7 +204,27 @@
-
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+ 协议内容
+
+
+
+
+
+ 1、文字占位文字占位文字占位文字占位文字占位文字占位文字占位 2、文字占位文字占位文字占位文字占位文字占位文字占位文
+
+
@@ -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