index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. <template>
  2. <view class="pages" :style="{'min-height':h+'px','padding-top':(mt)+'px'}">
  3. <c-nav-bar title="商品管理"></c-nav-bar>
  4. <view class="tb">
  5. <view class="tabs">
  6. <view v-for="(item,index) in tabList" :key="index" @tap="changeTab1(index)">
  7. <text :class="index==current?'active':''">{{item.name}}</text>
  8. </view>
  9. </view>
  10. </view>
  11. <!-- 房型数量 -->
  12. <view class="">
  13. <view class="typeNum">
  14. <view class="left" style="font-size: 24rpx; color: #777;" @click="areaShowed()">
  15. <text :class="areaShow==true?'active':''" style="margin-right: 20rpx;">上架时间</text>
  16. <u-icon name="arrow-down-fill" bold='true' v-if="areaShow==false" size="20" labelPos="left"
  17. labelSize="26"></u-icon>
  18. <u-icon name="arrow-up-fill" bold='true' v-else color="#007a68" labelColor='#007a68' size="20"
  19. labelPos="left" labelSize="26"></u-icon>
  20. </view>
  21. <view class="right" @click="showList">
  22. <view class="image">
  23. <image src="https://i.ringzle.com/file/20240313/f3d301b3bc4544ffaf5a0d96a761dd00.png" mode="">
  24. </image>
  25. </view>
  26. <view class="text">
  27. 批量操作
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 区域筛选 -->
  32. <view class="contented" :style="{'height':(h-mt)+'px'}" v-show="areaShow">
  33. <view class="custom_popup">
  34. <view class="types">
  35. <view class="pricequjian" style="height: 240rpx;">
  36. <view class="jiage" v-for="(item, index) in list1" :key="index"
  37. @click="clickareaShow(item, index)">
  38. <view class="contentpeice">
  39. <view class="title" :class="{'Doublactive': areaShowIndex == index}">
  40. {{item.name}}
  41. </view>
  42. <view class="image" v-if="areaShowIndex == index">
  43. <image
  44. src="https://i.ringzle.com/file/20240316/16dd69efb40242de83da8207539ec73e.png"
  45. mode=""></image>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 房型选择 -->
  55. <view class="type" v-for="item,index in roomType" :key="index">
  56. <view class="left" v-if="Selected==true">
  57. <view class="image">
  58. <image @tap="selectPerson()"
  59. :src="isSelect?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  60. </image>
  61. </view>
  62. </view>
  63. <!-- <view @click="goEditTypeInfo(item.houseBaseId)" style="width: 100%;"> -->
  64. <view style="width: 100%;">
  65. <view class="right">
  66. <view class="right-left">
  67. <image :src="item.cover" mode=""></image>
  68. </view>
  69. <view class="right-right">
  70. <view class="top">
  71. <text style="font-size: 30rpx; color: #333;">{{item.comboName}}</text>
  72. </view>
  73. <view class="under">
  74. <view style="font-size: 24rpx; color: #777;">销量:{{item.saleNums}}</view>
  75. <view style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  76. ¥{{item.price}}</view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="type-btn">
  81. <view class="type-btn-left">
  82. </view>
  83. <view class="type-btn-right">
  84. <view class="" @click="del(item)">
  85. 删除
  86. </view>
  87. <view class="">
  88. 改价格
  89. </view>
  90. <view class="">
  91. 下架
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 批量按钮 -->
  98. <view class="btn-btn" v-if="Selected==true">
  99. <view class="bottom-btn">
  100. <view class="left">
  101. <view class="image">
  102. <image @tap="selectPerson()"
  103. :src="isSelect?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  104. </image>
  105. </view>
  106. <view class="text">
  107. 已选:1
  108. </view>
  109. </view>
  110. <view class="right">
  111. <view class="right-btn">
  112. 批量下架
  113. </view>
  114. <view class="right-btn" @click="Pricing()">
  115. 批量定价
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <!-- 新增按钮 -->
  121. <view class="btn-btn" @click="addType(id)" v-else>
  122. <view class="btn">
  123. 添加商品
  124. </view>
  125. </view>
  126. <u-popup :show="showPricing" @close="close" @open="open">
  127. <view class="pop-pop">
  128. </view>
  129. </u-popup>
  130. <view class="mainContain">
  131. <!-- <view class="nodata" v-if='dataList.length==0'>
  132. <NoData></NoData>
  133. </view> -->
  134. </view>
  135. </view>
  136. </template>
  137. <script>
  138. import TopTabs from '@/components/TopTabs/topTabs.vue';
  139. // import NoData from '../../components/NoData/index.vue';
  140. export default {
  141. components: {
  142. TopTabs,
  143. // NoData
  144. },
  145. data() {
  146. return {
  147. h: uni.getSystemInfoSync().windowHeight,
  148. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  149. current: 0,
  150. tabList: [{
  151. name: '出售中'
  152. },
  153. {
  154. name: '待上架'
  155. },
  156. ],
  157. homestayId: uni.getStorageSync('homestayId') || 0,
  158. roomType: [],
  159. isSelect: false,
  160. Selected: false,
  161. showPricing: false,
  162. areaShow: false,
  163. list1: [{
  164. name: '创建时间'
  165. },
  166. {
  167. name: '上架时间'
  168. },
  169. {
  170. name: '价格从高到低'
  171. },
  172. {
  173. name: '价格从低到高'
  174. },
  175. // {
  176. // name: '销量从高到低'
  177. // },
  178. ],
  179. areaShowIndex: null,
  180. fromData: {
  181. homestayId: uni.getStorageSync('homestayId'),
  182. limit: 10,
  183. page: 1,
  184. order: '',
  185. orderField: "",
  186. status: 1
  187. }
  188. }
  189. },
  190. onLoad(option) {
  191. console.log(option);
  192. // if (uni.getStorageSync('merchantType') == 4) {
  193. this.getRepast()
  194. // } else {
  195. // }
  196. },
  197. methods: {
  198. del(item) {
  199. let ids = []
  200. ids.push(item.id)
  201. this.$api.del('/merchant/hotel/repast', ids).then(res => {
  202. console.log(res);
  203. if (res.data.code == 0) {
  204. this.getRepast()
  205. } else this.$showToast(res.data.msg);
  206. })
  207. },
  208. getRepast() {
  209. this.$api.get('/merchant/hotel/repast/page', this.fromData).then(res => {
  210. console.log(res);
  211. this.roomType = res.data.data.list
  212. })
  213. },
  214. // 区域筛选
  215. clickareaShow(e, i) {
  216. console.log('111111111111111111', e, i)
  217. this.areaShowIndex = i
  218. },
  219. // 上架时间
  220. areaShowed() {
  221. console.log(123);
  222. this.areaShow = !this.areaShow
  223. },
  224. changeTab1(index) {
  225. console.log(index);
  226. this.current = index;
  227. if (index == 0) {
  228. this.fromData.status = 1
  229. this.getRepast()
  230. } else {
  231. this.fromData.status = 0
  232. this.getRepast()
  233. }
  234. },
  235. // 批量显示
  236. showList() {
  237. this.Selected = !this.Selected
  238. },
  239. }
  240. }
  241. </script>
  242. <style lang="scss" scoped>
  243. .Doublactive {
  244. // background-color: #F0F7F6 !important;
  245. color: #007A69 !important;
  246. // border: 1px solid #007A69 !important;
  247. }
  248. .contented {
  249. width: 100%;
  250. padding: 0 24rpx;
  251. box-sizing: border-box;
  252. position: relative;
  253. }
  254. .custom_popup {
  255. width: 100%;
  256. height: 100%;
  257. background: rgba(0, 0, 0, .4);
  258. top: 0;
  259. left: 0;
  260. position: absolute;
  261. z-index: 999;
  262. .types {
  263. width: 100%;
  264. padding: 30rpx 30rpx 56rpx;
  265. box-sizing: border-box;
  266. background: #FFFFFF;
  267. .pricequjian {
  268. width: 100%;
  269. .contentpeice {
  270. width: 100%;
  271. display: flex;
  272. justify-content: space-between;
  273. margin: 15rpx 0;
  274. .title {
  275. font-weight: Regular;
  276. font-size: 28rpx;
  277. color: #333333;
  278. }
  279. .image {
  280. width: 28rpx;
  281. height: 20rpx;
  282. image {
  283. width: 100%;
  284. height: 100%;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. }
  291. .pages {
  292. background: #F5F8FA;
  293. box-sizing: border-box;
  294. .tb {
  295. width: 100%;
  296. top: 0;
  297. left: 0;
  298. z-index: 999;
  299. .searchBoxParent {
  300. width: 100%;
  301. background: #fff;
  302. padding: 20rpx 24rpx 6rpx;
  303. box-sizing: border-box;
  304. .searchBox {
  305. width: 100%;
  306. background-color: #fff;
  307. }
  308. }
  309. .tabs {
  310. background: #fff;
  311. padding: 26rpx 0;
  312. display: flex;
  313. align-items: center;
  314. width: 100%;
  315. &>view {
  316. width: 25%;
  317. font-size: 28rpx;
  318. font-family: PingFangSC-Regular, PingFang SC;
  319. font-weight: 400;
  320. color: black;
  321. line-height: 40rpx;
  322. position: relative;
  323. text-align: center;
  324. }
  325. .active {
  326. font-size: 32rpx;
  327. font-family: PingFang-SC-Bold, PingFang-SC;
  328. font-weight: bold;
  329. color: black;
  330. line-height: 45rpx;
  331. }
  332. .active::after {
  333. position: absolute;
  334. content: '';
  335. width: 50rpx;
  336. height: 8rpx;
  337. background: #007A69;
  338. bottom: -26rpx;
  339. left: 60%;
  340. margin-left: -42rpx;
  341. }
  342. }
  343. }
  344. .green {}
  345. .mainContain {
  346. display: flex;
  347. flex-direction: column;
  348. padding: 0 20rpx;
  349. .nodata {
  350. background: white;
  351. }
  352. .card {
  353. background: #fff;
  354. border-radius: 16rpx;
  355. margin: 20rpx 0;
  356. padding: 20rpx;
  357. .header {
  358. display: flex;
  359. justify-content: space-between;
  360. border-bottom: 1px #f3f3f3 solid;
  361. padding: 20rpx;
  362. .red {
  363. color: indianred;
  364. }
  365. .green {
  366. color: #999999;
  367. }
  368. .blue {
  369. color: #1372FF;
  370. }
  371. .grey {
  372. color: #4C5F76;
  373. }
  374. .orange {
  375. color: #FF9100;
  376. }
  377. }
  378. .mainContent {
  379. // border-bottom: 1px #f3f3f3 solid;
  380. display: flex;
  381. padding: 20rpx 0;
  382. // justify-content: space-evenly;
  383. .image {
  384. background-repeat: no-repeat;
  385. background-size: cover;
  386. width: 198rpx;
  387. height: 180rpx;
  388. border-radius: 16rpx;
  389. }
  390. .middle {
  391. padding-top: 16rpx;
  392. color: #777777;
  393. // display: flex;
  394. // flex-direction: column;
  395. // justify-content: space-between;
  396. margin-left: 25rpx;
  397. width: 100%;
  398. .title {
  399. font-weight: 700;
  400. font-size: 32rpx;
  401. color: black;
  402. }
  403. .info {
  404. padding-top: 30rpx;
  405. color: #777777;
  406. // display: flex;
  407. // flex-direction: column;
  408. &>span {
  409. margin-top: 10rpx;
  410. }
  411. }
  412. }
  413. .price {
  414. color: red;
  415. text-align: center;
  416. height: 100%;
  417. align-items: center;
  418. align-self: center;
  419. font-size: 29rpx;
  420. font-weight: 700;
  421. }
  422. }
  423. .bottom {
  424. // padding: 30rpx 20rpx;
  425. display: flex;
  426. justify-content: flex-end;
  427. .detail {
  428. // border: 1rpx solid darkgrey;
  429. border-radius: 16rpx;
  430. color: darkgrey;
  431. padding: 13rpx 34rpx;
  432. background-color: #F6F6F6;
  433. font-size: 26rpx;
  434. color: #333333;
  435. font-weight: Regular;
  436. }
  437. .del {
  438. border-radius: 16rpx;
  439. color: darkgrey;
  440. padding: 13rpx 34rpx;
  441. background-color: #007A69;
  442. font-size: 26rpx;
  443. color: #fff;
  444. font-weight: Regular;
  445. }
  446. }
  447. }
  448. }
  449. }
  450. .u-input__content {
  451. margin-top: 22rpx !important;
  452. }
  453. .uicon-arrow-right,
  454. .uicon-close-circle-fill {
  455. margin-top: 32rpx !important;
  456. margin-right: 20rpx !important;
  457. }
  458. .pop-pop {
  459. height: 65vh;
  460. padding: 46rpx 20rpx 0;
  461. .hander-one {
  462. display: flex;
  463. justify-content: space-between;
  464. .text {
  465. font-size: 36rpx;
  466. color: #333333;
  467. font-weight: bold;
  468. }
  469. .del {}
  470. }
  471. .hander-two {
  472. display: flex;
  473. align-items: center;
  474. margin: 30rpx 0;
  475. .hander-two-text {
  476. font-size: 30rpx;
  477. color: #333333;
  478. font-weight: Regular;
  479. }
  480. .hander-two-image {
  481. display: flex;
  482. align-items: center;
  483. .image {
  484. margin: 0 10rpx;
  485. width: 30rpx;
  486. height: 30rpx;
  487. image {
  488. width: 100%;
  489. height: 100%;
  490. }
  491. }
  492. }
  493. }
  494. .hander-three {
  495. display: flex;
  496. border: 1rpx solid #CCCCCC;
  497. border-radius: 16rpx;
  498. justify-content: space-between;
  499. height: 102rpx;
  500. line-height: 102rpx;
  501. .hander-three-text {
  502. width: 200rpx;
  503. text-align: left;
  504. display: flex;
  505. justify-content: space-between;
  506. margin: 0 20rpx;
  507. }
  508. .hander-three-input {
  509. width: 55%;
  510. }
  511. .hander-three-icon {
  512. height: 102rpx;
  513. line-height: 102rpx;
  514. }
  515. }
  516. .hander-four {
  517. margin-top: 30rpx;
  518. display: flex;
  519. border-radius: 16rpx;
  520. justify-content: space-between;
  521. border: 1rpx solid #CCCCCC;
  522. height: 102rpx;
  523. line-height: 102rpx;
  524. .hander-three-text {
  525. width: 200rpx;
  526. text-align: center;
  527. display: flex;
  528. justify-content: space-between;
  529. margin: 0 20rpx;
  530. }
  531. .hander-three-input {
  532. width: 55%;
  533. }
  534. .hander-three-icon {
  535. height: 102rpx;
  536. line-height: 102rpx;
  537. }
  538. }
  539. }
  540. .page {
  541. background: #F3F4F4;
  542. padding-bottom: 260rpx;
  543. box-sizing: border-box;
  544. overflow-y: auto;
  545. overflow-x: auto;
  546. }
  547. .typeNum {
  548. // width: 100%;
  549. height: 73rpx;
  550. display: flex;
  551. justify-content: space-between;
  552. padding: 23rpx 24rpx;
  553. align-items: center;
  554. .left {
  555. display: flex;
  556. align-items: center;
  557. .active {
  558. color: #007A69;
  559. }
  560. }
  561. .right {
  562. display: flex;
  563. align-items: center;
  564. .image {
  565. margin: 0 10rpx;
  566. width: 30rpx;
  567. height: 30rpx;
  568. image {
  569. width: 100%;
  570. height: 100%;
  571. }
  572. }
  573. .text {
  574. font-size: 28rpx;
  575. font-weight: Regular;
  576. color: #333333;
  577. }
  578. }
  579. }
  580. .type {
  581. margin: 0 auto;
  582. border-radius: 10rpx 10rpx 10rpx 10rpx;
  583. width: 86%;
  584. // height: 114rpx;
  585. background-color: #fff;
  586. padding: 30rpx;
  587. margin-bottom: 20rpx;
  588. display: flex;
  589. .left {
  590. height: 114rpx;
  591. line-height: 200rpx;
  592. margin-right: 20rpx;
  593. .image {
  594. margin: 0 10rpx;
  595. width: 30rpx;
  596. height: 30rpx;
  597. image {
  598. width: 100%;
  599. height: 100%;
  600. }
  601. }
  602. }
  603. .right {
  604. width: 100%;
  605. display: flex;
  606. .right-left {
  607. width: 172rpx;
  608. height: 172rpx;
  609. border-radius: 16rpx;
  610. margin-right: 22rpx;
  611. image {
  612. width: 100%;
  613. height: 100%;
  614. border-radius: 16rpx;
  615. }
  616. }
  617. .right-right {}
  618. }
  619. .type-btn {
  620. width: 100%;
  621. display: flex;
  622. justify-content: space-between;
  623. .type-btn-left {
  624. width: 50rpx;
  625. }
  626. .type-btn-right {
  627. display: flex;
  628. view {
  629. padding: 15rpx 23rpx;
  630. background-color: #F6F6F6;
  631. font-size: 24rpx;
  632. color: #333;
  633. font-weight: Regular;
  634. margin-right: 20rpx;
  635. border-radius: 50rpx;
  636. }
  637. }
  638. }
  639. }
  640. .top {
  641. display: flex;
  642. justify-content: space-between;
  643. }
  644. .under {
  645. margin-top: 20rpx;
  646. // display: flex;
  647. // justify-content: space-between;
  648. }
  649. .btn-btn {
  650. width: 100%;
  651. height: 136rpx;
  652. background-color: #fff;
  653. position: fixed;
  654. bottom: 0;
  655. padding: 30rpx 0 0;
  656. // margin: 0 auto;
  657. z-index: 9;
  658. // margin-top: 30rpx;
  659. // margin-left: 30rpx;
  660. .bottom-btn {
  661. display: flex;
  662. justify-content: space-between;
  663. margin: 0 24rpx;
  664. .left {
  665. width: 25%;
  666. display: flex;
  667. align-items: center;
  668. .image {
  669. width: 38rpx;
  670. height: 38rpx;
  671. margin: 0 10rpx;
  672. image {
  673. width: 100%;
  674. height: 100%;
  675. }
  676. }
  677. }
  678. .right {
  679. width: 75%;
  680. display: flex;
  681. justify-content: space-evenly;
  682. .right-btn {
  683. width: 148rpx;
  684. height: 80rpx;
  685. line-height: 80rpx;
  686. background-color: #1372FF;
  687. border-radius: 16rpx;
  688. font-size: 26rpx;
  689. color: #fff;
  690. font-weight: Regular;
  691. text-align: center;
  692. }
  693. }
  694. }
  695. }
  696. .btn {
  697. margin: 0 auto;
  698. width: 690rpx;
  699. height: 96rpx;
  700. background-color: #1372FF;
  701. color: #fff;
  702. display: flex;
  703. justify-content: center;
  704. align-items: center;
  705. font-size: 34rpx;
  706. border-radius: 48rpx;
  707. }
  708. </style>