cm-club-drawer.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  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. <template v-if="isManage">
  17. <view class="drawer-main-name">组员:</view>
  18. <view class="drawer-main-radiov">
  19. <view class="drawer-main-radio">
  20. <picker
  21. @change="bindPickerChange(1, $event)"
  22. :value="index"
  23. :range="sellerActions"
  24. range-key="name"
  25. >
  26. <input
  27. class="input"
  28. type="text"
  29. disabled="false"
  30. v-model="actionsText"
  31. value=""
  32. placeholder="请选择"
  33. />
  34. <text class="iconfont icon-xiangyou"></text>
  35. </picker>
  36. </view>
  37. </view>
  38. </template>
  39. <template v-else>
  40. <view class="drawer-main-name">客户分配日期</view>
  41. <view class="drawer-main-time">
  42. <view class="drawer-main-time-input">
  43. <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange">
  44. <text class="input-text">{{ queryData.startTime }}</text>
  45. </picker>
  46. <text class="iconfont icon-riqi"></text>
  47. </view>
  48. <view class="line">-</view>
  49. <view class="drawer-main-time-input">
  50. <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindEndDateChange">
  51. <text class="input-text">{{ queryData.endTime }}</text>
  52. </picker>
  53. <text class="iconfont icon-riqi"></text>
  54. </view>
  55. </view>
  56. <view class="drawer-main-name">机构类型:</view>
  57. <view class="drawer-main-radiov">
  58. <view class="drawer-main-radio">
  59. <picker @change="bindPickerChange(2,$event)" :value="index" :range="clubTypeActions" range-key="name">
  60. <input class="input" type="text" disabled="false" v-model="clubTypeText" value="" placeholder="请选择"/>
  61. <text class="iconfont icon-xiangyou"></text>
  62. </picker>
  63. </view>
  64. </view>
  65. <view class="drawer-main-name">升级状态<text class="small">(个人机构升级为资质机构)</text>:</view>
  66. <view class="drawer-main-radiov">
  67. <view class="drawer-main-radio">
  68. <picker @change="bindPickerChange(3,$event)" :value="index" :range="clubStatusActions" range-key="name">
  69. <input class="input" type="text" disabled="false" v-model="clubStatusText" value="" placeholder="请选择"/>
  70. <text class="iconfont icon-xiangyou"></text>
  71. </picker>
  72. </view>
  73. </view>
  74. <view class="drawer-main-name">活跃状态:</view>
  75. <view class="drawer-main-radiov">
  76. <view class="drawer-main-radio">
  77. <picker @change="bindPickerChange(4,$event)" :value="index" :range="clubActiveActions" range-key="name">
  78. <input class="input" type="text" disabled="false" v-model="clubActiveText" value="" placeholder="请选择"/>
  79. <text class="iconfont icon-xiangyou"></text>
  80. </picker>
  81. </view>
  82. </view>
  83. <view class="drawer-main-name">客户价值:</view>
  84. <view class="drawer-main-radiov">
  85. <view class="drawer-main-radio">
  86. <picker @change="bindPickerChange(5,$event)" :value="index" :range="customerValueActions" range-key="name">
  87. <input class="input" type="text" disabled="false" v-model="customerValueText" value="" placeholder="请选择"/>
  88. <text class="iconfont icon-xiangyou"></text>
  89. </picker>
  90. </view>
  91. </view>
  92. </template>
  93. </view>
  94. </scroll-view>
  95. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  96. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  97. <view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
  98. </view>
  99. </view>
  100. </tui-drawer>
  101. </view>
  102. </template>
  103. <script>
  104. import { mapState, mapMutations } from 'vuex'
  105. export default {
  106. name: 'rightDrawer',
  107. props: {
  108. rightDrawer: {
  109. type: Boolean,
  110. default: false
  111. }
  112. },
  113. data() {
  114. const currentDate = this.getDate({
  115. format: true
  116. })
  117. return {
  118. date: currentDate,
  119. CustomBar: this.CustomBar, // 顶部导航栏高度
  120. StatusBar: this.StatusBar,
  121. isIphoneX: this.$store.state.isIphoneX,
  122. height: 0,
  123. drawerH: 0, // 抽屉内部scrollview高度
  124. categorys: [],
  125. checkedCategorysList: [],
  126. actionsText: '',
  127. queryData: {
  128. startTime:'',
  129. endTime:'',
  130. serviceProviderId: 0
  131. },
  132. clubTypeActions:[
  133. {name:'个人机构',value:4},
  134. {name:'资质机构',value:2}
  135. ],
  136. clubStatusActions:[
  137. {name:'待升级',value:90},
  138. {name:'升级中',value:1},
  139. {name:'升级失败',value:92}
  140. ],
  141. clubActiveActions:[
  142. {name:'活跃用户',value:90},
  143. {name:'不活跃用户',value:1}
  144. ],
  145. customerValueActions:[
  146. {name:'高价值客户',value:90},
  147. {name:'一般价值客户',value:1},
  148. {name:'潜在价值客户',value:1},
  149. {name:'低价值客户',value:1}
  150. ],
  151. clubTypeText:'',
  152. clubStatusText:'',
  153. clubActiveText:'',
  154. customerValueText:'',
  155. sellerActions: []
  156. }
  157. },
  158. created() {
  159. this.setScrollHeight()
  160. if(this.isManage){
  161. this.userSellerServiceTeam()
  162. }
  163. },
  164. computed: {
  165. ...mapState(['isManage']),
  166. startDate() {
  167. return this.getDate('start')
  168. },
  169. endDate() {
  170. return this.getDate('end')
  171. }
  172. },
  173. methods: {
  174. async userSellerServiceTeam() {
  175. //获取组员协销列表
  176. try{
  177. const userInfo = await this.$api.getStorage()
  178. const res = await this.SellerService.userSellerServiceTeam({ spId: userInfo.serviceProviderId })
  179. this.sellerActions = res.data
  180. }catch(e){
  181. console.log('=========>获取组员协销列表异常')
  182. }
  183. },
  184. bindPickerChange(type, e) {
  185. //选择筛选条件
  186. switch (type) {
  187. case 1:
  188. this.actionsText = this.sellerActions[e.target.value].name
  189. this.queryData.serviceProviderId = this.sellerActions[e.target.value].serviceProviderId
  190. break
  191. case 2:
  192. this.clubTypeText = this.clubTypeActions[e.target.value].name
  193. this.queryData.userIdentity = this.clubTypeActions[e.target.value].value
  194. break
  195. case 3:
  196. this.clubStatusText = this.clubStatusActions[e.target.value].name
  197. this.queryData.status = this.clubStatusActions[e.target.value].value
  198. break
  199. case 4:
  200. this.clubActiveText = this.clubActiveActions[e.target.value].name
  201. // this.queryData.status = this.clubActiveActions[e.target.value].value
  202. break
  203. case 5:
  204. this.customerValueText = this.customerValueActions[e.target.value].name
  205. // this.queryData.status = this.customerValueActions[e.target.value].value
  206. break
  207. }
  208. },
  209. bindStartDateChange(event){
  210. //开始时间
  211. console.log('开始时间==>',event.detail.value)
  212. this.queryData.startTime = event.detail.value
  213. console.log('开始时间==>',this.queryData.startTime)
  214. },
  215. bindEndDateChange(event){
  216. //结束时间
  217. console.log('结束时间==>',event.detail.value)
  218. this.queryData.endTime = event.detail.value
  219. console.log('结束时间==>',this.queryData.endTime)
  220. },
  221. closeDrawer() {
  222. this.$parent.rightDrawer = false
  223. },
  224. handSearchConfirm() {
  225. //确定筛选
  226. this.$emit('handSearchConfirm', this.queryData)
  227. this.$parent.rightDrawer = false
  228. },
  229. setScrollHeight() {
  230. let obj = {}
  231. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  232. uni.getSystemInfo({
  233. success: res => {
  234. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  235. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  236. }
  237. })
  238. this.windowHeight = windowHeight - 1
  239. this.scrollHeight = windowHeight - 1
  240. },
  241. getDate(type) {
  242. const date = new Date()
  243. let year = date.getFullYear()
  244. let month = date.getMonth() + 1
  245. let day = date.getDate()
  246. if (type === 'start') {
  247. year = year - 1
  248. } else if (type === 'end') {
  249. year = year + 1
  250. }
  251. month = month > 9 ? month : '0' + month
  252. day = day > 9 ? day : '0' + day
  253. return `${year}-${month}-${day}`
  254. }
  255. }
  256. }
  257. </script>
  258. <style lang="scss">
  259. /*screen*/
  260. .drawer-container {
  261. width: 580rpx;
  262. height: 100%;
  263. padding: 80rpx 0;
  264. overflow: hidden;
  265. box-sizing: border-box;
  266. background-color: #ffffff;
  267. .drawer-title {
  268. width: 100%;
  269. height: 72rpx;
  270. line-height: 72rpx;
  271. box-sizing: border-box;
  272. padding: 0 30rpx;
  273. float: left;
  274. background-color: #f7f7f7;
  275. font-size: $font-size-26;
  276. color: #333333;
  277. font-weight: bold;
  278. text-align: left;
  279. }
  280. .drawer-main {
  281. width: 100%;
  282. height: auto;
  283. box-sizing: border-box;
  284. float: left;
  285. .drawer-main-name {
  286. width: 100%;
  287. height: 80rpx;
  288. line-height: 80rpx;
  289. text-align: left;
  290. font-size: $font-size-26;
  291. color: #333333;
  292. box-sizing: border-box;
  293. padding: 0 20rpx;
  294. font-weight: bold;
  295. .small{
  296. font-weight: normal;
  297. color: #999999;
  298. }
  299. }
  300. .drawer-main-time{
  301. width: 100%;
  302. height: 56rpx;
  303. box-sizing: border-box;
  304. .line{
  305. color: #999999;
  306. float: left;
  307. line-height: 56rpx;
  308. }
  309. .drawer-main-time-input{
  310. width: 228rpx;
  311. height: 56rpx;
  312. background: #F7F7F7;
  313. border-radius: 28rpx;
  314. box-sizing: border-box;
  315. padding: 0 20rpx;
  316. line-height: 56rpx;
  317. float: left;
  318. margin: 0 20rpx;
  319. position: relative;
  320. .input-text{
  321. display: block;
  322. height: 56rpx;
  323. font-size: 26rpx;
  324. color: #666666;
  325. }
  326. .icon-riqi{
  327. color: #FF5B00;
  328. display: block;
  329. width: 40rpx;
  330. height: 56rpx;
  331. position: absolute;
  332. right: 10rpx;
  333. top: 0;
  334. line-height: 56rpx;
  335. }
  336. }
  337. }
  338. .drawer-main-radiov {
  339. width: 100%;
  340. height: auto;
  341. box-sizing: border-box;
  342. padding: 0 20rpx;
  343. .drawer-main-radio {
  344. width: 100%;
  345. height: 80rpx;
  346. box-sizing: border-box;
  347. padding: 0 10rpx;
  348. border: 1px solid rgba(0, 0, 0, 0.2);
  349. border-radius: 6rpx;
  350. margin-bottom: 30rpx;
  351. position: relative;
  352. &.btn {
  353. border: none;
  354. margin-top: 40rpx;
  355. }
  356. .input {
  357. width: 100%;
  358. height: 80rpx;
  359. line-height: 80rpx;
  360. float: left;
  361. box-sizing: border-box;
  362. font-size: $font-size-24;
  363. color: #333333;
  364. padding: 0 10rpx;
  365. padding-right: 68rpx;
  366. }
  367. .iconfont {
  368. width: 50rpx;
  369. height: 80rpx;
  370. display: block;
  371. line-height: 80rpx;
  372. text-align: center;
  373. font-size: 30rpx;
  374. color: #999999;
  375. position: absolute;
  376. right: 0;
  377. top: 0;
  378. }
  379. }
  380. }
  381. }
  382. .drawer-input {
  383. width: 100%;
  384. float: left;
  385. box-sizing: border-box;
  386. padding: 24rpx 10rpx 0 10rpx;
  387. border: 1px solid rgba(0, 0, 0, 0.2);
  388. border-radius: 4rpx;
  389. position: relative;
  390. background-color: #ffffff;
  391. &.btn {
  392. border: none;
  393. display: flex;
  394. position: fixed;
  395. left: 0;
  396. bottom: 0;
  397. }
  398. .drawer-btn {
  399. width: 210rpx;
  400. height: 84rpx;
  401. border-radius: 42rpx;
  402. background: $btn-confirm;
  403. line-height: 84rpx;
  404. text-align: center;
  405. font-size: $font-size-26;
  406. color: #ffffff;
  407. flex: 1;
  408. margin: 0 10rpx;
  409. &.comfrim {
  410. background: $btn-confirm;
  411. }
  412. &.clear {
  413. background: #ffe6dc;
  414. color: $color-system;
  415. }
  416. }
  417. }
  418. }
  419. </style>