详情小程序
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.

394 lines
8.5 KiB

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