overseas 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +12 -0
  2. package/package.json +80 -0
  3. package/packages/.DS_Store +0 -0
  4. package/packages/base/bottom-popup/index.js +10 -0
  5. package/packages/base/bottom-popup/src/bottom-popup.vue +151 -0
  6. package/packages/base/button/index.js +10 -0
  7. package/packages/base/button/src/button.vue +108 -0
  8. package/packages/base/dialog/index.js +10 -0
  9. package/packages/base/dialog/src/dialog.vue +173 -0
  10. package/packages/base/icon/index.js +10 -0
  11. package/packages/base/icon/src/icon.vue +15 -0
  12. package/packages/base/image/index.js +10 -0
  13. package/packages/base/image/src/image.vue +40 -0
  14. package/packages/base/material-list/index.js +10 -0
  15. package/packages/base/material-list/src/material-list.vue +48 -0
  16. package/packages/base/popup/index.js +10 -0
  17. package/packages/base/popup/src/popup.vue +44 -0
  18. package/packages/business/basic-image/index.js +10 -0
  19. package/packages/business/basic-image/src/basicImage.vue +51 -0
  20. package/packages/business/bottom-fixed-button/index.js +10 -0
  21. package/packages/business/bottom-fixed-button/src/bottomFixedButton.vue +66 -0
  22. package/packages/business/class-choose/index.js +10 -0
  23. package/packages/business/class-choose/src/courseCard.vue +142 -0
  24. package/packages/business/class-choose/src/img/icon_close_bottomcard.svg +14 -0
  25. package/packages/business/class-choose/src/img/icon_date.svg +21 -0
  26. package/packages/business/class-choose/src/img/icon_full.svg +27 -0
  27. package/packages/business/class-choose/src/img/icon_full_EL.svg +49 -0
  28. package/packages/business/class-choose/src/img/icon_selected.svg +18 -0
  29. package/packages/business/class-choose/src/img/icon_star_selected.svg +13 -0
  30. package/packages/business/class-choose/src/img/icon_star_unselect.svg +13 -0
  31. package/packages/business/class-choose/src/index.vue +316 -0
  32. package/packages/business/grade-panel/index.js +10 -0
  33. package/packages/business/grade-panel/src/gradePanel.vue +150 -0
  34. package/packages/business/material-panel/index.js +10 -0
  35. package/packages/business/material-panel/src/index.vue +136 -0
  36. package/packages/business/notified-panel/index.js +10 -0
  37. package/packages/business/notified-panel/src/areaCodeList.js +181 -0
  38. package/packages/business/notified-panel/src/index.vue +491 -0
  39. package/packages/business/page-render/index.js +10 -0
  40. package/packages/business/page-render/src/pageRender.vue +73 -0
  41. package/packages/business/registration-panel/index.js +10 -0
  42. package/packages/business/registration-panel/src/areaCodeList.js +181 -0
  43. package/packages/business/registration-panel/src/img/icon_off.png +0 -0
  44. package/packages/business/registration-panel/src/img/icon_on.png +0 -0
  45. package/packages/business/registration-panel/src/index.vue +329 -0
  46. package/packages/business/registration-panel/src/languageList.js +41 -0
  47. package/packages/business/selector-panel/index.js +10 -0
  48. package/packages/business/selector-panel/src/selectorPanel.vue +134 -0
  49. package/packages/business/student-info/index.js +10 -0
  50. package/packages/business/student-info/src/api/index.js +10 -0
  51. package/packages/business/student-info/src/config.js +11 -0
  52. package/packages/business/student-info/src/studentInfo.vue +145 -0
  53. package/packages/business/switch-student/index.js +10 -0
  54. package/packages/business/switch-student/src/api/index.js +28 -0
  55. package/packages/business/switch-student/src/switchStudent.vue +245 -0
  56. package/packages/business/tips-popup/index.js +10 -0
  57. package/packages/business/tips-popup/src/tipsPopup.vue +76 -0
  58. package/packages/business/user-login/index.js +10 -0
  59. package/packages/business/user-login/src/api/index.js +23 -0
  60. package/packages/business/user-login/src/img/logo.png +0 -0
  61. package/packages/business/user-login/src/index.vue +149 -0
  62. package/packages/theme-style/package.json +38 -0
  63. package/packages/theme-style/src/bottom-fixed-button.scss +31 -0
  64. package/packages/theme-style/src/bottom-popup.scss +87 -0
  65. package/packages/theme-style/src/button.scss +110 -0
  66. package/packages/theme-style/src/class-choose.scss +251 -0
  67. package/packages/theme-style/src/common/popup.scss +39 -0
  68. package/packages/theme-style/src/common/var.scss +6 -0
  69. package/packages/theme-style/src/common.scss +97 -0
  70. package/packages/theme-style/src/dialog.scss +130 -0
  71. package/packages/theme-style/src/grade-panel.scss +76 -0
  72. package/packages/theme-style/src/icon.scss +369 -0
  73. package/packages/theme-style/src/image.scss +8 -0
  74. package/packages/theme-style/src/img/body_bg.png +0 -0
  75. package/packages/theme-style/src/img/pdf.png +0 -0
  76. package/packages/theme-style/src/img/title_bg.png +0 -0
  77. package/packages/theme-style/src/index.scss +20 -0
  78. package/packages/theme-style/src/material-list.scss +118 -0
  79. package/packages/theme-style/src/material-panel.scss +2 -0
  80. package/packages/theme-style/src/notified-panel.scss +207 -0
  81. package/packages/theme-style/src/page-render.scss +3 -0
  82. package/packages/theme-style/src/registration-panel.scss +158 -0
  83. package/packages/theme-style/src/selector-panel.scss +86 -0
  84. package/packages/theme-style/src/student-info.scss +114 -0
  85. package/packages/theme-style/src/switch-student.scss +176 -0
  86. package/packages/theme-style/src/tips-popup.scss +60 -0
  87. package/packages/theme-style/src/user-login.scss +93 -0
  88. package/src/index.js +74 -0
  89. package/src/network/api.js +53 -0
  90. package/src/network/apiUrl.js +65 -0
  91. package/src/utils/dom.js +54 -0
  92. package/src/utils/filters.js +82 -0
  93. package/src/utils/merge.js +16 -0
  94. package/src/utils/phone.js +153 -0
  95. package/src/utils/popup/index.js +115 -0
  96. package/src/utils/popup/popup-manager.js +178 -0
  97. package/src/utils/storage.js +22 -0
  98. package/src/utils/utils.js +49 -0
