会员,充值,明细,下单问题修复
This commit is contained in:
@@ -92,3 +92,6 @@ page,
|
|||||||
.u-flex-1{
|
.u-flex-1{
|
||||||
flex:1;
|
flex:1;
|
||||||
}
|
}
|
||||||
|
.u-col-center{
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
128
components/coupon/coupon-icon.vue
Normal file
128
components/coupon/coupon-icon.vue
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<!-- 优惠券图标 -->
|
||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="icon icon1" v-if="props.item.couponType == 1">
|
||||||
|
<view class="top">
|
||||||
|
<text class="i">¥</text>
|
||||||
|
<text class="num">{{ props.item.discountAmount }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="intro">
|
||||||
|
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="icon icon2" v-if="props.item.couponType == 2">
|
||||||
|
<view class="top">
|
||||||
|
<text class="i">{{ props.item.discountNum }}件</text>
|
||||||
|
<text class="num">商品兑换</text>
|
||||||
|
</view>
|
||||||
|
<view class="intro">
|
||||||
|
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="icon icon3" v-if="props.item.couponType == 3">
|
||||||
|
<view class="top">
|
||||||
|
<text class="num">{{ props.item.discountRate }}折</text>
|
||||||
|
</view>
|
||||||
|
<view class="intro">
|
||||||
|
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="icon icon2" v-if="props.item.couponType == 4">
|
||||||
|
<view class="top">
|
||||||
|
<text class="i">第二件</text>
|
||||||
|
<text class="num">半价券</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="icon icon2" v-if="props.item.couponType == 6">
|
||||||
|
<view class="top">
|
||||||
|
<text class="i">买一送</text>
|
||||||
|
<text class="num">一券</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
item: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
$color: #ff1c1c;
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
.icon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
&.icon1 {
|
||||||
|
.top {
|
||||||
|
.i {
|
||||||
|
color: $color;
|
||||||
|
font-size: 24upx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.num {
|
||||||
|
color: $color;
|
||||||
|
font-size: 72upx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.icon2 {
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.i {
|
||||||
|
color: $color;
|
||||||
|
font-size: 34upx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.num {
|
||||||
|
color: $color;
|
||||||
|
font-size: 34upx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.icon3 {
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.i {
|
||||||
|
color: $color;
|
||||||
|
font-size: 34upx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.num {
|
||||||
|
color: $color;
|
||||||
|
font-size: 52upx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
.t {
|
||||||
|
font-size: 22upx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
82
components/coupon/list.vue
Normal file
82
components/coupon/list.vue
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<up-popup :show="show" mode="center" round="16rpx" close-on-click-overlay @close="close">
|
||||||
|
<view class="model-box">
|
||||||
|
<view class="u-flex u-flex-between">
|
||||||
|
<view class="">
|
||||||
|
<text class="color-333 font-16">查看优惠券</text>
|
||||||
|
<text class="color-666 font-14">({{list.length}})张</text>
|
||||||
|
</view>
|
||||||
|
<up-icon name="close-circle" color="#666" size="28rpx" @click="close"></up-icon>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y="true" class="u-m-t-42" style="max-height: 50vh;">
|
||||||
|
<view class="list">
|
||||||
|
<view class="item u-flex u-m-b-32 u-col-center" v-for="(item,index) in list" :key="index">
|
||||||
|
<view class="left">
|
||||||
|
<couponIcon :item="item.coupon" />
|
||||||
|
<!-- <view class="red font-16 font-700" style="width: 122rpx;">第二件半价券</view> -->
|
||||||
|
<view></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="u-flex-1 u-p-l-26 ">
|
||||||
|
<view class="color-333 font-16">
|
||||||
|
{{item.coupon.title }}
|
||||||
|
</view>
|
||||||
|
<view class="color-999 font-12 u-m-t-8">
|
||||||
|
有效期至:{{item.coupon.validEndTime||''}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import couponIcon from './coupon-icon.vue'
|
||||||
|
const props = defineProps({
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const show = defineModel(false)
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
show.value = false
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.model-box {
|
||||||
|
width: 660rpx;
|
||||||
|
padding: 28rpx 48rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
.item {
|
||||||
|
padding: 32rpx 32rpx 32rpx 16rpx;
|
||||||
|
border-radius: 36rpx;
|
||||||
|
background: #F8F8F8;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
padding-right: 24rpx;
|
||||||
|
border-right: 1px solid #EDEDED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: #FF1C1C;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-x="true" class="u-m-t-20">
|
<scroll-view scroll-x="true" class="u-m-t-20">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item color1" @click="itemClick" v-for="(item,index) in list" :key="index"
|
<view class="item color1" @click="itemClick(index)" v-for="(item,index) in list" :key="index"
|
||||||
:class="{active:sel==index}">
|
:class="{active:sel==index}">
|
||||||
<view class="">
|
<view class="">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="font-12 color-666" v-if="item.couponInfoList.length">
|
<view class="font-12 color-666" v-if="item.couponInfoList.length">
|
||||||
<text>送</text>
|
<text>送</text>
|
||||||
<text>{{item.couponInfoList.length}}</text>
|
<text>{{couponNum(item.couponInfoList)}}</text>
|
||||||
<text>张券</text>
|
<text>张券</text>
|
||||||
<text class="color2 u-m-l-8" v-if="sel==index">查看</text>
|
<text class="color2 u-m-l-8" v-if="sel==index" @click="lookCoupon(item)">查看</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="sel u-flex" v-if="sel==index">
|
<view class="sel u-flex" v-if="sel==index">
|
||||||
@@ -40,21 +40,39 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-else></view>
|
<view class="" v-else></view>
|
||||||
|
<CouponList v-model="couponModel.show" :list="couponModel.couponInfoList"></CouponList>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import CouponList from '@/components/coupon/list.vue'
|
||||||
import * as rechargeApi from '@/common/api/market/recharge.js'
|
import * as rechargeApi from '@/common/api/market/recharge.js'
|
||||||
import {
|
import {
|
||||||
useCartsStore
|
useCartsStore
|
||||||
} from '@/stores/carts.js';
|
} from '@/stores/carts.js';
|
||||||
const cartStore = useCartsStore()
|
|
||||||
import {
|
import {
|
||||||
onMounted,
|
onMounted,reactive,
|
||||||
ref,
|
ref,
|
||||||
watch
|
watch
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
const couponModel = reactive({
|
||||||
|
show: false,
|
||||||
|
couponInfoList: []
|
||||||
|
})
|
||||||
|
|
||||||
|
function lookCoupon(item) {
|
||||||
|
couponModel.couponInfoList = item.couponInfoList
|
||||||
|
couponModel.show = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function couponNum(list) {
|
||||||
|
return list.reduce((prve, cur) => {
|
||||||
|
return prve + cur.num
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
const cartStore = useCartsStore()
|
||||||
|
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
const sel = ref(-1)
|
const sel = ref(-1)
|
||||||
const isShow = ref(false)
|
const isShow = ref(false)
|
||||||
@@ -82,19 +100,25 @@
|
|||||||
updateSel()
|
updateSel()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const emits=defineEmits(['updateChargeSel','updateRechargeId'])
|
||||||
function updateSel(){
|
function updateSel(){
|
||||||
const selItem=list.value[sel.value]
|
const selItem=list.value[sel.value]
|
||||||
emits('updateChargeSel',selItem?selItem:{})
|
emits('updateChargeSel',selItem?selItem:{})
|
||||||
emits('updateRechargeId',data.id)
|
emits('updateRechargeId',data.id)
|
||||||
}
|
}
|
||||||
function itemClick(index){
|
function itemClick(index){
|
||||||
|
|
||||||
|
console.log('itemClick',sel.value,index);
|
||||||
|
if(sel.value==-1){
|
||||||
|
sel.value=index
|
||||||
|
return
|
||||||
|
}
|
||||||
if(sel.value==index){
|
if(sel.value==index){
|
||||||
sel.value=-1
|
sel.value=-1
|
||||||
|
return
|
||||||
}
|
}
|
||||||
sel.value=index
|
sel.value=index
|
||||||
}
|
}
|
||||||
const emits=defineEmits(['updateChargeSel'])
|
|
||||||
watch(()=>sel.value,(newval)=>{
|
watch(()=>sel.value,(newval)=>{
|
||||||
updateSel()
|
updateSel()
|
||||||
})
|
})
|
||||||
@@ -104,8 +128,14 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.color1{
|
||||||
|
color: #5F2E0F;
|
||||||
|
}
|
||||||
|
.color2{
|
||||||
|
color: #FF6300;
|
||||||
|
}
|
||||||
.box {
|
.box {
|
||||||
background: linear-gradient(179.4deg, #f8eadc 0%, #fdf9f6 82%, #ffffff 100%);
|
background-color: #fdf9f6;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
border-radius: 22rpx;
|
border-radius: 22rpx;
|
||||||
@@ -125,7 +155,7 @@
|
|||||||
.item {
|
.item {
|
||||||
padding: 36rpx 22rpx;
|
padding: 36rpx 22rpx;
|
||||||
border-radius: 42rpx;
|
border-radius: 42rpx;
|
||||||
background: linear-gradient(180deg, #F5F5F5 58.54%, #FFF 140.47%);
|
background: linear-gradient(180deg, #F5F5F5 58.54%, #FFF 104.47%);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -88,8 +88,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- isTableFee == 0是不免除 -->
|
<!-- isTableFee == 0是不免除 -->
|
||||||
<view class="cell-item"
|
<view class="cell-item" v-if="cartStore.orderCostSummary.seatFee">
|
||||||
v-if="cartStore.orderCostSummary.seatFee">
|
|
||||||
<view class="label">餐位费</view>
|
<view class="label">餐位费</view>
|
||||||
<view class="val">
|
<view class="val">
|
||||||
<view>X{{cartStore.seatFeeConfig.personCount}}</view>
|
<view>X{{cartStore.seatFeeConfig.personCount}}</view>
|
||||||
@@ -117,13 +116,18 @@
|
|||||||
<u-image bgColor="#fff" :width="item.width||'44rpx'" :height="item.height||'44rpx'"
|
<u-image bgColor="#fff" :width="item.width||'44rpx'" :height="item.height||'44rpx'"
|
||||||
v-if="item.icon" :src="item.icon" mode=""></u-image>
|
v-if="item.icon" :src="item.icon" mode=""></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text class="name u-m-l-16"> {{ item.name }} </text>
|
<text class="name u-m-l-16 no-wrap"> {{ item.name }} </text>
|
||||||
|
<text class="font-12" style="color: #666;margin-right: 16rpx;" v-if="item.type=='points'">
|
||||||
|
「可用积分{{pointsRes.accountPoints}},最大可抵扣{{maxPointDiscount}}元」
|
||||||
|
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- 优惠卷 -->
|
<!-- 优惠卷 -->
|
||||||
<view class="favorable_right" v-if="item.type=='coupon'">
|
<view class="favorable_right" v-if="item.type=='coupon'">
|
||||||
<text class="favorable_right_text red" v-if="returnCouponDiscount>0">-¥{{returnCouponDiscount}}</text>
|
<text class="favorable_right_text red"
|
||||||
|
v-if="returnCouponDiscount>0">-¥{{returnCouponDiscount}}</text>
|
||||||
<up-icon name="arrow-right" color="#575B66" size="16"
|
<up-icon name="arrow-right" color="#575B66" size="16"
|
||||||
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'||!listinfo.id"></up-icon>
|
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'||!listinfo.id"></up-icon>
|
||||||
|
|
||||||
@@ -131,19 +135,31 @@
|
|||||||
|
|
||||||
<!-- 新客立减 -->
|
<!-- 新客立减 -->
|
||||||
<view class="favorable_right" v-if="item.type=='newUser'">
|
<view class="favorable_right" v-if="item.type=='newUser'">
|
||||||
<text class="favorable_right_text red" v-if="newUserDiscount>0">-¥{{newUserDiscount}}</text>
|
<text class="favorable_right_text red"
|
||||||
|
v-if="newUserDiscount>0">-¥{{newUserDiscount}}</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 积分 -->
|
<!-- 积分 -->
|
||||||
<view class="favorable_right" v-if="item.type=='points'">
|
<view class="favorable_right u-flex u-col-center" v-if="item.type=='points'">
|
||||||
|
<up-icon name="checkmark-circle-fill" size="24rpx" v-if="usePoints"
|
||||||
|
color="#FE7E00"></up-icon>
|
||||||
|
<text v-if="usePoints" class="red">
|
||||||
|
-¥{{cartStore.orderCostSummary.pointDeductionAmount}}
|
||||||
|
</text>
|
||||||
|
<view v-else class="u-flex u-col-center">
|
||||||
|
<view class="round"></view>
|
||||||
|
<text class="color-333 font-12 no-wrap">使用抵扣</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="favorable_right" v-if="item.type=='points'">
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
||||||
v-if="calcUsablePointsData.integral">
|
v-if="calcUsablePointsData.integral">
|
||||||
使用 {{ calcUsablePointsData.integral}}
|
使用 {{ calcUsablePointsData.integral}}
|
||||||
积分抵扣¥{{props.listinfo.pointsDiscountAmount}}
|
积分抵扣¥{{props.listinfo.pointsDiscountAmount}}
|
||||||
</text>
|
</text>
|
||||||
<up-icon v-else name="arrow-right" color="#575B66" size="16"></up-icon>
|
<up-icon v-else name="arrow-right" color="#575B66" size="16"></up-icon>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -247,6 +263,12 @@
|
|||||||
|
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
|
||||||
|
const usePoints = ref(false)
|
||||||
|
|
||||||
|
function chnageIsUsePoints() {
|
||||||
|
usePoints.value = !usePoints.value
|
||||||
|
}
|
||||||
|
|
||||||
import IntegralInput from './IntegralInput.vue';
|
import IntegralInput from './IntegralInput.vue';
|
||||||
import {
|
import {
|
||||||
APImemberPointsmyPoints,
|
APImemberPointsmyPoints,
|
||||||
@@ -278,8 +300,7 @@
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const favorablelist = reactive([
|
const favorablelist = reactive([{
|
||||||
{
|
|
||||||
name: "新客立减",
|
name: "新客立减",
|
||||||
type: "newUser",
|
type: "newUser",
|
||||||
width: '40rpx',
|
width: '40rpx',
|
||||||
@@ -374,12 +395,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const returnCouponDiscount = computed(() => {
|
const returnCouponDiscount = computed(() => {
|
||||||
if(!favorablelist[1].value){
|
if (!favorablelist[1].value) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
return favorablelist[1].value.reduce((prve,cur)=>{
|
return favorablelist[1].value.reduce((prve, cur) => {
|
||||||
return prve+(cur.discountAmount||0)
|
return prve + (cur.discountAmount || 0)
|
||||||
},0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 清空
|
// 清空
|
||||||
@@ -428,6 +449,8 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'points':
|
case 'points':
|
||||||
|
chnageIsUsePoints()
|
||||||
|
return
|
||||||
IntegralInputclose()
|
IntegralInputclose()
|
||||||
if (calcUsablePointsData.usable == 0) {
|
if (calcUsablePointsData.usable == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -453,14 +476,47 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const pointsRes = reactive({
|
||||||
|
accountPoints: 0
|
||||||
|
})
|
||||||
|
getMaxPointsDiscount()
|
||||||
|
const maxPointDiscount=ref(0)
|
||||||
|
async function getMaxPointsDiscount() {
|
||||||
|
//积分可抵扣最大金额
|
||||||
|
const maxMoney = cartStore.orderCostSummary.goodsRealAmount - cartStore.orderCostSummary
|
||||||
|
.couponDeductionAmount
|
||||||
|
let res = await APImemberPointscalcUsablePoints({
|
||||||
|
shopUserId: props.orderVIP.id,
|
||||||
|
orderAmount: maxMoney
|
||||||
|
})
|
||||||
|
console.log(res);
|
||||||
|
Object.assign(pointsRes, res)
|
||||||
|
const maxUsablePoints = res.maxUsablePoints
|
||||||
|
maxPointDiscount.value=res.maxDeductionAmount
|
||||||
|
// props.listinfo.pointsDiscountAmount = await APImemberPointscalcDeductionAmount({
|
||||||
|
// points: maxUsablePoints,
|
||||||
|
// shopUserId: props.orderVIP.id,
|
||||||
|
// orderAmount: maxMoney
|
||||||
|
// })
|
||||||
|
cartStore.setUserPoints(maxUsablePoints)
|
||||||
|
}
|
||||||
|
watch(() => usePoints.value, (newval) => {
|
||||||
|
if (newval) {
|
||||||
|
getMaxPointsDiscount()
|
||||||
|
} else {
|
||||||
|
cartStore.setUserPoints(0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const handleConfirm = async (integral) => {
|
const handleConfirm = async (integral) => {
|
||||||
//积分可抵扣最大金额
|
//积分可抵扣最大金额
|
||||||
const maxMoney= cartStore.orderCostSummary.goodsRealAmount-cartStore.orderCostSummary.couponDeductionAmount
|
const maxMoney = cartStore.orderCostSummary.goodsRealAmount - cartStore.orderCostSummary
|
||||||
|
.couponDeductionAmount
|
||||||
calcUsablePointsData.integral = integral
|
calcUsablePointsData.integral = integral
|
||||||
props.listinfo.pointsDiscountAmount = await APImemberPointscalcDeductionAmount({
|
props.listinfo.pointsDiscountAmount = await APImemberPointscalcDeductionAmount({
|
||||||
points: integral,
|
points: integral,
|
||||||
shopUserId: props.orderVIP.id,
|
shopUserId: props.orderVIP.id,
|
||||||
orderAmount:maxMoney
|
orderAmount: maxMoney
|
||||||
})
|
})
|
||||||
cartStore.setUserPoints(integral)
|
cartStore.setUserPoints(integral)
|
||||||
emits('clickPointsamount', {
|
emits('clickPointsamount', {
|
||||||
@@ -473,7 +529,7 @@
|
|||||||
const getCalcUsablePoints = async (data) => {
|
const getCalcUsablePoints = async (data) => {
|
||||||
Object.assign(calcUsablePointsData, data);
|
Object.assign(calcUsablePointsData, data);
|
||||||
try {
|
try {
|
||||||
cartStore.setPointDeductionRule(data.equivalentPoints,data.maxDeductionAmount)
|
cartStore.setPointDeductionRule(data.equivalentPoints, data.maxDeductionAmount)
|
||||||
calcUsablePointsData.minIntegral = data.minDeductionPoints
|
calcUsablePointsData.minIntegral = data.minDeductionPoints
|
||||||
calcUsablePointsData.maxIntegral = data.maxUsablePoints
|
calcUsablePointsData.maxIntegral = data.maxUsablePoints
|
||||||
calcUsablePointsData.instructionText =
|
calcUsablePointsData.instructionText =
|
||||||
@@ -514,18 +570,19 @@
|
|||||||
IntegralInputclose
|
IntegralInputclose
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(()=>props.listinfo.seatNum,(newval)=>{
|
watch(() => props.listinfo.seatNum, (newval) => {
|
||||||
cartStore.setSeatFeeConfig('personCount',newval||1)
|
cartStore.setSeatFeeConfig('personCount', newval || 1)
|
||||||
})
|
})
|
||||||
|
|
||||||
const newUserDiscount=ref(0)
|
const newUserDiscount = ref(0)
|
||||||
async function getConsumeDiscount(){
|
async function getConsumeDiscount() {
|
||||||
const consumeDiscountRes = await consumeDiscount({
|
const consumeDiscountRes = await consumeDiscount({
|
||||||
shopId: uni.cache.get('shopId'),
|
shopId: uni.cache.get('shopId'),
|
||||||
})
|
})
|
||||||
if(consumeDiscountRes){
|
if (consumeDiscountRes&&consumeDiscountRes.isUse) {
|
||||||
newUserDiscount.value=consumeDiscountRes.amount
|
newUserDiscount.value = consumeDiscountRes.amount
|
||||||
cartStore.newUserDiscount=consumeDiscountRes.amount||0
|
cartStore.newUserDiscount = consumeDiscountRes.amount || 0
|
||||||
|
cartStore.consumeDiscount=consumeDiscountRes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getConsumeDiscount()
|
getConsumeDiscount()
|
||||||
@@ -537,6 +594,14 @@
|
|||||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.round {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #D9D9D9;
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .u-textarea__field {
|
::v-deep .u-textarea__field {
|
||||||
background: #FAFAFA;
|
background: #FAFAFA;
|
||||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
@@ -1043,7 +1108,8 @@
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-weight: 400rpx;
|
font-weight: 400rpx;
|
||||||
&.red{
|
|
||||||
|
&.red {
|
||||||
color: #FF3232;
|
color: #FF3232;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1058,9 +1124,11 @@
|
|||||||
|
|
||||||
.favorable_right_text {
|
.favorable_right_text {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
&.red{
|
|
||||||
|
&.red {
|
||||||
color: #FF3232;
|
color: #FF3232;
|
||||||
}
|
}
|
||||||
|
|
||||||
text:nth-child(1) {
|
text:nth-child(1) {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
@@ -1205,7 +1273,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.red{
|
|
||||||
color:#FF3232;
|
.red {
|
||||||
|
color: #FF3232;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -118,7 +118,10 @@
|
|||||||
BigNumber
|
BigNumber
|
||||||
} from 'bignumber.js';
|
} from 'bignumber.js';
|
||||||
import ChargeVue from './components/charge.vue';
|
import ChargeVue from './components/charge.vue';
|
||||||
import {pay} from '@/utils/pay.js'
|
import {
|
||||||
|
pay
|
||||||
|
} from '@/utils/pay.js'
|
||||||
|
|
||||||
function onback() {
|
function onback() {
|
||||||
closeSocket()
|
closeSocket()
|
||||||
back()
|
back()
|
||||||
@@ -149,7 +152,8 @@
|
|||||||
import {
|
import {
|
||||||
APIgetOrderById,
|
APIgetOrderById,
|
||||||
APIputuserorder,
|
APIputuserorder,
|
||||||
APIhistoryOrder,rechargePayOrder
|
APIhistoryOrder,
|
||||||
|
rechargePayOrder
|
||||||
} from '@/common/api/order/index.js'
|
} from '@/common/api/order/index.js'
|
||||||
import {
|
import {
|
||||||
APIusershopInfodetail,
|
APIusershopInfodetail,
|
||||||
@@ -169,14 +173,17 @@
|
|||||||
|
|
||||||
|
|
||||||
//充值相关
|
//充值相关
|
||||||
const rechargeItem=ref({id:''})
|
const rechargeItem = ref({
|
||||||
const rechargeId=ref(null)
|
id: ''
|
||||||
|
})
|
||||||
|
const rechargeId = ref(null)
|
||||||
|
|
||||||
function updateRechargeId(e){
|
function updateRechargeId(e) {
|
||||||
rechargeId.value=e
|
rechargeId.value = e
|
||||||
}
|
}
|
||||||
function updateChargeSel(e){
|
|
||||||
rechargeItem.value=e
|
function updateChargeSel(e) {
|
||||||
|
rechargeItem.value = e
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onMessage(Message) {
|
async function onMessage(Message) {
|
||||||
@@ -192,8 +199,8 @@
|
|||||||
let res = await APIgetOrderById({
|
let res = await APIgetOrderById({
|
||||||
orderId: listinfo.id
|
orderId: listinfo.id
|
||||||
})
|
})
|
||||||
console.log('onMessage:APIgetOrderById',res);
|
console.log('onMessage:APIgetOrderById', res);
|
||||||
if(res){
|
if (res) {
|
||||||
// cartStore.carts=[];
|
// cartStore.carts=[];
|
||||||
// cartStore.setOldOrder(res)
|
// cartStore.setOldOrder(res)
|
||||||
}
|
}
|
||||||
@@ -647,7 +654,7 @@
|
|||||||
if (!cartStore.isEmpty) {
|
if (!cartStore.isEmpty) {
|
||||||
const res = await createOrder()
|
const res = await createOrder()
|
||||||
//历史订单数据
|
//历史订单数据
|
||||||
const res1= await APIgetOrderById({
|
const res1 = await APIgetOrderById({
|
||||||
orderId: res.id
|
orderId: res.id
|
||||||
})
|
})
|
||||||
cartStore.setOldOrder(res1)
|
cartStore.setOldOrder(res1)
|
||||||
@@ -700,22 +707,26 @@
|
|||||||
const goToPay = async (isCreateOrder = false) => {
|
const goToPay = async (isCreateOrder = false) => {
|
||||||
// 余额支付
|
// 余额支付
|
||||||
if (paymentmethod.payType == 'accountPay') {
|
if (paymentmethod.payType == 'accountPay') {
|
||||||
if (orderVIP.value.isVip == 0) {
|
// if (orderVIP.value.isVip == 0) {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
title: '提示',
|
// title: '提示',
|
||||||
content: '您还不是会员,是否去注册会员?',
|
// content: '您还不是会员,是否去注册会员?',
|
||||||
success: (res) => {
|
// success: (res) => {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
uni.pro.navigateTo('user/member/index', {
|
// uni.pro.navigateTo('user/member/index', {
|
||||||
shopId: orderVIP.value.shopId,
|
// shopId: orderVIP.value.shopId,
|
||||||
type: 'detail'
|
// type: 'detail'
|
||||||
})
|
// })
|
||||||
} else if (res.cancel) {
|
// } else if (res.cancel) {
|
||||||
console.log('用户点击取消');
|
// console.log('用户点击取消');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} else if (orderVIP.value.payPwd == '') {
|
// return
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (orderVIP.value.payPwd == '') {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '您还未设置支付密码,是否去设置?',
|
content: '您还未设置支付密码,是否去设置?',
|
||||||
@@ -779,7 +790,7 @@
|
|||||||
vipPrice: cartStore.useVipPrice ? 1 : 0, //是否使用会员价0否1是
|
vipPrice: cartStore.useVipPrice ? 1 : 0, //是否使用会员价0否1是
|
||||||
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||||
seatNum: is_type.value == 0 ? cartStore.seatFeeConfig.personCount : 0, //用餐人数
|
seatNum: is_type.value == 0 ? cartStore.seatFeeConfig.personCount : 0, //用餐人数
|
||||||
originAmount: cartStore.orderCostSummary.goodsRealAmount , //订单原金额(包含打包费+餐位费) 不含折扣价格
|
originAmount: cartStore.orderCostSummary.goodsRealAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||||
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
||||||
discountAmount: 0, //手动优惠金额 写死0
|
discountAmount: 0, //手动优惠金额 写死0
|
||||||
productCouponDiscountAmount: cartStore.orderCostSummary.productCouponDeduction, //商品优惠券抵扣金额
|
productCouponDiscountAmount: cartStore.orderCostSummary.productCouponDeduction, //商品优惠券抵扣金额
|
||||||
@@ -789,25 +800,29 @@
|
|||||||
roundAmount: 0, //抹零金额 减免多少钱
|
roundAmount: 0, //抹零金额 减免多少钱
|
||||||
pointsDiscountAmount: cartStore.orderCostSummary
|
pointsDiscountAmount: cartStore.orderCostSummary
|
||||||
.pointDeductionAmount, //积分抵扣金额(tb_points_basic_setting表)
|
.pointDeductionAmount, //积分抵扣金额(tb_points_basic_setting表)
|
||||||
pointsNum: listinfo.pointsNum, //(扣除各类折扣 enable_deduction后使用)
|
pointsNum: cartStore.orderCostSummary.pointUsed, //(扣除各类折扣 enable_deduction后使用)
|
||||||
|
newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减
|
||||||
|
newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore
|
||||||
|
.consumeDiscount.id : '',
|
||||||
remark: '', //用户备注
|
remark: '', //用户备注
|
||||||
}
|
}
|
||||||
console.log('topay checkOrderPay', checkOrderPay);
|
console.log('topay checkOrderPay', checkOrderPay);
|
||||||
try {
|
try {
|
||||||
if(rechargeItem.value.id&&rechargeId.value){
|
if (rechargeItem.value.id && rechargeId.value) {
|
||||||
//充值支付
|
//充值支付
|
||||||
const payRes= await rechargePayOrder({
|
const payRes = await rechargePayOrder({
|
||||||
checkOrderPay,
|
checkOrderPay,
|
||||||
payType: paymentmethod.payType,
|
payType: paymentmethod.payType,
|
||||||
buyerRemark: '',
|
buyerRemark: '',
|
||||||
returnUrl: '',
|
returnUrl: '',
|
||||||
rechargeId:rechargeId.value,
|
rechargeId: rechargeId.value,
|
||||||
rechargeDetailId:rechargeItem.value.id,
|
rechargeDetailId: rechargeItem.value.id,
|
||||||
shopUserId:orderVIP.value.id,
|
shopUserId: orderVIP.value.id,
|
||||||
shopId: orderVIP.value.shopId,
|
shopId: orderVIP.value.shopId,
|
||||||
})
|
})
|
||||||
pay(payRes)
|
await pay(payRes)
|
||||||
}else{
|
pay_unlock()
|
||||||
|
} else {
|
||||||
console.log('微信支付');
|
console.log('微信支付');
|
||||||
await storeMemberpay.actionsltPayOrder({
|
await storeMemberpay.actionsltPayOrder({
|
||||||
checkOrderPay,
|
checkOrderPay,
|
||||||
@@ -815,15 +830,17 @@
|
|||||||
buyerRemark: '',
|
buyerRemark: '',
|
||||||
returnUrl: ''
|
returnUrl: ''
|
||||||
})
|
})
|
||||||
|
pay_unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error',error);
|
console.log('error', error);
|
||||||
pay_unlock()
|
pay_unlock()
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pay_unlock()
|
pay_unlock()
|
||||||
|
console.log('orderorderInfo');
|
||||||
orderorderInfo()
|
orderorderInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,7 +870,7 @@
|
|||||||
vipPrice: cartStore.useVipPrice ? 1 : 0, //是否使用会员价0否1是
|
vipPrice: cartStore.useVipPrice ? 1 : 0, //是否使用会员价0否1是
|
||||||
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||||
seatNum: is_type.value == 0 ? cartStore.seatFeeConfig.personCount : 0, //用餐人数
|
seatNum: is_type.value == 0 ? cartStore.seatFeeConfig.personCount : 0, //用餐人数
|
||||||
originAmount: cartStore.orderCostSummary.goodsRealAmount , //订单原金额(包含打包费+餐位费) 不含折扣价格
|
originAmount: cartStore.orderCostSummary.goodsRealAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||||
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
||||||
discountAmount: 0, //手动优惠金额 写死0
|
discountAmount: 0, //手动优惠金额 写死0
|
||||||
productCouponDiscountAmount: cartStore.orderCostSummary.productCouponDeduction, //商品优惠券抵扣金额
|
productCouponDiscountAmount: cartStore.orderCostSummary.productCouponDeduction, //商品优惠券抵扣金额
|
||||||
@@ -863,7 +880,10 @@
|
|||||||
roundAmount: 0, //抹零金额 减免多少钱
|
roundAmount: 0, //抹零金额 减免多少钱
|
||||||
pointsDiscountAmount: cartStore.orderCostSummary
|
pointsDiscountAmount: cartStore.orderCostSummary
|
||||||
.pointDeductionAmount, //积分抵扣金额(tb_points_basic_setting表)
|
.pointDeductionAmount, //积分抵扣金额(tb_points_basic_setting表)
|
||||||
pointsNum: listinfo.pointsNum, //(扣除各类折扣 enable_deduction后使用)
|
pointsNum: cartStore.orderCostSummary.pointUsed, //(扣除各类折扣 enable_deduction后使用)
|
||||||
|
newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减
|
||||||
|
newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore.consumeDiscount
|
||||||
|
.id : '',
|
||||||
remark: '', //用户备注
|
remark: '', //用户备注
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -934,7 +954,7 @@
|
|||||||
url: '/pages/product/index'
|
url: '/pages/product/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const packfee=computed(()=>{
|
const packfee = computed(() => {
|
||||||
return cartStore.orderCostSummary.packFee
|
return cartStore.orderCostSummary.packFee
|
||||||
})
|
})
|
||||||
//不计算各种折扣前的实付金额
|
//不计算各种折扣前的实付金额
|
||||||
|
|||||||
@@ -323,7 +323,10 @@
|
|||||||
let noUseGoodsCoupon = []
|
let noUseGoodsCoupon = []
|
||||||
let noUseDiscountCoupon = []
|
let noUseDiscountCoupon = []
|
||||||
const user = uni.cache.get('shopUserInfo')
|
const user = uni.cache.get('shopUserInfo')
|
||||||
const shopInfo = uni.cache.get('shopInfo')
|
let shopInfo = uni.cache.get('shopInfo')||{}
|
||||||
|
if(!shopInfo.isMemberPrice){
|
||||||
|
shopInfo={}
|
||||||
|
}
|
||||||
const goodsOrderPrice = uni.getStorageSync('goodsOrderPrice') || 0
|
const goodsOrderPrice = uni.getStorageSync('goodsOrderPrice') || 0
|
||||||
const goodsList = uni.getStorageSync('canDikouGoodsArr') || []
|
const goodsList = uni.getStorageSync('canDikouGoodsArr') || []
|
||||||
const dinnerType = uni.getStorageSync('dinnerType')
|
const dinnerType = uni.getStorageSync('dinnerType')
|
||||||
|
|||||||
@@ -25,8 +25,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="listStyle " v-for="(item,i) in formData.list" :key="i">
|
<view class="listStyle " v-for="(item,i) in formData.list" :key="i">
|
||||||
<view class="flex-start">
|
<view class="flex-start">
|
||||||
<view class="listStyle_left">
|
<view class="color-333 font-16 font-700 u-m-b-16">
|
||||||
<view class="listrigth">
|
|
||||||
<view v-if="formData.active == 1">
|
<view v-if="formData.active == 1">
|
||||||
<text v-if="item.bizCode == 'cashIn'">
|
<text v-if="item.bizCode == 'cashIn'">
|
||||||
现金充值
|
现金充值
|
||||||
@@ -60,6 +59,10 @@
|
|||||||
{{item.content}}
|
{{item.content}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="listStyle_left">
|
||||||
|
<view class="listrigth color-333 font-14">
|
||||||
|
<view>{{item.shopName||'门店名称'}}</view>
|
||||||
<view v-if="formData.active == 1" :class="{colorStyle: (item.bizCode == 'cashIn' || item.bizCode == 'wechatIn' ||
|
<view v-if="formData.active == 1" :class="{colorStyle: (item.bizCode == 'cashIn' || item.bizCode == 'wechatIn' ||
|
||||||
item.bizCode == 'alipayIn'|| item.bizCode == 'awardIn'|| item.bizCode == 'rechargeRefund')}">
|
item.bizCode == 'alipayIn'|| item.bizCode == 'awardIn'|| item.bizCode == 'rechargeRefund')}">
|
||||||
{{ item.amount }}
|
{{ item.amount }}
|
||||||
@@ -285,11 +288,6 @@
|
|||||||
color: #FF7127;
|
color: #FF7127;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.listStyle_left {
|
.listStyle_left {
|
||||||
@@ -304,7 +302,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.listrigth2 {
|
.listrigth2 {
|
||||||
margin-top: 16rpx;
|
margin-top: 4rpx;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<view class="balance-wrap">
|
<view class="balance-wrap">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<text class="i t">余额</text>
|
<text class="i t">余额</text>
|
||||||
<text class="n t">{{shopUserInfo.amount}}</text>
|
<text class="n t">{{shopUserInfo.amount||0}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<text class="t" @click="toDetail">明细</text>
|
<text class="t" @click="toDetail">明细</text>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
:class="{active:sel==index}">
|
:class="{active:sel==index}">
|
||||||
<view class="">
|
<view class="">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text class="font-700" style="font-size: 48rpx;"
|
<text class="font-700" style="font-size: 48 u-flex-1rpx;"
|
||||||
:class="{color2:sel==index}">{{item.amount}}</text>
|
:class="{color2:sel==index}">{{item.amount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="font-12" v-if="item.rewardAmount" :class="{color2:sel==index}">
|
<view class="font-12" v-if="item.rewardAmount" :class="{color2:sel==index}">
|
||||||
@@ -51,16 +51,16 @@
|
|||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text class="font-14">{{item.rewardAmount}}</text>
|
<text class="font-14">{{item.rewardAmount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="font-12" v-if="item.rewardPoints">
|
<view class="font-12" v-if="item.rewardPoints" style="color: #5F2E0F;">
|
||||||
<text>送</text>
|
<text>送</text>
|
||||||
<text>¥</text>
|
|
||||||
<text class="font-14">{{item.rewardPoints}}</text>
|
<text class="font-14">{{item.rewardPoints}}</text>
|
||||||
|
<text class="">积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="font-12 color-666" v-if="item.couponInfoList.length">
|
<view class="font-12 color-666" v-if="item.couponInfoList.length">
|
||||||
<text>送</text>
|
<text>送</text>
|
||||||
<text>{{item.couponInfoList.length}}</text>
|
<text>{{couponNum(item.couponInfoList) }}</text>
|
||||||
<text>张券</text>
|
<text>张券</text>
|
||||||
<text class="color2 u-m-l-8" v-if="sel==index">查看</text>
|
<text class="color2 u-m-l-8" v-if="sel==index" @click="lookCoupon(item)">查看</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="sel u-flex" v-if="sel==index">
|
<view class="sel u-flex" v-if="sel==index">
|
||||||
@@ -68,12 +68,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<template v-if="state.isCustom">
|
||||||
<view class="u-flex other flex-center">
|
<view class="u-flex other flex-center">
|
||||||
<text class="font-14 color-333 font-700 u-m-r-28">其他金额</text>
|
<text class="font-14 color-333 font-700 u-m-r-28">其他金额</text>
|
||||||
<up-input v-model="money" type="number" placeholder="请输入充值金额" border="none"
|
<up-input v-model="money" type="number" placeholder="请输入充值金额" border="none"
|
||||||
placeholder-style="font-size:14px;"></up-input>
|
placeholder-style="font-size:14px;"></up-input>
|
||||||
</view>
|
</view>
|
||||||
<view class="color-999 font-12 u-m-t-4">自定义金额充值时,不享受任何优惠赠送</view>
|
<view class="color-999 font-12 u-m-t-4">自定义金额充值时,不享受任何优惠赠送</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
<button class="buy-btn" @click="buy">
|
<button class="buy-btn" @click="buy">
|
||||||
<text class="font-16 ">¥{{charge_money}}</text>
|
<text class="font-16 ">¥{{charge_money}}</text>
|
||||||
<text class="font-14 u-m-l-24">立即充值</text>
|
<text class="font-14 u-m-l-24">立即充值</text>
|
||||||
@@ -98,14 +101,14 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-16 u-flex u-flex-y-center">
|
<view class="u-m-t-16 u-flex u-flex-y-center">
|
||||||
<text class="no-wrap">充值说明</text>
|
<text class="no-wrap">充值说明</text>
|
||||||
<view class="u-m-l-28">
|
<text class="u-m-l-28" style="word-break: break-all;">
|
||||||
{{state.remark||''}}
|
{{state.remark||''}}
|
||||||
</view>
|
</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<CouponList v-model="couponModel.show" :list="couponModel.couponInfoList"></CouponList>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -114,6 +117,7 @@
|
|||||||
APIusershopInfodetail,
|
APIusershopInfodetail,
|
||||||
APIshopUserInfo
|
APIshopUserInfo
|
||||||
} from '@/common/api/member.js'
|
} from '@/common/api/member.js'
|
||||||
|
import CouponList from '@/components/coupon/list.vue'
|
||||||
import * as rechargeApi from '@/common/api/market/recharge.js'
|
import * as rechargeApi from '@/common/api/market/recharge.js'
|
||||||
import {
|
import {
|
||||||
recharge
|
recharge
|
||||||
@@ -134,6 +138,21 @@
|
|||||||
import {
|
import {
|
||||||
pay
|
pay
|
||||||
} from '@/utils/pay.js'
|
} from '@/utils/pay.js'
|
||||||
|
|
||||||
|
function couponNum(list) {
|
||||||
|
return list.reduce((prve, cur) => {
|
||||||
|
return prve + cur.num
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
const couponModel = reactive({
|
||||||
|
show: false,
|
||||||
|
couponInfoList: []
|
||||||
|
})
|
||||||
|
|
||||||
|
function lookCoupon(item) {
|
||||||
|
couponModel.show = true
|
||||||
|
couponModel.couponInfoList = item.couponInfoList
|
||||||
|
}
|
||||||
async function buy() {
|
async function buy() {
|
||||||
if (!charge_money.value) {
|
if (!charge_money.value) {
|
||||||
return uni.showToast({
|
return uni.showToast({
|
||||||
@@ -146,7 +165,7 @@
|
|||||||
shopUserId: shopUserInfo.id,
|
shopUserId: shopUserInfo.id,
|
||||||
}
|
}
|
||||||
if (sel.value < 0) {
|
if (sel.value < 0) {
|
||||||
json.amount = `${money.value}`.trim()*1
|
json.amount = `${money.value}`.trim() * 1
|
||||||
} else {
|
} else {
|
||||||
json.rechargeDetailId = list.value[sel.value].id
|
json.rechargeDetailId = list.value[sel.value].id
|
||||||
json.amount = list.value[sel.value].amount
|
json.amount = list.value[sel.value].amount
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ export const useCartsStore = defineStore('cart',
|
|||||||
isTableFee: 1
|
isTableFee: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const consumeDiscount=ref({})
|
||||||
|
|
||||||
// 适配工具库 BaseCartItem 接口的商品数据转换函数
|
// 适配工具库 BaseCartItem 接口的商品数据转换函数
|
||||||
const convertToBaseCartItem = (item) => {
|
const convertToBaseCartItem = (item) => {
|
||||||
const skuData = item.skuData ? {
|
const skuData = item.skuData ? {
|
||||||
@@ -584,9 +586,12 @@ export const useCartsStore = defineStore('cart',
|
|||||||
setSeatFeeConfig,
|
setSeatFeeConfig,
|
||||||
seatFeeConfig,
|
seatFeeConfig,
|
||||||
shopInfo,
|
shopInfo,
|
||||||
|
//新客立减数据
|
||||||
|
consumeDiscount,
|
||||||
//新客立减金额
|
//新客立减金额
|
||||||
newUserDiscount,
|
newUserDiscount,
|
||||||
getAllGoodsList
|
getAllGoodsList,
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="top" style=" background-image: url(/static/czzx_header_bg.png);">
|
<view class="top" style=" background-image: url(/static/czzx_header_bg.png);">
|
||||||
<view>
|
<view>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<up-avatar size="136rpx" shape="square" round="20rpx" :src="shopInfo.logo"></up-avatar>
|
<up-image radius="20rpx" width="136rpx" height="136rpx" :src="shopInfo.logo" mode="aspectFill"></up-image>
|
||||||
<view class="u-p-l-20">
|
<view class="u-p-l-20">
|
||||||
<view class="shop-name u-line-1">{{shopInfo.shopName||'店铺名称' }}</view>
|
<view class="shop-name u-line-1">{{shopInfo.shopName||'店铺名称' }}</view>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
@@ -577,7 +577,7 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
column-gap: 36rpx;
|
column-gap: 36rpx;
|
||||||
|
row-gap: 36rpx;
|
||||||
.vip-list-item {
|
.vip-list-item {
|
||||||
border: 4rpx solid #D9D9D9;
|
border: 4rpx solid #D9D9D9;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
|
|||||||
@@ -438,7 +438,7 @@ export function returnCanDikouGoods(arr, user, shopInfo) {
|
|||||||
return v.num > 0;
|
return v.num > 0;
|
||||||
})
|
})
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
return returnGoodsPrice(b, use, shopInfo) - returnGoodsPrice(a, user, shopInfo);
|
return returnGoodsPrice(b, user, shopInfo) - returnGoodsPrice(a, user, shopInfo);
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export const pay = (res) => {
|
export const pay = (res) => {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '支付中...',
|
title: '支付中...',
|
||||||
mask: true
|
mask: true
|
||||||
|
|||||||
Reference in New Issue
Block a user