积分商城问题修复
This commit is contained in:
@@ -9,3 +9,10 @@ export const consumeDiscount = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const homeData = (data) => {
|
||||||
|
return request({
|
||||||
|
url: prveUrl + '/user/home/data',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="icon icon1" v-if="props.item.couponType == 1">
|
<view class="icon icon1" v-if="props.item.couponType == 1">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text class="i">¥</text>
|
<text class="i" >¥</text>
|
||||||
<text class="num">{{ props.item.discountAmount }}</text>
|
<text class="num" >{{ props.item.discountAmount }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="intro">
|
<view class="intro">
|
||||||
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="icon icon2" v-if="props.item.couponType == 2">
|
<view class="icon icon2" v-if="props.item.couponType == 2">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text class="i">{{ props.item.discountNum }}件</text>
|
<text class="i" >{{ props.item.discountNum }}件</text>
|
||||||
<text class="num">商品兑换</text>
|
<text class="num" >商品兑换</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="intro">
|
<view class="intro">
|
||||||
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="icon icon3" v-if="props.item.couponType == 3">
|
<view class="icon icon3" v-if="props.item.couponType == 3">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text class="num">{{ props.item.discountRate/10 }}折</text>
|
<text class="num" >{{ props.item.discountRate/10 }}折</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="intro">
|
<view class="intro">
|
||||||
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
<text class="t">满{{ props.item.fullAmount }}可用</text>
|
||||||
@@ -29,100 +29,112 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="icon icon2" v-if="props.item.couponType == 4">
|
<view class="icon icon2" v-if="props.item.couponType == 4">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text class="i">第二件</text>
|
<text class="i" >第二件</text>
|
||||||
<text class="num">半价券</text>
|
<text class="num" >半价券</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="icon icon2" v-if="props.item.couponType == 6">
|
<view class="icon icon2" v-if="props.item.couponType == 6">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text class="i">买一送</text>
|
<text class="i" >买一送</text>
|
||||||
<text class="num">一券</text>
|
<text class="num" >一券</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {}
|
||||||
}
|
},
|
||||||
});
|
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
$color: #ff1c1c;
|
$color: #ff1c1c;
|
||||||
.container {
|
|
||||||
width: 100%;
|
.container {
|
||||||
height: 100%;
|
|
||||||
padding: 0;
|
|
||||||
.icon {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
padding: 0;
|
||||||
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 {
|
.icon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
.t {
|
align-items: center;
|
||||||
font-size: 22upx;
|
|
||||||
color: #999;
|
&.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>
|
||||||
</style>
|
|
||||||
@@ -334,7 +334,7 @@ onShow(async () => {
|
|||||||
proxy.$isResolve();
|
proxy.$isResolve();
|
||||||
const shopId = uni.cache.get('shopId');
|
const shopId = uni.cache.get('shopId');
|
||||||
if (shopId) {
|
if (shopId) {
|
||||||
indexsRef.value.getVipConfig();
|
indexsRef.value.updateData();
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
await proxy.$onLaunched;
|
await proxy.$onLaunched;
|
||||||
|
|||||||
@@ -1,385 +1,623 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content min-page bg-f7">
|
<view class="content min-page bg-f7">
|
||||||
<view class="contentbox">
|
<view class="contentbox">
|
||||||
<template v-if="shopExtend.length">
|
<template v-if="shopExtend.length">
|
||||||
<image
|
<image class="bg" :src="shopExtend[0].value" mode="aspectFill"
|
||||||
class="bg"
|
v-if="!isJsonArrayString(shopExtend[0].value)"></image>
|
||||||
:src="shopExtend[0].value"
|
<swiper class="swiper" autoplay circular v-else>
|
||||||
mode="aspectFill"
|
<swiper-item class="swiper-item" v-for="item in JSON.parse(shopExtend[0].value)">
|
||||||
v-if="!isJsonArrayString(shopExtend[0].value)"
|
<image class="swiper-bg" :src="item"></image>
|
||||||
></image>
|
</swiper-item>
|
||||||
<swiper class="swiper" autoplay circular v-else>
|
</swiper>
|
||||||
<swiper-item
|
</template>
|
||||||
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>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="u-flex menus u-font-32 color-333">
|
</view>
|
||||||
<view class="menu-item" @click="toIntegralMall">
|
|
||||||
<view>积分商城</view>
|
<view class="userInfo u-flex">
|
||||||
<view class="u-font-24 color-999">攒积分,兑换更多优惠</view>
|
<up-avatar size="61px" :default-url="imgs.defaultAvatar"></up-avatar>
|
||||||
</view>
|
<view class="u-flex-1 u-flex u-row-between u-p-l-16 u-p-r-16">
|
||||||
<view class="menu-item" @click="toFenxiao">
|
<view>
|
||||||
<view>分销</view>
|
<view class="u-flex">
|
||||||
<view class="u-font-24 color-999">邀请好友,获得佣金</view>
|
<view class="u-font-32 color-333 font-bold u-line-1" style="max-width: 320rpx;">HI,欢迎回来</view>
|
||||||
</view>
|
<view class="vip" v-if="shopUserInfo.isVip">会员身份</view>
|
||||||
</view>
|
</view>
|
||||||
<u-popup
|
|
||||||
:show="popupShow"
|
<view class="u-m-t-10 u-font-24 color-666">
|
||||||
:safe-area-inset-bottom="false"
|
<text>优惠券:{{allConfig.couponNum}}</text>
|
||||||
mode="center"
|
<text class="u-m-l-22">积分:{{allConfig.pointNum}}</text>
|
||||||
@close="popupShow = false"
|
</view>
|
||||||
>
|
|
||||||
<view class="popup-content">
|
</view>
|
||||||
<view class="header-wrap">
|
<image :src="imgs.code" class="code"></image>
|
||||||
<text class="t">请选择</text>
|
</view>
|
||||||
<view class="close" @click="popupShow = false">
|
</view>
|
||||||
<u-icon name="close" size="16" color="#666"></u-icon>
|
|
||||||
</view>
|
<view class="new-menus-box">
|
||||||
</view>
|
<view class="new-menus layout2" v-if="allConfig.takeout">
|
||||||
<view class="btn-content">
|
<view class="diner" @click="scanCodehandle(0)">
|
||||||
<view class="btn">
|
<image :src="imgs.orderFood" class="icon"></image>
|
||||||
<u-button
|
<view class="title">立即点单</view>
|
||||||
color="#E8AD7B"
|
<view class="desc">下单免排队</view>
|
||||||
plain=""
|
</view>
|
||||||
shape="circle"
|
<view class="line"></view>
|
||||||
@click="beforehandOrderHandle"
|
<view class="takeout">
|
||||||
>预点单</u-button
|
<image :src="imgs.takeout" class="icon"></image>
|
||||||
>
|
<view class="title">外卖点单</view>
|
||||||
</view>
|
<view class="desc">外卖送到家</view>
|
||||||
<view class="btn">
|
</view>
|
||||||
<u-button color="#E8AD7B" shape="circle" @click="scanOrderHandle"
|
</view>
|
||||||
>扫码点单</u-button
|
<view class="new-menus layout1" v-else @click="scanCodehandle(0)">
|
||||||
>
|
<view>
|
||||||
</view>
|
<view class="title">立即点单</view>
|
||||||
</view>
|
<view class="desc">-自助下单 快人一步-</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
<image :src="imgs.big_orderFood" class="big_img"></image>
|
||||||
</view>
|
|
||||||
|
|
||||||
|
</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>
|
||||||
|
<view class="close" @click="popupShow = false">
|
||||||
|
<u-icon name="close" size="16" color="#666"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn-content">
|
||||||
|
<view class="btn">
|
||||||
|
<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>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
getMemberConfig,
|
homeData
|
||||||
getRechargeConfig,
|
} from '@/common/api/market/index.js'
|
||||||
} from "@/common/api/index/index.js";
|
import {
|
||||||
import { ref, reactive, defineProps, defineEmits, onMounted } from "vue";
|
getMemberConfig,
|
||||||
import { isJsonArrayString } from "@/utils/util.js";
|
getRechargeConfig,
|
||||||
|
} 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() {
|
||||||
const props = defineProps({
|
uni.navigateTo({
|
||||||
shopExtend: {
|
url: "/distribution/shop-detail/index?shopId=" + uni.cache.get("shopId"),
|
||||||
type: Array,
|
});
|
||||||
default: [],
|
}
|
||||||
},
|
|
||||||
});
|
|
||||||
function toFenxiao() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/distribution/shop-detail/index?shopId="+uni.cache.get("shopId"),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function toIntegralMall() {
|
function toIntegralMall() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/scoreShop/index/index?shopId="+uni.cache.get("shopId"),
|
url: "/scoreShop/index/index?shopId=" + uni.cache.get("shopId"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
import { productStore } from "@/stores/user.js";
|
import {
|
||||||
|
productStore
|
||||||
|
} from "@/stores/user.js";
|
||||||
|
import {
|
||||||
|
onShow
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
|
||||||
// 显示弹窗
|
// 显示弹窗
|
||||||
const popupShow = ref(false);
|
const popupShow = ref(false);
|
||||||
const scanCodehandle = (i) => {
|
const scanCodehandle = (i) => {
|
||||||
popupShow.value = true;
|
popupShow.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 预点单
|
// 预点单
|
||||||
function beforehandOrderHandle() {
|
function beforehandOrderHandle() {
|
||||||
popupShow.value = false;
|
popupShow.value = false;
|
||||||
let shopUserInfo = uni.cache.get("shopUserInfo");
|
uni.cache.set("dinersNum", 1);
|
||||||
uni.cache.set("dinersNum", 1);
|
uni.cache.set("tableCode", shopUserInfo.id);
|
||||||
uni.cache.set("tableCode", shopUserInfo.id);
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url: "/pages/product/index?type=beforehand",
|
||||||
url: "/pages/product/index?type=beforehand",
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 扫码点餐
|
// 扫码点餐
|
||||||
async function scanOrderHandle() {
|
async function scanOrderHandle() {
|
||||||
popupShow.value = false;
|
popupShow.value = false;
|
||||||
const store = productStore();
|
const store = productStore();
|
||||||
await store.scanCodeactions();
|
await store.scanCodeactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
const memberindex = (url) => {
|
const memberindex = (url) => {
|
||||||
uni.pro.navigateTo(url, {
|
uni.pro.navigateTo(url, {
|
||||||
shopId: uni.cache.get("shopId"),
|
shopId: uni.cache.get("shopId"),
|
||||||
type: "index",
|
type: "index",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const shopUserInfo = reactive({})
|
||||||
|
Object.assign(shopUserInfo, uni.cache.get("shopUserInfo") || {})
|
||||||
|
|
||||||
function tomember() {
|
function tomember() {
|
||||||
if (isMember.value) {
|
if (isMember.value) {
|
||||||
const shopUserInfo = uni.cache.get("shopUserInfo") || {};
|
const shopId = uni.cache.get("shopId");
|
||||||
const shopId = uni.cache.get("shopId");
|
if (!shopUserInfo.isVip) {
|
||||||
if (!shopUserInfo.isVip) {
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url: "/user/vip/buy-vip?shopId=" + shopId,
|
||||||
url: "/user/vip/buy-vip?shopId=" + shopId,
|
});
|
||||||
});
|
return;
|
||||||
return;
|
}
|
||||||
}
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url: "/user/vip/vip?shopId=" + shopId,
|
||||||
url: "/user/vip/vip?shopId=" + shopId,
|
});
|
||||||
});
|
} else {
|
||||||
} else {
|
uni.showToast({
|
||||||
uni.showToast({
|
title: "暂未开放",
|
||||||
title: "暂未开放",
|
icon: "none",
|
||||||
icon: "none",
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function toCharge() {
|
function toCharge() {
|
||||||
if (isCharge.value) {
|
if (isCharge.value) {
|
||||||
const shopId = uni.cache.get("shopId");
|
const shopId = uni.cache.get("shopId");
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/user/member/czzx?shopId=" + shopId,
|
url: "/pages/user/member/czzx?shopId=" + shopId,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "暂未开放",
|
title: "暂未开放",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getQueryString = (url, name) => {
|
const getQueryString = (url, name) => {
|
||||||
//解码
|
//解码
|
||||||
var reg = new RegExp("(^|&|/?)" + name + "=([^&|/?]*)(&|/?|$)", "i");
|
var reg = new RegExp("(^|&|/?)" + name + "=([^&|/?]*)(&|/?|$)", "i");
|
||||||
var r = url.substr(1).match(reg);
|
var r = url.substr(1).match(reg);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
return r[2];
|
return r[2];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取会员配置
|
// 获取会员配置
|
||||||
const isMember = ref(0);
|
const isMember = ref(0);
|
||||||
const isCharge = ref(0);
|
const isCharge = ref(0);
|
||||||
async function getVipConfig() {
|
async function getVipConfig() {
|
||||||
try {
|
try {
|
||||||
const res1 = await getMemberConfig({ shopId: uni.cache.get("shopId") });
|
const res1 = await getMemberConfig({
|
||||||
const res2 = await getRechargeConfig({ shopId: uni.cache.get("shopId") });
|
shopId: uni.cache.get("shopId")
|
||||||
|
});
|
||||||
|
const res2 = await getRechargeConfig({
|
||||||
|
shopId: uni.cache.get("shopId")
|
||||||
|
});
|
||||||
|
|
||||||
isMember.value = +res1.memberConfig.isOpen;
|
isMember.value = +res1.memberConfig.isOpen;
|
||||||
isCharge.value = +res2.isEnable;
|
isCharge.value = +res2.isEnable;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getVipConfig();
|
|
||||||
});
|
|
||||||
|
|
||||||
defineExpose({
|
const allConfig = reactive({
|
||||||
getVipConfig,
|
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();
|
||||||
|
getHomeData()
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
updateData
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f6f8fa;
|
background: #f6f8fa;
|
||||||
}
|
}
|
||||||
.swiper {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
.swiper-item {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
.swiper-bg {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
.contentbox {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 1046rpx;
|
|
||||||
.bg {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentboxitem {
|
.swiper {
|
||||||
position: absolute;
|
width: 100%;
|
||||||
bottom: 0;
|
height: 100%;
|
||||||
width: 90%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 50%);
|
|
||||||
padding: 38rpx 0 26rpx 0;
|
|
||||||
background: rgba(255, 255, 255, 0.98);
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
|
||||||
|
|
||||||
.contentboxitemleft {
|
.swiper-item {
|
||||||
width: 50%;
|
width: 100%;
|
||||||
border-right: 2rpx solid #623618;
|
height: 100%;
|
||||||
|
|
||||||
image {
|
.swiper-bg {
|
||||||
width: 134rpx;
|
width: 100%;
|
||||||
height: 134rpx;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.contentboxitemlefttextone {
|
.content {
|
||||||
margin-top: 10rpx;
|
.contentbox {
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
position: relative;
|
||||||
font-weight: 400;
|
width: 100%;
|
||||||
font-size: 32rpx;
|
height: 430rpx;
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentboxitemlefttexttow {
|
.bg {
|
||||||
margin-top: 2rpx;
|
width: 100%;
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
height: 100%;
|
||||||
font-weight: 400;
|
position: absolute;
|
||||||
font-size: 24rpx;
|
top: 0;
|
||||||
color: #999999;
|
left: 0;
|
||||||
}
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentboxitemright {
|
.contentboxitem {
|
||||||
width: 50%;
|
position: absolute;
|
||||||
padding: 0 34rpx;
|
bottom: 0;
|
||||||
|
width: 90%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 50%);
|
||||||
|
padding: 38rpx 0 26rpx 0;
|
||||||
|
background: rgba(255, 255, 255, 0.98);
|
||||||
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
|
||||||
.contentboxitemright_item:nth-child(2) {
|
.contentboxitemleft {
|
||||||
margin-top: 30rpx;
|
width: 50%;
|
||||||
}
|
border-right: 2rpx solid #623618;
|
||||||
|
|
||||||
.contentboxitemright_item {
|
image {
|
||||||
image {
|
width: 134rpx;
|
||||||
width: 96rpx;
|
height: 134rpx;
|
||||||
height: 96rpx;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.contentboxitemright_itembox {
|
.contentboxitemlefttextone {
|
||||||
width: 170rpx;
|
margin-top: 10rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
text:nth-child(1) {
|
.contentboxitemlefttexttow {
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
margin-top: 2rpx;
|
||||||
font-weight: 400;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-size: 32rpx;
|
font-weight: 400;
|
||||||
color: #333333;
|
font-size: 24rpx;
|
||||||
}
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
text:nth-child(2) {
|
.contentboxitemright {
|
||||||
margin-top: 2rpx;
|
width: 50%;
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
padding: 0 34rpx;
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.popup-content {
|
|
||||||
width: 90vw;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 8px;
|
|
||||||
.header-wrap {
|
|
||||||
height: 64px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom: 1px solid #ececec;
|
|
||||||
padding: 0 28upx;
|
|
||||||
.t {
|
|
||||||
font-size: 32upx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.close {
|
|
||||||
$size: 60upx;
|
|
||||||
width: $size;
|
|
||||||
height: $size;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btn-content {
|
|
||||||
height: 86px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 60upx;
|
|
||||||
.btn {
|
|
||||||
width: 248upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menus {
|
.contentboxitemright_item:nth-child(2) {
|
||||||
display: flex;
|
margin-top: 30rpx;
|
||||||
padding: 32rpx 40rpx;
|
}
|
||||||
margin-top: 150rpx;
|
|
||||||
gap: 20rpx;
|
.contentboxitemright_item {
|
||||||
.menu-item {
|
image {
|
||||||
background-color: #fff;
|
width: 96rpx;
|
||||||
border-radius: 16rpx;
|
height: 96rpx;
|
||||||
text-align: center;
|
}
|
||||||
padding: 32rpx 28rpx;
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
.contentboxitemright_itembox {
|
||||||
flex: 1;
|
width: 170rpx;
|
||||||
}
|
|
||||||
}
|
text:nth-child(1) {
|
||||||
</style>
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
text:nth-child(2) {
|
||||||
|
margin-top: 2rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-content {
|
||||||
|
width: 90vw;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
.header-wrap {
|
||||||
|
height: 64px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #ececec;
|
||||||
|
padding: 0 28upx;
|
||||||
|
|
||||||
|
.t {
|
||||||
|
font-size: 32upx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close {
|
||||||
|
$size: 60upx;
|
||||||
|
width: $size;
|
||||||
|
height: $size;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-content {
|
||||||
|
height: 86px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 60upx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 248upx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menus {
|
||||||
|
display: flex;
|
||||||
|
padding: 32rpx 40rpx;
|
||||||
|
margin-top: 150rpx;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.menu-item {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
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>
|
||||||
@@ -2260,7 +2260,7 @@ async function getDiscountActivity() {
|
|||||||
const res = await discountActivityApi.config({
|
const res = await discountActivityApi.config({
|
||||||
shopId: uni.cache.get('shopId')
|
shopId: uni.cache.get('shopId')
|
||||||
});
|
});
|
||||||
if (res) {
|
if (res&&typeof res=='object') {
|
||||||
fullAmountActivity.value = res;
|
fullAmountActivity.value = res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<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>
|
</template>
|
||||||
<view class="sku">
|
<view class="sku">
|
||||||
<view>
|
<view>
|
||||||
@@ -75,11 +76,16 @@
|
|||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<view class="popup-content-top">
|
<view class="popup-content-top">
|
||||||
<text class="color-666">领取方式</text>
|
<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>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
<view class="u-flex">
|
<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 class="u-flex u-flex-1 u-row-between u-p-l-16 u-col-center">
|
||||||
<view>
|
<view>
|
||||||
<view class="u-font-32 font-bold">{{item.goodsName}}</view>
|
<view class="u-font-32 font-bold">{{item.goodsName}}</view>
|
||||||
@@ -116,6 +122,7 @@
|
|||||||
} from '@/utils/uniapp.js'
|
} from '@/utils/uniapp.js'
|
||||||
import modal from "@/scoreShop/components/modal.vue";
|
import modal from "@/scoreShop/components/modal.vue";
|
||||||
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
||||||
|
import couponIcon from "@/components/coupon-icon/index";
|
||||||
import {
|
import {
|
||||||
pay
|
pay
|
||||||
} from '@/utils/pay.js'
|
} from '@/utils/pay.js'
|
||||||
@@ -125,6 +132,12 @@
|
|||||||
const modalData = reactive({
|
const modalData = reactive({
|
||||||
show: false,
|
show: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function prveImg(url){
|
||||||
|
uni.previewImage({
|
||||||
|
urls:[url]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const popupData = reactive({
|
const popupData = reactive({
|
||||||
show: false,
|
show: false,
|
||||||
@@ -238,13 +251,13 @@
|
|||||||
}
|
}
|
||||||
const type = item.couponInfo.couponType
|
const type = item.couponInfo.couponType
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
return item.couponInfo.discountAmount + '元代金券' + ' ' + `(满${item.fullAmount}可用)`
|
return item.couponInfo.discountAmount + '元代金券' + ' ' + `(满${item.couponInfo.fullAmount}可用)`
|
||||||
}
|
}
|
||||||
if (type == 2) {
|
if (type == 2) {
|
||||||
return item.couponInfo.discountNum + '件商品兑换' + ' ' + `(满${item.fullAmount}可用)`
|
return item.couponInfo.discountNum + '件商品兑换' + ' ' + `(满${item.couponInfo.fullAmount}可用)`
|
||||||
}
|
}
|
||||||
if (type == 3) {
|
if (type == 3) {
|
||||||
return item.couponInfo.discountRate / 10 + '折' + ' ' + `(满${item.fullAmount}可用)`
|
return item.couponInfo.discountRate / 10 + '折' + ' ' + `(满${item.couponInfo.fullAmount}可用)`
|
||||||
}
|
}
|
||||||
if (type == 4) {
|
if (type == 4) {
|
||||||
return '第二件半价券'
|
return '第二件半价券'
|
||||||
@@ -447,7 +460,11 @@
|
|||||||
height: 184rpx;
|
height: 184rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
|
&.bg-fff{
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
@@ -467,4 +484,7 @@
|
|||||||
font-size: 700;
|
font-size: 700;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.w-full{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
<view v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
<view v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||||
<template v-if="layout === 'list'">
|
<template v-if="layout === 'list'">
|
||||||
<view class="item">
|
<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" />
|
<couponIcon :item="item.couponInfo" typeKey="couponType" />
|
||||||
</view>
|
</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="info">
|
||||||
<view>
|
<view>
|
||||||
<view class="name u-line-1">{{item.goodsName}}</view>
|
<view class="name u-line-1">{{item.goodsName}}</view>
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
<template v-if="layout === 'block'">
|
<template v-if="layout === 'block'">
|
||||||
<view class="item">
|
<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" />
|
<couponIcon :item="item.couponInfo" typeKey="couponType" />
|
||||||
</view>
|
</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="info">
|
||||||
<view class="name u-line-1">{{item.goodsName}}</view>
|
<view class="name u-line-1">{{item.goodsName}}</view>
|
||||||
<view class="price">
|
<view class="price">
|
||||||
@@ -63,11 +63,15 @@
|
|||||||
default: () => {},
|
default: () => {},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const numListStyle={
|
||||||
|
'font-size':'24rpx'
|
||||||
|
}
|
||||||
|
const numBlockStyle={
|
||||||
|
'font-size':'24rpx'
|
||||||
|
}
|
||||||
|
|
||||||
function toDetail(item) {
|
function toDetail(item) {
|
||||||
if (item.quantity<=0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.setStorageSync('exchange_goods', item)
|
uni.setStorageSync('exchange_goods', item)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/scoreShop/detail/index?id=' + item.id,
|
url: '/scoreShop/detail/index?id=' + item.id,
|
||||||
@@ -129,7 +133,7 @@
|
|||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
|
|
||||||
&.coupon {
|
&.coupon {
|
||||||
// background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,6 +164,7 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
&.end {
|
&.end {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
background: rgba(153, 153, 153, 0.3);
|
background: rgba(153, 153, 153, 0.3);
|
||||||
@@ -195,7 +200,7 @@
|
|||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
|
|
||||||
&.coupon {
|
&.coupon {
|
||||||
// background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-p-l-36">
|
<view class="u-p-l-36">
|
||||||
<view>{{item.pointsGoodsName}}</view>
|
<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>
|
</view>
|
||||||
<view class="u-m-t-28 u-flex u-row-right btns">
|
<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="refund(item)" v-if="canRefund(item)">申请退款</view>
|
||||||
<view class="btn black" @click.stop="cancelRefund(item)" v-if="item.status=='退款中'" >取消退款</view>
|
<view class="btn black" @click.stop="cancelRefund(item)" v-if="item.status=='退款中'" >取消退款</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -66,7 +70,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function canRefund(item) {
|
function canRefund(item) {
|
||||||
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ){
|
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ||item.status=='已完成'){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
<view class="min-page bg-f7 color-333 u-font-28">
|
<view class="min-page bg-f7 color-333 u-font-28">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="u-flex u-col-center">
|
<view class="u-flex u-col-center">
|
||||||
<up-image width="208rpx" height="208rpx" :src="item.goodsImageUrl" v-if="item.goodsCategory!='优惠券'"></up-image>
|
<up-image width="208rpx" height="208rpx" :src="item.goodsImageUrl"
|
||||||
<view class="" style="width: 208rpx;height: 208rpx;">
|
v-if="item.goodsCategory!='优惠券'"></up-image>
|
||||||
|
<view class="" style="width: 208rpx;height: 208rpx;" v-else>
|
||||||
<couponIcon :item="item.couponInfo" typeKey="couponType" />
|
<couponIcon :item="item.couponInfo" typeKey="couponType" />
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-l-28 u-flex-1">
|
<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 class="u-m-t-8 font-bold color1"> X{{item.number}} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="item.goodsCategory=='其它商品'">
|
<template v-if="item.goodsCategory=='其它商品'&&item.status!='已退款'">
|
||||||
<view class="u-m-t-16">
|
<view class="u-m-t-16">
|
||||||
<view class="u-flex u-row-center">
|
<view class="u-flex u-row-center">
|
||||||
<up-qrcode cid="ex1" :size="104" :val="qrcode"></up-qrcode>
|
<up-qrcode cid="ex1" :size="104" :val="qrcode"></up-qrcode>
|
||||||
@@ -92,6 +93,7 @@
|
|||||||
const item = reactive({
|
const item = reactive({
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function returnStatusClass(item) {
|
function returnStatusClass(item) {
|
||||||
if (item.status == '已完成' || item.status == '已退款') {
|
if (item.status == '已完成' || item.status == '已退款') {
|
||||||
return 'gray'
|
return 'gray'
|
||||||
@@ -103,22 +105,24 @@
|
|||||||
return 'error'
|
return 'error'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function canRefund(item) {
|
function canRefund(item) {
|
||||||
if(item.status=='已退款'|| item.status=='退款中'||item.goodsCategory!='其它商品' ){
|
if (item.status == '已退款' || item.status == '退款中' || item.goodsCategory != '其它商品' || item.status == '已完成') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
const data = uni.getStorageSync('points_order_detail')
|
const data = uni.getStorageSync('points_order_detail')
|
||||||
qrcode.value=data.couponCode
|
qrcode.value = data.couponCode
|
||||||
Object.assign(item, data)
|
Object.assign(item, data)
|
||||||
|
|
||||||
|
refresh()
|
||||||
}
|
}
|
||||||
onLoad(init)
|
onLoad(init)
|
||||||
|
|
||||||
|
|
||||||
function refund(item) {
|
function refund(item) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -135,13 +139,13 @@
|
|||||||
title: '申请退款成功',
|
title: '申请退款成功',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '申请退款失败',
|
title: '申请退款失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
refresh()
|
refresh()
|
||||||
@@ -150,17 +154,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh(){
|
function refresh() {
|
||||||
pointGoodsApi.recordOne({
|
pointGoodsApi.recordOne({
|
||||||
id:item.id
|
id: item.id,
|
||||||
}).then(res=>{
|
shopId: item.shopId
|
||||||
Object.assign(item,res)
|
}).then(res => {
|
||||||
|
Object.assign(item, res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelRefund(item) {
|
function cancelRefund(item) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -177,13 +182,13 @@
|
|||||||
title: '取消退款成功',
|
title: '取消退款成功',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '取消退款失败',
|
title: '取消退款失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
refresh()
|
refresh()
|
||||||
@@ -192,9 +197,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
value: "unevaluated",
|
value: "unevaluated",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "已核销",
|
name: "已完成",
|
||||||
value: "evaluated",
|
value: "evaluated",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,9 +27,13 @@
|
|||||||
<text class="color-666">消耗积分:</text>
|
<text class="color-666">消耗积分:</text>
|
||||||
<text>{{item.spendPoints}}</text>
|
<text>{{item.spendPoints}}</text>
|
||||||
</view>
|
</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">
|
<view class="u-p-22">
|
||||||
<text class="color-666">下单时间:</text>
|
<text class="color-666">下单时间:</text>
|
||||||
<text>{{item.checkoutTime}}</text>
|
<text>{{item.createTime}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-22">
|
<view class="u-p-22">
|
||||||
<text class="color-666">订单号:</text>
|
<text class="color-666">订单号:</text>
|
||||||
|
|||||||
Reference in New Issue
Block a user