cm-club-drawer.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="drawer-content">
  3. <!--右抽屉-->
  4. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  5. <view
  6. class="drawer-container clearfix"
  7. scroll-y
  8. :style="{
  9. paddingTop: CustomBar - StatusBar + 8 + 'px',
  10. paddingBottom: isIphoneX ? '180rpx' : '146rpx'
  11. }"
  12. >
  13. <scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
  14. <view class="drawer-title">更多筛选</view>
  15. <view class="drawer-main">
  16. <view class="drawer-main-name">组员:</view>
  17. <view class="drawer-main-radiov">
  18. <view class="drawer-main-radio">
  19. <picker
  20. @change="bindPickerChange(1, $event)"
  21. :value="index"
  22. :range="sellerActions"
  23. range-key="name"
  24. >
  25. <input
  26. class="input"
  27. type="text"
  28. disabled="false"
  29. v-model="actionsText"
  30. value=""
  31. placeholder="请选择"
  32. />
  33. <text class="iconfont icon-xiangyou"></text>
  34. </picker>
  35. </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  40. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  41. <view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
  42. </view>
  43. </view>
  44. </tui-drawer>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. name: 'rightDrawer',
  50. props: {
  51. rightDrawer: {
  52. type: Boolean,
  53. default: false
  54. }
  55. },
  56. data() {
  57. return {
  58. CustomBar: this.CustomBar, // 顶部导航栏高度
  59. StatusBar: this.StatusBar,
  60. isIphoneX: this.$store.state.isIphoneX,
  61. height: 0,
  62. drawerH: 0, // 抽屉内部scrollview高度
  63. categorys: [],
  64. checkedCategorysList: [],
  65. actionsText: '',
  66. queryData: {
  67. serviceProviderId: 0,
  68. },
  69. sellerActions: []
  70. }
  71. },
  72. created() {
  73. this.SetScrollHeight()
  74. this.userSellerServiceTeam()
  75. },
  76. computed: {},
  77. methods: {
  78. async userSellerServiceTeam() {
  79. //获取组员协销列表
  80. const userInfo = await this.$api.getStorage()
  81. this.SellerService.userSellerServiceTeam({ spId: userInfo.serviceProviderId })
  82. .then(response => {
  83. this.sellerActions = response.data
  84. })
  85. .catch(error => {
  86. console.log('=========>获取组员协销列表异常')
  87. })
  88. },
  89. bindPickerChange(type, e) {
  90. //选择筛选条件
  91. switch (type) {
  92. case 1:
  93. this.actionsText = this.sellerActions[e.target.value].name
  94. this.queryData.serviceProviderId = this.sellerActions[e.target.value].serviceProviderId
  95. break
  96. }
  97. },
  98. closeDrawer() {
  99. this.$parent.rightDrawer = false
  100. },
  101. handSearchConfirm() {
  102. //确定筛选
  103. this.$emit('handSearchConfirm', this.queryData)
  104. this.$parent.rightDrawer = false
  105. },
  106. SetScrollHeight() {
  107. let obj = {}
  108. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  109. uni.getSystemInfo({
  110. success: res => {
  111. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  112. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  113. }
  114. })
  115. this.windowHeight = windowHeight - 1
  116. this.scrollHeight = windowHeight - 1
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. /*screen*/
  123. .drawer-container {
  124. width: 580rpx;
  125. height: 100%;
  126. padding: 80rpx 0;
  127. overflow: hidden;
  128. box-sizing: border-box;
  129. background-color: #ffffff;
  130. .drawer-title {
  131. width: 100%;
  132. height: 72rpx;
  133. line-height: 72rpx;
  134. box-sizing: border-box;
  135. padding: 0 30rpx;
  136. float: left;
  137. background-color: #f7f7f7;
  138. font-size: $font-size-26;
  139. color: #333333;
  140. font-weight: bold;
  141. text-align: left;
  142. }
  143. .drawer-main {
  144. width: 100%;
  145. height: auto;
  146. box-sizing: border-box;
  147. float: left;
  148. .drawer-main-name {
  149. width: 100%;
  150. height: 80rpx;
  151. line-height: 80rpx;
  152. text-align: left;
  153. font-size: $font-size-26;
  154. color: #333333;
  155. box-sizing: border-box;
  156. padding: 0 20rpx;
  157. font-weight: bold;
  158. }
  159. .drawer-main-radiov {
  160. width: 100%;
  161. height: auto;
  162. box-sizing: border-box;
  163. padding: 0 20rpx;
  164. .drawer-main-radio {
  165. width: 100%;
  166. height: 80rpx;
  167. box-sizing: border-box;
  168. padding: 0 10rpx;
  169. border: 1px solid rgba(0, 0, 0, 0.2);
  170. border-radius: 6rpx;
  171. margin-bottom: 30rpx;
  172. position: relative;
  173. &.btn {
  174. border: none;
  175. margin-top: 40rpx;
  176. }
  177. .input {
  178. width: 100%;
  179. height: 80rpx;
  180. line-height: 80rpx;
  181. float: left;
  182. box-sizing: border-box;
  183. font-size: $font-size-24;
  184. color: #333333;
  185. padding: 0 10rpx;
  186. padding-right: 68rpx;
  187. }
  188. .iconfont {
  189. width: 50rpx;
  190. height: 80rpx;
  191. display: block;
  192. line-height: 80rpx;
  193. text-align: center;
  194. font-size: 30rpx;
  195. color: #999999;
  196. position: absolute;
  197. right: 0;
  198. top: 0;
  199. }
  200. }
  201. }
  202. }
  203. .drawer-input {
  204. width: 100%;
  205. float: left;
  206. box-sizing: border-box;
  207. padding: 24rpx 10rpx 0 10rpx;
  208. border: 1px solid rgba(0, 0, 0, 0.2);
  209. border-radius: 4rpx;
  210. position: relative;
  211. background-color: #ffffff;
  212. &.btn {
  213. border: none;
  214. display: flex;
  215. position: fixed;
  216. left: 0;
  217. bottom: 0;
  218. }
  219. .drawer-btn {
  220. width: 210rpx;
  221. height: 84rpx;
  222. border-radius: 42rpx;
  223. background: $btn-confirm;
  224. line-height: 84rpx;
  225. text-align: center;
  226. font-size: $font-size-26;
  227. color: #ffffff;
  228. flex: 1;
  229. margin: 0 10rpx;
  230. &.comfrim {
  231. background: $btn-confirm;
  232. }
  233. &.clear {
  234. background: #ffe6dc;
  235. color: $color-system;
  236. }
  237. }
  238. }
  239. }
  240. </style>