cm-club-drawer.vue 11 KB

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