fix:radio修复

pull/8/head
kele 2023-03-13 17:42:11 +08:00
parent 0dd5fde92c
commit 497d4e295f
10 changed files with 186 additions and 176 deletions

View File

@ -58,23 +58,29 @@
</uni-forms-item> </uni-forms-item>
</view> </view>
</uni-forms> </uni-forms>
<label class="ss-flex ss-m-t-20" @tap="onChange" v-if="state.protocol?.status == 1"> <radio-group @change="onChange" v-if="state.protocol?.status == 1">
<radio :checked="state.isAgree" color="var(--ui-BG-Main)" style="transform: scale(0.6)" /> <label class="ss-flex ss-m-t-20">
<view class="agreement-text ss-flex"> <radio
<view class="ss-m-r-4">勾选代表同意</view> :checked="state.isAgree"
<view color="var(--ui-BG-Main)"
class="tcp-text" style="transform: scale(0.6)"
@tap.stop=" />
sheep.$router.go('/pages/public/richtext', { <view class="agreement-text ss-flex">
id: state.protocol.id, <view class="ss-m-r-4">勾选代表同意</view>
title: state.protocol.title, <view
}) class="tcp-text"
" @tap.stop="
> sheep.$router.go('/pages/public/richtext', {
{{ state.protocol.title }} id: state.protocol.id,
title: state.protocol.title,
})
"
>
{{ state.protocol.title }}
</view>
</view> </view>
</view> </label>
</label> </radio-group>
<su-fixed bottom placeholder> <su-fixed bottom placeholder>
<view class="submit-box ss-flex ss-row-center ss-p-30"> <view class="submit-box ss-flex ss-row-center ss-p-30">
<button class="submit-btn ss-reset-button ui-BG-Main ui-Shadow-Main" @tap="submit"> <button class="submit-btn ss-reset-button ui-BG-Main ui-Shadow-Main" @tap="submit">

View File

@ -27,13 +27,18 @@
<view class="cart-content ss-flex-1 ss-p-x-30 ss-m-b-40"> <view class="cart-content ss-flex-1 ss-p-x-30 ss-m-b-40">
<view class="goods-box ss-r-10 ss-m-b-14" v-for="item in state.list" :key="item.id"> <view class="goods-box ss-r-10 ss-m-b-14" v-for="item in state.list" :key="item.id">
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<view class="check-box ss-flex ss-col-center ss-p-l-10" @tap="onSelectSingle(item.id)"> <radio-group
<radio @change="onSelectSingle(item.id)"
:checked="state.selectedIds.includes(item.id)" class="check-box ss-flex ss-col-center ss-p-l-10"
color="var(--ui-BG-Main)" >
style="transform: scale(0.8)" <label class="radio ss-flex">
/> <radio
</view> :checked="state.selectedIds.includes(item.id)"
color="var(--ui-BG-Main)"
style="transform: scale(0.8)"
/>
</label>
</radio-group>
<s-goods-item <s-goods-item
:title="item.goods.title" :title="item.goods.title"
:img="item.sku_price.image || item.goods.image" :img="item.sku_price.image || item.goods.image"
@ -59,14 +64,16 @@
<su-fixed bottom :val="48" placeholder v-if="state.list.length > 0" :isInset="false"> <su-fixed bottom :val="48" placeholder v-if="state.list.length > 0" :isInset="false">
<view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"> <view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom">
<view class="footer-left ss-flex ss-col-center"> <view class="footer-left ss-flex ss-col-center">
<view class="check-box ss-flex ss-col-center ss-p-r-30" @tap="onSelectAll"> <radio-group @change="onSelectAll" class="check-box ss-flex ss-col-center ss-p-r-30">
<radio <label class="radio ss-flex">
:checked="state.isAllSelected" <radio
color="var(--ui-BG-Main)" :checked="state.isAllSelected"
style="transform: scale(0.7)" color="var(--ui-BG-Main)"
/> style="transform: scale(0.8)"
<view> 全选 </view> />
</view> <view class="ss-m-l-8"> 全选 </view>
</label>
</radio-group>
<text>合计</text> <text>合计</text>
<view class="text-price price-text"> <view class="text-price price-text">
{{ state.totalPriceSelected }} {{ state.totalPriceSelected }}

View File

