predict.vue 9.2 KB

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