积分商城问题修复

This commit is contained in:
2025-12-11 15:51:14 +08:00
parent 62af2a81f8
commit 9a0164eff6
11 changed files with 773 additions and 479 deletions

View File

@@ -7,8 +7,9 @@
</view>
</template>
<template v-else>
<image class="top-img" :src="item.goodsImageUrl" mode="aspectFit"></image>
<view @click="prveImg(item.goodsImageUrl)">
<image class="top-img" :src="item.goodsImageUrl" mode="aspectFill" ></image>
</view>
</template>
<view class="sku">
<view>
@@ -75,11 +76,16 @@
<view class="popup-content">
<view class="popup-content-top">
<text class="color-666">领取方式</text>
<text class="u-m-l-16">需前往店铺自行兑换领取</text>
<text class="u-m-l-16" v-if="item.goodsCategory=='优惠券'">系统发放</text>
<text class="u-m-l-16" v-else>店内自取</text>
</view>
<view class="goods-info">
<view class="u-flex">
<image class="cover" :src="item.goodsImageUrl"></image>
<image class="cover" v-if="item.goodsCategory!='优惠券'" :src="item.goodsImageUrl"></image>
<view v-else class="cover bg-fff">
<couponIcon :item="item.couponInfo" typeKey="couponType" />
</view>
<view class="u-flex u-flex-1 u-row-between u-p-l-16 u-col-center">
<view>
<view class="u-font-32 font-bold">{{item.goodsName}}</view>
@@ -116,6 +122,7 @@
} from '@/utils/uniapp.js'
import modal from "@/scoreShop/components/modal.vue";
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
import couponIcon from "@/components/coupon-icon/index";
import {
pay
} from '@/utils/pay.js'
@@ -125,6 +132,12 @@
const modalData = reactive({
show: false,
});
function prveImg(url){
uni.previewImage({
urls:[url]
})
}
const popupData = reactive({
show: false,
@@ -238,13 +251,13 @@
}
const type = item.couponInfo.couponType
if (type == 1) {
return item.couponInfo.discountAmount + '元代金券' + ' ' + `(满${item.fullAmount}可用)`
return item.couponInfo.discountAmount + '元代金券' + ' ' + `(满${item.couponInfo.fullAmount}可用)`
}
if (type == 2) {
return item.couponInfo.discountNum + '件商品兑换' + ' ' + `(满${item.fullAmount}可用)`
return item.couponInfo.discountNum + '件商品兑换' + ' ' + `(满${item.couponInfo.fullAmount}可用)`
}
if (type == 3) {
return item.couponInfo.discountRate / 10 + '折' + ' ' + `(满${item.fullAmount}可用)`
return item.couponInfo.discountRate / 10 + '折' + ' ' + `(满${item.couponInfo.fullAmount}可用)`
}
if (type == 4) {
return '第二件半价券'
@@ -447,7 +460,11 @@
height: 184rpx;
border-radius: 16rpx;
background: #d9d9d9;
&.bg-fff{
background-color: #fff;
}
}
}
.bottom {
@@ -467,4 +484,7 @@
font-size: 700;
}
}
.w-full{
width: 100%;
}
</style>

View File