@ -17,19 +17,21 @@
<view class="refund-item"> <view class="refund-item">
<view class="item-title ss-m-b-20">售后类型</view> <view class="item-title ss-m-b-20">售后类型</view>
<view class="ss-flex-col"> <view class="ss-flex-col">
<view <radio-group @change="onRefundChange">
class="ss-flex ss-col-center ss-p-y-10" <label
v-for="(item, index) in state.refundTypeList" class="ss-flex ss-col-center ss-p-y-10"
:key="index" v-for="(item, index) in state.refundTypeList"
@tap="formData.type = item.value" :key="index"
> >
<radio <radio
:checked="formData.type === item.value" :checked="formData.type === item.value"
color="var(--ui-BG-Main)" color="var(--ui-BG-Main)"
style="transform: scale(0.8)" style="transform: scale(0.8)"
/> :value="item.value"
<view class="item-value">{{ item.text }}</view> />
</view> <view class="item-value ss-m-l-8">{{ item.text }}</view>
</label>
</radio-group>
</view> </view>
</view> </view>
<!-- 申请原因 --> <!-- 申请原因 -->
@ -99,26 +101,20 @@
>申请原因</view >申请原因</view
> >
<view class="modal-content content_box"> <view class="modal-content content_box">
<view <radio-group @change="onChange">
class="ss-flex ss-col-center" <label
v-for="item in state.refundReasonList" class="radio ss-flex ss-col-center"
:key="item.value" v-for="item in state.refundReasonList"
> :key="item.value"
<view class="ss-flex-1 ss-p-20" @tap="onTitle(item.value, item.title)">{{ >
item.title <view class="ss-flex-1 ss-p-20">{{ item.title }}</view>
}}</view> <radio
<view class="radio"> :value="item.value"
<radio-group @change="onChange(item.value, item.title)"> color="var(--ui-BG-Main)"
<label class="radio"> :checked="item.value === state.currentValue"
<radio />
:value="item.value" </label>
color="var(--ui-BG-Main)" </radio-group>
:checked="item.value === state.currentValue"
/>
</label>
</radio-group>
</view>
</view>
</view> </view>
<view class="modal-foot foot_box ss-flex ss-row-center ss-col-center"> <view class="modal-foot foot_box ss-flex ss-row-center ss-col-center">
<button class="ss-reset-button close-btn ui-BG-Main-Gradient" @tap="onReason" <button class="ss-reset-button close-btn ui-BG-Main-Gradient" @tap="onReason"
@ -209,10 +205,19 @@
} }
} }
//
function onRefundChange(e) {
formData.type = e.detail.value;
}
// //
function onChange(val, title) { function onChange(e) {
state.currentValue = val; state.currentValue = e.detail.value;
state.reasonText = title; state.refundReasonList.forEach((item) => {
if (item.value === e.detail.value) {
state.reasonText = item.title;
}
});
} }
// //
function onReason() { function onReason() {

View File

@ -178,9 +178,4 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
:deep(.uni-radio-input) {
width: 36rpx;
height: 36rpx;
}
</style> </style>

View File

@ -13,51 +13,52 @@
</view> </view>
<view class="modal-content ss-flex-1"> <view class="modal-content ss-flex-1">
<view class="pay-title ss-p-l-30 ss-m-y-30">选择支付方式</view> <view class="pay-title ss-p-l-30 ss-m-y-30">选择支付方式</view>
<view class="pay-type-item" v-for="item in state.payMethods" :key="item.title"> <radio-group @change="onTapPay">
<view <label class="pay-type-item" v-for="item in state.payMethods" :key="item.title">
class="pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom" <view
:class="{ 'disabled-pay-item': item.disabled }" class="pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"
v-if=" :class="{ 'disabled-pay-item': item.disabled }"
allowedPayment.includes(item.value) && v-if="
!(state.orderType === 'recharge' && item.value === 'money') allowedPayment.includes(item.value) &&
" !(state.orderType === 'recharge' && item.value === 'money')
@tap="onTapPay(item.disabled, item.value)" "
> >
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<image <image
class="pay-icon" class="pay-icon"
v-if="item.disabled" v-if="item.disabled"
:src="sheep.$url.static('/static/img/shop/pay/cod_disabled.png')" :src="sheep.$url.static('/static/img/shop/pay/cod_disabled.png')"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<image <image
class="pay-icon" class="pay-icon"
v-else v-else
:src="sheep.$url.static(item.icon)" :src="sheep.$url.static(item.icon)"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<text class="pay-title">{{ item.title }}</text> <text class="pay-title">{{ item.title }}</text>
</view>
<view class="check-box ss-flex ss-col-center ss-p-l-10">
<view class="userInfo-money ss-m-r-10" v-if="item.value == 'money'">
余额: {{ userInfo.money }}
</view> </view>
<view <view class="check-box ss-flex ss-col-center ss-p-l-10">
class="userInfo-money ss-m-r-10" <view class="userInfo-money ss-m-r-10" v-if="item.value == 'money'">
v-if="item.value == 'offline' && item.disabled" 余额: {{ userInfo.money }}
> </view>
部分商品不支持 <view
class="userInfo-money ss-m-r-10"
v-if="item.value == 'offline' && item.disabled"
>
部分商品不支持
</view>
<radio
:value="item.value"
color="var(--ui-BG-Main)"
style="transform: scale(0.8)"
:disabled="item.disabled"
:checked="state.payment === item.value"
/>
</view> </view>
<radio
:value="item.value"
color="var(--ui-BG-Main)"
style="transform: scale(0.8)"
:disabled="item.disabled"
:checked="state.payment === item.value"
/>
</view> </view>
</view> </label>
</view> </radio-group>
</view> </view>
<!-- 工具 --> <!-- 工具 -->
<view class="modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40"> <view class="modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40">
@ -191,12 +192,8 @@
state.payStatus = 2; state.payStatus = 2;
} }
function onTapPay(disabled, value) { function onTapPay(e) {
if (disabled) { state.payment = e.detail.value;
state.payment = '';
} else {
state.payment = value;
}
} }
async function setRechargeOrder(id) { async function setRechargeOrder(id) {

View File

@ -10,9 +10,7 @@
v-for="item in state.radioList" v-for="item in state.radioList"
:key="item.type" :key="item.type"
> >
<view> <radio :value="item.type" color="var(--ui-BG-Main)" style="transform: scale(0.8)" />
<radio :value="item.type" color="var(--ui-BG-Main)" style="transform: scale(0.8)" />
</view>
<view class="radio-subtitle">{{ item.type }}</view> <view class="radio-subtitle">{{ item.type }}</view>
</label> </label>
</radio-group> </radio-group>

View File

@ -32,10 +32,10 @@
:key="item.id" :key="item.id"
> >
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<view <radio-group
v-show="state.editMode"
class="check-box ss-flex ss-col-center ss-p-l-10" class="check-box ss-flex ss-col-center ss-p-l-10"
@tap="onSelect(item.goods_id)" @change="onSelect(item.goods_id)"
v-show="state.editMode"
> >
<label class="radio"> <label class="radio">
<radio <radio
@ -44,7 +44,7 @@
style="transform: scale(0.8)" style="transform: scale(0.8)"
/> />
</label> </label>
</view> </radio-group>
<s-goods-item <s-goods-item
:title="item.goods.title" :title="item.goods.title"
:img="item.goods.image" :img="item.goods.image"
@ -66,17 +66,16 @@
<su-fixed bottom :val="0" placeholder v-show="state.editMode"> <su-fixed bottom :val="0" placeholder v-show="state.editMode">
<view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"> <view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom">
<view class="footer-left ss-flex ss-col-center"> <view class="footer-left ss-flex ss-col-center">
<view class="check-box ss-flex ss-col-center ss-p-r-30" @tap="onSelectAll"> <radio-group @change="onSelectAll">
<label class="radio"> <label class="check-box ss-flex ss-col-center ss-p-r-30">
<radio <radio
:checked="state.selectAll" :checked="state.selectAll"
color="var(--ui-BG-Main)" color="var(--ui-BG-Main)"
style="transform: scale(0.7)" style="transform: scale(0.7)"
/> />
<view> 全选 </view>
</label> </label>
</radio-group>
<view> 全选 </view>
</view>
</view> </view>
<view class="footer-right"> <view class="footer-right">
<button <button
@ -133,11 +132,11 @@
page, page,
}); });
if (res.error === 0) { if (res.error === 0) {
let orderList = _.concat(state.pagination.data, res.data.data); let orderList = _.concat(state.pagination.data, res.data.data);
state.pagination = { state.pagination = {
...res.data, ...res.data,
data: orderList, data: orderList,
}; };
if (state.pagination.current_page < state.pagination.last_page) { if (state.pagination.current_page < state.pagination.last_page) {
state.loadStatus = 'more'; state.loadStatus = 'more';
} else { } else {
@ -181,7 +180,7 @@
state.editMode = false; state.editMode = false;
state.selectedCollectList = []; state.selectedCollectList = [];
state.selectAll = false; state.selectAll = false;
state.pagination = pagination state.pagination = pagination;
getData(); getData();
} }
} }

