dmTimeLevelScreen.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="timeContainer">
  3. <view class="title">{{title}}</view>
  4. <view class="subTitle">{{subTitle}}</view>
  5. <view class="bottomSection">
  6. <view class="selValue" @click="selectTimeLevelAction">
  7. {{selValue.title}}
  8. </view>
  9. <view class="rightSection">
  10. <image class="bottimIcon" src="../../static/icons/icon_aboutUs_DropDown.png" mode=""></image>
  11. <view class="line"></view>
  12. <view class="sort" :style="`background-color: ${sortType==0 ? '#fff': '#F7F8F9'}; color: ${sortType==0 ? '#333333': '#999999'};`"
  13. @click="sortAction(0)">正序</view>
  14. <view class="desSort" :style="`background-color: ${sortType==1 ? '#fff': '#F7F8F9'}; color: ${sortType==1 ? '#333333': '#999999'};`"
  15. @click="sortAction(1)">倒序</view>
  16. </view>
  17. </view>
  18. <dm-picker-view ref="timeLevelPicker" :options="timeLevelList" :value="selValue.value" @confirm="confirm" title="筛选时间维度"></dm-picker-view>
  19. </view>
  20. </template>
  21. <script>
  22. import dmPickerView from './dmPickerView.vue'
  23. export default {
  24. props: {
  25. title: {
  26. type: String,
  27. default: '筛选时间维度'
  28. },
  29. subTitle: {
  30. type: String,
  31. default: '倒序表示最近到最远排列'
  32. },
  33. sortType: {
  34. type: [Number, String],
  35. default: '1'
  36. },
  37. queryDateType: {
  38. type: [Number, String],
  39. default: 2
  40. },
  41. isChengjiao2: {
  42. type: Boolean,
  43. default: false
  44. }
  45. },
  46. data() {
  47. return {
  48. selValue: Object,
  49. timeLevelList: []
  50. }
  51. },
  52. mounted() {
  53. },
  54. methods: {
  55. selectTimeLevelAction() {
  56. this.$refs.timeLevelPicker.show()
  57. },
  58. confirm(e) {
  59. this.selValue = e.selItem
  60. this.$emit('queryDateTypeAction', e.selItem.value)
  61. },
  62. sortAction(e) {
  63. // this.sortType = e
  64. this.$emit('sortTypeAction', e)
  65. },
  66. reloadTimeLevelList() {
  67. if (this.isChengjiao2) {
  68. this.timeLevelList = [{
  69. title: '最新成交时间',
  70. value: 0
  71. },
  72. {
  73. title: '按认购时间',
  74. value: 1
  75. },
  76. {
  77. title: '按签约时间',
  78. value: 2
  79. },
  80. {
  81. title: '按已结首付时间',
  82. value: 3
  83. },
  84. {
  85. title: '按已结全款时间',
  86. value: 4
  87. }
  88. ]
  89. } else {
  90. this.timeLevelList = [{
  91. 'title': '按首次报备时间',
  92. 'value': '1'
  93. },
  94. {
  95. 'title': '按最新报备时间',
  96. 'value': '2'
  97. },
  98. {
  99. 'title': '按客户动态时间',
  100. 'value': '3'
  101. },
  102. {
  103. 'title': '按保护期截止时间',
  104. 'value': '4'
  105. }
  106. ]
  107. this.selValue = {
  108. title: '按最新报备时间',
  109. value: '2'
  110. }
  111. }
  112. }
  113. },
  114. watch: {
  115. queryDateType: {
  116. handler(e) {
  117. this.reloadTimeLevelList()
  118. if (this.isChengjiao2) {
  119. this.selValue = this.timeLevelList[parseInt(e)]
  120. }
  121. else {
  122. this.selValue = this.timeLevelList[parseInt(this.queryDateType - 1)]
  123. }
  124. this.$forceUpdate()
  125. },
  126. immediate: true
  127. },
  128. isChengjiao2: {
  129. handler(e) {
  130. this.reloadTimeLevelList()
  131. },
  132. immediate: true
  133. }
  134. },
  135. components: {
  136. dmPickerView
  137. }
  138. }
  139. </script>
  140. <style scoped lang="scss">
  141. .timeContainer {
  142. width: 100%;
  143. padding: 0 30rpx;
  144. box-sizing: border-box;
  145. font-family: Verdana;
  146. .title {
  147. color: #454545;
  148. font-size: 32rpx;
  149. font-weight: bold;
  150. }
  151. .subTitle {
  152. color: #999999;
  153. font-size: 24rpx;
  154. margin-top: 8rpx;
  155. }
  156. .bottomSection {
  157. margin-top: 20rpx;
  158. height: 94rpx;
  159. background-color: #F1F5F9;
  160. border-radius: 16rpx;
  161. display: flex;
  162. align-items: center;
  163. padding: 0 30rpx;
  164. box-sizing: border-box;
  165. justify-content: space-between;
  166. .selValue {
  167. color: #333333;
  168. font-size: 28rpx;
  169. flex-grow: 1;
  170. }
  171. .rightSection {
  172. display: flex;
  173. align-items: center;
  174. .bottimIcon {
  175. width: 14rpx;
  176. height: 9rpx;
  177. }
  178. .line {
  179. width: 2rpx;
  180. height: 52rpx;
  181. background-color: #EFEFEF;
  182. margin-left: 37rpx;
  183. }
  184. .sort {
  185. color: #333333;
  186. font-size: 28rpx;
  187. background-color: #FFFFFF;
  188. border: 2rpx solid #EFEFEF;
  189. border-radius: 26rpx;
  190. width: 90rpx;
  191. height: 52rpx;
  192. line-height: 52rpx;
  193. text-align: center;
  194. margin-left: 37rpx;
  195. }
  196. .desSort {
  197. color: #333333;
  198. font-size: 28rpx;
  199. background-color: #FFFFFF;
  200. border: 2rpx solid #EFEFEF;
  201. border-radius: 26rpx;
  202. width: 90rpx;
  203. height: 52rpx;
  204. line-height: 52rpx;
  205. text-align: center;
  206. }
  207. }
  208. }
  209. }
  210. </style>