Commit 3ff7e9e9 authored by 周俊涛(东信)'s avatar 周俊涛(东信)
parents 2bd96308 c1a2085d
......@@ -3,31 +3,62 @@
<view class="date">出发日期</view>
<ul class="ul">
<li
v-for="(item, index) in items"
v-for="(item, index) in dataList"
:key="index"
:class="{ active: selectedItem === index }"
@tap="selectItem(index)"
@tap="selectItem(index, item)"
>
{{ item }}
</li>
<wd-calendar use-default-slot v-model="value" @confirm="handleConfirm4">
<li>选择日期</li>
</wd-calendar>
</ul>
</view>
</template>
<script setup>
import { defineProps } from 'vue';
const items = reactive(['日期不限', '今天', '明天', '一周内', '一月内', '本周末', '七夕节']);
import { defineProps, onMounted } from 'vue';
import { getStartDate } from '@/api/assistingAgriculture/village';
const selectedItem = ref(null);
const emit = defineEmits(['dataParams']);
const dataList = ref([]);
const value = ref('');
const formatValue = ref('');
const params = {
current: 1,
size: 10,
};
const props = defineProps({
width: {
type: String,
default: '100%',
},
});
const selectItem = (selectItem) => {
selectedItem.value = selectItem;
onMounted(async () => {
getStartDateList();
});
const selectItem = (index, item) => {
console.log('item', item);
selectedItem.value = index;
emit('dataParams', item);
};
// 查询出发日期
const getStartDateList = () => {
getStartDate(params).then((res) => {
console.log('res.data', res.data);
const transformedData = Object.keys(res.data).reduce((acc, key) => {
acc[key] = { [key]: res.data[key] };
return acc;
}, {});
dataList.value = res.data;
console.log(Object.keys(dataList.value, 232));
});
};
function handleConfirm4({ value }) {
formatValue.value = new Date(value).toString();
}
</script>
<style lang="scss" scoped>
......
<template>
<view class="sort" :style="{ width: width }">
<view class="date">景点</view>
<ul class="ul">
<li
v-for="(item, index) in placeList"
:key="index"
:class="{ active: selectedItem === index }"
@tap="selectItem(index)"
@tap="selectItem(index, item)"
>
{{ item.brief }}
{{ item.attractionName }}
</li>
</ul>
</view>
......@@ -18,7 +17,7 @@
import { defineProps, onMounted } from 'vue';
import { getTour } from '@/api/assistingAgriculture/village';
const placeList = ref([]);
const emit = defineEmits(['sortParams']);
const emit = defineEmits(['placeParams']);
const selectedItem = ref(null);
const props = defineProps({
width: {
......@@ -31,11 +30,11 @@ onMounted(async () => {
});
const selectItem = (index, item) => {
selectedItem.value = index;
emit('sortParams', item);
emit('placeParams', item);
};
// 查询景点
const getTourList = () => {
getTour({ prodId: 0 }).then((res) => {
getTour().then((res) => {
placeList.value = res.data;
});
};
......
<template>
<view class="sort" :style="{ width: width }">
<view class="date">筛选</view>
<view class="date">出发城市</view>
<ul class="ul">
<li
v-for="(item, index) in items"
v-for="(item, index) in screenList"
:key="index"
:class="{ active: selectedItem === index }"
@tap="selectItem(index)"
@tap="selectItem(index, item, 'screen')"
>
{{ item }}
{{ item.tripCity }}
</li>
</ul>
<view class="date">服务承诺</view>
<ul class="ul">
<li
v-for="(item, index) in serveList"
:key="index"
:class="{ active: selectedItem1 === index }"
@tap="selectItem(index, item, 'serve')"
>
{{ item.labelName }}
</li>
</ul>
<view class="date">适用人群</view>
<ul class="ul">
<li
v-for="(item, index) in peopleList"
:key="index"
:class="{ active: selectedItem2 === index }"
@tap="selectItem(index, item, 'people')"
>
{{ item.labelName }}
</li>
</ul>
</view>
</template>
<script setup>
import { defineProps } from 'vue';
const items = reactive([
'智能排序',
'距离优先',
'好评优先',
'销量优先',
'低价优先',
'低价优先',
'距离优先',
'好评优先',
'销量优先',
'低价优先',
'距离优先',
]);
import { defineProps, onMounted, ref } from 'vue';
import { screeningConditions } from '@/api/assistingAgriculture/village';
const emit = defineEmits(['screenParams']);
const selectedItem = ref(null);
const selectedItem1 = ref(null);
const selectedItem2 = ref(null);
const screenList = ref([]);
const serveList = ref([]);
const peopleList = ref([]);
const props = defineProps({
width: {
type: String,
default: '100%',
},
});
const selectItem = (selectItem) => {
selectedItem.value = selectItem;
onMounted(async () => {
getScreeningConditions();
});
const selectItem = (index, item, type) => {
if (type === 'screen') {
selectedItem.value = index;
} else if (type === 'serve') {
selectedItem1.value = index;
} else if (type === 'people') {
selectedItem2.value = index;
}
emit('screenParams', item, type);
};
// 查询出发日期
const getScreeningConditions = () => {
screeningConditions().then((res) => {
screenList.value = res.data.startCityList;
serveList.value = res.data.serviceList;
peopleList.value = res.data.forPeopleList;
});
};
</script>
......@@ -68,7 +102,6 @@ const selectItem = (selectItem) => {
letter-spacing: 0em;
font-variation-settings: 'opsz' auto;
font-feature-settings: 'kern' on;
color: #fa5151;
margin-left: 44rpx;
margin-top: 20rpx;
}
......
......@@ -5,7 +5,7 @@
v-for="(item, index) in items"
:key="index"
:class="{ active: selectedItem === index }"
@tap="selectItem(index)"
@tap="selectItem(index, item)"
>
{{ item.name }}
</li>
......@@ -16,11 +16,11 @@
<script setup>
import { defineProps } from 'vue';
const items = ref([
{ name: '距离优先', sortModel: 1 },
{ name: '好评优先', sortModel: 2 },
{ name: '销量优先', sortModel: 3 },
{ name: '低价优先', sortModel: 4 },
{ name: '高价优先', sortModel: 5 },
{ name: '距离优先', sortMode: 1 },
{ name: '好评优先', sortMode: 2 },
{ name: '销量优先', sortMode: 3 },
{ name: '低价优先', sortMode: 4 },
{ name: '高价优先', sortMode: 5 },
]);
const emit = defineEmits(['sortParams']);
const selectedItem = ref(null);
......
import { request } from '../../utils/request';
// 查询评论详情
export function evaluationGetById(data) {
return request({
url: `/sgyrdd/evaluation/getById`,
method: 'GET',
data,
});
}
export function prodGetProd(data) {
return request({
url: `/sgyrdd/prod/getProd`,
method: 'GET',
data,
});
}
import { request } from '../../utils/request';
// 查询景点详情接口
export function znprodTourList(data) {
return request({
url: `/sgyrdd/znprod/tour/list`,
method: 'GET',
data,
});
}
......@@ -3,7 +3,7 @@ import { request } from '../../utils/request';
// 查询景点
export function getTour(data) {
return request({
url: `/sgyrdd/znprod/tour/list`,
url: `/sgyrdd/znprod/attraction/list`,
method: 'GET',
data,
});
......@@ -24,3 +24,19 @@ export function getProdList(data) {
data,
});
}
// 查询出发日期
export function getStartDate(data) {
return request({
url: `/sgyrdd/prod/startDate/page`,
method: 'GET',
data,
});
}
// 查询筛选
export function screeningConditions(data) {
return request({
url: `/sgyrdd/prod/screeningConditions/list`,
method: 'GET',
data,
});
}
......@@ -64,3 +64,12 @@ export function getCommentList(data) {
data,
});
}
// 评论列表数量统计和相同好评最多的评语
export function getEvalStatis(data) {
return request({
url: `/sgyrdd/evaluation/getEvalStatis`,
method: 'GET',
data,
});
}
......@@ -225,7 +225,9 @@
"style": {
"navigationBarTitleText": "景点详情",
"navigationBarBackgroundColor": "#ffffff",
"navigationStyle":""
"navigationStyle":"",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
}
},
{
......
......@@ -25,7 +25,9 @@
<view class="area">
<view class="area_l">
<view class="area_lt">当前定位</view>
<view class="area_lb">{{ forMData.city }}</view>
<view class="area_lb">
{{ forMData.province }}-{{ forMData.city }}-{{ forMData.area }}
</view>
</view>
<view class="area_r">
<wd-icon name="location" size="22px" @tap="changeLocation" />
......@@ -59,7 +61,9 @@
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
import { addAddress, updateAddress, deleteAddress } from '@/api/address';
import api from '@/services';
const newAddressFlag = ref(false);
const reForm = ref();
......@@ -92,46 +96,54 @@ const hdSubmit = async () => {
await addAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
province: forMData.value.province,
city: forMData.value.city,
area: forMData.value.area,
});
};
function handleSubmit() {
console.log('model的值', reForm.value);
reForm.value
.validate()
.then(({ valid }) => {
if (valid) {
hdSubmit();
// xma.showToast({
// title: '提交成功',
// duration: 2000,
// success: function () {
// console.log('数据更新后跳转地址列表页');
// },
// });
xma.showToast({
title: '提交成功',
duration: 2000,
});
}
})
.catch((error) => {
console.log(error, 'error');
});
}
// 重新定位收货地址
async function changeLocation() {
uni.chooseLocation({
success: function (res) {
forMData.value.city = res.address;
// forMData.value.city = res.address;
forMData.value.addr = res.address;
forMData.value.lng = res.longitude;
forMData.value.lat = res.latitude;
console.log('位置信息:' + JSON.stringify(res));
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
uni.request({
url: '/ws/geocoder/v1/',
data: {
key: 'MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN',
location: `${res.latitude},${res.longitude}`,
},
success: function (res) {
// console.log('逆地理编码:' + JSON.stringify(res));
if (res.data.status === 0) {
forMData.value.province = res.data.result.address_component.province;
forMData.value.city = res.data.result.address_component.city;
forMData.value.area = res.data.result.address_component.district;
}
},
});
},
});
const res = ('26.56806', '106.714304');
console.log('地址转换结果:' + res);
}
</script>
......
......@@ -55,7 +55,12 @@
:scroll-with-animation="true"
@scroll="scroll"
>
<view class="foodCard" v-for="(item, index) in popularRouterData" :key="index">
<view
class="foodCard"
v-for="(item, index) in popularRouterData"
:key="index"
@tap="toRouteDetails(item)"
>
<!-- <img-->
<!-- class="img-icon"-->
<!-- src="/static/assistingAgriculture/rural/icon.png"-->
......@@ -111,16 +116,16 @@
</view>
</view>
<Sort v-show="rotate" @sortParams="sortParams" />
<DepartureDate v-show="rotate2" />
<ScenicSpots v-show="rotate3" />
<Screen v-show="rotate4" />
<DepartureDate v-show="rotate2" @dataParams="dataParams" />
<ScenicSpots v-show="rotate3" @placeParams="placeParams" />
<Screen v-show="rotate4" @screenParams="screenParams" />
</view>
<view class="list-card">
<view
class="card-detail"
v-for="(item, index) in cardList"
:key="index"
@tap="toRouteDetails"
@tap="toRouteDetails(item)"
>
<img class="card-img" :src="item.img" style="width: 248rpx; height: 240rpx" />
<view class="detail-text">
......@@ -171,11 +176,12 @@ const rotate3 = ref(false);
const rotate4 = ref(false);
const cardList = ref([]);
const popularRouterData = ref([]);
const params = ref({
current: 1,
size: 10,
});
const sortType = ref(null);
const attractionId = ref(null);
const startCity = ref(null);
const dateType = ref(null);
const serviceCommitment = ref(null);
const labelId = ref(null);
const locationFiltering = (index) => {
switch (index) {
case 0:
......@@ -203,6 +209,11 @@ const locationFiltering = (index) => {
rotate3.value = false;
break;
}
if (index === 0) {
sortType.value = null;
attractionId.value = null;
dateType.value = null;
}
};
// 查询热门路线
const getPopular = () => {
......@@ -213,20 +224,57 @@ const getPopular = () => {
popularRouterData.value = res.data.records;
});
};
// 智能排序
const sortParams = (sortMode) => {
sortType.value = sortMode;
getProd();
};
// 出发日期
const dataParams = (item) => {
dateType.value = item;
getProd();
};
// 景点
const placeParams = (id) => {
attractionId.value = id;
getProd();
};
// 筛选
const screenParams = (item, type) => {
console.log(item, type, 111);
if (type === 'screen') {
startCity.value = item.tripCity;
} else if (type === 'serve') {
serviceCommitment.value = item.labelName;
} else if (type === 'people') {
labelId.value = item.labelName;
}
getProd();
};
// 查询列表
const getProd = () => {
getProdList({ current: 1, size: 10 }).then((res) => {
const params = {
current: 1,
size: 10,
...(sortType.value !== null && { sortType: sortType.value.sortMode }),
...(attractionId.value !== null && { attractionId: attractionId.value.id }),
...(dateType.value !== null && { dateType: dateType.value }),
...(startCity.value !== null && { startCity: startCity.value }),
...(serviceCommitment.value !== null && { serviceCommitment: serviceCommitment.value }),
...(labelId.value !== null && { labelId: labelId.value }),
};
getProdList(params).then((res) => {
res.data.records.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
cardList.value = res.data.records;
console.log(res, 222);
});
};
function toRouteDetails() {
function toRouteDetails(item) {
console.log(item, 22222);
// TODO: 跳转到线路详情
xma.navigateTo({
url: '/pages/assistingAgriculture/RouteDetails/RouteDetails',
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?prodId=${item.prodId}`,
});
}
function toSpecialOfferZoneList() {
......
......@@ -66,7 +66,7 @@
</view>
<view class="address-content" @click="jumpToAddressList">
<image class="location-pic" src="@/static/assistingAgriculture/assets/location.png"></image>
<view class="location-text">{{ addressInfo.areaAddr }} {{ addressInfo.areaName }}</view>
<view class="location-text">{{ addressInfo.addr }} {{ addressInfo.areaName }}</view>
<wd-icon custom-class="my-icon" color="#666" name="arrow-right" size="22px"></wd-icon>
</view>
<view class="address-user-info">
......@@ -151,7 +151,7 @@ import {
previewOrderBasketUpdate,
sgyOrderOrderInfo,
} from '@/api/assistingAgriculture/shop';
import { groupBuyConfirm } from '@/api/confirmOrder';
import { groupBuyConfirm, groupBuyUpdate, groupBuyCreate } from '@/api/confirmOrder';
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const textInputs = ref('');
const basketIds = ref([]);
......@@ -171,10 +171,14 @@ onLoad((options) => {
prodIds.value = prodId;
skuIds.value = skuId;
types.value = type;
basketIds.value = ids.split(',');
if (type === 'qg') {
groupBuyConfirmFn(prodId, skuId);
groupBuyConfirmFn(prodId, skuId).then((res) => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFnQg();
});
});
} else {
basketIds.value = ids.split(',');
sgyrddBasketConfirmFn(basketIds.value).then(() => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFn();
......@@ -182,42 +186,68 @@ onLoad((options) => {
});
}
});
function groupBuyUpdateFnQg(couponUserId = '') {
const { receiverName, receiverMobile, receiverAddress } = addressParams.value;
groupBuyUpdate({
key: orderInfo.value.key,
couponUserId,
receiverName,
receiverMobile,
receiverAddress,
}).then((res) => {
if (res.code === 0) {
orderInfo.value = res.data;
}
});
}
onShow(() => {
if (changeAddress.value) {
if (types.value === 'qg') {
groupBuyConfirmFn(prodIds.value, skuIds.value).then((res) => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFnQg();
});
});
} else {
sgyrddBasketConfirmFn(basketIds.value).then(() => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFn();
});
});
}
}
if (outTradeNos.value) {
// 查询订单状态决定是否支付
sgyOrderOrderInfo({ orderNumber: outTradeNos.value }).then((res) => {
// 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}`,
// });
// break;
// default:
// break;
// }
switch (res.data.baseOrder.subStatus) {
case '1':
xma.showToast({
title: '支付失败',
icon: 'error',
duration: 1000,
success() {
setTimeout(() => {
xma.redirectTo({
url: `/pages/assistingAgriculture/order/detail?orderNumber=${outTradeNos.value}`,
});
}, 1500);
},
});
break;
case '2':
xma.redirectTo({
url: `/pages/assistingAgriculture/order/detail?orderNumber=${outTradeNos.value}`,
});
break;
case '3':
xma.redirectTo({
url: `/pages/assistingAgriculture/order/detail?orderNumber=${outTradeNos.value}`,
});
break;
default:
break;
}
});
}
});
......@@ -226,7 +256,6 @@ function groupBuyConfirmFn(prodId, skuId) {
return new Promise((resolve, reject) => {
groupBuyConfirm({ prodId, skuId }).then((res) => {
if (res.code === 0) {
res.data.orderItems[0].pic = imgUrl + res.data.orderItems[0].pic;
orderInfo.value = res.data;
resolve(res.data.shopId);
} else {
......@@ -257,7 +286,11 @@ function selectShopCoupon(item) {
activeCouponId.value = item.couponId;
activeCouponInfo.value = item;
showpopup.value = false;
if (types.value === 'qg') {
groupBuyUpdateFnQg(item.couponUserId);
} else {
groupBuyUpdateFn(item.couponUserId);
}
} else {
xma.showToast({
title: '不满足优惠券使用条件',
......@@ -268,18 +301,11 @@ function selectShopCoupon(item) {
const jumpToAddressList = () => {
changeAddress.value = true;
wx.navigateTo({
url: '/pages/address/list',
url: '/pages/address/addressList',
});
};
function groupBuyUpdateFn(couponUserId) {
const { receiverName, receiverMobile, receiverAddress } = addressParams.value;
console.log(
'receiverName, receiverMobile, receiverAddress',
receiverName,
receiverMobile,
receiverAddress,
);
previewOrderBasketUpdate({
receiverName,
receiverMobile,
......@@ -311,7 +337,7 @@ const useraddrDefaultUserAddrFn = () => {
addressInfo.value = res.data;
addressParams.value.receiverName = res.data.receiver;
addressParams.value.receiverMobile = res.data.mobile;
addressParams.value.receiverAddress = res.data.areaAddr;
addressParams.value.receiverAddress = res.data.addr;
resolve();
}
});
......@@ -328,6 +354,7 @@ const params = ref({
basketIds: [],
remark: '',
});
const PaymentRef = ref(null);
const openZfType = () => {
PaymentRef.value.open();
......@@ -336,9 +363,32 @@ const payNow = async (data) => {
params.value.id = orderInfo.value.key;
params.value.tradeType = data.selectType;
params.value.basketIds = basketIds.value;
if (types.value === 'qg') {
const qgParams = {
id: orderInfo.value.key,
placeOrderWay: 'sgy',
payWayCode: 5,
tradeType: data.selectType,
};
groupBuyCreate(qgParams).then((res) => {
if (res.code === 0) {
openUrl(res.data.result);
} else {
groupBuyConfirmFn(prodIds.value, skuIds.value);
}
});
} else {
znsgyOrderCreate(params.value).then((res) => {
if (res.code === 0) {
const { paymentUrl, outTradeNo } = res.data.result;
openUrl(res.data.result);
} else {
sgyrddBasketConfirmFn(basketIds.value);
}
});
}
};
const openUrl = (result) => {
const { paymentUrl, outTradeNo } = result;
outTradeNos.value = outTradeNo;
window.location.href = paymentUrl;
// 设置一个延时器
......@@ -354,10 +404,6 @@ const payNow = async (data) => {
// 这里可以跳转到应用下载页面
}
}, 1600);
} else {
groupBuyConfirmFn(prodIds.value, skuIds.value);
}
});
};
</script>
......@@ -754,12 +800,12 @@ page {
.content {
font-size: 24rpx;
font-weight: 500;
width: 100%;
max-height: 243rpx;
background: #fafafa;
color: #77818f;
box-sizing: border-box;
border-radius: 12rpx;
margin: 0 auto;
}
}
.xj-content {
......
......@@ -44,6 +44,7 @@
<script setup>
import { ref } from 'vue';
import card from './card.vue';
import { getCommentList } from '../../../api/packageDetail';
const commentTypeList = [
{
text: '图/视频',
......@@ -114,7 +115,20 @@ const tagList = [
value: 514,
},
];
const commentParameters = {
shopId: '1818876196597334017',
current: 1,
size: 10,
};
onLoad((options) => {
getCommentListFn();
});
const showMoreTag = ref(false);
const getCommentListFn = () => {
getCommentList(commentParameters).then((res) => {
console.log('打印评论', res);
});
};
</script>
<style lang="scss" scoped>
......
......@@ -35,37 +35,30 @@
</view>
<view class="comment-list">
<view class="comment-item" v-for="item in 3" :key="item">
<view class="comment-item" v-for="(item, index) in commentData" :key="index">
<view class="top">
<view class="row">
<image
class="headPortrait"
mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png"
></image>
<image class="headPortrait" mode="aspectFill" :src="fileDomain + item.avatar"></image>
<view class="right">
<text class="name">略略略</text>
<text class="name">{{ item.nickName }}</text>
<view class="ratebox">
<image
class="rate-img"
src="@/static/assistingAgriculture/detail/fiveStars.png"
></image>
<text>5.0分</text>
<text>好评</text>
<image class="rate-img" :src="rateList[item.merchantServices].url"></image>
<text>{{ item.merchantServices }}.0分</text>
<text>{{ rateList[item.merchantServices].text }}</text>
</view>
</view>
</view>
<text class="detail">2024-08-03 筑农散养虫子土鸡(未下蛋小母鸡)x2</text>
<text class="detail">{{ item.createTime.slice(0, 10) }} {{ item.prodName }}x2</text>
</view>
<view class="info">
<text class="text">味道鲜美,煲出来的汤非常好喝,值得购买!</text>
<view class="imgbox">
<text class="text">{{ item.evaluation }}</text>
<view class="imgbox" v-if="item.images.length > 0">
<image
class="img"
mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png"
v-for="item in 6"
:key="item"
:src="fileDomain + img"
v-for="img in item.images"
:key="img"
></image>
</view>
</view>
......@@ -104,54 +97,44 @@ const tabs = ref([
},
]);
const rateList = ref([
{
value: 1,
url: '@/static/assistingAgriculture/index/oneStar.png',
const rateList = ref({
1: {
url: './../../static/assistingAgriculture/detail/oneStar.png',
text: '很糟',
},
{
value: 2,
url: '@/static/assistingAgriculture/index/twoStars.png',
2: {
url: './../../static/assistingAgriculture/detail/twoStars.png',
text: '较差',
},
{
value: 3,
url: '@/static/assistingAgriculture/index/threeStars.png',
3: {
url: './../../static/assistingAgriculture/detail/threeStars.png',
text: '一般',
},
{
value: 4,
url: '@/static/assistingAgriculture/index/fourStars.png',
4: {
url: './../../static/assistingAgriculture/detail/fourStars.png',
text: '还行',
},
{
value: 5,
url: '@/static/assistingAgriculture/index/fiveStars.png',
text: '超赞',
5: {
url: '../../../static/assistingAgriculture/detail/fiveStars.png',
text: '还行',
},
]);
});
/**
* 获取用户优惠券列表
*/
const isEnd = ref(false);
const state = ref('loading');
const total = ref(0);
const couponData = ref([]);
const commentData = ref([]);
const catalog = reactive({
current: 0,
size: 10,
statuMain: 0,
statuSon: 0,
shopId: '1818876196597334017',
evaluation: '', // 关键字搜索
type: '', // img-图片,append-追评,diff-中差评,good-好评
});
const getCouponList = async () => {
// if (isEnd.value) return;
const getList = async () => {
catalog.current++;
state.value = 'loading';
catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value;
console.log(catalog);
xma.showLoading({
title: '加载中...',
mask: true,
......@@ -162,12 +145,16 @@ const getCouponList = async () => {
}
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
item.showDetail = false;
if (item.images === '') {
item.images = [];
} else {
item.images = item.images.split(',');
}
});
couponData.value.push(...res.data.records);
commentData.value.push(...res.data.records);
total.value = res.data.total;
console.log(commentData.value);
}
// state.value = 'finished';
xma.hideLoading();
};
getList();
......
......@@ -3,7 +3,7 @@
<view class="review-details-pages">
<view class="swiper-list">
<wd-swiper
:list="swiperList"
:list="reviewDetail.orderEvaluation?.images"
direction="horizontal"
indicatorPosition="right"
autoplay
......@@ -22,46 +22,46 @@
<view class="revuew-content">
<view class="user-info">
<view class="info-content">
<image
src="@/static/assistingAgriculture/reviewDetails/avatar.png"
mode="aspectFill"
></image>
<image :src="imgUrl + reviewDetail.user?.avatar" mode="aspectFill"></image>
<view class="text-box">
<text class="user-name">不爱吃鱼的小猫咪</text>
<text class="fb-time">2024-08-03</text>
<text class="user-name">{{ reviewDetail.user.nickName }}</text>
<text class="fb-time">{{ reviewDetail.user.createTime }}</text>
</view>
</view>
<view>
<text class="score">4.9</text>
<text class="score">{{ reviewDetail.orderEvaluation?.descriptionMatches }}</text>
<text class="score-unit">/5分</text>
</view>
</view>
<text style="margin-top: 12rpx; font-size: 14 * 2rpx; color: #3d3d3d">
跟团游行程紧凑有序,充分利用了时间,让游客能够在有限的时间内充分游览黄果树的主要景点,如黄果树大瀑布、陡坡塘瀑布、天星桥景区等,不留遗憾。导游专业且热情,对景区有深入的了解,能够生动有趣地讲解景点的历史、文化和特色,同时耐心解答问题。
跟团游行程紧凑有序,充分利用了时间,让游客能够在有限的时间内充分游览黄果树的主要景点,如黄果树大瀑布、陡坡塘瀑布、天星桥景区等,不留遗憾。导游专业且热情,对景区有深入的了解,能够生动有趣地讲解景点的历史、文化和特色,同时耐心解答问题。
<text style="margin-top: 12rpx; font-size: 14 * 2rpx; color: #3d3d3d; text-align: left">
{{ reviewDetail.orderEvaluation.evaluation }}
</text>
</view>
<view class="scenic-spot">
<image src="@/static/assistingAgriculture/reviewDetails/fj.png" mode="aspectFill"></image>
<view class="scenic-spot" @click="jumpProd">
<image :src="imgUrl + prodInfo.pic" mode="aspectFill"></image>
<view class="scenic-area-details">
<text class="scenic-name">红枫湖+青岩古镇+云漫湖</text>
<text class="scenic-type">自然风景</text>
<text class="scenic-name">{{ prodInfo.prodName }}</text>
<text class="scenic-type">{{ prodInfo.brief }}</text>
<view class="tag-list">
<text class="tag">无购物</text>
<text class="tag">无购物</text>
<!-- <text class="tag">{{ prodInfo.brief }}</text> -->
</view>
</view>
<wd-icon class="icon" color="#ABAAAA" name="arrow-right" size="22px"></wd-icon>
</view>
<view class="dz-btn">
<wd-icon color="#767676" name="thumb-up" size="22px"></wd-icon>
<text>12</text>
<view class="dz-btn" @click="dzClick">
<wd-icon v-if="reviewDetail.isLike == 0" name="thumb-up" size="44rpx"></wd-icon>
<wd-icon v-else name="thumb-up" color="red" size="44rpx"></wd-icon>
<text>{{ reviewDetail.likeNum }}</text>
</view>
</view>
</template>
<script setup>
import { evaluationGetById, prodGetProd } from '@/api/assistingAgriculture/reviewDetails';
import { likeOrDislike } from '@/api/shop';
const current = ref(0);
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const evaluationIds = ref('');
onMounted(() => {
xma.getSystemInfo({
success: function (res) {
......@@ -69,15 +69,59 @@ onMounted(() => {
},
});
});
const swiperList = ref([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg',
]);
onLoad((options) => {
const { evaluationId } = options;
evaluationIds.value = evaluationId;
evaluationGetByIdFn(evaluationId);
});
function handleClick(e) {}
function onChange(e) {
console.log(e);
}
const prodInfo = ref({});
function prodGetProdFn(prodId) {
prodGetProd({ prodId }).then((res) => {
prodInfo.value = res.data.data.prod;
});
}
const reviewDetail = ref({});
const jumpProd = () => {
xma.navigateTo({
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?prodId=${prodInfo.value.prodId}&shopId=${prodInfo.value.shopId}`,
});
};
const dzClick = () => {
likeOrDislike({ evaluationId: evaluationIds.value }).then((res) => {
if (res.code === 0) {
if (reviewDetail.value.isLike === 0) {
reviewDetail.value.likeNum++;
reviewDetail.value.isLike = 1;
} else {
reviewDetail.value.likeNum--;
reviewDetail.value.isLike = 0;
}
}
});
};
function evaluationGetByIdFn(evaluationId) {
evaluationGetById({ evaluationId }).then((res) => {
if (res.code === 0) {
if (res.data.orderEvaluation.images) {
res.data.orderEvaluation.images = res.data.orderEvaluation.images
.split(',')
.map((item) => {
item = import.meta.env.VITE_APP_IMG_URL + item;
return item;
})
.filter((item) => {
return item && item !== '';
});
}
reviewDetail.value = res.data;
prodGetProdFn(res.data.orderEvaluation.prodId);
}
});
}
</script>
<style lang="scss" scoped>
......@@ -109,7 +153,6 @@ page {
display: flex;
flex-direction: column;
width: 100%;
align-items: center;
padding: 40rpx 20rpx;
box-sizing: border-box;
.user-info {
......
......@@ -2,13 +2,13 @@
<!-- 点评详情页面 -->
<view class="review-details-pages">
<view class="list">
<view class="item" v-for="i in 10" :key="i">
<image mode="aspectFill" src="@/static/assistingAgriculture/reviewDetails/fj.png"></image>
<view class="item" v-for="(item, index) in list" :key="index">
<image mode="aspectFill" :src="imgUrl + item.pic"></image>
<view class="info-box">
<text>红枫湖景区</text>
<text>自然风景</text>
<text class="t-2">4.5</text>
<text class="t-2">门票费用已包含</text>
<text>{{ item.attractionName }}</text>
<text>{{ item.resourceType }}</text>
<text class="t-2">{{ item.score }}</text>
<text class="t-2" v-if="item.isTicket === 1">门票费用已包含</text>
</view>
</view>
</view>
......@@ -16,7 +16,22 @@
</template>
<script setup>
onMounted(() => {});
import { znprodTourList } from '@/api/assistingAgriculture/scenicSpotDetails';
const prodIds = ref('');
const list = ref([]);
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
onLoad((options) => {
const { prodId } = options;
prodIds.value = prodId;
znprodTourListFn(prodId);
});
const znprodTourListFn = (prodId) => {
znprodTourList({ prodId }).then((res) => {
if (res.code === 0) {
list.value = res.data;
}
});
};
</script>
<style lang="scss" scoped>
......
......@@ -918,6 +918,7 @@ page {
}
img {
max-width: 100%;
object-fit: cover;
height: auto;
margin-top: 20rpx;
}
......
......@@ -9,7 +9,7 @@
class="pubList"
v-for="item in list"
:key="item.shopId"
@click="item.shopStatus != [1, 2, 3] ? shopGto(item) : ''"
@click="item.shopStatus != [1, 2, 3] ? shopGto(item.shopId) : ''"
>
<!-- 列表头部 -->
<view class="titlecon">
......
......@@ -45,6 +45,11 @@ export default defineConfig({
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/ws/geocoder': {
target: 'https://apis.map.qq.com',
changeOrigin: true,
bypass: (req, res, options) => res.setHeader("x-req-proxyUr1", options.target + req.url)
}
},
},
});
This source diff could not be displayed because it is too large. You can view the blob instead.
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