|
@@ -36,10 +36,8 @@
|
|
|
<!-- <text v-if="buyType == 0 || !placeId">{{ previewCourseInfo?.discountPrice }}</text> -->
|
|
<!-- <text v-if="buyType == 0 || !placeId">{{ previewCourseInfo?.discountPrice }}</text> -->
|
|
|
<text v-if="buyType == 1">{{ previewCourseInfo?.sellingPrice.toFixed(2) }}</text>
|
|
<text v-if="buyType == 1">{{ previewCourseInfo?.sellingPrice.toFixed(2) }}</text>
|
|
|
<text v-else>{{
|
|
<text v-else>{{
|
|
|
- previewCourseInfo?.originalPrice ? (previewCourseInfo?.originalPrice -
|
|
|
|
|
- previewCourseInfo?.sellingPrice.toFixed(2)) * countTotal : ((previewCourseInfo?.sellingPrice
|
|
|
|
|
- -
|
|
|
|
|
- previewCourseInfo?.totalPrice.toFixed(2))) * countTotal }}</text>
|
|
|
|
|
|
|
+ previewCourseInfo?.originalPrice ? ((previewCourseInfo?.originalPrice -
|
|
|
|
|
+ previewCourseInfo?.sellingPrice.toFixed(2)) * countTotal).toFixed(2) : (((previewCourseInfo?.sellingPrice-previewCourseInfo?.totalPrice.toFixed(2))) * countTotal).toFixed(2) }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -201,10 +199,10 @@
|
|
|
<view class="discount">优惠¥
|
|
<view class="discount">优惠¥
|
|
|
<text v-if="buyType == 1">{{ previewCourseInfo?.sellingPrice.toFixed(2) }}</text>
|
|
<text v-if="buyType == 1">{{ previewCourseInfo?.sellingPrice.toFixed(2) }}</text>
|
|
|
<text v-else>{{
|
|
<text v-else>{{
|
|
|
- previewCourseInfo?.originalPrice ? (previewCourseInfo?.originalPrice -
|
|
|
|
|
- previewCourseInfo?.sellingPrice.toFixed(2)) * countTotal : ((previewCourseInfo?.sellingPrice
|
|
|
|
|
|
|
+ previewCourseInfo?.originalPrice ? ((previewCourseInfo?.originalPrice -
|
|
|
|
|
+ previewCourseInfo?.sellingPrice.toFixed(2)) * countTotal).toFixed(2) : (((previewCourseInfo?.sellingPrice
|
|
|
-
|
|
-
|
|
|
- previewCourseInfo?.totalPrice.toFixed(2))) * countTotal }}</text>
|
|
|
|
|
|
|
+ previewCourseInfo?.totalPrice.toFixed(2))) * countTotal).toFixed(2) }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="footer-btn" @click="submitOrder">
|
|
<view class="footer-btn" @click="submitOrder">
|
|
@@ -315,12 +313,13 @@ const get_userData = () => {
|
|
|
const schoolStudentStatus = ref([])
|
|
const schoolStudentStatus = ref([])
|
|
|
const gradeClassInfo = ref([])
|
|
const gradeClassInfo = ref([])
|
|
|
|
|
|
|
|
|
|
+// 分班状态监听
|
|
|
watch(userData, (newUserData) => {
|
|
watch(userData, (newUserData) => {
|
|
|
- schoolStudentStatus.value = new Array(newUserData.length).fill(false);
|
|
|
|
|
- gradeClassInfo.value = new Array(newUserData.length).fill(null).map(() => ({
|
|
|
|
|
- grade: '',
|
|
|
|
|
- class: ''
|
|
|
|
|
- }));
|
|
|
|
|
|
|
+ schoolStudentStatus.value = new Array(newUserData.length).fill(null);
|
|
|
|
|
+ gradeClassInfo.value = new Array(newUserData.length).fill(null).map(() => ({
|
|
|
|
|
+ grade: '',
|
|
|
|
|
+ class: ''
|
|
|
|
|
+ }));
|
|
|
}, { immediate: true });
|
|
}, { immediate: true });
|
|
|
|
|
|
|
|
const deleteUser = async (e) => {
|
|
const deleteUser = async (e) => {
|
|
@@ -481,24 +480,28 @@ const orderCode = ref(null)
|
|
|
const orderId = ref(null)
|
|
const orderId = ref(null)
|
|
|
const submitOrderImpl = () => {
|
|
const submitOrderImpl = () => {
|
|
|
orderFormData.value.amount = countTotal.value
|
|
orderFormData.value.amount = countTotal.value
|
|
|
- for (let i = 0; i < userData.value.length; i++) {
|
|
|
|
|
- if (schoolStudentStatus.value[i] === true) {
|
|
|
|
|
- const grade = gradeClassInfo.value[i].grade;
|
|
|
|
|
- const clazz = gradeClassInfo.value[i].class;
|
|
|
|
|
-
|
|
|
|
|
- if (!grade || !clazz) {
|
|
|
|
|
- return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入完整的年级和班级信息`);
|
|
|
|
|
- }
|
|
|
|
|
- const gradeNum = parseInt(grade);
|
|
|
|
|
- const classNum = parseInt(clazz);
|
|
|
|
|
- if (isNaN(gradeNum) || gradeNum < 1 || gradeNum > 12) {
|
|
|
|
|
- return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入有效的年级(1-12)`);
|
|
|
|
|
- }
|
|
|
|
|
- if (isNaN(classNum) || classNum < 1 || classNum > 40) {
|
|
|
|
|
- return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入有效的班级(1-40)`);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ for (let i = 0; i < userData.value.length; i++) {
|
|
|
|
|
+ if (schoolStudentStatus.value[i] === null || schoolStudentStatus.value[i] === undefined) {
|
|
|
|
|
+ return TipsUtils.tips_toast(`请为${userData.value[i].fullName}选择是否本校学生`);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (schoolStudentStatus.value[i] === true) {
|
|
|
|
|
+ const grade = gradeClassInfo.value[i].grade;
|
|
|
|
|
+ const clazz = gradeClassInfo.value[i].class;
|
|
|
|
|
+
|
|
|
|
|
+ if (!grade || !clazz) {
|
|
|
|
|
+ return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入完整的年级和班级信息`);
|
|
|
|
|
+ }
|
|
|
|
|
+ const gradeNum = parseInt(grade);
|
|
|
|
|
+ const classNum = parseInt(clazz);
|
|
|
|
|
+ if (isNaN(gradeNum) || gradeNum < 1 || gradeNum > 12) {
|
|
|
|
|
+ return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入有效的年级(1-12)`);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isNaN(classNum) || classNum < 1 || classNum > 40) {
|
|
|
|
|
+ return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入有效的班级(1-40)`);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
orderFormData.value.addGradeLevelInformation = userData.value.map((user, index) => ({
|
|
orderFormData.value.addGradeLevelInformation = userData.value.map((user, index) => ({
|
|
|
class: schoolStudentStatus.value[index] === true ? gradeClassInfo.value[index].class : '',
|
|
class: schoolStudentStatus.value[index] === true ? gradeClassInfo.value[index].class : '',
|
|
|
familyId: user.id,
|
|
familyId: user.id,
|