index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view>
  3. <view class="header">
  4. <view class="rect">
  5. <van-search
  6. :value="value"
  7. shape="round"
  8. background=""
  9. placeholder="输入系列课标题"
  10. />
  11. <view
  12. style="display: flex; padding: 30rpx; justify-content: space-between"
  13. >
  14. <input
  15. readonly
  16. v-model="provice.province"
  17. @click="
  18. () => {
  19. proviceShow = true;
  20. }
  21. "
  22. placeholder="省份"
  23. class="header-provice"
  24. type="text"
  25. />
  26. <input
  27. readonly
  28. @click="
  29. () => {
  30. cityShow = true;
  31. }
  32. "
  33. v-model="city.city"
  34. placeholder="地市"
  35. class="header-city"
  36. type="text"
  37. />
  38. </view>
  39. </view>
  40. <van-popup round position="bottom" :show="proviceShow">
  41. <van-picker
  42. show-toolbar
  43. title="考场省份"
  44. :columns="examProviceList"
  45. value-key="province"
  46. @confirm="getExamCityAndProviceName"
  47. @cancel="
  48. () => {
  49. proviceShow = false;
  50. }
  51. "
  52. />
  53. </van-popup>
  54. <van-popup round position="bottom" :show="cityShow">
  55. <van-picker
  56. show-toolbar
  57. title="考场地市"
  58. :columns="examCityList"
  59. value-key="city"
  60. @confirm="getCityName"
  61. @cancel="
  62. () => {
  63. cityShow = false;
  64. }
  65. "
  66. />
  67. </van-popup>
  68. </view>
  69. <view class="content">
  70. <view class="list">
  71. <view
  72. class="list-item"
  73. v-for="(item, index) in examRoomList"
  74. @click="goCourseCatalog(item)"
  75. :key="index"
  76. >
  77. <image mode="widthFx" :src="item.image" class="list-item-image">
  78. </image>
  79. <view
  80. style="
  81. display: flex;
  82. align-items: space-between;
  83. flex-wrap: wrap;
  84. width: 355rpx;
  85. "
  86. >
  87. <view class="list-item-text1">{{ item.name }}</view>
  88. <view class="list-item-text2">共3节</view>
  89. </view>
  90. <view class="list-item-border"></view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <script>
  97. import api from "@/api";
  98. export default {
  99. data() {
  100. return {
  101. query: {},
  102. cityShow: false,
  103. proviceShow: false,
  104. examProviceList: [],
  105. examCityList: [],
  106. examRoomList: [],
  107. provice: { provinceId: "", province: "" },
  108. city: { cityId: "", city: "" },
  109. };
  110. },
  111. methods: {
  112. goCourseCatalog(item) {
  113. uni.navigateTo({
  114. url: "/otherPages/courseCatalog/index?examId=" + item.id+'&price='+item.price,
  115. });
  116. },
  117. getCityName(e) {
  118. this.city = e.detail.value;
  119. this.cityShow = false;
  120. api.exam
  121. .studentExamInfoList({
  122. ...this.city,
  123. })
  124. .then((res) => {
  125. this.examRoomList = res.rows;
  126. });
  127. },
  128. getExamCityAndProviceName(e) {
  129. this.proviceShow = false;
  130. this.provice = e.detail.value;
  131. api.exam
  132. .studentExamInfoCityProviceId(e.detail.value.provinceId)
  133. .then((res) => {
  134. this.examCityList = res.data;
  135. });
  136. console.log(e);
  137. },
  138. },
  139. onLoad(query) {
  140. this.query = query;
  141. api.exam.studentExamInfoIp()
  142. api.exam.studentExamInfoGetProvice().then((res) => {
  143. this.examProviceList = res.data;
  144. });
  145. api.exam
  146. .studentExamInfoList({
  147. ...this.city,
  148. })
  149. .then((res) => {
  150. this.examRoomList = res.rows;
  151. });
  152. },
  153. };
  154. </script>
  155. <style lang="scss" scoped>
  156. .header {
  157. width: 100%;
  158. height: auto;
  159. border-radius: 0px 0px 45px 45px;
  160. .rect {
  161. width: 100%;
  162. height: 406rpx;
  163. background-image: url("https://ct.zzxcx.net/ctjk/mp-wx/buyVideo/headerBg.png");
  164. background-size: 100%;
  165. }
  166. .arc {
  167. width: 100%;
  168. height: 100rpx;
  169. }
  170. .header-provice {
  171. width: 336rpx;
  172. height: 60rpx;
  173. background: #fff;
  174. border-radius: 40rpx;
  175. font-size: 26rpx;
  176. padding-left: 30rpx;
  177. box-sizing: border-box;
  178. }
  179. .header-city {
  180. width: 336rpx;
  181. height: 60rpx;
  182. background: #fff;
  183. border-radius: 40rpx;
  184. font-size: 26rpx;
  185. padding-left: 30rpx;
  186. box-sizing: border-box;
  187. }
  188. }
  189. .content {
  190. width: 100%;
  191. padding: 0rpx 30rpx;
  192. transform: translateY(-80px);
  193. .list {
  194. width: 100%;
  195. background: #edf4ff;
  196. height: 1200rpx;
  197. box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.1);
  198. border-radius: 20rpx 20rpx 20rpx 20rpx;
  199. .list-item {
  200. width: 100%;
  201. padding: 30rpx;
  202. padding-top: 30rpx;
  203. padding-bottom: 0rpx;
  204. display: flex;
  205. height: 220rpx;
  206. flex-wrap: wrap;
  207. }
  208. .list-item-image {
  209. width: 248rpx;
  210. height: 138rpx;
  211. margin-right: 24rpx;
  212. }
  213. .list-item-border {
  214. width: 100%;
  215. background: #e0e0e0;
  216. height: 2rpx;
  217. }
  218. .list-item-text1 {
  219. width: 305rpx;
  220. color: #0a1a33;
  221. font-size: 30rpx;
  222. padding-top: 10rpx;
  223. }
  224. .list-item-text2 {
  225. width: 305rpx;
  226. color: #8a9099;
  227. font-size: 26rpx;
  228. }
  229. }
  230. }
  231. </style>