@@ -0,0 +1,134 @@
1
+ <template>
2
+ <div class="selection-list-wrapper" :style="backgroundImgStyle">
3
+ <div class="selection-list-title">
4
+ {{ title }}
5
+ </div>
6
+ <div class="selection-list-container">
7
+ <ul class="selection-item-wrapper">
8
+ <li v-for="(item, index) in optionCardList" :key="index">
9
+ <div
10
+ :class="{
11
+ 'font-medium': true,
12
+ 'selection-item': true,
13
+ 'double': optionsNumber == '2',
14
+ 'only-one': optionsNumber == '1',
15
+ 'active': isActive == index,
16
+ }"
17
+ @click="selectGrade(item, index)"
18
+ >
19
+ <span class="item-text">{{ item.name }}</span>
20
+ </div>
21
+ </li>
22
+ </ul>
23
+ <ts-button
24
+ class="btn"
25
+ style-type="primary"
26
+ size="small"
27
+ width="100%"
28
+ height="48px"
29
+ @click="btnClick"
30
+ >
31
+ {{ btnTitle }}
32
+ </ts-button>
33
+ </div>
34
+ </div>
35
+ </template>
36
+ <script>
37
+ import TsButton from "../../../base/button";
38
+
39
+ export default {
40
+ name: "TsSelectorPanel",
41
+ components: { TsButton },
42
+ props: {
43
+ title: {
44
+ default: "选择器引导文案",
45
+ type: String,
46
+ },
47
+ optionsNumber: {
48
+ default: "3",
49
+ type: String,
50
+ },
51
+ backgroundImgUrl: {
52
+ default: "",
53
+ type: String,
54
+ },
55
+ btnTitle: {
56
+ default: "按钮操作文案",
57
+ type: String,
58
+ },
59
+ optionCardList: {
60
+ default: () => [],
61
+ type: Array,
62
+ },
63
+ },
64
+ data() {
65
+ return {
66
+ isActive: null,
67
+ touchItem: {},
68
+ };
69
+ },
70
+ computed: {
71
+ backgroundImgStyle() {
72
+ return {
73
+ backgroundImage: `url(${this.backgroundImgUrl})`,
74
+ backgroundSize: 'cover',
75
+ backgroundRepeat: 'no-repeat',
76
+ boxShadow: this.backgroundImgUrl ? 'none' : '0px 2px 11px 0px rgba(0, 45, 65, 0.17)',
77
+ }
78
+ }
79
+ },
80
+ mounted() {
81
+ this.$sensors.track('h5_selector_panel_show', {
82
+ list_pattern: this.optionsNumber,
83
+ list_num: this.optionCardList.length,
84
+ button_name: this.btnTitle
85
+ })
86
+ },
87
+ methods: {
88
+ selectGrade(item, index) {
89
+ console.log("点击触发Item", index)
90
+ this.isActive = index;
91
+ this.touchAction(index)
92
+ },
93
+ btnClick() {
94
+ console.log("点击触发", this.$props)
95
+ if (!this.isActive && this.isActive !== 0) {
96
+ this.$toast("Please select at least one option before continue.");
97
+ return
98
+ }
99
+ this.touchAction(this.isActive)
100
+ },
101
+ touchAction(index) {
102
+ this.touchItem = { ...this.optionCardList[index] }
103
+ console.log(this.touchItem)
104
+ this.$sensors.track('h5_selector_panel_click', {
105
+ list_pattern: this.optionsNumber,
106
+ list_num: this.optionCardList.length,
107
+ click_panel: this.touchItem.name,
108
+ click_link_type: this.touchItem.jumpTo === "saleLinkUrl" ? 2 : 1 //1=h5链接或项目页面;2=打开班级页
109
+ })
110
+ if (this.touchItem.jumpTo === "saleLinkUrl") {
111
+ if (this.touchItem.idsString) {
112
+ this.$emit("btn-click", 'click-sell-link', {
113
+ id: this.touchItem.idsString,
114
+ });
115
+ return;
116
+ } else {
117
+ this.$toast("Please set at least one option before continue.");
118
+ }
119
+ }
120
+ if (this.touchItem.jumpTo === "linkUrl") {
121
+ if (this.touchItem.linkString) {
122
+ console.log('链接上报')
123
+ this.$emit("open-other-links", {
124
+ link: this.touchItem.linkString, //普通链接,
125
+ target: "_self",
126
+ });
127
+ } else {
128
+ this.$toast("Please set at least one option before continue.");
129
+ }
130
+ }
131
+ },
132
+ },
133
+ };
134
+ </script>
@@ -0,0 +1,10 @@
1
+ import TsStudentInfo from './src/studentInfo.vue'
2
+
3
+ // install 是默认的方法,供按需引入
4
+ // 当外界在 use 这个组件的时候,就会调用本身的install方法,同时传一个Vue这个类的参数
5
+
6
+ TsStudentInfo.install = (Vue) => {
7
+ Vue.component(TsStudentInfo.name, TsStudentInfo)
8
+ }
9
+
10
+ export default TsStudentInfo
@@ -0,0 +1,10 @@
1
+ import { net } from '@thinkacademy/overseas-ui/src/network/api'
2
+
3
+ /**
4
+ *
5
+ * @param {修改个人信息} params
6
+ * @returns
7
+ */
8
+ export function modifyUserInfo(params) {
9
+ return net.post('/v1/ucenter/basic_info/user/modify', params);
10
+ }
@@ -0,0 +1,11 @@
1
+ export default {
2
+ rules: {
3
+ firstName: [{ required: true, message: 'The input is required.' }],
4
+ lastName: [{ required: true, message: 'The input is required.' }],
5
+ email: [
6
+ { required: true, message: 'The input is required.' },
7
+ { pattern: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, message: 'This input is invalid.' },
8
+ ],
9
+ grade: [{ required: true, message: 'The input is required.' }],
10
+ },
11
+ }
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <div class="desc">
3
+ <ts-bottom-popup
4
+ :popup-title="title"
5
+ :show.sync="showPop"
6
+ :show-left-icon="showLeft"
7
+ :show-right-icon="showRight"
8
+ @right-icon-handler="closePopoup"
9
+ >
10
+ <template v-slot:left-icon>
11
+ <div class="header-icon-btn-container left-icon-container" @click="closePopoup">
12
+ <i class="iconfont icon-left" />
13
+ </div>
14
+ </template>
15
+ <template v-slot:right-icon>
16
+ <div class="header-icon-btn-container right-icon-container" @click="closePopoup">
17
+ <i class="iconfont icon-close-new-e658" />
18
+ </div>
19
+ </template>
20
+ <template v-slot:body>
21
+ <div class="popup-body-wrapper">
22
+ <!-- <div class="popup-txt" v-html="contentFirstBlock" /> -->
23
+ <div class="popup-txt">
24
+ <form>
25
+ <div class="student-info font-medium">
26
+ <span>First name</span>
27
+ <input v-model.trim="formData.firstName" type="text" name="firstname" placeholder="Edit First name" maxlength="32">
28
+ </div>
29
+ <div v-show="formData.firstName === ' '" class="invalid">
30
+ {{ textTips }}
31
+ </div>
32
+ <div class="student-info font-medium">
33
+ <span>Last name</span>
34
+ <input v-model.trim="formData.lastName" type="text" name="lastname" placeholder="Edit Last name" maxlength="32">
35
+ </div>
36
+ <div v-show="formData.lastName === ' '" class="invalid">
37
+ {{ textTips }}
38
+ </div>
39
+ </form>
40
+ </div>
41
+ <!-- <div class="popup-txt" v-html="contentSecondBlock" /> -->
42
+ <div class="popup-tips font-medium">
43
+ {{ tips }}
44
+ </div>
45
+ <ts-button class="btn" style-type="primary" size="small" width="100%" height="48px" type="submit" @click="submitForm">
46
+ Continue Sign Up
47
+ </ts-button>
48
+ </div>
49
+ </template>
50
+ </ts-bottom-popup>
51
+ </div>
52
+ </template>
53
+
54
+ <script>
55
+ import TsBottomPopup from '../../../base/bottom-popup'
56
+ import TsButton from '../../../base/button'
57
+
58
+
59
+ export default {
60
+ name: 'TsStudentInfo',
61
+ components: { TsBottomPopup, TsButton },
62
+ props: {
63
+ title: {
64
+ default: 'Complete Student Info', // or 'Add a Student'
65
+ type: String,
66
+ },
67
+ showLeft: {
68
+ default: false,
69
+ type: Boolean,
70
+ },
71
+ showRight: {
72
+ default: true,
73
+ type: Boolean,
74
+ },
75
+ tips: {
76
+ default: 'Information in the student profile can help teachers get to know your child. When you are ready. click "Continue Sign Up" and proceed to checkout.',
77
+ type: String,
78
+ }
79
+ },
80
+ data() {
81
+ return {
82
+ // 默认为false
83
+ showPop: false,
84
+ textTips: 'This input is required.',
85
+ formData: {
86
+ firstName: '',
87
+ lastName: '',
88
+ },
89
+ isAdd: false
90
+ }
91
+ },
92
+ mounted() {
93
+ },
94
+ methods: {
95
+ closePopoup() {
96
+ this.showPop = false
97
+ },
98
+ submitForm() {
99
+ // Maximun 32 letters. Letters supported
100
+ console.log("submitForm fun")
101
+ const reg = /^[a-zA-Z]+$/
102
+ // 提交表单 调用修改个人信息的接口
103
+ if (!reg.test(this.formData.firstName)) {
104
+ this.formData.firstName = ' '
105
+ this.textTips = 'Maximun 32 letters. Letters supported'
106
+ return
107
+ }
108
+ if (!this.formData.firstName){
109
+ this.formData.firstName = ' '
110
+ return
111
+ }
112
+ if (!reg.test(this.formData.lastName)) {
113
+ this.formData.lastName = ' '
114
+ this.textTips = 'Maximun 32 letters. Letters supported'
115
+ return
116
+ }
117
+ if (!this.formData.lastName){
118
+ if (this.formData.lastName && reg.test(this.formData.lastName)) {
119
+ this.textTips = 'Maximun 32 letters. Letters supported'
120
+ }
121
+ this.formData.lastName = ' '
122
+ return
123
+ }
124
+ if (this.isAdd) {
125
+ console.log("新增")
126
+ this.$emit('btn-click', 'added-student', {
127
+ ...this.formData
128
+ })
129
+ } else {
130
+ console.log("补充")
131
+ this.$emit('btn-click', 'submit-info', {
132
+ ...this.formData
133
+ })
134
+ }
135
+ },
136
+ openPopup(val) {
137
+ console.log("student info showPop")
138
+ this.showPop = true
139
+ this.isAdd = val.isAdd || false
140
+ this.formData.firstName = val.firstName || ''
141
+ this.formData.lastName = val.lastName || ''
142
+ },
143
+ }
144
+ }
145
+ </script>
@@ -0,0 +1,10 @@
1
+ import TsSwitchStudent from './src/switchStudent.vue'
2
+
3
+ // install 是默认的方法,供按需引入
4
+ // 当外界在 use 这个组件的时候,就会调用本身的install方法,同时传一个Vue这个类的参数
5
+
6
+ TsSwitchStudent.install = (Vue) => {
7
+ Vue.component(TsSwitchStudent.name, TsSwitchStudent)
8
+ }
9
+
10
+ export default TsSwitchStudent
@@ -0,0 +1,28 @@
1
+ import { net } from '@thinkacademy/overseas-ui/src/network/api'
2
+
3
+ /**
4
+ *
5
+ * @param {账号列表} params
6
+ * @returns
7
+ */
8
+ export function queryAccount(params) {
9
+ return net.post('/v1/ucenter/account/associated/list', params);
10
+ }
11
+
12
+ /**
13
+ *
14
+ * @param {电话号码获取} params
15
+ * @returns
16
+ */
17
+ export function queryPhone(params) {
18
+ return net.post('/basic_info/master_user/get', params);
19
+ }
20
+
21
+ /**
22
+ *
23
+ * @param {获取基本信息} params
24
+ * @returns
25
+ */
26
+ export function queryUserInfo(params) {
27
+ return net.post('/basic_info/user/get', params);
28
+ }
@@ -0,0 +1,245 @@
1
+ <template>
2
+ <div class="desc">
3
+ <ts-bottom-popup
4
+ :popup-title="title"
5
+ :show.sync="showPop"
6
+ :show-left-icon="false"
7
+ :show-right-icon="true"
8
+ @right-icon-handler="closePopoup"
9
+ >
10
+ <!-- 右边按钮 -->
11
+ <template v-slot:right-icon>
12
+ <div class="header-icon-btn-container right-icon-container" @click="closePopoup">
13
+ <i class="iconfont icon-close-new-e658" />
14
+ </div>
15
+ </template>
16
+ <!-- 中间部分 -->
17
+ <template v-slot:body>
18
+ <div class="popup-body-wrapper">
19
+ <!-- 优惠券提示信息 -->
20
+ <div v-if="switchStuTipText" class="coupon-tip-container">
21
+ <div class="coupon-tip font-medium">
22
+ <i class="iconfont icon-alert" />
23
+ <!-- <img class="icon-alert" src="images/alert.png" alt=""> -->
24
+ <span>{{ switchStuTipText }}</span>
25
+ </div>
26
+ </div>
27
+ <!-- 电话号码提示 -->
28
+ <div class="students-list-title font-medium">
29
+ {{ phoneNumTip[0] }}
30
+ {{ '(' + countryCallingCode + ')' }}
31
+ {{ encryptPhone(phone) }}
32
+ {{ phoneNumTip[1] }}
33
+ </div>
34
+ <!-- 账号获取 -->
35
+ <div class="stu-switch-popup-txt">
36
+ <div class="students-list-wrapper">
37
+ <div v-for="(student, index) in studentsList" :key="index" class="students-list">
38
+ <div class="student-card-wrapper">
39
+ <div class="student-card-container">
40
+ <div class="card-main-container">
41
+ <div class="stu-avatar-container">
42
+ <img :src="student.avatar" alt="avatar">
43
+ </div>
44
+ <div class="stu-info-container font-medium">
45
+ <div class="stu-name">
46
+ {{ student.nickName }}
47
+ </div>
48
+ <div class="stu-no">
49
+ <span>No.</span><span>{{ formatCardNo(student.card) }}</span>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <div class="btn-select-student" @click="itemClick(student)">
55
+ <i v-show="isSelect == student.uid" class="iconfont icon-selected" />
56
+ <i v-show="isSelect !== student.uid" class="iconfont icon-unselect" />
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ <!-- 提示信息 -->
63
+ <div class="guide-to-add-student font-medium">
64
+ {{ addTip[0] }}
65
+ <span class="btn-add-student" @click="addStudentHandler">{{ addTip[1] }}</span>
66
+ {{ addTip[2] }}
67
+ </div>
68
+ <!-- 底部按钮 -->
69
+ <ts-button class="stu-switch-btn" style-type="primary" size="small" width="100%" height="48px" @click="closePopoupHandler">
70
+ Continue Sign Up
71
+ </ts-button>
72
+ <div class="empty-box" />
73
+ </div>
74
+ </template>
75
+ </ts-bottom-popup>
76
+ </div>
77
+ </template>
78
+
79
+ <script>
80
+ import TsBottomPopup from '../../../base/bottom-popup'
81
+ import TsButton from '../../../base/button'
82
+ import { queryAccount, queryPhone, queryUserInfo } from './api'
83
+
84
+ export default {
85
+ name: 'TsSwitchStudent',
86
+ components: { TsBottomPopup, TsButton },
87
+ inject: ["app"],
88
+ props: {
89
+ title: {
90
+ default: 'Choose a Student',
91
+ type: String,
92
+ },
93
+ switchStuTipText: {
94
+ default: 'Please note that the discount total may change by switching to another student account.',
95
+ type: String,
96
+ },
97
+ phoneNumTip: {
98
+ default: () => [
99
+ 'Your mobile number',
100
+ 'is registered to the following student accounts:',
101
+ ],
102
+ type: Array,
103
+ },
104
+ addTip: {
105
+ default: () => [
106
+ 'Registering for a different child not listed above?',
107
+ 'Click here ',
108
+ 'to add a new student account under this mobile number andregister for them.',
109
+ 'You can complete the student profile afterclicking "Continue Sign Up".',
110
+ ],
111
+ type: Array,
112
+ },
113
+ },
114
+ data() {
115
+ return {
116
+ // 默认为false
117
+ showPop: true,
118
+ isSelect: null,
119
+ phone: '',
120
+ countryCallingCode: '',
121
+ studentsList: [],
122
+ getSchoolCode: '',
123
+ }
124
+ },
125
+ methods: {
126
+ closePopoup() {
127
+ this.showPop = false
128
+ },
129
+
130
+ open(val) {
131
+ this.showPop = true
132
+ this.getSchoolCode = val.schoolCode
133
+ queryAccount({
134
+ header: {
135
+ schoolCode: val.schoolCode,
136
+ studentId: val.studentId,
137
+ },
138
+ }).then((res)=>{
139
+ const resData = res.data.data || {}
140
+ this.studentsList = resData.associatedAccount || [];
141
+ // 添加当前登录学员
142
+ this.studentsList.unshift(resData.currentAccount);
143
+ // 默认选中第一个
144
+ this.isSelect = this.studentsList[0].uid
145
+ })
146
+ queryPhone({
147
+ header: {
148
+ schoolCode: val.schoolCode,
149
+ },
150
+ }).then((res)=>{
151
+ const resData = res.data.data || {}
152
+ this.phone = resData.phone || [];
153
+ this.countryCallingCode = resData.countryCallingCode || [];
154
+ })
155
+ },
156
+
157
+ addStudentHandler() {
158
+ // 跳到添加学员
159
+ this.$emit('btn-click', 'TsStudentInfo', { title: "Add a student", 'show-left': true, 'show-right': false})
160
+ },
161
+ itemClick(student) {
162
+ this.isSelect = student.uid
163
+ this.switchLogin()
164
+ },
165
+ closePopoupHandler() {
166
+ // 判断是否需要提示入学测试
167
+
168
+ // 如果没有直接跳到支付页
169
+
170
+
171
+ //可以拿到uid
172
+ queryUserInfo({
173
+ header: {
174
+ schoolCode: this.getSchoolCode,
175
+ studentId: this.isSelect,
176
+ },
177
+ }).then((res)=>{
178
+ const resData = res.data.data || {}
179
+ const resFirstName = resData.firstName
180
+ const resLastName = resData.lastName
181
+ const resEmail = resData.email
182
+ const resNickName = resData.nickName
183
+ if (!resFirstName || !resLastName || !resEmail){
184
+ return this.$emit('btn-click', 'TsStudentInfo', {
185
+ firstName: resFirstName,
186
+ lastName: resLastName,
187
+ email: resEmail,
188
+ nickName: resNickName,
189
+ })
190
+ }
191
+ // 跳转判断是否 价格为0
192
+ // localtion.href = ''
193
+ })
194
+
195
+ this.showPop = false
196
+ },
197
+ // 加密手机号
198
+ encryptPhone(phone) {
199
+ if (!phone || phone === '') {
200
+ return ''
201
+ }
202
+ const phoneLen = phone.length;
203
+ const length = Math.floor(phoneLen / 3);
204
+ let replaceStr = [];
205
+ replaceStr.length = 2 * length - length + 1 + 1;
206
+ replaceStr = replaceStr.join('*');
207
+
208
+ return phone.replace(phone.substring(length, 2 * length + 1), replaceStr);
209
+ },
210
+ // 处理 card
211
+ formatCardNo(val) {
212
+ if (!val) return ''
213
+ return val.replace(/(.{4})/g, '$1 ')
214
+ },
215
+ // 切换登录账号
216
+ async switchLogin(){
217
+ const data = {
218
+ data: {
219
+ targetUid: this.isSelect
220
+ }
221
+ }
222
+ let res = await this.$axios.post("/one-api/ucenter/account/switch_login", data, { rewritePostBody: true })
223
+ console.log(res)
224
+ },
225
+ // 校验是否需要测试
226
+ async reportClassCheck() {
227
+ const data = {
228
+ data: {
229
+ skuNo: this.skuNo
230
+ }
231
+ }
232
+ let res = await this.$axios.post("/one-api/aggregate/signup/check", data, { rewritePostBody: true })
233
+ if (res.data.continue) {
234
+ this.$emit("btn-click", "toOrder")
235
+ } else {
236
+ this.$emit("btn-click", 'helper', res.data.helper)
237
+ }
238
+ },
239
+ // 判断是否需要补充用户信息
240
+ async supplementInfo() {
241
+ this.$axios.post("/one-api/ucenter/basic_info/user/get", {},)
242
+ }
243
+ },
244
+ }
245
+ </script>
@@ -0,0 +1,10 @@
1
+ import TsTipsPopup from './src/TipsPopup.vue'
2
+
3
+ // install 是默认的方法,供按需引入
4
+ // 当外界在 use 这个组件的时候,就会调用本身的install方法,同时传一个Vue这个类的参数
5
+
6
+ TsTipsPopup.install = (Vue) => {
7
+ Vue.component(TsTipsPopup.name, TsTipsPopup)
8
+ }
9
+
10
+ export default TsTipsPopup
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <van-popup v-model="show">
3
+ <div class="tips-popup-wrapper">
4
+ <div class="tips-popup-container">
5
+ <div class="font-semibold title">
6
+ {{ title }}
7
+ </div>
8
+ <div class="font-medium message">
9
+ {{ message }}
10
+ </div>
11
+ </div>
12
+ <div v-if="type == 1" class="btn-wrapper">
13
+ <ts-button class="btn" style-type="primary" size="small" width="64%" height="48px" @click="confirmBtnClick">
14
+ {{ btnText }}
15
+ </ts-button>
16
+ </div>
17
+ <div v-if="type == 2" class="btn-wrapper-2">
18
+ <ts-button class="btn btn-left" style-type="primary" size="small" width="42%" height="48px" @click="closePopupHandler">
19
+ Cancel
20
+ </ts-button>
21
+ <ts-button class="btn" style-type="primary" size="small" width="42%" height="48px" @click="nextStepClick">
22
+ {{ btnText }}
23
+ </ts-button>
24
+ </div>
25
+ </div>
26
+ </van-popup>
27
+ </template>
28
+ <script>
29
+
30
+ import TsButton from '../../../base/button'
31
+
32
+ export default {
33
+ name: 'TsTipsPopup',
34
+ components: {
35
+ TsButton,
36
+ },
37
+ props: {
38
+ title: {
39
+ default: '',
40
+ type: String,
41
+ },
42
+ message: {
43
+ default: '',
44
+ type: String,
45
+ },
46
+ btnText: {
47
+ default: '',
48
+ type: String,
49
+ },
50
+ type: {
51
+ default: 2,
52
+ type: Number,
53
+ },
54
+ },
55
+ data(){
56
+ return {
57
+ show: false
58
+ }
59
+ },
60
+ methods: {
61
+ openDialog() {
62
+ this.show = true
63
+
64
+ },
65
+ confirmBtnClick() {
66
+ this.show = false
67
+ },
68
+ closePopupHandler() {
69
+ this.show = false
70
+ },
71
+ nextStepClick() {
72
+ this.$emit('btn-click', "to-test")
73
+ },
74
+ },
75
+ }
76
+ </script>