作者 朱振飞

注册优化

@@ -3,55 +3,73 @@ @@ -3,55 +3,73 @@
3 <view class="studentMsg"> 3 <view class="studentMsg">
4 <view class="item"> 4 <view class="item">
5 <view class="title">姓名</view> 5 <view class="title">姓名</view>
6 - <input type="text" v-model="username" class="inpt" placeholder="请输入姓名" placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;"> 6 + <input type="text" v-model="username" class="inpt" placeholder="请输入姓名" placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;" />
7 </view> 7 </view>
8 <view class="item"> 8 <view class="item">
9 <view class="title">邮箱</view> 9 <view class="title">邮箱</view>
10 - <input type="text" v-model="email" class="inpt" placeholder="请输入邮箱" placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;"> 10 + <input type="text" v-model="email" class="inpt" placeholder="请输入邮箱" placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;" />
11 </view> 11 </view>
12 <view class="item" style="border-bottom:none"> 12 <view class="item" style="border-bottom:none">
13 <view class="title">头像</view> 13 <view class="title">头像</view>
14 - <image @click="upload" class="photo" :src="isUpload ? image : '../../static/touxiang_img@2x.png'"></image> 14 + <image @click="upload" class="photo" :src="isUpload ? uploadImg : '../../static/touxiang_img@2x.png'"></image>
15 </view> 15 </view>
16 </view> 16 </view>
17 <view class="schoolTitle">高中信息</view> 17 <view class="schoolTitle">高中信息</view>
18 <view class="studentMsg"> 18 <view class="studentMsg">
19 <view class="item" @click="selhigh"> 19 <view class="item" @click="selhigh">
20 <view class="title">高中</view> 20 <view class="title">高中</view>
21 - <view class="selectBtn">{{isHighShow? name : '请选择就读高中'}}<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> 21 + <view class="selectBtn">
  22 + {{ isHighShow ? name : '请选择就读高中' }}
  23 + <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
  24 + </view>
22 </view> 25 </view>
23 <view class="item"> 26 <view class="item">
24 <view class="title">毕业年份</view> 27 <view class="title">毕业年份</view>
25 <!-- <view class="selectBtn">请选择毕业年份<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> --> 28 <!-- <view class="selectBtn">请选择毕业年份<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> -->
26 <view @click="selDate" style="display: flex;justify-content: space-between;align-items: center;"> 29 <view @click="selDate" style="display: flex;justify-content: space-between;align-items: center;">
27 <picker mode="date" :value="date" start="2000-01-01" @change="bindTimeChange"> 30 <picker mode="date" :value="date" start="2000-01-01" @change="bindTimeChange">
28 - <view class="selectBtn">{{isDateShow? date : '请选择毕业年份'}}</view> 31 + <view class="selectBtn">{{ isDateShow ? date : '请选择毕业年份' }}</view>
29 </picker> 32 </picker>
30 <image class="icon" src="../../static/zhuandao_icon@2x.png"></image> 33 <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
31 </view> 34 </view>
32 </view> 35 </view>
33 <view class="item" @click="subPopupShow"> 36 <view class="item" @click="subPopupShow">
34 <view class="title">选考科目</view> 37 <view class="title">选考科目</view>
35 - <view class="selectBtn">{{subid.toString()!='' ? subname.toString() : "请选择选考科目"}}<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> 38 + <view class="selectBtn">
  39 + {{ subid.toString() != '' ? subname.toString() : '请选择选考科目' }}
  40 + <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
  41 + </view>
36 </view> 42 </view>
37 <view class="item" style="border-bottom:none" @click="stylePopupShow"> 43 <view class="item" style="border-bottom:none" @click="stylePopupShow">
38 <view class="title">升学方式</view> 44 <view class="title">升学方式</view>
39 - <view class="selectBtn">{{isupnameshow? upname : "请选择升学方式"}}<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> 45 + <view class="selectBtn">
  46 + {{ isupnameshow ? upname : '请选择升学方式' }}
  47 + <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
  48 + </view>
40 </view> 49 </view>
41 </view> 50 </view>
42 <view class="schoolTitle">大学信息</view> 51 <view class="schoolTitle">大学信息</view>
43 <view class="studentMsg"> 52 <view class="studentMsg">
44 <view class="item" @click="selcollege"> 53 <view class="item" @click="selcollege">
45 <view class="title">就读大学</view> 54 <view class="title">就读大学</view>
46 - <view class="selectBtn">{{isNameShow? collegename : '请选择就读大学'}}<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> 55 + <view class="selectBtn">
  56 + {{ isNameShow ? collegename : '请选择就读大学' }}
  57 + <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
  58 + </view>
47 </view> 59 </view>
48 <view class="item"> 60 <view class="item">
49 <view class="title">所属学院</view> 61 <view class="title">所属学院</view>
50 - <view class="selectBtn" @click="tocollege">{{iscollgegshow? academyname : '请选择所属学院' }}<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> 62 + <view class="selectBtn" @click="tocollege">
  63 + {{ iscollgegshow ? academyname : '请选择所属学院' }}
  64 + <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
  65 + </view>
51 </view> 66 </view>
52 <view class="item" style="border-bottom:none" @click="tomajor"> 67 <view class="item" style="border-bottom:none" @click="tomajor">
53 <view class="title">就读专业</view> 68 <view class="title">就读专业</view>
54 - <view class="selectBtn">{{ismajorshow? academyname : '请选择所属专业' }}<image class="icon" src="../../static/zhuandao_icon@2x.png"></image></view> 69 + <view class="selectBtn">
  70 + {{ ismajorshow ? academyname : '请选择所属专业' }}
  71 + <image class="icon" src="../../static/zhuandao_icon@2x.png"></image>
  72 + </view>
55 </view> 73 </view>
56 </view> 74 </view>
57 <view class="okBtn" @click="collegeregister">注册</view> 75 <view class="okBtn" @click="collegeregister">注册</view>
@@ -62,7 +80,17 @@ @@ -62,7 +80,17 @@
62 <view class="confimBtn" @click="subPopupHide">确定</view> 80 <view class="confimBtn" @click="subPopupHide">确定</view>
63 </view> 81 </view>
64 <view class="subBox"> 82 <view class="subBox">
65 - <view class="subject" @click="selsub" :class="{active:subid.indexOf(item.id)!=-1}" v-for="(item,index) in sublist" :key="index" :data-id="item.id" :data-name="item.name">{{item.name}}</view> 83 + <view
  84 + class="subject"
  85 + @click="selsub"
  86 + :class="{ active: subid.indexOf(item.id) != -1 }"
  87 + v-for="(item, index) in sublist"
  88 + :key="index"
  89 + :data-id="item.id"
  90 + :data-name="item.name"
  91 + >
  92 + {{ item.name }}
  93 + </view>
66 </view> 94 </view>
67 </view> 95 </view>
68 </view> 96 </view>
@@ -73,7 +101,17 @@ @@ -73,7 +101,17 @@
73 <view class="confimBtn" @click="stylePopupHide">确定</view> 101 <view class="confimBtn" @click="stylePopupHide">确定</view>
74 </view> 102 </view>
75 <view class="subBox"> 103 <view class="subBox">
76 - <view class="subject" :class="{active:upid==item.id}" @click="selup" v-for="(item,index) in uplist" :key="index" :data-id="item.id" :data-name="item.name">{{item.name}}</view> 104 + <view
  105 + class="subject"
  106 + :class="{ active: upid == item.id }"
  107 + @click="selup"
  108 + v-for="(item, index) in uplist"
  109 + :key="index"
  110 + :data-id="item.id"
  111 + :data-name="item.name"
  112 + >
  113 + {{ item.name }}
  114 + </view>
