index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <view class="right-wrapper" @touchmove.stop.prevent="moveStop">
  3. <view class="control-wrapper">
  4. <view class="content-box">
  5. <view class="acea-row row-between">
  6. <view class="title">店铺类型</view>
  7. <view class="btns" v-if="!isShow && merchantType.length>9" @click="isShow = true">展开全部<text class="iconfont icon-xiangxia"></text></view>
  8. <view class="btns" v-if="isShow && merchantType.length>9" @click="isShow = false">收起<text class="iconfont icon-xiangshang"></text></view>
  9. </view>
  10. <view class="brand-wrapper">
  11. <scroll-view :style="{'height':isShow?'100%':'250rpx'}" :scroll-y="isShow">
  12. <view class="wrapper">
  13. <view class="item line1" v-for="(item,index) in merchantType" :key="index" :class="activeIndex === index ? 'on' : ' '" @tap="bindChenck1(index)">
  14. {{item.name}}
  15. </view>
  16. </view>
  17. </scroll-view>
  18. </view>
  19. <view class="acea-row row-between">
  20. <view class="title">商户分类</view>
  21. <view class="btns" v-if="!isShowCate && merchantClassify.length>8" @click="isShowCate = true">展开全部<text class="iconfont icon-xiangxia"></text></view>
  22. <view class="btns" v-if="isShowCate && merchantClassify.length>8" @click="isShowCate = false">收起<text class="iconfont icon-xiangshang"></text></view>
  23. </view>
  24. <view class="brand-wrapper">
  25. <scroll-view :style="{'height':isShowCate?'100%':'250rpx'}" :scroll-y="isShowCate">
  26. <view class="wrapper">
  27. <view class="item line1" v-for="(item,index) in merchantClassify" :key="index" :class="activeIndex2 === index ? 'on' : ' '" @tap="bindChenck2(index)">
  28. {{item.name}}
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. <view class="foot-btn">
  34. <view class="btn-item" @click="reset">重置</view>
  35. <view class="btn-item confirm" @click="confirm">确定</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="right-bg" @click="close"></view>
  40. </view>
  41. </template>
  42. <script>
  43. // +----------------------------------------------------------------------
  44. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  45. // +----------------------------------------------------------------------
  46. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  47. // +----------------------------------------------------------------------
  48. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  49. // +----------------------------------------------------------------------
  50. // | Author: CRMEB Team <admin@crmeb.com>
  51. // +----------------------------------------------------------------------
  52. import { mapGetters } from "vuex";
  53. export default{
  54. computed: mapGetters(["merchantClassify", "merchantType"]),
  55. props:{
  56. whereMer:{
  57. type:Object,
  58. default:function(){
  59. return {}
  60. }
  61. }
  62. },
  63. data(){
  64. return {
  65. min: '',
  66. max:'',
  67. isShow:false,
  68. isShowCate: false,
  69. list:[],
  70. merCate: [],
  71. activeList:[],
  72. selectList: [],
  73. activeIndex: null,
  74. activeIndex2: null
  75. }
  76. },
  77. watch:{
  78. whereMer:{
  79. handler:function(newV,oldV){
  80. if(newV){
  81. this.typeId = this.whereMer.typeIds;
  82. this.categoryId = this.whereMer.categoryIds;
  83. if(this.typeId == '') this.activeIndex =null;
  84. if(this.categoryId == '') this.activeIndex2 =null;
  85. }
  86. },
  87. deep:true
  88. }
  89. },
  90. methods:{
  91. bindChenck1(index){
  92. this.activeIndex = index
  93. this.typeId = this.merchantType[index].id
  94. },
  95. bindChenck2(index){
  96. this.activeIndex2 = index
  97. this.categoryId = this.merchantClassify[index].id
  98. },
  99. reset(){
  100. this.activeIndex = null
  101. this.activeIndex2 = null
  102. this.typeId = ''
  103. this.categoryId = ''
  104. },
  105. confirm(){
  106. let obj = {
  107. typeId:this.typeId,
  108. categoryId: this.categoryId
  109. }
  110. this.$emit('confirm',obj)
  111. },
  112. close(){
  113. this.$emit('close')
  114. },
  115. moveStop(){}
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .right-wrapper{
  121. width: 650rpx;
  122. background: #FFFFFF;
  123. padding: 15px 0 0 15px;
  124. box-sizing: border-box;
  125. height: 100%;
  126. .control-wrapper{
  127. z-index: 90;
  128. position: absolute;
  129. right: 0;
  130. top: 0;
  131. display: flex;
  132. flex-direction: column;
  133. width: 650rpx;
  134. height: 100%;
  135. background-color: #F5F5F5;
  136. .btns{
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. padding-top: 10rpx;
  141. font-size: 22rpx;
  142. color: #999;
  143. .iconfont{
  144. margin-left: 10rpx;
  145. margin-top: 5rpx;
  146. font-size: 20rpx;
  147. }
  148. }
  149. .header{
  150. padding: 50rpx 26rpx 40rpx;
  151. background-color: #fff;
  152. .title{
  153. font-size: 26rpx;
  154. font-weight: bold;
  155. color: #282828;
  156. }
  157. .input-wrapper{
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-between;
  161. margin-top: 28rpx;
  162. input{
  163. width:260rpx;
  164. height:56rpx;
  165. padding: 0 10rpx;
  166. background:rgba(242,242,242,1);
  167. border-radius:28rpx;
  168. font-size: 22rpx;
  169. text-align: center;
  170. }
  171. .line{
  172. width:15rpx;
  173. height:2rpx;
  174. background:#7D7D7D;
  175. }
  176. }
  177. }
  178. .content-box{
  179. position: relative;
  180. flex: 1;
  181. display: flex;
  182. flex-direction: column;
  183. padding: 0 26rpx;
  184. background-color: #fff;
  185. overflow: hidden;
  186. .title{
  187. padding: 54rpx 0 20rpx;
  188. font-size: 26rpx;
  189. font-weight: bold;
  190. color: #282828;
  191. }
  192. .brand-wrapper{
  193. // flex: 1;
  194. overflow: hidden;
  195. padding-bottom: 100rpx;
  196. .wrapper{
  197. display: flex;
  198. flex-wrap: wrap;
  199. padding-bottom: 20rpx;
  200. }
  201. .item{
  202. display: block;
  203. width:186rpx;
  204. height:56rpx;
  205. line-height: 56rpx;
  206. text-align: center;
  207. background:rgba(242,242,242,1);
  208. border-radius:28rpx;
  209. margin-top: 25rpx;
  210. padding: 0 10rpx;
  211. margin-right: 12rpx;
  212. &:nth-child(3n){
  213. margin-right: 0;
  214. }
  215. &.on{
  216. @include main_color(theme);
  217. @include coupons_border_color(theme);
  218. }
  219. }
  220. }
  221. .foot-btn{
  222. display: flex;
  223. align-items: center;
  224. justify-content: space-between;
  225. position: absolute;
  226. // width: 100%;
  227. // text-align: center;
  228. bottom: 30rpx;
  229. .btn-item{
  230. display: flex;
  231. align-items: center;
  232. justify-content: center;
  233. width:286rpx;
  234. height:68rpx;
  235. background:rgba(255,255,255,1);
  236. border:1px solid rgba(170,170,170,1);
  237. border-radius:34rpx;
  238. font-size: 26rpx;
  239. color: #282828;
  240. &.confirm{
  241. @include main_bg_color(theme);
  242. @include coupons_border_color(theme);
  243. color: #fff;
  244. margin-left: 20rpx;
  245. }
  246. }
  247. }
  248. }
  249. }
  250. .right-bg{
  251. // position: absolute;
  252. // left: 0;
  253. // top: 0;
  254. width: 100%;
  255. height: 100%;
  256. background-color: rgba(0,0,0,.5);
  257. }
  258. }
  259. </style>