积分商城问题修复

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

@@ -9,3 +9,10 @@ export const consumeDiscount = (data) => {
data: data
})
}
export const homeData = (data) => {
return request({
url: prveUrl + '/user/home/data',
method: 'get',
data: data
})
}

View File

@@ -3,8 +3,8 @@
<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>
<text class="i" ></text>
<text class="num" >{{ props.item.discountAmount }}</text>
</view>
<view class="intro">
<text class="t">{{ props.item.fullAmount }}可用</text>
@@ -12,8 +12,8 @@
</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>
<text class="i" >{{ props.item.discountNum }}</text>
<text class="num" >商品兑换</text>
</view>
<view class="intro">
<text class="t">{{ props.item.fullAmount }}可用</text>
@@ -21,7 +21,7 @@
</view>
<view class="icon icon3" v-if="props.item.couponType == 3">
<view class="top">
<text class="num">{{ props.item.discountRate/10 }}</text>
<text class="num" >{{ props.item.discountRate/10 }}</text>
</view>
<view class="intro">
<text class="t">{{ props.item.fullAmount }}可用</text>
@@ -29,34 +29,37 @@
</view>
<view class="icon icon2" v-if="props.item.couponType == 4">
<view class="top">
<text class="i">第二件</text>
<text class="num">半价券</text>
<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>
<text class="i" >买一送</text>
<text class="num" >一券</text>
</view>
</view>
</view>
</template>
<script setup>
const props = defineProps({
const props = defineProps({
item: {
type: Object,
default: {}
}
});
},
});
</script>
<style scoped lang="scss">
$color: #ff1c1c;
.container {
$color: #ff1c1c;
.container {
width: 100%;
height: 100%;
padding: 0;
.icon {
width: 100%;
height: 100%;
@@ -64,6 +67,7 @@ $color: #ff1c1c;
flex-direction: column;
justify-content: center;
align-items: center;
&.icon1 {
.top {
.i {
@@ -71,6 +75,7 @@ $color: #ff1c1c;
font-size: 24upx;
font-weight: bold;
}
.num {
color: $color;
font-size: 72upx;
@@ -78,17 +83,20 @@ $color: #ff1c1c;
}
}
}
&.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;
@@ -96,17 +104,20 @@ $color: #ff1c1c;
}
}
}
&.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;
@@ -118,11 +129,12 @@ $color: #ff1c1c;
.intro {
display: flex;
justify-content: center;
.t {
font-size: 22upx;
color: #999;
}
}
}
}
}
</style>

View File