View File

@ -35,10 +35,10 @@
:key="item.id" :key="item.id"
> >
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<view <radio-group
v-show="state.editMode" v-show="state.editMode"
class="check-box ss-flex ss-col-center ss-p-l-10" class="check-box ss-flex ss-col-center ss-p-l-10"
@tap="onSelect(item.goods_id)" @change="onSelect(item.goods_id)"
> >
<label class="radio"> <label class="radio">
<radio <radio
@ -47,7 +47,7 @@
style="transform: scale(0.8)" style="transform: scale(0.8)"
/> />
</label> </label>
</view> </radio-group>
<s-goods-item <s-goods-item
:title="item.goods.title" :title="item.goods.title"
:img="item.goods.image" :img="item.goods.image"
@ -69,16 +69,16 @@
<su-fixed bottom :val="0" placeholder v-show="state.editMode"> <su-fixed bottom :val="0" placeholder v-show="state.editMode">
<view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"> <view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom">
<view class="footer-left ss-flex ss-col-center"> <view class="footer-left ss-flex ss-col-center">
<view class="check-box ss-flex ss-col-center ss-p-r-30" @tap="onSelectAll"> <radio-group @change="onSelectAll">
<label class="radio"> <label class="check-box ss-flex ss-col-center ss-p-r-30">
<radio <radio
:checked="state.selectAll" :checked="state.selectAll"
color="var(--ui-BG-Main)" color="var(--ui-BG-Main)"
style="transform: scale(0.7)" style="transform: scale(0.7)"
/> />
<view>全选</view>
</label> </label>
<view>全选</view> </radio-group>
</view>
</view> </view>
<view class="footer-right"> <view class="footer-right">
<button <button

