处理新增订单的套餐问题

This commit is contained in:
2026-01-27 14:16:37 +08:00
parent 98eefbb833
commit e04cf17a37
16 changed files with 872 additions and 210 deletions

View File

@@ -3,44 +3,122 @@
<view style=" padding: 10rpx;">
<view class="title">基础台费 </view>
<nut-form>
<!-- <nut-form-item>
<template v-slot:label>房间</template>
<template v-slot:default>
<view style="color: black;" @click="visibleRoomsPopup = true">
<text>{{form.room_name}}</text>
</view>
</template>
</nut-form-item> -->
<nut-form-item label="结算方式">
<nut-radio-group v-model="form.fee_type" direction="horizontal">
<nut-radio label="1">团购</nut-radio>
<nut-radio label="2">线下</nut-radio>
</nut-radio-group>
</nut-form-item>
</nut-form>
<!-- 台费类型套餐支付状态 三者在同一行布局 -->
<view class="inline-form">
<!-- 台费类型选择 -->
<nut-form v-if="form.fee_type==1">
<view class="inline-combo-form" v-for="(item, index) in orderCombos" :key="index">
<view class="form-row">
<nut-form-item label-position="top">
<template v-slot:label>结算方式</template>
<template v-slot:label>平台</template>
<template v-slot:default>
<view style="color: black;" @click="visibleFeeTypePopup = true">
<text>{{form.fee_type_name}}</text>
<view style="color: black;" @click="visibleComboTypePopup = true">
<text v-if="item.combo_type_name">{{item.combo_type_name}}</text>
<text v-else>选择平台</text>
</view>
</template>
</nut-form-item>
<nut-form-item label-position="top">
<template v-slot:label>套餐</template>
<template v-slot:default>
<view style="color: black;" @click="visibleCombosPopup = true">
<text v-if="item.combo_name">{{item.combo_name}}</text>
<text v-else>选择套餐</text>
</view>
</template>
</nut-form-item>
<nut-form-item label-position="top">
<template v-slot:label>售价</template>
<template v-slot:default>
<view style="color: black;">
<text>{{item.combo_price}}</text>
</view>
</template>
</nut-form-item>
</view>
<view class="form-row">
<nut-form-item label-position="top">
<template v-slot:label>支付状态</template>
<template v-slot:default>
<view style="color: black;" @click="openPayStatusPopup('combo',index)">
<text>{{item.combo_pay_status_txt}}</text>
</view>
</template>
</nut-form-item>
<nut-form-item label-position="top">
<template v-slot:label> </template>
<template v-slot:default>
<view>
<nut-button type="danger" size="mini" @click="removeCombos(index)">删除套餐</nut-button>
</view>
</template>
</nut-form-item>
</view>
</view>
<!-- 台费类型套餐支付状态 三者在同一行布局 -->
<!-- <view class="inline-form" v-for="(item, index) in orderCombos" :key="index"> -->
<!-- 台费类型选择 -->
<!-- <nut-form-item label-position="top">
<template v-slot:label>套餐平台</template>
<template v-slot:default>
<view style="color: black;" @click="visibleComboTypePopup = true">
<text>{{form.combo_type_name}}</text>
</view>
</template>
</nut-form-item> -->
<!-- 套餐选择 -->
<nut-form-item label-position="top" v-if="form.fee_type === 1 || form.fee_type === 2">
<!-- <nut-form-item label-position="top" v-if="form.fee_type === 1 || form.fee_type === 2">
<template v-slot:label>选择团购</template>
<template v-slot:default>
<view style="color: black;" @click="visibleCombosPopup = true">
<text>{{form.fee_combo_name}}</text>
</view>
</template>
</nut-form-item>
</nut-form-item> -->
<!-- 金额输入框 -->
<nut-form-item label-position="top" v-else>
<!-- <nut-form-item label-position="top" v-else>
<template v-slot:label>线下收款</template>
<template v-slot:default>
<nut-input v-model="form.fee_amount" placeholder="请输入金额" type="number" />
</template>
</nut-form-item> -->
<!-- 支付状态选择 -->
<!-- <nut-form-item label-position="top">
<template v-slot:label>支付状态</template>
<template v-slot:default>
<view style="color: black;" @click="openPayStatusPopup('fee')">
<text>{{form.fee_pay_status_txt}}</text>
</view>
</template>
</nut-form-item>
</view> -->
<view class="top-bar">
<nut-button type="primary" plain size="small" @click="addCombos">新增套餐</nut-button>
</view>
</nut-form>
<nut-form v-else>
<view class="inline-form">
<nut-form-item label-position="top">
<template v-slot:label>线下收款</template>
<template v-slot:default>
<nut-input v-model="form.fee_amount" placeholder="请输入金额" type="number" />
</template>
</nut-form-item>
<!-- 支付状态选择 -->
<nut-form-item label-position="top">
<template v-slot:label>支付状态</template>
<template v-slot:default>
@@ -53,15 +131,49 @@
</nut-form>
<view class="title" v-if="form.fee_type==1 || form.fee_type==2 ">超时收费 </view>
<nut-form v-if="form.fee_type==1 || form.fee_type==2 ">
<!-- 台费类型套餐支付状态 三者在同一行布局 -->
<view class="inline-form">
<!-- <view class="inline-form"> -->
<!-- 台费类型选择 -->
<!-- <nut-form-item label-position="top">
<template v-slot:label>结算方式</template>
<template v-slot:default>
<view style="color: black;" @click="visibleFeeTypePopup = true">
<text>{{form.fee_type_name}}</text>
</view>
</template>
</nut-form-item> -->
<!-- 套餐选择 -->
<!-- <nut-form-item label-position="top" v-if="form.fee_type === 1 || form.fee_type === 2">
<template v-slot:label>选择团购</template>
<template v-slot:default>
<view style="color: black;" @click="visibleCombosPopup = true">
<text>{{form.fee_combo_name}}</text>
</view>
</template>
</nut-form-item> -->
<!-- 金额输入框 -->
<!-- <nut-form-item label-position="top" v-else>
<template v-slot:label>线下收款</template>
<template v-slot:default>
<nut-input v-model="form.fee_amount" placeholder="请输入金额" type="number" />
</template>
</nut-form-item> -->
<!-- 支付状态选择 -->
<!-- <nut-form-item label-position="top">
<template v-slot:label>支付状态</template>
<template v-slot:default>
<view style="color: black;" @click="openPayStatusPopup('fee')">
<text>{{form.fee_pay_status_txt}}</text>
</view>
</template>
</nut-form-item>
</view> -->
<view class="title" v-if="form.fee_type==1">超时收费</view>
<nut-form v-if="form.fee_type==1 ">
<view class="inline-form">
<nut-form-item label-position="top">
<template v-slot:label>时长(小时)</template>
<template v-slot:default>
@@ -69,7 +181,6 @@
</template>
</nut-form-item>
<!-- 金额输入框 -->
<nut-form-item label-position="top">
<template v-slot:label>超时金额</template>
<template v-slot:default>
@@ -77,7 +188,6 @@
</template>
</nut-form-item>
<!-- 支付状态选择 -->
<nut-form-item label-position="top">
<template v-slot:label>支付状态</template>
<template v-slot:default>
@@ -182,10 +292,12 @@
title="选择团购套餐" @confirm="onConfirmCombos" @cancel="visibleCombosPopup = false">
</nut-picker>
</nut-popup>
<!-- v-model="popupFeeTypeVal" -->
<nut-popup v-model:visible="visibleFeeTypePopup" position="bottom" safe-area-inset-bottom>
<nut-picker :columns="feeTypes" :field-names="{text:'label',value:'value'}" title="选择结算方式"
@confirm="onConfirmFeeType" @cancel="visibleFeeTypePopup = false">
<nut-popup v-model:visible="visibleComboTypePopup" position="bottom" safe-area-inset-bottom>
<nut-picker :columns="comboTypes" :field-names="{text:'label',value:'value'}" title="选择套餐平台"
@confirm="onConfirmComboType" @cancel="visibleComboTypePopup = false">
</nut-picker>
</nut-popup>
@@ -228,13 +340,42 @@
})
// 选择房间弹窗
const visibleFeeTypePopup = ref(false);
// 台费结算类型
// const popupFeeTypeVal = ref([])
// 台费类型选择列表
const feeTypes = [{
// 订单套餐
const orderCombos = ref([
// {
// combo_type_name: null,
// combo_type_id: null,
// combo_name: null,
// goods_id: null,
// goods_price: null,
// goods_pay_status: 0,
// goods_pay_status_txt: "请选择",
// cascader_val: []
// },
])
// 新增套餐
const addCombos = () => {
console.log(orderCombos.value);
orderCombos.value.push({
combo_type_name: null,
combo_type_id: null,
combo_id: null,
combo_name: null,
combo_price: null,
combo_pay_status: 0,
combo_pay_status_txt: "请选择",
// goods_price: null,
// cascader_val: []
})
}
// 删除套餐
const removeCombos = (index) => {
orderCombos.value.splice(index, 1)
}
// 选择套餐平台弹窗
const visibleComboTypePopup = ref(false);
// 套餐平台
const comboTypes = [{
value: 1,
label: '美团'
},
@@ -242,24 +383,19 @@
value: 2,
label: '抖音'
},
{
value: 3,
label: '线下'
}
];
// 选择房间
const onConfirmFeeType = (selectedValue) => {
// 选择套餐平台
const onConfirmComboType = (selectedValue) => {
console.log(selectedValue);
form.fee_type_name = selectedValue.selectedOptions[0].label
form.fee_type = selectedValue.selectedOptions[0].value
console.log(form);
if (form.fee_type !== 3) {
getCombos();
visibleComboTypePopup.value = false // 关闭选择套餐弹窗
}
visibleFeeTypePopup.value = false
}
const getCombos = () => {
console.log("获取套餐");
@@ -432,12 +568,15 @@
const form = reactive({
order_type: 1, // 开台订单
room_id: 0,
fee_type: 0,
fee_type_name: '请选择',
fee_combo_id: 0, // 套餐ID
fee_combo_name: '请选择', // 套餐名称
fee_combo_price: null,
room_id: 0, // 房间ID
fee_type: "1", // 默认是团购
// fee_combo_id: 0, // 套餐ID
// fee_combo_name: '请选择', // 套餐名称
// fee_combo_price: null,
fee_amount: null, // 线下支付费用
fee_pay_status: 0, // 费用支付状态
fee_pay_status_txt: '请选择', // 费用支付状态
@@ -454,6 +593,7 @@
// 商品列表
const selectGoods = ref([])
onMounted(() => {
fetchGoods().then(res => {
selectGoods.value = res;
@@ -470,21 +610,21 @@
}
console.log('提交的订单数据:', data);
// console.log('提交的订单数据:', form);
fetchAddOrder(data).then(res => {
console.log(res);
uni.showToast({
icon: 'none',
title: '开台成功'
})
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
});
// uni.navigateBack({
// delta: 1 // 返回上一页
// fetchAddOrder(data).then(res => {
// console.log(res);
// uni.showToast({
// icon: 'none',
// title: '开台成功'
// })
// setTimeout(() => {
// uni.switchTab({
// url: '/pages/index/index'
// });
}, 500)
})
// // uni.navigateBack({
// // delta: 1 // 返回上一页
// // });
// }, 500)
// })
};
</script>
@@ -525,6 +665,8 @@
// z-index: 999;
}
.inline-combo-form {}
/* 每个商品项容器 */
.inline-goods-form {
// box-sizing: border-box;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7440,7 +7440,7 @@ function isConsoleWritable() {
function initRuntimeSocketService() {
const hosts = "127.0.0.1,192.168.31.5,198.18.0.1";
const port = "8090";
const id = "mp-weixin_tqTix_";
const id = "mp-weixin_EY0X_V";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();
@@ -8422,6 +8422,7 @@ exports.p = p;
exports.provide = provide;
exports.r = r;
exports.reactive = reactive;
exports.readonly = readonly;
exports.ref = ref;
exports.resolveComponent = resolveComponent;
exports.s = s;

View File

@@ -2,38 +2,71 @@
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
if (!Array) {
const _easycom_nut_radio2 = common_vendor.resolveComponent("nut-radio");
const _easycom_nut_radio_group2 = common_vendor.resolveComponent("nut-radio-group");
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
const _easycom_nut_textarea2 = common_vendor.resolveComponent("nut-textarea");
const _easycom_nut_cascader2 = common_vendor.resolveComponent("nut-cascader");
const _easycom_nut_picker2 = common_vendor.resolveComponent("nut-picker");
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
(_easycom_nut_form_item2 + _easycom_nut_input2 + _easycom_nut_form2 + _easycom_nut_button2 + _easycom_nut_textarea2 + _easycom_nut_cascader2 + _easycom_nut_picker2 + _easycom_nut_popup2)();
(_easycom_nut_radio2 + _easycom_nut_radio_group2 + _easycom_nut_form_item2 + _easycom_nut_form2 + _easycom_nut_button2 + _easycom_nut_input2 + _easycom_nut_textarea2 + _easycom_nut_cascader2 + _easycom_nut_picker2 + _easycom_nut_popup2)();
}
const _easycom_nut_radio = () => "../../uni_modules/nutui-uni/components/radio/radio.js";
const _easycom_nut_radio_group = () => "../../uni_modules/nutui-uni/components/radiogroup/radiogroup.js";
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
const _easycom_nut_textarea = () => "../../uni_modules/nutui-uni/components/textarea/textarea.js";
const _easycom_nut_cascader = () => "../../uni_modules/nutui-uni/components/cascader/cascader.js";
const _easycom_nut_picker = () => "../../uni_modules/nutui-uni/components/picker/picker.js";
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
if (!Math) {
(_easycom_nut_form_item + _easycom_nut_input + _easycom_nut_form + _easycom_nut_button + _easycom_nut_textarea + _easycom_nut_cascader + _easycom_nut_picker + _easycom_nut_popup)();
(_easycom_nut_radio + _easycom_nut_radio_group + _easycom_nut_form_item + _easycom_nut_form + _easycom_nut_button + _easycom_nut_input + _easycom_nut_textarea + _easycom_nut_cascader + _easycom_nut_picker + _easycom_nut_popup)();
}
const _sfc_main = {
__name: "orderAdd",
setup(__props) {
common_vendor.onLoad((options) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:223", "onLoad");
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:335", "onLoad");
form.room_id = options.roomId;
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:226", form);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:227", options);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:338", form);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:339", options);
});
const visibleFeeTypePopup = common_vendor.ref(false);
const feeTypes = [
const orderCombos = common_vendor.ref([
// {
// combo_type_name: null,
// combo_type_id: null,
// combo_name: null,
// goods_id: null,
// goods_price: null,
// goods_pay_status: 0,
// goods_pay_status_txt: "请选择",
// cascader_val: []
// },
]);
const addCombos = () => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:358", orderCombos.value);
orderCombos.value.push({
combo_type_name: null,
combo_type_id: null,
combo_id: null,
combo_name: null,
combo_price: null,
combo_pay_status: 0,
combo_pay_status_txt: "请选择"
// goods_price: null,
// cascader_val: []
});
};
const removeCombos = (index) => {
orderCombos.value.splice(index, 1);
};
const visibleComboTypePopup = common_vendor.ref(false);
const comboTypes = [
{
value: 1,
label: "美团"
@@ -41,28 +74,22 @@ const _sfc_main = {
{
value: 2,
label: "抖音"
},
{
value: 3,
label: "线下"
}
];
const onConfirmFeeType = (selectedValue) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:254", selectedValue);
const onConfirmComboType = (selectedValue) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:389", selectedValue);
form.fee_type_name = selectedValue.selectedOptions[0].label;
form.fee_type = selectedValue.selectedOptions[0].value;
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:257", form);
if (form.fee_type !== 3) {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:392", form);
getCombos();
}
visibleFeeTypePopup.value = false;
visibleComboTypePopup.value = false;
};
const getCombos = () => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:265", "获取套餐");
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:401", "获取套餐");
api_index.fetchCombos({
type: form.fee_type
}).then((res) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:269", res);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:405", res);
combos.value = res;
});
};
@@ -70,11 +97,11 @@ const _sfc_main = {
const popupCombosVal = common_vendor.ref([]);
const combos = common_vendor.ref([]);
const onConfirmCombos = (selectedValue) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:284", "selectedValue", selectedValue);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:420", "selectedValue", selectedValue);
form.fee_combo_name = selectedValue.selectedOptions[0].label;
form.fee_combo_id = selectedValue.selectedOptions[0].value;
form.fee_combo_price = selectedValue.selectedOptions[0].combo_price;
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:288", form);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:424", form);
visibleCombosPopup.value = false;
};
const visiblePaymentStatusPopup = common_vendor.ref(false);
@@ -98,7 +125,7 @@ const _sfc_main = {
popupPaymentTypeVal.value = type;
goodsPayIndex.value = index;
visiblePaymentStatusPopup.value = true;
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:316", type);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:452", type);
};
const onConfirmPaymentStatus = (selectedValue) => {
if (popupPaymentTypeVal.value == "fee") {
@@ -110,11 +137,11 @@ const _sfc_main = {
form.over_pay_status = selectedValue.selectedOptions[0].value;
}
if (popupPaymentTypeVal.value == "goods" && goodsPayIndex.value >= 0) {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:330", "处理商品支付状态", goodsPayIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:466", "处理商品支付状态", goodsPayIndex.value);
orderGoods.value[goodsPayIndex.value].goods_pay_status_txt = selectedValue.selectedOptions[0].label;
orderGoods.value[goodsPayIndex.value].goods_pay_status = selectedValue.selectedOptions[0].value;
}
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:334", form);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:470", form);
visiblePaymentStatusPopup.value = false;
popupPaymentTypeVal.value = "";
goodsPayIndex.value = -1;
@@ -134,7 +161,7 @@ const _sfc_main = {
const goodsPayIndex = common_vendor.ref(0);
const goodsIndex = common_vendor.ref(0);
const addGoods = () => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:361", orderGoods.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:497", orderGoods.value);
orderGoods.value.push({
goods_type_name: null,
goods_type_id: null,
@@ -160,12 +187,12 @@ const _sfc_main = {
}
});
const onGoodsChange = (...args) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:389", "onGoodsChange", args);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:525", "onGoodsChange", args);
};
const onGoodsPathChange = (args) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:393", "onGoodsPathChange", args);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:394", "goodsIndex", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:395", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:529", "onGoodsPathChange", args);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:530", "goodsIndex", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:531", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
orderGoods.value[goodsIndex.value].goods_type_name = null;
orderGoods.value[goodsIndex.value].goods_type_id = null;
orderGoods.value[goodsIndex.value].goods_name = null;
@@ -180,11 +207,11 @@ const _sfc_main = {
orderGoods.value[goodsIndex.value].goods_id = args[1].value;
orderGoods.value[goodsIndex.value].goods_price = args[1].goods_price;
}
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:411", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:547", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
};
const onCloseGoodsCascader = () => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:414", "onCloseGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:415", "goodsIndex.value", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:550", "onCloseGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:551", "goodsIndex.value", goodsIndex.value);
if (orderGoods.value[goodsIndex.value].goods_type_id && orderGoods.value[goodsIndex.value].goods_id) {
orderGoods.value[goodsIndex.value].cascader_val = [
orderGoods.value[goodsIndex.value].goods_type_id,
@@ -192,23 +219,22 @@ const _sfc_main = {
];
}
goodsIndex.value = 0;
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:423", "goodsIndex.value", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:559", "goodsIndex.value", goodsIndex.value);
};
const onOpenGoodsCascader = () => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:426", "onOpenGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:427", "goodsIndex.value", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:562", "onOpenGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:563", "goodsIndex.value", goodsIndex.value);
};
const form = common_vendor.reactive({
order_type: 1,
// 开台订单
room_id: 0,
fee_type: 0,
fee_type_name: "请选择",
fee_combo_id: 0,
// 套餐ID
fee_combo_name: "请选择",
// 套餐名称
fee_combo_price: null,
// 房间ID
fee_type: "1",
// 默认是团购
// fee_combo_id: 0, // 套餐ID
// fee_combo_name: '请选择', // 套餐名称
// fee_combo_price: null,
fee_amount: null,
// 线下支付费用
fee_pay_status: 0,
@@ -238,79 +264,121 @@ const _sfc_main = {
order_goods: orderGoods.value,
order: form
};
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:471", "提交的订单数据:", data);
api_index.fetchAddOrder(data).then((res) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:474", res);
common_vendor.index.showToast({
icon: "none",
title: "开台成功"
});
setTimeout(() => {
common_vendor.index.switchTab({
url: "/pages/index/index"
});
}, 500);
});
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:611", "提交的订单数据:", data);
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(form.fee_type_name),
b: common_vendor.o(($event) => visibleFeeTypePopup.value = true),
c: common_vendor.p({
a: common_vendor.p({
label: "1"
}),
b: common_vendor.p({
label: "2"
}),
c: common_vendor.o(($event) => form.fee_type = $event),
d: common_vendor.p({
direction: "horizontal",
modelValue: form.fee_type
}),
e: common_vendor.p({
label: "结算方式"
}),
f: form.fee_type == 1
}, form.fee_type == 1 ? {
g: common_vendor.f(orderCombos.value, (item, index, i0) => {
return common_vendor.e({
a: item.combo_type_name
}, item.combo_type_name ? {
b: common_vendor.t(item.combo_type_name)
} : {}, {
c: common_vendor.o(($event) => visibleComboTypePopup.value = true, index),
d: "528154d3-6-" + i0 + ",528154d3-5",
e: item.combo_name
}, item.combo_name ? {
f: common_vendor.t(item.combo_name)
} : {}, {
g: common_vendor.o(($event) => visibleCombosPopup.value = true, index),
h: "528154d3-7-" + i0 + ",528154d3-5",
i: common_vendor.t(item.combo_price),
j: "528154d3-8-" + i0 + ",528154d3-5",
k: common_vendor.t(item.combo_pay_status_txt),
l: common_vendor.o(($event) => openPayStatusPopup("combo", index), index),
m: "528154d3-9-" + i0 + ",528154d3-5",
n: common_vendor.o(($event) => removeCombos(index), index),
o: "528154d3-11-" + i0 + "," + ("528154d3-10-" + i0),
p: "528154d3-10-" + i0 + ",528154d3-5",
q: index
});
}),
h: common_vendor.p({
["label-position"]: "top"
}),
d: form.fee_type === 1 || form.fee_type === 2
}, form.fee_type === 1 || form.fee_type === 2 ? {
e: common_vendor.t(form.fee_combo_name),
f: common_vendor.o(($event) => visibleCombosPopup.value = true),
g: common_vendor.p({
i: common_vendor.p({
["label-position"]: "top"
}),
j: common_vendor.p({
["label-position"]: "top"
}),
k: common_vendor.p({
["label-position"]: "top"
}),
l: common_vendor.p({
type: "danger",
size: "mini"
}),
m: common_vendor.p({
["label-position"]: "top"
}),
n: common_vendor.o(addCombos),
o: common_vendor.p({
type: "primary",
plain: true,
size: "small"
})
} : {
h: common_vendor.o(($event) => form.fee_amount = $event),
i: common_vendor.p({
p: common_vendor.o(($event) => form.fee_amount = $event),
q: common_vendor.p({
placeholder: "请输入金额",
type: "number",
modelValue: form.fee_amount
}),
j: common_vendor.p({
r: common_vendor.p({
["label-position"]: "top"
}),
s: common_vendor.t(form.fee_pay_status_txt),
t: common_vendor.o(($event) => openPayStatusPopup("fee")),
v: common_vendor.p({
["label-position"]: "top"
})
}, {
k: common_vendor.t(form.fee_pay_status_txt),
l: common_vendor.o(($event) => openPayStatusPopup("fee")),
m: common_vendor.p({
["label-position"]: "top"
}),
n: form.fee_type == 1 || form.fee_type == 2
}, form.fee_type == 1 || form.fee_type == 2 ? {} : {}, {
o: form.fee_type == 1 || form.fee_type == 2
}, form.fee_type == 1 || form.fee_type == 2 ? {
p: common_vendor.o(($event) => form.over_often = $event),
q: common_vendor.p({
w: form.fee_type == 1
}, form.fee_type == 1 ? {} : {}, {
x: form.fee_type == 1
}, form.fee_type == 1 ? {
y: common_vendor.o(($event) => form.over_often = $event),
z: common_vendor.p({
placeholder: "请输入小时",
type: "number",
modelValue: form.over_often
}),
r: common_vendor.p({
A: common_vendor.p({
["label-position"]: "top"
}),
s: common_vendor.o(($event) => form.over_amount = $event),
t: common_vendor.p({
B: common_vendor.o(($event) => form.over_amount = $event),
C: common_vendor.p({
placeholder: "请输入金额",
type: "number",
modelValue: form.over_amount
}),
v: common_vendor.p({
D: common_vendor.p({
["label-position"]: "top"
}),
w: common_vendor.t(form.over_pay_status_txt),
x: common_vendor.o(($event) => openPayStatusPopup("over")),
y: common_vendor.p({
E: common_vendor.t(form.over_pay_status_txt),
F: common_vendor.o(($event) => openPayStatusPopup("over")),
G: common_vendor.p({
["label-position"]: "top"
})
} : {}, {
z: common_vendor.f(orderGoods.value, (item, index, i0) => {
H: common_vendor.f(orderGoods.value, (item, index, i0) => {
return common_vendor.e({
a: item.goods_type_name && item.goods_name
}, item.goods_type_name && item.goods_name ? {
@@ -321,67 +389,67 @@ const _sfc_main = {
visibleGoodsCascader.value = true;
goodsIndex.value = index;
}, index),
e: "528154d3-13-" + i0 + ",528154d3-12",
e: "528154d3-24-" + i0 + ",528154d3-23",
f: common_vendor.t(item.goods_price),
g: "528154d3-14-" + i0 + ",528154d3-12",
g: "528154d3-25-" + i0 + ",528154d3-23",
h: common_vendor.t(item.goods_pay_status_txt),
i: common_vendor.o(($event) => openPayStatusPopup("goods", index), index),
j: "528154d3-15-" + i0 + ",528154d3-12",
j: "528154d3-26-" + i0 + ",528154d3-23",
k: common_vendor.o(($event) => removeGoods(index), index),
l: "528154d3-17-" + i0 + "," + ("528154d3-16-" + i0),
m: "528154d3-16-" + i0 + ",528154d3-12",
l: "528154d3-28-" + i0 + "," + ("528154d3-27-" + i0),
m: "528154d3-27-" + i0 + ",528154d3-23",
n: index
});
}),
A: common_vendor.p({
I: common_vendor.p({
["label-position"]: "top"
}),
B: common_vendor.p({
J: common_vendor.p({
["label-position"]: "top"
}),
C: common_vendor.p({
K: common_vendor.p({
["label-position"]: "top"
}),
D: common_vendor.p({
L: common_vendor.p({
type: "danger",
size: "mini"
}),
E: common_vendor.p({
M: common_vendor.p({
["label-position"]: "top"
}),
F: common_vendor.o(addGoods),
G: common_vendor.p({
N: common_vendor.o(addGoods),
O: common_vendor.p({
type: "primary",
plain: true,
size: "small"
}),
H: common_vendor.o(($event) => form.discount_amount = $event),
I: common_vendor.p({
P: common_vendor.o(($event) => form.discount_amount = $event),
Q: common_vendor.p({
placeholder: "请输入金额",
type: "number",
modelValue: form.discount_amount
}),
J: common_vendor.o(($event) => form.remarks = $event),
K: common_vendor.p({
R: common_vendor.o(($event) => form.remarks = $event),
S: common_vendor.p({
rows: 3,
placeholder: "请输入备注",
modelValue: form.remarks
}),
L: common_vendor.p({
T: common_vendor.p({
label: "备注"
}),
M: common_vendor.o(submitForm),
N: common_vendor.p({
U: common_vendor.o(submitForm),
V: common_vendor.p({
type: "primary",
block: true
}),
O: common_vendor.o(onGoodsChange),
P: common_vendor.o(onGoodsPathChange),
Q: common_vendor.o(onOpenGoodsCascader),
R: common_vendor.o(onCloseGoodsCascader),
S: common_vendor.o(($event) => visibleGoodsCascader.value = $event),
T: common_vendor.o(($event) => cascaderGoodsValue.value = $event),
U: common_vendor.p({
W: common_vendor.o(onGoodsChange),
X: common_vendor.o(onGoodsPathChange),
Y: common_vendor.o(onOpenGoodsCascader),
Z: common_vendor.o(onCloseGoodsCascader),
aa: common_vendor.o(($event) => visibleGoodsCascader.value = $event),
ab: common_vendor.o(($event) => cascaderGoodsValue.value = $event),
ac: common_vendor.p({
title: "商品选择",
["text-key"]: "label",
["value-key"]: "value",
@@ -391,9 +459,9 @@ const _sfc_main = {
visible: visibleGoodsCascader.value,
modelValue: cascaderGoodsValue.value
}),
V: common_vendor.o(onConfirmPaymentStatus),
W: common_vendor.o(($event) => visiblePaymentStatusPopup.value = false),
X: common_vendor.p({
ad: common_vendor.o(onConfirmPaymentStatus),
ae: common_vendor.o(($event) => visiblePaymentStatusPopup.value = false),
af: common_vendor.p({
columns: paymentStatuses,
["field-names"]: {
text: "label",
@@ -401,16 +469,16 @@ const _sfc_main = {
},
title: "选择支付状态"
}),
Y: common_vendor.o(($event) => visiblePaymentStatusPopup.value = $event),
Z: common_vendor.p({
ag: common_vendor.o(($event) => visiblePaymentStatusPopup.value = $event),
ah: common_vendor.p({
position: "bottom",
["safe-area-inset-bottom"]: true,
visible: visiblePaymentStatusPopup.value
}),
aa: common_vendor.o(onConfirmCombos),
ab: common_vendor.o(($event) => visibleCombosPopup.value = false),
ac: common_vendor.o(($event) => popupCombosVal.value = $event),
ad: common_vendor.p({
ai: common_vendor.o(onConfirmCombos),
aj: common_vendor.o(($event) => visibleCombosPopup.value = false),
ak: common_vendor.o(($event) => popupCombosVal.value = $event),
al: common_vendor.p({
columns: combos.value,
["field-names"]: {
text: "label",
@@ -419,27 +487,27 @@ const _sfc_main = {
title: "选择团购套餐",
modelValue: popupCombosVal.value
}),
ae: common_vendor.o(($event) => visibleCombosPopup.value = $event),
af: common_vendor.p({
am: common_vendor.o(($event) => visibleCombosPopup.value = $event),
an: common_vendor.p({
position: "bottom",
["safe-area-inset-bottom"]: true,
visible: visibleCombosPopup.value
}),
ag: common_vendor.o(onConfirmFeeType),
ah: common_vendor.o(($event) => visibleFeeTypePopup.value = false),
ai: common_vendor.p({
columns: feeTypes,
ao: common_vendor.o(onConfirmComboType),
ap: common_vendor.o(($event) => visibleComboTypePopup.value = false),
aq: common_vendor.p({
columns: comboTypes,
["field-names"]: {
text: "label",
value: "value"
},
title: "选择结算方式"
title: "选择套餐平台"
}),
aj: common_vendor.o(($event) => visibleFeeTypePopup.value = $event),
ak: common_vendor.p({
ar: common_vendor.o(($event) => visibleComboTypePopup.value = $event),
as: common_vendor.p({
position: "bottom",
["safe-area-inset-bottom"]: true,
visible: visibleFeeTypePopup.value
visible: visibleComboTypePopup.value
})
});
};

View File

@@ -2,10 +2,12 @@
"navigationBarTitleText": "开台",
"enablePullDownRefresh": false,
"usingComponents": {
"nut-radio": "../../uni_modules/nutui-uni/components/radio/radio",
"nut-radio-group": "../../uni_modules/nutui-uni/components/radiogroup/radiogroup",
"nut-form-item": "../../uni_modules/nutui-uni/components/formitem/formitem",
"nut-input": "../../uni_modules/nutui-uni/components/input/input",
"nut-form": "../../uni_modules/nutui-uni/components/form/form",
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
"nut-input": "../../uni_modules/nutui-uni/components/input/input",
"nut-textarea": "../../uni_modules/nutui-uni/components/textarea/textarea",
"nut-cascader": "../../uni_modules/nutui-uni/components/cascader/cascader",
"nut-picker": "../../uni_modules/nutui-uni/components/picker/picker",

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,34 @@
"use strict";
require("../../../../common/vendor.js");
require("../_utils/env.js");
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
const radioProps = {
...uni_modules_nutuiUni_components__utils_props.commonProps,
/**
* @description 是否禁用选择
*/
disabled: uni_modules_nutuiUni_components__utils_props.nullableBooleanProp,
/**
* @description 图标尺寸
*/
iconSize: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
/**
* @description 单选框标识
*/
label: {
type: [String, Number, Boolean],
default: ""
},
/**
* @description 形状,可选值为 button、round
*/
shape: uni_modules_nutuiUni_components__utils_props.makeStringProp("round"),
/**
* @description 尺寸,可选值为 `large` `small` `mini` `normal`,仅在 shape 为 `button` 时生效
*/
size: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal")
};
const RADIO_KEY = Symbol("nut-radio");
exports.RADIO_KEY = RADIO_KEY;
exports.radioProps = radioProps;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/radio/index.js.map

View File

@@ -0,0 +1,108 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
const uni_modules_nutuiUni_components__hooks_useInject = require("../_hooks/useInject.js");
require("../_utils/env.js");
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
const form = require("../../../../form.js");
const uni_modules_nutuiUni_components_radio_index = require("./index.js");
if (!Math) {
NutIcon();
}
const NutIcon = () => "../icon/icon.js";
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-radio`;
const __default__ = common_vendor.defineComponent({
name: componentName,
options: {
virtualHost: true,
addGlobalClass: true,
styleIsolation: "shared"
}
});
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
...__default__,
props: uni_modules_nutuiUni_components_radio_index.radioProps,
setup(__props) {
const props = __props;
const { parent } = uni_modules_nutuiUni_components__hooks_useInject.useInject(uni_modules_nutuiUni_components_radio_index.RADIO_KEY);
const disabled = form.useFormDisabled(common_vendor.toRef(props, "disabled"));
const reverseState = common_vendor.computed(() => parent.position.value === "left");
const classes = common_vendor.computed(() => {
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
[`${componentName}--reverse`]: reverseState.value,
[`${componentName}--${props.shape}`]: true
});
});
function handleClick() {
if (isCurValue.value || disabled.value)
return;
parent.updateValue(props.label);
}
const isCurValue = common_vendor.computed(() => {
return parent.label.value === props.label;
});
const color = common_vendor.computed(() => {
return !disabled.value ? isCurValue.value ? "nut-radio__icon" : "nut-radio__icon--unchecked" : "nut-radio__icon--disable";
});
const getButtonClass = common_vendor.computed(() => {
return `${componentName}__button ${componentName}__button--${props.size} ${isCurValue.value && `${componentName}__button--active`} ${disabled.value ? `${componentName}__button--disabled` : ""}`;
});
const getLabelClass = common_vendor.computed(() => {
return `${componentName}__label ${disabled.value ? `${componentName}__label--disabled` : ""}`;
});
return (_ctx, _cache) => {
return common_vendor.e({
a: _ctx.shape === "button"
}, _ctx.shape === "button" ? {
b: common_vendor.n(getButtonClass.value)
} : reverseState.value ? common_vendor.e({
d: common_vendor.n(getLabelClass.value),
e: !isCurValue.value
}, !isCurValue.value ? {
f: common_vendor.p({
name: "check-normal",
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
["pop-class"]: color.value
})
} : {
g: common_vendor.p({
name: "check-checked",
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
["pop-class"]: color.value
})
}) : common_vendor.e({
h: !isCurValue.value
}, !isCurValue.value ? {
i: common_vendor.p({
name: "check-normal",
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
["pop-class"]: color.value
})
} : {
j: common_vendor.p({
name: "check-checked",
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
["pop-class"]: color.value
})
}, {
k: common_vendor.n(getLabelClass.value)
}), {
c: reverseState.value,
l: common_vendor.n(classes.value),
m: common_vendor.s(_ctx.customStyle),
n: common_vendor.o(handleClick)
});
};
}
});
wx.createComponent(_sfc_main);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/radio/radio.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"nut-icon": "../icon/icon"
}
}

View File

@@ -0,0 +1 @@
<view class="{{l}}" style="{{m}}" bindtap="{{n}}"><view wx:if="{{a}}" class="{{b}}"><slot/></view><block wx:elif="{{c}}"><view class="{{d}}"><slot/></view><block wx:if="{{e}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><nut-icon wx:if="{{f}}" u-i="ad85ac80-0" bind:__l="__l" u-p="{{f}}"/></block></block><block wx:else><block wx:if="{{$slots.checkedIcon}}"><slot name="checkedIcon"></slot></block><block wx:else><nut-icon wx:if="{{g}}" u-i="ad85ac80-1" bind:__l="__l" u-p="{{g}}"/></block></block></block><block wx:else><block wx:if="{{h}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><nut-icon wx:if="{{i}}" u-i="ad85ac80-2" bind:__l="__l" u-p="{{i}}"/></block></block><block wx:else><block wx:if="{{$slots.checkedIcon}}"><slot name="checkedIcon"></slot></block><block wx:else><nut-icon wx:if="{{j}}" u-i="ad85ac80-3" bind:__l="__l" u-p="{{j}}"/></block></block><view class="{{k}}"><slot/></view></block></view>

View File

@@ -0,0 +1,159 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.nut-radio-group {
display: inline-block;
}
.nut-radio-group .nut-radio {
margin-bottom: 5px;
}
.nut-radio-group--horizontal .nut-radio {
display: inline-flex !important;
margin-right: 10px !important;
}
.nut-radio-group--horizontal .nut-radio--round .nut-radio__label {
margin: 0 6px !important;
}
.nut-theme-dark .nut-radio__label {
color: var(--nut-dark-color, var(--nut-white, #fff));
}
.nut-theme-dark .nut-radio__label--disabled {
color: var(--nut-radio-label-disable-color, #999);
}
.nut-theme-dark .nut-radio__button {
color: var(--nut-dark-color, var(--nut-white, #fff));
background: var(--nut-dark-background, #131313);
}
.nut-theme-dark .nut-radio__button--disabled {
color: var(--nut-radio-label-disable-color, #999);
border: 1px solid var(--nut-radio-label-disable-color, #999);
}
.nut-radio {
display: flex;
flex-shrink: 0;
align-items: center;
}
.nut-radio:last-child {
margin-right: 0 !important;
margin-bottom: 0 !important;
}
.nut-radio--reverse .nut-radio__label {
margin-right: var(--nut-radio-label-margin-left, 15px);
margin-left: 0;
}
.nut-radio__button {
box-sizing: border-box;
display: inline-flex;
align-items: center;
padding: var(--nut-radio-button-padding, 5px 18px);
font-size: var(--nut-radio-button-font-size, 12px);
color: var(--nut-radio-label-font-color, #1d1e1e);
background: #f6f7f9;
border: 1px solid #f6f7f9;
border-radius: var(--nut-radio-button-border-radius, 15px);
}
.nut-radio__button--active {
position: relative;
color: var(--nut-radio-label-font-active-color, var(--nut-primary-color, #fa2c19));
background: transparent;
border: 1px solid var(--nut-radio-label-button-border-color, var(--nut-primary-color, #fa2c19));
}
.nut-radio__button--active::after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: "";
background-color: var(--nut-radio-label-button-background, var(--nut-primary-color, #fa2c19));
border-radius: var(--nut-radio-button-border-radius, 15px);
opacity: 0.05;
}
.nut-radio__button--disabled {
color: var(--nut-radio-label-disable-color, #999);
border: none;
}
.nut-radio__button--large {
height: var(--nut-button-large-height, 48px);
font-size: var(--nut-button-large-font-size, var(--nut-button-default-font-size, var(--nut-font-size-2, 14px)));
line-height: var(--nut-button-large-line-height, 46px);
}
.nut-radio__button--small {
height: var(--nut-button-small-height, 28px);
padding: var(--nut-button-small-padding, 0 12px);
font-size: var(--nut-button-small-font-size, var(--nut-font-size-1, 12px));
line-height: var(--nut-button-small-line-height, 26px);
}
.nut-radio__button--mini {
height: var(--nut-button-mini-height, 24px);
padding: var(--nut-button-mini-padding, 0 12px);
font-size: var(--nut-button-mini-font-size, var(--nut-font-size-1, 12px));
line-height: var(--nut-button-mini-line-height, 1.2);
}
.nut-radio__label {
flex: 1;
margin-left: var(--nut-radio-label-margin-left, 15px);
font-size: var(--nut-radio-label-font-size, 14px);
color: var(--nut-radio-label-font-color, #1d1e1e);
}
.nut-radio__label--disabled {
color: var(--nut-radio-label-disable-color, #999);
}
.nut-radio__icon {
color: var(--nut-radio-label-font-active-color, var(--nut-primary-color, #fa2c19));
transition-duration: 0.3s;
transition-property: color, border-color, background-color;
}
.nut-radio__icon--unchecked {
color: var(--nut-radio-icon-disable-color, #d6d6d6);
}
.nut-radio__icon--disable {
color: var(--nut-radio-icon-disable-color2, var(--nut-help-color, #f5f5f5));
}

View File

@@ -0,0 +1,73 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
const uni_modules_nutuiUni_components__hooks_useProvide = require("../_hooks/useProvide.js");
require("../_utils/env.js");
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
const uni_modules_nutuiUni_components_radio_index = require("../radio/index.js");
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
const radiogroupProps = {
...uni_modules_nutuiUni_components__utils_props.commonProps,
/**
* @description 当前选中项的标识符,与 `label` 值一致时呈选中状态
*/
modelValue: {
type: [Number, String, Boolean],
default: ""
},
/**
* @description 使用横纵方向,可选值 `horizontal`、`vertical`
*/
direction: uni_modules_nutuiUni_components__utils_props.makeStringProp("vertical"),
/**
* @description 文本所在的位置,可选值:`left`,`right`
*/
textPosition: uni_modules_nutuiUni_components__utils_props.makeStringProp("right")
};
const radiogroupEmits = {
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isString(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || uni_modules_nutuiUni_components__utils_is.isBoolean(val),
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isString(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || uni_modules_nutuiUni_components__utils_is.isBoolean(val)
};
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-radio-group`;
const __default__ = common_vendor.defineComponent({
name: componentName,
options: {
virtualHost: true,
addGlobalClass: true,
styleIsolation: "shared"
}
});
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
...__default__,
props: radiogroupProps,
emits: radiogroupEmits,
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const updateValue = (value) => emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, value);
uni_modules_nutuiUni_components__hooks_useProvide.useProvide(uni_modules_nutuiUni_components_radio_index.RADIO_KEY)({
label: common_vendor.readonly(common_vendor.computed(() => props.modelValue)),
position: common_vendor.readonly(common_vendor.computed(() => props.textPosition)),
updateValue
});
const classes = common_vendor.computed(() => {
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
[`${componentName}--${props.direction}`]: true
});
});
common_vendor.watch(
() => props.modelValue,
(value) => emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, value)
);
return (_ctx, _cache) => {
return {
a: common_vendor.n(classes.value),
b: common_vendor.s(_ctx.customStyle)
};
};
}
});
wx.createComponent(_sfc_main);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/radiogroup/radiogroup.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{a}}" style="{{b}}"><slot/></view>

View File

@@ -0,0 +1,63 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.nut-radio-group {
display: inline-block;
}
.nut-radio-group .nut-radio {
margin-bottom: 5px;
}
.nut-radio-group--horizontal .nut-radio {
display: inline-flex !important;
margin-right: 10px !important;
}
.nut-radio-group--horizontal .nut-radio--round .nut-radio__label {
margin: 0 6px !important;
}