Commit c9a24b8b authored by spc's avatar spc

fixed

parent b7e90c1c
......@@ -40,7 +40,8 @@ data:{
receiveStatus:1,//优惠券状态 0-未领取 1-已领取
receiveTime:1,//领取时间
}
]
],
next2810Countdown:0,//2810活动倒计时
}
*/
......
......@@ -15,11 +15,11 @@ const {
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
// let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
const request = (options = {}) => {
// 在这里可以对请求头进行一些设置
......
This diff is collapsed.
This diff is collapsed.
......@@ -22,10 +22,9 @@
<image class="diamondthreeaward" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.DIAMOND.THREE.AWARD}`"
mode="aspectFit">
</image>
<image class="diamondthreebtn" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.DIAMOND.THREE.BTN}`"
mode="aspectFit" @click="handleButtonClick('diamond')">
</image>
<view class="diamondthreebtn active" @click="handleButtonClick('diamond')">
<text>{{ buttonInfo.text }}</text>
</view>
</view>
</view>
......@@ -52,10 +51,9 @@
</image>
<image class="starshinethreeaward" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.STARSHINE.THREE.AWARD}`"
mode="aspectFit"></image>
<image class="starshinethreebtn" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.STARSHINE.THREE.BTN}`"
mode="aspectFit" @click="handleButtonClick('starshine')">
</image>
<view class="starshinethreebtn starshine" @click="handleButtonClick('starshine')">
<text>{{ buttonInfo.text }}</text>
</view>
</view>
</view>
......@@ -82,10 +80,9 @@
</image>
<image class="starlightthreeaward" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.STARLIGHT.THREE.AWARD}`"
mode="aspectFit"></image>
<image class="starlightthreebtn" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.STARLIGHT.THREE.BTN}`"
mode="aspectFit" @click="handleButtonClick('starlight')">
</image>
<view class="starlightthreebtn starlight" @click="handleButtonClick('starlight')">
<text>{{ buttonInfo.text }}</text>
</view>
</view>
</view>
......@@ -106,9 +103,9 @@
</image>
<image class="goldthreeaward" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.GOLD.THREE.AWARD}`" mode="aspectFit">
</image>
<image class="goldthreebtn" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.GOLD.THREE.BTN}`" mode="aspectFit"
@click="handleButtonClick('gold')"></image>
<view class="goldthreebtn gold" @click="handleButtonClick('gold')">
<text>{{ buttonInfo.text }}</text>
</view>
</view>
<image class="goldlocktip" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.GOLD.LOCKTIP}`" mode="aspectFit"></image>
</view>
......@@ -138,10 +135,9 @@
<image class="platinumthreebg" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.PLATINUM.THREE.BG}`"
mode="aspectFit">
</image>
<image class="platinumthreebtn" :src="`${$baseUrl}${YEAR_GIFT_IMAGES.PLATINUM.THREE.BTN}`"
mode="aspectFit" @click="handleButtonClick('platinum')">
</image>
<view class="platinumthreebtn platinum" @click="handleButtonClick('platinum')">
<text>{{ buttonInfo.text }}</text>
</view>
</view>
</view>
</view>
......@@ -188,48 +184,34 @@ const userLevelName = computed(() => LEVEL_MAP[props.userLevel])
const buttonInfo = computed(() => {
const levelOrder = [0, 1, 2, 3, 4]; // gold, platinum, diamond, starlight, starshine
const userLevelIndex = levelOrder.indexOf(props.userLevel);
const requiredLevelIndex = levelOrder.indexOf(props.currentLevel);
if (userLevelIndex < requiredLevelIndex) {
return {
text: '待解锁',
action: 'none'
};
} else if (state.isReceived) {
const diamondIndex = levelOrder.indexOf(2); // Diamond level
const platinumIndex = levelOrder.indexOf(1); // Platinum level
if (userLevelIndex <= platinumIndex) {
return {
text: '已领取',
action: 'none'
text: '去升级',
action: 'upgrade'
};
} else {
} else if (userLevelIndex >= diamondIndex) {
return {
text: '立即领取',
action: 'receive'
text: '去查看',
action: 'view'
};
}
})
// 按钮点击事件处理
const handleButtonClick = () => {
if (buttonInfo.value.action === 'receive') {
// 检查用户等级是否符合领取条件
const levelOrder = [0, 1, 2, 3, 4]; // gold, platinum, diamond, starlight, starshine
const userLevelIndex = levelOrder.indexOf(props.userLevel);
const requiredLevelIndex = levelOrder.indexOf(props.currentLevel);
if (userLevelIndex < requiredLevelIndex) {
uni.showToast({
title: '等级不够,无法领取',
icon: 'none',
duration: 2000
});
return;
}
receiveYearGift();
} else if (buttonInfo.value.action === 'upgrade') {
if (buttonInfo.value.action === 'upgrade') {
// 跳转到升级页面
uni.navigateTo({
url: '/pages/upgrade/upgradeGuide'
});
} else if (buttonInfo.value.action === 'view') {
// 跳转到查看页面
uni.navigateTo({
url: '/pages/webview/webview?url=https://member.feihe.com/memberH5/#/coupon'
});
}
}
</script>
......@@ -237,7 +219,7 @@ const handleButtonClick = () => {
<style lang="less" scoped>
.yeargift {
width: 686rpx;
height: 1139rpx;
height: 1218rpx;
left: 0rpx;
top: 0rpx;
right: 0rpx;
......@@ -358,7 +340,7 @@ const handleButtonClick = () => {
left: 61rpx;
top: 436rpx;
position: absolute;
cursor: pointer;
transition: transform 0.2s ease;
&:active {
......@@ -473,7 +455,7 @@ const handleButtonClick = () => {
left: 61rpx;
top: 436rpx;
position: absolute;
cursor: pointer;
transition: transform 0.2s ease;
&:active {
......@@ -588,7 +570,7 @@ const handleButtonClick = () => {
left: 61rpx;
top: 436rpx;
position: absolute;
cursor: pointer;
transition: transform 0.2s ease;
&:active {
......@@ -703,7 +685,7 @@ const handleButtonClick = () => {
left: 61rpx;
top: 436rpx;
position: absolute;
cursor: pointer;
transition: transform 0.2s ease;
&:active {
......@@ -833,7 +815,7 @@ const handleButtonClick = () => {
left: 61rpx;
top: 436rpx;
position: absolute;
cursor: pointer;
transition: transform 0.2s ease;
&:active {
......@@ -845,4 +827,79 @@ const handleButtonClick = () => {
}
}
}
/* 按钮样式 */
.diamondthreebtn,
.starshinethreebtn,
.starlightthreebtn,
.goldthreebtn,
.platinumthreebtn {
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.5rpx;
font-size: 32rpx;
font-weight: bold;
transition: transform 0.2s ease;
&.active {
background: linear-gradient(to right, #7253a5, #9879cc);
/* 钻石 */
color: #fff;
box-shadow: 0 4rpx 12rpx rgba(114, 83, 165, 0.3);
&:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(114, 83, 165, 0.4);
}
}
&.starshine {
background: linear-gradient(to right, #000000, #2c1600);
/* 星耀 */
color: #fff;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.3);
&:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.4);
}
}
&.starlight {
background: linear-gradient(to right, #cda36b, #e0b97d);
/* 星光 */
color: #fff;
box-shadow: 0 4rpx 12rpx rgba(205, 163, 107, 0.3);
&:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(205, 163, 107, 0.4);
}
}
&.gold {
background: linear-gradient(to right, #906632, #ab7a44);
/* 黄金 */
color: #fff;
box-shadow: 0 4rpx 12rpx rgba(144, 102, 50, 0.3);
&:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(144, 102, 50, 0.4);
}
}
&.platinum {
background: linear-gradient(to right, #5189c0, #6fa2d5);
/* 白金 */
color: #fff;
box-shadow: 0 4rpx 12rpx rgba(81, 137, 192, 0.3);
&:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(81, 137, 192, 0.4);
}
}
}
</style>
......@@ -15,7 +15,7 @@ export const YEAR_GIFT_IMAGES = {
},
THREE: {
BG: `pointRights/YearGift/${version}/diamondThreeBg.png`,
AWARD: `pointRights/YearGift/${version}/diamondThreeAward.png`,
AWARD: `pointRights/YearGift/${version}/goldThreeAward2.png`,
BTN: `pointRights/YearGift/${version}/diamondThreeBtn.png`
}
},
......@@ -33,7 +33,7 @@ export const YEAR_GIFT_IMAGES = {
},
THREE: {
BG: `pointRights/YearGift/${version}/starshineThreeBg.png`,
AWARD: `pointRights/YearGift/${version}/starshineThreeAward.png`,
AWARD: `pointRights/YearGift/${version}/goldThreeAward2.png`,
BTN: `pointRights/YearGift/${version}/starshineThreeBtn.png`
}
},
......@@ -51,7 +51,7 @@ export const YEAR_GIFT_IMAGES = {
},
THREE: {
BG: `pointRights/YearGift/${version}/starlightThreeBg.png`,
AWARD: `pointRights/YearGift/${version}/starlightThreeAward.png`,
AWARD: `pointRights/YearGift/${version}/goldThreeAward2.png`,
BTN: `pointRights/YearGift/${version}/starlightThreeBtn.png`
}
},
......@@ -69,7 +69,7 @@ export const YEAR_GIFT_IMAGES = {
},
THREE: {
BG: `pointRights/YearGift/${version}/goldThreeBg.png`,
AWARD: `pointRights/YearGift/${version}/goldThreeAward.png`,
AWARD: `pointRights/YearGift/${version}/goldThreeAward2.png`,
BTN: `pointRights/YearGift/${version}/goldThreeBtn.png`
},
LOCKTIP: `pointRights/YearGift/${version}/goldLockTip.png`
......@@ -89,7 +89,7 @@ export const YEAR_GIFT_IMAGES = {
},
THREE: {
BG: `pointRights/YearGift/${version}/platinumThreeBg.png`,
AWARD: `pointRights/YearGift/${version}/platinumThreeAward.png`,
AWARD: `pointRights/YearGift/${version}/goldThreeAward2.png`,
BTN: `pointRights/YearGift/${version}/platinumThreeBtn.png`
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment