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

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