diff --git a/api/address.js b/api/address.js index e25853e..d9875b9 100644 --- a/api/address.js +++ b/api/address.js @@ -3,17 +3,14 @@ import {host} from "@/config/host"; /** * 获取地址列表 - * @param page + * @param data * @returns {Promise | Promise} */ -export function getAddressList(page){ +export function getAddressList(data){ return request({ url:`${host}/user/address-list`, method: 'post', - data:{ - page: page, - limit: 10 - } + data:data }); } diff --git a/api/order.js b/api/order.js index 8267b44..fdbb95b 100644 --- a/api/order.js +++ b/api/order.js @@ -35,4 +35,19 @@ export function getOrderList(data = { method: 'post', data:data }) +} + +/** + * 匹配宠物店铺服务 + * @param data + * @returns {Promise} + */ +export function getStoreService(data = { + "address_id":"" +}){ + return request({ + url:"order/store-service", + method: 'post', + data:data + }) } \ No newline at end of file diff --git a/main.js b/main.js index 1ca15ea..9f9c955 100644 --- a/main.js +++ b/main.js @@ -14,35 +14,9 @@ app.$mount() // #ifdef VUE3 import uviewPlus from 'uview-plus' import { createSSRApp } from 'vue' -import { createStore } from 'vuex' import { title } from '@/config/host.js' -const store = createStore({ - state () { - return { - footCheck:'home', - title:title, - userInfo:{}, - userExtends:{}, - } - }, - getters:{ +import store from "@/store"; - }, - mutations: { - footCheck (state,check) { - state.footCheck = check - }, - title (state,title) { - state.title = title - }, - userInfo (state,userInfo) { - state.userInfo = userInfo - }, - userExtends (state,userExtends) { - state.userExtends = userExtends - }, - } -}) export function createApp() { const app = createSSRApp(App) app.use(uviewPlus) diff --git a/manifest.json b/manifest.json index 966ff91..3027d64 100644 --- a/manifest.json +++ b/manifest.json @@ -54,7 +54,16 @@ "setting" : { "urlCheck" : false }, - "usingComponents" : true + "usingComponents" : true, + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + }, + "scope.userFuzzyLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + }, + "requiredPrivateInfos": ["chooseLocation", "getLocation"] }, "mp-alipay" : { "usingComponents" : true diff --git a/pages/Addr/index.vue b/pages/Addr/index.vue index f142505..8be2b25 100644 --- a/pages/Addr/index.vue +++ b/pages/Addr/index.vue @@ -53,23 +53,23 @@ - - - - - --> + + + + + + + + + @@ -129,6 +129,11 @@ petImage: imghost + '/static/image/pet_avatar1.jpeg', addrList: [], type:'', + pages:{ + page:1, + limit:10, + }, + status:'loadmore', } }, onLoad(option) { @@ -226,11 +231,18 @@ url:url }) }, - getAddressList(page = 1){ - getAddressList(page).then(data => { - page === 1 - ? this.addrList = data.data - : this.addrList.push(data.data); + getAddressList(){ + if(this.status === 'nomore'){ + return false; + } + getAdressList(this.pages).then(res => { + this.addrList.push.apply(this.addrList,res.data) + this.pages.page++; + if(res.data.length === 0){ + this.status = 'nomore'; + }else{ + this.status = 'loadmore'; + } }); }, delAddress(id){ @@ -242,6 +254,9 @@ }) } }, + onReachBottom() { + this.getAddressList(); + }, onPageScroll(res) { if (res.scrollTop <= 20) { uni.$emit('isTop', true); diff --git a/pages/AddrDetail/index.vue b/pages/AddrDetail/index.vue index d47158f..fbb3a80 100644 --- a/pages/AddrDetail/index.vue +++ b/pages/AddrDetail/index.vue @@ -206,6 +206,7 @@ getDetail(id){ getDetail(id).then(data => { this.address = data.data; + this.address.position = data.data.province+data.data.city+data.data.district; }) }, selectAddress() { @@ -232,8 +233,10 @@ that.address.province = address.province; that.address.city = address.city; that.address.district = address.district; - that.address.position = res.address; + that.address.position = address.province+address.city+address.district; that.address.info = res.name; + that.address.lat = res.latitude; + that.address.lng = res.longitude; }); }, diff --git a/pages/OrderPage/index.vue b/pages/OrderPage/index.vue index 66e9086..2c63084 100644 --- a/pages/OrderPage/index.vue +++ b/pages/OrderPage/index.vue @@ -62,27 +62,20 @@ - + 增值服务 - - @@ -146,12 +139,12 @@ - + - - 专业服务 - 标准 + + {{item.name}} + {{parseFloat(item.price)}}/次 1、文字占位文字占位文字占位文字占位文字占位文字占位文字占位 2、文字占位文字占位文字占位文字占位文字占位文字占位文 + + + @@ -241,6 +237,7 @@ import {cardDetail} from "@/api/card"; import {getAddressList} from "@/api/address"; import image from "@/config/image"; + import {getStoreService} from "@/api/order"; export default { components: { HeaderNav, @@ -284,6 +281,12 @@ is_timeout: false, }], address:{}, + addServiceList:[], + basicServiceList:[], + pages:{ + page:1, + limit:10 + } } }, onLoad(options) { @@ -294,6 +297,18 @@ this.getDefaultAddress(); }, methods: { + showAddServicePopup(){ + this.$refs.addServicePopup.open(); + }, + selectAddService(item){ + + }, + getStoreServiceList(){ + getStoreService({address_id: this.address.id}).then(res => { + this.addServiceList = res.data.add_service; + this.basicServiceList = res.data.basic_service; + }); + }, getDefaultAddress() { let cacheAddress = uni.getStorageSync('address'); if (cacheAddress) { @@ -301,14 +316,16 @@ console.log(cacheAddress) this.address = cacheAddress; } else { - getAddressList({}).then(res => { + getAddressList(this.pages).then(res => { res.data.forEach(item => { if (item.is_default === 1) { this.address = item; } }); }) - console.log(this.address) + } + if(this.address.id){ + this.getStoreServiceList(); } }, delTime(index){ diff --git a/store.js b/store.js new file mode 100644 index 0000000..e1dfe69 --- /dev/null +++ b/store.js @@ -0,0 +1,31 @@ +import {title} from "@/config/host"; +import { createStore } from 'vuex' + +const store = createStore({ + state () { + return { + footCheck:'home', + title:title, + userInfo:{}, + userExtends:{}, + } + }, + getters:{ + + }, + mutations: { + footCheck (state,check) { + state.footCheck = check + }, + title (state,title) { + state.title = title + }, + userInfo (state,userInfo) { + state.userInfo = userInfo + }, + userExtends (state,userExtends) { + state.userExtends = userExtends + }, + } +}) +export default store; \ No newline at end of file diff --git a/uni_modules/uv-calendar/components/uv-calendar/header.vue b/uni_modules/uv-calendar/components/uv-calendar/header.vue index d7daa7b..75b7e5d 100644 --- a/uni_modules/uv-calendar/components/uv-calendar/header.vue +++ b/uni_modules/uv-calendar/components/uv-calendar/header.vue @@ -1,13 +1,6 @@