productList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template >
  2. <view>
  3. <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
  4. <view class="back-container" @click="handleBack">
  5. <view class="back-text">返回</view>
  6. </view>
  7. <view class="content-container">
  8. <view class="content-text">{{title}}</view>
  9. </view>
  10. </view>
  11. <view class="line-box">
  12. <view :style="[{top:CustomBar + 'px'}]">
  13. <view class="tabs" v-if="md=='1'">
  14. <view
  15. v-for="(tab, index) in tabs"
  16. :key="index"
  17. class="tab-item"
  18. :class="{ active: activeTab === index }"
  19. @click="switchTab(index)"
  20. >
  21. {{ tab.name }}
  22. </view>
  23. </view>
  24. <view class="search-box" >
  25. <view class="choose-box2" style="margin-top: 10rpx;">
  26. <view style="width: 520rpx;">
  27. <input type="text" placeholder="输入关键词产品或企业名称" v-model="searchForm.qyName" confirm-type="search"
  28. ></input>
  29. </view>
  30. <text style="padding-left: 40rpx;flex: 1;" class="cuIcon-search color-white" @click="doSearch"></text>
  31. </view>
  32. </view>
  33. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
  34. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
  35. v-for="(item, index) in dataList" :key="index" @touchstart="ListTouchStart"
  36. @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
  37. <view class="item-box" @click="gotoBuildInfo(item.id)">
  38. <view class="item-title">
  39. <view>
  40. {{item.des5}}
  41. </view>
  42. <view class="item-name31" v-if="item.des1=='1'">供</view>
  43. <view class="item-name3" v-if="item.des1=='2'">需</view>
  44. </view>
  45. <view class="item-line">
  46. <view class="item-name">{{item.des2}}</view>
  47. </view>
  48. <view class="item-line">
  49. <text class="item-name2">{{item.des4}} </text>
  50. <view class="item-name3"></view>
  51. </view>
  52. </view>
  53. </view>
  54. </mescroll-body>
  55. <uni-fab :pattern=" {
  56. color: '#7A7E83',
  57. backgroundColor: '#fff',
  58. selectedColor: '#007AFF',
  59. buttonColor: '#007AFF'
  60. }" horizontal="right" vertical="bottom" @fabClick="add" ></uni-fab>
  61. <!-- <view @click="outlogin" class="fixed-bottom-right" v-if="isLogin!=null">
  62. <image class="center-img2" src="/static/img/icon_logout.png"></image>
  63. </view> -->
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import loginService from "@/api/auth/loginService";
  70. import uniFab from '@/components/uni-fab/uni-fab.vue';
  71. import DoublePicker from '@/components/DoublePicker/DoublePicker.vue'
  72. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  73. import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
  74. import {mapActions} from 'vuex'
  75. export default {
  76. mixins: [MescrollMixin, MescrollMoreItemMixin], // 使用mixin (在main.js注册全局组件)
  77. name: "apps",
  78. components: {
  79. uniFab,
  80. DoublePicker
  81. },
  82. data() {
  83. return {
  84. isLogin:"",
  85. pageInfo: {},
  86. loginid:"",
  87. title:"产品供需",
  88. isBack: true, // 是否显示返回按钮
  89. bgColor: 'bg-blue', // 背景颜色
  90. tabs: [
  91. { name: '全部' },
  92. { name: '供' },
  93. { name: '需' }
  94. ],
  95. activeTab: 0,
  96. stype: "", // 企业 => 3 楼宇 => 2 园区 => 1 zfadmin => 4 admin=> 5
  97. md:"1",
  98. searchForm: {
  99. des1:"",
  100. des10:"",
  101. qyName:"",
  102. },
  103. curWord: "", //当前搜索关键词
  104. dataList: [], // 数据列表
  105. modalName: null,
  106. tablePage: {
  107. total: 0,
  108. currentPage: 1,
  109. pageSize: 10,
  110. orders: []
  111. },
  112. loading: false,
  113. parkId: '',
  114. parkList: [],
  115. parkList2: [],
  116. parkList3: [],
  117. parkList4: [],
  118. ddd1:"" ,
  119. };
  120. },
  121. onLoad(query) {
  122. if(query!=undefined&&query!=null&&query!=''){
  123. if(query.loginid!=undefined){
  124. this.loginid=query.loginid
  125. this.autoLogin();
  126. }
  127. if (query && query.w=='1' ) {
  128. this.md = "1";
  129. this.title="产品供需";
  130. }else if(query && query.w=='2'){
  131. this.md = "2";
  132. this.title="我的发布";
  133. this.searchForm.des10="1";
  134. }
  135. }
  136. },
  137. onShow() {
  138. this.isLogin=this.$auth.checkisLogin();
  139. },
  140. created() {
  141. //this.getPageInfo();
  142. //this.getParkList()
  143. //this.getParkList2()
  144. //this.getParkList3()
  145. },
  146. methods: {
  147. ...mapActions(['refreshUserInfo']),
  148. /*获取数据列表 */
  149. upCallback(page) {
  150. this.loading = true
  151. loginService.enterpriseother({
  152. current: page.num,
  153. size: page.size,
  154. orders: [{ column: 'a.create_date', asc: false }],
  155. ...this.searchForm
  156. }).then(({
  157. data
  158. }) => {
  159. let curPageData = data.records
  160. this.mescroll.endBySize(curPageData.length, data.total);
  161. //如果是第一页需手动制空列表
  162. if (page.num == 1)
  163. this.dataList = [];
  164. //追加新数据
  165. this.dataList = this.dataList.concat(curPageData);
  166. }).catch(e => {
  167. //联网失败, 结束加载
  168. this.mescroll.endErr();
  169. })
  170. },
  171. gotoBuildInfo(id) {
  172. uni.navigateTo({
  173. url: `/pages/product/productInfo?id=${id}&ischeck=1`
  174. })
  175. //window.location.href=`/yd_qycpfbH5/#/pages/comEdit/comEdit?id=${id}&ischeck=1`
  176. },
  177. updateCities(newCities) {
  178. this.cities = newCities;
  179. },
  180. // 搜索
  181. doSearch() {
  182. this.dataList = []; // 先清空列表,显示加载进度
  183. this.mescroll.resetUpScroll();
  184. },
  185. totongxunlu(){
  186. uni.navigateTo({
  187. url: '/pages/comList/comList'
  188. })
  189. },
  190. totongxunlu2(){
  191. uni.showModal({
  192. title: '功能暂未开放,请至后台导入!',
  193. showCancel: true,
  194. success: (res) => {
  195. }
  196. });
  197. },
  198. getPageInfo() {
  199. loginService.InfoStatistics({}).then(({ data }) => {
  200. this.pageInfo = data;
  201. });
  202. },
  203. autoLogin(){
  204. console.log("登录id"+this.loginid);
  205. loginService.loginid( this.loginid).then(({data}) => {
  206. this.$store.commit('SET_TOKEN',data.token);
  207. this.refreshUserInfo();
  208. }).catch(e => {
  209. console.error(e)
  210. })
  211. },
  212. getRole() {
  213. let userInfo = uni.getStorageSync('WMS-userinfo')
  214. var officeId = userInfo.officeDTO.id;
  215. var roleIds = userInfo.roleIds;
  216. if (roleIds.indexOf("17bac1f980264e3e8193bc965538e2c6") != -1) {
  217. //// 管理员
  218. this.stype = 5
  219. uni.setStorageSync('stype', this.stype);
  220. } else if (roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1) {
  221. // 政府管理员
  222. this.stype = 4
  223. uni.setStorageSync('stype', this.stype);
  224. } else {
  225. console.log('==================>这里走了么','================>存一个stape')
  226. loginService
  227. .getOtherIdByOffceid({
  228. officeid: officeId,
  229. })
  230. .then(({
  231. data
  232. }) => {
  233. console.log(data, "====================>getOtherIdByOffceid");
  234. this.stype = data.stype;
  235. uni.setStorageSync('stype', this.stype);
  236. });
  237. }
  238. },
  239. outloginset(){
  240. loginService.logout().then(({
  241. data
  242. }) => {
  243. this.$store.commit('logout');
  244. uni.clearStorage();
  245. })
  246. this.$store.commit('logout');
  247. uni.clearStorage();
  248. this.isLogin=this.$auth.checkisLogin();
  249. uni.hideLoading()
  250. },
  251. outlogin() {
  252. uni.showModal({
  253. title: '您确认退出么?',
  254. showCancel: true,
  255. success: (res) => {
  256. if (res.confirm) {
  257. uni.showLoading()
  258. this.outloginset();
  259. // uni.reLaunch({
  260. // url: '/pages/login/login'
  261. // })
  262. }
  263. }
  264. });
  265. },
  266. tces() {
  267. uni.navigateTo({
  268. url: '/pages/index/AudioToWord'
  269. })
  270. },
  271. // ListTouch触摸开始
  272. ListTouchStart(e) {
  273. this.listTouchStart = e.touches[0].pageX
  274. },
  275. // ListTouch计算方向
  276. ListTouchMove(e) {
  277. this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > -60 ? 'right' : 'left'
  278. },
  279. // ListTouch计算滚动
  280. ListTouchEnd(e) {
  281. if (this.listTouchDirection == 'left') {
  282. this.modalName = e.currentTarget.dataset.target
  283. } else {
  284. this.modalName = null
  285. }
  286. this.listTouchDirection = null
  287. },
  288. handleBack() {
  289. // 返回逻辑,比如跳转至上一页
  290. this.$router.go(-1);
  291. },
  292. add(){
  293. if(this.isLogin==null){
  294. uni.showModal({
  295. title: '您还未登录,现在去登录?',
  296. showCancel: true,
  297. success: (res) => {
  298. if (res.confirm) {
  299. uni.showLoading()
  300. uni.reLaunch({
  301. url: '/pages/login/login'
  302. })
  303. }
  304. }
  305. });
  306. }else{
  307. uni.navigateTo({
  308. url: '/pages/product/productAdd?w=1'
  309. })
  310. }
  311. },
  312. switchTab(index) {
  313. this.activeTab = index;
  314. if(this.activeTab==0){
  315. this.searchForm.des1="";
  316. }else{
  317. this.searchForm.des1=this.activeTab;
  318. }
  319. this.doSearch();
  320. }
  321. }
  322. }
  323. </script>
  324. <style>
  325. .page {
  326. height: 100vh;
  327. }
  328. .line-box {
  329. padding-left: 20rpx;
  330. padding-right: 20rpx;
  331. margin-top: 20rpx;
  332. }
  333. .mart-t {
  334. margin-top: 30rpx;
  335. }
  336. .center-box{
  337. margin-top: 20rpx;
  338. width: 100%;
  339. border-radius: 25rpx;
  340. border-radius: 25rpx;
  341. background: #fff;
  342. box-shadow: 0px 8px 16px 2px rgba(101, 101, 101, 0.2);
  343. padding-bottom: 30rpx;
  344. display: flex;
  345. flex-wrap: wrap;
  346. }
  347. .center-left-box {
  348. width: 100%;
  349. padding-bottom: 30rpx;
  350. display: flex;
  351. flex-wrap: wrap;
  352. }
  353. .btn-box-text {
  354. flex:1;
  355. height: 20rpx;
  356. text-align: center;
  357. color: #000000;
  358. font-size: 14px;
  359. font-weight: 700;
  360. }
  361. .btn-box-1 {
  362. flex:1;
  363. height: 30rpx;
  364. text-align: center;
  365. color: #36A7F3;
  366. font-size: x-large;
  367. font-weight: 700;
  368. }
  369. .btn-box-2 {
  370. flex:1;
  371. height: 30rpx;
  372. text-align: center;
  373. color:#F3365A;
  374. font-size: x-large;
  375. font-weight: 700;
  376. }
  377. .btn-box-3 {
  378. flex:1;
  379. height: 30rpx;
  380. text-align: center;
  381. color:#15D578;
  382. font-size: x-large;
  383. font-weight: 700;
  384. }
  385. .btn-box-4 {
  386. flex:1;
  387. height: 30rpx;
  388. text-align: center;
  389. color:#F1A31B;
  390. font-size: x-large;
  391. font-weight: 700;
  392. }
  393. .btn-Imbox {
  394. flex:1;
  395. height: 150rpx;
  396. padding-top: 8rpx;
  397. text-align: center;
  398. display: flex;
  399. flex-direction: column;
  400. justify-content: center; /* 子元素内部内容竖向居中 */
  401. align-items: center; /* 子元素内部内容水平居中 */
  402. text-align: center; /* 文字居中 */
  403. }
  404. .btn-Imbox p {
  405. font-size: 14px; /* 文字大小,可根据需要调整 */
  406. margin: 0; /* 去掉默认的外边距 */
  407. font-weight: 700;
  408. }
  409. .center-img{
  410. width: 90rpx;
  411. height: 90rpx;
  412. margin-bottom: 10rpx;
  413. text-align: center;
  414. }
  415. .center-img2{
  416. width: 70rpx;
  417. height: 70rpx;
  418. margin-top: 10rpx;
  419. margin-bottom: 20rpx;
  420. text-align: center;
  421. }
  422. .kuai-text{
  423. color: #000000;
  424. font-weight: 900;
  425. font-size: 34rpx;
  426. padding-top: 20rpx;
  427. padding-left: 20rpx;
  428. }
  429. .btn-box-5 {
  430. width: 337rpx;
  431. height: 200rpx;
  432. background-image: url('../../static/img/btn3.png');
  433. background-size: 100% 100%;
  434. }
  435. .btn-box-6 {
  436. width: 337rpx;
  437. height: 200rpx;
  438. background-image: url('../../static/img/btn6.png');
  439. background-size: 100% 100%;
  440. }
  441. .h-200 {
  442. height: 200rpx;
  443. }
  444. .swiper {
  445. width: 750rpx;
  446. height: 310rpx;
  447. }
  448. .swiper-item {
  449. width: 750rpx;
  450. height: 310rpx;
  451. background-color: aliceblue;
  452. }
  453. .font-size-35 {
  454. font-size: 35px !important;
  455. }
  456. .img-size {
  457. width: 80rpx;
  458. height: 80rpx;
  459. }
  460. .content-box {
  461. width: 437rpx;
  462. height: 200rpx;
  463. }
  464. .my-app .padding-sm {
  465. padding: 6px;
  466. }
  467. .grid .padding-sm .bg-white {
  468. box-shadow: 0 1px 4px #f9f9f9, 1px 1px 40px rgba(0, 0, 0, .06);
  469. }
  470. .bg-blue {
  471. background: #fff;
  472. color: #0081ff !important;
  473. }
  474. .text-white,
  475. .line-white,
  476. .lines-white {
  477. color: #0081ff !important;
  478. }
  479. .cu-bar .search-form {
  480. background-color: white;
  481. }
  482. .item-box{
  483. width: 710rpx;
  484. background: #FFFFFF;
  485. box-shadow: 0px 1px 3px 0px rgba(9,2,4,0.1);
  486. border-radius: 10px;
  487. padding-top: 20rpx;
  488. padding-left: 38rpx;
  489. padding-right: 10rpx;
  490. margin-top: 20rpx;
  491. }
  492. .item-title{
  493. position: relative;
  494. display: flex;
  495. justify-content: space-between;
  496. font-size: 30rpx;
  497. color: #010101;
  498. font-weight: bold;
  499. align-items: center;
  500. }
  501. .item-line{
  502. display: flex;
  503. height: 48rpx;
  504. margin-top: 20rpx;
  505. }
  506. .item-line2{
  507. height: 48rpx;
  508. margin-top: 20rpx;
  509. }
  510. .subtitle{
  511. color: #E5880E;
  512. }
  513. .item-name{
  514. margin-top: 5rpx;
  515. font-size: 29rpx;
  516. color: #666666;
  517. }
  518. .item-name2{
  519. font-size: 29rpx;
  520. color: #676D99;
  521. height: 40rpx; /* 这里假设两行的高度是80rpx */
  522. overflow: hidden; /* 超出部分隐藏 */
  523. text-overflow: ellipsis; /* 超出部分显示省略号 */
  524. display: -webkit-box; /* 使用Webkit的行盒模型 */
  525. -webkit-line-clamp: 1; /* 限制最多显示2行 */
  526. -webkit-box-orient: vertical; /* 垂直排列 */
  527. }
  528. .item-name3{
  529. display: flex;
  530. width: 100%;
  531. padding-right: 30rpx;
  532. flex: 1;
  533. justify-content: flex-end;
  534. font-size: 29rpx;
  535. color: #FF4500;
  536. }
  537. .item-name31{
  538. display: flex;
  539. width: 100%;
  540. padding-right: 30rpx;
  541. flex: 1;
  542. justify-content: flex-end;
  543. font-size: 29rpx;
  544. color: #2E8B57;
  545. }
  546. .item-content{
  547. color: #1497EF;
  548. font-size: 30rpx;
  549. }
  550. .btn-box{
  551. display: flex;
  552. }
  553. .line-zs{
  554. width: 2rpx;
  555. height: 30rpx;
  556. background: #36A7F3;
  557. }
  558. .edit-botton{
  559. width: 100rpx;
  560. height: 48rpx;
  561. line-height: 48rpx;
  562. color: #fff;
  563. font-size: 28rpx;
  564. margin-right: 20rpx;
  565. border-radius: 10rpx;
  566. background: #5A9EE9;
  567. text-align: center;
  568. }
  569. .del-botton{
  570. width: 100rpx;
  571. height: 48rpx;
  572. line-height: 48rpx;
  573. color: #fff;
  574. font-size: 28rpx;
  575. margin-right: 20rpx;
  576. border-radius: 10rpx;
  577. background: #F27C85;
  578. text-align: center;
  579. }
  580. .color-white{
  581. color: #808080;
  582. font-size: 40rpx;
  583. line-height: 60rpx;
  584. }
  585. .search-box{
  586. padding-left: 20rpx;
  587. padding-right: 20rpx;
  588. padding-top: 20rpx;
  589. margin-top: 20rpx;
  590. width: 100%;
  591. border-radius: 25rpx;
  592. border-radius: 25rpx;
  593. background: #fff;
  594. box-shadow: 0px 8px 16px 2px rgba(101, 101, 101, 0.2);
  595. padding-bottom: 30rpx;
  596. display: flex;
  597. flex-wrap: wrap;
  598. }
  599. .search-box1{
  600. display: flex;
  601. }
  602. .input-box{
  603. background: #fff;
  604. height: 65rpx;
  605. width: 640rpx;
  606. display: flex;
  607. align-items: center;
  608. border-radius: 30rpx;
  609. padding-left: 30rpx;
  610. margin-right: 20rpx;
  611. }
  612. .input-boxinput{
  613. height: 75rpx;
  614. font-size: 15rpx;
  615. }
  616. .choose-box{
  617. background: #fff;
  618. width: 325rpx;
  619. border-radius: 23rpx;
  620. height: 70rpx;
  621. display: flex;
  622. align-items: center;
  623. justify-content: center;
  624. margin-right: 20rpx;
  625. border: 1rpx solid #808080;
  626. }
  627. .choose-box2{
  628. background: #fff;
  629. width: 100%;
  630. border-radius: 23rpx;
  631. height: 70rpx;
  632. display: flex;
  633. padding-left: 29rpx;
  634. align-items: center;
  635. border: 1rpx solid #808080;
  636. }
  637. .choose-box3{
  638. display: flex;
  639. }
  640. .choose-boxp{
  641. font-size: 32rpx;
  642. width: 80rpx;
  643. }
  644. .fixed-bottom-right {
  645. padding: 20rpx;
  646. position: fixed;
  647. bottom: 20px; /* 距离底部的距离 */
  648. right: 20px; /* 距离右侧的距离 */
  649. }
  650. .tabs {
  651. display: flex;
  652. justify-content: space-around;
  653. margin-bottom: 10px;
  654. }
  655. .tab-item {
  656. padding: 10px 10px;
  657. cursor: pointer;
  658. transition: all 0.3s;
  659. }
  660. .tab-item.active {
  661. color: #66b1ff;
  662. border-bottom: 2px solid #66b1ff;
  663. }
  664. .tab-content {
  665. padding: 20px;
  666. }
  667. .tab-item-content {
  668. display: none;
  669. }
  670. .tab-item-content.v-if {
  671. display: block;
  672. }
  673. .custom-header {
  674. display: flex;
  675. align-items: center;
  676. justify-content: center;
  677. padding: 10px;
  678. width: 100%;
  679. }
  680. .is-back {
  681. position: relative;
  682. }
  683. .back-container {
  684. position: absolute;
  685. left: 10px;
  686. cursor: pointer;
  687. }
  688. .back-text {
  689. color: white; /* 返回按钮文本颜色 */
  690. }
  691. /* 背景颜色 */
  692. .bg-blue {
  693. background-color: #4285f4; /* 假设这是一个蓝色背景 */
  694. }
  695. .content-container {
  696. flex: 1;
  697. text-align: center;
  698. }
  699. .content-text {
  700. color: white; /* 标题文本颜色 */
  701. font-weight: bold;
  702. }
  703. </style>