Compare View
Commits (3)
Showing
1 changed file
Show diff stats
src/pages/purchaseLenses/purchaseLenses.vue
... | ... | @@ -36,7 +36,140 @@ |
36 | 36 | <view class="opCollapse"> |
37 | 37 | <view class="body"> |
38 | 38 | <template v-if="opIsOpen"> |
39 | - <view class="goods-form"> | |
39 | + <view class="goods-form"> | |
40 | + <view class="p1"> | |
41 | + <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> | |
42 | + 填写验光数据 | |
43 | + </view> | |
44 | + <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> | |
45 | + <view class="picker"> | |
46 | + <view class="picker-choice"> | |
47 | + <view class="choice-left"> | |
48 | + <text class="pd">验光单取名:</text> | |
49 | + </view> | |
50 | + <input type="text" @blur="handleInput" class="input" | |
51 | + placeholder="请输入名称" maxlength="20" :value="name" /> | |
52 | + </view> | |
53 | + </view> | |
54 | + <view class="picker" > | |
55 | + <view class="picker-choice"> | |
56 | + <view class="choice-left"> | |
57 | + <text class="p11">{{pickerInfoList[0].nameC}}</text> | |
58 | + <text class="p12">{{pickerInfoList[0].nameE}}</text> | |
59 | + </view> | |
60 | + <text class="p13">左 (OD)</text> | |
61 | + <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> | |
62 | + <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> | |
63 | + <view class="p14"> | |
64 | + {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} | |
65 | + <image src="../../static/detail-tabicon.png" ></image> | |
66 | + </view> | |
67 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
68 | + </picker> | |
69 | + <text class="p13">右 (OS)</text> | |
70 | + <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> | |
71 | + <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> | |
72 | + <view class="p14"> | |
73 | + {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} | |
74 | + <image src="../../static/detail-tabicon.png" ></image> | |
75 | + </view> | |
76 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
77 | + </picker> | |
78 | + </view> | |
79 | + </view> | |
80 | + <view class="picker" > | |
81 | + <view class="picker-choice"> | |
82 | + <view class="choice-left"> | |
83 | + <text class="p11">{{pickerInfoList[1].nameC}}</text> | |
84 | + <text class="p12">{{pickerInfoList[1].nameE}}</text> | |
85 | + </view> | |
86 | + <text class="p13">左 (OD)</text> | |
87 | + <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> | |
88 | + <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> | |
89 | + <view class="p14"> | |
90 | + {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} | |
91 | + <image src="../../static/detail-tabicon.png" ></image> | |
92 | + </view> | |
93 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
94 | + </picker> | |
95 | + <text class="p13">右 (OS)</text> | |
96 | + <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> | |
97 | + <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> | |
98 | + <view class="p14"> | |
99 | + {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} | |
100 | + <image src="../../static/detail-tabicon.png" ></image> | |
101 | + </view> | |
102 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
103 | + </picker> | |
104 | + </view> | |
105 | + </view> | |
106 | + <view class="picker" > | |
107 | + <view class="picker-choice"> | |
108 | + <view class="choice-left"> | |
109 | + <text class="p11">{{pickerInfoList[2].nameC}}</text> | |
110 | + <text class="p12">{{pickerInfoList[2].nameE}}</text> | |
111 | + </view> | |
112 | + <text class="p13">左 (OD)</text> | |
113 | + <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> | |
114 | + <view class="p14"> | |
115 | + {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} | |
116 | + <image src="../../static/detail-tabicon.png" ></image> | |
117 | + </view> | |
118 | + </picker> | |
119 | + <text class="p13">右 (OS)</text> | |
120 | + <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> | |
121 | + <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> | |
122 | + <view class="p14"> | |
123 | + {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} | |
124 | + <image src="../../static/detail-tabicon.png" ></image> | |
125 | + </view> | |
126 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
127 | + </picker> | |
128 | + </view> | |
129 | + </view> | |
130 | + <view class="picker"> | |
131 | + <view class="picker-choice"> | |
132 | + <view class="choice-left"> | |
133 | + <text class="pd">瞳距:</text> | |
134 | + </view> | |
135 | + <input type="digit" @change="handleInputPd" class="input" | |
136 | + placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> | |
137 | + </view> | |
138 | + </view> | |
139 | + <view class="picker" > | |
140 | + <view class="picker-choice"> | |
141 | + <view class="choice-left"> | |
142 | + <text class="p11">{{pickerInfoList[3].nameC}}</text> | |
143 | + </view> | |
144 | + <text class="p13-date">年 (Y)</text> | |
145 | + <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> | |
146 | + <view class="p14" style="width: 30px;"> | |
147 | + {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} | |
148 | + <image src="../../static/detail-tabicon.png" ></image> | |
149 | + </view> | |
150 | + </picker> | |
151 | + <text class="p13-date">月 (M)</text> | |
152 | + <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> | |
153 | + <view class="p14" style="width: 30px;"> | |
154 | + {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} | |
155 | + <image src="../../static/detail-tabicon.png" ></image> | |
156 | + </view> | |
157 | + </picker> | |
158 | + <text class="p13-date">日 (D)</text> | |
159 | + <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> | |
160 | + <view class="p14" style="width: 30px;"> | |
161 | + {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} | |
162 | + <image src="../../static/detail-tabicon.png" ></image> | |
163 | + </view> | |
164 | + </picker> | |
165 | + </view> | |
166 | + </view> | |
167 | + <view class="confirm"> | |
168 | + <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> | |
169 | + <text>确认以上输入信息来源于我的验光数据!</text> | |
170 | + </view> | |
171 | + </view> | |
172 | + <!-- <view class="goods-form"> | |
40 | 173 | <view class="data-title"> |
41 | 174 | <image src="../../static/icon-data.png"></image> |
42 | 175 | <text class="p1">填写验光数据</text> |
... | ... | @@ -209,7 +342,7 @@ |
209 | 342 | ></image> |
210 | 343 | <text>确认以上输入信息来源于我的验光数据!</text> |
211 | 344 | </view> |
212 | - </view> | |
345 | + </view> --> | |
213 | 346 | |
214 | 347 | </template> |
215 | 348 | <template v-else> |
... | ... | @@ -418,13 +551,33 @@ export default { |
418 | 551 | ], |
419 | 552 | chooseItem3: [0, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 470, 500, 525, 550, 575, 600, 1000], |
420 | 553 | // 度数相关数据 |
421 | - pickerInfoList: [ | |
422 | - { nameC: '度数', nameE: '(SPH)', nameArray1: [1.5, 2.5, 3.5, 4.5], nameIndex1: 0, nameArray2: [1.5, 2.5, 3.5, 4.5], nameIndex2: 0, key: 0 }, | |
423 | - { nameC: '散光', nameE: '(CYL)', nameArray1: [1.5, 2.5, 3.5, 4.5], nameIndex1: 0, nameArray2: [1.5, 2.5, 3.5, 4.5], nameIndex2: 0, key: 1 }, | |
424 | - { nameC: '散光轴位', nameE: '(AXI)', nameArray1: [1.5, 2.5, 3.5, 4.5], nameIndex1: 0, nameArray2: [1.5, 2.5, 3.5, 4.5], nameIndex2: 0, key: 2 }, | |
425 | - { nameC: '双眼瞳距', nameE: '(PD)', nameArray1: [1.5, 2.5, 3.5, 4.5], nameIndex1: 0, nameArray2: [1.5, 2.5, 3.5, 4.5], nameIndex2: 0, key: 3 }, | |
426 | - { nameC: '验光日期', nameE: '', nameArray1: [2017, 2018, 2019, 2020, 2021], nameIndex1: 0, nameArray2: [1, 2, 3, 4, 5, 6, 7], nameIndex2: 0, nameArray3: [1, 2, 3, 4, 5, 6], nameIndex3: 0 } | |
427 | - ] | |
554 | + pickerInfoList:[ | |
555 | + {nameC:"度数",nameE:"(SPH)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:0}, | |
556 | + {nameC:"散光",nameE:"(CYL)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:1}, | |
557 | + {nameC:"散光轴位",nameE:"(AXI)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:2}, | |
558 | + {nameC:"验光日期",nameE:'',nameArray1:[''],nameIndex1:0,nameArray2:['',1,2,3,4,5,6,7,8,9,10,11,12],nameIndex2:0,nameArray3:[''],nameIndex3:0} | |
559 | + ], | |
560 | + confirm: false, // 用户是否确认 | |
561 | + tabicon:['/static/detail-button.png','/static/detail-button-unselected.png'], | |
562 | + name: '夏小花', | |
563 | + oldname:'',// 用于判读用户是否改变名字 | |
564 | + pickerInfoChioce:{ | |
565 | + "leftSph": '', | |
566 | + "rightSph": '', | |
567 | + "leftCyl": '', | |
568 | + "rightCyl": '', | |
569 | + "leftAxi": '', | |
570 | + "rightAxi": '', | |
571 | + "time":{ | |
572 | + "year":0, | |
573 | + "month": 0, | |
574 | + "day":0 , | |
575 | + } | |
576 | + }, | |
577 | + pd: '',// 瞳距 | |
578 | + oldpd: '',// 用于判断用户是否改变瞳距 | |
579 | + kinds:1, // kinds=1,提交为新增验光,2为修改 | |
580 | + mp_id: Number | |
428 | 581 | } |
429 | 582 | }, |
430 | 583 | computed: { |
... | ... | @@ -453,34 +606,191 @@ export default { |
453 | 606 | this.show = show |
454 | 607 | }) |
455 | 608 | store.dispatch('myLoveList/getLoveList') |
609 | + | |
610 | + // 初始化SPL、CYL、AXI的值 | |
611 | + for (let j = 0; j < 3; j++) { | |
612 | + for(let i=-12;i<6;i++){ | |
613 | + this.pickerInfoList[j].nameArray1.push(i) | |
614 | + this.pickerInfoList[j].nameArray1.push(i+0.5) | |
615 | + this.pickerInfoList[j].nameArray2.push(i) | |
616 | + this.pickerInfoList[j].nameArray2.push(i+0.5) | |
617 | + if(i>=-6){ | |
618 | + this.pickerInfoList[j].nameArray1.push(i+0.25) | |
619 | + this.pickerInfoList[j].nameArray1.push(i+0.75) | |
620 | + this.pickerInfoList[j].nameArray2.push(i+0.25) | |
621 | + this.pickerInfoList[j].nameArray2.push(i+0.75) | |
622 | + } | |
623 | + if(i==5){ | |
624 | + this.pickerInfoList[j].nameArray1.push(i+1) | |
625 | + this.pickerInfoList[j].nameArray2.push(i+1) | |
626 | + } | |
627 | + } | |
628 | + } | |
629 | + // 初始化日期值 | |
630 | + for (let i = 1; i < 32; i++){ | |
631 | + this.pickerInfoList[3].nameArray3.push(i) | |
632 | + } | |
633 | + // 初始化年份前后五年 | |
634 | + let myDate = new Date(); | |
635 | + let nowYear = myDate.getFullYear(); | |
636 | + for(let i=0;i<5;i++){ | |
637 | + this.pickerInfoList[3].nameArray1.push(nowYear-i) | |
638 | + } | |
456 | 639 | }, |
457 | 640 | methods: { |
641 | + // picker相关功能 | |
642 | + handleInput(e){ | |
643 | + this.name=e.target.value | |
644 | + this.isDataName = false | |
645 | + console.log('e---->', e) | |
646 | + const mpList = this.mpList | |
647 | + console.log('mpList===>',mpList) | |
648 | + for (let index = 0; index < mpList.length; index++) { | |
649 | + if (e.detail.value === mpList[index].name) { | |
650 | + this.isDataName = true | |
651 | + uni.showModal({ | |
652 | + title: '提示', | |
653 | + content: `是否填充已有的"${e.detail.value}"的数据`, | |
654 | + success: ({ confirm }) => { | |
655 | + if (confirm) { | |
656 | + this.kinds=2 | |
657 | + console.log('args===>',index) | |
658 | + // const mpList=Object.assign({},this.$store.state.mympList.mpList) | |
659 | + console.log('mpList===>',mpList) | |
660 | + this.name=mpList[index].name | |
661 | + this.pd=mpList[index].pd | |
662 | + this.mp_id=mpList[index].mp_id | |
663 | + this.oldname=mpList[index].name | |
664 | + this.oldpd=mpList[index].pd | |
665 | + // 将kinds =2时的值传到该页面 | |
666 | + this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) | |
667 | + this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) | |
668 | + this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) | |
669 | + this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) | |
670 | + this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) | |
671 | + this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) | |
672 | + | |
673 | + this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0,4)) | |
674 | + if(mpList[index].in_time.toString().slice(5,6)==0){ | |
675 | + this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6,7)) | |
676 | + } else{ | |
677 | + this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5,7)) | |
678 | + } | |
679 | + if(mpList[index].in_time.toString().slice(8,9)==0){ | |
680 | + this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9,10)) | |
681 | + } else{ | |
682 | + this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8,10)) | |
683 | + } | |
684 | + // this.checkedData = mpList[index] | |
685 | + // console.log('checkedData', this.checkedData) | |
686 | + } | |
687 | + } | |
688 | + }) | |
689 | + } | |
690 | + } | |
691 | + }, | |
692 | + handleInputPd(e){ | |
693 | + // 只能输入正浮点数或正数 | |
694 | + if(/^\d+(\.\d+)?$/.test(e.target.value)){ | |
695 | + this.pd=e.target.value | |
696 | + } else { | |
697 | + uni.showToast({ | |
698 | + title:"请输入有效数据;示例:89", | |
699 | + icon: "none", | |
700 | + duration: 2000, | |
701 | + }) | |
702 | + this.pd = '' | |
703 | + } | |
704 | + | |
705 | + }, | |
706 | + changeConfirm() { | |
707 | + this.confirm = !this.confirm | |
708 | + }, | |
709 | + bindPickerChange01: function(e) { | |
710 | + this.pickerInfoList[0].nameIndex1 = e.target.value | |
711 | + this.pickerInfoChioce.leftSph=this.pickerInfoList[0].nameArray1[e.target.value] | |
712 | + }, | |
713 | + bindPickerChange02: function(e) { | |
714 | + this.pickerInfoList[0].nameIndex2 = e.target.value | |
715 | + this.pickerInfoChioce.rightSph=this.pickerInfoList[0].nameArray2[e.target.value] | |
716 | + }, | |
717 | + | |
718 | + bindPickerChange11: function(e) { | |
719 | + this.pickerInfoList[1].nameIndex1 = e.target.value | |
720 | + this.pickerInfoChioce.leftCyl=this.pickerInfoList[1].nameArray1[e.target.value] | |
721 | + }, | |
722 | + bindPickerChange12: function(e) { | |
723 | + this.pickerInfoList[1].nameIndex2 = e.target.value | |
724 | + this.pickerInfoChioce.rightCyl=this.pickerInfoList[1].nameArray2[e.target.value] | |
725 | + }, | |
726 | + | |
727 | + bindPickerChange21: function(e) { | |
728 | + this.pickerInfoList[2].nameIndex1 = e.target.value | |
729 | + this.pickerInfoChioce.leftAxi=this.pickerInfoList[2].nameArray1[e.target.value] | |
730 | + }, | |
731 | + bindPickerChange22: function(e) { | |
732 | + this.pickerInfoList[2].nameIndex2 = e.target.value | |
733 | + this.pickerInfoChioce.rightAxi=this.pickerInfoList[2].nameArray2[e.target.value] | |
734 | + }, | |
735 | + | |
736 | + bindPickerChange41: function(e) { | |
737 | + this.pickerInfoList[3].nameIndex1 = e.target.value | |
738 | + this.pickerInfoChioce.time.year=this.pickerInfoList[3].nameArray1[e.target.value] | |
739 | + }, | |
740 | + bindPickerChange42: function(e) { | |
741 | + this.pickerInfoList[3].nameIndex2 = e.target.value | |
742 | + this.pickerInfoChioce.time.month=this.pickerInfoList[3].nameArray2[e.target.value] | |
743 | + }, | |
744 | + bindPickerChange43: function(e) { | |
745 | + this.pickerInfoList[3].nameIndex3 = e.target.value | |
746 | + this.pickerInfoChioce.time.day=this.pickerInfoList[3].nameArray3[e.target.value] | |
747 | + }, | |
748 | + | |
458 | 749 | // 是否填充人员数据 |
459 | - fillData(e) { | |
460 | - this.isDataName = false | |
461 | - console.log('e---->', e) | |
462 | - const mpList = this.mpList | |
750 | + // fillData(e) { | |
751 | + // this.isDataName = false | |
752 | + // console.log('e---->', e) | |
753 | + // const mpList = this.mpList | |
463 | 754 | |
464 | - for (let index = 0; index < mpList.length; index++) { | |
465 | - if (e.detail.value === mpList[index].name) { | |
466 | - this.isDataName = true | |
467 | - uni.showModal({ | |
468 | - title: '提示', | |
469 | - content: `是否自动填充已保存的${e.detail.value}的数据`, | |
470 | - success: ({ confirm }) => { | |
471 | - if (confirm) { | |
472 | - this.checkedData = mpList[index] | |
473 | - console.log('checkedData', this.checkedData) | |
474 | - } | |
475 | - } | |
476 | - }) | |
477 | - } | |
478 | - } | |
479 | - }, | |
480 | - // 确认验光数据 | |
481 | - changeConfirm() { | |
755 | +// <<<<<<< HEAD | |
756 | + // for (let index = 0; index < mpList.length; index++) { | |
757 | + // if (e.detail.value === mpList[index].name) { | |
758 | + // this.isDataName = true | |
759 | + // uni.showModal({ | |
760 | + // title: '提示', | |
761 | + // content: `是否填充已有的${e.detail.value}的数据`, | |
762 | + // success: ({ confirm }) => { | |
763 | + // if (confirm) { | |
764 | + // this.checkedData = mpList[index] | |
765 | + // console.log('checkedData', this.checkedData) | |
766 | + // } | |
767 | + // } | |
768 | + // }) | |
769 | + // } | |
770 | + // } | |
771 | + // }, | |
772 | +// ======= | |
773 | + // for (let index = 0; index < mpList.length; index++) { | |
774 | + // if (e.detail.value === mpList[index].name) { | |
775 | + // this.isDataName = true | |
776 | + // uni.showModal({ | |
777 | + // title: '提示', | |
778 | + // content: `是否自动填充已保存的${e.detail.value}的数据`, | |
779 | + // success: ({ confirm }) => { | |
780 | + // if (confirm) { | |
781 | + // this.checkedData = mpList[index] | |
782 | + // console.log('checkedData', this.checkedData) | |
783 | + // } | |
784 | + // } | |
785 | + // }) | |
786 | + // } | |
787 | + // } | |
788 | + // }, | |
789 | + // // 确认验光数据 | |
790 | + // changeConfirm() { | |
482 | 791 | |
483 | - }, | |
792 | + // }, | |
793 | +// >>>>>>> 3a0878cc773855146d390a935b133980a5c0ee88 | |
484 | 794 | change(num) { |
485 | 795 | this.show[num] = !this.show[num] |
486 | 796 | this.$forceUpdate() |
... | ... | @@ -517,28 +827,176 @@ export default { |
517 | 827 | } |
518 | 828 | }, |
519 | 829 | toComfirmOrder() { |
520 | - let i = 0 | |
521 | - // 判断出是哪一个sku被选中 | |
522 | - for (let index = 0; index < this.current.length; index++) { | |
523 | - console.log('index', index, i, index !== this.current.length - 1) | |
524 | - if (index !== this.current.length - 1) { | |
525 | - console.log('----', this.current[index], this.attrList[1].attr.length, this.attrList) | |
526 | - i = this.current[index] * this.attrList[1].attr.length | |
527 | - } else { | |
528 | - i += this.current[index] | |
529 | - } | |
530 | - console.log('i', i) | |
531 | - } | |
532 | - console.log('i------>', i) | |
533 | - // 判断是否其输入的人员数据是否已存在 | |
534 | - store.dispatch('order/saveParams', { | |
535 | - sk_id_arr: this.skuList[i], | |
536 | - current: this.current | |
537 | - }) | |
830 | + // 先处理验光部分的逻辑,如果ok在跳转 | |
831 | + let flag=0; | |
832 | + if(this.name==''){ | |
833 | + uni.showToast({ | |
834 | + title:"请输入验光单取名", | |
835 | + icon: "none", | |
836 | + duration: 2000, | |
837 | + }) | |
838 | + }else{ | |
839 | + | |
840 | + if(this.pd==''){ | |
841 | + uni.showToast({ | |
842 | + title:"请输入瞳距", | |
843 | + icon: "none", | |
844 | + duration: 2000, | |
845 | + }) | |
846 | + }else{ | |
847 | + | |
848 | + if(this.kinds==1){ | |
849 | + // 添加用户验光单 | |
850 | + console.log('kinds====>',this.pickerInfoChioce.leftSph) | |
851 | + console.log('kinds====>',this.pickerInfoChioce.leftSph==Number) | |
852 | + console.log('kinds====>',this.pickerInfoChioce.rightSph==Number) | |
853 | + if(this.pickerInfoChioce.rightSph==''||this.pickerInfoChioce.leftSph==''|| | |
854 | + this.pickerInfoChioce.leftCyl==''||this.pickerInfoChioce.rightCyl==''|| | |
855 | + this.pickerInfoChioce.leftAxi==''||this.pickerInfoChioce.rightAxi=='' | |
856 | + ){ | |
857 | + uni.showToast({ | |
858 | + title:"请输入您的验光数据", | |
859 | + icon: "none", | |
860 | + duration: 2000, | |
861 | + }) | |
862 | + }else{ | |
863 | + if(this.confirm){ | |
864 | + store.dispatch('myLoveList/addMylove', { | |
865 | + uid: this.$store.state.user.userInfo.uid, | |
866 | + openid: this.$store.state.user.userInfo.openid, | |
867 | + // mp_name: this.$store.state.user.userInfo.mp_name, | |
868 | + leftSph: this.pickerInfoChioce.leftSph, | |
869 | + rightSph: this.pickerInfoChioce.rightSph, | |
870 | + leftCyl: this.pickerInfoChioce.leftCyl, | |
871 | + rightCyl: this.pickerInfoChioce.rightCyl, | |
872 | + leftAxi: this.pickerInfoChioce.leftAxi, | |
873 | + rightAxi: this.pickerInfoChioce.rightAxi, | |
874 | + pd: this.pd,// 瞳距 | |
875 | + mp_name:this.name, | |
876 | + // time: this.pickerInfoChioce.time, | |
877 | + // img_url2: "http://localhost:8087/images/shop_1/1/", | |
878 | + }); | |
879 | + store.dispatch('myLoveList/getLoveList', { | |
880 | + uid: this.$store.state.user.userInfo.uid, | |
881 | + }); | |
882 | + flag=1 | |
883 | + } else{ | |
884 | + uni.showToast({ | |
885 | + title:"请确认您的验光数据", | |
886 | + icon: "none", | |
887 | + duration: 3000, | |
888 | + }) | |
889 | + } | |
890 | + } | |
891 | + } | |
892 | + if(this.kinds==2){ | |
893 | + // console.log('kinds====>',this.kinds) | |
894 | + // console.log('pickerindex=====>',this.pickerInfoList[0].nameIndex1) | |
895 | + // console.log('this.pickerInfoChioce====>',type(this.pickerInfoChioce)) | |
896 | + if(this.confirm){ | |
897 | + const leftList = ["leftSph","leftCyl","leftAxi"]; | |
898 | + const rightList = ["rightSph", "rightCyl", "rightAxi"]; | |
899 | + // let flag=0; | |
900 | + if(this.name!=this.oldname){ | |
901 | + store.dispatch('myLoveList/updateMylove', { | |
902 | + uid: this.$store.state.user.userInfo.uid, | |
903 | + openid: this.$store.state.user.userInfo.openid, | |
904 | + mp_id: this.mp_id, | |
905 | + keyname: 'name', | |
906 | + keyvalue: this.name, | |
907 | + }); | |
908 | + flag=1 | |
909 | + } | |
910 | + if(this.pd!=this.oldpd){ | |
911 | + store.dispatch('myLoveList/updateMylove', { | |
912 | + uid: this.$store.state.user.userInfo.uid, | |
913 | + openid: this.$store.state.user.userInfo.openid, | |
914 | + mp_id: this.mp_id, | |
915 | + keyname: 'pd', | |
916 | + keyvalue: this.pd, | |
917 | + }); | |
918 | + flag=1 | |
919 | + } | |
920 | + // 先验证是否输入有无空 | |
921 | + let q= true; | |
922 | + for(let k=0; k<3;k++){ | |
923 | + q=q&&(this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1]!=''&& | |
924 | + this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2]!='') | |
925 | + } | |
926 | + if(q){ | |
927 | + | |
928 | + for (let j=0; j<3; j++) { | |
929 | + if(this.pickerInfoList[j].nameIndex1!=0){ | |
930 | + store.dispatch('myLoveList/updateMylove', { | |
931 | + uid: this.$store.state.user.userInfo.uid, | |
932 | + openid: this.$store.state.user.userInfo.openid, | |
933 | + mp_id: this.mp_id, | |
934 | + keyname: leftList[j], | |
935 | + keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], | |
936 | + }); | |
937 | + } | |
938 | + if(this.pickerInfoList[j].nameIndex2!=0){ | |
939 | + store.dispatch('myLoveList/updateMylove', { | |
940 | + uid: this.$store.state.user.userInfo.uid, | |
941 | + openid: this.$store.state.user.userInfo.openid, | |
942 | + mp_id: this.mp_id, | |
943 | + keyname: rightList[j], | |
944 | + keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2] | |
945 | + }); | |
946 | + } | |
947 | + flag=1; | |
948 | + } | |
949 | + }else{ | |
950 | + flag=0; | |
951 | + uni.showToast({ | |
952 | + title:"请输入您的验光数据", | |
953 | + icon: "none", | |
954 | + duration: 2000, | |
955 | + }) | |
956 | + | |
957 | + } | |
958 | + if(flag!=0){ | |
959 | + store.dispatch('myLoveList/getLoveList', { | |
960 | + uid: this.$store.state.user.userInfo.uid, | |
961 | + }); | |
962 | + } | |
963 | + | |
964 | + } else{ | |
965 | + uni.showToast({ | |
966 | + title:"请确认您的验光数据", | |
967 | + icon: "none", | |
968 | + duration: 3000, | |
969 | + }) | |
970 | + } | |
971 | + } | |
972 | + } | |
973 | + | |
974 | + } | |
975 | + if(flag!=0){ | |
976 | + let i = 0 | |
977 | + // 判断出是哪一个sku被选中 | |
978 | + for (let index = 0; index < this.current.length; index++) { | |
979 | + console.log('index', index, i, index !== this.current.length - 1) | |
980 | + if (index !== this.current.length - 1) { | |
981 | + console.log('----', this.current[index], this.attrList[1].attr.length, this.attrList) | |
982 | + i = this.current[index] * this.attrList[1].attr.length | |
983 | + } else { | |
984 | + i += this.current[index] | |
985 | + } | |
986 | + console.log('i', i) | |
987 | + } | |
988 | + console.log('i------>', i) | |
989 | + // 判断是否其输入的人员数据是否已存在 | |
990 | + store.dispatch('order/saveParams', { | |
991 | + sk_id_arr: this.skuList[i], | |
992 | + current: this.current | |
993 | + }) | |
994 | + | |
995 | + uni.navigateTo({ | |
996 | + url: `../confirmOrder/confirmOrder?pid=${this.pid}` | |
997 | + }) | |
998 | + } | |
538 | 999 | |
539 | - uni.navigateTo({ | |
540 | - url: `../confirmOrder/confirmOrder?pid=${this.pid}` | |
541 | - }) | |
542 | 1000 | } |
543 | 1001 | } |
544 | 1002 | } |
... | ... | @@ -686,98 +1144,223 @@ export default { |
686 | 1144 | } |
687 | 1145 | } |
688 | 1146 | } |
689 | - .goods-form { | |
690 | - display: flex; | |
691 | - flex-direction: column; | |
692 | - align-items: center; | |
693 | - justify-content: center; | |
694 | - background-color: #fff; | |
695 | - width: 100%; | |
696 | - .p1 { | |
697 | - font-size: 16px; | |
698 | - color: #333333; | |
699 | - letter-spacing: -0.3px; | |
700 | - text-align: justify; | |
701 | - line-height: 24px; | |
702 | - margin: 4px 0; | |
703 | - } | |
704 | - .p2 { | |
705 | - font-size: 12px; | |
706 | - color: #999999; | |
707 | - letter-spacing: -0.23px; | |
708 | - margin-bottom: 18rpx; | |
709 | - } | |
710 | - image { | |
711 | - width: 28rpx; | |
712 | - height: 26rpx; | |
713 | - } | |
714 | - .confirm { | |
715 | - display: flex; | |
716 | - align-items: center; | |
717 | - font-size: 12px; | |
718 | - color: #666666; | |
719 | - letter-spacing: -0.23px; | |
720 | - width: 684rpx; | |
721 | - image { | |
722 | - margin-right: 25rpx; | |
723 | - } | |
724 | - } | |
725 | - .picker { | |
726 | - display: flex; | |
727 | - flex-direction: column; | |
728 | - justify-content: center; | |
729 | - align-items: center; | |
730 | - width: 100%; | |
731 | - image { | |
732 | - width: 10px; | |
733 | - height: 10px; | |
734 | - margin-right: 5px; | |
735 | - } | |
736 | - .picker-choice { | |
737 | - display: flex; | |
738 | - width: 684rpx; | |
739 | - align-items: center; | |
740 | - margin-bottom: 40rpx; | |
741 | - .choice-left { | |
742 | - width: 210rpx; | |
743 | - .p11 { | |
744 | - font-size: 14px; | |
745 | - color: #333333; | |
746 | - letter-spacing: -0.26px; | |
747 | - text-align: justify; | |
748 | - line-height: 24px; | |
749 | - } | |
750 | - .p12 { | |
751 | - font-size: 10px; | |
752 | - color: #3f3f3f; | |
753 | - letter-spacing: -0.19px; | |
754 | - text-align: justify; | |
755 | - line-height: 24px; | |
756 | - } | |
757 | - } | |
758 | - .p13 { | |
759 | - font-size: 10px; | |
760 | - color: #999999; | |
761 | - letter-spacing: -0.19px; | |
762 | - margin-right: 10px; | |
763 | - } | |
764 | - .p13-date { | |
765 | - font-size: 10px; | |
766 | - color: #999999; | |
767 | - letter-spacing: -0.19px; | |
768 | - margin-right: 5px; | |
769 | - } | |
770 | - .p14 { | |
771 | - font-size: 14px; | |
772 | - color: #666666; | |
773 | - letter-spacing: -0.26px; | |
774 | - text-align: center; | |
775 | - width: 124rpx; | |
776 | - border-bottom: 1px solid #cfcfcf; | |
777 | - } | |
778 | - } | |
779 | - } | |
780 | - } | |
1147 | + | |
1148 | + // .goods-form { | |
1149 | + // display: flex; | |
1150 | + // flex-direction: column; | |
1151 | + // align-items: center; | |
1152 | + // justify-content: center; | |
1153 | + // background-color: #fff; | |
1154 | + // width: 100%; | |
1155 | + // .p1 { | |
1156 | + // font-size: 16px; | |
1157 | + // color: #333333; | |
1158 | + // letter-spacing: -0.3px; | |
1159 | + // text-align: justify; | |
1160 | + // line-height: 24px; | |
1161 | + // margin: 4px 0; | |
1162 | + // } | |
1163 | + // .p2 { | |
1164 | + // font-size: 12px; | |
1165 | + // color: #999999; | |
1166 | + // letter-spacing: -0.23px; | |
1167 | + // margin-bottom: 18rpx; | |
1168 | + // } | |
1169 | + // image { | |
1170 | + // width: 28rpx; | |
1171 | + // height: 26rpx; | |
1172 | + // } | |
1173 | + // .confirm { | |
1174 | + // display: flex; | |
1175 | + // align-items: center; | |
1176 | + // font-size: 12px; | |
1177 | + // color: #666666; | |
1178 | + // letter-spacing: -0.23px; | |
1179 | + // width: 684rpx; | |
1180 | + // image { | |
1181 | + // margin-right: 25rpx; | |
1182 | + // } | |
1183 | + // } | |
1184 | + // .picker { | |
1185 | + // display: flex; | |
1186 | + // flex-direction: column; | |
1187 | + // justify-content: center; | |
1188 | + // align-items: center; | |
1189 | + // width: 100%; | |
1190 | + // image { | |
1191 | + // width: 10px; | |
1192 | + // height: 10px; | |
1193 | + // margin-right: 5px; | |
1194 | + // } | |
1195 | + // .picker-choice { | |
1196 | + // display: flex; | |
1197 | + // width: 684rpx; | |
1198 | + // align-items: center; | |
1199 | + // margin-bottom: 40rpx; | |
1200 | + // .choice-left { | |
1201 | + // width: 210rpx; | |
1202 | + // .p11 { | |
1203 | + // font-size: 14px; | |
1204 | + // color: #333333; | |
1205 | + // letter-spacing: -0.26px; | |
1206 | + // text-align: justify; | |
1207 | + // line-height: 24px; | |
1208 | + // } | |
1209 | + // .p12 { | |
1210 | + // font-size: 10px; | |
1211 | + // color: #3f3f3f; | |
1212 | + // letter-spacing: -0.19px; | |
1213 | + // text-align: justify; | |
1214 | + // line-height: 24px; | |
1215 | + // } | |
1216 | + // } | |
1217 | + // .p13 { | |
1218 | + // font-size: 10px; | |
1219 | + // color: #999999; | |
1220 | + // letter-spacing: -0.19px; | |
1221 | + // margin-right: 10px; | |
1222 | + // } | |
1223 | + // .p13-date { | |
1224 | + // font-size: 10px; | |
1225 | + // color: #999999; | |
1226 | + // letter-spacing: -0.19px; | |
1227 | + // margin-right: 5px; | |
1228 | + // } | |
1229 | + // .p14 { | |
1230 | + // font-size: 14px; | |
1231 | + // color: #666666; | |
1232 | + // letter-spacing: -0.26px; | |
1233 | + // text-align: center; | |
1234 | + // width: 124rpx; | |
1235 | + // border-bottom: 1px solid #cfcfcf; | |
1236 | + // } | |
1237 | + // } | |
1238 | + // } | |
1239 | + // } | |
1240 | + .goods-form { | |
1241 | + display: flex; | |
1242 | + flex-direction: column; | |
1243 | + align-items: center; | |
1244 | + justify-content: center; | |
1245 | + background-color: #fff; | |
1246 | + width: 100%; | |
1247 | + padding: 40rpx 0; | |
1248 | + .p1 { | |
1249 | + font-size: 16px; | |
1250 | + color: #333333; | |
1251 | + letter-spacing: -0.3px; | |
1252 | + text-align: justify; | |
1253 | + line-height: 24px; | |
1254 | + margin: 4px 0; | |
1255 | + | |
1256 | + } | |
1257 | + .p2 { | |
1258 | + font-size: 12px; | |
1259 | + color: #999999; | |
1260 | + letter-spacing: -0.23px; | |
1261 | + margin-bottom: 32rpx; | |
1262 | + } | |
1263 | + .image2{ | |
1264 | + width: 42rpx; | |
1265 | + height: 34rpx; | |
1266 | + margin-right: 12rpx; | |
1267 | + } | |
1268 | + .confirm { | |
1269 | + display: flex; | |
1270 | + align-items: center; | |
1271 | + font-size: 12px; | |
1272 | + color: #666666; | |
1273 | + letter-spacing: -0.23px; | |
1274 | + width: 684rpx; | |
1275 | + .image1{ | |
1276 | + margin-right:25rpx; | |
1277 | + width: 42rpx; | |
1278 | + height: 38rpx; | |
1279 | + } | |
1280 | + } | |
1281 | + .picker{ | |
1282 | + display: flex; | |
1283 | + flex-direction: column; | |
1284 | + justify-content: center; | |
1285 | + align-items: center; | |
1286 | + width: 100%; | |
1287 | + | |
1288 | + .picker-choice{ | |
1289 | + display: flex; | |
1290 | + width: 684rpx; | |
1291 | + align-items: center; | |
1292 | + margin-bottom: 40rpx; | |
1293 | + .input{ | |
1294 | + border-bottom: 1px solid #CFCFCF; | |
1295 | + height: 40rpx; | |
1296 | + } | |
1297 | + .choice-left{ | |
1298 | + width: 210rpx; | |
1299 | + .pd{ | |
1300 | + font-size: 14px; | |
1301 | + color: #333333; | |
1302 | + letter-spacing: -0.26px; | |
1303 | + text-align: justify; | |
1304 | + line-height: 24px; | |
1305 | + margin-right: 44rpx; | |
1306 | + } | |
1307 | + .p11 { | |
1308 | + font-size: 14px; | |
1309 | + color: #333333; | |
1310 | + letter-spacing: -0.26px; | |
1311 | + text-align: justify; | |
1312 | + line-height: 24px; | |
1313 | + // margin-right: 10px; | |
1314 | + } | |
1315 | + .p12 { | |
1316 | + font-size: 10px; | |
1317 | + color: #3F3F3F; | |
1318 | + letter-spacing: -0.19px; | |
1319 | + text-align: justify; | |
1320 | + line-height: 24px; | |
1321 | + } | |
1322 | + | |
1323 | + | |
1324 | + } | |
1325 | + .p13 { | |
1326 | + font-size: 10px; | |
1327 | + color: #999999; | |
1328 | + letter-spacing: -0.19px; | |
1329 | + margin-right: 10px; | |
1330 | + } | |
1331 | + .p13-date { | |
1332 | + font-size: 10px; | |
1333 | + color: #999999; | |
1334 | + letter-spacing: -0.19px; | |
1335 | + margin-right: 5px; | |
1336 | + } | |
1337 | + picker{ | |
1338 | + width: 144rpx; | |
1339 | + height: 40rpx; | |
1340 | + display: flex; | |
1341 | + position: relative; | |
1342 | + .p14 { | |
1343 | + font-size: 14px; | |
1344 | + color: #666666; | |
1345 | + letter-spacing: -0.26px; | |
1346 | + text-align: center; | |
1347 | + width: 124rpx; | |
1348 | + border-bottom: 1px solid #CFCFCF; | |
1349 | + height: 38rpx; | |
1350 | + } | |
1351 | + image{ | |
1352 | + width: 20rpx; | |
1353 | + height: 20rpx; | |
1354 | + position: absolute; | |
1355 | + right: 20rpx; | |
1356 | + top: 8rpx; | |
1357 | + } | |
1358 | + } | |
1359 | + | |
1360 | + | |
1361 | + } | |
1362 | + } | |
1363 | + } | |
781 | 1364 | } |
782 | 1365 | } |
783 | 1366 | .choose { | ... | ... |