cm-order-drawer.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. manager: 0,
  62. leaderId: 0,
  63. height: 0,
  64. drawerH: 0, // 抽屉内部scrollview高度
  65. categorys: [],
  66. checkedCategorysList: [],
  67. actionsText: '',
  68. queryData: {
  69. serviceProviderId: 0
  70. },
  71. sellerActions: []
  72. }
  73. },
  74. created() {
  75. this.SetScrollHeight()
  76. this.userSellerServiceTeam()
  77. },
  78. computed: {},
  79. methods: {
  80. async userSellerServiceTeam() {
  81. //获取组员协销列表
  82. const userInfo = await this.$api.getStorage()
  83. this.SellerService.userSellerServiceTeam({ spId: userInfo.serviceProviderId })
  84. .then(response => {
  85. this.sellerActions = response.data
  86. })
  87. .catch(error => {
  88. console.log('=========>获取组员协销列表异常')
  89. })
  90. },
  91. bindPickerChange(type, e) {
  92. //选择筛选条件
  93. switch (type) {
  94. case 1:
  95. this.actionsText = this.sellerActions[e.target.value].name
  96. this.queryData.serviceProviderId = this.sellerActions[e.target.value].serviceProviderId
  97. break
  98. }
  99. },
  100. closeDrawer() {
  101. this.$parent.rightDrawer = false
  102. },
  103. handSearchConfirm() {
  104. //确定筛选
  105. this.$emit('handSearchConfirm', this.queryData)
  106. this.$parent.rightDrawer = false
  107. },
  108. SetScrollHeight() {
  109. let obj = {}
  110. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  111. uni.getSystemInfo({
  112. success: res => {
  113. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  114. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  115. }
  116. })
  117. this.windowHeight = windowHeight - 1
  118. this.scrollHeight = windowHeight - 1
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. /*screen*/
  125. .drawer-container {
  126. width: 580rpx;
  127. height: 100%;
  128. padding: 80rpx 0;
  129. overflow: hidden;
  130. box-sizing: border-box;
  131. background-color: #ffffff;
  132. .drawer-title {
  133. width: 100%;
  134. height: 72rpx;
  135. line-height: 72rpx;
  136. box-sizing: border-box;
  137. padding: 0 30rpx;
  138. float: left;
  139. background-color: #f7f7f7;
  140. font-size: $font-size-26;
  141. color: #333333;
  142. font-weight: bold;
  143. text-align: left;
  144. }
  145. .drawer-main {
  146. width: 100%;
  147. height: auto;
  148. box-sizing: border-box;
  149. float: left;
  150. .drawer-main-name {
  151. width: 100%;
  152. height: 80rpx;
  153. line-height: 80rpx;
  154. text-align: left;
  155. font-size: $font-size-26;
  156. color: #333333;
  157. box-sizing: border-box;
  158. padding: 0 20rpx;
  159. font-weight: bold;
  160. }
  161. .drawer-main-radiov {
  162. width: 100%;
  163. height: auto;
  164. box-sizing: border-box;
  165. padding: 0 20rpx;
  166. .drawer-main-radio {
  167. width: 100%;
  168. height: 80rpx;
  169. box-sizing: border-box;
  170. padding: 0 10rpx;
  171. border: 1px solid rgba(0, 0, 0, 0.2);
  172. border-radius: 6rpx;
  173. margin-bottom: 30rpx;
  174. position: relative;
  175. &.btn {
  176. border: none;
  177. margin-top: 40rpx;
  178. }
  179. .input {
  180. width: 100%;
  181. height: 80rpx;
  182. line-height: 80rpx;
  183. float: left;
  184. box-sizing: border-box;
  185. font-size: $font-size-24;
  186. color: #333333;
  187. padding: 0 10rpx;
  188. padding-right: 68rpx;
  189. }
  190. .iconfont {
  191. width: 50rpx;
  192. height: 80rpx;
  193. display: block;
  194. line-height: 80rpx;
  195. text-align: center;
  196. font-size: 30rpx;
  197. color: #999999;
  198. position: absolute;
  199. right: 0;
  200. top: 0;
  201. }
  202. }
  203. }
  204. }
  205. .drawer-input {
  206. width: 100%;
  207. float: left;
  208. box-sizing: border-box;
  209. padding: 24rpx 10rpx 0 10rpx;
  210. border: 1px solid rgba(0, 0, 0, 0.2);
  211. border-radius: 4rpx;
  212. position: relative;
  213. background-color: #ffffff;
  214. &.btn {
  215. border: none;
  216. display: flex;
  217. position: fixed;
  218. left: 0;
  219. bottom: 0;
  220. }
  221. .drawer-btn {
  222. width: 210rpx;
  223. height: 84rpx;
  224. border-radius: 42rpx;
  225. background: $btn-confirm;
  226. line-height: 84rpx;
  227. text-align: center;
  228. font-size: $font-size-26;
  229. color: #ffffff;
  230. flex: 1;
  231. margin: 0 10rpx;
  232. &.comfrim {
  233. background: $btn-confirm;
  234. }
  235. &.clear {
  236. background: #ffe6dc;
  237. color: $color-system;
  238. }
  239. }
  240. }
  241. }
  242. </style>