|
@@ -11,26 +11,29 @@
|
|
|
]"
|
|
]"
|
|
|
v-for="(item, index) in payOptions"
|
|
v-for="(item, index) in payOptions"
|
|
|
:key="index"
|
|
:key="index"
|
|
|
- @click="changeOption(index)"
|
|
|
|
|
- >
|
|
|
|
|
- <view
|
|
|
|
|
- class="tag fs-24 color-fff fw-500"
|
|
|
|
|
|
|
+ @click="changeOption(index)">
|
|
|
|
|
+ <image
|
|
|
v-if="payOptionsDiscount[index]"
|
|
v-if="payOptionsDiscount[index]"
|
|
|
- >{{ payOptionsDiscount[index] }}
|
|
|
|
|
- </view
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ src="/static/images/coupon-center.png"
|
|
|
|
|
+ mode="widthFix"
|
|
|
|
|
+ class="tag fs-24 color-fff fw-500 width-40"
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- <view
|
|
|
|
|
+ class="tag fs-24 color-fff fw-500"
|
|
|
|
|
+ v-if="payOptionsDiscount[index]">{{ payOptionsDiscount[index] }}
|
|
|
|
|
+ </view>-->
|
|
|
{{ item }}
|
|
{{ item }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="payOptionsDiscountDay[payOption]" class="flex-align-center">
|
|
<view v-if="payOptionsDiscountDay[payOption]" class="flex-align-center">
|
|
|
- <view class="fs-30 color-666"
|
|
|
|
|
- >折扣优惠有效期{{ payOptionsDiscountDay[payOption] }}天
|
|
|
|
|
- </view
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <view class="fs-30 color-666">
|
|
|
|
|
+ {{ (payOptionsDiscount[payOption] && payOptionsDiscount[payOption] > 0) ? `享服务费${payOptionsDiscount[payOption]}折,` : '' }}权益有效期{{
|
|
|
|
|
+ payOptionsDiscountDay[payOption]
|
|
|
|
|
+ }}天
|
|
|
|
|
+ </view>
|
|
|
<view
|
|
<view
|
|
|
class="ml-12 color-primary fs-30"
|
|
class="ml-12 color-primary fs-30"
|
|
|
- @click="to(`/pages-common/activity/activity?id=${activityId}`)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ @click="to(`/pages-common/activity/activity?id=${activityId}`)">
|
|
|
<text>详细规则</text>
|
|
<text>详细规则</text>
|
|
|
<text class="fs-24 ml-6">>></text>
|
|
<text class="fs-24 ml-6">>></text>
|
|
|
</view>
|
|
</view>
|
|
@@ -40,17 +43,13 @@
|
|
|
:value="payValue > 0 ? payValue : ''"
|
|
:value="payValue > 0 ? payValue : ''"
|
|
|
title="金额"
|
|
title="金额"
|
|
|
type="digit"
|
|
type="digit"
|
|
|
- @input="input"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ @input="input"/>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<style-bottom-view>
|
|
<style-bottom-view>
|
|
|
<view class="pl-60 pr-60 pb-20">
|
|
<view class="pl-60 pr-60 pb-20">
|
|
|
- <style-button size="small" type="primary" @click="debounceConfirm"
|
|
|
|
|
- >充值
|
|
|
|
|
- </style-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <style-button size="small" type="primary" @click="debounceConfirm">充值</style-button>
|
|
|
</view>
|
|
</view>
|
|
|
</style-bottom-view>
|
|
</style-bottom-view>
|
|
|
</template>
|
|
</template>
|
|
@@ -69,18 +68,25 @@ const payOptionsDiscount = ref(["", "", "", "", "", ""]);
|
|
|
const payOptionsDiscountDay = ref([0, 0, 0, 0, 0, 0]);
|
|
const payOptionsDiscountDay = ref([0, 0, 0, 0, 0, 0]);
|
|
|
const payValue = ref(0);
|
|
const payValue = ref(0);
|
|
|
const activityId = ref();
|
|
const activityId = ref();
|
|
|
|
|
+const rechargeRightsId = ref();
|
|
|
|
|
+const rechargeRightsList = ref([]);
|
|
|
const needBack = ref(false);
|
|
const needBack = ref(false);
|
|
|
const input = (e: any) => {
|
|
const input = (e: any) => {
|
|
|
payValue.value = e.value;
|
|
payValue.value = e.value;
|
|
|
|
|
+ rechargeRightsId.value = 0;
|
|
|
};
|
|
};
|
|
|
const changeOption = (index: number) => {
|
|
const changeOption = (index: number) => {
|
|
|
payValue.value = 0;
|
|
payValue.value = 0;
|
|
|
payOption.value = index;
|
|
payOption.value = index;
|
|
|
|
|
+ let find = rechargeRightsList.value.find((k:any) => (k.amountMin || 0) / 100 === payOptions.value[index]);
|
|
|
|
|
+ if (find) {
|
|
|
|
|
+ rechargeRightsId.value = find?.id;
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const debounceConfirm = debounce(()=>{
|
|
|
|
|
|
|
+const debounceConfirm = debounce(() => {
|
|
|
confirm();
|
|
confirm();
|
|
|
-},500)
|
|
|
|
|
|
|
+}, 500)
|
|
|
|
|
|
|
|
const confirm = () => {
|
|
const confirm = () => {
|
|
|
if (payValue.value && !/^[0-9]*(\.\d{1,2})?$/.test(`${payValue.value}`)) {
|
|
if (payValue.value && !/^[0-9]*(\.\d{1,2})?$/.test(`${payValue.value}`)) {
|
|
@@ -107,7 +113,7 @@ const confirm = () => {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
title: "加载中",
|
|
|
});
|
|
});
|
|
|
- insertMoney(params)
|
|
|
|
|
|
|
+ insertMoney(params, rechargeRightsId.value)
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
return fetchProfile();
|
|
return fetchProfile();
|
|
|
})
|
|
})
|
|
@@ -147,7 +153,7 @@ onLoad((options: any) => {
|
|
|
needBack.value = !!options.back;
|
|
needBack.value = !!options.back;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(options.discount){
|
|
|
|
|
|
|
+ if (options.discount) {
|
|
|
payValue.value = Number((Number(options.discount) / 100).toFixed(2));
|
|
payValue.value = Number((Number(options.discount) / 100).toFixed(2));
|
|
|
}
|
|
}
|
|
|
fetchProfile().then((res) => {
|
|
fetchProfile().then((res) => {
|
|
@@ -158,11 +164,13 @@ onLoad((options: any) => {
|
|
|
const val = Number((Number(item.amountMin) / 100).toFixed(2));
|
|
const val = Number((Number(item.amountMin) / 100).toFixed(2));
|
|
|
const fi = payOptions.value.findIndex((o) => o === val);
|
|
const fi = payOptions.value.findIndex((o) => o === val);
|
|
|
if (fi >= 0) {
|
|
if (fi >= 0) {
|
|
|
- payOptionsDiscount.value[fi] = item.rightsDesc;
|
|
|
|
|
- payOptionsDiscountDay.value[fi] =
|
|
|
|
|
- item.validity > 0 ? item.validity : 1;
|
|
|
|
|
|
|
+ payOptionsDiscount.value[fi] = ((item.discount || 0) / 100).toFixed(0);
|
|
|
|
|
+ payOptionsDiscountDay.value[fi] = item.validity > 0 ? item.validity : 1;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ if (res.activityList && res.activityList[0].rechargeRightsList && res.activityList[0].rechargeRightsList.length > 0) {
|
|
|
|
|
+ rechargeRightsList.value = res?.activityList[0]?.rechargeRightsList
|
|
|
|
|
+ }
|
|
|
activityId.value = res.activityList[0].id;
|
|
activityId.value = res.activityList[0].id;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -188,7 +196,7 @@ onLoad((options: any) => {
|
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
|
color: #000;
|
|
color: #000;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ //overflow: hidden;
|
|
|
|
|
|
|
|
&:nth-child(3n + 1) {
|
|
&:nth-child(3n + 1) {
|
|
|
margin-left: 0;
|
|
margin-left: 0;
|
|
@@ -196,19 +204,17 @@ onLoad((options: any) => {
|
|
|
|
|
|
|
|
.tag {
|
|
.tag {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- top: 0px;
|
|
|
|
|
- right: 0px;
|
|
|
|
|
- border-radius: 30rpx 0px 0px 30rpx;
|
|
|
|
|
- box-sizing: content-box;
|
|
|
|
|
- padding: 2rpx 10rpx;
|
|
|
|
|
- background: linear-gradient(90deg, #f366ff 0%, #5e98ff 100%);
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
|
|
+ top: -9px;
|
|
|
|
|
+ right: -10px;
|
|
|
|
|
+ padding: 2rpx 2rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.option-active {
|
|
.option-active {
|
|
|
- background-color: var(--color-primary);
|
|
|
|
|
- color: #fff;
|
|
|
|
|
|
|
+ color: var(--color-primary);
|
|
|
|
|
+ //border-color: var(--color-primary);
|
|
|
|
|
+ //color: #fff;
|
|
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|