修改支付页面

parent 01d04082
......@@ -13,12 +13,17 @@
<view class="content">
<text class="title">{{ item.prodName }}</text>
<view class="labelBox">
<view class="item" v-for="(item, index) in 4" :key="index">30天有效</view>
<view class="item" v-for="(lab, index) in item.labels" :key="index">{{ lab }}</view>
<view
style="background: transparent"
class="item"
v-if="!item.labels || item.labels.length === 0"
></view>
</view>
<view class="price">
<view class="discounts">4.5折</view>
<text class="text">39.9</text>
<text class="text2">58</text>
<!-- <view class="discounts">4.5折</view> -->
<text class="text">{{ item.price }}</text>
<text class="text2">{{ item.oriPrice }}</text>
<view class="btn">
<!-- <text class="text3">仅剩余5张</text> -->
<text class="text3"></text>
......@@ -71,7 +76,7 @@
</view>
</view>
<!-- 美食类别 -->
<Classification v-show="rotate" />
<Classification v-show="rotate" :category="categoryData" @foodCategory="foodCategory" />
<!-- 附近筛选 -->
<Position v-show="rotate2" />
<!-- 排序筛选 -->
......@@ -92,22 +97,34 @@ import { getByParentId, merchantList, prodSpecial } from '../../api/index';
const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']);
const active = ref(null);
const categoryData = ref([]);
const rotate = ref(false);
const rotate2 = ref(false);
const rotate3 = ref(false);
const categoryId = ref(null);
const topDiscountedProducts = ref([]);
const pics = ref(null);
const paramsId = {
parentId: null,
};
onLoad((option) => {
const { parentId, pic } = option;
categoryId.value = parentId;
pics.value = pic;
query(parentId);
prodSpecialFn();
getByParentIdData();
});
onMounted(() => {
getMerchantList();
});
// 根据父级分类id查询子分类列表
const getByParentIdData = () => {
getByParentId(paramsId).then((res) => {
categoryData.value = res.data;
});
};
// 根据父级分类id查询子分类列表
const query = (parentId) => {
getByParentId(parentId).then((res) => {
......@@ -116,18 +133,13 @@ const query = (parentId) => {
};
const prodSpecialFn = () => {
prodSpecial({ categoryId: categoryId.value }).then((res) => {
res.data.data = res.data.data
.map((el) => {
if (el.labels) {
el.labels = el.labels.split(',');
}
return el;
})
.filter((it) => {
return it.it && it !== '';
});
topDiscountedProducts.value = res.data;
res.data.data = res.data.data.map((el) => {
if (el.labels) {
el.labels = el.labels.split(',');
}
return el;
});
topDiscountedProducts.value = res.data.data;
});
};
// onLoad(option) {
......
......@@ -182,7 +182,7 @@ onShow(() => {
if (outTradeNos.value) {
// 查询订单状态决定是否支付
getOrderDetail({ orderNumber: outTradeNos.value }).then((res) => {
switch (orderDetail.value.status) {
switch (res.data.status) {
case '1':
xma.showToast({
title: '支付失败',
......
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