写真产品已完成
This commit is contained in:
parent
3be2fa87f5
commit
3da3d9e6b4
21
pages.json
21
pages.json
|
@ -1,5 +1,19 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
|
{
|
||||||
|
"path" : "pages/book/photoProductDetail/photoProductDetail",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/book/photoProducts/photoProducts",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/coupon/CouponMall/CouponMall",
|
"path" : "pages/coupon/CouponMall/CouponMall",
|
||||||
"style" :
|
"style" :
|
||||||
|
@ -261,6 +275,13 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationBarTitleText" : ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/coupon/OverDueCoupon/OverDueCoupon",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"plugins" : {
|
"plugins" : {
|
||||||
|
|
|
@ -4,31 +4,70 @@
|
||||||
<view class="flex-col justify-start items-center text-wrapper pos"><text class="font text">我的优惠券</text></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>
|
<text class="font_2 text_2 pos_2">优惠券</text>
|
||||||
<view class="flex-col pos_3">
|
<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-col relative list-item mt-15" v-for="(item, index) in couponList" :key="index">
|
||||||
<view class="flex-row justify-between items-center">
|
<view class="flex-row justify-between items-center">
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<view class="group">
|
<view class="group">
|
||||||
<text class="font_3">50</text>
|
<text class="font_3">{{ item.couponVO.conditionAmount }}</text>
|
||||||
<text class="font_2 text_3">元</text>
|
<text class="font_2 text_3">元</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="ml-54 font">200减50元</text>
|
<text class="ml-54 font">{{ item.couponVO.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="font_4 text_4">已过期</text>
|
<text class="font_4 text_4"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-14 flex-row">
|
<view class="mt-14 flex-row">
|
||||||
<text class="shrink-0 self-start font_5">满200元使用</text>
|
<text class="shrink-0 self-start font_5">满{{ item.couponVO.standardAmount }}元使用</text>
|
||||||
<text class="flex-1 font_6 ml-27">2025-01-10 00:00至2025-04-09 00:00</text>
|
<text class="flex-1 font_6 ml-27">{{ item.couponVO.startTime.substr(0, 16) }}至{{ item.couponVO.endTime.substr(0, 16) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="font_4 text_5 pos_4">查看失效的券码></text>
|
<text class="font_4 text_5 pos_4" @click="jumpToOverDue">查看失效的券码></text>
|
||||||
<view class="flex-col justify-start items-center text-wrapper pos_5"><text class="font text">兑换优惠券</text></view>
|
<view @click="jumpToMall" class="flex-col justify-start items-center text-wrapper pos_5"><text class="font text">兑换优惠券</text></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref} from 'vue'
|
import {onMounted, ref} from 'vue'
|
||||||
const items = ref([null, null, null, null, null, null, null, null, null])
|
import { baseUrl } from '../../../api/request';
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
const cookie = wx.getStorageSync("cookie") //请求头
|
||||||
|
onMounted(() => {
|
||||||
|
getCouponList()
|
||||||
|
})
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
getCouponList()
|
||||||
|
})
|
||||||
|
|
||||||
|
const couponList = ref([])
|
||||||
|
|
||||||
|
const getCouponList = async () => {
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/coupon/list/my',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
cookie
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: '可用'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
couponList.value = res.data.data
|
||||||
|
console.log(couponList.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const jumpToMall = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../CouponMall/CouponMall'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const jumpToOverDue = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../OverDueCoupon/OverDueCoupon'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -155,7 +194,7 @@
|
||||||
.pos_4 {
|
.pos_4 {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 265.91rpx;
|
right: 265.91rpx;
|
||||||
bottom: 110.76rpx;
|
bottom: 100.76rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
}
|
}
|
||||||
.pos_5 {
|
.pos_5 {
|
||||||
|
|
184
pages/coupon/OverDueCoupon/OverDueCoupon.vue
Normal file
184
pages/coupon/OverDueCoupon/OverDueCoupon.vue
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
<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 overDueCouponList" :key="index">
|
||||||
|
<view class="flex-row justify-between items-center">
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<view class="group">
|
||||||
|
<text class="font_3">{{ item.couponVO.conditionAmount }}</text>
|
||||||
|
<text class="font_2 text_3">元</text>
|
||||||
|
</view>
|
||||||
|
<text class="ml-54 font_4">{{ item.couponVO.name }}</text>
|
||||||
|
</view>
|
||||||
|
<text class="font_5 text_4">已过期</text>
|
||||||
|
</view>
|
||||||
|
<view class="mt-14 flex-row">
|
||||||
|
<text class="shrink-0 self-start font_5">满{{ item.couponVO.standardAmount }}元使用</text>
|
||||||
|
<text class="flex-1 font_6 ml-27">{{ item.couponVO.startTime.substr(0, 16) }}至{{ item.couponVO.endTime.substr(0, 16) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view @click="jumpToMall" class="flex-col justify-start items-center text-wrapper pos_4"><text class="font text">兑换优惠券</text></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {onMounted, ref} from 'vue'
|
||||||
|
import { baseUrl } from '../../../api/request';
|
||||||
|
const cookie = wx.getStorageSync("cookie") //请求头
|
||||||
|
onMounted(() => {
|
||||||
|
getOverDueCouponList()
|
||||||
|
})
|
||||||
|
|
||||||
|
const overDueCouponList = ref([])
|
||||||
|
|
||||||
|
const getOverDueCouponList = async () => {
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/coupon/list/my',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
cookie
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: '已过期'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
overDueCouponList.value = res.data.data
|
||||||
|
console.log(overDueCouponList.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const jumpToMall = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../CouponMall/CouponMall'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
</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 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 29.42rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
line-height: 29.18rpx;
|
||||||
|
}
|
||||||
|
.font_2 {
|
||||||
|
font-size: 37.5rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 29.42rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.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: 1100rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 隐藏所有滚动条 */
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
padding: 30rpx 22.5rpx 30rpx 48.75rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
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: #818181;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
line-height: 29.31rpx;
|
||||||
|
}
|
||||||
|
.font_4 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 29.42rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.font_5 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 24.62rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.text_4 {
|
||||||
|
margin-right: 11.25rpx;
|
||||||
|
line-height: 24.3rpx;
|
||||||
|
}
|
||||||
|
.font_6 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: FZSongKeBenXiuKaiS-R-GB;
|
||||||
|
line-height: 31.88rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.pos_4 {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
|
@ -21,7 +21,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row justify-between section_3">
|
<view class="flex-row justify-between section_3" @click="jumpToMall">
|
||||||
<text class="font_2 text_2">优惠券商城</text>
|
<text class="font_2 text_2">优惠券商城</text>
|
||||||
<image
|
<image
|
||||||
class="image_2"
|
class="image_2"
|
||||||
|
@ -68,8 +68,9 @@
|
||||||
import {onMounted, ref} from 'vue'
|
import {onMounted, ref} from 'vue'
|
||||||
import emitter from '../../../utils/emitter';
|
import emitter from '../../../utils/emitter';
|
||||||
import { baseUrl } from '../../../api/request';
|
import { baseUrl } from '../../../api/request';
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
const checkedArr = ref([])
|
const checkedArr = ref([])
|
||||||
const idx = ref(0)
|
const idx = ref(-1)
|
||||||
const isShow = ref(true)
|
const isShow = ref(true)
|
||||||
const borderStyle = ref({})
|
const borderStyle = ref({})
|
||||||
let totalAmount = 0
|
let totalAmount = 0
|
||||||
|
@ -101,6 +102,7 @@
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const changeStateLeft = (val:any) => {
|
const changeStateLeft = (val:any) => {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
isShow.value = !isShow.value
|
isShow.value = !isShow.value
|
||||||
|
@ -133,7 +135,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
|
if (idx.value !== -1) {
|
||||||
emitter.emit('getCouponObj', myCouponList.value[idx.value])
|
emitter.emit('getCouponObj', myCouponList.value[idx.value])
|
||||||
|
}
|
||||||
emitter.emit('closeCoupon')
|
emitter.emit('closeCoupon')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +164,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const jumpToMall = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/coupon/CouponMall/CouponMall'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<view class="flex-col justify-start relative page">
|
<view class="flex-col justify-start relative page">
|
||||||
<view class="flex-col group_1">
|
<view class="flex-col group_1">
|
||||||
<!-- 地址信息 -->
|
<!-- 地址信息 -->
|
||||||
<view class="flex-col section_2">
|
<view class="flex-col section_2" @click="loadPop" :style="{ pointerEvents: isLoading ? 'none' : 'auto' }">
|
||||||
<view class="flex-row justify-between">
|
<view class="flex-row justify-between">
|
||||||
<view class="flex-col">
|
<view class="flex-col">
|
||||||
<text class="self-center font text">{{ addressRealInfo.region }}</text>
|
<text class="self-center font text">{{ addressRealInfo.region }}</text>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<text class="font_2 text_2 ml-8">{{ addressRealInfo.detailAddress }}</text>
|
<text class="font_2 text_2 ml-8">{{ addressRealInfo.detailAddress }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row self-start group" @click="loadPop">
|
<view class="flex-row self-start group">
|
||||||
<text class="font_3 text_3">更换地址</text>
|
<text class="font_3 text_3">更换地址</text>
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_2"
|
class="shrink-0 image_2"
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
class="image_7"
|
class="image_7"
|
||||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FjIVFaWXA-rmb.png"
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FjIVFaWXA-rmb.png"
|
||||||
/>
|
/>
|
||||||
<text class="font_4 ml-2">{{ productObject.price }}</text>
|
<text class="font_4 ml-2">{{ productObject.price.toFixed(2) }}</text>
|
||||||
<!-- <text class="font_6 text_27 ml-2">00</text> -->
|
<!-- <text class="font_6 text_27 ml-2">00</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -93,10 +93,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col mt-25">
|
<view class="flex-col mt-25">
|
||||||
<view class="flex-row justify-between group_10" @click="openCoupon">
|
<view class="flex-row justify-between group_10" @click="openCoupon" :style="{ pointerEvents: isLoading ? 'none' : 'auto' }">
|
||||||
<text class="font_7">优惠券</text>
|
<text class="font_7">优惠券</text>
|
||||||
<view class="flex-row">
|
<view class="flex-row">
|
||||||
<text class="font_8">{{ templateString }}</text>
|
<text class="font_8" :style="{color: textColor}">{{ templateString }}</text>
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_7 ml-3"
|
class="shrink-0 image_7 ml-3"
|
||||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FTrywtERT-right.png"
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FTrywtERT-right.png"
|
||||||
|
@ -146,7 +146,8 @@
|
||||||
<text class="text_22">{{ sfAmount.toFixed(2) }}</text>
|
<text class="text_22">{{ sfAmount.toFixed(2) }}</text>
|
||||||
<!-- <text class="text_24">00</text> -->
|
<!-- <text class="text_24">00</text> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col justify-start items-center text-wrapper_3" @click="createOrder"><text class="font_7 text_23">微信支付</text></view>
|
<view class="flex-col justify-start items-center text-wrapper_3" @click="wxPayFd" :style="{ pointerEvents: isLoading ? 'none' : 'auto' }">
|
||||||
|
<text class="font_7 text_23">微信支付</text></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-popup ref="popup" background-color="#fff">
|
<uni-popup ref="popup" background-color="#fff">
|
||||||
|
@ -162,6 +163,9 @@
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
|
|
||||||
|
<!-- 遮罩层 -->
|
||||||
|
<view v-if="isShow" class="overlay"></view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -202,9 +206,7 @@ const cookie = wx.getStorageSync("cookie") //请求头
|
||||||
|
|
||||||
|
|
||||||
const useCouponId = ref(null)
|
const useCouponId = ref(null)
|
||||||
|
const textColor = ref('')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,6 +241,7 @@ const useCouponId = ref(null)
|
||||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||||
sfAmount.value = sumprice.value
|
sfAmount.value = sumprice.value
|
||||||
useCouponId.value = null
|
useCouponId.value = null
|
||||||
|
textColor.value = '#818181'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -248,6 +251,7 @@ const useCouponId = ref(null)
|
||||||
conditionAmount.value = val.couponVO.conditionAmount
|
conditionAmount.value = val.couponVO.conditionAmount
|
||||||
sfAmount.value = sumprice.value - conditionAmount.value
|
sfAmount.value = sumprice.value - conditionAmount.value
|
||||||
useCouponId.value = val.id
|
useCouponId.value = val.id
|
||||||
|
textColor.value = '#FFB6B9'
|
||||||
console.log(val)
|
console.log(val)
|
||||||
})
|
})
|
||||||
console.log('===============start===============')
|
console.log('===============start===============')
|
||||||
|
@ -303,14 +307,73 @@ const useCouponId = ref(null)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let debounceTimer = null;
|
||||||
|
let wxPayTimer = null;
|
||||||
|
let loading = false;
|
||||||
|
let isLoading = ref(false)
|
||||||
|
let isShow = ref(false)
|
||||||
|
|
||||||
|
const fd = () => {
|
||||||
|
clearTimeout(debounceTimer)
|
||||||
|
showLoading()
|
||||||
|
debounceTimer = setTimeout(async () => {
|
||||||
|
await getMyCouponList()
|
||||||
|
hideLoading()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const wxPayFd = () => {
|
||||||
|
clearTimeout(wxPayTimer)
|
||||||
|
showLoading()
|
||||||
|
isShow.value = true
|
||||||
|
wxPayTimer = setTimeout(async () => {
|
||||||
|
await createOrder()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function showLoading() {
|
||||||
|
if (!loading) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
});
|
||||||
|
loading = true;
|
||||||
|
isLoading.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function hideLoading() {
|
||||||
|
if (loading) {
|
||||||
|
wx.hideLoading();
|
||||||
|
loading = false;
|
||||||
|
isLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//减少当前商品数量
|
||||||
|
const shortNum = ()=>{
|
||||||
|
if(quantity.value > 1) {
|
||||||
|
quantity.value -= 1
|
||||||
|
//计算商品价格
|
||||||
|
sumprice.value = math.round(sumprice.value-productObject.value.price,2)
|
||||||
|
sfAmount.value = sumprice.value
|
||||||
|
useCouponId.value = null
|
||||||
|
textColor.value = '#818181'
|
||||||
|
fd()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//增加当前商品数量
|
||||||
|
const addNum = ()=>{
|
||||||
|
if( quantity.value < productObject.value.inventory ) { //数量肯定不能大于库存
|
||||||
|
quantity.value += 1
|
||||||
|
sumprice.value = math.round(sumprice.value+productObject.value.price,2) //解决js计算精度问题
|
||||||
|
sfAmount.value = sumprice.value
|
||||||
|
useCouponId.value = null
|
||||||
|
textColor.value = '#818181'
|
||||||
|
fd()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -391,21 +454,11 @@ const dealRes =(res)=> { //处理来自后端的数据
|
||||||
sfAmount.value = res.data.data.price
|
sfAmount.value = res.data.data.price
|
||||||
console.log('productArr--->',productObject.value);
|
console.log('productArr--->',productObject.value);
|
||||||
}
|
}
|
||||||
//减少当前商品数量
|
|
||||||
const shortNum = ()=>{
|
|
||||||
if(quantity.value > 1) {
|
|
||||||
quantity.value -= 1
|
|
||||||
//计算商品价格
|
|
||||||
sumprice.value = math.round(sumprice.value-productObject.value.price,2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//增加当前商品数量
|
|
||||||
const addNum = ()=>{
|
|
||||||
if( quantity.value < productObject.value.inventory ) { //数量肯定不能大于库存
|
|
||||||
quantity.value += 1
|
|
||||||
sumprice.value = math.round(sumprice.value+productObject.value.price,2) //解决js计算精度问题
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const formatArr = () =>{ //格式化
|
const formatArr = () =>{ //格式化
|
||||||
postCartArr.value.splice(0,postCartArr.value.length)
|
postCartArr.value.splice(0,postCartArr.value.length)
|
||||||
postCartArr.value.push({
|
postCartArr.value.push({
|
||||||
|
@ -414,7 +467,7 @@ const formatArr = () =>{ //格式化
|
||||||
})
|
})
|
||||||
console.log(postCartArr.value);
|
console.log(postCartArr.value);
|
||||||
}
|
}
|
||||||
const wxPay = async( oid )=> { //传入订单id
|
const wxPay = async ( oid )=> { //传入订单id
|
||||||
try {
|
try {
|
||||||
const res = await uni.request({
|
const res = await uni.request({
|
||||||
url: baseUrl + '/wechat/payment/create',
|
url: baseUrl + '/wechat/payment/create',
|
||||||
|
@ -482,6 +535,18 @@ const textAssign = (e) => { //文本输入框赋值方法
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
|
||||||
|
.overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.4); /* 半透明黑色背景 */
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
.popup-content {
|
.popup-content {
|
||||||
height: 392px;
|
height: 392px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user