Commit 59534b0dc8c24dfbf47a3a8c764e82c9fe06b6ac

Authored by pengye
1 parent 2a2387bb

优惠券增加单次可用几张字段

@@ -118,7 +118,10 @@ @@ -118,7 +118,10 @@
118 "pages/index_new", 118 "pages/index_new",
119 "pages/cart_new", 119 "pages/cart_new",
120 "pages/success_new", 120 "pages/success_new",
121 - "pages/favourableList" 121 + "pages/favourableList",
  122 + "pages/comboList",
  123 + "pages/comboDetails",
  124 + "pages/comboBuy"
122 ] 125 ]
123 }, 126 },
124 { 127 {
@@ -736,49 +736,127 @@ Page({ @@ -736,49 +736,127 @@ Page({
736 return (this.data.dataStr < (item.useEtime * 1) || item.aexpiration.valid_forever == '1'); 736 return (this.data.dataStr < (item.useEtime * 1) || item.aexpiration.valid_forever == '1');
737 }) 737 })
738 list.sort((a, b) => { 738 list.sort((a, b) => {
739 - return (a.etime * 1) - (b.etime * 1) 739 + if (a.aexpiration.valid_forever == '1' && b.aexpiration.valid_forever != '1') return 1;
  740 + if (a.aexpiration.valid_forever != '1' && b.aexpiration.valid_forever == '1') return -1;
  741 + return (a.useEtime * 1) - (b.useEtime * 1)
740 }) 742 })
741 let couponArr = list 743 let couponArr = list
  744 + // 相同aid的券合并成一张,用加减号选择张数
  745 + let couponGroup = {}
  746 + let couponList = []
  747 + couponArr.forEach(item => {
  748 + let key = item.aid ? item.aid : item.activity_id
  749 + if (couponGroup[key]) {
  750 + couponGroup[key].num = (couponGroup[key].num * 1) + 1
  751 + couponGroup[key].activityIds.push(item.activity_id)
  752 + } else {
  753 + item.num = 1
  754 + item.checkedNum = 0
  755 + item.activityIds = [item.activity_id]
  756 + couponGroup[key] = item
  757 + couponList.push(item)
  758 + }
  759 + })
  760 + couponArr = couponList
  761 + // 单次使用数量限制,0表示不限制,默认0;合并完成后统一计算
  762 + couponArr.forEach(item => {
  763 + let useLimit = item.single_use_limit ? (item.single_use_limit * 1) : 0
  764 + item.maxNum = (useLimit > 0 && useLimit < item.num) ? useLimit : item.num
  765 + })
  766 + console.log('couponArr----',couponArr);
  767 +
742 this.setData({ 768 this.setData({
743 couponArr 769 couponArr
744 }) 770 })
745 } 771 }
746 }) 772 })
747 }, 773 },
748 - // 勾选券  
749 - checkboxChange(e) {  
750 - console.log('checkbox发生change事件,携带value值为:', e.detail.value) 774 + // 加减号选择券的张数
  775 + changeCouponNum(e) {
  776 + let type = e.currentTarget.dataset.type;
  777 + let aid = e.currentTarget.dataset.aid;
  778 + const list = this.data.couponArr
  779 + let item = list.find(i => i.aid == aid)
  780 + if (!item) return
  781 + if (type == 'plus') {
  782 + if (item.canAdd != '1') return
  783 + item.checkedNum = (item.checkedNum * 1) + 1
  784 + }
  785 + if (type == 'minus') {
  786 + if (item.checkedNum <= 0) return
  787 + item.checkedNum = (item.checkedNum * 1) - 1
  788 + }
  789 + this.refreshCouponState()
  790 + },
  791 + // 加减号中间输入框:只允许正整数或0,且不能超过当前可用张数
  792 + numInputChange(e) {
  793 + let aid = e.currentTarget.dataset.aid;
  794 + let val = (e.detail.value || '').replace(/[^\d]/g, ''); // 只保留数字
  795 + const list = this.data.couponArr
  796 + let item = list.find(i => i.aid == aid)
  797 + if (!item) return
  798 + let maxSelect = this.getMaxSelectNum(item)
  799 + let num = val === '' ? 0 : parseInt(val, 10)
  800 + if (isNaN(num)) num = 0
  801 + if (num > maxSelect) num = maxSelect
  802 + item.checkedNum = num
  803 + this.refreshCouponState()
  804 + },
  805 + // 计算某张券当前最多可以选到的张数
  806 + getMaxSelectNum(item) {
  807 + const list = this.data.couponArr
  808 + let inputValue = parseFloat(this.data.inputValue)
  809 + let descStr = 0
  810 + let val = 0
  811 + list.forEach(i => {
  812 + if (i.checkedNum > 0 && i.aid != item.aid) {
  813 + let d = parseFloat(i.desc) || 0
  814 + if (d > 0) descStr += d * i.checkedNum
  815 + val += parseFloat(i.price) * i.checkedNum
  816 + }
  817 + })
  818 + let itemDesc = parseFloat(item.desc) || 0
  819 + let itemPrice = parseFloat(item.price)
  820 + let maxSelect = item.maxNum
  821 + if (item.accumulationShow != '1' && maxSelect > 1) maxSelect = 1
  822 + if (inputValue > 0) {
  823 + if (itemDesc > 0) {
  824 + let byDesc = Math.floor((inputValue - descStr) / itemDesc)
  825 + if (byDesc < maxSelect) maxSelect = byDesc
  826 + } else {
  827 + // 无门槛券:满减门槛之和小于输入金额时才能叠加
  828 + if (descStr >= inputValue) {
  829 + maxSelect = 0
  830 + } else {
  831 + let byPrice = Math.floor((inputValue - val) / itemPrice)
  832 + if (byPrice < maxSelect) maxSelect = byPrice
  833 + }
  834 + }
  835 + }
  836 + if (maxSelect < 0) maxSelect = 0
  837 + return maxSelect
  838 + },
  839 + // 根据选择的券张数刷新券的可选状态
  840 + refreshCouponState() {
751 const list = this.data.couponArr 841 const list = this.data.couponArr
752 - const values = e.detail.value  
753 - let arr = []  
754 let currentCoupon = '0'; //没选券 为0 可叠加券1 不可叠加券2 842 let currentCoupon = '0'; //没选券 为0 可叠加券1 不可叠加券2
755 let inputValue = parseFloat(this.data.inputValue) 843 let inputValue = parseFloat(this.data.inputValue)
756 let val = 0; //勾选的券 优惠金额的和 844 let val = 0; //勾选的券 优惠金额的和
757 let descStr = 0; //勾选的券 每满金额的和 845 let descStr = 0; //勾选的券 每满金额的和
758 - for (let i = 0, lenI = list.length; i < lenI; ++i) {  
759 - list[i].checked = false;  
760 - for (let j = 0, lenJ = values.length; j < lenJ; ++j) {  
761 - if (list[i].activity_id === values[j]) {  
762 - val += parseFloat(list[i].price)  
763 - if (!list[i].desc || list[i].desc == 0) {  
764 - descStr += parseFloat(list[i].price)  
765 - } else {  
766 - descStr += parseFloat(list[i].desc)  
767 - }  
768 - arr.push({  
769 - ...list[i]  
770 - })  
771 - list[i].checked = true  
772 - if (list[i].accumulationShow == '1') {  
773 - currentCoupon = '1'  
774 - break  
775 - } else {  
776 - currentCoupon = '2'  
777 - break  
778 - } 846 + list.forEach(item => {
  847 + if (item.checkedNum > 0) {
  848 + val += parseFloat(item.price) * item.checkedNum
  849 + let itemDesc = parseFloat(item.desc) || 0
  850 + if (itemDesc > 0) {
  851 + descStr += itemDesc * item.checkedNum
  852 + }
  853 + if (item.accumulationShow != '1') {
  854 + currentCoupon = '2'
  855 + } else {
  856 + currentCoupon = '1'
779 } 857 }
780 } 858 }
781 - } 859 + })
782 let remaining = inputValue - val; //剩余金额 860 let remaining = inputValue - val; //剩余金额
783 console.log('没选券为0可叠加券1不可叠加券2', currentCoupon, remaining); 861 console.log('没选券为0可叠加券1不可叠加券2', currentCoupon, remaining);
784 //没选券 所有可选的打开 862 //没选券 所有可选的打开
@@ -792,7 +870,7 @@ Page({ @@ -792,7 +870,7 @@ Page({
792 //选的不可叠加券 其他所有的可叠加券都不可选 870 //选的不可叠加券 其他所有的可叠加券都不可选
793 if (currentCoupon == '2') { 871 if (currentCoupon == '2') {
794 list.map((item) => { 872 list.map((item) => {
795 - if (item.checked) { 873 + if (item.checkedNum > 0) {
796 item.showCpupon = '1' 874 item.showCpupon = '1'
797 } else { 875 } else {
798 item.showCpupon = '0' 876 item.showCpupon = '0'
@@ -802,17 +880,79 @@ Page({ @@ -802,17 +880,79 @@ Page({
802 //选的可叠加券 其他所有的不可叠加券都不可选 880 //选的可叠加券 其他所有的不可叠加券都不可选
803 if (currentCoupon == '1') { 881 if (currentCoupon == '1') {
804 list.forEach(item => { 882 list.forEach(item => {
805 - if (item.checked || (item.accumulationShow == "1" && (inputValue - descStr) >= parseFloat(item.desc) && parseFloat(item.price) <= (inputValue - val))) { 883 + if (item.checkedNum > 0 || (item.accumulationShow == "1" && parseFloat(item.price) <= (inputValue - val) && (((parseFloat(item.desc) || 0) > 0 && (inputValue - descStr) >= parseFloat(item.desc)) || ((parseFloat(item.desc) || 0) === 0 && descStr < inputValue)))) {
806 item.showCpupon = '1'; 884 item.showCpupon = '1';
807 } else { 885 } else {
808 item.showCpupon = '0'; 886 item.showCpupon = '0';
809 } 887 }
810 }) 888 })
811 } 889 }
812 - let finalList = list.filter(i=>{return i.checked})  
813 - this.setData({  
814 - couponArr: list,  
815 - finalList 890 + let finalList = []
  891 + list.forEach(item => {
  892 + if (item.checkedNum > 0) {
  893 + for (let k = 0; k < item.checkedNum; k++) {
  894 + finalList.push({
  895 + ...item,
  896 + activity_id: item.activityIds[k]
  897 + })
  898 + }
  899 + }
  900 + })
  901 + this.updateCanAdd()
  902 + if (inputValue) {
  903 + let discountPrice = 0;
  904 + finalList.forEach(i => {
  905 + discountPrice += parseFloat(i.price)
  906 + })
  907 + discountPrice = discountPrice.toFixed(2)
  908 + console.log('优惠金额----', discountPrice);
  909 + let actualPrice = (inputValue - discountPrice - this.data.consumeDiscount).toFixed(2)
  910 + let myBalance = this.data.myBalance * 1;
  911 + let balancePay = (this.data.payType == '1' && actualPrice > myBalance) ? myBalance : actualPrice;
  912 + let soothPrice = this.data.payType == '1' ? (actualPrice - balancePay).toFixed(2) : actualPrice;
  913 + this.setData({
  914 + couponArr: list,
  915 + finalList,
  916 + discountPrice,
  917 + actualPrice,
  918 + balancePay,
  919 + soothPrice,
  920 + })
  921 + } else {
  922 + this.setData({
  923 + couponArr: list,
  924 + finalList
  925 + })
  926 + }
  927 + },
  928 + // 计算每张券还能不能继续加:满减门槛之和不能超过输入金额
  929 + updateCanAdd() {
  930 + const list = this.data.couponArr
  931 + let inputValue = parseFloat(this.data.inputValue)
  932 + let descStr = 0
  933 + let val = 0
  934 + list.forEach(item => {
  935 + if (item.checkedNum > 0) {
  936 + let itemDesc = parseFloat(item.desc) || 0
  937 + let itemPrice = parseFloat(item.price)
  938 + if (itemDesc > 0) descStr += itemDesc * item.checkedNum
  939 + val += itemPrice * item.checkedNum
  940 + }
  941 + })
  942 + list.forEach(item => {
  943 + item.canAdd = '0'
  944 + // 不可叠加的券最多只能选一张
  945 + let maxSelect = item.accumulationShow == '1' ? item.maxNum : 1
  946 + if (item.showCpupon == '1' && item.checkedNum < maxSelect) {
  947 + let itemDesc = parseFloat(item.desc) || 0
  948 + let itemPrice = parseFloat(item.price)
  949 + if (itemDesc > 0) {
  950 + if (descStr + itemDesc <= inputValue) item.canAdd = '1'
  951 + } else {
  952 + // 无门槛券:满减门槛之和小于输入金额时才能叠加
  953 + if (descStr < inputValue && val + itemPrice <= inputValue) item.canAdd = '1'
  954 + }
  955 + }
816 }) 956 })
817 }, 957 },
818 // 输入金额 958 // 输入金额
@@ -821,7 +961,7 @@ Page({ @@ -821,7 +961,7 @@ Page({
821 let list = this.data.couponArr; 961 let list = this.data.couponArr;
822 // 所有的券重置 962 // 所有的券重置
823 list.forEach(i => { 963 list.forEach(i => {
824 - i.checked = false; 964 + i.checkedNum = 0;
825 i.showCpupon = '0' 965 i.showCpupon = '0'
826 }) 966 })
827 this.setData({ 967 this.setData({
@@ -867,11 +1007,11 @@ Page({ @@ -867,11 +1007,11 @@ Page({
867 if (!inputValue) return 1007 if (!inputValue) return
868 let list = this.data.couponArr; 1008 let list = this.data.couponArr;
869 list = list.filter(i => { 1009 list = list.filter(i => {
870 - return i.checked 1010 + return i.checkedNum > 0
871 }) 1011 })
872 let price = 0; 1012 let price = 0;
873 list.forEach(i => { 1013 list.forEach(i => {
874 - price += parseFloat(i.price) 1014 + price += parseFloat(i.price) * i.checkedNum
875 }) 1015 })
876 console.log('优惠金额----', price); 1016 console.log('优惠金额----', price);
877 let val = parseFloat(this.data.inputValue); 1017 let val = parseFloat(this.data.inputValue);
@@ -1235,9 +1375,7 @@ Page({ @@ -1235,9 +1375,7 @@ Page({
1235 let list1 = []; // 可叠加的优惠券组合 1375 let list1 = []; // 可叠加的优惠券组合
1236 let list2 = []; // 最优惠的不可叠加的优惠券 1376 let list2 = []; // 最优惠的不可叠加的优惠券
1237 let finalList = []; //最终用的优惠券组合 1377 let finalList = []; //最终用的优惠券组合
1238 - // 计算可叠加的组合  
1239 - let remainingPrice = amount; // 剩余金额  
1240 - let totalDiscount = 0; // 总优惠金额 1378 + let selectCount = {}; // 每种券选中的张数
1241 // 1. 优先排序 desc 为空或为 0 的,再根据 price 从大到小排序,再根据满减条件 desc 从大到小排序 1379 // 1. 优先排序 desc 为空或为 0 的,再根据 price 从大到小排序,再根据满减条件 desc 从大到小排序
1242 stackingCoupons.sort((a, b) => { 1380 stackingCoupons.sort((a, b) => {
1243 if (a.desc === '0' || a.desc === '') return -1; // 优先选择 desc 为空或为 0 的 1381 if (a.desc === '0' || a.desc === '') return -1; // 优先选择 desc 为空或为 0 的
@@ -1246,35 +1384,82 @@ Page({ @@ -1246,35 +1384,82 @@ Page({
1246 return parseFloat(b.desc) - parseFloat(a.desc); // 按满减条件 desc 从大到小 1384 return parseFloat(b.desc) - parseFloat(a.desc); // 按满减条件 desc 从大到小
1247 }); 1385 });
1248 console.log('排序后的可叠加券列表',stackingCoupons); 1386 console.log('排序后的可叠加券列表',stackingCoupons);
1249 - // 2. 从排序后的券中选择  
1250 - for (let coupon of stackingCoupons) {  
1251 - let couponDesc = parseFloat(coupon.desc);  
1252 - let couponPrice = parseFloat(coupon.price);  
1253 - let kyNum = Math.floor(remainingPrice / couponDesc);// 计算券可用张数  
1254 - if (couponDesc === 0) {// 如果满减条件为 0,直接选择  
1255 - list1.push(coupon);  
1256 - remainingPrice -= couponPrice; // 减去价格  
1257 - totalDiscount += couponPrice; // 计算优惠金额  
1258 - continue; 1387 + // 2. 可叠加满减券:先选满减门槛最大的券,再叠加其他可用的券(门槛之和不能超过输入金额)
  1388 + let thresholdDescSum = 0
  1389 + let maxThresholdValue = 0
  1390 + let thresholdCoupons = stackingCoupons.filter(coupon => (parseFloat(coupon.desc) || 0) > 0)
  1391 + // 按满减门槛从大到小排序,门槛相同再按优惠金额从大到小
  1392 + thresholdCoupons.sort((a, b) => {
  1393 + if (parseFloat(b.desc) !== parseFloat(a.desc)) return parseFloat(b.desc) - parseFloat(a.desc)
  1394 + return parseFloat(b.price) - parseFloat(a.price)
  1395 + })
  1396 + thresholdCoupons.forEach(coupon => {
  1397 + let couponDesc = parseFloat(coupon.desc) || 0
  1398 + let couponPrice = parseFloat(coupon.price)
  1399 + let maxCopies = Math.floor((amount - thresholdDescSum) / couponDesc)
  1400 + if (maxCopies > coupon.maxNum) maxCopies = coupon.maxNum
  1401 + if (maxCopies > 0) {
  1402 + selectCount[coupon.aid] = maxCopies
  1403 + thresholdDescSum += couponDesc * maxCopies
  1404 + maxThresholdValue += couponPrice * maxCopies
  1405 + }
  1406 + })
  1407 + list1 = stackingCoupons.filter(i => (selectCount[i.aid] || 0) > 0)
  1408 + console.log('可叠加优惠券组合', list1);
  1409 + // 3. 无门槛可叠加券:满减门槛之和小于输入金额时可以叠加,等于时和满减组合取优惠更大的
  1410 + // 先算无门槛券单独使用的优惠总额
  1411 + let noDescValue = 0
  1412 + let noDescCount = {}
  1413 + stackingCoupons.forEach(coupon => {
  1414 + let couponDesc = parseFloat(coupon.desc) || 0
  1415 + let couponPrice = parseFloat(coupon.price)
  1416 + if (couponDesc === 0 && couponPrice > 0) {
  1417 + let num = Math.floor((amount - noDescValue) / couponPrice)
  1418 + if (num > coupon.maxNum) num = coupon.maxNum
  1419 + if (num > 0) {
  1420 + noDescCount[coupon.aid] = num
  1421 + noDescValue += couponPrice * num
  1422 + }
1259 } 1423 }
1260 - // 如果剩余金额足够,选择券  
1261 - if (remainingPrice > couponDesc || remainingPrice == couponDesc) {  
1262 - // 计算实际使用的张数,不能超过 kyNum  
1263 - let usedCount = Math.min(kyNum, 1); // 假设每次只使用一张  
1264 - let potentialDiscount = couponDesc * usedCount; // 计算潜在的优惠金额  
1265 - if ((totalDiscount + potentialDiscount < amount) || (totalDiscount + potentialDiscount == amount)) {// 检查总优惠金额是否会超过总金额  
1266 - list1.push(coupon);  
1267 - remainingPrice -= couponPrice * usedCount; // 减去价格  
1268 - totalDiscount += potentialDiscount; // 计算优惠金额 1424 + })
  1425 + let maxStackableValue = maxThresholdValue
  1426 + if (thresholdDescSum < amount) {
  1427 + // 可以叠加:无门槛券按剩余优惠额度叠加上去
  1428 + stackingCoupons.forEach(coupon => {
  1429 + let couponDesc = parseFloat(coupon.desc) || 0
  1430 + let couponPrice = parseFloat(coupon.price)
  1431 + if (couponDesc === 0 && couponPrice > 0) {
  1432 + let num = Math.floor((amount - maxStackableValue) / couponPrice)
  1433 + if (num > coupon.maxNum) num = coupon.maxNum
  1434 + if (num > 0) {
  1435 + selectCount[coupon.aid] = num
  1436 + maxStackableValue += couponPrice * num
  1437 + }
1269 } 1438 }
  1439 + })
  1440 + list1 = stackingCoupons.filter(i => (selectCount[i.aid] || 0) > 0)
  1441 + } else if (noDescValue > maxThresholdValue) {
  1442 + // 门槛等于输入金额,不能叠加,取无门槛券或满减券中优惠更大的
  1443 + list1 = stackingCoupons.filter(i => (noDescCount[i.aid] || 0) > 0)
  1444 + selectCount = noDescCount
  1445 + maxStackableValue = noDescValue
  1446 + } else if (noDescValue == maxThresholdValue && noDescValue > 0) {
  1447 + // 优惠相同取最早到期
  1448 + let listThreshold = stackingCoupons.filter(i => (selectCount[i.aid] || 0) > 0)
  1449 + let listNoDesc = stackingCoupons.filter(i => (noDescCount[i.aid] || 0) > 0)
  1450 + let min1 = listThreshold.length > 0 ? Math.min(...listThreshold.map(item => item.useEtime)) : Infinity
  1451 + let min2 = listNoDesc.length > 0 ? Math.min(...listNoDesc.map(item => item.useEtime)) : Infinity
  1452 + if (min2 < min1) {
  1453 + list1 = listNoDesc
  1454 + selectCount = noDescCount
1270 } 1455 }
1271 - // 如果剩余金额已经小于等于 0,停止选择  
1272 - if (remainingPrice < 0 || remainingPrice == 0) break;  
1273 } 1456 }
  1457 + let stackList = list1
  1458 + let stackCount = selectCount
1274 // 遍历有效优惠券,寻找不可叠加的优惠券 1459 // 遍历有效优惠券,寻找不可叠加的优惠券
1275 let maxNonStackableValue = 0 1460 let maxNonStackableValue = 0
1276 validCoupons.forEach(coupon => { 1461 validCoupons.forEach(coupon => {
1277 - if (coupon.accumulationShow === '0') { 1462 + if (coupon.accumulationShow != '1') {
1278 const discountAmount = parseFloat(coupon.price); 1463 const discountAmount = parseFloat(coupon.price);
1279 // 计算实际支付金额 1464 // 计算实际支付金额
1280 const finalAmount = amount - discountAmount; 1465 const finalAmount = amount - discountAmount;
@@ -1287,27 +1472,25 @@ Page({ @@ -1287,27 +1472,25 @@ Page({
1287 } 1472 }
1288 } 1473 }
1289 }); 1474 });
1290 - console.log('可叠加优惠券组合', list1);  
1291 console.log('不可叠加的优惠券', list2); 1475 console.log('不可叠加的优惠券', list2);
1292 // 计算两个列表的最大优惠值 1476 // 计算两个列表的最大优惠值
1293 - let maxStackableValue = list1.reduce((total, coupon) => total + parseFloat(coupon.price), 0);  
1294 console.log('可叠加优惠券组合总金额', maxStackableValue); 1477 console.log('可叠加优惠券组合总金额', maxStackableValue);
1295 console.log('不可叠加的优惠券总金额', maxNonStackableValue); 1478 console.log('不可叠加的优惠券总金额', maxNonStackableValue);
1296 // 比较两个最大值并输出结果 1479 // 比较两个最大值并输出结果
1297 if (maxStackableValue > maxNonStackableValue) { 1480 if (maxStackableValue > maxNonStackableValue) {
1298 - finalList = list1 1481 + finalList = stackList
1299 } else if (maxStackableValue < maxNonStackableValue) { 1482 } else if (maxStackableValue < maxNonStackableValue) {
1300 finalList = list2 1483 finalList = list2
1301 } else { 1484 } else {
1302 console.log(`两者的优惠值相同: ${maxStackableValue}`); 1485 console.log(`两者的优惠值相同: ${maxStackableValue}`);
1303 - let copiedList1 = JSON.parse(JSON.stringify(list1)); 1486 + let copiedList1 = JSON.parse(JSON.stringify(stackList));
1304 let copiedList2 = JSON.parse(JSON.stringify(list2)); 1487 let copiedList2 = JSON.parse(JSON.stringify(list2));
1305 let minList1 = copiedList1.length > 0 ? Math.min(...copiedList1.map(item => item.useEtime)) : Infinity; 1488 let minList1 = copiedList1.length > 0 ? Math.min(...copiedList1.map(item => item.useEtime)) : Infinity;
1306 let minList2 = copiedList2.length > 0 ? Math.min(...copiedList2.map(item => item.useEtime)) : Infinity; 1489 let minList2 = copiedList2.length > 0 ? Math.min(...copiedList2.map(item => item.useEtime)) : Infinity;
1307 // 判断最小的 useEtime 是在 list1 还是 list2 1490 // 判断最小的 useEtime 是在 list1 还是 list2
1308 if (minList1 <= minList2) { 1491 if (minList1 <= minList2) {
1309 - console.log('最小的在 list1 中', list1);  
1310 - finalList = list1 1492 + console.log('最小的在 list1 中', stackList);
  1493 + finalList = stackList
1311 } else { 1494 } else {
1312 console.log('最小的在 list2 中', list2); 1495 console.log('最小的在 list2 中', list2);
1313 finalList = list2 1496 finalList = list2
@@ -1320,19 +1503,32 @@ Page({ @@ -1320,19 +1503,32 @@ Page({
1320 let target = arr.findIndex(obj => obj.activity_id === coupon.activity_id); 1503 let target = arr.findIndex(obj => obj.activity_id === coupon.activity_id);
1321 if (target>-1) { 1504 if (target>-1) {
1322 arr[target].showCpupon = 1; 1505 arr[target].showCpupon = 1;
1323 - arr[target].checked = true;  
1324 - discountPrice += parseFloat(coupon.price); // 使用 parseFloat 确保类型正确 1506 + arr[target].checkedNum = stackCount[coupon.aid] || 1;
  1507 + discountPrice += parseFloat(coupon.price) * (stackCount[coupon.aid] || 1); // 使用 parseFloat 确保类型正确
1325 } 1508 }
1326 console.log('选中的券', { 1509 console.log('选中的券', {
1327 ...coupon 1510 ...coupon
1328 }); 1511 });
1329 }); 1512 });
  1513 + // 根据选中的张数展开最终券列表
  1514 + finalList = []
  1515 + arr.forEach(item => {
  1516 + if (item.checkedNum > 0) {
  1517 + for (let k = 0; k < item.checkedNum; k++) {
  1518 + finalList.push({
  1519 + ...item,
  1520 + activity_id: item.activityIds[k]
  1521 + })
  1522 + }
  1523 + }
  1524 + })
1330 discountPrice = discountPrice.toFixed(2) 1525 discountPrice = discountPrice.toFixed(2)
1331 console.log('总优惠金额:', discountPrice); 1526 console.log('总优惠金额:', discountPrice);
1332 console.log('消费金抵扣:',this.data.consumeDiscount); 1527 console.log('消费金抵扣:',this.data.consumeDiscount);
1333 this.setData({ 1528 this.setData({
1334 discountPrice, 1529 discountPrice,
1335 }); 1530 });
  1531 + this.updateCanAdd()
1336 return { 1532 return {
1337 arr, 1533 arr,
1338 discountPrice, 1534 discountPrice,
@@ -1425,42 +1621,83 @@ Page({ @@ -1425,42 +1621,83 @@ Page({
1425 let obj = this.checkTimeInInterval(currentTime, lunchDis, lunchDinnerList); 1621 let obj = this.checkTimeInInterval(currentTime, lunchDis, lunchDinnerList);
1426 //节假日数组 1622 //节假日数组
1427 var holidays = [ 1623 var holidays = [
1428 - '2025-1-1', // 元旦  
1429 - '2025-1-28', // 春节  
1430 - '2025-1-29', // 春节  
1431 - '2025-1-30', // 春节  
1432 - '2025-1-31', // 春节  
1433 - '2025-2-1', // 春节  
1434 - '2025-2-2', // 春节  
1435 - '2025-2-3', // 春节  
1436 - '2025-2-4', // 春节  
1437 - '2025-4-4', //清明  
1438 - '2025-4-5', //清明  
1439 - '2025-4-6', //清明  
1440 - '2025-5-1', // 劳动节  
1441 - '2025-5-2', // 劳动节  
1442 - '2025-5-3', // 劳动节  
1443 - '2025-5-4', // 劳动节  
1444 - '2025-5-5', // 劳动节  
1445 - '2025-5-31', // 端午节  
1446 - '2025-6-1', // 端午节  
1447 - '2025-6-2', // 端午节  
1448 - '2025-10-1', // 国庆节、中秋节  
1449 - '2025-10-2', // 国庆节、中秋节  
1450 - '2025-10-3', // 国庆节、中秋节  
1451 - '2025-10-4', // 国庆节、中秋节  
1452 - '2025-10-5', // 国庆节、中秋节  
1453 - '2025-10-6', // 国庆节、中秋节  
1454 - '2025-10-7', // 国庆节、中秋节  
1455 - '2025-10-8', // 国庆节、中秋节 1624 + '2026-1-1', // 元旦
  1625 + '2026-1-2', // 元旦
  1626 + '2026-1-3', // 元旦
  1627 + '2026-2-15', // 春节
  1628 + '2026-2-16', // 春节
  1629 + '2026-2-17', // 春节
  1630 + '2026-2-18', // 春节
  1631 + '2026-2-19', // 春节
  1632 + '2026-2-20', // 春节
  1633 + '2026-2-21', // 春节
  1634 + '2026-2-22', // 春节
  1635 + '2026-2-23', // 春节
  1636 + '2026-4-4', //清明
  1637 + '2026-4-5', //清明
  1638 + '2026-4-6', //清明
  1639 + '2026-5-1', // 劳动节
  1640 + '2026-5-2', // 劳动节
  1641 + '2026-5-3', // 劳动节
  1642 + '2026-5-4', // 劳动节
  1643 + '2026-5-5', // 劳动节
  1644 + '2026-6-19', // 端午节
  1645 + '2026-6-20', // 端午节
  1646 + '2026-6-21', // 端午节
  1647 + '2026-9-25', // 中秋节
  1648 + '2026-9-26', // 中秋节
  1649 + '2026-9-27', // 中秋节
  1650 + '2026-10-1', // 国庆节
  1651 + '2026-10-2', // 国庆节
  1652 + '2026-10-3', // 国庆节
  1653 + '2026-10-4', // 国庆节
  1654 + '2026-10-5', // 国庆节
  1655 + '2026-10-6', // 国庆节
  1656 + '2026-10-7', // 国庆节
  1657 + '2027-1-1', // 元旦
  1658 + '2027-1-2', // 元旦
  1659 + '2027-1-3', // 元旦
  1660 + '2027-2-5', // 春节
  1661 + '2027-2-6', // 春节
  1662 + '2027-2-7', // 春节
  1663 + '2027-2-8', // 春节
  1664 + '2027-2-9', // 春节
  1665 + '2027-2-10', // 春节
  1666 + '2027-2-11', // 春节
  1667 + '2027-2-12', // 春节
  1668 + '2027-2-13', // 春节
  1669 + '2027-4-3', //清明
  1670 + '2027-4-4', //清明
  1671 + '2027-4-5', //清明
  1672 + '2027-5-1', // 劳动节
  1673 + '2027-5-2', // 劳动节
  1674 + '2027-5-3', // 劳动节
  1675 + '2027-5-4', // 劳动节
  1676 + '2027-5-5', // 劳动节
  1677 + '2027-6-9', // 端午节
  1678 + '2027-9-15', // 中秋节
  1679 + '2027-10-1', // 国庆节
  1680 + '2027-10-2', // 国庆节
  1681 + '2027-10-3', // 国庆节
  1682 + '2027-10-4', // 国庆节
  1683 + '2027-10-5', // 国庆节
  1684 + '2027-10-6', // 国庆节
  1685 + '2027-10-7', // 国庆节
1456 ]; 1686 ];
1457 //周末上班日期数组 1687 //周末上班日期数组
1458 var nWeekend = [ 1688 var nWeekend = [
1459 - '2025-1-26', //春节调整  
1460 - '2025-2-8', //春节调整  
1461 - '2025-4-27', //五一调整  
1462 - '2025-9-28', //国庆调整  
1463 - '2025-10-11', //国庆调整 1689 + '2026-1-4', //元旦调整
  1690 + '2026-2-14', //春节调整
  1691 + '2026-2-28', //春节调整
  1692 + '2026-5-9', //五一调整
  1693 + '2026-9-20', //国庆调整
  1694 + '2026-10-10', //国庆调整
  1695 + '2027-1-31', //春节调整
  1696 + '2027-2-14', //春节调整
  1697 + '2027-4-25', //五一调整
  1698 + '2027-5-8', //五一调整
  1699 + '2027-9-26', //国庆调整
  1700 + '2027-10-9', //国庆调整
1464 ]; 1701 ];
1465 var curdate = new Date(); 1702 var curdate = new Date();
1466 var year = curdate.getFullYear(); 1703 var year = curdate.getFullYear();
@@ -1644,4 +1881,4 @@ Page({ @@ -1644,4 +1881,4 @@ Page({
1644 onShareAppMessage() { 1881 onShareAppMessage() {
1645 1882
1646 } 1883 }
1647 -})  
  1884 +})
@@ -17,7 +17,8 @@ @@ -17,7 +17,8 @@
17 <text>¥</text> 17 <text>¥</text>
18 <input type="digit" value="{{inputValue}}" bindchange="bindKeyInput" /> 18 <input type="digit" value="{{inputValue}}" bindchange="bindKeyInput" />
19 </view> 19 </view>
20 - <view bindtap="showCouponModal" class="couponsBox {{available == '1' ? 'colorOrange':'colorNine'}}"> 20 + <view bindtap="showCouponModal" class="couponsBox colorOrange">
  21 +
21 <view class="couponLeft">选择优惠券</view> 22 <view class="couponLeft">选择优惠券</view>
22 <view class="couponRight"> 23 <view class="couponRight">
23 <text wx:if="{{discountPrice && discountPrice!='0.00' && couponSwitch}}">-{{discountPrice}}</text> 24 <text wx:if="{{discountPrice && discountPrice!='0.00' && couponSwitch}}">-{{discountPrice}}</text>
@@ -151,37 +152,44 @@ @@ -151,37 +152,44 @@
151 <view class="infoBottom font24r">注意:消费金与优惠券{{coexist == '1'?'可':'不可'}}同时使用</view> 152 <view class="infoBottom font24r">注意:消费金与优惠券{{coexist == '1'?'可':'不可'}}同时使用</view>
152 </view> 153 </view>
153 <scroll-view class="couponBox" scroll-y="true"> 154 <scroll-view class="couponBox" scroll-y="true">
154 - <checkbox-group bindchange="checkboxChange">  
155 - <view wx:for="{{couponArr}}" data-activityId="{{item.activity_id}}" class="couponItems {{item.showCpupon == '0' ? 'couponNo' : ''}}">  
156 - <view class="itemLeft">  
157 - <view class="priceText" wx:if="{{item.price}}">  
158 - <view class="icons font24r">¥</view><text class="priceText">{{item.price}}</text>  
159 - </view>  
160 - <view class="icons font20r" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>  
161 - <view class="icons font20r" wx:if="{{item.desc=='0'}}">无门槛</view> 155 + <view wx:for="{{couponArr}}" data-aid="{{item.aid}}" class="couponItems {{item.showCpupon == '0' ? 'couponNo' : ''}}">
  156 + <view class="itemLeft">
  157 + <view class="priceText" wx:if="{{item.price}}">
  158 + <view class="icons font24r">¥</view><text class="priceText">{{item.price}}</text>
162 </view> 159 </view>
163 - <view class="itemRight">  
164 - <view class="anameText">  
165 - <text class="font40r">{{item.aname}}</text> 160 + <view class="icons font20r" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  161 + <view class="icons font20r" wx:if="{{item.desc=='0'}}">无门槛</view>
  162 + </view>
  163 + <view class="itemRight">
  164 + <view class="anameText">
  165 + <view class="anameInfo">
  166 + <view class="names font40r">{{item.aname}}</view>
166 <view class="discountText1 font20r">{{item.accumulationShow == '1' ? '可' : '不可'}}叠加</view> 167 <view class="discountText1 font20r">{{item.accumulationShow == '1' ? '可' : '不可'}}叠加</view>
167 </view> 168 </view>
168 - <view wx:if="{{item.endDateStr}}" class="font20r bottomTitle">有效日期:<view class="bottom font20r">{{item.endDateStr}}</view>  
169 - </view>  
170 - <!-- <view class="font20r bottom">{{item.arule.is_same_day=='1'?'领取当日可用':'领取当日不可用'}}</view>  
171 - <view wx:if="{{item.aexpiration>0}}" class="font20r bottom">领取后{{item.aexpiration}}天内使用</view>  
172 - <view wx:if="{{item.cdateText}}" class="font20r bottom">领取日期:{{item.cdateText}}</view> -->  
173 - <view wx:if="{{item.morText || item.noonText || item.nigText}}" class="font20r bottomTitle"><text>不可使用:</text>  
174 - <view class="textBox">  
175 - <view wx:if="{{item.morText}}" class="bottom font20r">{{item.morText}}</view>  
176 - <view wx:if="{{item.noonText}}" class="bottom font20r">{{item.noonText}}</view>  
177 - <view wx:if="{{item.nigText}}" class="bottom font20r">{{item.nigText}}</view>  
178 - </view> 169 + </view>
  170 + <view wx:if="{{item.endDateStr}}" class="font20r bottomTitle">有效日期:<view class="bottom font20r">{{item.endDateStr}}</view>
  171 + </view>
  172 + <!-- <view class="font20r bottom">{{item.arule.is_same_day=='1'?'领取当日可用':'领取当日不可用'}}</view>
  173 + <view wx:if="{{item.aexpiration>0}}" class="font20r bottom">领取后{{item.aexpiration}}天内使用</view>
  174 + <view wx:if="{{item.cdateText}}" class="font20r bottom">领取日期:{{item.cdateText}}</view> -->
  175 + <view wx:if="{{item.morText || item.noonText || item.nigText}}" class="font20r bottomTitle"><text>不可使用:</text>
  176 + <view class="textBox">
  177 + <view wx:if="{{item.morText}}" class="bottom font20r">{{item.morText}}</view>
  178 + <view wx:if="{{item.noonText}}" class="bottom font20r">{{item.noonText}}</view>
  179 + <view wx:if="{{item.nigText}}" class="bottom font20r">{{item.nigText}}</view>
179 </view> 180 </view>
180 - <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font20r">无使用时间限制</view>  
181 </view> 181 </view>
182 - <checkbox disabled="{{item.showCpupon == '0'}}" value="{{item.activity_id}}" checked="{{item.checked}}" /> 182 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font20r">无使用时间限制</view>
  183 + </view>
  184 + <view class="rightBox">
  185 + <view class="ownNum font20r">拥有{{item.num}}张</view>
  186 + <view class="numBox">
  187 + <view class="numBtn {{item.checkedNum == 0 ? 'numBtnDisabled' : ''}}" bindtap="changeCouponNum" data-aid="{{item.aid}}" data-type="minus">-</view>
  188 + <input class="numText" type="number" value="{{item.checkedNum}}" data-aid="{{item.aid}}" disabled="{{item.showCpupon == '0'}}" bindinput="numInputChange" />
  189 + <view class="numBtn {{item.canAdd != '1' ? 'numBtnDisabled' : ''}}" bindtap="changeCouponNum" data-aid="{{item.aid}}" data-type="plus">+</view>
  190 + </view>
183 </view> 191 </view>
184 - </checkbox-group> 192 + </view>
185 </scroll-view> 193 </scroll-view>
186 </view> 194 </view>
187 </my-modal> 195 </my-modal>
@@ -69,10 +69,6 @@ page { @@ -69,10 +69,6 @@ page {
69 margin-left: 10rpx; 69 margin-left: 10rpx;
70 } 70 }
71 71
72 -.colorNine {  
73 - color: #999;  
74 -}  
75 -  
76 .colorOrange { 72 .colorOrange {
77 color: #ED7B2F; 73 color: #ED7B2F;
78 } 74 }
@@ -181,14 +177,14 @@ page { @@ -181,14 +177,14 @@ page {
181 } 177 }
182 178
183 .itemLeft { 179 .itemLeft {
184 - width: 25%; 180 + min-width: 21%;
185 display: flex; 181 display: flex;
186 align-items: center; 182 align-items: center;
187 flex-direction: column; 183 flex-direction: column;
188 justify-content: center; 184 justify-content: center;
189 border-right: 2rpx dashed #09BB07; 185 border-right: 2rpx dashed #09BB07;
190 - padding-right: 14rpx;  
191 - margin-right: 14rpx; 186 + padding-right: 10rpx;
  187 + margin-right: 10rpx;
192 } 188 }
193 189
194 .couponModal1 { 190 .couponModal1 {
@@ -219,20 +215,25 @@ page { @@ -219,20 +215,25 @@ page {
219 215
220 .anameText { 216 .anameText {
221 display: flex; 217 display: flex;
  218 + justify-content: space-between;
222 } 219 }
223 220
224 .anameText { 221 .anameText {
225 margin-bottom: 14rpx; 222 margin-bottom: 14rpx;
226 } 223 }
227 224
228 -.anameText text { 225 +.anameText .names {
229 font-family: PingFang SC; 226 font-family: PingFang SC;
230 font-weight: 600; 227 font-weight: 600;
231 line-height: 48rpx; 228 line-height: 48rpx;
232 display: flex; 229 display: flex;
233 flex-wrap: wrap; 230 flex-wrap: wrap;
234 justify-content: flex-end; 231 justify-content: flex-end;
  232 + display: -webkit-box;
235 word-break: break-all; 233 word-break: break-all;
  234 + word-wrap: break-word;
  235 + overflow: hidden;
  236 + text-align: left;
236 } 237 }
237 238
238 .discountText1 { 239 .discountText1 {
@@ -242,6 +243,20 @@ page { @@ -242,6 +243,20 @@ page {
242 margin: 0 20rpx; 243 margin: 0 20rpx;
243 } 244 }
244 245
  246 +.anameInfo {
  247 + display: flex;
  248 + align-items: center;
  249 + flex-wrap: wrap;
  250 +}
  251 +
  252 +.ownNum {
  253 + text-align: center;
  254 + color: #fe6d03;
  255 + font-family: PingFang SC;
  256 + font-weight: 500;
  257 + flex-shrink: 0;
  258 +}
  259 +
245 .textBox { 260 .textBox {
246 width: 90%; 261 width: 90%;
247 display: flex; 262 display: flex;
@@ -312,6 +327,47 @@ checkbox::before { @@ -312,6 +327,47 @@ checkbox::before {
312 content: '' !important; 327 content: '' !important;
313 } 328 }
314 329
  330 +.numBox {
  331 + display: flex;
  332 + align-items: center;
  333 + justify-content: center;
  334 + margin: 30rpx 10rpx 0 10rpx;
  335 + flex-shrink: 0;
  336 + align-self: center;
  337 +}
  338 +
  339 +.numBtn {
  340 + width: 44rpx;
  341 + height: 44rpx;
  342 + border-radius: 50%;
  343 + background: linear-gradient(90deg, #ff4d11 0%, #fe7600 100%);
  344 + color: #ffffff;
  345 + font-size: 48rpx;
  346 + font-weight: 600;
  347 + line-height: 44rpx;
  348 + text-align: center;
  349 +}
  350 +
  351 +.numBox .numBtn:first-child {
  352 + line-height: 40rpx;
  353 +}
  354 +
  355 +.numBtnDisabled {
  356 + background: #cccccc;
  357 +}
  358 +
  359 +.numText {
  360 + min-width: 48rpx;
  361 + width: 64rpx;
  362 + height: 44rpx;
  363 + border: 2rpx solid #c8c8c8;
  364 + margin: 0 10rpx;
  365 + text-align: center;
  366 + font-size: 28rpx;
  367 + font-weight: 600;
  368 + color: #333333;
  369 +}
  370 +
315 .mymodal .mymodal-content { 371 .mymodal .mymodal-content {
316 height: 80% !important; 372 height: 80% !important;
317 } 373 }
@@ -324,12 +380,18 @@ checkbox::before { @@ -324,12 +380,18 @@ checkbox::before {
324 border-right: 2rpx dashed #999; 380 border-right: 2rpx dashed #999;
325 } 381 }
326 382
  383 +.couponNo .numText {
  384 + border: 2rpx solid #999;
  385 + color: #999;
  386 +}
  387 +
327 .couponNo .priceText, 388 .couponNo .priceText,
328 .couponNo .icons, 389 .couponNo .icons,
329 .couponNo .priceText, 390 .couponNo .priceText,
330 .couponNo .itemRight, 391 .couponNo .itemRight,
331 .couponNo .discountText1, 392 .couponNo .discountText1,
332 .couponNo .bottomTitle, 393 .couponNo .bottomTitle,
  394 +.couponNo .ownNum,
333 .couponNo .bottom { 395 .couponNo .bottom {
334 color: #999; 396 color: #999;
335 } 397 }
@@ -104,6 +104,15 @@ @@ -104,6 +104,15 @@
104 顾客生日当天可用 104 顾客生日当天可用
105 </view> 105 </view>
106 </view> 106 </view>
  107 + <view class="centerMain" wx:if="{{detail.single_use_limit && ((detail.single_use_limit*1) > 0)}}">
  108 + <view class="title">
  109 + <image src="https://qn.colorcun.com/restrictionsIcon.png" mode="" />
  110 + <text class="font32r">使用限制</text>
  111 + </view>
  112 + <view class="info font28r">
  113 + 单次可用{{detail.single_use_limit}}张
  114 + </view>
  115 + </view>
107 <view class="centerMain" wx:if="{{detail.is_type == '3'}}"> 116 <view class="centerMain" wx:if="{{detail.is_type == '3'}}">
108 <view class="title"> 117 <view class="title">
109 <image src="https://qn.colorcun.com/voucherUnion_4.png" mode="" /> 118 <image src="https://qn.colorcun.com/voucherUnion_4.png" mode="" />
@@ -1055,6 +1055,9 @@ Page({ @@ -1055,6 +1055,9 @@ Page({
1055 if (!content) { 1055 if (!content) {
1056 return; 1056 return;
1057 } 1057 }
  1058 + this.setData({
  1059 + isPlay: '1',
  1060 + })
1058 data.detail.rname = data.detail.rname.trim() 1061 data.detail.rname = data.detail.rname.trim()
1059 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1062 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1060 let charArray = data.seller.deskStr.split(''); 1063 let charArray = data.seller.deskStr.split('');
@@ -1085,6 +1085,9 @@ Page({ @@ -1085,6 +1085,9 @@ Page({
1085 if (!content) { 1085 if (!content) {
1086 return; 1086 return;
1087 } 1087 }
  1088 + this.setData({
  1089 + isPlay: '1',
  1090 + })
1088 data.detail.rname = data.detail.rname.trim() 1091 data.detail.rname = data.detail.rname.trim()
1089 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1092 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1090 let charArray = data.seller.deskStr.split(''); 1093 let charArray = data.seller.deskStr.split('');
@@ -1083,6 +1083,9 @@ Page({ @@ -1083,6 +1083,9 @@ Page({
1083 if (!content) { 1083 if (!content) {
1084 return; 1084 return;
1085 } 1085 }
  1086 + this.setData({
  1087 + isPlay: '1',
  1088 + })
1086 data.detail.rname = data.detail.rname.trim() 1089 data.detail.rname = data.detail.rname.trim()
1087 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1090 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1088 let charArray = data.seller.deskStr.split(''); 1091 let charArray = data.seller.deskStr.split('');
@@ -907,6 +907,9 @@ Page({ @@ -907,6 +907,9 @@ Page({
907 if (!content) { 907 if (!content) {
908 return; 908 return;
909 } 909 }
  910 + this.setData({
  911 + isPlay: '1',
  912 + })
910 data.detail.rname = data.detail.rname.trim() 913 data.detail.rname = data.detail.rname.trim()
911 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 914 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
912 let charArray = data.seller.deskStr.split(''); 915 let charArray = data.seller.deskStr.split('');
@@ -1135,6 +1135,9 @@ Page({ @@ -1135,6 +1135,9 @@ Page({
1135 if (!content) { 1135 if (!content) {
1136 return; 1136 return;
1137 } 1137 }
  1138 + this.setData({
  1139 + isPlay: '1',
  1140 + })
1138 data.detail.rname = data.detail.rname.trim() 1141 data.detail.rname = data.detail.rname.trim()
1139 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1142 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1140 let charArray = data.seller.deskStr.split(''); 1143 let charArray = data.seller.deskStr.split('');
@@ -1042,6 +1042,9 @@ Page({ @@ -1042,6 +1042,9 @@ Page({
1042 if (!content) { 1042 if (!content) {
1043 return; 1043 return;
1044 } 1044 }
  1045 + this.setData({
  1046 + isPlay: '1',
  1047 + })
1045 data.detail.rname = data.detail.rname.trim() 1048 data.detail.rname = data.detail.rname.trim()
1046 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1049 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1047 let charArray = data.seller.deskStr.split(''); 1050 let charArray = data.seller.deskStr.split('');
@@ -1042,6 +1042,9 @@ Page({ @@ -1042,6 +1042,9 @@ Page({
1042 if (!content) { 1042 if (!content) {
1043 return; 1043 return;
1044 } 1044 }
  1045 + this.setData({
  1046 + isPlay: '1',
  1047 + })
1045 data.detail.rname = data.detail.rname.trim() 1048 data.detail.rname = data.detail.rname.trim()
1046 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1049 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1047 let charArray = data.seller.deskStr.split(''); 1050 let charArray = data.seller.deskStr.split('');
@@ -1041,6 +1041,9 @@ Page({ @@ -1041,6 +1041,9 @@ Page({
1041 if (!content) { 1041 if (!content) {
1042 return; 1042 return;
1043 } 1043 }
  1044 + this.setData({
  1045 + isPlay: '1',
  1046 + })
1044 data.detail.rname = data.detail.rname.trim() 1047 data.detail.rname = data.detail.rname.trim()
1045 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1048 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1046 let charArray = data.seller.deskStr.split(''); 1049 let charArray = data.seller.deskStr.split('');
@@ -999,6 +999,9 @@ Page({ @@ -999,6 +999,9 @@ Page({
999 if (!content) { 999 if (!content) {
1000 return; 1000 return;
1001 } 1001 }
  1002 + this.setData({
  1003 + isPlay: '1',
  1004 + })
1002 data.detail.rname = data.detail.rname.trim() 1005 data.detail.rname = data.detail.rname.trim()
1003 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1006 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1004 let charArray = data.seller.deskStr.split(''); 1007 let charArray = data.seller.deskStr.split('');
@@ -1042,6 +1042,9 @@ Page({ @@ -1042,6 +1042,9 @@ Page({
1042 if (!content) { 1042 if (!content) {
1043 return; 1043 return;
1044 } 1044 }
  1045 + this.setData({
  1046 + isPlay: '1',
  1047 + })
1045 data.detail.rname = data.detail.rname.trim() 1048 data.detail.rname = data.detail.rname.trim()
1046 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1049 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1047 let charArray = data.seller.deskStr.split(''); 1050 let charArray = data.seller.deskStr.split('');
@@ -1041,6 +1041,9 @@ Page({ @@ -1041,6 +1041,9 @@ Page({
1041 if (!content) { 1041 if (!content) {
1042 return; 1042 return;
1043 } 1043 }
  1044 + this.setData({
  1045 + isPlay: '1',
  1046 + })
1044 data.detail.rname = data.detail.rname.trim() 1047 data.detail.rname = data.detail.rname.trim()
1045 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1048 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1046 let charArray = data.seller.deskStr.split(''); 1049 let charArray = data.seller.deskStr.split('');
@@ -1086,6 +1086,9 @@ Page({ @@ -1086,6 +1086,9 @@ Page({
1086 if (!content) { 1086 if (!content) {
1087 return; 1087 return;
1088 } 1088 }
  1089 + this.setData({
  1090 + isPlay: '1',
  1091 + })
1089 data.detail.rname = data.detail.rname.trim() 1092 data.detail.rname = data.detail.rname.trim()
1090 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : ''; 1093 let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
1091 let charArray = data.seller.deskStr.split(''); 1094 let charArray = data.seller.deskStr.split('');