bidding.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <u-navbar title="招标" @leftClick="leftClick" bgColor="rgba(0,0,0,0)" :placeholder="true" :autoBack="true">
  5. </u-navbar>
  6. <view class="search">
  7. <u-input v-model="serach_value" type="text" :border="true" placeholder="热搜关键词" shape="circle"
  8. prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" @confirm="search">
  9. <template slot="suffix">
  10. <view @click="search">搜索</view>
  11. </template>
  12. </u-input>
  13. </view>
  14. </view>
  15. <view class="box">
  16. <view class="hflex acenter jbetween">
  17. <view class="hflex acenter jbetween tabs">
  18. <block v-for="(item,index) in tabs" :key="index">
  19. <view class="tabs_item hflex acenter" @click="changeTab(item.index)" :class="tab_active == item.index ? 'tab_active' : ''">
  20. {{item.name}}
  21. <block v-if="index != 0">
  22. <u-icon name="arrow-down-fill" color="#666666" size="6" v-if="tab_active != item.index"></u-icon>
  23. <u-icon name="arrow-up-fill" color="#506DFF" size="6" v-if="tab_active == item.index"></u-icon>
  24. </block>
  25. </view>
  26. </block>
  27. </view>
  28. <view class="hflex acenter " @click="screen">
  29. <view class="tabs_item" :class="screen_show? 'tab_active' : ''">筛选</view>
  30. <image src="https://ship.shipcc.cn/common/screen.png" class="screen_icon" v-show="!screen_show"></image>
  31. <image src="https://ship.shipcc.cn/common/screen_active.png" class="screen_icon" v-show="screen_show"></image>
  32. </view>
  33. </view>
  34. <view class="drop" v-show="screen_show">
  35. <view class="drop_bg">
  36. <view class="drop_list">
  37. <view class="hflex acenter jbetween">
  38. <view class="drop_title">披露方式</view>
  39. <view class="hflex acenter" @click="expend('mode')">
  40. <view class="drop_right">{{mode?'':'展开'}}</view>
  41. <u-icon name="arrow-down-fill" color="#666666" size="6" v-if="!mode"></u-icon>
  42. <u-icon name="arrow-up-fill" color="#666666" size="6" v-else></u-icon>
  43. </view>
  44. </view>
  45. <view class="hflex acenter fwrap" :class="mode?'':'hide'">
  46. <block v-for="(item,index) in modeList" :key="index">
  47. <view class="drop_item" :class="mode_active == index?'drop_active':''" @click="selectMode(index)">{{item.name}}</view>
  48. </block>
  49. </view>
  50. </view>
  51. <view class="drop_list">
  52. <view class="hflex acenter jbetween">
  53. <view class="drop_title">转让底价</view>
  54. <view class="hflex acenter" @click="expend('price')">
  55. <view class="drop_right">{{price?'':'展开'}}</view>
  56. <u-icon name="arrow-down-fill" color="#666666" size="6" v-if="!price"></u-icon>
  57. <u-icon name="arrow-up-fill" color="#666666" size="6" v-else></u-icon>
  58. </view>
  59. </view>
  60. <view class="hflex acenter fwrap" :class="price?'':'hide'">
  61. <block v-for="(item,index) in priceList" :key="index">
  62. <view class="drop_item" :class="price_active == index?'drop_active':''" @click="selectPrice(index)">{{item.name}}</view>
  63. </block>
  64. </view>
  65. </view>
  66. <view class="drop_list">
  67. <view class="hflex acenter jbetween">
  68. <view class="drop_title">交易类型</view>
  69. <view class="hflex acenter" @click="expend('type')">
  70. <view class="drop_right">{{type?'':'展开'}}</view>
  71. <u-icon name="arrow-down-fill" color="#666666" size="6" v-if="!type"></u-icon>
  72. <u-icon name="arrow-up-fill" color="#666666" size="6" v-else></u-icon>
  73. </view>
  74. </view>
  75. <view class="hflex acenter fwrap" :class="type?'':'hide'">
  76. <block v-for="(item,index) in typeList" :key="index">
  77. <view class="drop_item" :class="type_active == index?'drop_active':''" @click="selectType(index)">{{item.name}}</view>
  78. </block>
  79. </view>
  80. </view>
  81. <view class="drop_list">
  82. <view class="hflex acenter jbetween">
  83. <view class="drop_title">所在地区</view>
  84. <view class="hflex acenter" @click="expend('region')">
  85. <view class="drop_right">{{region?'':'展开'}}</view>
  86. <u-icon name="arrow-down-fill" color="#666666" size="6" v-if="!region"></u-icon>
  87. <u-icon name="arrow-up-fill" color="#666666" size="6" v-else></u-icon>
  88. </view>
  89. </view>
  90. <scroll-view scroll-y="true" class="hflex acenter fwrap" style="height: 300rpx;" v-if="region">
  91. <view class="hflex acenter fwrap" :class="region?'':'hide'">
  92. <block v-for="(item,index) in regionList" :key="index">
  93. <view class="drop_item" :class="region_active == index?'drop_active':''" @click="selectRegion(index)">{{item.title}}</view>
  94. </block>
  95. </view>
  96. </scroll-view>
  97. <view class="hflex acenter fwrap" :class="region?'':'hide'" v-else>
  98. <block v-for="(item,index) in regionList" :key="index">
  99. <view class="drop_item" :class="region_active == index?'drop_active':''" @click="selectRegion(index)">{{item.title}}</view>
  100. </block>
  101. </view>
  102. </view>
  103. <view class="drop_list">
  104. <view class="hflex acenter jbetween">
  105. <view class="drop_title">披露截止时间</view>
  106. <view class="hflex acenter" @click="expend('time')">
  107. <view class="drop_right">{{time?'':'展开'}}</view>
  108. <u-icon name="arrow-down-fill" color="#666666" size="6" v-if="!time"></u-icon>
  109. <u-icon name="arrow-up-fill" color="#666666" size="6" v-else></u-icon>
  110. </view>
  111. </view>
  112. <view class="hflex acenter fwrap" :class="time?'':'hide'">
  113. <block v-for="(item,index) in timeList" :key="index">
  114. <view class="drop_item" :class="time_active == index?'drop_active':''" @click="selectTime(index)">{{item.name}}</view>
  115. </block>
  116. </view>
  117. </view>
  118. <view class="drop_bottom hflex acenter jbetween">
  119. <view class="left" @click="reset">清空</view>
  120. <view class="right" @click="confirm">确定</view>
  121. </view>
  122. </view>
  123. </view>
  124. <scroll-view class="list" :scroll-y="true" v-if="pageList.length>0" @scrolltolower="scrolltolower">
  125. <block v-for="(item,index) in pageList" :key="index">
  126. <view class="list_item" @click="toDetail(item.id)">
  127. <view class="top">
  128. <view v-if="item.status == 1" class="top_icon">已中标</view>
  129. <view v-if="item.status == 0" class="top_icon1">招标中</view>
  130. <view class="item_name">{{item.title}}</view>
  131. </view>
  132. <view class="hflex acenter cell">
  133. <image src="https://ship.shipcc.cn/common/company.png" class="item_icon"></image>
  134. <view class="text_style1">招标单位</view>
  135. <view class="text_style1">{{item.com_name}}</view>
  136. </view>
  137. <view class="hflex acenter cell">
  138. <u-icon name="clock-fill" color="#888888" size="14"></u-icon>
  139. <view class="text_style1">发布时间</view>
  140. <view class="text_style1">{{item.create_time}}</view>
  141. </view>
  142. </view>
  143. </block>
  144. </scroll-view>
  145. </view>
  146. <view class="" style="height: 100rpx"></view>
  147. </view>
  148. </template>
  149. <script>
  150. import $api from '@/static/js/api.js'
  151. var that = ''
  152. export default {
  153. data() {
  154. return {
  155. serach_value: '',
  156. tabs: [
  157. {
  158. index: 0,
  159. name: '默认',
  160. },
  161. {
  162. index: 1,
  163. name: '披露起始时间',
  164. },
  165. {
  166. index: 2,
  167. name: '披露截止时间',
  168. }
  169. ],
  170. tab_active: 0,
  171. screen_show: false,
  172. pageList: [
  173. ],
  174. type: false,
  175. type_active: -1,
  176. typeList: [
  177. ],
  178. mode: false,
  179. mode_active: -1,
  180. modeList: [
  181. {
  182. id: '',
  183. name: '全部',
  184. },
  185. {
  186. id: 0,
  187. name: '预披露',
  188. },
  189. {
  190. id: 1,
  191. name: '正式披露',
  192. }
  193. ],
  194. price: false,
  195. price_active: -1,
  196. priceList: [
  197. {
  198. amount_min: '',
  199. amount_max: '',
  200. name: '全部',
  201. },
  202. {
  203. amount_min: 0,
  204. amount_max: '100万',
  205. name: '100万以下',
  206. },
  207. {
  208. amount_min: '100万',
  209. amount_max: '500万',
  210. name: '100万-500万',
  211. }
  212. ],
  213. region: false,
  214. region_active: -1,
  215. regionList: [
  216. ],
  217. time: false,
  218. time_active: -1,
  219. timeList: [
  220. {
  221. day: '',
  222. name: '全部',
  223. },
  224. {
  225. day: 3,
  226. name: '三天内',
  227. },
  228. {
  229. day: 10,
  230. name: '十天内',
  231. }
  232. ],
  233. page: 1,
  234. limit: 15,
  235. total: 15,
  236. }
  237. },
  238. onLoad() {
  239. that = this
  240. that.getType()
  241. that.getCity()
  242. },
  243. onShow() {
  244. },
  245. methods: {
  246. // 返回
  247. leftClick() {
  248. $api.jump(-1)
  249. },
  250. search() {
  251. that.page = 1
  252. that.pageList = []
  253. that.getList()
  254. },
  255. getList() {
  256. $api.req({
  257. url: '/data/api.Bidding/index',
  258. data: {
  259. limit: that.limit,
  260. page: that.page,
  261. b_type: that.mode_active == -1?'':that.modeList[that.mode_active].id,
  262. amount_min: that.price_active == -1?'':that.priceList[that.price_active].amount_min,
  263. amount_max: that.price_active == -1?'':that.priceList[that.price_active].amount_max,
  264. type_id: that.type_active == -1?'':that.typeList[that.type_active].id,
  265. city: that.type_active == -1?'':that.regionList[that.region_active].id,
  266. day_type: 'day',
  267. day: that.time_active == -1? '' : that.timeList[that.time_active].day,
  268. o_f: that.tabs[that.tab_active].index,
  269. o_b: 'desc',
  270. keyword: that.serach_value
  271. }
  272. }, function(res) {
  273. if(res.code == 1) {
  274. if(that.page == 1) {
  275. that.pageList = res.data.data
  276. that.total = res.data.total
  277. } else {
  278. that.pageList = that.pageList.concat(res.data.data)
  279. }
  280. }
  281. })
  282. },
  283. getType() {
  284. $api.req({
  285. url: '/data/api.Bidding/types',
  286. }, function(res) {
  287. if(res.code == 1) {
  288. that.typeList = res.data
  289. that.getList()
  290. }
  291. })
  292. },
  293. getCity() {
  294. $api.req({
  295. url: '/data/api.Area/sort',
  296. data: {
  297. level: 2,
  298. hot: 1
  299. }
  300. }, function(res) {
  301. if(res.code == 1) {
  302. var list = res.data.areas
  303. for(var i=0;i<list.length;i++) {
  304. for(var j=0;j<list[i].child.length;j++) {
  305. that.regionList.push(list[i].child[j])
  306. }
  307. }
  308. var data ={
  309. id: 0,
  310. title: '全国'
  311. }
  312. that.regionList.unshift(data)
  313. // console.log(that.regionList);
  314. // that.regionList = res.data.areas
  315. // that.itemArr = res.data.areas
  316. }
  317. })
  318. },
  319. // 切换tabs
  320. changeTab(index) {
  321. that.tab_active = index
  322. that.page = 1
  323. that.pageList = []
  324. that.getList()
  325. },
  326. // 筛选
  327. screen() {
  328. that.screen_show = !that.screen_show
  329. },
  330. // 查看详情
  331. toDetail(id) {
  332. $api.jump('/page_index/pages/bidding/bidDetail?id=' + id)
  333. },
  334. expend(e) {
  335. if(e == 'type') {
  336. that.type = !that.type
  337. }
  338. if(e == 'mode') {
  339. that.mode = !that.mode
  340. }
  341. if(e == 'price') {
  342. that.price = !that.price
  343. }
  344. if(e == 'region') {
  345. that.region = !that.region
  346. }
  347. if(e == 'time') {
  348. that.time = !that.time
  349. }
  350. },
  351. selectMode(index) {
  352. that.mode_active = index
  353. },
  354. selectPrice(index) {
  355. that.price_active = index
  356. },
  357. selectType(index) {
  358. that.type_active = index
  359. /* if(that.type_active.length == 0) {
  360. that.type_active.push(index)
  361. } else {
  362. for(var i=0;i<that.type_active.length;i++) {
  363. if(that.type_active[i] == index) {
  364. that.type_active.splice(i,1)
  365. return
  366. }
  367. }
  368. that.type_active.push(index)
  369. } */
  370. },
  371. selectRegion(index) {
  372. that.region_active = index
  373. },
  374. selectTime(index) {
  375. that.time_active = index
  376. },
  377. reset() {
  378. that.mode_active = -1
  379. that.price_active = -1
  380. that.type_active = []
  381. that.region_active = -1
  382. that.time_active = -1
  383. },
  384. confirm() {
  385. that.page = 1,
  386. that.pageList = []
  387. that.screen_show = false
  388. that.getList()
  389. },
  390. scrolltolower() {
  391. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  392. $api.info("没有更多了")
  393. } else {
  394. that.page++
  395. that.getList()
  396. }
  397. },
  398. },
  399. onReachBottom() {
  400. }
  401. }
  402. </script>
  403. <style lang="scss" scoped>
  404. .content::v-deep {
  405. max-height: 100vh;
  406. overflow: hidden;
  407. background-color: #e8eff5;
  408. .navbar {
  409. .search {
  410. // background: #fff;
  411. width: 100%;
  412. height: 88rpx;
  413. box-sizing: border-box;
  414. padding: 12rpx 30rpx;
  415. .u-input {
  416. background-color: #fff;
  417. height: 64rpx;
  418. padding: 0 0 0 18rpx !important;
  419. border: 1rpx solid #506Dff;
  420. margin-bottom: 12rpx;
  421. }
  422. .u-input__content__subfix-icon {
  423. width: 128rpx;
  424. height: 64rpx;
  425. background-color: #506Dff;
  426. border-radius: 32rpx;
  427. color: #fff;
  428. font-size: 28rpx;
  429. text-align: center;
  430. line-height: 64rpx;
  431. }
  432. }
  433. }
  434. .box {
  435. margin-top: 24rpx;
  436. width: 100%;
  437. min-height: calc(100vh - 216rpx);
  438. background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
  439. border-radius: 40rpx 40rpx 0px 0px;
  440. box-sizing: border-box;
  441. padding: 30rpx;
  442. .tabs {
  443. width: 526rpx;
  444. }
  445. .tabs_item {
  446. font-size: 26rpx;
  447. font-weight: 400;
  448. color: #666666;
  449. line-height: 36rpx;
  450. padding-right: 8rpx;
  451. .u-icon{
  452. padding-left: 8rpx;
  453. }
  454. }
  455. .tab_active {
  456. color: #506DFF;
  457. }
  458. .screen_icon {
  459. width: 24rpx;
  460. height: 24rpx;
  461. }
  462. .drop {
  463. position: absolute;
  464. left: 0;
  465. top: 345rpx;
  466. width: 750rpx;
  467. z-index: 9;
  468. min-height: calc(100vh - 345rpx);
  469. background: rgba(0,0,0,0.5);
  470. backdrop-filter: blur(5px);
  471. .drop_bg {
  472. width: 100%;
  473. background-color: #fff;
  474. .drop_list {
  475. box-sizing: border-box;
  476. padding: 0 30rpx;
  477. .drop_title {
  478. margin: 24rpx 0 20rpx;
  479. font-size: 28rpx;
  480. font-weight: 400;
  481. color: #3D4249;
  482. line-height: 40rpx;
  483. }
  484. .drop_right {
  485. font-size: 20rpx;
  486. font-weight: 400;
  487. color: #555555;
  488. line-height: 28rpx;
  489. padding-right: 8rpx;
  490. }
  491. .hide {
  492. width: 100%;
  493. height: 80rpx;
  494. overflow: hidden;
  495. }
  496. .drop_item {
  497. width: 208rpx;
  498. height: 76rpx;
  499. background: #F4F8FB;
  500. border-radius: 4rpx;
  501. font-size: 28rpx;
  502. text-align: center;
  503. font-weight: 400;
  504. color: #555555;
  505. line-height: 76rpx;
  506. margin: 0 24rpx 20rpx 0;
  507. }
  508. .drop_item:nth-child(3n+3) {
  509. margin: 0 0 20rpx;
  510. }
  511. .drop_active {
  512. background: #E8F2FF;
  513. font-weight: 500;
  514. color: #506DFF;
  515. }
  516. }
  517. .drop_bottom {
  518. margin-top: 32rpx;
  519. width: 100%;
  520. height: 100rpx;
  521. background: #FFFFFF;
  522. box-shadow: 0px -1px 2px 0px rgba(0,0,0,0.05);
  523. .left {
  524. width: 50%;
  525. height: 100%;
  526. font-size: 36rpx;
  527. font-weight: 400;
  528. color: #BDBDBD;
  529. line-height: 100rpx;
  530. text-align: center;
  531. }
  532. .right {
  533. width: 50%;
  534. height: 100%;
  535. font-size: 36rpx;
  536. font-weight: 400;
  537. color: #FFFFFF;
  538. line-height: 100rpx;
  539. text-align: center;
  540. background: #506DFF;
  541. }
  542. }
  543. }
  544. }
  545. .list {
  546. height: calc(100vh - 23vh);
  547. margin-bottom: 60rpx;
  548. .list_item {
  549. margin: 20rpx auto 0;
  550. width: 690rpx;
  551. background: #FFFFFF;
  552. border-radius: 10px;
  553. box-sizing: border-box;
  554. padding: 20rpx;
  555. .cell {
  556. padding: 12rpx 0;
  557. }
  558. .top {
  559. vertical-align:middle;
  560. .item_name {
  561. // width: calc(100% - 74rpx);
  562. font-size: 30rpx;
  563. font-weight: 400;
  564. color: #222222;
  565. // float: right;
  566. line-height: 42rpx;
  567. }
  568. .top_icon {
  569. width: 64rpx;
  570. height: 28rpx;
  571. float: left;
  572. margin: 7rpx 10rpx 0 0;
  573. background: url('https://ship.shipcc.cn/common/green_bg.png') no-repeat;
  574. background-size: 100%;
  575. font-size: 16rpx;
  576. font-weight: normal;
  577. color: #FFFFFF;
  578. line-height: 28rpx;
  579. text-align: center;
  580. }
  581. .top_icon1 {
  582. width: 64rpx;
  583. height: 28rpx;
  584. float: left;
  585. margin: 7rpx 10rpx 0 0;
  586. background: url('https://ship.shipcc.cn/common/blue_bg.png') no-repeat;
  587. background-size: 100%;
  588. font-size: 16rpx;
  589. font-weight: normal;
  590. color: #FFFFFF;
  591. line-height: 28rpx;
  592. text-align: center;
  593. }
  594. }
  595. .text_style1 {
  596. font-size: 22rpx;
  597. font-weight: 400;
  598. color: #585F6A;
  599. line-height: 32rpx;
  600. padding-left: 12rpx;
  601. }
  602. .item_icon {
  603. width: 28rpx;
  604. height: 28rpx;
  605. }
  606. }
  607. }
  608. }
  609. }
  610. </style>