修改支付页面

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