predict.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view class="headselection">
  3. <ChooseLits :list="list" :arr="arr" @chooseLike="chooseLike"></ChooseLits>
  4. <view class="search">
  5. <input type="number" placeholder="输入预估分数" />
  6. <button type="primary">立即获取</button>
  7. </view>
  8. <view class="uni-product-list">
  9. <view class="uni-product"></view>
  10. <view class="uni-product" v-for="(product,index) in data" :key="index">
  11. <view class="image-view">
  12. <image class="uni-product-image" src="/static/school.png"></image>
  13. <view class="uni-product-title">{{product.name}}</view>
  14. </view>
  15. <view class="uni-product-price">
  16. <view class="uni-product-content">
  17. <view class="uni-product-content-line">
  18. <view class="uni-product-content-items">
  19. <view class="uni-product-price-original">{{product.address}}</view>
  20. <view class="uni-product-price-favour">{{product.type}}</view>
  21. <view class="uni-product-tip">{{product.project}}</view>
  22. </view>
  23. <view class="uni-product-content-score">
  24. <text>平均分:{{product.maxSco}}</text>
  25. <text>最低分:{{product.minSco}}</text>
  26. </view>
  27. <view class=""><text>录取概率:</text></view>
  28. </view>
  29. <image src="/static/collect.png"></image>
  30. </view>
  31. <view class="uni-product-content-bottom">
  32. <text @tap="writeModal" :data-name="index">分数匹配专业</text>
  33. <image src="/static/arrow.png"></image>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <neil-modal :show="show" :title="modaltitle" :show-cancel="false" @close="changeshow">
  39. <view class="">
  40. <view class="table-head">
  41. <text>专业</text>
  42. <text>平均分</text>
  43. <text>最低分</text>
  44. <text>省控线</text>
  45. <text>录取人数</text>
  46. <text>录取批次</text>
  47. </view>
  48. <view class="table-body">
  49. <text>XXX</text>
  50. <text>{{modalscore}}</text>
  51. <text>{{modalmin}}</text>
  52. <text>XXX</text>
  53. <text>XXX</text>
  54. <text>{{modallevel}}</text>
  55. </view>
  56. </view>
  57. </neil-modal>
  58. </view>
  59. </template>
  60. <script>
  61. import ChooseLits from '../../components/choose-Cade/choose-Cade.vue';
  62. import neilModal from '@/components/neil-modal/neil-modal.vue';
  63. export default {
  64. data() {
  65. return {
  66. modaltitle: '',
  67. modalscore: '',
  68. modalmin: '',
  69. modallevel: '',
  70. show: false,
  71. // showdetail:false,
  72. list: ['录取概率', '所在地', '高校层次', '批次', '2017'],
  73. arr: [
  74. ['录取概率', '冲刺', '稳妥', '保底'],
  75. ['所在地', '北京', '湖北', '陕西', '四川'],
  76. ['高校层次', '985', '211'],
  77. ['批次', '本科一批', '本科二批'],
  78. ['2017', '2016', '2018']
  79. ],
  80. i2: [0, 0, 0, 0, 0],
  81. dataorigin: getApp().globalData.global_colle,
  82. data: getApp().globalData.global_colle,
  83. // flag: true,
  84. }
  85. },
  86. // onLoad() {
  87. // console.log("onLoad");
  88. // },
  89. onShow() {
  90. this.list = ['录取概率', '所在地', '高校层次', '批次', '2017']
  91. },
  92. onHide() {
  93. this.list = [];
  94. console.log("我走了");
  95. this.flag = false;
  96. },
  97. components: {
  98. ChooseLits,
  99. neilModal,
  100. },
  101. methods: {
  102. onTabItemTap() {
  103. this.i2 = [0, 0, 0, 0, 0]
  104. this.$forceUpdate();
  105. // this.arr = [['录取概率'], ['所在地'], ['高校层次'], ['批次'], ['2017']],
  106. this.data = this.dataorigin;
  107. this.i2.forEach(this.filterData)
  108. },
  109. writeModal(e) { //往模态框写内容
  110. var thistitle = this.data[e.currentTarget.dataset.name].name;
  111. this.modalscore = this.data[e.currentTarget.dataset.name].maxSco;
  112. this.modalmin = this.data[e.currentTarget.dataset.name].minSco;
  113. this.modallevel = this.data[e.currentTarget.dataset.name].level;
  114. this.show = true;
  115. this.modaltitle = thistitle + '-专业列表2017';
  116. },
  117. changeshow(data) {
  118. this.show = data;
  119. },
  120. filterData(item, index) { //当index不是0才能筛选
  121. if (item !== 0) {
  122. this.filteredData(this.arr[index][item]);
  123. }
  124. },
  125. filteredData(nowvalue) {
  126. var nowdata = [];
  127. for (var indiv in this.data) {
  128. if (this.data[indiv].address == nowvalue || this.data[indiv].type == nowvalue || this.data[indiv].project ==
  129. nowvalue) {
  130. nowdata.push(this.data[indiv]);
  131. }
  132. };
  133. this.data = nowdata;
  134. return nowdata;
  135. },
  136. chooseLike(i1) { //arr的index 触发filter
  137. if (this.i2[i1[0]] != i1[1]) {
  138. this.i2[i1[0]] = i1[1];
  139. this.data = this.dataorigin;
  140. this.i2.forEach(this.filterData);
  141. };
  142. },
  143. }
  144. }
  145. </script>
  146. <style>
  147. choose-lits {
  148. font-size: 27rpx;
  149. }
  150. .uni-product {
  151. background-color: white;
  152. }
  153. .search {
  154. display: flex;
  155. flex-direction: row;
  156. justify-content: space-between;
  157. /* height: 40rpx; */
  158. margin-top: 40rpx;
  159. /* line-height: 40rpx; */
  160. }
  161. .search input {
  162. width: 50%;
  163. height: 60rpx;
  164. border-radius: 30rpx;
  165. font-size: 30rpx;
  166. padding-left: 30rpx;
  167. margin-left: 5%;
  168. background-color: #F8F8F8;
  169. }
  170. .search button {
  171. /* line-height: 28px; */
  172. /* height: 28px; */
  173. height: 60rpx;
  174. line-height: 60rpx;
  175. border-radius: 28px;
  176. width: 25%;
  177. font-size: 30rpx;
  178. background-color: #EF3A3A;
  179. }
  180. text {
  181. color: #808080;
  182. }
  183. .table-head,
  184. .table-body {
  185. margin: auto;
  186. display: flex;
  187. justify-content: space-between;
  188. padding-left: 20rpx;
  189. padding-right: 20rpx;
  190. }
  191. .table-head text,
  192. .table-body text {
  193. width: 15%;
  194. }
  195. .uni-product-list {
  196. background-color: #F8F8F8;
  197. font-size: 35rpx;
  198. }
  199. .uni-product {
  200. padding-top: 20rpx;
  201. padding-bottom: 20rpx;
  202. margin-bottom: 20rpx;
  203. padding-left: 20rpx;
  204. padding-right: 20rpx;
  205. display: flex;
  206. flex-direction: row;
  207. justify-content: space-between;
  208. }
  209. .uni-product-price {
  210. font-size: 25rpx;
  211. width: 70%;
  212. }
  213. .uni-product-content {
  214. display: flex;
  215. flex-direction: row;
  216. justify-content: space-between;
  217. height: 150rpx;
  218. margin-bottom: 18rpx;
  219. }
  220. .uni-product-price-favour,
  221. .uni-product-price-original,
  222. .uni-product-tip {
  223. background-color: #F2F4F5;
  224. display: block;
  225. height: 30rpx;
  226. position: relative;
  227. display: flex;
  228. justify-content: center;
  229. }
  230. .uni-product-price-favour:before {
  231. content: '';
  232. display: block;
  233. position: relative;
  234. background-color: #F2F4F5;
  235. border-bottom: 15px solid #F2F4F5;
  236. border-left: 15px solid white;
  237. }
  238. .uni-product-price-favour:after {
  239. content: '';
  240. display: block;
  241. position: relative;
  242. background-color: #F2F4F5;
  243. border-left: 15px solid #F2F4F5;
  244. border-bottom: 15px solid white;
  245. }
  246. .uni-product-price-original:before {
  247. content: '';
  248. display: block;
  249. position: relative;
  250. background-color: #F2F4F5;
  251. border-bottom: 15px solid #F2F4F5;
  252. border-left: 15px solid white;
  253. }
  254. .uni-product-price-original:after {
  255. content: '';
  256. display: block;
  257. position: relative;
  258. background-color: #F2F4F5;
  259. border-left: 15px solid #F2F4F5;
  260. border-bottom: 15px solid white;
  261. }
  262. .uni-product-tip:before {
  263. content: '';
  264. display: block;
  265. position: relative;
  266. background-color: #F2F4F5;
  267. border-bottom: 15px solid #F2F4F5;
  268. border-left: 15px solid white;
  269. }
  270. .uni-product-tip:after {
  271. content: '';
  272. display: block;
  273. position: relative;
  274. background-color: #F2F4F5;
  275. border-left: 15px solid #F2F4F5;
  276. border-bottom: 15px solid white;
  277. }
  278. .uni-product-content-items,
  279. .uni-product-content-score {
  280. display: flex;
  281. flex-direction: row;
  282. justify-content: space-between;
  283. }
  284. .uni-product-content-bottom {
  285. float: right;
  286. }
  287. .uni-product-content-bottom image {
  288. width: 30rpx;
  289. height: 30rpx;
  290. vertical-align: middle;
  291. }
  292. .uni-product-content-line {
  293. display: flex;
  294. flex-direction: column;
  295. justify-content: space-between;
  296. width: 70%;
  297. }
  298. .uni-product-content image {
  299. width: 80rpx;
  300. height: 80rpx;
  301. }
  302. .uni-product-image {
  303. width: 150rpx;
  304. height: 150rpx;
  305. }
  306. </style>