bidding.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  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-expert.zhousi.hdlkeji.com/common/screen.png" class="screen_icon" v-show="!screen_show"></image>
  31. <image src="https://ship-expert.zhousi.hdlkeji.com/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. <view class="list" v-if="pageList.length>0">
  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-expert.zhousi.hdlkeji.com/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. </view>
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. import $api from '@/static/js/api.js'
  150. var that = ''
  151. export default {
  152. data() {
  153. return {
  154. serach_value: '',
  155. tabs: [
  156. {
  157. index: 0,
  158. name: '默认',
  159. },
  160. {
  161. index: 1,
  162. name: '披露起始时间',
  163. },
  164. {
  165. index: 2,
  166. name: '披露截止时间',
  167. }
  168. ],
  169. tab_active: 0,
  170. screen_show: false,
  171. pageList: [
  172. ],
  173. type: false,
  174. type_active: -1,
  175. typeList: [
  176. ],
  177. mode: false,
  178. mode_active: -1,
  179. modeList: [
  180. {
  181. id: '',
  182. name: '全部',
  183. },
  184. {
  185. id: 0,
  186. name: '预披露',
  187. },
  188. {
  189. id: 1,
  190. name: '正式披露',
  191. }
  192. ],
  193. price: false,
  194. price_active: -1,
  195. priceList: [
  196. {
  197. amount_min: '',
  198. amount_max: '',
  199. name: '全部',
  200. },
  201. {
  202. amount_min: 0,
  203. amount_max: '100万',
  204. name: '100万以下',
  205. },
  206. {
  207. amount_min: '100万',
  208. amount_max: '500万',
  209. name: '100万-500万',
  210. }
  211. ],
  212. region: false,
  213. region_active: -1,
  214. regionList: [
  215. ],
  216. time: false,
  217. time_active: -1,
  218. timeList: [
  219. {
  220. day: '',
  221. name: '全部',
  222. },
  223. {
  224. day: 3,
  225. name: '三天内',
  226. },
  227. {
  228. day: 10,
  229. name: '十天内',
  230. }
  231. ],
  232. page: 1,
  233. limit: 15,
  234. total: 15,
  235. }
  236. },
  237. onLoad() {
  238. that = this
  239. that.getType()
  240. that.getCity()
  241. },
  242. onShow() {
  243. var token = uni.getStorageSync('token')
  244. if(!token) {
  245. $api.info('请先登录')
  246. setTimeout(() =>{
  247. $api.jump('/pages/login/code_login')
  248. }, 1000)
  249. }
  250. },
  251. methods: {
  252. // 返回
  253. leftClick() {
  254. $api.jump(-1)
  255. },
  256. search() {
  257. that.page = 1
  258. that.pageList = []
  259. that.getList()
  260. },
  261. getList() {
  262. $api.req({
  263. url: '/data/api.Bidding/index',
  264. data: {
  265. limit: that.limit,
  266. page: that.page,
  267. b_type: that.mode_active == -1?'':that.modeList[that.mode_active].id,
  268. amount_min: that.price_active == -1?'':that.priceList[that.price_active].amount_min,
  269. amount_max: that.price_active == -1?'':that.priceList[that.price_active].amount_max,
  270. type_id: that.type_active == -1?'':that.typeList[that.type_active].id,
  271. city: that.type_active == -1?'':that.regionList[that.region_active].id,
  272. day_type: 'day',
  273. day: that.time_active == -1? '' : that.timeList[that.time_active].day,
  274. o_f: that.tabs[that.tab_active].index,
  275. o_b: 'desc',
  276. keyword: that.serach_value
  277. }
  278. }, function(res) {
  279. if(res.code == 1) {
  280. if(that.page == 1) {
  281. that.pageList = res.data.data
  282. that.total = res.data.total
  283. } else {
  284. that.pageList = that.pageList.concat(res.data.data)
  285. }
  286. }
  287. })
  288. },
  289. getType() {
  290. $api.req({
  291. url: '/data/api.Bidding/types',
  292. }, function(res) {
  293. if(res.code == 1) {
  294. that.typeList = res.data
  295. that.getList()
  296. }
  297. })
  298. },
  299. getCity() {
  300. $api.req({
  301. url: '/data/api.Area/sort',
  302. data: {
  303. level: 2,
  304. hot: 1
  305. }
  306. }, function(res) {
  307. if(res.code == 1) {
  308. var list = res.data.areas
  309. for(var i=0;i<list.length;i++) {
  310. for(var j=0;j<list[i].child.length;j++) {
  311. that.regionList.push(list[i].child[j])
  312. }
  313. }
  314. var data ={
  315. id: 0,
  316. title: '全国'
  317. }
  318. that.regionList.unshift(data)
  319. // console.log(that.regionList);
  320. // that.regionList = res.data.areas
  321. // that.itemArr = res.data.areas
  322. }
  323. })
  324. },
  325. // 切换tabs
  326. changeTab(index) {
  327. that.tab_active = index
  328. that.page = 1
  329. that.pageList = []
  330. that.getList()
  331. },
  332. // 筛选
  333. screen() {
  334. that.screen_show = !that.screen_show
  335. },
  336. // 查看详情
  337. toDetail(id) {
  338. $api.jump('/page_index/pages/bidding/bidDetail?id=' + id)
  339. },
  340. expend(e) {
  341. if(e == 'type') {
  342. that.type = !that.type
  343. }
  344. if(e == 'mode') {
  345. that.mode = !that.mode
  346. }
  347. if(e == 'price') {
  348. that.price = !that.price
  349. }
  350. if(e == 'region') {
  351. that.region = !that.region
  352. }
  353. if(e == 'time') {
  354. that.time = !that.time
  355. }
  356. },
  357. selectMode(index) {
  358. that.mode_active = index
  359. },
  360. selectPrice(index) {
  361. that.price_active = index
  362. },
  363. selectType(index) {
  364. that.type_active = index
  365. /* if(that.type_active.length == 0) {
  366. that.type_active.push(index)
  367. } else {
  368. for(var i=0;i<that.type_active.length;i++) {
  369. if(that.type_active[i] == index) {
  370. that.type_active.splice(i,1)
  371. return
  372. }
  373. }
  374. that.type_active.push(index)
  375. } */
  376. },
  377. selectRegion(index) {
  378. that.region_active = index
  379. },
  380. selectTime(index) {
  381. that.time_active = index
  382. },
  383. reset() {
  384. that.mode_active = -1
  385. that.price_active = -1
  386. that.type_active = []
  387. that.region_active = -1
  388. that.time_active = -1
  389. },
  390. confirm() {
  391. that.page = 1,
  392. that.pageList = []
  393. that.screen_show = false
  394. that.getList()
  395. },
  396. onReachBottom() {
  397. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  398. $api.info("没有更多了")
  399. } else {
  400. that.page++
  401. that.getList()
  402. }
  403. }
  404. },
  405. }
  406. </script>
  407. <style lang="scss" scoped>
  408. .content::v-deep {
  409. background-color: #e8eff5;
  410. .navbar {
  411. .search {
  412. // background: #fff;
  413. width: 100%;
  414. height: 88rpx;
  415. box-sizing: border-box;
  416. padding: 12rpx 30rpx;
  417. .u-input {
  418. background-color: #fff;
  419. height: 64rpx;
  420. padding: 0 0 0 18rpx !important;
  421. border: 1rpx solid #506Dff;
  422. margin-bottom: 12rpx;
  423. }
  424. .u-input__content__subfix-icon {
  425. width: 128rpx;
  426. height: 64rpx;
  427. background-color: #506Dff;
  428. border-radius: 32rpx;
  429. color: #fff;
  430. font-size: 28rpx;
  431. text-align: center;
  432. line-height: 64rpx;
  433. }
  434. }
  435. }
  436. .box {
  437. margin-top: 24rpx;
  438. width: 100%;
  439. min-height: calc(100vh - 216rpx);
  440. background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
  441. border-radius: 40rpx 40rpx 0px 0px;
  442. box-sizing: border-box;
  443. padding: 30rpx;
  444. .tabs {
  445. width: 526rpx;
  446. }
  447. .tabs_item {
  448. font-size: 26rpx;
  449. font-weight: 400;
  450. color: #666666;
  451. line-height: 36rpx;
  452. padding-right: 8rpx;
  453. .u-icon{
  454. padding-left: 8rpx;
  455. }
  456. }
  457. .tab_active {
  458. color: #506DFF;
  459. }
  460. .screen_icon {
  461. width: 24rpx;
  462. height: 24rpx;
  463. }
  464. .drop {
  465. position: absolute;
  466. left: 0;
  467. top: 345rpx;
  468. width: 750rpx;
  469. z-index: 9;
  470. min-height: calc(100vh - 345rpx);
  471. background: rgba(0,0,0,0.5);
  472. backdrop-filter: blur(5px);
  473. .drop_bg {
  474. width: 100%;
  475. background-color: #fff;
  476. .drop_list {
  477. box-sizing: border-box;
  478. padding: 0 30rpx;
  479. .drop_title {
  480. margin: 24rpx 0 20rpx;
  481. font-size: 28rpx;
  482. font-weight: 400;
  483. color: #3D4249;
  484. line-height: 40rpx;
  485. }
  486. .drop_right {
  487. font-size: 20rpx;
  488. font-weight: 400;
  489. color: #555555;
  490. line-height: 28rpx;
  491. padding-right: 8rpx;
  492. }
  493. .hide {
  494. width: 100%;
  495. height: 80rpx;
  496. overflow: hidden;
  497. }
  498. .drop_item {
  499. width: 208rpx;
  500. height: 76rpx;
  501. background: #F4F8FB;
  502. border-radius: 4rpx;
  503. font-size: 28rpx;
  504. text-align: center;
  505. font-weight: 400;
  506. color: #555555;
  507. line-height: 76rpx;
  508. margin: 0 24rpx 20rpx 0;
  509. }
  510. .drop_item:nth-child(3n+3) {
  511. margin: 0 0 20rpx;
  512. }
  513. .drop_active {
  514. background: #E8F2FF;
  515. font-weight: 500;
  516. color: #506DFF;
  517. }
  518. }
  519. .drop_bottom {
  520. margin-top: 32rpx;
  521. width: 100%;
  522. height: 100rpx;
  523. background: #FFFFFF;
  524. box-shadow: 0px -1px 2px 0px rgba(0,0,0,0.05);
  525. .left {
  526. width: 50%;
  527. height: 100%;
  528. font-size: 36rpx;
  529. font-weight: 400;
  530. color: #BDBDBD;
  531. line-height: 100rpx;
  532. text-align: center;
  533. }
  534. .right {
  535. width: 50%;
  536. height: 100%;
  537. font-size: 36rpx;
  538. font-weight: 400;
  539. color: #FFFFFF;
  540. line-height: 100rpx;
  541. text-align: center;
  542. background: #506DFF;
  543. }
  544. }
  545. }
  546. }
  547. .list {
  548. margin-bottom: 60rpx;
  549. .list_item {
  550. margin: 20rpx auto 0;
  551. width: 690rpx;
  552. background: #FFFFFF;
  553. border-radius: 10px;
  554. box-sizing: border-box;
  555. padding: 20rpx;
  556. .cell {
  557. padding: 12rpx 0;
  558. }
  559. .top {
  560. vertical-align:middle;
  561. .item_name {
  562. // width: calc(100% - 74rpx);
  563. font-size: 30rpx;
  564. font-weight: 400;
  565. color: #222222;
  566. // float: right;
  567. line-height: 42rpx;
  568. }
  569. .top_icon {
  570. width: 64rpx;
  571. height: 28rpx;
  572. float: left;
  573. margin: 7rpx 10rpx 0 0;
  574. background: url('https://ship-expert.zhousi.hdlkeji.com/common/green_bg.png') no-repeat;
  575. background-size: 100%;
  576. font-size: 16rpx;
  577. font-weight: normal;
  578. color: #FFFFFF;
  579. line-height: 28rpx;
  580. text-align: center;
  581. }
  582. .top_icon1 {
  583. width: 64rpx;
  584. height: 28rpx;
  585. float: left;
  586. margin: 7rpx 10rpx 0 0;
  587. background: url('https://ship-expert.zhousi.hdlkeji.com/common/blue_bg.png') no-repeat;
  588. background-size: 100%;
  589. font-size: 16rpx;
  590. font-weight: normal;
  591. color: #FFFFFF;
  592. line-height: 28rpx;
  593. text-align: center;
  594. }
  595. }
  596. .text_style1 {
  597. font-size: 22rpx;
  598. font-weight: 400;
  599. color: #585F6A;
  600. line-height: 32rpx;
  601. padding-left: 12rpx;
  602. }
  603. .item_icon {
  604. width: 28rpx;
  605. height: 28rpx;
  606. }
  607. }
  608. }
  609. }
  610. }
  611. </style>