Commit 769ba1c4 authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 059fb2d3 2bf239f3
......@@ -56,7 +56,7 @@ export function sgyrddShopPage(data) {
});
}
// 获取店铺入驻类型
// 获取店铺入驻分类(弹窗)
export function sgyrShopCategory() {
return request({
url: `/sgyrdd/category/tree`,
......@@ -73,7 +73,7 @@ export function applyShop(data) {
});
}
// 申请成为商家
// 更改申请信息
export function editShop(data) {
return request({
url: `/sgyrdd/shop/update`,
......@@ -81,3 +81,11 @@ export function editShop(data) {
data,
});
}
export function getShopInfoById(data) {
return request({
url: `/sgyrdd/shop/getShopById`,
method: 'GET',
data,
});
}
......@@ -208,7 +208,8 @@
{
"path": "pages/assistingAgriculture/RuralTravel/RuralTravel",
"style": {
"navigationBarTitleText": "乡村旅居"
"navigationBarTitleText": "乡村旅居",
"enablePullDownRefresh": true,
}
},
......
......@@ -164,7 +164,7 @@
</div>
</div>
<wd-action-sheet v-model="show" title="标题" @close="show = false">
<wd-action-sheet v-model="show" title="选择日期" @close="show = false">
<view style="padding: 15px 15px 15px 15px" class="popout">
<div
class="item"
......@@ -305,14 +305,16 @@
<wd-icon v-else color="red" name="star-on"></wd-icon>
<p>{{ shopInfo.privateIntFcount || 0 }}</p>
</div>
<button>立即预定</button>
<button @click="openZfType">立即预定</button>
</div>
<Payment ref="PaymentRef" @payment="payNow"></Payment>
</div>
</template>
<script setup>
import timeLine from './timeLine.vue';
import domain from '@/utils/domain';
import Payment from '@/pages/order/components/Payment/index.vue';
import { ref, computed, watch } from 'vue';
import {
getProd,
......@@ -324,6 +326,7 @@ import {
getItinerary,
getStoreInformation,
} from '@/api/assistingAgriculture/route';
import { groupBuyConfirm, groupBuyUpdate } from '@/api/confirmOrder';
import { getCollect } from '@/api/packageDetail';
const swiperList = ref([
......@@ -339,7 +342,7 @@ const firstEvaluation = ref({});
const photoList = ref([]);
// 套餐列表
const mealList = ref([]);
const activeMeal = ref({});
const activeMeal = ref(null);
const onActiveMeal = (item) => {
activeMeal.value = item;
getPriceListFn(item.mealId);
......@@ -347,7 +350,7 @@ const onActiveMeal = (item) => {
// 日历
const priceList = ref([]);
const viewPriceList = ref([]);
const activePrice = ref({});
const activePrice = ref(null);
const show = ref(false);
const shopIds = ref('');
watch(show, (value) => {
......@@ -367,6 +370,75 @@ const getPriceListFn = (mealId) => {
viewPriceList.value = res.data.slice(0, 4);
});
};
function groupBuyConfirmFn(prodId, skuId) {
return new Promise((resolve, reject) => {
groupBuyConfirm({ prodId, skuId }).then((res) => {
if (res.code === 0) {
orderInfo.value = res.data;
resolve(res.data.shopId);
} else {
wx.showToast({
title: res.msg,
});
}
});
});
}
const PaymentRef = ref(null);
const openZfType = () => {
if (!activeMeal.value) {
xma.showToast({
title: '请先选择套餐',
icon: 'error',
});
} else if (!activePrice.value) {
xma.showToast({
title: '请先选择日期',
icon: 'error',
});
} else {
PaymentRef.value.open();
}
};
function formatDate(inputDate) {
const [year, monthDay] = inputDate.split('');
return `${year}-${monthDay}`;
}
const payNow = async (data) => {
groupBuyConfirmFn(prodIds.value, skuIds.value).then((res) => {
groupBuyUpdateFnQg();
});
params.value.id = orderInfo.value.key;
params.value.tradeType = data.selectType;
params.value.basketIds = basketIds.value;
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);
}
});
};
function groupBuyUpdateFnQg(couponUserId = '') {
const { receiverName, receiverMobile, receiverAddress } = addressParams.value;
groupBuyUpdate({
key: orderInfo.value.key,
couponUserId,
receiverTime: formatDate(activePrice.value.priceDay),
}).then((res) => {
if (res.code === 0) {
orderInfo.value = res.data;
}
});
}
const shopInfo = ref({});
// 获取店铺信息
const getStoreInformationFn = (id) => {
......
......@@ -137,23 +137,23 @@
<img class="card-img" :src="item.img" style="width: 248rpx; height: 240rpx" />
<view class="detail-text">
<text class="detail-title">{{ item.prodName }}</text>
<text class="give">{{ item.prodName }}</text>
<text class="give">{{ item.brief }}</text>
<view class="tag">
<wd-tag
bg-color="#EEEEEE"
round
v-for="(tag, tagIndex) in item.tag"
v-for="(tag, tagIndex) in item.serveList"
:key="tagIndex"
>
{{ tag }}
{{ tag.labelName }}
</wd-tag>
</view>
<view class="detail-score">
<text class="score">{{ item.deliveryAmount }}</text>
<text class="num">月销{{ item.deliveryAmount }}</text>
<text class="score">{{ item.score }}</text>
<text class="num">月销{{ item.monthSoldNum }}</text>
</view>
<view class="venue">
<text class="place">{{ item.prodName }}</text>
<text class="place">{{ item.tripArea }}出发</text>
<text class="price">{{ item.price }}</text>
</view>
</view>
......@@ -226,6 +226,13 @@ const locationFiltering = (index) => {
labelId.value = null;
}
};
onPullDownRefresh(() => {
getProd();
getPopular();
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1000);
});
// 查询热门路线
const getPopular = () => {
getPopularList({ current: 1, size: 10 }).then((res) => {
......@@ -287,10 +294,12 @@ const getProd = () => {
getProdList(params).then((res) => {
res.data.records.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
item.serveList = item.serviceList.slice(0, 3);
});
cardList.value = res.data.records;
});
};
const resetParams = () => {
sortType.value = null;
attractionId.value = null;
......@@ -549,6 +558,6 @@ page {
height: 56rpx;
}
.detail-score {
margin-top: 90rpx;
margin-top: 30rpx;
}
</style>
......@@ -356,9 +356,6 @@ const params = ref({
});
const PaymentRef = ref(null);
const openZfType = () => {
PaymentRef.value.open();
};
const payNow = async (data) => {
params.value.id = orderInfo.value.key;
params.value.tradeType = data.selectType;
......
This diff is collapsed.
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