|
|
@@ -50,7 +50,7 @@
|
|
|
</view>
|
|
|
<view class="item-content_right">
|
|
|
<style-checkbox
|
|
|
- @on-checkChange="handleCheckRights($event,item.rightsId)"
|
|
|
+ @on-checkChange="handleCheckRights($event,item.rightsId,item.id)"
|
|
|
:size="48"
|
|
|
:checked="item.rightsId === rightsId"
|
|
|
:iconsize="17"
|
|
|
@@ -120,7 +120,7 @@
|
|
|
<radio :checked="item.couponId === couponId"/>
|
|
|
</radio-group>-->
|
|
|
<style-checkbox
|
|
|
- @on-checkChange="handleCheckCoupon($event,item.couponId)"
|
|
|
+ @on-checkChange="handleCheckCoupon($event,item.couponId,item.id)"
|
|
|
:size="48"
|
|
|
:checked="item.couponId === couponId"
|
|
|
:iconsize="17"
|
|
|
@@ -176,12 +176,14 @@ const handleClose = () => {
|
|
|
const handleConfirm = () => {
|
|
|
let emitData = {
|
|
|
rightsId: rightsId.value,
|
|
|
+ userRechargeRightsId: userRechargeRightsId.value,
|
|
|
couponId: couponId.value,
|
|
|
+ userCouponId: userCouponId.value,
|
|
|
stationId: stationId.value,
|
|
|
userRights: rightsList.value?.find((k: any) => k.rightsId == rightsId.value ),
|
|
|
- userCoupon: couponList.value?.find((k: any) => k.couponId == couponId.value)
|
|
|
+ userCoupon: couponList.value?.find((k: any) => k.couponId == couponId.value),
|
|
|
}
|
|
|
- // console.log(emitData)
|
|
|
+ console.log(emitData)
|
|
|
emits('on-change', emitData)
|
|
|
handleClose();
|
|
|
}
|
|
|
@@ -194,22 +196,38 @@ const changeTab = (tab: number) => {
|
|
|
mode.value = tab;
|
|
|
}
|
|
|
|
|
|
-const handleCheckRights = (val: boolean, userRightsId: any) => {
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param val
|
|
|
+ * @param rId rechargeRightsId
|
|
|
+ * @param urId userRechargeRightsId
|
|
|
+ */
|
|
|
+const handleCheckRights = (val: boolean, rId: any,urId: any) => {
|
|
|
// console.log("handleCheckRights", userRightsId, val)
|
|
|
- if (rightsId.value == userRightsId) {
|
|
|
+ if (rightsId.value == rId) {
|
|
|
rightsId.value = null;
|
|
|
+ userRechargeRightsId.value = null;
|
|
|
} else {
|
|
|
- rightsId.value = userRightsId;
|
|
|
+ rightsId.value = rId;
|
|
|
+ userRechargeRightsId.value = urId;
|
|
|
couponId.value = null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const handleCheckCoupon = (e: any, userCouponId: any) => {
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param e
|
|
|
+ * @param cid couponId
|
|
|
+ * @param ucid userCouponId
|
|
|
+ */
|
|
|
+const handleCheckCoupon = (e: any, cid: any,ucid: any) => {
|
|
|
// console.log("handleCheckCoupon", userCouponId, e)
|
|
|
- if (couponId.value == userCouponId) {
|
|
|
+ if (couponId.value == cid) {
|
|
|
couponId.value = null;
|
|
|
+ userCouponId.value = null;
|
|
|
} else {
|
|
|
- couponId.value = userCouponId;
|
|
|
+ couponId.value = cid;
|
|
|
+ userCouponId.value = ucid;
|
|
|
rightsId.value = null;
|
|
|
}
|
|
|
}
|