Commit ea8d1d2c authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 55a5f7f1 72970b97
......@@ -10,16 +10,17 @@
>
{{ item.startDate }}
</li>
<wd-calendar use-default-slot v-model="value" @confirm="handleConfirm4">
<li>选择日期</li>
<wd-calendar use-default-slot v-model="value" @confirm="handleConfirm">
<li @tap="selectItem(index, item)">选择日期</li>
</wd-calendar>
</ul>
</view>
</template>
<script setup>
import { defineProps, onMounted } from 'vue';
import { defineProps, onMounted, ref } from 'vue';
import { getStartDate } from '@/api/assistingAgriculture/village';
const selectedItem = ref(null);
const emit = defineEmits(['dataParams']);
const dataList = ref([]);
......@@ -35,21 +36,33 @@ const props = defineProps({
default: '100%',
},
});
onMounted(async () => {
getStartDateList();
});
const selectItem = (index, item) => {
console.log(item, 323);
const datePart = timestampToDateBasic(value.value);
selectedItem.value = index;
emit('dataParams', item);
emit('dataParams', item, datePart);
console.log(datePart, 'datePart');
};
// 查询出发日期
const getStartDateList = () => {
getStartDate(params).then((res) => {
dataList.value = res.data;
});
};
function handleConfirm4({ value }) {
formatValue.value = new Date(value).toString();
function handleConfirm({ value }) {
const datePart = timestampToDateBasic(value);
console.log(datePart, 'datePart---111');
selectItem(undefined, undefined);
}
function timestampToDateBasic(timestamp) {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}/${month}/${day}`;
}
</script>
......
......@@ -7,6 +7,10 @@
:draggable="true"
inactiveIcon="a-controlplatform"
>
<view class="custom-button" @click="go('/pages/assistingAgriculture/index/index')">
<image class="fab-icon" src="../../static/index/order.png"></image>
<text class="fab-text">助农</text>
</view>
<view class="custom-button" @click="go('/pages/ticket/ticket')">
<image class="fab-icon" src="../../static/index/coupon.png"></image>
<text class="fab-text">优惠券</text>
......
......@@ -40,7 +40,7 @@ export function getPhoto({ shopId, prodId }) {
},
});
}
// 查询商家相册列表
// 获取套餐价格列表
export function getMealList(data) {
return request({
url: `/sgyrdd/znprod/meal/list`,
......@@ -64,3 +64,10 @@ export function getItinerary(data) {
data,
});
}
// 店铺信息
export function getStoreInformation(data) {
return request({
url: `/sgyrdd/shop/getById?shopId=${data}`,
method: 'GET',
});
}
......@@ -87,6 +87,8 @@ export function evaluation(data) {
data,
});
}
// 查询售后详情
export function afterSale(data) {
return request({
url: '/sgyrdd/sgyOrder/afterSales/getInfo',
......@@ -94,3 +96,21 @@ export function afterSale(data) {
data,
});
}
// 查询物流轨迹
export function getLogistics(data) {
return request({
url: '/sgyrdd/sgyOrder/logistics/logistics',
method: 'POST',
data,
});
}
// 查询物流轨迹含地图
export function getLogisticsMap(data) {
return request({
url: '/sgyrdd/sgyOrder/logistics/logisticsMap',
method: 'GET',
data,
});
}
......@@ -95,23 +95,31 @@ function fieldNotEmpty(val) {
}
const hdSubmit = async () => {
if (!content.value.addrId) {
await addAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
province: forMData.value.province,
city: forMData.value.city,
area: forMData.value.area,
try {
if (!content.value.addrId) {
await addAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
province: forMData.value.province,
city: forMData.value.city,
area: forMData.value.area,
});
} else {
await updateAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
});
}
uni.showToast({
title: '提交成功',
duration: 2000,
});
} else {
await updateAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
uni.navigateTo({
url: '/pages/address/addressList',
});
} catch (error) {
console.log(error, 'error');
}
uni.navigateTo({
url: '/pages/address/addressList',
});
};
function handleSubmit() {
reForm.value
......@@ -119,10 +127,6 @@ function handleSubmit() {
.then(({ valid }) => {
if (valid) {
hdSubmit();
xma.showToast({
title: '提交成功',
duration: 2000,
});
}
})
.catch((error) => {
......
......@@ -68,20 +68,23 @@
<p>物超所值(44)</p>
<p>线路合理(44)</p>
</div> -->
<div class="user">
<div class="user" v-if="firstEvaluation">
<div class="user-name flex-align-center">
<img :src="domain.imgPrefix + firstEvaluation.avatar" />
<p>{{ firstEvaluation.nickName }}</p>
</div>
<div class="content">{{ firstEvaluation.evaluation }}</div>
</div>
<div class="user flex-center" v-else>
<p style="color: #999">暂无数据</p>
</div>
</div>
<div class="album">
<div class="top flex-between">
<div class="title">用户相册</div>
<div class="link" @click="toAlbum">查看全部({{ evalData.imgCount }}) ></div>
<div class="link" @click="toAlbum">查看全部({{ photoList.length }}) ></div>
</div>
<div class="img-list">
<div class="img-list" v-if="photoList?.length">
<wd-img
v-for="(v, i) in photoList"
:key="i"
......@@ -89,6 +92,9 @@
enable-preview
/>
</div>
<div class="album flex-center" v-else>
<p style="color: #999">暂无数据</p>
</div>
</div>
</div>
<p class="choose-package-text">选择套餐·日期</p>
......@@ -98,14 +104,13 @@
<div class="package-list">
<div
class="package-item"
:class="{ active: activeMeal === v }"
:class="{ active: activeMeal === v, 'special-offer': v.isEspecially }"
v-for="(v, i) in mealList"
@click="onActiveMeal(v)"
:key="i"
>
<div class="price flex-between">
<p class="name">{{ v.mealName }}</p>
<p>¥{{ v.price }}</p>
</div>
<div class="content">
<div>
......@@ -125,6 +130,9 @@
<p>{{ v.mealFood }}</p>
</div>
</div>
<div class="price" style="margin-top: 30rpx">
<p>¥{{ v.price }}</p>
</div>
</div>
</div>
<div class="selected">
......@@ -292,9 +300,10 @@
</div>
</scroll-view>
<div class="footer flex-between">
<div class="like">
<wd-icon name="star"></wd-icon>
<p>收藏</p>
<div class="like" @click="getCollectFn">
<wd-icon v-if="shopInfo.isCollect === 0" name="star"></wd-icon>
<wd-icon v-else color="red" name="star-on"></wd-icon>
<p>{{ shopInfo.privateIntFcount || 0 }}</p>
</div>
<button>立即预定</button>
</div>
......@@ -313,7 +322,9 @@ import {
getMealList,
getPriceList,
getItinerary,
getStoreInformation,
} from '@/api/assistingAgriculture/route';
import { getCollect } from '@/api/packageDetail';
const swiperList = ref([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',
......@@ -338,6 +349,7 @@ const priceList = ref([]);
const viewPriceList = ref([]);
const activePrice = ref({});
const show = ref(false);
const shopIds = ref('');
watch(show, (value) => {
let index = priceList.value.indexOf(activePrice.value);
index = Math.max(1, index);
......@@ -355,11 +367,24 @@ const getPriceListFn = (mealId) => {
viewPriceList.value = res.data.slice(0, 4);
});
};
const shopInfo = ref({});
// 获取店铺信息
const getStoreInformationFn = (id) => {
return new Promise((resolve, reject) => {
getStoreInformation(id).then((res) => {
if (res.code === 0) {
shopInfo.value = res.data.shop;
resolve();
}
});
});
};
// 行程
const itineraryData = ref([]);
/* shopId:1821388624367861761
prodId:43835 */
onLoad(({ shopId, prodId }) => {
shopIds.value = shopId;
// const shopId = 1821388624367861761n;
// const prodId = 43835;
getProd({
......@@ -391,7 +416,22 @@ onLoad(({ shopId, prodId }) => {
getItinerary({ prodId }).then((res) => {
itineraryData.value = res.data;
});
// 获取店铺信息
getStoreInformationFn(shopId);
});
function getCollectFn() {
getCollect(shopIds.value).then((res) => {
if (res.code === 0) {
if (shopInfo.value.isCollect === 0) {
shopInfo.value.privateIntFcount++;
shopInfo.value.isCollect = 1;
} else {
shopInfo.value.privateIntFcount--;
shopInfo.value.isCollect = 0;
}
}
});
}
// 返回上一级
function back() {
xma.navigateBack({
......@@ -618,8 +658,24 @@ uni-page-body {
padding: 20rpx;
background: linear-gradient(180deg, #feeeee 0%, #ffffff 100%);
box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.08);
position: relative;
overflow: hidden;
&.active {
border: 1px solid #fa5151;
border: 2rpx solid #fa5151;
}
&.special-offer::after {
content: '特价套餐';
font-weight: bold;
font-size: 24rpx;
padding: 0 100rpx;
background-color: #fa5151;
color: #fff;
display: block;
position: absolute;
top: 26rpx;
right: 40rpx;
white-space: nowrap;
transform: translateX(50%) rotateZ(45deg);
}
.price {
font-size: 24rpx;
......
......@@ -115,6 +115,13 @@
></wd-icon>
</view>
</view>
|
<view class="bootom-top">
<view class="option" @tap="resetParams">
<text>清空</text>
<wd-icon size="24rpx" class="icons"></wd-icon>
</view>
</view>
<Sort v-show="rotate" @sortParams="sortParams" />
<DepartureDate v-show="rotate2" @dataParams="dataParams" />
<ScenicSpots v-show="rotate3" @placeParams="placeParams" />
......@@ -180,6 +187,7 @@ const sortType = ref(null);
const attractionId = ref(null);
const startCity = ref(null);
const dateType = ref(null);
const allocateDate = ref(null);
const serviceCommitment = ref(null);
const labelId = ref(null);
const locationFiltering = (index) => {
......@@ -233,10 +241,16 @@ const sortParams = (sortMode) => {
getProd();
};
// 出发日期
const dataParams = (item) => {
console.log(item, item.key, 22322323);
dateType.value = item.key;
getProd();
const dataParams = (item, datePart) => {
if (item !== undefined) {
dateType.value = item.key;
getProd();
} else if (item === undefined) {
console.log(item, 3333333);
dateType.value = 8;
allocateDate.value = datePart;
getProd();
}
};
// 景点
const placeParams = (id) => {
......@@ -248,12 +262,14 @@ const screenParams = (item, type) => {
console.log(item, type, 111);
if (type === 'screen') {
startCity.value = item.tripCity;
getProd();
} else if (type === 'serve') {
serviceCommitment.value = item.labelName;
getProd();
} else if (type === 'people') {
labelId.value = item.labelName;
getProd();
}
getProd();
};
// 查询列表
const getProd = () => {
......@@ -262,10 +278,11 @@ const getProd = () => {
size: 10,
...(sortType.value !== null && { sortType: sortType.value.sortMode }),
...(attractionId.value !== null && { attractionId: attractionId.value.id }),
...(dateType.value !== null && { dateType: dateType.value.key }),
...(dateType.value !== null && { dateType: dateType.value }),
...(startCity.value !== null && { startCity: startCity.value }),
...(serviceCommitment.value !== null && { serviceCommitment: serviceCommitment.value }),
...(labelId.value !== null && { labelId: labelId.value }),
...(dateType.value === 8 && { allocateDate: allocateDate.value }),
};
getProdList(params).then((res) => {
res.data.records.forEach((item) => {
......@@ -274,11 +291,21 @@ const getProd = () => {
cardList.value = res.data.records;
});
};
const resetParams = () => {
sortType.value = null;
attractionId.value = null;
dateType.value = null;
startCity.value = null;
serviceCommitment.value = null;
labelId.value = null;
allocateDate.value = null;
getProd();
};
function toRouteDetails(item) {
console.log(item, 22222);
// TODO: 跳转到线路详情
xma.navigateTo({
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=${item.shopId},prodId=${item.prodId}`,
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=${item.shopId}&prodId=${item.prodId}`,
});
}
function toSpecialOfferZoneList() {
......
......@@ -58,11 +58,13 @@
</view>
</view>
</view>
<fab />
</view>
</template>
<script setup lang="ts">
import Search from '../../../components/assistingAgriculture/index/Search.vue';
import fab from '../../../components/fab/fab.vue';
import {
getPresaleCategory,
getPresaleList,
......
......@@ -110,6 +110,12 @@
</template>
<script setup>
const props = defineProps({
dataList: {
type: Array,
default: null,
},
});
const show = ref(false);
// 正则表达式匹配电话号码
const phoneRegex = /\b(\d{3,4}-\d{7,8}|\d{11})\b/g;
......
......@@ -3,7 +3,8 @@
<Header title="商品详情页"></Header>
<web-view
style="height: 600rpx"
src="https://api.kuaidi100.com/tools/map/59d4a57b7964ebd6fc1d831847cb61c9_106.714305,26.568055_6"
:src="logisticsDetail.trailUrl"
v-if="logisticsDetail"
></web-view>
<!-- <view style="height: 600rpx; background-color: aquamarine"></view> -->
<view class="content">
......@@ -11,7 +12,7 @@
<view class="top">
<view class="left">
<image class="logo" src="/static/ticket/logo.png" mode="aspectFill"></image>
<text>中通快递78810259271088</text>
<text>中通快递{{ orderDetail.orderLogistics.logisticsNumber }}</text>
</view>
<view class="right">
<text>复制</text>
......@@ -159,10 +160,11 @@
</view>
<view style="height: 170rpx"></view>
</view>
<view class="footer">
<view class="btn">查看物流</view>
<view class="btn">申请售后</view>
<view class="btn err">确认收货</view>
<view class="footer" v-if="orderDetail">
<view class="btn" v-if="orderDetail.orderLogistics.status === '3'">查看物流</view>
<view class="btn">联系商家</view>
<view class="btn err" v-if="orderDetail.orderLogistics.status === '3'">确认收货</view>
<view class="btn err" v-if="orderDetail.orderLogistics.status === '1'">立即付款</view>
</view>
</view>
<stepBar ref="stepBarRef"></stepBar>
......@@ -171,7 +173,7 @@
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
import stepBar from '@/pages/assistingAgriculture/order/components/stepBar/index.vue';
import { getOrderDetail, getShopDetail } from '@/api/order';
import { getOrderDetail, getShopDetail, getLogisticsMap } from '@/api/order';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const orderNumber = ref('');
......@@ -194,6 +196,9 @@ const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
orderDetail.value = res.data;
getShopMailDetail(orderDetail.value.baseOrder.shopId);
if (orderDetail.value.orderLogistics.logisticsNumber) {
getLogisticsDetail(orderDetail.value.orderLogistics.logisticsNumber);
}
};
/**
......@@ -205,6 +210,15 @@ const getShopMailDetail = async (id) => {
shopDetail.value = res.data.shop;
};
/**
* 获取物流信息
*/
const logisticsDetail = ref();
const getLogisticsDetail = async (id) => {
const res = await getLogisticsMap({ expressNum: id });
logisticsDetail.value = res.data;
};
const toShopDetail = () => {
xma.navigateTo({
url: `/pages/assistingAgriculture/shop/index?shopId=${shopDetail.value.shopId}`,
......
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