77 </view> 115 </view>
78 </view> 116 </view>
79 </view> 117 </view>
@@ -81,332 +119,322 @@ @@ -81,332 +119,322 @@
81 </template> 119 </template>
82 120
83 <script> 121 <script>
84 - import app from "../../App.vue" 122 +import app from '../../App.vue';
85 123
86 export default { 124 export default {
87 - data(){  
88 - return{  
89 - isSubPopupShow:false,  
90 - isStylePopupShow:false,  
91 - username:'',  
92 - image:'',  
93 - isUpload:false, 125 + data() {
  126 + return {
  127 + isSubPopupShow: false,
  128 + isStylePopupShow: false,
  129 + username: '',
  130 + image: '',
  131 + isUpload: false,
94 date: '请选择毕业年份', 132 date: '请选择毕业年份',
95 isDateShow: false, 133 isDateShow: false,
96 - uplist:[],  
97 - upid:'1',  
98 - subid:[],  
99 - sublist:[],  
100 - collegename:'请选择就读大学',  
101 - isNameShow:false,  
102 - isHighShow:false,  
103 - name:'请选择就读高中',  
104 - subname:[],  
105 - issubnameshow:false,  
106 - upname:'请选择升学方式',  
107 - isupnameshow:false,  
108 - school_id:'',  
109 - uni_id:'',  
110 - academyname:'请选择所属学院',  
111 - iscollgegshow:false,  
112 - majorname:'请选择所属专业',  
113 - ismajorshow:false,  
114 - email:'',  
115 - majorid:'',  
116 - academyid:'',  
117 - chuanimg:''  
118 -  
119 - } 134 + uplist: [],
  135 + upid: '1',
  136 + subid: [],
  137 + sublist: [],
  138 + collegename: '请选择就读大学',
  139 + isNameShow: false,
  140 + isHighShow: false,
  141 + name: '请选择就读高中',
  142 + subname: [],
  143 + issubnameshow: false,
  144 + upname: '请选择升学方式',
  145 + isupnameshow: false,
  146 + school_id: '',
  147 + uni_id: '',
  148 + academyname: '请选择所属学院',
  149 + iscollgegshow: false,
  150 + majorname: '请选择所属专业',
  151 + ismajorshow: false,
  152 + email: '',
  153 + majorid: '',
  154 + academyid: '',
  155 + chuanimg: '',
  156 + baseUrl: app.globalData.imageBaseUrl,
  157 + uploadImg: ''
  158 + };
120 }, 159 },
121 - methods:{  
122 - selDate(){  
123 - this.isDateShow=true 160 + methods: {
  161 + selDate() {
  162 + this.isDateShow = true;
124 }, 163 },
125 - subPopupShow(){  
126 - this.isSubPopupShow=true 164 + subPopupShow() {
  165 + this.isSubPopupShow = true;
127 }, 166 },
128 - subPopupHide(){  
129 - this.isSubPopupShow=false 167 + subPopupHide() {
  168 + this.isSubPopupShow = false;
130 }, 169 },
131 - stylePopupShow(){  
132 - this.isStylePopupShow=true 170 + stylePopupShow() {
  171 + this.isStylePopupShow = true;
133 }, 172 },
134 - stylePopupHide(){  
135 - this.isStylePopupShow=false 173 + stylePopupHide() {
  174 + this.isStylePopupShow = false;
136 }, 175 },
137 - // toSchoolmate(){  
138 176
139 - // wx.navigateTo({  
140 - // url: "/pages/schoolmate/schoolmate?type="+2  
141 - // })  
142 - // },  
143 - upload(){ 177 + upload() {
144 var that = this; 178 var that = this;
145 uni.chooseImage({ 179 uni.chooseImage({
146 count: 1, 180 count: 1,
147 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 181 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
148 sourceType: ['album'], //从相册选择 182 sourceType: ['album'], //从相册选择
149 - success: function (res) { 183 + success: function(res) {
150 const tempFilePaths = res.tempFilePaths; 184 const tempFilePaths = res.tempFilePaths;
151 that.image = tempFilePaths[0]; 185 that.image = tempFilePaths[0];
152 - app.upload('image',res.tempFilePaths[0],"post").then((res)=>{  
153 - // let newimage=that.image  
154 - that.image=res.url;  
155 - that.chuanimg=res.kurl  
156 - console.log(res)  
157 - console.log(that.image)  
158 - console.log(res.url)  
159 - // newimage.push(res.url)  
160 - that.isUpload=true  
161 - }).catch((err)=>{  
162 - console.log(err) 186 + app.upload('image', res.tempFilePaths[0], 'post')
  187 + .then(res => {
  188 + that.image = res.url;
  189 + that.chuanimg = res.kurl;
  190 + that.uploadImg = that.baseUrl + res.kurl;
  191 + that.isUpload = true;
163 }) 192 })
164 - // console.log("tempFilePaths[0]",tempFilePaths[0]) //能够打印出选中的图片  
165 - // console.log(res)  
166 - // that.head_image=tempFilePaths[0]  
167 - // that.iconcheck = 1;//点击后图片更改状态由0变成1 193 + .catch(err => {
  194 + console.log(err);
  195 + });
168 }, 196 },
169 - error : function(e){ 197 + error: function(e) {
170 console.log(e); 198 console.log(e);
171 } 199 }
172 }); 200 });
173 }, 201 },
174 bindTimeChange: function(e) { 202 bindTimeChange: function(e) {
175 - this.date = e.target.value 203 + this.date = e.target.value;
176 }, 204 },
177 - getUpType(){  
178 - var that = this  
179 - var url = "university/getAllUp"  
180 - var params = {}  
181 - app.post(url,params,"get").then((res)=>{  
182 - console.log(res)  
183 - that.uplist=res  
184 - }).catch((err)=>{  
185 - console.log(err) 205 + getUpType() {
  206 + var that = this;
  207 + var url = 'university/getAllUp';
  208 + var params = {};
  209 + app.post(url, params, 'get')
  210 + .then(res => {
  211 + console.log(res);
  212 + that.uplist = res;
186 }) 213 })
  214 + .catch(err => {
  215 + console.log(err);
  216 + });
187 }, 217 },
188 - getAllSub(){  
189 - var that=this  
190 - var url = "university/listSubject"  
191 - var params ={}  
192 - app.post(url,params,"get").then((res)=>{  
193 - that.sublist=res  
194 - console.log(res)  
195 - }).catch((err)=>{  
196 - console.log(err) 218 + getAllSub() {
  219 + var that = this;
  220 + var url = 'university/listSubject';
  221 + var params = {};
  222 + app.post(url, params, 'get')
  223 + .then(res => {
  224 + that.sublist = res;
  225 + console.log(res);
197 }) 226 })
  227 + .catch(err => {
  228 + console.log(err);
  229 + });
198 }, 230 },
199 - selup(e){  
200 - this.isupnameshow=true  
201 - console.log(e.currentTarget.dataset)  
202 - this.upid=e.currentTarget.dataset.id  
203 - this.upname=e.currentTarget.dataset.name 231 + selup(e) {
  232 + this.isupnameshow = true;
  233 + console.log(e.currentTarget.dataset);
  234 + this.upid = e.currentTarget.dataset.id;
  235 + this.upname = e.currentTarget.dataset.name;
204 }, 236 },
205 - selsub(e){ 237 + selsub(e) {
206 Array.prototype.remove = function(val) { 238 Array.prototype.remove = function(val) {
207 var index = this.indexOf(val); 239 var index = this.indexOf(val);
208 if (index > -1) { 240 if (index > -1) {
209 this.splice(index, 1); 241 this.splice(index, 1);
210 } 242 }
211 }; 243 };
212 - this.issubnameshow=true  
213 - if(this.subid.indexOf(e.currentTarget.dataset.id)!=-1){  
214 - this.subid.remove(e.currentTarget.dataset.id)  
215 - this.subname.remove(e.currentTarget.dataset.name)  
216 - }else{  
217 - this.subid.push(e.currentTarget.dataset.id)  
218 - this.subname.push(e.currentTarget.dataset.name)  
219 - }  
220 - console.log(this.subid)  
221 - 244 + this.issubnameshow = true;
  245 + if (this.subid.indexOf(e.currentTarget.dataset.id) != -1) {
  246 + this.subid.remove(e.currentTarget.dataset.id);
  247 + this.subname.remove(e.currentTarget.dataset.name);
  248 + } else {
  249 + this.subid.push(e.currentTarget.dataset.id);
  250 + this.subname.push(e.currentTarget.dataset.name);
  251 + }
  252 + console.log(this.subid);
222 }, 253 },
223 - selcollege(){  
224 - this.isNameShow=true 254 + selcollege() {
  255 + this.isNameShow = true;
225 uni.navigateTo({ 256 uni.navigateTo({
226 - url:'./selectCollege'  
227 - }) 257 + url: './selectCollege'
  258 + });
228 }, 259 },
229 - selhigh(){  
230 - this.isHighShow=true 260 + selhigh() {
  261 + this.isHighShow = true;
231 uni.navigateTo({ 262 uni.navigateTo({
232 - url:'./selectSchool'  
233 - }) 263 + url: './selectSchool'
  264 + });
234 }, 265 },
235 - tocollege(){  
236 - this.iscollgegshow=true  
237 - var school_id = this.uni_id  
238 - console.log(school_id) 266 + tocollege() {
  267 + this.iscollgegshow = true;
  268 + var school_id = this.uni_id;
  269 + console.log(school_id);
239 uni.navigateTo({ 270 uni.navigateTo({
240 - url:'./selectAcademy?uni_id='+school_id  
241 - }) 271 + url: './selectAcademy?uni_id=' + school_id
  272 + });
242 }, 273 },
243 - tomajor(){  
244 - this.ismajorshow=true 274 + tomajor() {
  275 + this.ismajorshow = true;
245 276
246 uni.navigateTo({ 277 uni.navigateTo({
247 - url:'./selectMajor'  
248 - }) 278 + url: './selectMajor'
  279 + });
249 }, 280 },
250 - collegeregister(){  
251 - var that = this  
252 - if(that.username==''){ 281 + collegeregister() {
  282 + var that = this;
  283 + if (that.username == '') {
253 uni.showToast({ 284 uni.showToast({
254 - title:"姓名不能为空",  
255 - icon:"none"  
256 - })  
257 - return false 285 + title: '姓名不能为空',
  286 + icon: 'none'
  287 + });
  288 + return false;
258 } 289 }
259 - var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/ ;  
260 - if(!reg.test(that.email)){ 290 + var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
  291 + if (!reg.test(that.email)) {
261 uni.showToast({ 292 uni.showToast({
262 - title:"请输入正确邮箱",  
263 - icon:"none"  
264 - })  
265 - return false 293 + title: '请输入正确邮箱',
  294 + icon: 'none'
  295 + });
  296 + return false;
266 } 297 }
267 - if(that.image==''){ 298 + if (that.image == '') {
268 uni.showToast({ 299 uni.showToast({
269 - title:"请选择头像",  
270 - icon:"none"  
271 - })  
272 - return false 300 + title: '请选择头像',
  301 + icon: 'none'
  302 + });
  303 + return false;
273 } 304 }
274 - if(that.name=='请选择就读高中'){ 305 + if (that.name == '请选择就读高中') {
275 uni.showToast({ 306 uni.showToast({
276 - title:"请选择高中",  
277 - icon:"none"  
278 - })  
279 - return false 307 + title: '请选择高中',
  308 + icon: 'none'
  309 + });
  310 + return false;
280 } 311 }
281 - if(that.date=='请选择毕业年份'){ 312 + if (that.date == '请选择毕业年份') {
282 uni.showToast({ 313 uni.showToast({
283 - title:"请选择毕业年份",  
284 - icon:"none"  
285 - })  
286 - return false 314 + title: '请选择毕业年份',
  315 + icon: 'none'
  316 + });
  317 + return false;
287 } 318 }
288 - if(that.subname=='请选择选考科目'){ 319 + if (that.subname == '请选择选考科目') {
289 uni.showToast({ 320 uni.showToast({
290 - title:"请选择选考科目",  
291 - icon:"none"  
292 - })  
293 - return false 321 + title: '请选择选考科目',
  322 + icon: 'none'
  323 + });
  324 + return false;
294 } 325 }
295 - if(that.upname=='请选择升学方式'){ 326 + if (that.upname == '请选择升学方式') {
296 uni.showToast({ 327 uni.showToast({
297 - title:"请选择升学方式",  
298 - icon:"none"  
299 - })  
300 - return false 328 + title: '请选择升学方式',
  329 + icon: 'none'
  330 + });
  331 + return false;
301 } 332 }
302 - if(that.collegename=='请选择就读大学'){ 333 + if (that.collegename == '请选择就读大学') {
303 uni.showToast({ 334 uni.showToast({
304 - title:"请选择就读大学",  
305 - icon:"none"  
306 - })  
307 - return false 335 + title: '请选择就读大学',
  336 + icon: 'none'
  337 + });
  338 + return false;
308 } 339 }
309 - if(that.academyname=='请选择所属学院'){ 340 + if (that.academyname == '请选择所属学院') {
310 uni.showToast({ 341 uni.showToast({
311 - title:"请选择所属学院",  
312 - icon:"none"  
313 - })  
314 - return false 342 + title: '请选择所属学院',
  343 + icon: 'none'
  344 + });
  345 + return false;
315 } 346 }
316 - if(that.majorname=='请选择所属专业'){ 347 + if (that.majorname == '请选择所属专业') {
317 uni.showToast({ 348 uni.showToast({
318 - title:"请选择所属专业",  
319 - icon:"none"  
320 - })  
321 - return false 349 + title: '请选择所属专业',
  350 + icon: 'none'
  351 + });
  352 + return false;
322 } 353 }
323 - var url = "register/register"  
324 - var token = uni.getStorageSync('token') 354 + var url = 'register/register';
  355 + var token = uni.getStorageSync('token');
325 var params = { 356 var params = {
326 - token:token,  
327 - level:2,  
328 - nickname:that.username,  
329 - head_image:that.chuanimg,  
330 - school_id:that.school_id,  
331 - email:that.email,  
332 - endtime:that.date,  
333 - subject_ids:that.subid.toString(),  
334 - up_id:that.upid,  
335 - university_id:that.uni_id,  
336 - graduated_id:that.majorid,  
337 - college_id:that.academyid  
338 -  
339 - }  
340 - app.post(url,params,"post").then((res)=>{  
341 - console.log(res) 357 + token: token,
  358 + level: 2,
  359 + nickname: that.username,
  360 + head_image: that.chuanimg,
  361 + school_id: that.school_id,
  362 + email: that.email,
  363 + endtime: that.date,
  364 + subject_ids: that.subid.toString(),
  365 + up_id: that.upid,
  366 + university_id: that.uni_id,
  367 + graduated_id: that.majorid,
  368 + college_id: that.academyid
  369 + };
  370 + app.post(url, params, 'post')
  371 + .then(res => {
  372 + console.log(res);
342 // console.log(res) 373 // console.log(res)
343 uni.showToast({ 374 uni.showToast({
344 - title:"注册成功",  
345 - icon:"none"  
346 - }) 375 + title: '注册成功',
  376 + icon: 'none'
  377 + });
347 setTimeout(() => { 378 setTimeout(() => {
348 uni.navigateTo({ 379 uni.navigateTo({
349 - url: "/pages/schoolmate/schoolmate?type="+2  
350 - }) 380 + url: '/pages/schoolmate/schoolmate?type=' + 2
  381 + });
351 }, 1500); 382 }, 1500);
352 - }).catch((err)=>{  
353 - console.log(err)  
354 - if(err.code==0){  
355 - uni.showToast({  
356 - title:err.msg,  
357 - icon:'none'  
358 }) 383 })
  384 + .catch(err => {
  385 + console.log(err);
  386 + if (err.code == 0) {
  387 + uni.showToast({
  388 + title: err.msg,
  389 + icon: 'none'
  390 + });
359 } 391 }
360 -  
361 - }) 392 + });
362 } 393 }
363 -  
364 }, 394 },
365 - onLoad(){  
366 - this.getUpType()  
367 - this.getAllSub() 395 + onLoad() {
  396 + this.getUpType();
  397 + this.getAllSub();
368 } 398 }
369 -  
370 -} 399 +};
371 </script> 400 </script>
372 401
373 <style lang="less"> 402 <style lang="less">
374 -.content{ 403 +.content {
375 padding: 32rpx; 404 padding: 32rpx;
376 - background:rgba(249,249,249,1); 405 + background: rgba(249, 249, 249, 1);
377 font-size: 28rpx; 406 font-size: 28rpx;
378 - .studentMsg{ 407 + .studentMsg {
379 background-color: #fff; 408 background-color: #fff;
380 padding: 0rpx 32rpx; 409 padding: 0rpx 32rpx;
381 - border-radius:20rpx;  
382 - .item{ 410 + border-radius: 20rpx;
  411 + .item {
383 height: 114rpx; 412 height: 114rpx;
384 display: flex; 413 display: flex;
385 justify-content: space-between; 414 justify-content: space-between;
386 align-items: center; 415 align-items: center;
387 - border-bottom: 1rpx solid rgba(238,238,238,1); 416 + border-bottom: 1rpx solid rgba(238, 238, 238, 1);
388 font-size: 28rpx; 417 font-size: 28rpx;
389 - .title{ 418 + .title {
390 // line-height: 114px; 419 // line-height: 114px;
391 padding: 30rpx 0; 420 padding: 30rpx 0;
392 // box-sizing: border-box; 421 // box-sizing: border-box;
393 } 422 }
394 - .selectBtn{  
395 - color:rgba(189,196,206,1); 423 + .selectBtn {
  424 + color: rgba(189, 196, 206, 1);
396 line-height: 114rpx; 425 line-height: 114rpx;
397 -  
398 } 426 }
399 - .icon{ 427 + .icon {
400 width: 13rpx; 428 width: 13rpx;
401 height: 24rpx; 429 height: 24rpx;
402 margin-left: 8rpx; 430 margin-left: 8rpx;
403 } 431 }
404 - .inpt{ 432 + .inpt {
405 height: 114rpx; 433 height: 114rpx;
406 text-align: right; 434 text-align: right;
407 // width: 250rpx; 435 // width: 250rpx;
408 } 436 }
409 - .photo{ 437 + .photo {
410 width: 64rpx; 438 width: 64rpx;
411 height: 64rpx; 439 height: 64rpx;
412 margin-top: 20rpx; 440 margin-top: 20rpx;
@@ -414,25 +442,25 @@ export default { @@ -414,25 +442,25 @@ export default {
414 } 442 }
415 } 443 }
416 } 444 }
417 - .schoolTitle{  
418 - font-size:32rpx;  
419 - color:rgba(45,85,117,1); 445 + .schoolTitle {
  446 + font-size: 32rpx;
  447 + color: rgba(45, 85, 117, 1);
420 margin-top: 44rpx; 448 margin-top: 44rpx;
421 margin-bottom: 12rpx; 449 margin-bottom: 12rpx;
422 } 450 }
423 - .okBtn{  
424 - width:686rpx;  
425 - height:80rpx;  
426 - background:rgba(45,85,117,1);  
427 - opacity:1;  
428 - border-radius:8rpx; 451 + .okBtn {
  452 + width: 686rpx;
  453 + height: 80rpx;
  454 + background: rgba(45, 85, 117, 1);
  455 + opacity: 1;
  456 + border-radius: 8rpx;
429 font-size: 28rpx; 457 font-size: 28rpx;
430 color: #fff; 458 color: #fff;
431 line-height: 80rpx; 459 line-height: 80rpx;
432 text-align: center; 460 text-align: center;
433 margin-top: 56rpx; 461 margin-top: 56rpx;
434 } 462 }
435 - .subPopup{ 463 + .subPopup {
436 width: 100%; 464 width: 100%;
437 height: 100%; 465 height: 100%;
438 background-color: rgba(0, 0, 0, 0.5); 466 background-color: rgba(0, 0, 0, 0.5);
@@ -441,53 +469,53 @@ export default { @@ -441,53 +469,53 @@ export default {
441 left: 0; 469 left: 0;
442 right: 0; 470 right: 0;
443 z-index: 999; 471 z-index: 999;
444 - .selectCard{ 472 + .selectCard {
445 width: 750rpx; 473 width: 750rpx;
446 height: 426rpx; 474 height: 426rpx;
447 - background:rgba(255,255,255,1); 475 + background: rgba(255, 255, 255, 1);
448 // opacity:1; 476 // opacity:1;
449 - border-radius:20px 20px 0px 0px; 477 + border-radius: 20px 20px 0px 0px;
450 position: absolute; 478 position: absolute;
451 bottom: 0; 479 bottom: 0;
452 - .buttonBox{ 480 + .buttonBox {
453 display: flex; 481 display: flex;
454 justify-content: space-between; 482 justify-content: space-between;
455 padding: 28rpx 30rpx; 483 padding: 28rpx 30rpx;
456 font-size: 28rpx; 484 font-size: 28rpx;
457 - .closeBtn{  
458 - color:rgba(140,145,152,1); 485 + .closeBtn {
  486 + color: rgba(140, 145, 152, 1);
459 } 487 }
460 - .confimBtn{  
461 - color:rgba(45,85,117,1); 488 + .confimBtn {
  489 + color: rgba(45, 85, 117, 1);
462 } 490 }
463 } 491 }
464 - .subBox{ 492 + .subBox {
465 display: flex; 493 display: flex;
466 flex-wrap: wrap; 494 flex-wrap: wrap;
467 justify-content: space-between; 495 justify-content: space-between;
468 padding: 16rpx 32rpx; 496 padding: 16rpx 32rpx;
469 - .active{  
470 - background:rgba(129,195,191,1);  
471 - border:2rpx solid rgba(129,195,191,1); 497 + .active {
  498 + background: rgba(129, 195, 191, 1);
  499 + border: 2rpx solid rgba(129, 195, 191, 1);
472 color: #fff; 500 color: #fff;
473 } 501 }
474 } 502 }
475 - .subject{  
476 - width:28%;  
477 - height:56rpx; 503 + .subject {
  504 + width: 28%;
  505 + height: 56rpx;
478 background: #fff; 506 background: #fff;
479 - border:1rpx solid rgba(6,18,30,1);  
480 - opacity:1;  
481 - border-radius:40rpx; 507 + border: 1rpx solid rgba(6, 18, 30, 1);
  508 + opacity: 1;
  509 + border-radius: 40rpx;
482 text-align: center; 510 text-align: center;
483 line-height: 56rpx; 511 line-height: 56rpx;
484 - color:rgba(6,18,30,1); 512 + color: rgba(6, 18, 30, 1);
485 font-size: 28rpx; 513 font-size: 28rpx;
486 margin-bottom: 36rpx; 514 margin-bottom: 36rpx;
487 } 515 }
488 } 516 }
489 } 517 }
490 - .stylePopup{ 518 + .stylePopup {
491 width: 100%; 519 width: 100%;
492 height: 100%; 520 height: 100%;
493 background-color: rgba(0, 0, 0, 0.5); 521 background-color: rgba(0, 0, 0, 0.5);
@@ -496,47 +524,47 @@ export default { @@ -496,47 +524,47 @@ export default {
496 left: 0; 524 left: 0;
497 right: 0; 525 right: 0;
498 z-index: 999; 526 z-index: 999;
499 - .styleCard{ 527 + .styleCard {
500 width: 750rpx; 528 width: 750rpx;
501 height: 228rpx; 529 height: 228rpx;
502 - background:rgba(255,255,255,1); 530 + background: rgba(255, 255, 255, 1);
503 // opacity:1; 531 // opacity:1;
504 - border-radius:20px 20px 0px 0px; 532 + border-radius: 20px 20px 0px 0px;
505 position: absolute; 533 position: absolute;
506 bottom: 0; 534 bottom: 0;
507 - .buttonBox{ 535 + .buttonBox {
508 display: flex; 536 display: flex;
509 justify-content: space-between; 537 justify-content: space-between;
510 padding: 28rpx 30rpx; 538 padding: 28rpx 30rpx;
511 font-size: 28rpx; 539 font-size: 28rpx;
512 - .closeBtn{  
513 - color:rgba(140,145,152,1); 540 + .closeBtn {
  541 + color: rgba(140, 145, 152, 1);
514 } 542 }
515 - .confimBtn{  
516 - color:rgba(45,85,117,1); 543 + .confimBtn {
  544 + color: rgba(45, 85, 117, 1);
517 } 545 }
518 } 546 }
519 - .subBox{ 547 + .subBox {
520 display: flex; 548 display: flex;
521 flex-wrap: wrap; 549 flex-wrap: wrap;
522 justify-content: space-around; 550 justify-content: space-around;
523 padding: 16rpx 32rpx; 551 padding: 16rpx 32rpx;
524 - .active{  
525 - background:rgba(129,195,191,1);  
526 - border:2rpx solid rgba(129,195,191,1); 552 + .active {
  553 + background: rgba(129, 195, 191, 1);
  554 + border: 2rpx solid rgba(129, 195, 191, 1);
527 color: #fff; 555 color: #fff;
528 } 556 }
529 } 557 }
530 - .subject{  
531 - width:28%;  
532 - height:56rpx; 558 + .subject {
  559 + width: 28%;
  560 + height: 56rpx;
533 background: #fff; 561 background: #fff;
534 - border:1rpx solid rgba(6,18,30,1);  
535 - opacity:1;  
536 - border-radius:40rpx; 562 + border: 1rpx solid rgba(6, 18, 30, 1);
  563 + opacity: 1;
  564 + border-radius: 40rpx;
537 text-align: center; 565 text-align: center;
538 line-height: 56rpx; 566 line-height: 56rpx;
539 - color:rgba(6,18,30,1); 567 + color: rgba(6, 18, 30, 1);
540 font-size: 28rpx; 568 font-size: 28rpx;
541 margin-bottom: 36rpx; 569 margin-bottom: 36rpx;
542 } 570 }
@@ -72,7 +72,6 @@ @@ -72,7 +72,6 @@
72 72
73 wxGetUserInfo(e) { 73 wxGetUserInfo(e) {
74 let that = this; 74 let that = this;
75 - console.log(e)  
76 // type:1 高中生 2 大学生 75 // type:1 高中生 2 大学生
77 let type = e.currentTarget.dataset.type; 76 let type = e.currentTarget.dataset.type;
78 console.log(type) 77 console.log(type)
@@ -107,6 +106,7 @@ @@ -107,6 +106,7 @@
107 console.log(r) 106 console.log(r)
108 that.session_key = r.session_key; 107 that.session_key = r.session_key;
109 that.openid = r.openid; 108 that.openid = r.openid;
  109 +
110 console.log(that.session_key); 110 console.log(that.session_key);
111 console.log(that.openid) 111 console.log(that.openid)
112 112
@@ -132,7 +132,6 @@ @@ -132,7 +132,6 @@
132 encryptedData: that.encrypted_data, 132 encryptedData: that.encrypted_data,
133 iv: that.iv 133 iv: that.iv
134 } 134 }
135 - console.log(param)  
136 app.post(url, param, "get").then(r => { 135 app.post(url, param, "get").then(r => {
137 uni.setStorageSync('token', r.userInfo.token); 136 uni.setStorageSync('token', r.userInfo.token);
138 137
@@ -121,6 +121,9 @@ export default { @@ -121,6 +121,9 @@ export default {
121 text-align: center; 121 text-align: center;
122 margin-right: 14rpx; 122 margin-right: 14rpx;
123 margin-bottom: 16rpx; 123 margin-bottom: 16rpx;
  124 + overflow: hidden;
  125 + white-space: nowrap;
  126 + text-overflow: ellipsis;
124 } 127 }
125 } 128 }
126 } 129 }
@@ -174,6 +174,8 @@ export default { @@ -174,6 +174,8 @@ export default {
174 color:rgba(6,18,30,1); 174 color:rgba(6,18,30,1);
175 height: 100vh; 175 height: 100vh;
176 font-size: 28rpx; 176 font-size: 28rpx;
  177 + display: flex;
  178 + flex-direction: column;
177 // padding: 0 32rpx; 179 // padding: 0 32rpx;
178 .selectCity{ 180 .selectCity{
179 display: flex; 181 display: flex;
@@ -195,6 +197,9 @@ export default { @@ -195,6 +197,9 @@ export default {
195 .list{ 197 .list{
196 font-size: 28rpx; 198 font-size: 28rpx;
197 padding: 12rpx 32rpx; 199 padding: 12rpx 32rpx;
  200 + flex: 1;
  201 + margin-bottom: 100rpx;
  202 + overflow-y: scroll;
198 .item{ 203 .item{
199 padding: 28rpx 0; 204 padding: 28rpx 0;
200 border-bottom: 1rpx solid rgba(238,238,238,1); 205 border-bottom: 1rpx solid rgba(238,238,238,1);
@@ -170,6 +170,9 @@ export default { @@ -170,6 +170,9 @@ export default {
170 background:rgba(249,249,249,1); 170 background:rgba(249,249,249,1);
171 color:rgba(6,18,30,1); 171 color:rgba(6,18,30,1);
172 height: 100vh; 172 height: 100vh;
  173 + display: flex;
  174 + flex-direction: column;
  175 +
173 // padding: 0 32rpx; 176 // padding: 0 32rpx;
174 .selectCity{ 177 .selectCity{
175 display: flex; 178 display: flex;
@@ -191,6 +194,9 @@ export default { @@ -191,6 +194,9 @@ export default {
191 .list{ 194 .list{
192 font-size: 28rpx; 195 font-size: 28rpx;
193 padding: 12rpx 32rpx; 196 padding: 12rpx 32rpx;
  197 + box-sizing: border-box;
  198 + overflow-y: scroll;
  199 + margin-bottom: 100rpx;
194 .item{ 200 .item{
195 padding: 28rpx 0; 201 padding: 28rpx 0;
196 border-bottom: 1rpx solid rgba(238,238,238,1); 202 border-bottom: 1rpx solid rgba(238,238,238,1);
@@ -70,10 +70,12 @@ @@ -70,10 +70,12 @@
70 word:'', 70 word:'',
71 schoollist:[], 71 schoollist:[],
72 isnulldata:false, 72 isnulldata:false,
73 - token:'' 73 + token:'',
  74 + isRegister: 0,
74 } 75 }
75 }, 76 },
76 onLoad(options){ 77 onLoad(options){
  78 + this.code2Token();
77 this.token=uni.getStorageSync('token') 79 this.token=uni.getStorageSync('token')
78 console.log(options); 80 console.log(options);
79 // this.getschoollist(); 81 // this.getschoollist();
@@ -89,7 +91,22 @@ @@ -89,7 +91,22 @@
89 uni.redirectTo({ 91 uni.redirectTo({
90 url: url 92 url: url
91 }) 93 })
92 - 94 + },
  95 + code2Token(){
  96 + let that = this;
  97 + uni.login({
  98 + success(res) {
  99 + let url = 'common/codeToToken'
  100 + app.post(url,{
  101 + code: res.code
  102 + }).then(r=>{
  103 + console.log()
  104 + uni.setStorageSync('token',r.userInfo.token);
  105 + uni.setStorageSync('isRegister',r.userInfo.is_register);
  106 + that.isRegister = r.userInfo.is_register;
  107 + })
  108 + }
  109 + })
93 }, 110 },
94 111
95 // 获取大学列表 112 // 获取大学列表
@@ -167,10 +184,22 @@ @@ -167,10 +184,22 @@
167 }) 184 })
168 }, 1500); 185 }, 1500);
169 }else{ 186 }else{
  187 + if(this.isRegister == 0){
  188 + uni.showToast({
  189 + title: '请完善信息后操作',
  190 + icon: 'none'
  191 + })
  192 + setTimeout(() => {
  193 + uni.navigateTo({
  194 + url:'../register/register?istoken='+1
  195 + })
  196 + }, 1500);
  197 + }else{
170 wx.navigateTo({ 198 wx.navigateTo({
171 url:'./searchSchool' 199 url:'./searchSchool'
172 }) 200 })
173 } 201 }
  202 + }
174 }, 203 },
175 204
176 onReachBottom: function() { 205 onReachBottom: function() {
1 <template> 1 <template>
2 <view class="content"> 2 <view class="content">
  3 + <view class="conet_top">
3 <view class="top"> 4 <view class="top">
4 <view class="search"> 5 <view class="search">
5 <image class="icon" src="../../static/sousuo_icon@2x.png"></image> 6 <image class="icon" src="../../static/sousuo_icon@2x.png"></image>
6 - <input type="text" placeholder="请输入搜索内容" class="input" placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;" style="font-size:28rpx;" v-model="word"> 7 + <input
  8 + type="text"
  9 + placeholder="请输入搜索内容"
  10 + class="input"
  11 + placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;"
  12 + style="font-size:28rpx;"
  13 + v-model="word"
  14 + />
7 </view> 15 </view>
8 <view class="searchBtn" @click="getschoollist">搜索</view> 16 <view class="searchBtn" @click="getschoollist">搜索</view>
9 </view> 17 </view>
10 <view class="type"> 18 <view class="type">
11 - <view class="paiming" :class="{'active':active1}" @click="paimingShow">排名</view>  
12 - <view class="diqu" :class="{'active':active2}" @click="diquShow">地区</view> 19 + <view class="paiming" :class="{ active: active1 }" @click="paimingShow">排名</view>
  20 + <view class="diqu" :class="{ active: active2 }" @click="diquShow">地区</view>
13 <view class="paimingPopup" v-if="isPaimingShow"> 21 <view class="paimingPopup" v-if="isPaimingShow">
14 <view class="title" @click="selectalllevel">全部</view> 22 <view class="title" @click="selectalllevel">全部</view>
15 - <view class="item" @click="paimingHide" v-for="(item,index) in levelList" :key="index">{{item.name}}</view> 23 + <view class="item" @click="paimingHide" v-for="(item, index) in levelList" :key="index">{{ item.name }}</view>
16 <!-- <view class="item" @click="paimingHide">{{item.name}}</view> --> 24 <!-- <view class="item" @click="paimingHide">{{item.name}}</view> -->
17 -  
18 </view> 25 </view>
19 <view class="diquPopup" v-if="isDiquShow"> 26 <view class="diquPopup" v-if="isDiquShow">
20 <view class="title" @click="selectallprovince">全部地区</view> 27 <view class="title" @click="selectallprovince">全部地区</view>
21 <view class="cont"> 28 <view class="cont">
22 <view class="colum"> 29 <view class="colum">
23 - <view class="item" @click="selectprovince" v-for="(item,index) in provinceList" :key="index" :data-id="item.code">{{item.name}}</view>  
24 - 30 + <view class="item" @click="selectprovince" v-for="(item, index) in provinceList" :key="index" :data-id="item.code">{{ item.name }}</view>
25 </view> 31 </view>
26 <view class="colum"> 32 <view class="colum">
27 - <view class="item" @click="selectcity" v-for="(item,index) in cityList" :key="index" :data-id="item.code">{{item.name}}</view>  
28 - 33 + <view class="item" @click="selectcity" v-for="(item, index) in cityList" :key="index" :data-id="item.code">{{ item.name }}</view>
  34 + </view>
29 </view> 35 </view>
30 -  
31 </view> 36 </view>
32 -  
33 </view> 37 </view>
34 </view> 38 </view>
35 39
36 <view class="contentBox"> 40 <view class="contentBox">
37 - <view class="item" v-for="(item,index) in schoolList" :key="index" @click="godetail(item)">  
38 - <view class="title">{{item.name}}</view> 41 + <view class="item" v-for="(item, index) in schoolList" :key="index" @click="godetail(item)">
  42 + <view class="title">{{ item.name }}</view>
39 <image class="icon" :src="item.icon_image"></image> 43 <image class="icon" :src="item.icon_image"></image>
40 </view> 44 </view>
41 </view> 45 </view>
42 -  
43 </view> 46 </view>
44 </template> 47 </template>
45 48
46 <script> 49 <script>
47 -import app from "../../App.vue"; 50 +import app from '../../App.vue';
48 51
49 export default { 52 export default {
50 - data(){  
51 - return{  
52 - isPaimingShow:false,  
53 - isDiquShow:false,  
54 - active1:false, 53 + data() {
  54 + return {
  55 + isPaimingShow: false,
  56 + isDiquShow: false,
  57 + active1: false,
55 // isDiquShow:false, 58 // isDiquShow:false,
56 - active2:false,  
57 - province_id:"",  
58 - city_id:'',  
59 - level_id:'',  
60 - provinceList:[],  
61 - cityList:[],  
62 - schoolList:[],  
63 - word:'',  
64 - page:'1',  
65 - levelList:[]  
66 - } 59 + active2: false,
  60 + province_id: '',
  61 + city_id: '',
  62 + level_id: '',
  63 + provinceList: [],
  64 + cityList: [],
  65 + schoolList: [],
  66 + word: '',
  67 + page: '1',
  68 + levelList: []
  69 + };
67 }, 70 },
68 - methods:{  
69 - paimingShow(event){  
70 - this.isPaimingShow=true;  
71 - this.isDiquShow=false  
72 - this.active1=true,  
73 - this.active2=false  
74 - 71 + methods: {
  72 + paimingShow(event) {
  73 + this.isPaimingShow = true;
  74 + this.isDiquShow = false;
  75 + (this.active1 = true), (this.active2 = false);
75 }, 76 },
76 - paimingHide(){  
77 - this.isPaimingShow=false;  
78 - this.active1=false,  
79 - this.active2=false 77 + paimingHide() {
  78 + this.isPaimingShow = false;
  79 + (this.active1 = false), (this.active2 = false);
80 }, 80 },
81 - diquShow(){  
82 - this.isDiquShow=true;  
83 - this.isPaimingShow=false;  
84 - this.active2=true,  
85 - this.active1=false  
86 - 81 + diquShow() {
  82 + this.isDiquShow = true;
  83 + this.isPaimingShow = false;
  84 + (this.active2 = true), (this.active1 = false);
87 }, 85 },
88 - diquHide(){  
89 - this.isDiquShow=false,  
90 - this.active1=false,  
91 - this.active2=false 86 + diquHide() {
  87 + (this.isDiquShow = false), (this.active1 = false), (this.active2 = false);
92 }, 88 },
93 //获取全部地区(省) 89 //获取全部地区(省)
94 - getAllProvince(){  
95 - var url ="city/getAllProvince"  
96 - var params ={}  
97 - app.post(url,params,"get").then((res)=>{  
98 - this.provinceList=res  
99 - console.log(res)  
100 - }).catch((err)=>{  
101 - console.log(err) 90 + getAllProvince() {
  91 + var url = 'city/getAllProvince';
  92 + var params = {};
  93 + app.post(url, params, 'get')
  94 + .then(res => {
  95 + this.provinceList = res;
  96 + console.log(res);
102 }) 97 })
  98 + .catch(err => {
  99 + console.log(err);
  100 + });
103 }, 101 },
104 102
105 //市 103 //市
106 - getAllCity(){  
107 - var url = "city/getCity" 104 + getAllCity() {
  105 + var url = 'city/getCity';
108 var params = { 106 var params = {
109 - province_id:this.province_id  
110 - }  
111 - app.post(url,params,"get").then((res)=>{  
112 - console.log(res)  
113 - this.cityList=res  
114 - }).catch((err)=>{  
115 - console.log(err) 107 + province_id: this.province_id
  108 + };
  109 + app.post(url, params, 'get')
  110 + .then(res => {
  111 + console.log(res);
  112 + this.cityList = res;
116 }) 113 })
  114 + .catch(err => {
  115 + console.log(err);
  116 + });
117 }, 117 },
118 //点击选中的省 118 //点击选中的省
119 - selectprovince(e){  
120 - this.province_id=e.currentTarget.dataset.id  
121 - this.getAllCity()  
122 - 119 + selectprovince(e) {
  120 + this.province_id = e.currentTarget.dataset.id;
  121 + this.getAllCity();
123 }, 122 },
124 //点击全部省 123 //点击全部省
125 - selectallprovince(){  
126 - this.getschoollist()  
127 - this.isDiquShow=false 124 + selectallprovince() {
  125 + this.getschoollist();
  126 + this.isDiquShow = false;
128 }, 127 },
129 //点击选中全部市 128 //点击选中全部市
130 - selectallcity(){  
131 - this.getschoollist()  
132 - this.isDiquShow=false  
133 - 129 + selectallcity() {
  130 + this.getschoollist();
  131 + this.isDiquShow = false;
134 }, 132 },
135 //点击选中的市 133 //点击选中的市
136 - selectcity(e){  
137 - this.city_id=e.currentTarget.dataset.id  
138 - this.getschoollist()  
139 - this.isDiquShow=false 134 + selectcity(e) {
  135 + this.city_id = e.currentTarget.dataset.id;
  136 + this.getschoollist();
  137 + this.isDiquShow = false;
140 }, 138 },
141 // getAllSchool(){ 139 // getAllSchool(){
142 // var url="city/getUniversityByCity" 140 // var url="city/getUniversityByCity"
@@ -151,109 +149,111 @@ export default { @@ -151,109 +149,111 @@ export default {
151 // }) 149 // })
152 // }, 150 // },
153 // 获取大学列表 151 // 获取大学列表
154 - getschoollist(){ 152 + getschoollist() {
155 let that = this; 153 let that = this;
156 var url = 'university/getUniversityList'; 154 var url = 'university/getUniversityList';
157 var params = { 155 var params = {
158 - page:that.page,  
159 - size:10,  
160 - word:that.word,  
161 - level_id:that.level_id,  
162 - province_id:that.province_id  
163 - }  
164 - app.post(url, params,"post").then((res) => { 156 + page: that.page,
  157 + size: 10,
  158 + word: that.word,
  159 + level_id: that.level_id,
  160 + province_id: that.province_id
  161 + };
  162 + app.post(url, params, 'post')
  163 + .then(res => {
165 console.log(res); 164 console.log(res);
166 - that.schoolList=res  
167 -  
168 - }).catch((err) => {  
169 - 165 + that.schoolList = res;
170 }) 166 })
  167 + .catch(err => {});
171 }, 168 },
172 //获取全部排名 169 //获取全部排名
173 - getAllLevel(){ 170 + getAllLevel() {
174 let that = this; 171 let that = this;
175 - var url = 'university/getUniversityLevel'  
176 - var params={}  
177 - app.post(url,params,"get").then((res)=>{  
178 - that.levelList=res  
179 -  
180 - }).catch((err)=>{  
181 - console.log(err) 172 + var url = 'university/getUniversityLevel';
  173 + var params = {};
  174 + app.post(url, params, 'get')
  175 + .then(res => {
  176 + that.levelList = res;
182 }) 177 })
  178 + .catch(err => {
  179 + console.log(err);
  180 + });
183 }, 181 },
184 //点击全部排名 182 //点击全部排名
185 - selectalllevel(){  
186 - this.isPaimingShow=false  
187 - this.getschoollist()  
188 - 183 + selectalllevel() {
  184 + this.isPaimingShow = false;
  185 + this.getschoollist();
189 }, 186 },
190 // 进入学校详情页 187 // 进入学校详情页
191 - godetail(item){  
192 - let id=item.id; 188 + godetail(item) {
  189 + let id = item.id;
193 uni.navigateTo({ 190 uni.navigateTo({
194 - url:'./schoolDetails?id='+id  
195 - })  
196 - },  
197 -  
198 - 191 + url: './schoolDetails?id=' + id
  192 + });
  193 + }
199 }, 194 },
200 - onLoad(){  
201 - this.getAllProvince()  
202 - this.getschoollist()  
203 - this.getAllLevel() 195 + onLoad() {
  196 + this.getAllProvince();
  197 + this.getschoollist();
  198 + this.getAllLevel();
204 } 199 }
205 -  
206 -} 200 +};
207 </script> 201 </script>
208 202
209 <style lang="less"> 203 <style lang="less">
210 -.content{  
211 - background-color: rgba(249,249,249,1);  
212 - .top{ 204 +page{
  205 + height: 100%;
  206 + width: 100%;
  207 +}
  208 +.content {
  209 + background-color: rgba(249, 249, 249, 1);
  210 + height: 100%;
  211 + display: flex;
  212 + flex-direction: column;
  213 + .top {
213 padding: 18rpx 32rpx; 214 padding: 18rpx 32rpx;
214 display: flex; 215 display: flex;
215 background-color: #fff; 216 background-color: #fff;
216 } 217 }
217 - .search{  
218 - // background-color: #fff; 218 + .search {
219 display: flex; 219 display: flex;
220 - // text-align: center;  
221 align-items: center; 220 align-items: center;
222 - width:596rpx;  
223 - height:64rpx;  
224 - background:rgba(238,238,238,1);  
225 - opacity:1;  
226 - border-radius:40rpx; 221 + width: 596rpx;
  222 + height: 64rpx;
  223 + background: rgba(238, 238, 238, 1);
  224 + opacity: 1;
  225 + border-radius: 40rpx;
227 padding: 0 28rpx; 226 padding: 0 28rpx;
228 box-sizing: border-box; 227 box-sizing: border-box;
229 - .icon{ 228 + .icon {
230 width: 30rpx; 229 width: 30rpx;
231 height: 30rpx; 230 height: 30rpx;
232 } 231 }
233 - .input{ 232 + .input {
234 height: 64rpx; 233 height: 64rpx;
235 width: 500rpx; 234 width: 500rpx;
236 text-align: center; 235 text-align: center;
237 } 236 }
238 -  
239 } 237 }
240 - .searchBtn{  
241 - color:rgba(6,18,30,1); 238 + .searchBtn {
  239 + color: rgba(6, 18, 30, 1);
242 font-size: 28rpx; 240 font-size: 28rpx;
243 line-height: 64rpx; 241 line-height: 64rpx;
244 margin-left: 20rpx; 242 margin-left: 20rpx;
245 } 243 }
246 - .type{ 244 + .type {
247 display: flex; 245 display: flex;
248 - color:rgba(6,18,30,1); 246 + color: rgba(6, 18, 30, 1);
249 font-size: 24rpx; 247 font-size: 24rpx;
250 background-color: #fff; 248 background-color: #fff;
251 padding: 24rpx 32rpx; 249 padding: 24rpx 32rpx;
252 margin-top: 2rpx; 250 margin-top: 2rpx;
253 - .paiming,.diqu{ 251 + .paiming,
  252 + .diqu {
254 margin-right: 72rpx; 253 margin-right: 72rpx;
255 } 254 }
256 - .paimingPopup,.diquPopup{ 255 + .paimingPopup,
  256 + .diquPopup {
257 width: 750rpx; 257 width: 750rpx;
258 height: 600rpx; 258 height: 600rpx;
259 position: absolute; 259 position: absolute;
@@ -263,51 +263,54 @@ export default { @@ -263,51 +263,54 @@ export default {
263 padding: 22rpx 32rpx; 263 padding: 22rpx 32rpx;
264 box-sizing: border-box; 264 box-sizing: border-box;
265 z-index: 999; 265 z-index: 999;
266 - box-shadow:0px 4px 4px rgba(0,0,0,0.06);  
267 - border-top: 1rpx solid rgba(249,249,249,1);  
268 - .item{ 266 + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.06);
  267 + border-top: 1rpx solid rgba(249, 249, 249, 1);
  268 + .item {
269 margin-bottom: 22rpx; 269 margin-bottom: 22rpx;
270 // height: 74rpx; 270 // height: 74rpx;
271 width: 170rpx; 271 width: 170rpx;
272 } 272 }
273 - .title{ 273 + .title {
274 margin-bottom: 20rpx; 274 margin-bottom: 20rpx;
275 } 275 }
276 - .cont{ 276 + .cont {
277 display: flex; 277 display: flex;
278 // flex-direction: column; 278 // flex-direction: column;
279 flex-wrap: wrap; 279 flex-wrap: wrap;
280 justify-content: start; 280 justify-content: start;
281 - .colum{ 281 + .colum {
282 overflow: auto; 282 overflow: auto;
283 height: 500rpx; 283 height: 500rpx;
284 width: 30%; 284 width: 30%;
285 } 285 }
286 } 286 }
287 } 287 }
288 - .active{  
289 - color: #05849D; 288 + .active {
  289 + color: #05849d;
290 } 290 }
291 } 291 }
292 - .contentBox{ 292 + .contentBox {
293 padding: 24rpx 32rpx; 293 padding: 24rpx 32rpx;
294 - .item{  
295 - width:686rpx;  
296 - height:160rpx;  
297 - background:rgba(255,255,255,1);  
298 - opacity:1;  
299 - border-radius:8rpx; 294 + box-sizing: border-box;
  295 + flex: 1;
  296 + overflow-y: scroll;
  297 + .item {
  298 + width: 686rpx;
  299 + height: 160rpx;
  300 + background: rgba(255, 255, 255, 1);
  301 + opacity: 1;
  302 + border-radius: 8rpx;
300 display: flex; 303 display: flex;
301 font-size: 28rpx; 304 font-size: 28rpx;
302 - color:rgba(61,68,77,1); 305 + color: rgba(61, 68, 77, 1);
303 justify-content: space-between; 306 justify-content: space-between;
304 padding: 0 40rpx; 307 padding: 0 40rpx;
305 box-sizing: border-box; 308 box-sizing: border-box;
306 margin-bottom: 24rpx; 309 margin-bottom: 24rpx;
307 - .title{ 310 + .title {
308 line-height: 160rpx; 311 line-height: 160rpx;
309 } 312 }
310 - .icon{ 313 + .icon {
311 width: 120rpx; 314 width: 120rpx;
312 height: 120rpx; 315 height: 120rpx;
313 margin-top: 20rpx; 316 margin-top: 20rpx;
@@ -12,8 +12,6 @@ @@ -12,8 +12,6 @@
12 <!-- <view class="typeitem" @click="schoolShow" :class="{'active':active2}">学校</view> --> 12 <!-- <view class="typeitem" @click="schoolShow" :class="{'active':active2}">学校</view> -->
13 <view class="typeitem" @click="majorShow" :class="{'active':active3}">专业</view> 13 <view class="typeitem" @click="majorShow" :class="{'active':active3}">专业</view>
14 <view class="typeitem" @click="styleShow" :class="{'active':active4}">升学方式</view> 14 <view class="typeitem" @click="styleShow" :class="{'active':active4}">升学方式</view>
15 -  
16 -  
17 <view class="diquPopup" v-if="isDiquShow"> 15 <view class="diquPopup" v-if="isDiquShow">
18 16
19 <view class="cont"> 17 <view class="cont">
@@ -30,7 +28,6 @@ @@ -30,7 +28,6 @@
30 <view class="colum" style="overflow: auto;height: 600rpx;"> 28 <view class="colum" style="overflow: auto;height: 600rpx;">
31 <view class="title" @click="selectschool" :data-id="null">全部学校</view> 29 <view class="title" @click="selectschool" :data-id="null">全部学校</view>
32 <view class="item" @click="selectschool" v-for="(item,index) in schoolList" :key="index" :data-id="item.id">{{item.name}}</view> 30 <view class="item" @click="selectschool" v-for="(item,index) in schoolList" :key="index" :data-id="item.id">{{item.name}}</view>
33 -  
34 </view> 31 </view>
35 32
36 </view> 33 </view>
@@ -47,9 +44,7 @@ @@ -47,9 +44,7 @@
47 <view class="majorPopup" v-if="isMajorShow"> 44 <view class="majorPopup" v-if="isMajorShow">
48 <view class="cont" style="display:flex;flex-direction: column;overflow: auto;height: 600rpx;"> 45 <view class="cont" style="display:flex;flex-direction: column;overflow: auto;height: 600rpx;">
49 <view class="title" @click="selectgraduated" :data-id="null">全部</view> 46 <view class="title" @click="selectgraduated" :data-id="null">全部</view>
50 -  
51 <view class="item" style="width:330rpx" @click="selectgraduated" v-for="(item,index) in graduatedList" :key="index" :data-id="item.id">{{item.name}}</view> 47 <view class="item" style="width:330rpx" @click="selectgraduated" v-for="(item,index) in graduatedList" :key="index" :data-id="item.id">{{item.name}}</view>
52 -  
53 </view> 48 </view>
54 </view> 49 </view>
55 <view class="stylePopup" v-if="isStyleShow"> 50 <view class="stylePopup" v-if="isStyleShow">
@@ -169,7 +164,6 @@ data(){ @@ -169,7 +164,6 @@ data(){
169 page:'1', 164 page:'1',
170 size:'10', 165 size:'10',
171 word:'' 166 word:''
172 -  
173 }, 167 },
174 168
175 graduatedList:[], 169 graduatedList:[],
@@ -379,8 +373,11 @@ methods:{ @@ -379,8 +373,11 @@ methods:{
379 }, 373 },
380 //点击选中的省 374 //点击选中的省
381 selectprovince(e){ 375 selectprovince(e){
382 - this.province_id=e.currentTarget.dataset.id 376 + if(this.province_id!=e.currentTarget.dataset.id){
  377 + this.province_id=e.currentTarget.dataset.id;
  378 + this.schoolList = [];
383 this.getAllCity() 379 this.getAllCity()
  380 + }
384 381
385 }, 382 },
386 //点击全部省 383 //点击全部省
@@ -396,8 +393,13 @@ methods:{ @@ -396,8 +393,13 @@ methods:{
396 }, 393 },
397 //点击选中的市 394 //点击选中的市
398 selectcity(e){ 395 selectcity(e){
  396 + if(this.city_id!=e.currentTarget.dataset.id){
399 this.city_id=e.currentTarget.dataset.id 397 this.city_id=e.currentTarget.dataset.id
  398 + this.schoolList = [];
400 this.getAllSchool() 399 this.getAllSchool()
  400 + }
  401 +
  402 +
401 }, 403 },
402 todetile(e){ 404 todetile(e){
403 if(uni.getStorageSync('token')==''){ 405 if(uni.getStorageSync('token')==''){