@@ -3,10 +3,10 @@
<view v-for="(item, index) in list" :key="index" @click="toDetail(item)">
<template v-if="layout === 'list'">
<view class="item">
<view class="img coupon" v-if="item.goodsCategory=='优惠'&&item.couponInfo">
<couponIcon :item="item.couponInfo" typeKey="couponType" />
<view class="img coupon" v-if="item.goodsCategory=='优惠'&&item.couponInfo">
<couponIcon :item="item.couponInfo" typeKey="couponType" />
</view>
<image class="img" v-else lazy-load :src="item.goodsImageUrl"></image>
<image class="img" v-else lazy-load :src="item.goodsImageUrl" mode="aspectFill"></image>
<view class="info">
<view>
<view class="name u-line-1">{{item.goodsName}}</view>
@@ -26,9 +26,9 @@
<template v-if="layout === 'block'">
<view class="item">
<view class="img coupon" v-if="item.goodsCategory=='优惠券'&&item.couponInfo">
<couponIcon :item="item.couponInfo" typeKey="couponType" />
<couponIcon :item="item.couponInfo" typeKey="couponType" />
</view>
<image class="img" v-else lazy-load :src="item.goodsImageUrl"></image>
<image class="img" v-else lazy-load :src="item.goodsImageUrl" mode="aspectFill"></image>
<view class="info">
<view class="name u-line-1">{{item.goodsName}}</view>
<view class="price">
@@ -63,11 +63,15 @@
default: () => {},
}
});
const numListStyle={
'font-size':'24rpx'
}
const numBlockStyle={
'font-size':'24rpx'
}
function toDetail(item) {
if (item.quantity<=0) {
return
}
uni.setStorageSync('exchange_goods', item)
uni.navigateTo({
url: '/scoreShop/detail/index?id=' + item.id,
@@ -129,7 +133,7 @@
background: #d9d9d9;
&.coupon {
// background-color: transparent;
background-color: transparent;
}
}
@@ -160,6 +164,7 @@
font-size: 28rpx;
font-weight: 700;
white-space: nowrap;
&.end {
color: #999999;
background: rgba(153, 153, 153, 0.3);
@@ -195,7 +200,7 @@
background: #d9d9d9;
&.coupon {
// background-color: transparent;
background-color: transparent;
}
}

View File

@@ -12,11 +12,15 @@
</view>
<view class="u-p-l-36">
<view>{{item.pointsGoodsName}}</view>
<view class="u-m-t-28 color-666">{{item.spendPoints}}积分</view>
<view class="u-m-t-28 color-666">
<text>{{item.spendPoints}}积分 </text>
<text v-if="item.extraPaymentAmount"> + {{item.extraPaymentAmount}} </text>
</view>
</view>
</view>
<view class="u-m-t-28 u-flex u-row-right btns">
<view class="btn look" @click.stop="lookCode(item)" v-if="item.goodsCategory!='优惠券'">查看券码</view>
<view class="btn look" @click.stop="lookCode(item)" v-if="item.goodsCategory!='优惠券'&&item.status!='已退款'&&item.status!='已完成'">查看券码</view>
<view class="btn black" @click.stop="refund(item)" v-if="canRefund(item)">申请退款</view>
<view class="btn black" @click.stop="cancelRefund(item)" v-if="item.status=='退款中'" >取消退款</view>
</view>
@@ -66,7 +70,7 @@
}
function canRefund(item) {
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ){
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ||item.status=='已完成'){
return false
}
return true

View File

@@ -2,8 +2,9 @@
<view class="min-page bg-f7 color-333 u-font-28">
<view class="top">
<view class="u-flex u-col-center">
<up-image width="208rpx" height="208rpx" :src="item.goodsImageUrl" v-if="item.goodsCategory!='优惠券'"></up-image>
<view class="" style="width: 208rpx;height: 208rpx;">
<up-image width="208rpx" height="208rpx" :src="item.goodsImageUrl"
v-if="item.goodsCategory!='优惠券'"></up-image>
<view class="" style="width: 208rpx;height: 208rpx;" v-else>
<couponIcon :item="item.couponInfo" typeKey="couponType" />
</view>
<view class="u-p-l-28 u-flex-1">
@@ -15,7 +16,7 @@
<view class="u-m-t-8 font-bold color1"> X{{item.number}} </view>
</view>
</view>
<template v-if="item.goodsCategory=='其它商品'">
<template v-if="item.goodsCategory=='其它商品'&&item.status!='已退款'">
<view class="u-m-t-16">
<view class="u-flex u-row-center">
<up-qrcode cid="ex1" :size="104" :val="qrcode"></up-qrcode>
@@ -92,6 +93,7 @@
const item = reactive({
})
function returnStatusClass(item) {
if (item.status == '已完成' || item.status == '已退款') {
return 'gray'
@@ -103,22 +105,24 @@
return 'error'
}
}
function canRefund(item) {
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ){
if (item.status == '已退款' || item.status == '退款中' || item.goodsCategory != '其它商品' || item.status == '已完成') {
return false
}
return true
}
function init() {
const data = uni.getStorageSync('points_order_detail')
qrcode.value=data.couponCode
qrcode.value = data.couponCode
Object.assign(item, data)
refresh()
}
onLoad(init)
function refund(item) {
uni.showModal({
title: '提示',
@@ -135,13 +139,13 @@
title: '申请退款成功',
icon: 'none'
})
} else {
uni.showToast({
title: '申请退款失败',
icon: 'none'
})
}
setTimeout(() => {
refresh()
@@ -150,17 +154,18 @@
}
}
})
}
function refresh(){
function refresh() {
pointGoodsApi.recordOne({
id:item.id
}).then(res=>{
Object.assign(item,res)
id: item.id,
shopId: item.shopId
}).then(res => {
Object.assign(item, res)
})
}
function cancelRefund(item) {
uni.showModal({
title: '提示',
@@ -177,13 +182,13 @@
title: '取消退款成功',
icon: 'none'
})
} else {
uni.showToast({
title: '取消退款失败',
icon: 'none'
})
}
setTimeout(() => {
refresh()
@@ -192,9 +197,8 @@
}
}
})
}
</script>
<style lang="scss" scoped>

View File

@@ -147,7 +147,7 @@
value: "unevaluated",
},
{
name: "已核销",
name: "已完成",
value: "evaluated",
},
{

View File

@@ -27,9 +27,13 @@
<text class="color-666">消耗积分</text>
<text>{{item.spendPoints}}</text>
</view>
<view class="u-p-22" v-if="item.extraPaymentAmount">
<text class="color-666">支付金额</text>
<text>{{item.extraPaymentAmount}}</text>
</view>
<view class="u-p-22">
<text class="color-666">下单时间</text>
<text>{{item.checkoutTime}}</text>
<text>{{item.createTime}}</text>
</view>
<view class="u-p-22">
<text class="color-666">订单号</text>