index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <template>
  2. <view class="content">
  3. <!-- <image class="logo" src="/static/logo.png"></image> -->
  4. <div class="search-input-box">
  5. <div>
  6. <image class="search_icon_nor" src="../../static/search_icon_nor.png" mode=""></image>
  7. </div>
  8. <input type="text" placeholder="搜索专业、院校" value="" />
  9. </div>
  10. <!-- <image class="banner" src="/static/home-all.png" mode="widthFix"></image> -->
  11. <div class="view-content">
  12. <div>
  13. <image src="../../static/home_ic_college@2x.png" mode="widthFix"></image>
  14. <p>院校库</p>
  15. </div>
  16. <div>
  17. <image src="../../static/home_ic_major@2x.png" mode="widthFix"></image>
  18. <p>专业库</p>
  19. </div>
  20. <div>
  21. <image src="../../static/home_ic_test@2x.png" mode="widthFix"></image>
  22. <p>兴趣测评</p>
  23. </div>
  24. </div>
  25. <div class="school">
  26. <image src="../../static/home_word_university@2x.png" mode="widthFix"></image>
  27. <div class="school-content">
  28. <div class="schol-icon">
  29. <image src="../../static/清华@2x.png" mode="widthFix"></image>
  30. <span>清华大学</span>
  31. </div>
  32. <div class="schol-icon">
  33. <image src="../../static/清华@2x.png" mode="widthFix"></image>
  34. <span>清华大学</span>
  35. </div>
  36. </div>
  37. <div class="school-content">
  38. <!-- <div> -->
  39. <div class="schol-icon">
  40. <image src="../../static/清华@2x.png" mode="widthFix"></image>
  41. <span>清华大学</span>
  42. </div>
  43. <div class="schol-icon">
  44. <image src="../../static/清华@2x.png" mode="widthFix"></image>
  45. <span>清华大学</span>
  46. </div>
  47. </div>
  48. <div class="school-content">
  49. <!-- <div> -->
  50. <div class="schol-icon">
  51. <image src="../../static/清华@2x.png" mode="widthFix"></image>
  52. <span>清华大学</span>
  53. </div>
  54. <div class="schol-icon">
  55. <image src="../../static/清华@2x.png" mode="widthFix"></image>
  56. <span>清华大学</span>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="major">
  61. <image src="../../static/home_word_profession@2x.png" mode="widthFix"></image>
  62. <div class="major-content">
  63. </div>
  64. </div>
  65. <view class="example-title">自定义弹出层</view>
  66. <view class="example-body">
  67. <button class="button" type="button" @click="togglePopup('center', 'tip')">提示框</button>
  68. <button class="button" type="button" @click="togglePopup('center', 'popup')">中间弹出 popup</button>
  69. <button class="button" type="button" @click="togglePopup('center', 'get-grade')">插屏广告</button>
  70. <!-- <button class="button" type="button" @click="togglePopup('bottom', 'share')">底部分享</button> -->
  71. </view>
  72. <uni-popup ref="popup" :type="type" @change="change">{{ content }}</uni-popup>
  73. <uni-popup :show="show" :type="type" :custom="true" :mask-click="false" @change="change">
  74. <view class="uni-tip">
  75. <view class="uni-tip-title">微信授权</view>
  76. <view class="uni-tip-image">
  77. <image src="../../static/芝麻高报-logo.png" mode=""></image>
  78. </view>
  79. <view class="uni-tip-content">芝麻高报系统申请获取以下权限:</view>
  80. <view class="uni-tip-content">
  81. <ul>
  82. <li>获得你的信息(昵称、头像、地区 等)</li>
  83. </ul>
  84. <picker mode="">
  85. <view>文科</view><view>内蒙古</view>
  86. </picker>
  87. <picker mode="">
  88. <view>内蒙古</view>
  89. </picker>
  90. </view>
  91. <view class="uni-tip-group-button">
  92. <view class="uni-tip-button" @click="cancel('tip')">拒绝</view>
  93. <view class="uni-tip-button" @click="cancel('tip')">允许</view>
  94. </view>
  95. </view>
  96. </uni-popup>
  97. <uni-popup ref="get-grade" :type="type" :custom="true" :mask-click="false" @change="change">
  98. <view class="get-grade">
  99. <view class="get-grade-title">输入分数,获取适合你的学校、专业和志愿预测</view>
  100. <view class="get-grade-content">
  101. <button type="primary" bindtap="listenerButton">弹出ActionSheet</button>
  102. <input type="number" name="" id="" value="" placeholder="内蒙古" @click="wx.showActionSheet()"/>
  103. <input type="idcard" name="" id="" value="" placeholder="文科" />
  104. </view>
  105. <view class="get-grade-content">
  106. <input type="number" name="" id="" value="" placeholder="输入预估分数"/>
  107. <input type="number" name="" id="" value="" placeholder="输入位次(选填)"/>
  108. </view>
  109. <view class="uni-get-grade-button">
  110. <view class="get-grade-button" @click="togglePopup('center', 'image')">立即获取</view>
  111. </view>
  112. </view>
  113. </uni-popup>
  114. </view>
  115. </template>
  116. <script>
  117. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  118. import uniIcon from '@/components/uni-icon/uni-icon.vue'
  119. export default {
  120. components: {
  121. uniPopup,
  122. uniIcon
  123. },
  124. data() {
  125. return {
  126. title:"hello",
  127. open:'tip',
  128. show: false,
  129. type: '',
  130. list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
  131. content: '顶部弹 popup'
  132. }
  133. },
  134. onLoad() {
  135. // wx.showActionSheet({
  136. //
  137. // itemList: ['A', 'B', 'C'],
  138. //
  139. // success: function (res) {
  140. //
  141. // if (!res.cancel) {
  142. //
  143. // console.log(res.tapIndex)//这里是点击了那个按钮的下标
  144. //
  145. // }
  146. //
  147. // }
  148. //
  149. // })
  150. },
  151. methods: {
  152. togglePopup(type, open) {
  153. switch (type) {
  154. case 'top':
  155. this.content = '顶部弹出 popup'
  156. break
  157. case 'bottom':
  158. this.content = '底部弹出 popup'
  159. break
  160. case 'center':
  161. this.content = '居中弹出 popup'
  162. break
  163. }
  164. this.type = type
  165. if (open === 'tip') {
  166. this.show = true
  167. } else {
  168. this.$refs[open].open()
  169. }
  170. },
  171. cancel(type) {
  172. if (type === 'tip') {
  173. this.show = false
  174. return
  175. }
  176. this.$refs[type].close()
  177. },
  178. change(e) {
  179. console.log(e.show)
  180. }
  181. }
  182. }
  183. </script>
  184. <style>
  185. .search-input-box{
  186. width:690upx;
  187. height:70upx;
  188. background:rgba(248,248,248,1);
  189. border-radius:36upx;
  190. border:1upx solid rgba(242,242,242,1);
  191. margin-top: 42upx;
  192. }
  193. .search-input-box image{
  194. width:70upx;
  195. height:70upx;
  196. margin-left: 20upx;
  197. float: left;
  198. }
  199. .search-input-box uni-input {
  200. overflow: visible;
  201. float: left;
  202. }
  203. .search-input-box input{
  204. box-sizing: border-box;
  205. /* margin-bottom: 1upx; */
  206. outline: none;
  207. padding-left: 10upx;
  208. border:0;
  209. /* margin-top: 10upx; */
  210. height:70upx;
  211. }
  212. .search-input-box .uni-input-placeholder{
  213. width:196upx;
  214. height:40upx;
  215. font-size:28upx;
  216. font-family:PingFangSC;
  217. font-weight:400;
  218. color:rgba(175,178,191,1);
  219. line-height:40upx;
  220. }
  221. .banner{
  222. width:690upx;
  223. height:308upx;
  224. border-radius:20upx;
  225. }
  226. .content {
  227. display: flex;
  228. flex-direction: column;
  229. align-items: center;
  230. justify-content: center;
  231. /* background-color: #F8F8F8; */
  232. }
  233. .view-content{
  234. display: flex;
  235. flex-direction: row no-wrap;
  236. height:210upx;
  237. background:rgba(255,255,255,1);
  238. }
  239. .view-content image{
  240. width:128upx;
  241. height:128upx;
  242. overflow: visible;
  243. vertical-align:middle;
  244. }
  245. .view-content p{
  246. text-align:center;
  247. width:96upx;
  248. height:33upx;
  249. font-size:24upx;
  250. font-family:PingFangSC;
  251. font-weight:500;
  252. color:rgba(117,119,128,1);
  253. line-height:33upx;
  254. }
  255. .view-content div{
  256. display: flex;
  257. flex-direction: column;
  258. width:80upx;
  259. height:28upx;
  260. }
  261. .view-content div:first-child{
  262. margin-left: 61upx;
  263. margin-right: 0upx;
  264. }
  265. .view-content div:nth-child(2){
  266. margin-left: 122upx;
  267. margin-right: 122upx;
  268. }
  269. .view-content div:nth-child(3){
  270. margin-right: 61upx;
  271. }
  272. .view-content p{
  273. align-self:center;
  274. }
  275. .view-content image{
  276. align-self:center;
  277. }
  278. .school {
  279. align-items:flex-start;
  280. width:750upx;
  281. /* height:984upx; */
  282. background:rgba(255,255,255,1);
  283. }
  284. .school image{
  285. width: 170upx;
  286. height: 54upx;
  287. margin: 0 auto;
  288. /* text-align: center; */
  289. /* vertical-align: middle; */
  290. display: block;
  291. }
  292. .school-content{
  293. display: flex;
  294. flex-wrap: wrap;
  295. }
  296. .school-content div:first-child{
  297. margin-left: 98upx;
  298. margin-right: 195upx;
  299. }
  300. .schol-icon image{
  301. width: 180upx;
  302. height: 180upx;
  303. }
  304. .schol-icon span{
  305. width:112upx;
  306. height:40upx;
  307. font-size:28upx;
  308. font-family:PingFangSC;
  309. font-weight:500;
  310. color:rgba(44,44,44,1);
  311. line-height:40upx;
  312. margin-top: 24upx;
  313. margin-bottom: 40upx;
  314. }
  315. .schol-icon{
  316. display: flex;
  317. flex-direction: column;
  318. align-items: flex-end;
  319. text-align: -webkit-center;
  320. }
  321. .major{
  322. width:750upx;
  323. height:470upx;
  324. background:rgba(255,255,255,1);
  325. margin-top: 20upx;
  326. }
  327. .major image{
  328. width: 170upx;
  329. height: 54upx;
  330. margin: 0 auto;
  331. display: block;
  332. }
  333. /* 授权窗口 */
  334. .uni-tip {
  335. padding: 15upx;
  336. width: 300upx;
  337. background: #fff;
  338. box-sizing: border-box;
  339. border-radius: 10upx;
  340. width:560upx;
  341. height:515upx;
  342. background:rgba(255,255,255,1);
  343. border-radius:8upx;
  344. }
  345. .uni-tip-title {
  346. text-align: center;
  347. padding: 21upx 100upx;
  348. /* width:136upx; */
  349. height:48upx;
  350. font-size:34upx;
  351. font-family:PingFangSC;
  352. font-weight:500;
  353. color:rgba(0,0,0,1);
  354. line-height:48upx;
  355. border-bottom: 1px solid rgba(229,229,229,1);
  356. }
  357. .uni-tip-image {
  358. border:0upx;
  359. text-align: center;
  360. }
  361. .uni-tip-image image{
  362. width: 64upx;
  363. height: 64upx;
  364. border:0upx;
  365. margin-top: 36upx;
  366. margin-bottom: 24upx;
  367. }
  368. .uni-tip-content {
  369. margin-left: 54upx;
  370. padding-bottom: 36upx;
  371. width:420upx;
  372. height:40upx;
  373. font-size:28upx;
  374. font-family:PingFangSC;
  375. font-weight:400;
  376. color:rgba(0,0,0,1);
  377. line-height:40upx;
  378. }
  379. .uni-tip-group-button {
  380. margin-top: 10upx;
  381. display: flex;
  382. justify-content: space-around;
  383. border-top: 1px solid rgba(229,229,229,1);
  384. padding-top: 27upx;
  385. }
  386. .uni-tip-group-button view:nth-child(1){
  387. width:144upx;
  388. height:45upx;
  389. font-size:32upx;
  390. font-family:PingFangSC;
  391. font-weight:400;
  392. color:#000000;
  393. line-height:45upx;
  394. }
  395. .uni-tip-group-button view:nth-child(2){
  396. width:111upx;
  397. height:45upx;
  398. font-size:32upx;
  399. font-family:PingFangSC;
  400. font-weight:400;
  401. color:#02BB00;
  402. line-height:45upx;
  403. }
  404. .uni-tip-button {
  405. width: 100%;
  406. text-align: center;
  407. /* font-size: 14upx; */
  408. /* color: #3b4144; */
  409. }
  410. .get-grade{
  411. width:560upx;
  412. height:616upx;
  413. background:rgba(255,255,255,1);
  414. border-radius:8upx;
  415. text-align: center;
  416. }
  417. .get-grade-title{
  418. padding: 40upx;
  419. }
  420. /* .get-grade-content{
  421. margin: 0 auto;
  422. } */
  423. .get-grade-content select{
  424. width:230upx;
  425. height:80upx;
  426. background:rgba(248,248,248,1);
  427. border-radius:40upx;
  428. border:1upx solid rgba(242,242,242,1);
  429. margin-right: 20upx;
  430. }
  431. /* .get-grade-content option{
  432. margin: 20upx 40upx;
  433. } */
  434. .get-grade-content input{
  435. width:480upx;
  436. height:80upx;
  437. background:rgba(248,248,248,1);
  438. border-radius:40upx;
  439. border:1upx solid rgba(242,242,242,1);
  440. margin: 10upx 40upx;
  441. }
  442. .uni-get-grade-button{
  443. width:480upx;
  444. height:80upx;
  445. background:rgba(239,58,58,1);
  446. box-shadow:0upx 6upx 12upx 0upx rgba(239,58,58,0.2);
  447. border-radius:40upx;
  448. text-align: center;
  449. margin: 22upx 40upx;
  450. }
  451. select{
  452. width: auto;
  453. padding: 0 0 0 55upx;
  454. margin: 0;
  455. }
  456. .get-grade-button{
  457. /* margin: 24upx 100upx; */
  458. width:120upx;
  459. height:42upx;
  460. font-size:30upx;
  461. font-family:PingFangSC;
  462. font-weight:500;
  463. color:rgba(255,255,255,1);
  464. line-height:80upx;
  465. margin: 0 auto;
  466. /* height:80upx; */
  467. }
  468. .content {
  469. display: flex;
  470. flex-direction: column;
  471. align-items: center;
  472. justify-content: center;
  473. }
  474. .logo {
  475. height: 200upx;
  476. width: 200upx;
  477. margin-top: 200upx;
  478. margin-left: auto;
  479. margin-right: auto;
  480. margin-bottom: 50upx;
  481. }
  482. .text-area {
  483. display: flex;
  484. justify-content: center;
  485. }
  486. .title {
  487. font-size: 36upx;
  488. color: #8f8f94;
  489. }
  490. </style>