修改了搜索分页数据都一样的问题

parent f31edd22
......@@ -138,7 +138,7 @@ onLoad((option) => {
const { parentId, pic, categoryName } = option;
categoryNames.value = categoryName;
categoryId.value = parentId;
params.value.categoryId = [parentId];
params.value.categoryIds = [parentId];
pics.value = pic;
query(parentId);
prodSpecialFn();
......
......@@ -141,18 +141,18 @@
<view class="bz">
<text class="yh-name">保障:</text>
<view class="icon-box">
<i class="iconfont icon icon-rs-countdown" />
<image src="@/static/shop/icon-1.png" class="m-r"></image>
过期退
</view>
<view style="margin-left: 64rpx" class="icon-box">
<i class="iconfont icon icon-ic_business_refund24px" />
<image src="@/static/shop/icon-2.png" class="m-r"></image>
随时退
</view>
<view style="margin-left: 64rpx" class="icon-box">
<i class="iconfont icon icon-naozhong" />
<image src="@/static/shop/icon-3.png" class="m-r"></image>
随时用
</view>
<i @click="alert" class="iconfont jg icon-jinggao" />
<image style="margin-left: auto" @click="alert" src="@/static/shop/icon-4.png"></image>
</view>
<view class="xz">
<text class="yh-name">限制:</text>
......@@ -255,6 +255,7 @@
<script setup>
import { getProdDetail, getCollect, getCouponShopList, receiveCoupon } from '@/api/packageDetail';
import { getStoreInformation } from '@/api/shop';
import { getDistance } from '@/utils/common';
const prodInfo = ref({});
const prodRlue = ref({});
const myProdId = ref('');
......@@ -263,7 +264,7 @@ const showRlue = ref(true);
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const shopInfo = ref({});
const show = ref(false);
const currentLatitudeAndLongitude = ref({});
const shopLocation = ref({});
const shopId = ref('');
const showpopup = ref(false);
const prodSkusInfo = ref({});
......@@ -273,17 +274,21 @@ onLoad((options) => {
const { prodId } = options;
myProdId.value = prodId;
getProdDetailFn(prodId).then((shopId) => {
getStoreInformationFn(shopId);
getCouponShopListFn(prodId, shopId);
});
});
onShow(() => {
getStoreInformationFn(shopId).then((shopInfo) => {
// 获取位置
getLocationFn();
});
getCouponShopListFn(prodId, shopId);
});
});
function alert() {
if (productCoupons.value.length > 0) {
show.value = true;
} else {
xma.showToast({
title: '暂无优惠券',
icon: 'error',
});
}
}
/**
......@@ -391,8 +396,9 @@ function getLocationFn() {
xma.getLocation({
type: 'wgs84',
success: function (res) {
const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude;
const myLatitude = shopLocation.value.latitude;
const myLongitude = shopLocation.value.longitude;
console.log('myLongitude', myLatitude, myLongitude);
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
shopInfo.value.distance = distance;
},
......@@ -425,9 +431,11 @@ const getStoreInformationFn = (id) => {
getStoreInformation(id).then((res) => {
if (res.code === 0) {
shopInfo.value = res.data.shop;
if (res.data.shop.labels) {
shopInfo.value.tagList = res.data.shop.labels.split(',');
currentLatitudeAndLongitude.value.latitude = res.data.shop.location.lat;
currentLatitudeAndLongitude.value.longitude = res.data.shop.location.lon;
}
shopLocation.value.latitude = res.data.shop.location.lat;
shopLocation.value.longitude = res.data.shop.location.lon;
resolve();
}
});
......@@ -850,24 +858,19 @@ page {
display: flex;
align-items: center;
margin: 22rpx 0 32rpx 0;
image {
width: 14 * 2rpx;
height: 14 * 2rpx;
}
.icon-box {
display: flex;
align-items: center;
font-size: 11 * 2rpx;
color: #abaaaa;
.icon {
font-size: 38rpx;
font-weight: bold;
font-weight: 300;
color: #fa5151;
.m-r {
margin-right: 10rpx;
}
}
.jg {
font-size: 46rpx;
font-weight: bold;
margin-left: auto;
color: #abaaaa;
}
}
.xz {
font-size: 10 * 2rpx;
......
......@@ -46,6 +46,7 @@
</view>
<view class="score-icon">
<wd-rate
custom-class="icon-statr"
color="#fff"
readonly
v-model="shopInfo.grade"
......@@ -128,9 +129,10 @@
<text class="goods-title multi-line">{{ item.prodName }}</text>
<text class="yh-fl multi-line">{{ item.brief }}</text>
<text class="yh-time multi-line">{{ item.rule }}</text>
<view class="tag-list">
<view class="tag">{{ item.labelNames }}</view>
<!-- <view class="tag">随时退</view> -->
<view class="tag-list" v-if="item.labelNames.length > 0">
<view v-for="(lab, i) in item.labelNames" :key="i">
<text v-if="lab" class="tag" style="border-radius: 6rpx">{{ lab }}</text>
</view>
</view>
<view class="price">
<text class="num0">到手</text>
......@@ -180,6 +182,7 @@
<view class="u-pf">
<text>{{ item.descriptionMatches }}</text>
<wd-rate
custom-class="icon-statr"
color="#fff"
readonly
v-model="item.descriptionMatches"
......@@ -557,6 +560,9 @@ const groupBuyListFn = (shopId) => {
if (res.code === 0) {
listOfGroupBuyingProducts.value = res.data.map((item) => {
item.pic = imgUrl + item.pic;
item.labelNames = item.labelNames.split(',').filter((lab) => {
return lab !== '';
});
return item;
});
}
......@@ -887,6 +893,11 @@ page {
margin-left: 8rpx;
}
}
.icon-statr {
:v-deep(.wd-rate__item-star--active) {
overflow: visible !important;
}
}
}
.shop-business-hours {
texe {
......@@ -1106,7 +1117,7 @@ page {
background: #fcdbdb;
padding: 2rpx 8rpx;
box-sizing: border-box;
font-size: 8 * 2rpx;
font-size: 12 * 2rpx;
color: #fa5151;
margin-right: 8rpx;
}
......@@ -1206,6 +1217,11 @@ page {
.u-pf {
display: flex;
align-items: center;
.icon-statr {
:v-deep(.wd-rate__item-star--active) {
overflow: visible !important;
}
}
text {
color: #fa5151;
font-weight: 700;
......
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