详情小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

356 lines
7.1 KiB

  1. <template>
  2. <view>
  3. <view class="work-tag">
  4. <view class="lf-row-between lf-m-b-30">
  5. <view class="lf-font-28 lf-color-333"><text class="lf-font-28" style="color: #E21196;">*</text>年薪</view>
  6. <picker mode='selector' @change="getValue('index', $event)" :value="index" :range="array" range-key="name">
  7. <view class="lf-font-28 lf-color-333">
  8. {{array[index].name}}
  9. <u-icon name="arrow-right lf-color-777"></u-icon>
  10. </view>
  11. </picker>
  12. </view>
  13. <view class="lf-row-between lf-m-b-30">
  14. <view class="lf-font-28 lf-color-333" style="margin-left: 14rpx;">职务</view>
  15. <view>
  16. <input type="text" placeholder="请输入" style="text-align: right;" />
  17. </view>
  18. </view>
  19. <view class="lf-row-between lf-m-b-30">
  20. <view class="lf-font-28 lf-color-333"><text class="lf-font-28" style="color: #E21196;">*</text>家庭成员</view>
  21. <view @tap="showModal" data-target="ChooseModal" class="lf-font-28 lf-color-777">
  22. 请选择
  23. </view>
  24. </view>
  25. <view class="tag-content">
  26. <view class="personal-tag" :class="item.hot?'personal-special1':'personal-active1'" v-for="item of chooseList">{{item.name}}</view>
  27. </view>
  28. <view class="cu-modal" :class="modalName=='ChooseModal'?'show':''" @tap="hideModal">
  29. <view class="cu-dialog">
  30. <view class="lf-p-b-30 lf-font-32" style="color: #E21196;">
  31. 请选择你的家庭成员
  32. </view>
  33. <view class="tag-content1">
  34. <view class="personal-tag1" :class="item.checked?'personal-active':''" :data-value="item.value" v-for="(item,index) of checkbox" @tap.stop="ChooseCheckbox">{{item.name}}</view>
  35. </view>
  36. <view class="lf-row-center">
  37. <view class="work-btn1 work-btn" @click.stop="makeSure()">
  38. 确认选择
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="work-btn">
  44. 保存
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. array: [
  54. {name: '6万到8万'},
  55. {name: '十万到十二万'},
  56. ],
  57. index: 0,
  58. selectname: '',
  59. modalName: null,
  60. checkbox: [{
  61. value: 0,
  62. name: '父亲',
  63. checked: true,
  64. hot: false,
  65. }, {
  66. value: 1,
  67. name: '母亲',
  68. checked: true,
  69. hot: false,
  70. }, {
  71. value: 2,
  72. name: '哥哥',
  73. checked: false,
  74. hot: false,
  75. }, {
  76. value: 3,
  77. name: '姐姐',
  78. checked: false,
  79. hot: false,
  80. }, {
  81. value: 4,
  82. name: '儿子',
  83. checked: false,
  84. hot: false,
  85. }, {
  86. value: 5,
  87. name: '儿子(离异归对方)',
  88. checked: false,
  89. hot: true,
  90. }],
  91. chooseList: []
  92. }
  93. },
  94. methods: {
  95. getValue(current, e) {
  96. this[current] = e.target.value
  97. },
  98. showModal(e) {
  99. this.modalName = e.currentTarget.dataset.target
  100. },
  101. hideModal(e) {
  102. this.modalName = null
  103. },
  104. makeSure(e) {
  105. this.chooseList = [];
  106. this.checkbox.forEach(item => {
  107. if(item.checked == true) {
  108. this.chooseList.push(item)
  109. }
  110. });
  111. this.modalName = null
  112. },
  113. ChooseCheckbox(e) {
  114. let items = this.checkbox;
  115. let values = e.currentTarget.dataset.value;
  116. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  117. if (items[i].value == values) {
  118. items[i].checked = !items[i].checked;
  119. break
  120. }
  121. }
  122. }
  123. }
  124. }
  125. </script>
  126. <style>
  127. page {
  128. background-color: #F5F5F5;
  129. }
  130. </style>
  131. <style lang="scss" scoped="scoped">
  132. /deep/.input-placeholder {
  133. /* placeholder颜色 */
  134. color: #777777;
  135. /* placeholder字体大小 */
  136. font-size: 28rpx;
  137. }
  138. .work-btn1 {
  139. border-radius: 10rpx!important;
  140. }
  141. .work-btn {
  142. width: 626rpx;
  143. height: 90rpx;
  144. background: #E21196;
  145. border-radius: 45rpx;
  146. color: white;
  147. font-size: 32rpx;
  148. display: flex;
  149. justify-content: center;
  150. text-align: center;
  151. align-items: center;
  152. margin-top: 60rpx;
  153. }
  154. .tag-content {
  155. width: 600rpx;
  156. flex-wrap: wrap;
  157. display: flex;
  158. }
  159. .personal-tag {
  160. margin: 10rpx 4rpx;
  161. width: max-content;
  162. padding: 2rpx 20rpx;
  163. height: 55rpx;
  164. border-radius: 28rpx;
  165. border: 1rpx solid #E21196;
  166. color: #E21196;
  167. font-size: 28rpx;
  168. margin-right: 15rpx;
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. &:nth-child(5n) {
  173. margin-right: 0;
  174. }
  175. &:nth-child(n + 6) {
  176. margin-top: 20rpx;
  177. }
  178. }
  179. .tag-content1 {
  180. width: 600rpx;
  181. flex-wrap: wrap;
  182. display: flex;
  183. }
  184. .personal-tag1 {
  185. width: max-content;
  186. padding: 8rpx 25rpx;
  187. height: 55rpx;
  188. border-radius: 10rpx;
  189. border: 1rpx solid #ccc;
  190. color: #969090;
  191. font-size: 28rpx;
  192. margin-right: 15rpx;
  193. display: flex;
  194. justify-content: center;
  195. align-items: center;
  196. &:nth-child(5n) {
  197. margin-right: 0;
  198. }
  199. &:nth-child(n + 6) {
  200. margin-top: 20rpx;
  201. }
  202. }
  203. .personal-active {
  204. border: 1rpx solid #E21196!important;
  205. color: #E21196!important;
  206. }
  207. .personal-special {
  208. border: 1rpx solid orange!important;
  209. color: orange!important;
  210. }
  211. .personal-active1 {
  212. border: none!important;
  213. background-color: #E21196!important;
  214. color: #fff!important;
  215. }
  216. .personal-special1 {
  217. border: none!important;
  218. background-color: orange!important;
  219. color: #fff!important;
  220. }
  221. .work-tag {
  222. height: 100%!important;
  223. }
  224. .work-tag {
  225. width: 686rpx;
  226. height: 215rpx;
  227. background: #FFFFFF;
  228. border-radius: 10rpx;
  229. margin: 30rpx auto;
  230. display: flex;
  231. flex-direction: column;
  232. /* justify-content: space-around; */
  233. padding: 30rpx;
  234. }
  235. //窗口
  236. .cu-modal {
  237. position: fixed;
  238. top: 0;
  239. right: 0;
  240. bottom: 0;
  241. left: 0;
  242. z-index: 1110;
  243. opacity: 0;
  244. outline: 0;
  245. text-align: center;
  246. -ms-transform: scale(1.185);
  247. transform: scale(1.185);
  248. backface-visibility: hidden;
  249. perspective: 2000upx;
  250. background: rgba(0, 0, 0, 0.6);
  251. transition: all 0.3s ease-in-out 0s;
  252. pointer-events: none;
  253. }
  254. .cu-modal::before {
  255. content: "\200B";
  256. display: inline-block;
  257. height: 100%;
  258. vertical-align: middle;
  259. }
  260. .cu-modal.show {
  261. opacity: 1;
  262. transition-duration: 0.3s;
  263. -ms-transform: scale(1);
  264. transform: scale(1);
  265. overflow-x: hidden;
  266. overflow-y: auto;
  267. pointer-events: auto;
  268. }
  269. .cu-dialog {
  270. position: relative;
  271. display: inline-block;
  272. vertical-align: middle;
  273. margin-left: auto;
  274. margin-right: auto;
  275. width: 680upx;
  276. max-width: 100%;
  277. background-color: #f8f8f8;
  278. border-radius: 10upx;
  279. overflow: hidden;
  280. padding: 30rpx;
  281. }
  282. .cu-modal.bottom-modal::before {
  283. vertical-align: bottom;
  284. }
  285. .cu-modal.bottom-modal .cu-dialog {
  286. width: 100%;
  287. border-radius: 0;
  288. }
  289. .cu-modal.bottom-modal {
  290. margin-bottom: -1000upx;
  291. }
  292. .cu-modal.bottom-modal.show {
  293. margin-bottom: 0;
  294. }
  295. .cu-modal.drawer-modal {
  296. transform: scale(1);
  297. display: flex;
  298. }
  299. .cu-modal.drawer-modal .cu-dialog {
  300. height: 100%;
  301. min-width: 200upx;
  302. border-radius: 0;
  303. margin: initial;
  304. transition-duration: 0.3s;
  305. }
  306. .cu-modal.drawer-modal.justify-start .cu-dialog {
  307. transform: translateX(-100%);
  308. }
  309. .cu-modal.drawer-modal.justify-end .cu-dialog {
  310. transform: translateX(100%);
  311. }
  312. .cu-modal.drawer-modal.show .cu-dialog {
  313. transform: translateX(0%);
  314. }
  315. .cu-modal .cu-dialog>.cu-bar:first-child .action{
  316. min-width: 100rpx;
  317. margin-right: 0;
  318. min-height: 100rpx;
  319. }
  320. </style>