index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-05-22 15:31:58
  6. * @Description: file content
  7. * @FilePath: \oms\pages\distributor\index.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" @click="goBack()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>招标信息</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <!-- 搜索 -->
  23. <view class="query-wrap">
  24. <view class="search-container">
  25. <view class="search-input">
  26. <u-input
  27. clearable
  28. placeholderStyle="font-size:26rpx"
  29. :customStyle="{ height: '66rpx' }"
  30. v-model="title"
  31. prefixIcon="search"
  32. prefixIconStyle="font-size: 22px;color: #909399"
  33. placeholder="请输入招标信息标题"
  34. shape="circle"
  35. border="surround"></u-input>
  36. </view>
  37. <view class="search-btn" @click="searchList">搜索</view>
  38. </view>
  39. </view>
  40. <u-empty v-if="bidData.length == 0" mode="list" text="暂无数据"></u-empty>
  41. <scroll-view :scroll-y="true" class="data-list" @scrolltolower="lower" v-else>
  42. <view>
  43. <view class="data-item" v-for="(v, i) in bidData" :key="i" @click="toDetails(v)">
  44. <view class="customer-name flex">
  45. <text class="name">{{ v.title }}</text>
  46. </view>
  47. <view class="customer-info flex">
  48. <view class="info-left flex_1">
  49. <view class="info-row flex_l">
  50. <text class="info-label">客户名称:</text>
  51. <u-text color="#323232" size="24rpx" :text="v.cuctName || '-'"></u-text>
  52. </view>
  53. <view class="info-row flex_l">
  54. <text class="info-label">招标产品名称:</text>
  55. <u-text color="#323232" size="24rpx" :text="v.productName || '-'"></u-text>
  56. </view>
  57. <view class="info-row flex_l">
  58. <text class="info-label">发布招标日期:</text>
  59. <u-text
  60. color="#323232"
  61. size="24rpx"
  62. :text="parseTime(v.publishedTime, '{y}-{m}-{d}') || '-'"></u-text>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <u-loadmore :status="loadStatus" />
  68. </view>
  69. </scroll-view>
  70. </view>
  71. <!-- 消息提示 -->
  72. <u-toast ref="uToast"></u-toast>
  73. </view>
  74. </template>
  75. <script>
  76. import bidApi from '../../api/bid'
  77. import to from 'await-to-js'
  78. export default {
  79. name: 'omsIndex',
  80. components: {},
  81. data() {
  82. return {
  83. openBtnWidth: false,
  84. lineBg: require('@/static/images/up.png'),
  85. curTabIndex: 0,
  86. height: '',
  87. paddingTop: '',
  88. pageNum: 0,
  89. pageSize: 10,
  90. bidData: [], //客户列表
  91. bidDataTotal: 0, //列表元素数量
  92. loadStatus: '', //加载状态
  93. title: '', //经销商名称
  94. }
  95. },
  96. created() {
  97. const navData = uni.getMenuButtonBoundingClientRect()
  98. this.height = navData.height + 'px'
  99. this.paddingTop = navData.top + 'px'
  100. },
  101. onShow() {
  102. this.searchList()
  103. },
  104. methods: {
  105. // 上拉滚动
  106. lower() {
  107. if (this.bidData.length < this.bidDataTotal && this.loadStatus != 'loading') {
  108. this.$u.throttle(this.getBidList(), 2000, false)
  109. }
  110. },
  111. // 查询列表
  112. searchList() {
  113. this.pageNum = 0
  114. this.getBidList(true)
  115. },
  116. async getBidList(reset) {
  117. this.loadStatus = 'loading'
  118. this.pageNum++
  119. let params = {
  120. title: this.title,
  121. pageNum: this.pageNum,
  122. pageSize: this.pageSize,
  123. }
  124. const [err, res] = await to(bidApi.list(params))
  125. if (err) {
  126. this.loadStatus = 'nomore'
  127. return
  128. }
  129. if (res && res.code == 200) {
  130. if (reset) {
  131. this.bidData = res.data.list || []
  132. } else {
  133. this.bidData = [...this.bidData, ...(res.data.list || [])]
  134. }
  135. this.bidDataTotal = res.data.total
  136. this.loadStatus = this.bidData.length == this.bidDataTotal ? 'nomore' : 'loadmore'
  137. } else {
  138. this.loadStatus = 'nomore'
  139. }
  140. },
  141. goBack() {
  142. uni.navigateBack({
  143. //关闭当前页面,返回上一页面或多级页面。
  144. delta: 1,
  145. })
  146. },
  147. toDetails(v) {
  148. uni.navigateTo({
  149. //保留当前页面,跳转到应用内的某个页面
  150. url: '/pages/inviteTenders/details?id=' + v.id,
  151. })
  152. },
  153. },
  154. }
  155. </script>
  156. <style>
  157. page {
  158. background: #f2f3f5;
  159. }
  160. </style>
  161. <style lang="scss" scoped>
  162. .home {
  163. padding-top: 188rpx;
  164. .nav {
  165. position: absolute;
  166. left: 0;
  167. top: 0;
  168. width: 100%;
  169. height: 284rpx;
  170. background: #3e7ef8;
  171. .title {
  172. position: relative;
  173. text-align: center;
  174. font-size: 32rpx;
  175. font-weight: bold;
  176. color: #ffffff;
  177. .back {
  178. position: absolute;
  179. top: 0;
  180. bottom: 0;
  181. margin: auto;
  182. left: 70rpx;
  183. display: flex;
  184. }
  185. }
  186. }
  187. .main {
  188. position: absolute;
  189. width: 100%;
  190. height: calc(100vh - 188rpx);
  191. background: #ffffff;
  192. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  193. border-radius: 31rpx 31rpx 0 0;
  194. padding: 0 32rpx;
  195. padding-bottom: 64rpx;
  196. .query-wrap {
  197. padding-top: 20rpx;
  198. .search-container {
  199. display: flex;
  200. align-items: center;
  201. .search-input {
  202. flex: 1;
  203. }
  204. .search-btn {
  205. text-align: center;
  206. line-height: 60rpx;
  207. border-radius: 12rpx;
  208. width: 100rpx;
  209. height: 60rpx;
  210. font-size: 26rpx;
  211. margin: 0 0 0 12rpx;
  212. background: $u-primary;
  213. color: #ffffff;
  214. }
  215. }
  216. }
  217. .data-list {
  218. width: 100%;
  219. height: calc(100vh - 372rpx);
  220. overflow-y: scroll;
  221. .data-item {
  222. background: rgba(242, 243, 245, 0.5);
  223. border-radius: 15rpx;
  224. padding: 28rpx 40rpx 28rpx 38rpx;
  225. margin-top: 32rpx;
  226. .customer-name {
  227. .name {
  228. flex: 1;
  229. color: #323232;
  230. font-weight: bold;
  231. font-size: 28rpx;
  232. margin-right: 12rpx;
  233. }
  234. .user-code {
  235. width: 180rpx;
  236. height: 32rpx;
  237. font-size: 24rpx;
  238. color: #323232;
  239. line-height: 32rpx;
  240. }
  241. }
  242. .customer-info {
  243. .info-left {
  244. .transfer-btn {
  245. margin-top: 20rpx;
  246. width: 150rpx;
  247. }
  248. .info-row {
  249. margin-top: 12rpx;
  250. .info-label {
  251. color: #646464;
  252. font-size: 24rpx;
  253. }
  254. }
  255. }
  256. .info-right {
  257. padding-top: 30rpx;
  258. .user-img {
  259. border-radius: 50%;
  260. width: 46rpx;
  261. height: 46rpx;
  262. }
  263. }
  264. }
  265. }
  266. }
  267. }
  268. .filter-popup {
  269. background: rgba(0, 0, 0, 0.8);
  270. position: fixed;
  271. width: 100%;
  272. height: 100%;
  273. left: 0;
  274. z-index: 1;
  275. .filter-wrap {
  276. width: 100%;
  277. padding: 20rpx;
  278. background: #ffffff;
  279. .filter-item {
  280. padding-bottom: 30rpx;
  281. .tit {
  282. font-size: 26rpx;
  283. color: #323232;
  284. font-weight: bold;
  285. padding-bottom: 20rpx;
  286. }
  287. .menu-list {
  288. display: flex;
  289. flex-wrap: wrap;
  290. .menu-item {
  291. margin-right: 40rpx;
  292. margin-bottom: 20rpx;
  293. }
  294. }
  295. }
  296. }
  297. .btn-box {
  298. width: 698rpx;
  299. height: 75px;
  300. display: flex;
  301. align-items: center;
  302. justify-content: space-between;
  303. > view {
  304. width: 320rpx;
  305. height: 40px;
  306. border-radius: 40px;
  307. border: solid 1rpx #ec652b;
  308. align-items: center;
  309. justify-content: center;
  310. text-align: center;
  311. line-height: 40px;
  312. }
  313. .reset {
  314. color: #ec652b;
  315. }
  316. .submit {
  317. color: #fff;
  318. background-color: #ec652b;
  319. }
  320. }
  321. }
  322. .fixed-btn-group {
  323. position: fixed;
  324. display: flex;
  325. justify-content: space-around;
  326. align-items: center;
  327. width: 90rpx;
  328. height: 90rpx;
  329. bottom: 50rpx;
  330. right: 50rpx;
  331. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  332. border-radius: 20px;
  333. transition: all 0.2s;
  334. background: #fff;
  335. .btn {
  336. width: 60rpx;
  337. height: 60rpx;
  338. background: #3e7ef8;
  339. border-radius: 50%;
  340. margin: 10rpx;
  341. font-size: 26rpx;
  342. font-weight: bold;
  343. color: #ffffff;
  344. }
  345. }
  346. }
  347. </style>