View File

@ -75,29 +75,31 @@
v-if="['accountLogin', 'smsLogin', 'smsRegister'].includes(authType)" v-if="['accountLogin', 'smsLogin', 'smsRegister'].includes(authType)"
class="agreement-box ss-flex ss-row-center" class="agreement-box ss-flex ss-row-center"
> >
<label class="radio ss-flex" @tap="onChange"> <radio-group @change="onChange" class="ss-flex ss-col-center">
<radio <label class="radio ss-flex">
:checked="state.protocol" <radio
color="var(--ui-BG-Main)" :checked="state.protocol"
style="transform: scale(0.8)" color="var(--ui-BG-Main)"
/> style="transform: scale(0.8)"
<view class="agreement-text ss-flex ss-col-center"> />
我已阅读并遵守 <view class="agreement-text ss-flex ss-col-center ss-m-l-8">
<view 我已阅读并遵守
class="tcp-text" <view
@tap.stop="onProtocol(appInfo.user_protocol.id, appInfo.user_protocol.title)" class="tcp-text"
> @tap.stop="onProtocol(appInfo.user_protocol.id, appInfo.user_protocol.title)"
{{ appInfo.user_protocol.title }} >
{{ appInfo.user_protocol.title }}
</view>
<view class="agreement-text"></view>
<view
class="tcp-text"
@tap.stop="onProtocol(appInfo.privacy_protocol.id, appInfo.privacy_protocol.title)"
>
{{ appInfo.privacy_protocol.title }}
</view>
</view> </view>
<view class="agreement-text"></view> </label>
<view </radio-group>
class="tcp-text"
@tap.stop="onProtocol(appInfo.privacy_protocol.id, appInfo.privacy_protocol.title)"
>
{{ appInfo.privacy_protocol.title }}
</view>
</view>
</label>
</view> </view>
<view class="safe-box"></view> <view class="safe-box"></view>
</view> </view>

View File

@ -19,14 +19,15 @@
<view v-for="(item, index) in state.couponInfo.can_use" :key="index"> <view v-for="(item, index) in state.couponInfo.can_use" :key="index">
<s-coupon-list :data="item" type="user" :disabled="false"> <s-coupon-list :data="item" type="user" :disabled="false">
<template #default> <template #default>
<label class="radio"> <radio-group @change="radioChange(item.id)" class="ss-flex ss-col-center">
<radio <label class="radio">
color="var(--ui-BG-Main)" <radio
style="transform: scale(0.8)" color="var(--ui-BG-Main)"
@tap.stop="radioChange(item.id)" style="transform: scale(0.8)"
:checked="state.couponId == item.id" :checked="state.couponId == item.id"
/> />
</label> </label>
</radio-group>
</template> </template>
</s-coupon-list> </s-coupon-list>
</view> </view>