动态传入页面参数

parent 2130e576
......@@ -294,7 +294,7 @@ const activeId = ref(1);
const shopInfo = ref({});
// 店铺轮播图
const shopSwiperList = ref([]);
// 当前位置的经纬度
// 当前位置的经纬度-// 店铺的经纬度
const currentLatitudeAndLongitude = ref({ latitude: 0, longitude: 0 });
// 团购商品列表
const listOfGroupBuyingProducts = ref([]);
......@@ -304,7 +304,7 @@ const merchantCoupons = ref({});
const params = ref({
current: 1,
size: 3,
shopId: '1626126617850544129',
shopId: '',
isEnd: false,
});
const isLoadReachBottom = ref(null);
......@@ -320,11 +320,12 @@ const tagList2 = ref([{ name: '免费停车', id: 1 }]);
// 周边推荐-商家列表
const recommendedListOfPeripherals = ref([]);
onLoad((options) => {
getStoreInformationFn('1626126617850544129').then(() => {
params.value.shopId = options.shopId;
getStoreInformationFn(options.shopId).then(() => {
peripheryRecomFn();
});
groupBuyListFn('1626126617850544129');
couponShopListFn('1626126617850544129');
groupBuyListFn(options.shopId);
couponShopListFn(options.shopId);
getEvaluationPageFn();
});
onShow(() => {
......@@ -355,16 +356,16 @@ function peripheryRecomFn() {
recommendedTypesOfPeripherals.value = res.data;
const id = recommendedTypesOfPeripherals.value[0].categoryId;
activeId.value = id;
sgyrddShopPageFn(id);
sgyrddShopPageFn(id, lat, lon);
}
});
}
function sgyrddShopPageFn(categoryIds) {
function sgyrddShopPageFn(categoryIds, lat, lon) {
const params = {
current: 1,
size: 15,
lat: '106.68650025025502',
lon: '26.567192352601154',
lat,
lon,
categoryIds,
distance: 200,
};
......@@ -391,7 +392,7 @@ function getLocationFn() {
success: function (res) {
// 经纬度
console.log('res.latitude, res.longitude', res.latitude, res.longitude);
// 店铺的经纬度
const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment