diff --git a/common/api/index/index.js b/common/api/index/index.js
index a89a35f..f12ef26 100644
--- a/common/api/index/index.js
+++ b/common/api/index/index.js
@@ -22,9 +22,29 @@ export const APIhome = (data) => {
// 获取咖啡
export const userdict = (data) => {
return request({
- url: '/account/user/dict',
+ url: '/account/user/dict',
method: 'GET',
data: data,
toast: false
})
}
+
+// 获取当前店铺会员开通配置信息
+export const getMemberConfig = (data) => {
+ return request({
+ url: '/market/user/member/config',
+ method: 'GET',
+ data: data,
+ toast: false
+ })
+}
+
+// 获取充值配置
+export const getRechargeConfig = (data) => {
+ return request({
+ url: '/market/user/recharge/config',
+ method: 'GET',
+ data: data,
+ toast: false
+ })
+}
\ No newline at end of file
diff --git a/components/coupon-modal.vue b/components/coupon-modal.vue
index eda950c..987b94e 100644
--- a/components/coupon-modal.vue
+++ b/components/coupon-modal.vue
@@ -2,11 +2,11 @@
-
-
-
-
-
+
+
+
+
+
-
+
@@ -66,7 +66,7 @@
-
+
全部领取({{ couponCount }}张)
@@ -84,6 +84,15 @@ import dayjs from 'dayjs';
import { onMounted, ref } from 'vue';
import { getCouponPopup, receivePopUp } from '@/common/api/member.js';
+const currentNum = ref(1);
+const swiperCheck = ref(3);
+const bgUrlList = ref({
+ 1: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/0/20c159a4cd664d8a843d82eb9b5a5e0e.png',
+ 2: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/0/d6b11e76f03b495d84f07791b3ce1c3e.png',
+ 3: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/0/f41a5bffdc1c474eb5bb41ed0035c91b.png'
+});
+const bgUrl = ref('');
+
const couponCount = ref(0);
const swiperIndex = ref(0);
const couponList = ref([]);
@@ -114,12 +123,24 @@ async function getCouponPopupAjax() {
.format('YYYY-MM-DD HH:mm:ss');
}
});
-
- console.log('res===', res);
show.value = true;
couponCount.value = res.length;
- couponList.value = _.chunk(res, 3);
- console.log('couponList.value===', couponList.value);
+ couponList.value = _.chunk(res, swiperCheck.value);
+
+ console.log('couponList.value[0].length===', couponList.value[0].length);
+
+ if (couponList.value[0].length >= swiperCheck.value) {
+ bgUrl.value = bgUrlList.value[3];
+ currentNum.value = 3;
+ }
+ if (couponList.value[0].length == 2) {
+ bgUrl.value = bgUrlList.value[2];
+ currentNum.value = 2;
+ }
+ if (couponList.value[0].length <= 1) {
+ bgUrl.value = bgUrlList.value[1];
+ currentNum.value = 1;
+ }
}
} catch (error) {
console.log(error);
@@ -163,7 +184,9 @@ onMounted(() => {
.content {
width: 94vw;
position: relative;
- padding-left: 24upx;
+ &.content3 {
+ padding-left: 24upx;
+ }
.close {
position: absolute;
left: 50%;
@@ -179,19 +202,43 @@ onMounted(() => {
height: 70%;
position: absolute;
left: 18%;
- top: 96upx;
+ &.swiper-wrap1 {
+ top: 162upx;
+ }
+ &.swiper-wrap2 {
+ top: 140upx;
+ }
+ &.swiper-wrap3 {
+ top: 96upx;
+ }
.swiper {
width: 100%;
- height: 90%;
background-color: #fff;
+ &.swiper1 {
+ height: 44%;
+ }
+ &.swiper2 {
+ height: 70%;
+ }
+ &.swiper3 {
+ height: 90%;
+ }
.swiper-item {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: 1fr;
- grid-template-rows: repeat(3, 1fr);
grid-column-gap: 0;
grid-row-gap: 12upx;
+ &.swiper-item1 {
+ grid-template-rows: repeat(1, 1fr);
+ }
+ &.swiper-item2 {
+ grid-template-rows: repeat(2, 1fr);
+ }
+ &.swiper-item3 {
+ grid-template-rows: repeat(3, 1fr);
+ }
.item {
background-color: #e20410;
border-radius: 12upx;
@@ -315,7 +362,15 @@ onMounted(() => {
width: 60%;
position: absolute;
left: 20%;
- bottom: 38upx;
+ &.btn-wrap1 {
+ bottom: 74upx;
+ }
+ &.btn-wrap2 {
+ bottom: 74upx;
+ }
+ &.btn-wrap3 {
+ bottom: 38upx;
+ }
.btn-img {
width: 100%;
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 5af1803..98ca706 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -125,7 +125,7 @@
-->
-
+
@@ -319,6 +319,9 @@ onPageScroll((res) => {
isSticky.value = res.scrollTop > elementTop.value ? true : false;
uni.$u.debounce((store.scrollTop = res.scrollTop), 500);
});
+
+const indexsRef = ref(null);
+
onShow(async () => {
try {
uni.getLocation({
@@ -343,6 +346,8 @@ onShow(async () => {
}
}
});
+
+ indexsRef.value.getVipConfig();
} catch (error) {
try {
let successres = await APIgeocodelocation({
diff --git a/pages/index/indexs.vue b/pages/index/indexs.vue
index 2f4bded..57e6e3d 100644
--- a/pages/index/indexs.vue
+++ b/pages/index/indexs.vue
@@ -1,11 +1,16 @@
-
+
-
-
+
点餐
在线点不排队
@@ -13,8 +18,7 @@
-
-
+
会员
入会享权益
@@ -25,8 +29,7 @@
> -->
-
+
充值
充值享更多优惠
@@ -39,153 +42,183 @@
\ No newline at end of file
+}
+
diff --git a/pages/user/user.vue b/pages/user/user.vue
index b69ceba..176ca84 100644
--- a/pages/user/user.vue
+++ b/pages/user/user.vue
@@ -1,25 +1,30 @@
-
+
- {{userInfo.nickName}}
+ {{ userInfo.nickName }}
-
-
-
-
+
+
-
@@ -29,33 +34,27 @@
-
-
+
储值
- {{rechargeTotal}}家店
+ {{ rechargeTotal }}家店
-
-
+
+
-
+
¥
- {{item.amount}}
+ {{ item.amount || '0.00' }}
- {{item.shopName}}
+ {{ item.shopName }}
-
-
+
查看全部
@@ -63,44 +62,65 @@
-
-
+
会员
- {{memberTotal}}家店
+ {{ memberTotal }}家店
-
+
- {{item.shopName}}
+ {{ item.shopName }}
-
-
+
查看全部
-
+
+
+
+
+ 积分
+
+
+ {{ coinTotal }}家店
+
+
+
-
+
+
+
+
+
+ ¥
+ {{ item.accountPoints || '0.00' }}
+
+ {{ item.shopName }}
+
+
+
+ 查看全部
+
+
+
-
+
- {{item.name}}
+ {{ item.name }}
-
- {{userInfo.accountPoints || 0}}
+
+ {{ userInfo.accountPoints || 0 }}
查看
@@ -108,394 +128,387 @@
-
-
\ No newline at end of file
+}
+