Commit 66866a63 authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents da0d1b44 840c2c7d
......@@ -38,7 +38,7 @@ const selectItem = (index, categoryId) => {
position: absolute;
top: 100%;
// width: 100%;
// height: 212rpx;
max-height: 780rpx;
border-radius: 0rpx 0rpx 16rpx 16rpx;
background: #ffffff;
box-shadow: 0rpx 16rpx 16rpx 0rpx rgba(73, 73, 73, 0.14);
......@@ -47,6 +47,7 @@ const selectItem = (index, categoryId) => {
display: flex;
padding-bottom: 20rpx;
box-sizing: border-box;
overflow-y: scroll;
.ul {
padding-left: 60rpx;
li {
......
......@@ -123,7 +123,7 @@ const selectItem2 = (index, area) => {
position: absolute;
top: 100%;
// width: 710rpx;
min-height: 780rpx;
height: 780rpx;
border-radius: 0rpx 0rpx 16rpx 16rpx;
background: #ffffff;
box-shadow: 0rpx 16rpx 16rpx 0rpx rgba(73, 73, 73, 0.14);
......@@ -188,6 +188,8 @@ const selectItem2 = (index, area) => {
}
.ul {
padding-left: 60rpx;
overflow-y: scroll;
height: 65%;
li {
list-style-type: none;
font-size: 22rpx;
......
......@@ -102,3 +102,29 @@ export function prodSpecial(data) {
data,
});
}
// 领券中心-分类列表
export function getCoupon() {
return request({
url: `/sgyrdd/dict/key/coupon_classify`,
method: 'GET',
});
}
// 领券中心-店铺商品列表分页
export function getShopAndProdPage(data) {
return request({
url: `/sgyrdd/couponShop/shopAndProdPage`,
method: 'GET',
data,
});
}
// 获取指定类型轮播图
export function getByType(data) {
return request({
url: `/sgyrdd/carousel/getByType`,
method: 'GET',
data,
});
}
......@@ -5,7 +5,7 @@
"^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue"
}
},
"pages": [ // pages 数组中第一项表示应用启动页
"pages": [
{
"path": "pages/index/index",
"style": {
......@@ -96,7 +96,8 @@
{
"path": "pages/index/coupon",
"style": {
"navigationBarTitleText": "优惠券详情"
"navigationBarTitleText": "优惠券详情",
"enablePullDownRefresh": true
}
}
,
......
<template>
<view class="container">
<scroll-view class="tabs" scroll-x="true" @scroll="scroll">
<text class="tab" v-for="(item, index) in tabs" :key="index">{{ item }}</text>
<text
@tap="choice(index, item.value)"
class="tab"
:class="{ light: active === index }"
v-for="(item, index) in tabs"
:key="index"
>
{{ item.label }}
</text>
</scroll-view>
<view class="itemBox">
<view class="item"></view>
<view class="item" v-for="(item, index) in listData" :key="index">
<image class="commodity" :src="item.shopLogo" mode="aspectFill" />
<view class="describe">
<text class="title">{{ item.shopName }}</text>
<view class="oneBox">
<text class="price">{{ item.price }}</text>
<view class="afterTheCoupon">
<text class="afterTheCoupon1">券后¥</text>
<text class="afterTheCoupon2">{{ item.price - item.reduceAmount }}</text>
</view>
</view>
<view class="twoBox">
<text class="coupon">商家券</text>
<text class="discounted">已优惠¥{{ item.reduceAmount }}</text>
</view>
<view class="threeBox">
<text class="fullReduction">{{ item.couponName }}</text>
<view class="receive">领劵</view>
</view>
</view>
</view>
<view
style="width: 100%; text-align: center; font-size: 24rpx; margin: 10rpx 0; color: #888989"
v-if="show"
>
没有更多啦~
</view>
</view>
</view>
</template>
<script setup>
import {} from 'vue';
import { getCoupon, getShopAndProdPage } from '../../api/index';
const tabs = ref(['推荐', '附近美食', '果蔬生鲜', '数码商城', '小吃快餐', '数码商城', '餐饮券']);
const params = {
current: 1,
size: 6,
lng: 106.68650025025502,
lat: 26.567192352601154,
};
let total;
const active = ref(0);
const listData = ref([]);
const show = ref(false);
// 获取优惠券
onMounted(() => {
getCoupons();
getShop();
});
// 数据重置
const reset = () => {
params.current = 1;
params.size = 6;
listData.value = [];
show.value = false;
};
const choice = (index, value) => {
reset();
active.value = index;
if (value === '999') {
delete params.classification;
} else {
params.classification = value;
}
getShop();
// emit('nearby', distance);
};
// 领券中心-分类列表
const getCoupons = () => {
getCoupon().then((res) => {
res.data.unshift({ label: '推荐', value: '999' });
tabs.value = res.data;
console.log('优惠券', res);
});
};
// 领券中心-店铺商品列表分页
const getShop = () => {
xma.showLoading({
title: '加载中',
});
getShopAndProdPage(params).then((res) => {
xma.hideLoading();
total = res.data.total;
res.data.records.forEach((item) => {
item.pic = import.meta.env.VITE_APP_IMG_URL + item.pic;
item.shopLogo = import.meta.env.VITE_APP_IMG_URL + item.shopLogo;
});
console.log('优惠券', res);
listData.value = [...listData.value, ...res.data.records];
});
};
onPullDownRefresh(() => {
getCoupons();
getShop();
});
onReachBottom(() => {
if (listData.value.length < total) {
params.current++;
getShop();
return;
}
show.value = true;
});
</script>
<style lang="scss" scoped>
......@@ -29,19 +136,126 @@ page {
color: #333333;
font-weight: bold;
background: white;
position: sticky;
top: 0;
z-index: 99;
.tab {
display: inline-block;
margin-right: 40rpx;
}
.light {
color: #f12a2a;
}
}
.itemBox {
padding: 0 23rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-top: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item {
width: 341rpx;
height: 674rpx;
// height: 674rpx;
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-bottom: 18rpx;
box-sizing: border-box;
padding-bottom: 20rpx;
.commodity {
width: 341rpx;
height: 401rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
}
.describe {
padding: 0 12rpx;
box-sizing: border-box;
.title {
font-weight: bold;
color: #333333;
font-size: 26rpx;
font-family:
PingFang SC,
PingFang SC;
}
.oneBox {
display: flex;
align-items: end;
margin: 20rpx 0;
.price {
font-weight: bold;
color: #f12a2a;
font-size: 28rpx;
}
.afterTheCoupon {
border-radius: 21rpx 21rpx 21rpx 21rpx;
// height: 41rpx;
text-align: center;
padding: 0 10rpx;
background: #f12a2a;
margin-left: 20rpx;
display: flex;
align-items: center;
.afterTheCoupon1 {
color: #ffffff;
font-size: 20rpx;
}
.afterTheCoupon2 {
color: #ffffff;
font-size: 36rpx;
}
}
}
.twoBox {
display: flex;
align-items: center;
.coupon {
text-align: center;
height: 32rpx;
font-size: 22rpx;
line-height: 32rpx;
min-width: 73rpx;
color: #ffffff;
border-radius: 6rpx 6rpx 6rpx 6rpx;
background: linear-gradient(90deg, #ff4d33 0%, #ff1d2e 100%);
}
.discounted {
font-size: 20rpx;
min-width: 136rpx;
height: 28rpx;
color: #f12a2a;
font-weight: 400;
background: #feebf0;
border-radius: 6rpx 6rpx 6rpx 6rpx;
line-height: 28rpx;
text-align: center;
}
}
.threeBox {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 13rpx;
.fullReduction {
font-size: 20rpx;
font-family:
PingFang SC,
PingFang SC;
font-weight: 400;
color: #f12a2a;
}
.receive {
background: linear-gradient(90deg, #ff4d33 0%, #ff1d2e 100%);
border-radius: 20rpx 20rpx 20rpx 20rpx;
height: 35rpx;
width: 81rpx;
text-align: center;
line-height: 35rpx;
color: #ffffff;
font-size: 24rpx;
}
}
}
}
}
}
......
......@@ -50,7 +50,7 @@
<view class="bootom">
<view class="bootom-top">
<view class="option" @tap="locationFiltering(0)">
<text :class="{ rotate: rotate }">全部烧烤烤肉</text>
<text :class="{ rotate: rotate }">全部{{ categoryNames }}</text>
<wd-icon
:class="{ rotate: rotate }"
name="fill-arrow-down"
......@@ -117,6 +117,7 @@ const isLoadReachBottom = ref(null);
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']);
const active = ref(null);
const categoryNames = ref('');
const categoryData = ref([]);
const rotate = ref(false);
const rotate2 = ref(false);
......@@ -134,16 +135,15 @@ const params = ref({
});
const pics = ref(null);
onLoad((option) => {
const { parentId, pic } = option;
const { parentId, pic, categoryName } = option;
categoryNames.value = categoryName;
categoryId.value = parentId;
params.value.categoryId = [parentId];
pics.value = pic;
query(parentId);
prodSpecialFn();
});
onMounted(() => {
getLocationFn().then((res) => {
const { lat, lon } = res;
getMerchantList(lat, lon);
getMerchantList();
});
});
// distance参数来源
......@@ -238,7 +238,7 @@ function jumpProductDetails(prodId) {
const prodSpecialFn = () => {
prodSpecial({ categoryId: categoryId.value }).then((res) => {
res.data.data = res.data.data.map((el) => {
if (el.labels) {
if (el.labels && el.labels !== '') {
el.labels = el.labels.split(',');
}
return el;
......@@ -310,6 +310,8 @@ function getLocationFn() {
type: 'wgs84',
isHighAccuracy: true,
success: function (res) {
params.value.lat = res.latitude;
params.value.lon = res.longitude;
// 经纬度
resolve({ lat: res.latitude, lon: res.longitude });
},
......@@ -440,10 +442,14 @@ page {
box-sizing: border-box;
margin-left: auto;
margin-right: 20rpx;
display: flex;
justify-content: center;
align-items: center;
.text3 {
font-size: 20rpx;
color: #fa5151;
line-height: 47rpx;
text-align: center;
margin-left: 14rpx;
}
.qiang {
......
......@@ -9,7 +9,7 @@
<view class="classification">
<view class="classification-top">
<view
@tap="jingang(item.categoryId, item.pic)"
@tap="jingang(item.categoryId, item.pic, item.categoryName)"
class="choice"
v-for="(item, index) in classificationT"
:key="index"
......@@ -20,7 +20,7 @@
</view>
<view class="classification-bottom">
<view
@tap="jingang(item.categoryId, item.pic)"
@tap="jingang(item.categoryId, item.pic, item.categoryName)"
class="choice"
v-for="(item, index) in classificationB"
:key="index"
......@@ -138,6 +138,12 @@
<Marketing />
<!-- 美食卡片 -->
<FoodDetails :cardData="cardData2" />
<view
style="width: 100%; text-align: center; font-size: 24rpx; margin: 10rpx 0; color: #888989"
v-if="show"
>
没有更多啦~
</view>
</view>
</template>
......@@ -167,7 +173,7 @@ const { countInfo, addCount } = useCountStore();
// 附近美食
const foodNearbyData = ref([]);
const tabsData = ref([]);
const show = ref(false);
const light = ref(0);
const rotate = ref(false);
const classificationT = ref([
......@@ -196,6 +202,7 @@ const listParams = {
lat: 26.567192352601154,
};
const coupon = ref([]);
let total;
// 轮播图数据
let lunboData;
onMounted(() => {
......@@ -306,16 +313,58 @@ const recommendedClassification = () => {
tabsData.value.unshift({ categoryName: '推荐' });
});
};
// 重置数据
const reset = () => {
listParams.current = 1;
shopCardData.value = {};
cardData.value = [];
cardData1.value = [];
cardData2.value = [];
show.value = false;
};
// 商家列表分页-搜索列表
const getMerchantList = () => {
xma.showLoading({
title: '加载中',
});
merchantList(listParams).then((res) => {
xma.hideLoading();
total = res.data.totalElements;
res.data.content.forEach((item) => {
item.shopLogo = import.meta.env.VITE_APP_IMG_URL + item.shopLogo;
if (item.evaluationVos.length > 0) {
item.simpleProds.forEach((item) => {
item.avatar = import.meta.env.VITE_APP_IMG_URL + item.avatar;
});
}
if (item.simpleProds.length > 0) {
item.simpleProds.forEach((item) => {
item.pic = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
}
if (item.labels) {
item.labels = item.labels.split(',');
}
});
shopCardData.value = res.data.content[0];
cardData.value = res.data.content.slice(1, 3);
cardData1.value = res.data.content.slice(3, 5);
cardData2.value = res.data.content.slice(5);
});
};
// 商家列表分页-搜索列表(分页)
const getMerchantListPaging = () => {
// const data = {
// current: 1,
// size: 10,
// lon: 106.68650025025502,
// lat: 26.567192352601154,
// };
xma.showLoading({
title: '加载中',
});
merchantList(listParams).then((res) => {
console.log('商家列表', res);
xma.hideLoading();
res.data.content.forEach((item) => {
item.shopLogo = import.meta.env.VITE_APP_IMG_URL + item.shopLogo;
if (item.evaluationVos.length > 0) {
......@@ -332,15 +381,13 @@ const getMerchantList = () => {
item.labels = item.labels.split(',');
}
});
shopCardData.value = res.data.content[0];
cardData.value = res.data.content.slice(1, 3);
cardData1.value = res.data.content.slice(3, 5);
cardData2.value = res.data.content.slice(5);
cardData2.value = [...cardData2.value, ...res.data.content];
});
};
// distance参数来源
const nearby = (distance) => {
console.log('distance', distance);
reset();
if (distance === 0) {
delete listParams.distance;
} else {
......@@ -351,6 +398,7 @@ const nearby = (distance) => {
// communityName参数来源
const popular = (communityName) => {
console.log('communityName', communityName);
reset();
listParams.communityName = communityName;
if (listParams.area) {
delete listParams.area;
......@@ -360,6 +408,7 @@ const popular = (communityName) => {
// area参数来源
const region = (area) => {
console.log('area', area);
reset();
listParams.area = area;
if (listParams.communityName) {
delete listParams.communityName;
......@@ -368,6 +417,7 @@ const region = (area) => {
};
// tabs
const choice = (index, categoryId) => {
reset();
light.value = index;
listParams.categoryIds = [categoryId];
if (index === 0) {
......@@ -376,7 +426,7 @@ const choice = (index, categoryId) => {
getMerchantList();
};
// 金刚区分类选择
const jingang = (id, pic) => {
const jingang = (id, pic, categoryName) => {
// switch (index) {
// case 0:
// xma.navigateTo({
......@@ -390,7 +440,7 @@ const jingang = (id, pic) => {
// xma.navigateTo({});
// }
xma.navigateTo({
url: `/pages/index/foodClassification?parentId=${id}&pic=${pic}&page=index`,
url: `/pages/index/foodClassification?parentId=${id}&pic=${pic}&page=index&categoryName=${categoryName}`,
});
};
const locationFiltering = () => {
......@@ -398,22 +448,22 @@ const locationFiltering = () => {
};
const handleClick = (e) => {
const index = e.index;
if (index === 0) {
xma.navigateTo({
url: '/pages/index/listFood?type=1',
});
}
xma.navigateTo({
url: lunboData[index].link,
});
};
const onChange = (e) => {
// console.log(e);
};
// function toUIComponentsDoc() {
// window.open('https://wot-design-uni.netlify.app/component/button.html');
// }
// function onHandleClick() {
// addCount();
// }
// 触底加载
onReachBottom(() => {
if (cardData2.value.length + 5 < total) {
listParams.current++;
getMerchantListPaging();
return;
}
show.value = true;
});
</script>
<style lang="scss" scoped>
......@@ -665,7 +715,9 @@ page {
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
margin: 0 auto;
margin-top: 10rpx;
position: relative;
position: sticky;
top: 0;
z-index: 99;
uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
display: none;
......
......@@ -64,7 +64,7 @@ import FoodDetails from '../../components/index/FoodDetails.vue';
import Classification from '../../components/index/Classification.vue';
import Position from '../../components/index/Position.vue';
import Sort from '../../components/index/Sort.vue';
import { merchantList, getByParentId } from '../../api/index';
import { merchantList, getByParentId, getByType } from '../../api/index';
const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']);
const active = ref(null);
......@@ -87,19 +87,12 @@ onMounted(() => {
});
onLoad((options) => {
const { type } = options;
switch (type) {
case '1':
topBg.value = 'url(../../static/index/taste.png)';
paramsId.parentId = '3262';
getByParentIdData();
break;
case '2':
topBg.value = 'url(../../static/index/foodBg.png)';
paramsId.parentId = '3263';
getByParentIdData();
break;
}
const { categoryId, place } = options;
paramsId.parentId = categoryId;
getByParentIdData();
getByType({ place }).then((res) => {
topBg.value = `url(${import.meta.env.VITE_APP_IMG_URL + res.data[0].imgUrl})`;
});
});
// distance参数来源
const nearby = (distance) => {
......@@ -212,7 +205,8 @@ page {
}
.head {
width: 100%;
height: 480rpx;
margin-bottom: 10rpx;
// height: 480rpx;
.top {
height: 356rpx;
// background: url('../../static/index/taste.png');
......@@ -225,7 +219,8 @@ page {
}
}
.bootom {
height: 124rpx;
// height: 124rpx;
height: 80rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
......
......@@ -52,11 +52,12 @@
<view v-if="item.numState === 0" class="btn" @click="getCoupon(item)">
立即领取
</view>
<i
<!-- <i
v-else
class="iconfont icon-lianhe40"
style="font-size: 120rpx; color: #efefef"
></i>
></i> -->
<image v-else class="ylq-icon" src="@/static/shop/yl.png"></image>
</view>
</view>
<view class="foot">
......@@ -121,10 +122,16 @@
<view class="yh">
<text class="yh-name">优惠:</text>
<view class="bt-icon">
<image src="@/static/shop/bt-icon.png"></image>
<!-- <image src="@/static/shop/bt-icon.png"></image>
<text class="yh-name lj">
{{ productCoupons[0].thresholdAmount }}{{ productCoupons[0].discountValue }}
</text>
</text> -->
<view class="subsidy">
<image mode="aspectFill" src="@/static/shop/subsidy.png" />
<text class="multi-line">
{{ productCoupons[0].thresholdAmount }}{{ productCoupons[0].discountValue }}
</text>
</view>
</view>
<view class="ylq-icon" @click="showpopup = true">
{{ productCoupons[0].numState === 0 ? '未领取' : '已领取' }}
......@@ -602,7 +609,7 @@ page {
.headbox {
display: flex;
justify-content: space-between;
align-items: end;
align-items: center;
height: 50rpx;
.time {
......@@ -611,6 +618,10 @@ page {
color: #999999;
line-height: 20rpx;
}
.ylq-icon {
width: 64 * 2rpx;
height: 64 * 2rpx;
}
.btn {
padding: 20rpx;
......@@ -634,7 +645,7 @@ page {
gap: 14rpx;
.line {
border-top: 2rpx solid #f2f2f2;
// border-top: 2rpx solid #f2f2f2;
}
.footbox {
......@@ -793,9 +804,34 @@ page {
position: absolute;
right: 14rpx;
height: 11 * 2rpx;
text-align: center;
line-height: 22rpx;
top: calc(50% - 11rpx);
}
.subsidy {
width: 144 * 2rpx;
height: 22 * 2rpx;
position: relative;
image {
position: absolute;
width: 65 * 2rpx;
height: 22 * 2rpx;
top: 0;
left: 0;
}
text {
border: 1rpx solid #fa5151;
right: 14rpx;
height: 20 * 2rpx;
position: absolute;
font-size: 11 * 2rpx;
line-height: 22 * 2rpx;
top: 0;
text-align: center;
left: 65 * 2rpx;
color: #fa5151;
}
}
}
}
.ylq-icon {
......
......@@ -172,28 +172,36 @@ const orderInfo = ref({});
const activeCouponInfo = ref({});
const activeCouponId = ref('');
const outTradeNos = ref(null);
const prodIds = ref(null);
const skuIds = ref(null);
// 商品优惠券
const productCoupons = ref([]);
onLoad((options) => {
const { prodId, skuId } = options;
prodIds.value = prodId;
skuIds.value = skuId;
groupBuyConfirmFn(prodId, skuId);
});
onShow(() => {
if (outTradeNos.value) {
// 查询订单状态决定是否支付
getOrderDetail({ orderNumber: outTradeNos.value }).then((res) => {
switch (res.data.status) {
switch (res.data.baseOrder.subStatus) {
case '1':
xma.showToast({
title: '支付失败',
icon: 'error',
duration: 2000,
success() {
groupBuyConfirmFn(prodIds.value, skuIds.value);
},
});
break;
case '2':
xma.redirectTo({
url: `/pages/shop/paymentSuccessful?outTradeNos=${outTradeNos.value}`,
});
break;
case '3':
xma.redirectTo({
url: `/pages/shop/paymentSuccessful?outTradeNos=${outTradeNos.value}`,
......@@ -268,10 +276,24 @@ function submitOrder() {
};
groupBuyCreate(params).then((res) => {
if (res.code === 0) {
let timeout = null;
const start = new Date().getTime();
const { paymentUrl, outTradeNo } = res.data.result;
console.log('merchantNo', outTradeNo);
outTradeNos.value = outTradeNo;
window.location.href = paymentUrl;
timeout = setTimeout(function () {
const end = new Date().getTime();
// 如果超时未打开应用,则假设未安装
if (end - start < 1000) {
xma.showToast({
title: '未安装App',
icon: 'none',
});
}
}, 1500);
// window.open(paymentUrl);
// plus.runtime.openURL(paymentUrl);
}
......
......@@ -31,26 +31,33 @@
import Header from '@/pages/order/components/Header/index.vue';
import { getOrderDetail, getShopDetail, getProdDetail } from '@/api/order';
import QRCode from 'qrcode';
const myOutTradeNos = ref('');
/**
* 获取订单详情
*/
const orderDetail = ref();
onLoad((options) => {
const { outTradeNos } = options;
getOrderDetailFn('NEONO-2024080509591318964');
myOutTradeNos.value = outTradeNos;
getOrderDetailFn(outTradeNos);
});
function getOrderDetailFn(orderNumber) {
getOrderDetail({ orderNumber }).then((res) => {
orderDetail.value = res.data;
const outTradeNo = res.data.orderNumber;
orderDetail.value = res.data.baseOrder;
orderDetail.value.orderItems = res.data.orderItems;
orderDetail.value.orderStore = res.data.orderStore;
const outTradeNo = res.data.baseOrder.orderNumber;
const indexOfDash = outTradeNo.indexOf('-');
if (indexOfDash !== -1) {
res.data.orderNumber = outTradeNo.substring(indexOfDash + 1);
res.data.baseOrder.orderNumber = outTradeNo.substring(indexOfDash + 1);
} else {
console.log(`订单编号 ${outTradeNo} 中没有找到 "-" 符号。`);
}
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber);
if (
orderDetail.value.orderStore.status === '2' ||
orderDetail.value.orderStore.status === '3'
) {
codeDetail(orderNumber);
}
getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId);
......
......@@ -86,7 +86,7 @@
<view class="subsidy-content" @click="jumpPage">
<view class="subsidy">
<image mode="aspectFill" src="@/static/shop/subsidy.png" />
<text>{{ merchantCoupons.activityName }}</text>
<text class="multi-line">{{ merchantCoupons.activityName }}</text>
</view>
<view class="more">
<text>更多</text>
......@@ -215,6 +215,19 @@
</view>
</view>
</view>
<view
style="
width: 100%;
text-align: center;
font-size: 24rpx;
margin-top: 10rpx;
color: #888989;
"
v-if="commentList.length === 0"
>
没有更多啦~
</view>
<view @tap="viewAll" v-if="commentList.length < commentTotal" class="u-more">
查看全部{{ commentTotal }}条评价
</view>
......@@ -261,7 +274,7 @@
</view>
</scroll-view>
</view>
<view class="tj-more">
<view class="tj-more" @click="jumpListPage">
<text>查看更多</text>
<wd-icon name="arrow-right" size="16px"></wd-icon>
</view>
......@@ -341,6 +354,11 @@ const handleClick = (e) => {
const imgSrc = shopSwiperList.value[index];
previewImage(imgSrc);
};
function jumpListPage() {
xma.navigateTo({
url: `/pages/index/foodClassification?parentId=${activeId.value}&page=shop&pic=''`,
});
}
const onChange = (e) => {};
function scroll(e) {
old.scrollTop = e.detail.scrollTop;
......@@ -354,7 +372,7 @@ function peripheryRecomFn() {
const lat = currentLatitudeAndLongitude.value.latitude;
// 经度
const lon = currentLatitudeAndLongitude.value.longitude;
peripheryRecom({ lat, lon, distance: 200 }).then((res) => {
peripheryRecom({ lat, lon, distance: 10 }).then((res) => {
if (res.code === 0) {
recommendedTypesOfPeripherals.value = res.data;
const id = recommendedTypesOfPeripherals.value[0].categoryId;
......@@ -370,8 +388,12 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
lat,
lon,
categoryIds,
distance: 200,
distance: 10,
};
xma.showLoading({
title: '加载中',
mask: true,
});
sgyrddShopPage(params).then((res) => {
if (res.code === 0) {
res.data.content = res.data.content
......@@ -385,6 +407,7 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
return item !== '';
});
recommendedListOfPeripherals.value = res.data.content;
xma.hideLoading();
}
});
}
......@@ -449,7 +472,9 @@ const getStoreInformationFn = (id) => {
if (res.code === 0) {
shopInfo.value = res.data.shop;
shopSwiperList.value = res.data.imgList.map((item) => imgUrl + item.imgUrl);
shopInfo.value.tagList = res.data.shop.labels.split(',');
if (res.data.shop.labels && 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;
resolve();
......@@ -590,6 +615,10 @@ const giveTheThumbs = (item, index) => {
* 查看全部评论
*/
const viewAll = () => {
xma.showLoading({
title: '加载中...',
mask: false,
});
getEvaluationPage({
current: 1,
size: commentTotal.value,
......@@ -599,6 +628,7 @@ const viewAll = () => {
commentList.value = res.data.records.map((item) => {
item.avatar = addImgUrlPrefix(imgUrl, item.avatar);
item.images = addImgUrlPrefixToImages(imgUrl, item.images);
xma.hideLoading();
return item;
});
}
......@@ -853,18 +883,21 @@ page {
position: relative;
image {
position: absolute;
width: 144 * 2rpx;
width: 84 * 2rpx;
height: 54 * 2rpx;
top: calc(50% - 54rpx);
left: 0;
}
text {
border: 1rpx solid #fa5151;
right: 14rpx;
height: 28 * 2rpx;
position: absolute;
font-size: 11 * 2rpx;
line-height: 54 * 2rpx;
height: 54 * 2rpx;
top: calc(50% - 54rpx);
line-height: 28 * 2rpx;
top: calc(50% - 28rpx);
text-align: center;
left: 84 * 2rpx;
color: #fa5151;
}
}
......
src/static/shop/subsidy.png

9.04 KB | W: | H:

src/static/shop/subsidy.png

8.6 KB | W: | H:

src/static/shop/subsidy.png
src/static/shop/subsidy.png
src/static/shop/subsidy.png
src/static/shop/subsidy.png
  • 2-up
  • Swipe
  • Onion skin
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