shuangchuang.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <view class="shuangchaung">
  3. <u-sticky>
  4. <view class="search">
  5. <view class="u-demo-block__content">
  6. <view class="u-page__tag-item">
  7. <u-search placeholder="请输入项目标题" v-model="searchValue" @search="searchActive()"
  8. @clear="clearActive()" :show-action="false" shape='square'>
  9. </u-search>
  10. </view>
  11. </view>
  12. <view class="search-button" @click="searchActive()">搜索</view>
  13. </view>
  14. </u-sticky>
  15. <view class="item_wrap">
  16. <view class="empty" v-if="list.length==0">
  17. <view class="enptyStatus">
  18. <image src="../../static/empty.png" mode=""></image>
  19. <view class="words">
  20. 暂无内容
  21. </view>
  22. </view>
  23. </view>
  24. <view class="item" v-for="(item,index) in list" :key="index">
  25. <!-- <view class="tag_wrap">
  26. <text v-if="item.check_status==1" class="success">审核成功</text>
  27. <text v-if="item.check_status==2" class="wrang">审核失败</text>
  28. <text v-if="item.check_status==0" class="wait">待审核</text>
  29. </view> -->
  30. <view class="left">
  31. <view class="center">
  32. <view class="title">
  33. {{item.title}}
  34. </view>
  35. <view class="name">
  36. <text>导师:{{item.truename}}</text>
  37. <text v-if="item.check_status==1" class="success">审核成功</text>
  38. <text v-if="item.check_status==2" class="wrang">审核失败</text>
  39. <text v-if="item.check_status==0" class="wait">待审核</text>
  40. <!-- <text v-if="getStart(item.apply_start_time) <= getNow() && getNow() <= getEnd(item.apply_end_time)" class="tag">进行中</text>
  41. <text v-if="getNow() > getEnd(item.apply_end_time)" class="tag over">已结束</text>
  42. <text v-if="getStart(item.apply_start_time) > getNow()" class="tag wait">未开始</text> -->
  43. </view>
  44. </view>
  45. </view>
  46. <view class="right">
  47. <text class="nums">{{item.sign_up_count}}/{{item.student_nums}}</text>
  48. <view class="detail" @click="to_detail(item.id)">
  49. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. list: [],
  61. page: 1,
  62. last: false,
  63. searchValue: '', //搜索
  64. }
  65. },
  66. onShow() {
  67. this.page = 1
  68. this.list = []
  69. this.last = false
  70. this.getList()
  71. },
  72. async onLoad() {
  73. // this.getList()
  74. },
  75. onReachBottom() {
  76. if (!this.last) {
  77. this.page++
  78. }
  79. console.log(this.page, 'oooooooooooooooooo')
  80. this.getList()
  81. },
  82. methods: {
  83. //点击搜索
  84. searchActive() {
  85. this.list = []
  86. this.page = 1
  87. this.last = false
  88. console.log(this.searchValue, '用户点击了搜索')
  89. this.getList()
  90. },
  91. //清空搜索框
  92. clearActive() {
  93. this.list = []
  94. this.page = 1
  95. this.last = false
  96. this.getList()
  97. console.log(this.searchValue, '用户点击了搜索---')
  98. },
  99. // //截取时间
  100. // getTime(time) {
  101. // if (!time) return '--'
  102. // else return time.split(' ')[0]
  103. // },
  104. // getTime1(time) {
  105. // let name = ''
  106. // for (let key in time) {
  107. // if (key == 'active_time')
  108. // name = time.active_time.slice(0,16)
  109. // }
  110. // return name ? name : '--'
  111. // },
  112. getList() {
  113. this.$u.get('/innovation', {
  114. title: this.searchValue,
  115. page: this.page,
  116. per_page: 15
  117. }).then(res => {
  118. console.log(res, 'ppp')
  119. let data = res.data.list
  120. console.log(res, 'course1')
  121. if (this.page > 1 && data.length == 0) {
  122. uni.showToast({
  123. title: '暂无更多',
  124. icon: 'none'
  125. })
  126. this.last = true
  127. } else {
  128. this.list = this.list.concat(data)
  129. }
  130. })
  131. },
  132. //获取开始时间
  133. getStart(time) {
  134. // let time = this.detail.apply_start_time
  135. // console.log(time,'tome')
  136. return new Date(time).getTime()
  137. },
  138. //获取结束时间
  139. getEnd(time) {
  140. // let time = this.detail.apply_end_time
  141. return new Date(time).getTime()
  142. },
  143. //获取当前时间
  144. getNow() {
  145. return Date.now()
  146. },
  147. to_detail(id) {
  148. console.log('详情')
  149. uni.navigateTo({
  150. url: './shuangchuang_detail?id=' + id
  151. })
  152. },
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. page {
  158. position: relative;
  159. background-color: #F7F7F7;
  160. }
  161. .shuangchaung {
  162. .enptyStatus{
  163. display: flex;
  164. justify-content: center;
  165. align-items: center;
  166. flex-direction: column;
  167. padding: 30px 10px;
  168. image{
  169. width: 120px;
  170. height: 150px;
  171. margin-top: 100px;
  172. }
  173. .words{
  174. color: #ffae21;
  175. font-size: 18px;
  176. padding-top: 18px;
  177. }
  178. }
  179. .search {
  180. background-color: #FFFFFF;
  181. padding: 8px 15px;
  182. // margin-top: 6px;
  183. display: flex;
  184. justify-items: center;
  185. justify-content: center;
  186. align-items: center;
  187. .search-button {
  188. padding: 0 10px;
  189. color: #138E57;
  190. font-size: 15px;
  191. text-align: center;
  192. }
  193. .u-demo-block__content {
  194. flex: 1;
  195. }
  196. ::v-deep {
  197. .u-action {
  198. color: #138E57 !important;
  199. }
  200. }
  201. }
  202. .item_wrap {
  203. padding: 15px;
  204. .item {
  205. background-color: #fff;
  206. opacity: 1;
  207. border-radius: 4px;
  208. padding: 16px 15px;
  209. position: relative;
  210. display: flex;
  211. align-items: center;
  212. justify-content: space-between;
  213. margin-bottom: 10px;
  214. overflow: hidden;
  215. // .tag_wrap {
  216. // position: absolute;
  217. // top: 0;
  218. // // left: 0;
  219. // right: 0;
  220. // .success {
  221. // display: inline-block;
  222. // color: #67C23A;
  223. // background-color:rgba($color: #67C23A, $alpha: 0.2) ;
  224. // padding: 2px 5px;
  225. // font-size: 12px;
  226. // // border-bottom-right-radius: 6px;
  227. // border-bottom-left-radius: 6px;
  228. // }
  229. // .wrang {
  230. // display: inline-block;
  231. // color:#F56C6C;
  232. // background-color:rgba($color:#F56C6C, $alpha: 0.2) ;
  233. // padding: 2px 5px;
  234. // font-size: 12px;
  235. // // border-bottom-right-radius: 6px;
  236. // border-bottom-left-radius: 6px;
  237. // }
  238. // .wait {
  239. // display: inline-block;
  240. // color: #E6A23C;
  241. // background-color:rgba($color: #E6A23C, $alpha: 0.2) ;
  242. // padding: 2px 5px;
  243. // font-size: 12px;
  244. // // border-bottom-right-radius: 6px;
  245. // border-bottom-left-radius: 6px;
  246. // }
  247. // }
  248. .right {
  249. width: 30%;
  250. flex-shrink: 0;
  251. border-left: 1px solid #eee;
  252. text-align: center;
  253. // padding-right: 15px;
  254. display: flex;
  255. align-items: center;
  256. justify-content: space-between;
  257. text {
  258. display: block;
  259. font-size: 12px;
  260. color: #999;
  261. }
  262. .nums {
  263. display: inline-block;
  264. width: 70%;
  265. text-align: center;
  266. font-size: 20px;
  267. color: #3B7653;
  268. padding-left: 5px;
  269. }
  270. .detail {
  271. display: flex;
  272. align-items: center;
  273. justify-content: center;
  274. flex-shrink: 0;
  275. width: 25px;
  276. height: 25px;
  277. text-align: center;
  278. border-radius: 50%;
  279. border: 1px solid #eee;
  280. color: #999;
  281. font-size: 16px;
  282. }
  283. }
  284. .left {
  285. width: 70%;
  286. flex-shrink: 0;
  287. .center {
  288. flex-shrink: 0;
  289. .title {
  290. font-size: 16px;
  291. color: #333;
  292. overflow: hidden;
  293. text-overflow: ellipsis;
  294. white-space: nowrap;
  295. }
  296. .name {
  297. margin-top: 5px;
  298. font-size: 14px;
  299. color: #666;
  300. overflow: hidden;
  301. text-overflow: ellipsis;
  302. white-space: nowrap;
  303. display: flex;
  304. align-items: center;
  305. justify-content: space-between;
  306. text{
  307. flex-shrink: 0;
  308. overflow: hidden;
  309. text-overflow: ellipsis;
  310. white-space: nowrap;
  311. &:first-child{
  312. width: calc(100% - 75px);
  313. }
  314. }
  315. .success {
  316. display: inline-block;
  317. color: #67C23A;
  318. background-color:rgba($color: #67C23A, $alpha: 0.2) ;
  319. padding: 2px 5px;
  320. font-size: 12px;
  321. // border-bottom-right-radius: 6px;
  322. // border-bottom-left-radius: 6px;
  323. border-radius: 3px;
  324. margin-right: 15px;
  325. }
  326. .wrang {
  327. display: inline-block;
  328. color:#F56C6C;
  329. background-color:rgba($color:#F56C6C, $alpha: 0.2) ;
  330. padding: 2px 5px;
  331. font-size: 12px;
  332. // border-bottom-right-radius: 6px;
  333. // border-bottom-left-radius: 6px;
  334. border-radius: 3px;
  335. margin-right: 15px;
  336. }
  337. .wait {
  338. display: inline-block;
  339. color: #E6A23C;
  340. background-color:rgba($color: #E6A23C, $alpha: 0.2) ;
  341. padding: 2px 5px;
  342. font-size: 12px;
  343. // border-bottom-right-radius: 6px;
  344. // border-bottom-left-radius: 6px;
  345. border-radius: 3px;
  346. margin-right: 15px;
  347. }
  348. // .tag{
  349. // margin-right: 15px;
  350. // padding: 2px 5px;
  351. // background-color: rgba($color: #67C23A, $alpha: 0.2);
  352. // color: #67C23A;
  353. // border-radius: 3px;
  354. // font-size: 12px;
  355. // }
  356. // .over{
  357. // background-color: rgba($color: #F56C6C, $alpha: 0.2);
  358. // color: #F56C6C;
  359. // }
  360. // .wait{
  361. // background-color: rgba($color: #909399, $alpha: 0.2);
  362. // color: #909399;
  363. // }
  364. }
  365. }
  366. }
  367. }
  368. }
  369. }
  370. </style>