predict.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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>分数匹配专业</text>
  33. <image src="/static/arrow.png"></image>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import ChooseLits from '../../components/choose-Cade/choose-Cade.vue';
  42. export default {
  43. data() {
  44. return {
  45. list: ['录取概率', '所在地', '高校层次', '批次', '2017'],
  46. arr: [
  47. ['录取概率', '冲刺', '稳妥', '保底'],
  48. ['所在地', '北京', '湖北', '陕西', '四川'],
  49. ['高校层次', '985', '211'],
  50. ['批次', '本科一批', '本科二批'],
  51. ['2017', '2016', '2018']
  52. ],
  53. i2: [0, 0, 0, 0, 0],
  54. dataorigin:getApp().globalData.global_colle,
  55. data: getApp().globalData.global_colle,
  56. }
  57. },
  58. components: {
  59. ChooseLits,
  60. },
  61. methods: {
  62. filterData(item, index) {
  63. if (item !== 0) {
  64. console.log(this.arr[index][item]);
  65. this.filteredData(this.arr[index][item]);
  66. }
  67. },
  68. filteredData(nowvalue) {
  69. var nowdata = [];
  70. for (var indiv in this.data) {
  71. console.log(this.data)
  72. if (this.data[indiv].address == nowvalue || this.data[indiv].type == nowvalue || this.data[indiv].project ==
  73. nowvalue) {
  74. nowdata.push(this.data[indiv]);
  75. }
  76. };
  77. this.data = nowdata;
  78. return nowdata;
  79. },
  80. chooseLike(i1) { //arr的index
  81. if (this.i2[i1[0]] != i1[1]) {
  82. this.i2[i1[0]] = i1[1];
  83. this.data = this.dataorigin;
  84. this.i2.forEach(this.filterData);
  85. };
  86. console.log(this.i2);
  87. // 我写的果然是垃圾
  88. // this.keys = this.arr.map((item)=>{return item=item[0]});
  89. // this.datakey = this.arr[i1[0]];//每列属性值
  90. // this.datakeyvalue = this.arr[i1[0]][i1[1]];
  91. // this.trueorfalse=this.keys.forEach((item)=>{return item==this.datakey});
  92. },
  93. }
  94. }
  95. </script>
  96. <style>
  97. choose-lits {
  98. font-size: 27rpx;
  99. }
  100. .uni-product {
  101. background-color: white;
  102. }
  103. .search {
  104. display: flex;
  105. flex-direction: row;
  106. justify-content: space-between;
  107. /* height: 40rpx; */
  108. margin-top: 40rpx;
  109. /* line-height: 40rpx; */
  110. }
  111. .search input {
  112. width: 50%;
  113. height: 60rpx;
  114. border-radius: 30rpx;
  115. font-size: 30rpx;
  116. padding-left: 30rpx;
  117. margin-left: 5%;
  118. background-color: #F8F8F8;
  119. }
  120. .search button {
  121. /* line-height: 28px; */
  122. /* height: 28px; */
  123. height: 60rpx;
  124. line-height: 60rpx;
  125. border-radius: 28px;
  126. width: 25%;
  127. font-size: 30rpx;
  128. background-color: #EF3A3A;
  129. }
  130. text {
  131. color: #808080;
  132. }
  133. .uni-product-list {
  134. background-color: #F8F8F8;
  135. font-size: 35rpx;
  136. }
  137. .uni-product {
  138. padding-top: 20rpx;
  139. padding-bottom: 20rpx;
  140. margin-bottom: 20rpx;
  141. padding-left: 20rpx;
  142. padding-right: 20rpx;
  143. display: flex;
  144. flex-direction: row;
  145. justify-content: space-between;
  146. }
  147. .uni-product-price {
  148. font-size: 25rpx;
  149. width: 70%;
  150. }
  151. .uni-product-content {
  152. display: flex;
  153. flex-direction: row;
  154. justify-content: space-between;
  155. height: 150rpx;
  156. margin-bottom: 18rpx;
  157. }
  158. .uni-product-price-favour,
  159. .uni-product-price-original,
  160. .uni-product-tip {
  161. background-color: #F2F4F5;
  162. display: block;
  163. height: 30rpx;
  164. position: relative;
  165. display: flex;
  166. justify-content: center;
  167. }
  168. .uni-product-price-favour:before {
  169. content: '';
  170. display: block;
  171. position: relative;
  172. background-color: #F2F4F5;
  173. border-bottom: 15px solid #F2F4F5;
  174. border-left: 15px solid white;
  175. }
  176. .uni-product-price-favour:after {
  177. content: '';
  178. display: block;
  179. position: relative;
  180. background-color: #F2F4F5;
  181. border-left: 15px solid #F2F4F5;
  182. border-bottom: 15px solid white;
  183. }
  184. .uni-product-price-original:before {
  185. content: '';
  186. display: block;
  187. position: relative;
  188. background-color: #F2F4F5;
  189. border-bottom: 15px solid #F2F4F5;
  190. border-left: 15px solid white;
  191. }
  192. .uni-product-price-original:after {
  193. content: '';
  194. display: block;
  195. position: relative;
  196. background-color: #F2F4F5;
  197. border-left: 15px solid #F2F4F5;
  198. border-bottom: 15px solid white;
  199. }
  200. .uni-product-tip:before {
  201. content: '';
  202. display: block;
  203. position: relative;
  204. background-color: #F2F4F5;
  205. border-bottom: 15px solid #F2F4F5;
  206. border-left: 15px solid white;
  207. }
  208. .uni-product-tip:after {
  209. content: '';
  210. display: block;
  211. position: relative;
  212. background-color: #F2F4F5;
  213. border-left: 15px solid #F2F4F5;
  214. border-bottom: 15px solid white;
  215. }
  216. .uni-product-content-items,
  217. .uni-product-content-score {
  218. display: flex;
  219. flex-direction: row;
  220. justify-content: space-between;
  221. }
  222. .uni-product-content-bottom {
  223. float: right;
  224. }
  225. .uni-product-content-bottom image {
  226. width: 30rpx;
  227. height: 30rpx;
  228. vertical-align: middle;
  229. }
  230. .uni-product-content-line {
  231. display: flex;
  232. flex-direction: column;
  233. justify-content: space-between;
  234. width: 70%;
  235. }
  236. .uni-product-content image {
  237. width: 80rpx;
  238. height: 80rpx;
  239. }
  240. .uni-product-image {
  241. width: 150rpx;
  242. height: 150rpx;
  243. }
  244. </style>