Commit 6d615a40 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 1124d5ce d660770b
......@@ -92,6 +92,13 @@
"navigationBarTitleText": "申请退款"
}
}
,
{
"path": "pages/index/coupon",
"style": {
"navigationBarTitleText": "优惠券详情"
}
}
],
"globalStyle": {
"navigationStyle": "custom"
......
<template>
<view class="container">
<scroll-view class="tabs" scroll-x="true" @scroll="scroll">
<text class="tab" v-for="(item, index) in tabs" :key="index">{{ item }}</text>
</scroll-view>
<view class="itemBox">
<view class="item"></view>
</view>
</view>
</template>
<script setup>
import {} from 'vue';
const tabs = ref(['推荐', '附近美食', '果蔬生鲜', '数码商城', '小吃快餐', '数码商城', '餐饮券']);
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.container {
.tabs {
white-space: nowrap;
padding: 0 30rpx;
box-sizing: border-box;
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
color: #333333;
font-weight: bold;
background: white;
.tab {
display: inline-block;
margin-right: 40rpx;
}
}
.itemBox {
padding: 0 23rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-top: 20rpx;
.item {
width: 341rpx;
height: 674rpx;
background: #ffffff;
}
}
}
</style>
......@@ -44,7 +44,12 @@
<view v-else class="textF" @tap="toUse">去使用</view>
</view>
</scroll-view>
<image class="discount" src="../../static/index/discount.png" mode="widthFix" />
<image
@tap="toCoupon"
class="discount"
src="../../static/index/discount.png"
mode="widthFix"
/>
</view>
<!-- 贵阳老味道 -->
<!-- <view class="guiyang"></view> -->
......@@ -223,6 +228,12 @@ const receive = (data) => {
});
}
};
// TO优惠券详情
const toCoupon = () => {
xma.navigateTo({
url: '/pages/index/coupon',
});
};
// 获取分类
const getClassification = () => {
groupBuyList().then((res) => {
......
......@@ -5,18 +5,9 @@
<!-- 使用状态 -->
<view class="status">
<view class="status-box">
<wd-icon
name="check-outline"
size="26px"
color="#333"
v-if="orderDetail.status == 5 || orderDetail.status == 7"
></wd-icon>
<wd-icon
name="close-outline"
size="26px"
color="#333"
v-if="orderDetail.status == 6"
></wd-icon>
<wd-icon name="check-outline" size="26px" color="#333"
v-if="orderDetail.status == 5 || orderDetail.status == 7"></wd-icon>
<wd-icon name="close-outline" size="26px" color="#333" v-if="orderDetail.status == 6"></wd-icon>
<view class="status-text">{{ statusList[orderDetail.status] }}</view>
</view>
<view class="detail" v-if="orderDetail.status == 3">
......@@ -64,13 +55,10 @@
<text class="title1" v-if="orderDetail.status != 2 || orderDetail.status != 3">
券码信息
</text>
<text
:class="
orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
<text :class="orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
? 'linethrough'
: 'phone'
"
>
">
{{ orderDetail.orderNumber.slice(6) }}
</text>
</view>
......@@ -259,14 +247,13 @@ onLoad((options) => {
const orderDetail = ref();
const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
if (res.code === 0) {
orderDetail.value = res.data;
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber);
}
getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId);
}
};
/**
......@@ -290,9 +277,7 @@ const codeDetail = (item) => {
const prodDetail = ref();
const getProductDetail = async (id) => {
const res = await getProdDetail({ prodId: id });
if (res.code === 0) {
prodDetail.value = res.data.data;
}
};
/**
......@@ -301,9 +286,7 @@ const getProductDetail = async (id) => {
const shopDetail = ref();
const getShopMailDetail = async (id) => {
const res = await getShopDetail({ shopId: id });
if (res.code === 0) {
shopDetail.value = res.data.shop;
}
};
const maskPhoneNumber = (phone) => {
......@@ -374,6 +357,7 @@ page {
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
padding-top: 44px;
display: flex;
......
......@@ -161,20 +161,15 @@ const getList = async () => {
catalog.current++;
state.value = 'loading';
const res = await getOrderList(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
// 待付款倒计时计算
if (item.status === '1') {
item.countDown = calculateCountdown(item.createTime);
}
});
dataList.value.push(...res.data.records);
total.value = res.data.total;
} else {
state.value = 'finished';
}
} else {
state.value = 'error';
}
state.value = 'finished';
};
......@@ -222,18 +217,11 @@ const handleDelete = (orderNumber) => {
success: async (res) => {
if (res.confirm) {
const res = await deleteOrderApi(orderNumber);
if (res.code === 0) {
uni.showToast({
title: '删除成功',
icon: 'success',
});
initDataList();
} else {
uni.showToast({
title: '删除失败',
icon: 'error',
});
}
}
},
});
......@@ -250,18 +238,11 @@ const handleCancel = (orderNumber) => {
success: async (res) => {
if (res.confirm) {
const res = await cancelOrderApi({ orderNumber });
if (res.code === 0) {
uni.showToast({
title: '取消成功',
icon: 'success',
});
initDataList();
} else {
uni.showToast({
title: '取消失败',
icon: 'error',
});
}
}
},
});
......
<template>
<view class="container">
<Header title="申请退款"></Header>
<Header title="售后/退款"></Header>
<view class="content">
<view class="content-box">
<view class="content-item">
<text class="title">单号:1111111111</text>
</view>
<view class="content-item">
<view class="item-left">
<image class="item-img" mode="aspectFill" src="@/static/images/ticket/logo.png"></image>
<view class="item-info">
<text>血糯米</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
......@@ -16,5 +31,12 @@ page {
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
padding-top: 44px;
display: flex;
flex-direction: column;
gap: 20rpx;
}
}
</style>
......@@ -177,20 +177,12 @@ const handleChangeDetail = (idx) => {
*/
const getCoupon = async (item) => {
const res = await receiveCoupon([item.couponYzfId]);
if (res.code === 0) {
item.numState = 1;
xma.showToast({
title: '领取成功',
icon: 'success',
duration: 2000,
});
return;
}
xma.showToast({
title: '领取失败',
icon: 'error',
duration: 2000,
});
};
/**
......@@ -212,7 +204,6 @@ const getCouponAll = async () => {
return;
}
const res = await receiveCoupon(ids);
if (res.code === 0) {
couponData.value.forEach((item) => {
item.numState = 1;
});
......@@ -221,13 +212,6 @@ const getCouponAll = async () => {
icon: 'success',
duration: 2000,
});
return;
}
xma.showToast({
title: '领取失败',
icon: 'error',
duration: 2000,
});
};
/**
......
......@@ -2,12 +2,8 @@
<view class="container">
<Header title="我的券"></Header>
<view class="tab">
<view
:class="currentTab == index ? 'tab-select' : 'tab-item'"
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
<view :class="currentTab == index ? 'tab-select' : 'tab-item'" @click="changeTab(index)"
v-for="(item, index) in tabList" :key="index">
{{ item }}
</view>
</view>
......@@ -19,12 +15,8 @@
<!-- 优惠券状态 -->
<view class="status">
<view
:class="currenStatus == index ? 'status-select' : 'status-item'"
@click="changeStatus(index)"
v-for="(item, index) in statusList"
:key="index"
>
<view :class="currenStatus == index ? 'status-select' : 'status-item'" @click="changeStatus(index)"
v-for="(item, index) in statusList" :key="index">
{{ item }}
</view>
</view>
......@@ -47,11 +39,7 @@
</view>
<view class="ticket-right">
<image
class="img"
:src="iconUrl[item.status]"
v-if="item.status == 0 || item.status == 2"
></image>
<image class="img" :src="iconUrl[item.status]" v-if="item.status == 0 || item.status == 2"></image>
<view class="head">
<text class="title">{{ item.couponName }}</text>
<view class="headbox">
......@@ -67,11 +55,8 @@
<view class="line"></view>
<view class="footbox" @click="handleChangeDetail(index)">
<text class="desc">详细信息</text>
<wd-icon
:name="item.showDetail ? 'chevron-down' : 'chevron-right'"
size="15px"
color="#9d9d9d"
></wd-icon>
<wd-icon :name="item.showDetail ? 'chevron-down' : 'chevron-right'" size="15px"
color="#9d9d9d"></wd-icon>
</view>
</view>
</view>
......@@ -176,18 +161,13 @@ const getCouponList = async () => {
catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value;
const res = await myCouponListApi(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
item.showDetail = false;
});
couponData.value.push(...res.data.records);
total.value = res.data.total;
} else {
state.value = 'finished';
}
} else {
state.value = 'error';
}
state.value = 'finished';
};
......@@ -227,6 +207,7 @@ const toShop = (idx) => {
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
......@@ -545,7 +526,8 @@ page {
}
.desc {
white-space: pre-line; /* 将空格和换行符保留在文本中 */
white-space: pre-line;
/* 将空格和换行符保留在文本中 */
font-family: PingFang SC Regular;
font-size: 24rpx;
color: #333333;
......
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