hello
This commit is contained in:
parent
9d3aa0c4c4
commit
3be2fa87f5
21
pages.json
21
pages.json
|
@ -1,5 +1,12 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
|
{
|
||||||
|
"path" : "pages/coupon/CouponMall/CouponMall",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/testPage/testPage",
|
"path" : "pages/testPage/testPage",
|
||||||
"style" :
|
"style" :
|
||||||
|
@ -240,6 +247,20 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationBarTitleText" : ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/coupon/CouponTips/CouponTips",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/coupon/MyCoupon/MyCoupon",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"plugins" : {
|
"plugins" : {
|
||||||
|
|
298
pages/coupon/CouponMall/CouponMall.vue
Normal file
298
pages/coupon/CouponMall/CouponMall.vue
Normal file
|
@ -0,0 +1,298 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col justify-start relative page">
|
||||||
|
<view class="section"></view>
|
||||||
|
|
||||||
|
<view class="my-box">
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper pos"><text class="font text">积分商城</text></view>
|
||||||
|
<view class="flex-row justify-between items-start section_2 pos_2">
|
||||||
|
<view class="flex-col items-center">
|
||||||
|
<text class="text_2">可用积分</text>
|
||||||
|
<text class="mt-20 text_3">{{ points }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col items-center group" @click="jumpToTips">
|
||||||
|
<image
|
||||||
|
class="image"
|
||||||
|
src="https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=91726e3d2a00b43be59bc02bdb123c41.png"
|
||||||
|
/>
|
||||||
|
<text class="text_4 mt-7">规则</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="flex-col pos_3">
|
||||||
|
<view class="flex-col mt-18 list-item" v-for="(item, index) in couponList" :key="index">
|
||||||
|
<view class="flex-row justify-between items-start self-stretch">
|
||||||
|
<view class="flex-col items-start">
|
||||||
|
<text class="font_2">{{ item.conditionAmount }}元优惠券</text>
|
||||||
|
<text class="font text_5 mt-15">{{ item.name }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper_2" @click="exchangeCoupon(item)">
|
||||||
|
<text class="font_3 text_6">兑换</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_4 mt-7">{{ item.requirePoints }} 积分</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<uni-popup ref="exchange" :maskClick="false" :animation="false">
|
||||||
|
<view class="exchange-popup">
|
||||||
|
<confirmPopupVue></confirmPopupVue>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {ref, onMounted, nextTick} from 'vue'
|
||||||
|
import { baseUrl } from '@/api/request';
|
||||||
|
import confirmPopupVue from '../component/confirmPopup.vue';
|
||||||
|
import popupVue from '../../popup.vue';
|
||||||
|
import emitter from '../../../utils/emitter';
|
||||||
|
const cookie = wx.getStorageSync("cookie") //请求头
|
||||||
|
const couponList = ref([])
|
||||||
|
const points = ref(0)
|
||||||
|
const exchange = ref(null)
|
||||||
|
|
||||||
|
const coupon = ref(0)
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getMyUserInfo()
|
||||||
|
getCouponList()
|
||||||
|
emitter.on('closeConfirmPopup', () => {
|
||||||
|
nextTick(() => {
|
||||||
|
if (exchange.value) {
|
||||||
|
exchange.value.close()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
emitter.on('confirmExchange', async () => {
|
||||||
|
await pointsExchangeCoupon()
|
||||||
|
await getMyUserInfo()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const getMyUserInfo = async () => {
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/user/get/login',
|
||||||
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
cookie
|
||||||
|
}
|
||||||
|
})
|
||||||
|
points.value = res.data.data.points
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCouponList = async () => {
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/coupon/list/all',
|
||||||
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
cookie
|
||||||
|
}
|
||||||
|
})
|
||||||
|
couponList.value = res.data.data
|
||||||
|
}
|
||||||
|
|
||||||
|
const jumpToTips = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../CouponTips/CouponTips'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const exchangeCoupon = (val:any) => {
|
||||||
|
coupon.value = val
|
||||||
|
exchange.value.open('center')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const pointsExchangeCoupon = async () => {
|
||||||
|
|
||||||
|
if (points.value < coupon.value.requirePoints) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '积分不足',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/coupon/exchange',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
cookie
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
id: coupon.value.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.data.data) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '兑换成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
.exchange-popup {
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-top: -200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-box {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 0 auto;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-15 {
|
||||||
|
margin-top: 28.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-7 {
|
||||||
|
margin-top: 13.13rpx;
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
background-color: #ffffff;
|
||||||
|
background-image: url('https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=776298fdb18de84cb191f66e4d22ba7a.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.section {
|
||||||
|
background-image: url('https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=776298fdb18de84cb191f66e4d22ba7a.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 1386.88rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 45rpx 0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 28.09rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
color: #000000;
|
||||||
|
line-height: 28.59rpx;
|
||||||
|
}
|
||||||
|
.section_2 {
|
||||||
|
padding: 24.38rpx 52.5rpx 15rpx;
|
||||||
|
background-image: linear-gradient(90deg, #ffffff 42.3%, #fbdedf 93.5%);
|
||||||
|
}
|
||||||
|
.pos_2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 114.38rpx;
|
||||||
|
}
|
||||||
|
.text_2 {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 25.78rpx;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
color: #c35c5d;
|
||||||
|
font-size: 60rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 40.09rpx;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
margin-right: 18.75rpx;
|
||||||
|
margin-top: 11.25rpx;
|
||||||
|
}
|
||||||
|
.image {
|
||||||
|
width: 73.13rpx;
|
||||||
|
height: 73.13rpx;
|
||||||
|
}
|
||||||
|
.text_4 {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 24.38rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 21.34rpx;
|
||||||
|
}
|
||||||
|
.pos_3 {
|
||||||
|
position: absolute;
|
||||||
|
left: 22.5rpx;
|
||||||
|
right: 22.5rpx;
|
||||||
|
top: 307.5rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
.list-item {
|
||||||
|
padding: 37.5rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
.list-item:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.font_2 {
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 32.83rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text_5 {
|
||||||
|
line-height: 29.42rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper_2 {
|
||||||
|
margin-right: 3.75rpx;
|
||||||
|
margin-top: 45rpx;
|
||||||
|
padding: 15rpx 0;
|
||||||
|
background-color: #e79ea1;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
width: 159.38rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
}
|
||||||
|
.font_3 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 28.09rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.text_6 {
|
||||||
|
line-height: 27.66rpx;
|
||||||
|
}
|
||||||
|
.font_4 {
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 28.09rpx;
|
||||||
|
color: #c35c5d;
|
||||||
|
}
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
121
pages/coupon/CouponTips/CouponTips.vue
Normal file
121
pages/coupon/CouponTips/CouponTips.vue
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col justify-start relative page">
|
||||||
|
<view class="section"></view>
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper pos"><text class="font text">积分规则</text></view>
|
||||||
|
<view class="flex-col section_2 pos_2">
|
||||||
|
<text class="self-start font_2">积分怎么花?</text>
|
||||||
|
<view class="flex-col items-start self-stretch group">
|
||||||
|
<text class="font text_2">·使用积分兑换优惠券:可兑换优惠券,</text>
|
||||||
|
<text class="font">兑换成功后可到个人中心查看。</text>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_2 text_3">怎么赚积分?</text>
|
||||||
|
<view class="flex-col items-start self-stretch group_2">
|
||||||
|
<text class="font text_4">·积分状态分为收入、支出状态。收入指获</text>
|
||||||
|
<text class="font">得积分;支出指消耗积分。</text>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_3 text_5">·积分获取上限: 每天获取积分无上限</text>
|
||||||
|
<text class="self-stretch font_3 text_6">·积分有效期:当前获得的积分为 永久有效</text>
|
||||||
|
<text class="self-stretch font text_7">·积分扣减规则:通过交易成功后获得的积分,在订单退款时,会相应扣减积分</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page {
|
||||||
|
background-color: #ffffff;
|
||||||
|
background-image: url('https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=776298fdb18de84cb191f66e4d22ba7a.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
background-image: url('https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=776298fdb18de84cb191f66e4d22ba7a.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 1386.88rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 45rpx 0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 35.63rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
}
|
||||||
|
.section_2 {
|
||||||
|
padding: 41.25rpx 45rpx 142.5rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
.pos_2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 43.13rpx;
|
||||||
|
right: 41.27rpx;
|
||||||
|
top: 161.25rpx;
|
||||||
|
}
|
||||||
|
.font_2 {
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 32.44rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
margin-top: 18.75rpx;
|
||||||
|
}
|
||||||
|
.text_2 {
|
||||||
|
margin-left: 11.25rpx;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
margin-top: 26.25rpx;
|
||||||
|
line-height: 32.17rpx;
|
||||||
|
}
|
||||||
|
.group_2 {
|
||||||
|
margin-top: 22.5rpx;
|
||||||
|
}
|
||||||
|
.text_4 {
|
||||||
|
margin-left: 11.25rpx;
|
||||||
|
}
|
||||||
|
.font_3 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 28.95rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text_5 {
|
||||||
|
margin-left: 15rpx;
|
||||||
|
margin-top: 37.5rpx;
|
||||||
|
}
|
||||||
|
.text_6 {
|
||||||
|
margin-left: 11.25rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
line-height: 29.31rpx;
|
||||||
|
}
|
||||||
|
.text_7 {
|
||||||
|
margin-top: 22.5rpx;
|
||||||
|
}
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
168
pages/coupon/MyCoupon/MyCoupon.vue
Normal file
168
pages/coupon/MyCoupon/MyCoupon.vue
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col justify-start relative page">
|
||||||
|
<view class="shrink-0 section"></view>
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper pos"><text class="font text">我的优惠券</text></view>
|
||||||
|
<text class="font_2 text_2 pos_2">优惠券</text>
|
||||||
|
<view class="flex-col pos_3">
|
||||||
|
<view class="flex-col relative list-item mt-15" v-for="(item, index) in items" :key="index">
|
||||||
|
<view class="flex-row justify-between items-center">
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<view class="group">
|
||||||
|
<text class="font_3">50</text>
|
||||||
|
<text class="font_2 text_3">元</text>
|
||||||
|
</view>
|
||||||
|
<text class="ml-54 font">200减50元</text>
|
||||||
|
</view>
|
||||||
|
<text class="font_4 text_4">已过期</text>
|
||||||
|
</view>
|
||||||
|
<view class="mt-14 flex-row">
|
||||||
|
<text class="shrink-0 self-start font_5">满200元使用</text>
|
||||||
|
<text class="flex-1 font_6 ml-27">2025-01-10 00:00至2025-04-09 00:00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="font_4 text_5 pos_4">查看失效的券码></text>
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper pos_5"><text class="font text">兑换优惠券</text></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {ref} from 'vue'
|
||||||
|
const items = ref([null, null, null, null, null, null, null, null, null])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.mt-15 {
|
||||||
|
margin-top: 28.13rpx;
|
||||||
|
}
|
||||||
|
.ml-27 {
|
||||||
|
margin-left: 50.63rpx;
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
overflow: hidden;
|
||||||
|
background-image: url('https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=a3720d519620e205ede7e141952573f4.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.section {
|
||||||
|
background-image: url('https://ide.code.fun/api/image?token=67bd70bf4ae84d0012272c1a&name=a3720d519620e205ede7e141952573f4.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 1400rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 45rpx 0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.font_2 {
|
||||||
|
font-size: 37.5rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 29.42rpx;
|
||||||
|
color: #c35c5c;
|
||||||
|
}
|
||||||
|
.text_2 {
|
||||||
|
color: #000000;
|
||||||
|
line-height: 36.47rpx;
|
||||||
|
}
|
||||||
|
.pos_2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 53.08rpx;
|
||||||
|
top: 146.49rpx;
|
||||||
|
}
|
||||||
|
.pos_3 {
|
||||||
|
position: absolute;
|
||||||
|
left: 52.5rpx;
|
||||||
|
right: 50.63rpx;
|
||||||
|
top: 221.25rpx;
|
||||||
|
height: 1000rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 隐藏所有滚动条 */
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
padding: 30rpx 22.5rpx 30rpx 48.75rpx;
|
||||||
|
background-image: linear-gradient(90deg, #ffffff 28.8%, #faddde 96.8%);
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
box-shadow: 0rpx 7.5rpx 7.5rpx #00000040;
|
||||||
|
}
|
||||||
|
.list-item:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
height: 43.22rpx;
|
||||||
|
}
|
||||||
|
.font_3 {
|
||||||
|
font-size: 60rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 40.09rpx;
|
||||||
|
color: #c35c5c;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
line-height: 29.31rpx;
|
||||||
|
}
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 29.42rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
line-height: 29.18rpx;
|
||||||
|
}
|
||||||
|
.font_4 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 24.62rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text_4 {
|
||||||
|
margin-right: 11.25rpx;
|
||||||
|
line-height: 24.3rpx;
|
||||||
|
}
|
||||||
|
.font_5 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 24.62rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.font_6 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 31.88rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.text_5 {
|
||||||
|
color: #4c4c4c;
|
||||||
|
line-height: 25.22rpx;
|
||||||
|
}
|
||||||
|
.pos_4 {
|
||||||
|
position: absolute;
|
||||||
|
right: 265.91rpx;
|
||||||
|
bottom: 110.76rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
.pos_5 {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
71
pages/coupon/component/confirmPopup.vue
Normal file
71
pages/coupon/component/confirmPopup.vue
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col page">
|
||||||
|
<text class="self-center text">确认兑换该优惠券</text>
|
||||||
|
<view class="mt-34 flex-row justify-between self-stretch">
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper" @click="cancel"><text class="font text_2">取消</text></view>
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper_2" @click="confirm"><text class="font text_3">确定</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {nextTick, onMounted, ref} from 'vue'
|
||||||
|
import emitter from '../../../utils/emitter';
|
||||||
|
|
||||||
|
const cancel = () => {
|
||||||
|
emitter.emit('closeConfirmPopup')
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirm = () => {
|
||||||
|
emitter.emit('confirmExchange')
|
||||||
|
emitter.emit('closeConfirmPopup')
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page {
|
||||||
|
padding: 65.83rpx 73.45rpx 58.78rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 47.02rpx;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 42.32rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 41.17rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 23.51rpx 0;
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
border-radius: 47.02rpx;
|
||||||
|
width: 216.3rpx;
|
||||||
|
height: 84.64rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
.font {
|
||||||
|
font-size: 37.62rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 35.41rpx;
|
||||||
|
}
|
||||||
|
.text_2 {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text-wrapper_2 {
|
||||||
|
padding: 23.51rpx 0;
|
||||||
|
background-color: #ffb6b9;
|
||||||
|
border-radius: 47.02rpx;
|
||||||
|
width: 216.3rpx;
|
||||||
|
height: 84.64rpx;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
color: #ffffff;
|
||||||
|
line-height: 35.13rpx;
|
||||||
|
}
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
|
@ -55,11 +55,11 @@
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row section_5" @click="closeCoupon">
|
<view class="flex-row section_5">
|
||||||
<view class="flex-col justify-start items-center text-wrapper">
|
<view class="flex-col justify-start items-center text-wrapper" @click="cancel">
|
||||||
<text class="font_6 text_8">不使用优惠券</text>
|
<text class="font_6 text_8">不使用优惠券</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col justify-start items-center text-wrapper_2"><text class="font_6 text_9" @click="confirm">确定</text></view>
|
<view class="flex-col justify-start items-center text-wrapper_2" @click="confirm"><text class="font_6 text_9">确定</text></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -137,7 +137,10 @@
|
||||||
emitter.emit('closeCoupon')
|
emitter.emit('closeCoupon')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cancel = () => {
|
||||||
|
emitter.emit('cancelCoupon')
|
||||||
|
emitter.emit('closeCoupon')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const getMyCouponList = async () => {
|
const getMyCouponList = async () => {
|
||||||
|
@ -154,7 +157,6 @@
|
||||||
})
|
})
|
||||||
myCouponList.value = res.data.data
|
myCouponList.value = res.data.data
|
||||||
checkedArr.value = new Array(myCouponList.value.length).fill(false)
|
checkedArr.value = new Array(myCouponList.value.length).fill(false)
|
||||||
console.log(myCouponList.value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,6 +213,11 @@
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.section {
|
.section {
|
||||||
padding-top: 41.25rpx;
|
padding-top: 41.25rpx;
|
||||||
|
|
BIN
pages/coupon/images/cha.png
Normal file
BIN
pages/coupon/images/cha.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 449 B |
BIN
pages/coupon/images/yjt.png
Normal file
BIN
pages/coupon/images/yjt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 507 B |
|
@ -165,7 +165,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {onMounted, ref, toRaw} from 'vue'
|
import {nextTick, onMounted, ref, toRaw} from 'vue'
|
||||||
import emitter from '../../../utils/emitter'
|
import emitter from '../../../utils/emitter'
|
||||||
import { onLoad , onShow } from "@dcloudio/uni-app";
|
import { onLoad , onShow } from "@dcloudio/uni-app";
|
||||||
import { baseUrl } from '../../../api/request';
|
import { baseUrl } from '../../../api/request';
|
||||||
|
@ -193,7 +193,6 @@ const couponIsShow = ref(false)
|
||||||
const coupon = ref(null)
|
const coupon = ref(null)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const couponObj = ref({})
|
const couponObj = ref({})
|
||||||
const templateString = ref('')
|
const templateString = ref('')
|
||||||
const conditionAmount = ref(0)
|
const conditionAmount = ref(0)
|
||||||
|
@ -202,10 +201,7 @@ const myCouponList = ref([])
|
||||||
const cookie = wx.getStorageSync("cookie") //请求头
|
const cookie = wx.getStorageSync("cookie") //请求头
|
||||||
|
|
||||||
|
|
||||||
|
const useCouponId = ref(null)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -223,20 +219,36 @@ const cookie = wx.getStorageSync("cookie") //请求头
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getFonts()
|
getFonts()
|
||||||
// 将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
// 将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||||
console.log('======================================>', popup.value)
|
|
||||||
emitter.on('closeAddress', () => {
|
emitter.on('closeAddress', () => {
|
||||||
popup.value.close()
|
nextTick(() => {
|
||||||
|
if (popup.value) {
|
||||||
|
popup.value.close()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
emitter.on('closeCoupon', () => {
|
emitter.on('closeCoupon', () => {
|
||||||
coupon.value.close()
|
nextTick(() => {
|
||||||
|
if (coupon.value) {
|
||||||
|
coupon.value.close()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
emitter.on('cancelCoupon', () => {
|
||||||
|
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||||
|
sfAmount.value = sumprice.value
|
||||||
|
useCouponId.value = null
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
emitter.on('getCouponObj', (val) => {
|
emitter.on('getCouponObj', (val) => {
|
||||||
couponObj.value = val
|
couponObj.value = val
|
||||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||||
conditionAmount.value = val.couponVO.conditionAmount
|
conditionAmount.value = val.couponVO.conditionAmount
|
||||||
sfAmount.value = sumprice.value - conditionAmount.value
|
sfAmount.value = sumprice.value - conditionAmount.value
|
||||||
console.log(sfAmount.value)
|
useCouponId.value = val.id
|
||||||
|
console.log(val)
|
||||||
})
|
})
|
||||||
console.log('===============start===============')
|
console.log('===============start===============')
|
||||||
})
|
})
|
||||||
|
@ -348,7 +360,7 @@ const createOrder = async () => { //创建单个商品订单的方法
|
||||||
userName: userInfo.userName,
|
userName: userInfo.userName,
|
||||||
addressId: addressRealInfo.value.id, //地址信息id
|
addressId: addressRealInfo.value.id, //地址信息id
|
||||||
// contactsId: null, //联系人信息id
|
// contactsId: null, //联系人信息id
|
||||||
couponId: null, //优惠卷id
|
couponId: useCouponId.value, //优惠卷id
|
||||||
note: note.value,
|
note: note.value,
|
||||||
orderItemMainInfoAddRequestList: toRaw(postCartArr.value)
|
orderItemMainInfoAddRequestList: toRaw(postCartArr.value)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<couponPopupVue></couponPopupVue>
|
<confirmPopupVue></confirmPopupVue>
|
||||||
<!-- <timeSelectVue></timeSelectVue> -->
|
|
||||||
<!-- <tipVue></tipVue> -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import timeSelectVue from '../workshop/component/timeSelect.vue';
|
import timeSelectVue from '../workshop/component/timeSelect.vue';
|
||||||
import tipVue from '../workshop/component/tip.vue';
|
import tipVue from '../workshop/component/tip.vue';
|
||||||
import couponPopupVue from '../coupon/component/couponPopup.vue';
|
import couponPopupVue from '../coupon/component/couponPopup.vue';
|
||||||
|
import confirmPopupVue from '../coupon/component/confirmPopup.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user