@@ -334,7 +334,7 @@ onShow(async () => {
proxy.$isResolve();
const shopId = uni.cache.get('shopId');
if (shopId) {
indexsRef.value.getVipConfig();
indexsRef.value.updateData();
}
} catch (error) {}
await proxy.$onLaunched;

View File

@@ -2,76 +2,99 @@
<view class="content min-page bg-f7">
<view class="contentbox">
<template v-if="shopExtend.length">
<image
class="bg"
:src="shopExtend[0].value"
mode="aspectFill"
v-if="!isJsonArrayString(shopExtend[0].value)"
></image>
<image class="bg" :src="shopExtend[0].value" mode="aspectFill"
v-if="!isJsonArrayString(shopExtend[0].value)"></image>
<swiper class="swiper" autoplay circular v-else>
<swiper-item
class="swiper-item"
v-for="item in JSON.parse(shopExtend[0].value)"
>
<swiper-item class="swiper-item" v-for="item in JSON.parse(shopExtend[0].value)">
<image class="swiper-bg" :src="item"></image>
</swiper-item>
</swiper>
</template>
<view class="contentboxitem flex-between">
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
<image
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png"
mode="aspectFill"
></image>
<text class="contentboxitemlefttextone">点餐</text>
<text class="contentboxitemlefttexttow">在线点不排队</text>
</view>
<view class="contentboxitemright">
<!-- <view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/memberdetails')"> -->
<view class="contentboxitemright_item flex-between" @click="tomember">
<image
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png"
mode="aspectFill"
></image>
<view class="contentboxitemright_itembox flex-colum">
<text>会员</text>
<text>入会享权益</text>
</view>
</view>
<!-- <view class="contentboxitemright_item flex-between"
@click="memberindex('user/member/index')"
> -->
<view class="contentboxitemright_item flex-between" @click="toCharge">
<image
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png"
mode="aspectFill"
></image>
<view class="contentboxitemright_itembox flex-colum">
<text>充值</text>
<text>充值享更多优惠</text>
<view class="userInfo u-flex">
<up-avatar size="61px" :default-url="imgs.defaultAvatar"></up-avatar>
<view class="u-flex-1 u-flex u-row-between u-p-l-16 u-p-r-16">
<view>
<view class="u-flex">
<view class="u-font-32 color-333 font-bold u-line-1" style="max-width: 320rpx;">HI欢迎回来</view>
<view class="vip" v-if="shopUserInfo.isVip">会员身份</view>
</view>
<view class="u-m-t-10 u-font-24 color-666">
<text>优惠券{{allConfig.couponNum}}</text>
<text class="u-m-l-22">积分{{allConfig.pointNum}}</text>
</view>
</view>
<image :src="imgs.code" class="code"></image>
</view>
</view>
<view class="u-flex menus u-font-32 color-333">
<view class="menu-item" @click="toIntegralMall">
<view>积分商城</view>
<view class="u-font-24 color-999">攒积分兑换更多优惠</view>
<view class="new-menus-box">
<view class="new-menus layout2" v-if="allConfig.takeout">
<view class="diner" @click="scanCodehandle(0)">
<image :src="imgs.orderFood" class="icon"></image>
<view class="title">立即点单</view>
<view class="desc">下单免排队</view>
</view>
<view class="menu-item" @click="toFenxiao">
<view>分销</view>
<view class="u-font-24 color-999">邀请好友获得佣金</view>
<view class="line"></view>
<view class="takeout">
<image :src="imgs.takeout" class="icon"></image>
<view class="title">外卖点单</view>
<view class="desc">外卖送到家</view>
</view>
</view>
<u-popup
:show="popupShow"
:safe-area-inset-bottom="false"
mode="center"
@close="popupShow = false"
>
<view class="new-menus layout1" v-else @click="scanCodehandle(0)">
<view>
<view class="title">立即点单</view>
<view class="desc">-自助下单 快人一步-</view>
</view>
<image :src="imgs.big_orderFood" class="big_img"></image>
</view>
<view class="groupBuying" v-if="allConfig.group">
<view class="u-flex u-col-center">
<image class="img" :src="imgs.groupBuying"></image>
<view class="u-font-32 color-333 font-700 u-m-l-12">快乐拼单</view>
</view>
<view class="u-font-28 color-999">一键分享快速拼单</view>
</view>
</view>
<view class="points" @click="toIntegralMall" v-if="allConfig.pointsMall">
<view>
<view class="title">积分乐园</view>
<view class="desc">好物兑换 畅花积分</view>
</view>
<image class="img" :src="imgs.points"></image>
</view>
<view class="bottom_menus">
<view class="item" @click="tomember">
<image :src="imgs.vip" class="img"></image>
<view class="title">会员</view>
<view class="desc">入会项权益</view>
</view>
<view class="item" @click="toCharge">
<image :src="imgs.recharge" class="img"></image>
<view class="title">充值</view>
<view class="desc">充值享更多优惠</view>
</view>
<view class="item" @click="toFenxiao" v-if="allConfig.distribution">
<image :src="imgs.share" class="img"></image>
<view class="title">股东共享</view>
<view class="desc">邀请好友获得佣金</view>
</view>
</view>
<view style="height: 90px;"></view>
<u-popup :show="popupShow" :safe-area-inset-bottom="false" mode="center" @close="popupShow = false">
<view class="popup-content">
<view class="header-wrap">
<text class="t">请选择</text>
@@ -81,18 +104,10 @@
</view>
<view class="btn-content">
<view class="btn">
<u-button
color="#E8AD7B"
plain=""
shape="circle"
@click="beforehandOrderHandle"
>预点单</u-button
>
<u-button color="#E8AD7B" plain="" shape="circle" @click="beforehandOrderHandle">预点单</u-button>
</view>
<view class="btn">
<u-button color="#E8AD7B" shape="circle" @click="scanOrderHandle"
>扫码点单</u-button
>
<u-button color="#E8AD7B" shape="circle" @click="scanOrderHandle">扫码点单</u-button>
</view>
</view>
</view>
@@ -101,68 +116,96 @@
</template>
<script setup>
import {
import {
homeData
} from '@/common/api/market/index.js'
import {
getMemberConfig,
getRechargeConfig,
} from "@/common/api/index/index.js";
import { ref, reactive, defineProps, defineEmits, onMounted } from "vue";
import { isJsonArrayString } from "@/utils/util.js";
// 定义接收的属性
const props = defineProps({
} from "@/common/api/index/index.js";
import {
ref,
reactive,
defineProps,
defineEmits,
onMounted
} from "vue";
import {
isJsonArrayString
} from "@/utils/util.js";
const imgs = {
recharge: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/2f22c0ced494497e8d6f981832b191c9.png',
share: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/bcb8d461e96d445ba40256079da775b3.png',
vip: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/cfc3bf5ba12747c6ada4d5a388aceca3.png',
orderFood: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/7c54a22d56f44813bf3f76c1a82a34f3.png',
big_orderFood: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b3c7f6139eff4a7d81482cf533ec79fa.png',
takeout: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/3623cbf425d845a993acb4309404a7b9.png',
groupBuying: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/117745e0f3db48b489f9d4e5c5967043.png',
points: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/df0758f7b86449f89f882e50226e17c7.png',
code: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/044dcaf913054f03a9db7983f048b1e6.png',
defaultAvatar: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b98d2c7110e847f996e8d7ba4342f0a5.png'
}
// 定义接收的属性
const props = defineProps({
shopExtend: {
type: Array,
default: [],
},
});
function toFenxiao() {
uni.navigateTo({
url: "/distribution/shop-detail/index?shopId="+uni.cache.get("shopId"),
});
}
function toIntegralMall() {
function toFenxiao() {
uni.navigateTo({
url: "/scoreShop/index/index?shopId="+uni.cache.get("shopId"),
url: "/distribution/shop-detail/index?shopId=" + uni.cache.get("shopId"),
});
}
}
import { productStore } from "@/stores/user.js";
function toIntegralMall() {
uni.navigateTo({
url: "/scoreShop/index/index?shopId=" + uni.cache.get("shopId"),
});
}
// 显示弹窗
const popupShow = ref(false);
const scanCodehandle = (i) => {
import {
productStore
} from "@/stores/user.js";
import {
onShow
} from '@dcloudio/uni-app';
// 显示弹窗
const popupShow = ref(false);
const scanCodehandle = (i) => {
popupShow.value = true;
};
};
// 预点单
function beforehandOrderHandle() {
// 预点单
function beforehandOrderHandle() {
popupShow.value = false;
let shopUserInfo = uni.cache.get("shopUserInfo");
uni.cache.set("dinersNum", 1);
uni.cache.set("tableCode", shopUserInfo.id);
uni.navigateTo({
url: "/pages/product/index?type=beforehand",
});
}
}
// 扫码点餐
async function scanOrderHandle() {
// 扫码点餐
async function scanOrderHandle() {
popupShow.value = false;
const store = productStore();
await store.scanCodeactions();
}
}
const memberindex = (url) => {
const memberindex = (url) => {
uni.pro.navigateTo(url, {
shopId: uni.cache.get("shopId"),
type: "index",
});
};
};
const shopUserInfo = reactive({})
Object.assign(shopUserInfo, uni.cache.get("shopUserInfo") || {})
function tomember() {
function tomember() {
if (isMember.value) {
const shopUserInfo = uni.cache.get("shopUserInfo") || {};
const shopId = uni.cache.get("shopId");
if (!shopUserInfo.isVip) {
uni.navigateTo({
@@ -179,9 +222,9 @@ function tomember() {
icon: "none",
});
}
}
}
function toCharge() {
function toCharge() {
if (isCharge.value) {
const shopId = uni.cache.get("shopId");
uni.navigateTo({
@@ -193,8 +236,8 @@ function toCharge() {
icon: "none",
});
}
}
const getQueryString = (url, name) => {
}
const getQueryString = (url, name) => {
//解码
var reg = new RegExp("(^|&|/?)" + name + "=([^&|/?]*)(&|/?|$)", "i");
var r = url.substr(1).match(reg);
@@ -202,53 +245,82 @@ const getQueryString = (url, name) => {
return r[2];
}
return null;
};
};
// 获取会员配置
const isMember = ref(0);
const isCharge = ref(0);
async function getVipConfig() {
// 获取会员配置
const isMember = ref(0);
const isCharge = ref(0);
async function getVipConfig() {
try {
const res1 = await getMemberConfig({ shopId: uni.cache.get("shopId") });
const res2 = await getRechargeConfig({ shopId: uni.cache.get("shopId") });
const res1 = await getMemberConfig({
shopId: uni.cache.get("shopId")
});
const res2 = await getRechargeConfig({
shopId: uni.cache.get("shopId")
});
isMember.value = +res1.memberConfig.isOpen;
isCharge.value = +res2.isEnable;
} catch (error) {
console.log(error);
}
}
}
onMounted(() => {
const allConfig = reactive({
takeout: 0,
group: 0,
pointsMall: 0,
distribution: 0,
couponNum: 0,
pointNum: 0
})
function getHomeData() {
homeData().then(res => {
Object.assign(allConfig, res)
})
}
onMounted(() => {
updateData()
});
function updateData() {
Object.assign(shopUserInfo, uni.cache.get("shopUserInfo") || {})
getVipConfig();
});
defineExpose({
getVipConfig,
});
getHomeData()
}
defineExpose({
updateData
});
</script>
<style scoped lang="scss">
page {
page {
background: #f6f8fa;
}
.swiper {
}
.swiper {
width: 100%;
height: 100%;
.swiper-item {
width: 100%;
height: 100%;
.swiper-bg {
width: 100%;
height: 100%;
}
}
}
.content {
}
.content {
.contentbox {
position: relative;
width: 100%;
height: 1046rpx;
height: 430rpx;
.bg {
width: 100%;
height: 100%;
@@ -331,11 +403,13 @@ page {
}
}
}
}
.popup-content {
}
.popup-content {
width: 90vw;
background-color: #fff;
border-radius: 8px;
.header-wrap {
height: 64px;
display: flex;
@@ -343,10 +417,12 @@ page {
justify-content: space-between;
border-bottom: 1px solid #ececec;
padding: 0 28upx;
.t {
font-size: 32upx;
color: #333;
}
.close {
$size: 60upx;
width: $size;
@@ -356,23 +432,26 @@ page {
justify-content: center;
}
}
.btn-content {
height: 86px;
display: flex;
align-items: center;
justify-content: center;
gap: 60upx;
.btn {
width: 248upx;
}
}
}
}
.menus {
.menus {
display: flex;
padding: 32rpx 40rpx;
margin-top: 150rpx;
gap: 20rpx;
.menu-item {
background-color: #fff;
border-radius: 16rpx;
@@ -381,5 +460,164 @@ page {
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
flex: 1;
}
}
}
.userInfo {
display: flex;
padding: 22rpx 24rpx;
margin: 0 4rpx;
align-items: center;
align-self: stretch;
border-radius: 24rpx;
background: #FFF;
transform: translateY(-36rpx);
.vip {
background: #FA720A;
font-size: 24rpx;
color: #ffffff;
padding: 6rpx 10rpx;
margin-left: 10rpx;
border-radius: 20rpx 20rpx 20rpx 0;
}
.code {
width: 33px;
height: 33px;
}
}
.new-menus-box {
margin: 0 16rpx 34rpx 16rpx;
.new-menus {
display: flex;
background-color: #fff;
border-radius: 16rpx;
align-items: center;
.icon {
width: 79px;
height: 79px;
}
&.layout2 {
padding: 29px 0;
.diner,
.takeout {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.line {
width: 2rpx;
height: 156rpx;
background: #EDEDED;
}
.takeout {}
}
&.layout1 {
padding: 36rpx 40rpx;
justify-content: space-between;
display: flex;
align-items: center;
.big_img {
width: 330rpx;
height: 330rpx;
}
.title {
font-size: 48rpx;
}
.desc {
margin-top: 20rpx;
font-size: 32rpx;
color: #999;
}
}
}
}
.groupBuying {
padding: 16rpx 38rpx;
border-top: 2rpx solid #EDEDED;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
.img {
width: 40px;
height: 40px;
}
}
.title {
color: #333333;
font-size: 36rpx;
font-weight: 700;
}
.desc {
margin-top: 16rpx;
font-size: 28rpx;
color: #999;
}
.points {
margin-top: 34rpx;
background-color: #fff;
padding: 16rpx 68rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
.img {
width: 98px;
height: 98px;
}
}
.bottom_menus {
display: flex;
gap: 14rpx;
margin-top: 34rpx;
.item {
flex: 1;
display: flex;
padding: 20rpx;
flex-direction: column;
align-items: center;
border-radius: 18rpx;
background: #FFF;
.img {
width: 39px;
height: 39px;
}
.title {
font-size: 32rpx;
}
.desc {
margin-top: 8rpx;
color: #999;
font-size: 24rpx;
white-space: nowrap;
}
}
}
</style>

View File

@@ -2260,7 +2260,7 @@ async function getDiscountActivity() {
const res = await discountActivityApi.config({
shopId: uni.cache.get('shopId')
});
if (res) {
if (res&&typeof res=='object') {
fullAmountActivity.value = res;
}
}

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'
@@ -126,6 +133,12 @@
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,9 +460,13 @@
height: 184rpx;
border-radius: 16rpx;
background: #d9d9d9;
&.bg-fff{
background-color: #fff;
}
}
}
.bottom {
padding: 20rpx 28rpx 20rpx 20rpx;
border-bottom: 1px solid #ededed;
@@ -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">
<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>
@@ -28,7 +28,7 @@
<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 class="name u-line-1">{{item.goodsName}}</view>
<view class="price">
@@ -64,10 +64,14 @@
}
});
function toDetail(item) {
if (item.quantity<=0) {
return
const numListStyle={
'font-size':'24rpx'
}
const numBlockStyle={
'font-size':'24rpx'
}
function toDetail(item) {
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'
@@ -105,7 +107,7 @@
}
function canRefund(item) {
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ){
if (item.status == '已退款' || item.status == '退款中' || item.goodsCategory != '其它商品' || item.status == '已完成') {
return false
}
return true
@@ -113,8 +115,10 @@
function init() {
const data = uni.getStorageSync('points_order_detail')
qrcode.value=data.couponCode
qrcode.value = data.couponCode
Object.assign(item, data)
refresh()
}
onLoad(init)
@@ -153,11 +157,12 @@
}
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)
})
}
@@ -194,7 +199,6 @@
})
}
</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>