step.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525
  1. <template>
  2. <view class="step-container">
  3. <view class="reserveASeat"></view>
  4. <!-- 步骤指示器 -->
  5. <view class="step-header">
  6. <text class="step-number">STEP {{ currentStep }}</text>
  7. <view class="progress-container">
  8. <view class="progress-bar">
  9. <view class="progress-inner" :style="{ width: currentStep === 1 ? '50%' : '100%' }"></view>
  10. </view>
  11. </view>
  12. </view>
  13. <!-- 步骤1:个人信息 -->
  14. <view v-if="currentStep === 1" class="step-content">
  15. <view class="step-title">这里是 <text>·灵魂汇聚·</text> 的起点</view>
  16. <!-- 头像上传 -->
  17. <view class="avatar-section">
  18. <view class="avatar-wrapper" @click="chooseAvatar">
  19. <CircleAvatar v-if="userInfo.avatar" class="avator" :src="userInfo.avatar"></CircleAvatar>
  20. <view class="avatar-placeholder">
  21. <image src="/static/me/photo.png" mode="aspectFit" class="camera-icon"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 昵称输入 -->
  26. <view class="input-section">
  27. <view class="input-label">我的名字</view>
  28. <view class="input-wrapper">
  29. <input type="text" v-model="userInfo.nickname" placeholder="取一个独一无二的名字吧~"
  30. placeholder-class="input-placeholder" maxlength="10" />
  31. <view class="input-actions">
  32. <image src="/static/me/step/dlzc_icon_suiji.png" mode="aspectFit" class="action-icon random"
  33. @click="generateRandomNickname"></image>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 性别选择 -->
  38. <view class="gender-section">
  39. <view class="input-label">性别</view>
  40. <view class="gender-options">
  41. <view class="gender-item" :class="{ active: userInfo.gender === '1' }" @click="userInfo.gender = '1'">
  42. <image src="/static/me/step/dlzc_icon_nan.png" mode="aspectFit" class="gender-icon"></image>
  43. <text>男生</text>
  44. </view>
  45. <view class="gender-item" :class="{ active: userInfo.gender === '2' }" @click="userInfo.gender = '2'">
  46. <image src="/static/me/step/dlzc_icon_nv.png" mode="aspectFit" class="gender-icon"></image>
  47. <text>女生</text>
  48. </view>
  49. <view class="gender-item" :class="{ active: userInfo.gender === '3' }" @click="userInfo.gender = '3'">
  50. <image src="/static/me/step/dlzc_icon_qita.png" mode="aspectFit" class="gender-icon"></image>
  51. <text>其它</text>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 生日选择 -->
  56. <view class="birthday-section">
  57. <view class="input-label">我的生日</view>
  58. <view class="birthday-picker">
  59. <picker style="height: auto" mode="date" :value="userInfo.birthday" :end="endDate" @change="bindDateChange">
  60. <view class="uni-input">
  61. <text :class="{ placeholder: !userInfo.birthday }">{{
  62. userInfo.birthday || "选择生日"
  63. }}</text>
  64. <text v-if="userInfo.birthday" class="constellation">{{
  65. userInfo.xinzuo
  66. }}</text>
  67. </view>
  68. </picker>
  69. <image src="/static/me/step/dlzc_icon_arrow.png" mode="aspectFit" class="arrow-icon"></image>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 步骤2:兴趣选择 -->
  74. <view v-if="currentStep === 2" class="step-content">
  75. <view class="step-title">亦是 <text>·奇思妙想·</text> 的原野</view>
  76. <view class="interest-section">
  77. <text class="interest-tip">请选择</text>
  78. <view class="interest-circles" @touchstart="handleTouchStart" @touchmove="handleTouchMove"
  79. @touchend="handleTouchEnd">
  80. <view class="interest-circles-container" :style="getContainerStyle()">
  81. <view v-for="(interest, index) in interests" :key="index" class="interest-circle-box" :class="{
  82. active: selectedInterests.includes(interest.id),
  83. disabled:
  84. !selectedInterests.includes(interest.id) && isMaxSelected,
  85. }" @click="toggleInterest(interest.id)" :style="getCircleStyle(index)">
  86. <view class="interest-circle">
  87. <view>{{ interest.name }}</view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 添加兴趣爱好 -->
  93. <view class="add-interests">
  94. <view class="add-title">
  95. 添加兴趣爱好
  96. <text class="add-hint">(最多选择5个)</text>
  97. </view>
  98. <view class="interest-tags">
  99. <view v-for="(tag, index) in selectedTags" :key="index" class="interest-tag">
  100. {{ tag.name }}
  101. <text class="remove-tag" @click.stop="removeTag(tag)">×</text>
  102. </view>
  103. <view class="add-tag" @click="showPopup" v-if="!isMaxSelected">
  104. <image src="/static/me/step/dlzc_icon_tianjia.png" mode="aspectFit" class="add-icon"></image>
  105. 创建新偏好
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <!-- 底部按钮 -->
  112. <view class="bottom-button" @click="handleNext">
  113. {{ currentStep === 1 ? "下一步" : "完成" }}
  114. </view>
  115. <!-- 添加标签弹窗 -->
  116. <uni-popup ref="addTagPopup" type="center" :mask-click="false">
  117. <view class="add-tag-popup">
  118. <view class="popup-title">创建新偏好</view>
  119. <scroll-view scroll-y class="popup-content" :scroll-top="scrollTop" @scroll="onScroll">
  120. <view class="popup-input">
  121. <input type="text" v-model="newTag" :disabled="isMaxSelected" :placeholder="isMaxSelected ? '已达到标签上限' : '输入您的兴趣爱好'
  122. " placeholder-style="color: #999999;" maxlength="5" @confirm="addNewTag" class="tag-input"
  123. :class="{ disabled: isMaxSelected }" />
  124. </view>
  125. <view class="selected-tags" v-if="selectedTags.length > 0">
  126. <view class="selected-tags-title">
  127. 已选标签 ({{ selectedTags.length }}/{{ maxTags }})
  128. <text v-if="isMaxSelected" class="max-hint">已达到上限</text>
  129. </view>
  130. <view class="selected-tags-list">
  131. <view v-for="(tag, index) in selectedTags" :key="index" class="selected-tag">
  132. {{ tag.name }}
  133. <text class="remove-tag" @click.stop="removeTag(tag)">×</text>
  134. </view>
  135. </view>
  136. </view>
  137. </scroll-view>
  138. <view class="popup-buttons">
  139. <button class="btn-cancel" @click="closePopup">再考虑一下</button>
  140. <button class="btn-confirm" :class="{ disabled: isMaxSelected || !newTag.trim() }" @click="addNewTag">
  141. 确认添加
  142. </button>
  143. </view>
  144. </view>
  145. </uni-popup>
  146. <!-- 权限申请提示 -->
  147. <view v-if="showRights" style="
  148. width: 100%;
  149. height: 300rpx;
  150. background-color: rgba(255, 255, 255, 0.9);
  151. position: fixed;
  152. top: 0;
  153. display: flex;
  154. flex-direction: column;
  155. justify-content: center;
  156. align-items: center;
  157. z-index: 999;">
  158. <text style="
  159. width: 90%;
  160. color: #000000;
  161. font-size: 38rpx;
  162. text-align: left;
  163. padding: 10rpx 20rpx;
  164. padding-top: 10rpx;">正在获取相机、存储权限</text>
  165. <text style="
  166. width: 90%;
  167. color: #666666;
  168. font-size: 28rpx;
  169. text-align: left;
  170. padding: 10rpx 20rpx;">该权限用于获取设备拍摄或获取本地应用相册,进行头像或图片上传。</text>
  171. </view>
  172. </view>
  173. </template>
  174. <script>
  175. import permission from '@/common/permission.js';
  176. export default {
  177. components: {},
  178. data() {
  179. return {
  180. currentStep: 1,
  181. userInfo: {
  182. avatar: "",
  183. nickname: "",
  184. gender: "",
  185. birthday: "",
  186. xinzuo: "",
  187. },
  188. interests: [
  189. { id: 1, name: "老二次元了" },
  190. { id: 2, name: "coser" },
  191. { id: 3, name: "沉迷音乐-Hop" },
  192. { id: 4, name: "网游小达人" },
  193. { id: 5, name: "AJ控" },
  194. { id: 6, name: "白日梦想家" },
  195. { id: 7, name: "撸铁狂魔" },
  196. { id: 8, name: "古风汉服" },
  197. { id: 9, name: "爱画画" },
  198. { id: 10, name: "数码极客" },
  199. { id: 11, name: "盲盒玩家" },
  200. { id: 12, name: "三坑玩家" },
  201. { id: 13, name: "动漫达人" },
  202. { id: 14, name: "独立设计师" },
  203. { id: 15, name: "爱卡通" },
  204. { id: 16, name: "兜风去" },
  205. { id: 17, name: "爱夜跑" },
  206. { id: 18, name: "街头滑板" },
  207. { id: 19, name: "球类运动" },
  208. { id: 20, name: "lo娘" },
  209. { id: 21, name: "rapper" },
  210. { id: 22, name: "时尚达人" },
  211. { id: 23, name: "机甲狂潮" },
  212. { id: 24, name: "养宠物" },
  213. { id: 25, name: "风轻云淡" },
  214. { id: 26, name: "养多肉" },
  215. { id: 27, name: "热爱自然" },
  216. { id: 28, name: "赛博朋克" },
  217. { id: 29, name: "骨子里高冷" },
  218. { id: 30, name: "爱唠嗑" },
  219. { id: 31, name: "资深中二" },
  220. { id: 32, name: "天然呆" },
  221. { id: 33, name: "思想家" },
  222. { id: 34, name: "极度抽象" },
  223. { id: 35, name: "学院派" },
  224. { id: 36, name: "平平无奇" },
  225. { id: 37, name: "热情奔放" },
  226. { id: 38, name: "博古通今" },
  227. { id: 39, name: "labubu粉" },
  228. { id: 40, name: "玛特收藏家" },
  229. ],
  230. selectedInterests: [],
  231. showAddTag: false,
  232. newTag: "",
  233. endDate: "",
  234. circleConfig: {
  235. size: 132,
  236. gap: 30,
  237. rowGap: 20,
  238. offsetLefts: 30,
  239. offsetTops: 20,
  240. rows: 4,
  241. baseTop: 30,
  242. baseLeft: 30,
  243. },
  244. containerWidth: 0,
  245. customTags: [],
  246. maxTags: 5,
  247. scrollTop: 0,
  248. xinzuo: [
  249. "水瓶座",
  250. "双鱼座",
  251. "白羊座",
  252. "金牛座",
  253. "双子座",
  254. "巨蟹座",
  255. "狮子座",
  256. "处女座",
  257. "天秤座",
  258. "天蝎座",
  259. "射手座",
  260. "摩羯座",
  261. ],
  262. showRights: false,
  263. skey: getApp().globalData.skey,
  264. imglocal: "",
  265. };
  266. },
  267. computed: {
  268. totalWidth() {
  269. const { size, gap, rows } = this.circleConfig;
  270. const columns = Math.ceil(this.interests.length / rows);
  271. return columns * (size + gap) + gap + "rpx";
  272. },
  273. selectedTags() {
  274. const selectedPresets = this.interests
  275. .filter((interest) => this.selectedInterests.includes(interest.id))
  276. .map((interest) => ({
  277. id: interest.id,
  278. name: interest.name,
  279. isPreset: true,
  280. }));
  281. return [...selectedPresets, ...this.customTags];
  282. },
  283. isMaxSelected() {
  284. return this.selectedTags.length >= this.maxTags;
  285. },
  286. },
  287. onLoad() {
  288. this.currentStep = 1;
  289. const now = new Date();
  290. const year = now.getFullYear();
  291. const month = String(now.getMonth() + 1).padStart(2, "0");
  292. const day = String(now.getDate()).padStart(2, "0");
  293. this.endDate = `${year}-${month}-${day}`;
  294. // 页面加载时获取用户信息
  295. this.getInfoData();
  296. },
  297. onShow() { },
  298. methods: {
  299. onBack() { },
  300. chkSel() {
  301. if (this.sel == 1) {
  302. this.sel = 0;
  303. } else {
  304. this.sel = 1;
  305. }
  306. },
  307. chkSex(sex) {
  308. this.sex = sex;
  309. },
  310. delTag(tg) {
  311. let list_tag2 = [];
  312. for (let i = 0; i < this.sel_tags.length; i++) {
  313. if (this.sel_tags[i] != tg && this.sel_tags[i] != "") {
  314. list_tag2.push(this.sel_tags[i]);
  315. }
  316. }
  317. this.sel_tags = list_tag2;
  318. },
  319. selTags(itm) {
  320. let that = this;
  321. let isIn = false;
  322. for (let entry of this.sel_tags) {
  323. // console.log(entry); // 1, "string", false
  324. if (entry == itm) {
  325. isIn = true;
  326. break;
  327. }
  328. }
  329. return isIn;
  330. },
  331. chkTag(itm) {
  332. if (this.selTags(itm)) {
  333. let tmpTags = [];
  334. for (let entry of this.sel_tags) {
  335. // console.log(entry); // 1, "string", false
  336. if (entry != itm && entry != "") {
  337. tmpTags.push(entry);
  338. }
  339. }
  340. this.sel_tags = tmpTags;
  341. } else {
  342. if (this.sel_tags.length >= 5) {
  343. this.$refs["ToastW3"].showToast({
  344. title: "最多选择5个标签",
  345. animation: 0,
  346. });
  347. return;
  348. }
  349. this.sel_tags.push(itm);
  350. }
  351. },
  352. sliderChange1(e) {
  353. this.age = e.detail.value;
  354. },
  355. sliderChange2(e) {
  356. this.height = e.detail.value;
  357. },
  358. sliderChange3(e) {
  359. this.weight = e.detail.value;
  360. },
  361. SetXueli() {
  362. let that = this;
  363. uni.showActionSheet({
  364. itemColor: "#000000",
  365. itemList: this.xueli,
  366. success: function (res) {
  367. that.xueli_sel = that.xueli[res.tapIndex];
  368. // console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  369. },
  370. fail: function (res) {
  371. console.log(res.errMsg);
  372. },
  373. });
  374. },
  375. SetXinzuo() {
  376. let that = this;
  377. uni.showActionSheet({
  378. itemColor: "#000000",
  379. itemList: this.xinzuo,
  380. success: function (res) {
  381. that.xinzuo_sel = that.xinzuo[res.tapIndex];
  382. // console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  383. },
  384. fail: function (res) {
  385. console.log(res.errMsg);
  386. },
  387. });
  388. },
  389. getInfoData() {
  390. console.log(this.$apiHost + "/Member/getinfoData");
  391. uni.request({
  392. url: this.$apiHost + "/Member/getinfoData",
  393. data: {
  394. uuid: getApp().globalData.uuid,
  395. },
  396. header: {
  397. "content-type": "application/json",
  398. },
  399. success: (res) => {
  400. console.log("res", res.data);
  401. if (res.data) {
  402. // 根据返回数据设置用户信息
  403. this.userInfo = {
  404. ...this.userInfo,
  405. nickname: res.data.nickname || "",
  406. gender: res.data.sex ? String(res.data.sex) : "",
  407. birthday: res.data.birthday || "",
  408. xinzuo: res.data.xinzuo || "",
  409. };
  410. if (res.data.avator) {
  411. this.userInfo.avatar = res.data.avator;
  412. }
  413. // 如果有兴趣爱好,解析并设置
  414. if (res.data.aihao && res.data.aihao.length > 0) {
  415. // 解析爱好标签
  416. const aihaos = res.data.aihao.split(",");
  417. // 处理预设兴趣
  418. const presetTags = [];
  419. const customTags = [];
  420. aihaos.forEach((tag) => {
  421. // 查找是否是预设兴趣
  422. const matchedInterest = this.interests.find(
  423. (i) => i.name === tag
  424. );
  425. if (matchedInterest) {
  426. presetTags.push(matchedInterest.id);
  427. } else if (tag.trim()) {
  428. customTags.push({
  429. name: tag,
  430. isCustom: true,
  431. });
  432. }
  433. });
  434. this.selectedInterests = presetTags;
  435. this.customTags = customTags;
  436. }
  437. }
  438. },
  439. fail: (err) => {
  440. console.error("获取用户信息失败", err);
  441. uni.showToast({
  442. title: "获取信息失败,请重试",
  443. icon: "none",
  444. });
  445. },
  446. });
  447. },
  448. submitUserInfo() {
  449. // 收集所有标签
  450. let tagStr = this.selectedTags.map((item) => item.name).join(",");
  451. // 构建提交的数据对象
  452. const data = {
  453. uuid: getApp().globalData.uuid,
  454. nickname: this.userInfo.nickname,
  455. avator: this.userInfo.avatar,
  456. sex: this.userInfo.gender,
  457. birthday: this.userInfo.birthday,
  458. xinzuo: this.userInfo.xinzuo,
  459. aihao: tagStr,
  460. };
  461. uni.showLoading({
  462. title: "保存中...",
  463. mask: true,
  464. });
  465. uni.request({
  466. url: this.$apiHost + "/Member/setinfoData",
  467. data: data,
  468. method: "POST",
  469. header: {
  470. "Content-Type": "application/x-www-form-urlencoded",
  471. sign: getApp().globalData.headerSign,
  472. },
  473. dataType: "json",
  474. success: (res) => {
  475. if (res.data.success === "yes") {
  476. // 保存用户信息到全局变量和本地存储
  477. if (this.userInfo.nickname) {
  478. getApp().globalData.nickname = this.userInfo.nickname;
  479. uni.setStorageSync("nickname", this.userInfo.nickname);
  480. }
  481. if (this.userInfo.avatar) {
  482. getApp().globalData.avator = this.userInfo.avatar;
  483. uni.setStorageSync("avator", this.userInfo.avatar);
  484. }
  485. uni.showToast({
  486. title: "注册成功",
  487. icon: "success",
  488. });
  489. // 延迟跳转
  490. setTimeout(() => {
  491. uni.switchTab({
  492. url: "/pages/index/index",
  493. });
  494. }, 1500);
  495. } else {
  496. uni.showToast({
  497. title: res.data.str || "保存失败",
  498. icon: "none",
  499. });
  500. }
  501. },
  502. fail: () => {
  503. uni.showToast({
  504. title: "网络错误",
  505. icon: "none",
  506. });
  507. },
  508. complete: () => {
  509. uni.hideLoading();
  510. },
  511. });
  512. },
  513. chooseAvatar() {
  514. uni.showActionSheet({
  515. itemList: ['拍照', '从相册选择'],
  516. success: (res) => {
  517. const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
  518. this.chooseImage(sourceType);
  519. }
  520. });
  521. },
  522. async chooseImage(sourceType) {
  523. try {
  524. let hasPermission = false;
  525. if (sourceType === 'camera') {
  526. hasPermission = await this.checkCameraPermission();
  527. } else if (sourceType === 'album') {
  528. hasPermission = await this.checkPhotoLibraryPermission();
  529. }
  530. if (!hasPermission) {
  531. uni.showToast({
  532. title: '未获得权限',
  533. icon: 'none'
  534. });
  535. return;
  536. }
  537. uni.chooseImage({
  538. count: 1,
  539. sizeType: ['compressed'],
  540. sourceType: [sourceType],
  541. success: async (res) => {
  542. console.log('res:', res)
  543. if (res.tempFilePaths.length > 0) {
  544. this.userInfo.avatar = res.tempFilePaths[0]; // 立即显示选择的图片
  545. const tempFilePath = res.tempFilePaths[0];
  546. console.log('tempFilePaths:', tempFilePath);
  547. await this.uploadImage(tempFilePath);
  548. }
  549. },
  550. fail: (err) => {
  551. console.error('选择图片失败:', err);
  552. uni.showToast({
  553. title: '选择图片失败',
  554. icon: 'none'
  555. });
  556. }
  557. });
  558. } catch (error) {
  559. console.error('权限检查失败:', error);
  560. uni.showToast({
  561. title: '权限检查失败',
  562. icon: 'none'
  563. });
  564. }
  565. },
  566. async checkCameraPermission() {
  567. const hasPermission = await permission.request(permission.PermissionType.CAMERA, {
  568. title: '相机权限申请',
  569. describe: '需要使用相机拍摄照片,请允许使用相机权限'
  570. });
  571. return hasPermission;
  572. },
  573. async checkPhotoLibraryPermission() {
  574. const hasPermission = await permission.request(permission.PermissionType.PHOTO_LIBRARY, {
  575. title: '相册权限申请',
  576. describe: '需要访问相册选择照片,请允许访问相册权限'
  577. });
  578. return hasPermission;
  579. },
  580. uploadImage(tempFilePath) {
  581. const _self = this;
  582. const uploadTask = uni.uploadFile({
  583. url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self.skey,
  584. filePath: tempFilePath,
  585. name: 'file',
  586. success: function(uploadFileRes) {
  587. let resdata = JSON.parse(uploadFileRes.data);
  588. console.log('Success:', uploadFileRes);
  589. console.log('Upload data:', resdata);
  590. if (resdata.success == 'yes') {
  591. _self.showRights = false;
  592. _self.userInfo.avatar = resdata.url;
  593. uni.showToast({
  594. title: '头像上传成功',
  595. icon: 'success',
  596. duration: 1500
  597. });
  598. } else {
  599. uni.showToast({
  600. title: resdata.msg || '上传失败',
  601. icon: 'none',
  602. duration: 1500
  603. });
  604. }
  605. },
  606. fail: function(uploadFileFail) {
  607. console.error('Error:', uploadFileFail);
  608. uni.showToast({
  609. title: '上传失败,请重试',
  610. icon: 'none',
  611. duration: 1500
  612. });
  613. },
  614. complete: () => {
  615. console.log('Upload complete');
  616. }
  617. });
  618. // 显示上传进度
  619. uploadTask.onProgressUpdate((res) => {
  620. console.log('上传进度' + res.progress);
  621. console.log('已经上传的数据长度' + res.totalBytesSent);
  622. console.log('预期需要上传的数据总长度' + res.totalBytesExpectedToSend);
  623. });
  624. },
  625. toggleInterest(id) {
  626. if (this.selectedInterests.includes(id)) {
  627. // 取消选择
  628. this.selectedInterests.splice(this.selectedInterests.indexOf(id), 1);
  629. } else if (!this.isMaxSelected) {
  630. // 添加选择
  631. this.selectedInterests.push(id);
  632. } else {
  633. uni.showToast({
  634. title: "最多只能选择5个标签哦",
  635. icon: "none",
  636. duration: 1500,
  637. });
  638. }
  639. },
  640. removeTag(tag) {
  641. if (tag.isPreset) {
  642. const index = this.selectedInterests.indexOf(tag.id);
  643. if (index !== -1) {
  644. this.selectedInterests.splice(index, 1);
  645. }
  646. } else {
  647. const index = this.customTags.findIndex(
  648. (item) => item.name === tag.name
  649. );
  650. if (index !== -1) {
  651. this.customTags.splice(index, 1);
  652. }
  653. }
  654. uni.showToast({
  655. title: "已删除",
  656. icon: "none",
  657. duration: 1500,
  658. });
  659. },
  660. showPopup() {
  661. this.$refs.addTagPopup.open();
  662. },
  663. closePopup() {
  664. this.$refs.addTagPopup.close();
  665. this.newTag = "";
  666. },
  667. addNewTag() {
  668. const tagName = this.newTag.trim();
  669. if (!tagName) {
  670. uni.showToast({
  671. title: "请输入标签内容",
  672. icon: "none",
  673. });
  674. return;
  675. }
  676. if (tagName.length > 5) {
  677. uni.showToast({
  678. title: "标签最多5个字哦",
  679. icon: "none",
  680. });
  681. return;
  682. }
  683. if (this.isMaxSelected) {
  684. uni.showToast({
  685. title: "最多只能添加5个标签哦",
  686. icon: "none",
  687. });
  688. return;
  689. }
  690. const isPresetDuplicate = this.interests.some(
  691. (interest) => interest.name === tagName
  692. );
  693. const isCustomDuplicate = this.customTags.some(
  694. (tag) => tag.name === tagName
  695. );
  696. if (isPresetDuplicate || isCustomDuplicate) {
  697. uni.showToast({
  698. title: "这个标签已经添加过啦",
  699. icon: "none",
  700. });
  701. return;
  702. }
  703. this.customTags.push({
  704. name: tagName,
  705. isCustom: true,
  706. });
  707. uni.showToast({
  708. title: "添加成功",
  709. icon: "success",
  710. duration: 1500,
  711. });
  712. this.newTag = "";
  713. this.closePopup();
  714. },
  715. generateRandomNickname() {
  716. const characters = "0123456789";
  717. let result = "织梦者_";
  718. for (let i = 0; i < 8; i++) {
  719. result += characters.charAt(
  720. Math.floor(Math.random() * characters.length)
  721. );
  722. }
  723. this.userInfo.nickname = result;
  724. },
  725. bindDateChange(e) {
  726. const selectedDate = new Date(e.detail.value);
  727. const now = new Date();
  728. if (selectedDate > now) {
  729. uni.showToast({
  730. title: "不能选择未来日期",
  731. icon: "none",
  732. });
  733. return;
  734. }
  735. this.userInfo.birthday = e.detail.value;
  736. this.setXinzuoByDate(e.detail.value);
  737. },
  738. bindXinzuoChange(e) {
  739. const index = e.detail.value;
  740. this.xinzuoIndex = index;
  741. this.userInfo.xinzuo = this.xinzuo[index];
  742. },
  743. setXinzuoByDate(birthday) {
  744. if (!birthday) return;
  745. const date = new Date(birthday);
  746. const month = date.getMonth() + 1;
  747. const day = date.getDate();
  748. let xinzuoIndex = 0;
  749. if ((month == 1 && day >= 20) || (month == 2 && day <= 18)) {
  750. xinzuoIndex = 0; // 水瓶座
  751. } else if ((month == 2 && day >= 19) || (month == 3 && day <= 20)) {
  752. xinzuoIndex = 1; // 双鱼座
  753. } else if ((month == 3 && day >= 21) || (month == 4 && day <= 19)) {
  754. xinzuoIndex = 2; // 白羊座
  755. } else if ((month == 4 && day >= 20) || (month == 5 && day <= 20)) {
  756. xinzuoIndex = 3; // 金牛座
  757. } else if ((month == 5 && day >= 21) || (month == 6 && day <= 21)) {
  758. xinzuoIndex = 4; // 双子座
  759. } else if ((month == 6 && day >= 22) || (month == 7 && day <= 22)) {
  760. xinzuoIndex = 5; // 巨蟹座
  761. } else if ((month == 7 && day >= 23) || (month == 8 && day <= 22)) {
  762. xinzuoIndex = 6; // 狮子座
  763. } else if ((month == 8 && day >= 23) || (month == 9 && day <= 22)) {
  764. xinzuoIndex = 7; // 处女座
  765. } else if ((month == 9 && day >= 23) || (month == 10 && day <= 23)) {
  766. xinzuoIndex = 8; // 天秤座
  767. } else if ((month == 10 && day >= 24) || (month == 11 && day <= 22)) {
  768. xinzuoIndex = 9; // 天蝎座
  769. } else if ((month == 11 && day >= 23) || (month == 12 && day <= 21)) {
  770. xinzuoIndex = 10; // 射手座
  771. } else {
  772. xinzuoIndex = 11; // 摩羯座
  773. }
  774. this.xinzuoIndex = xinzuoIndex;
  775. this.userInfo.xinzuo = this.xinzuo[xinzuoIndex];
  776. },
  777. getCircleStyle(index) {
  778. const {
  779. size,
  780. gap,
  781. rowGap,
  782. rows,
  783. baseTop,
  784. offsetLefts,
  785. offsetTops,
  786. baseLeft,
  787. } = this.circleConfig;
  788. const row = index % rows;
  789. const column = Math.floor(index / rows);
  790. let offsetLeft = 0;
  791. let offsetTop = 0;
  792. if (row % 2 == 0) {
  793. offsetLeft = offsetLefts;
  794. } else {
  795. offsetLeft = -offsetLefts;
  796. }
  797. if (column % 2 == 1) {
  798. offsetTop = offsetTops;
  799. } else {
  800. offsetTop = -offsetTops;
  801. }
  802. const left = baseLeft + column * (size + gap) + offsetLeft + "rpx";
  803. const top = baseTop + row * (size + rowGap) + offsetTop + "rpx";
  804. return {
  805. position: "absolute",
  806. left,
  807. top,
  808. width: size + "rpx",
  809. height: size + "rpx",
  810. };
  811. },
  812. getContainerStyle() {
  813. return {
  814. width: this.totalWidth,
  815. height: "648rpx",
  816. position: "relative",
  817. };
  818. },
  819. handleTouchStart(e) {
  820. this.touchStartX = e.touches[0].clientX;
  821. this.touchStartScrollLeft = e.currentTarget.scrollLeft;
  822. },
  823. handleTouchMove(e) {
  824. if (!this.touchStartX) return;
  825. const deltaX = this.touchStartX - e.touches[0].clientX;
  826. e.currentTarget.scrollLeft = this.touchStartScrollLeft + deltaX;
  827. },
  828. handleTouchEnd() {
  829. this.touchStartX = null;
  830. this.touchStartScrollLeft = null;
  831. },
  832. handleNext() {
  833. if (this.currentStep === 1) {
  834. // 验证第一步数据
  835. if (!this.userInfo.nickname) {
  836. uni.showToast({
  837. title: "请输入昵称",
  838. icon: "none",
  839. });
  840. return;
  841. }
  842. if (!this.userInfo.gender) {
  843. uni.showToast({
  844. title: "请选择性别",
  845. icon: "none",
  846. });
  847. return;
  848. }
  849. this.currentStep = 2;
  850. } else {
  851. // 验证第二步数据
  852. if (
  853. this.selectedInterests.length === 0 &&
  854. this.selectedTags.length === 0
  855. ) {
  856. uni.showToast({
  857. title: "请至少选择一个兴趣",
  858. icon: "none",
  859. });
  860. return;
  861. }
  862. // 提交所有数据
  863. this.submitUserInfo();
  864. }
  865. },
  866. onScroll(e) {
  867. this.scrollTop = e.detail.scrollTop;
  868. },
  869. },
  870. };
  871. </script>
  872. <style lang="scss">
  873. .reserveASeat {
  874. width: 100%;
  875. height: calc(var(--status-bar-height) + 20rpx);
  876. }
  877. .popSel {
  878. position: fixed;
  879. z-index: 101;
  880. top: 0;
  881. left: 0;
  882. background-color: #f2f6f2;
  883. width: 100%;
  884. height: 100vh;
  885. overflow-y: scroll;
  886. -webkit-overflow-scrolling: touch;
  887. box-sizing: border-box;
  888. padding-bottom: 100rpx;
  889. }
  890. .tag_all_select {
  891. padding: 20rpx;
  892. height: 100%;
  893. overflow-y: auto;
  894. .tag_items {
  895. display: flex;
  896. flex-wrap: wrap;
  897. gap: 30rpx;
  898. justify-content: center;
  899. align-items: center;
  900. padding-bottom: 50rpx;
  901. .tag_item {
  902. display: flex;
  903. align-items: center;
  904. justify-content: center;
  905. border-radius: 50%;
  906. background: rgba(255, 255, 255, 0.1);
  907. color: #333;
  908. font-size: 26rpx;
  909. transition: all 0.3s ease;
  910. cursor: pointer;
  911. &.small {
  912. width: 120rpx;
  913. height: 120rpx;
  914. }
  915. &.medium {
  916. width: 160rpx;
  917. height: 160rpx;
  918. font-size: 28rpx;
  919. }
  920. &.large {
  921. width: 200rpx;
  922. height: 200rpx;
  923. font-size: 32rpx;
  924. }
  925. &.active {
  926. transform: scale(1.2);
  927. background: rgba(255, 255, 255, 0.2);
  928. box-shadow: 0 0 20rpx rgba(255, 255, 255, 0.3);
  929. z-index: 1;
  930. }
  931. &:not(.active):hover {
  932. transform: scale(1.05);
  933. }
  934. }
  935. }
  936. }
  937. .step-container {
  938. min-height: 100vh;
  939. background: url("../../static/me/step/wd_bg_bianjiziliao.png") top center/100% no-repeat,
  940. #f2f6f2;
  941. padding: 40rpx 0;
  942. padding-bottom: 230rpx;
  943. box-sizing: border-box;
  944. }
  945. .step-header {
  946. margin-bottom: 20rpx;
  947. padding: 0 40rpx;
  948. .step-number {
  949. font-size: 48rpx;
  950. font-weight: bold;
  951. color: #000;
  952. margin-bottom: 20rpx;
  953. display: block;
  954. text-align: center;
  955. }
  956. .progress-container {
  957. height: 6rpx;
  958. background: #f1f1f1;
  959. border-radius: 4rpx;
  960. overflow: hidden;
  961. .progress-inner {
  962. height: 100%;
  963. background: #1f1f1f;
  964. border-radius: 4rpx;
  965. transition: width 0.3s ease;
  966. height: 6rpx;
  967. }
  968. }
  969. }
  970. .step-content {
  971. padding: 0 40rpx;
  972. .step-title {
  973. text-align: center;
  974. font-size: 32rpx;
  975. font-weight: bold;
  976. color: #666;
  977. margin-bottom: 50rpx;
  978. letter-spacing: 1rpx;
  979. text {
  980. font-size: 40rpx;
  981. }
  982. }
  983. }
  984. .avatar-section {
  985. display: flex;
  986. justify-content: center;
  987. margin-bottom: 60rpx;
  988. .avatar-wrapper {
  989. width: 200rpx;
  990. height: 200rpx;
  991. border-radius: 50%;
  992. background: #f8f8f8;
  993. display: flex;
  994. align-items: center;
  995. justify-content: center;
  996. border: 4rpx dashed #e5e5e5;
  997. position: relative;
  998. .avatar {
  999. width: 100%;
  1000. height: 100%;
  1001. }
  1002. .avatar-placeholder {
  1003. width: 64rpx;
  1004. height: 64rpx;
  1005. position: absolute;
  1006. bottom: 0;
  1007. right: 0;
  1008. .camera-icon {
  1009. width: 100%;
  1010. height: 100%;
  1011. }
  1012. }
  1013. }
  1014. }
  1015. .input-section {
  1016. margin-bottom: 20rpx;
  1017. .input-wrapper {
  1018. position: relative;
  1019. display: flex;
  1020. align-items: center;
  1021. background: #f8f8f8;
  1022. border-radius: 16rpx;
  1023. padding-right: 20rpx;
  1024. input {
  1025. flex: 1;
  1026. height: 88rpx;
  1027. padding: 0 20rpx 0 30rpx;
  1028. font-size: 28rpx;
  1029. color: #333;
  1030. background: transparent;
  1031. &::placeholder {
  1032. color: #999;
  1033. }
  1034. }
  1035. .input-actions {
  1036. display: flex;
  1037. align-items: center;
  1038. gap: 16rpx;
  1039. .close-icon {
  1040. width: 36rpx;
  1041. height: 36rpx;
  1042. }
  1043. .random {
  1044. width: 44rpx;
  1045. height: 44rpx;
  1046. }
  1047. }
  1048. }
  1049. }
  1050. .gender-section {
  1051. margin-bottom: 20rpx;
  1052. .gender-options {
  1053. display: flex;
  1054. gap: 20rpx;
  1055. .gender-item {
  1056. flex: 1;
  1057. background: #f8f8f8;
  1058. border-radius: 20rpx;
  1059. display: flex;
  1060. flex-direction: column;
  1061. align-items: center;
  1062. justify-content: center;
  1063. transition: all 0.3s ease;
  1064. width: 184px;
  1065. height: 168rpx;
  1066. border-radius: 20rpx;
  1067. border: 4rpx solid #e9e9e9;
  1068. &.active {
  1069. background: linear-gradient(180deg,
  1070. #f0ffd9 0%,
  1071. rgba(240, 255, 217, 0) 99%);
  1072. transform: scale(1.02);
  1073. border-color: #1f1f1f;
  1074. }
  1075. .gender-icon {
  1076. width: 80rpx;
  1077. height: 80rpx;
  1078. margin-bottom: 16rpx;
  1079. }
  1080. text {
  1081. font-size: 28rpx;
  1082. color: #333;
  1083. }
  1084. }
  1085. }
  1086. }
  1087. .birthday-section {
  1088. margin-bottom: 20rpx;
  1089. background: #fff;
  1090. padding: 20rpx;
  1091. border-radius: 20rpx;
  1092. .input-label {
  1093. font-size: 28rpx;
  1094. color: #333;
  1095. padding-bottom: 20rpx;
  1096. }
  1097. .birthday-picker {
  1098. height: 88rpx;
  1099. background: #f8f8f8;
  1100. border-radius: 16rpx;
  1101. padding: 0 30rpx;
  1102. display: flex;
  1103. align-items: center;
  1104. justify-content: space-between;
  1105. picker {
  1106. flex: 1;
  1107. height: 100%;
  1108. .uni-input {
  1109. width: 100%;
  1110. height: 100%;
  1111. display: flex;
  1112. align-items: center;
  1113. gap: 12rpx;
  1114. text {
  1115. font-size: 28rpx;
  1116. color: #333;
  1117. &.placeholder {
  1118. color: #999;
  1119. }
  1120. &.constellation {
  1121. font-size: 28rpx;
  1122. color: #1f1f1f;
  1123. padding: 4rpx 12rpx;
  1124. border-radius: 8rpx;
  1125. }
  1126. }
  1127. }
  1128. }
  1129. .arrow-icon {
  1130. width: 32rpx;
  1131. height: 32rpx;
  1132. flex-shrink: 0;
  1133. }
  1134. }
  1135. }
  1136. .interest-section {
  1137. .interest-tip {
  1138. font-size: 28rpx;
  1139. color: #666;
  1140. margin-bottom: 30rpx;
  1141. }
  1142. .interest-circles {
  1143. width: 100%;
  1144. height: 648rpx;
  1145. overflow-x: scroll;
  1146. overflow-y: hidden;
  1147. position: relative;
  1148. margin-bottom: 60rpx;
  1149. padding: 10rpx;
  1150. box-sizing: border-box;
  1151. -webkit-overflow-scrolling: touch;
  1152. &::-webkit-scrollbar {
  1153. display: none;
  1154. }
  1155. -ms-overflow-style: none;
  1156. scrollbar-width: none;
  1157. .interest-circles-container {
  1158. position: relative;
  1159. height: 100%;
  1160. display: flex;
  1161. flex-wrap: wrap;
  1162. gap: 20rpx;
  1163. padding: 20rpx;
  1164. }
  1165. .interest-circle-box {
  1166. width: 132rpx;
  1167. height: 132rpx;
  1168. border-radius: 50%;
  1169. position: relative;
  1170. display: flex;
  1171. align-items: center;
  1172. justify-content: center;
  1173. &.active {
  1174. background: url("../../static/me/step/dlzc_btn_xuanzhong.png") no-repeat center center / 100% 100%;
  1175. }
  1176. &.disabled {
  1177. opacity: 0.5;
  1178. cursor: not-allowed;
  1179. .interest-circle {
  1180. background: rgba(0, 0, 0, 0.02);
  1181. }
  1182. }
  1183. .interest-circle {
  1184. width: 120rpx;
  1185. height: 120rpx;
  1186. display: flex;
  1187. align-items: center;
  1188. justify-content: center;
  1189. border-radius: 50%;
  1190. background: rgba(0, 0, 0, 0.04);
  1191. font-size: 24rpx;
  1192. color: #666;
  1193. transition: all 0.3s ease;
  1194. text-align: center;
  1195. box-sizing: border-box;
  1196. max-width: 120rpx;
  1197. padding: 10rpx;
  1198. >view {
  1199. width: 100%;
  1200. white-space: nowrap;
  1201. overflow: hidden;
  1202. text-overflow: ellipsis;
  1203. }
  1204. }
  1205. }
  1206. }
  1207. }
  1208. .interest-tags {
  1209. display: flex;
  1210. flex-wrap: wrap;
  1211. gap: 20rpx;
  1212. margin-top: 30rpx;
  1213. padding: 0 20rpx;
  1214. .interest-tag {
  1215. padding: 16rpx 24rpx;
  1216. background: #ffffff;
  1217. border-radius: 100rpx;
  1218. font-size: 28rpx;
  1219. color: #333333;
  1220. display: flex;
  1221. align-items: center;
  1222. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  1223. position: relative;
  1224. .remove-tag {
  1225. margin-left: 12rpx;
  1226. font-size: 32rpx;
  1227. color: #333333;
  1228. padding: 0 6rpx;
  1229. display: flex;
  1230. align-items: center;
  1231. position: relative;
  1232. z-index: 1;
  1233. &::after {
  1234. content: "";
  1235. position: absolute;
  1236. left: -8rpx;
  1237. right: -8rpx;
  1238. top: -8rpx;
  1239. bottom: -8rpx;
  1240. z-index: 0;
  1241. }
  1242. }
  1243. }
  1244. .add-tag {
  1245. padding: 16rpx 24rpx;
  1246. background: #ffffff;
  1247. border-radius: 100rpx;
  1248. font-size: 28rpx;
  1249. color: #333333;
  1250. display: flex;
  1251. align-items: center;
  1252. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  1253. .add-icon {
  1254. width: 32rpx;
  1255. height: 32rpx;
  1256. margin-right: 12rpx;
  1257. }
  1258. }
  1259. }
  1260. .bottom-button {
  1261. position: fixed;
  1262. left: 40rpx;
  1263. right: 40rpx;
  1264. bottom: 40rpx;
  1265. height: 88rpx;
  1266. background: #000;
  1267. border-radius: 44rpx;
  1268. color: #fff;
  1269. font-size: 32rpx;
  1270. display: flex;
  1271. align-items: center;
  1272. justify-content: center;
  1273. transition: all 0.3s ease;
  1274. &.step2 {
  1275. background: linear-gradient(90deg, #acf934 0%, #23c343 100%);
  1276. color: #000;
  1277. }
  1278. }
  1279. .add-tag-popup {
  1280. background: #ffffff;
  1281. border-radius: 24rpx;
  1282. width: 580rpx;
  1283. height: 70vh;
  1284. max-height: 800rpx;
  1285. display: flex;
  1286. flex-direction: column;
  1287. .popup-title {
  1288. padding: 40rpx 30rpx 20rpx;
  1289. font-size: 32rpx;
  1290. color: #333333;
  1291. text-align: center;
  1292. font-weight: 600;
  1293. flex-shrink: 0;
  1294. }
  1295. .popup-content {
  1296. flex: 1;
  1297. overflow-y: auto;
  1298. padding: 0 30rpx;
  1299. margin-bottom: 20rpx;
  1300. .popup-input {
  1301. margin-bottom: 30rpx;
  1302. .tag-input {
  1303. width: 100%;
  1304. height: 80rpx;
  1305. background: #f2f6f2;
  1306. border-radius: 12rpx;
  1307. padding: 0 24rpx;
  1308. font-size: 28rpx;
  1309. color: #333333;
  1310. &.disabled {
  1311. background: rgba(0, 0, 0, 0.02);
  1312. color: #999;
  1313. }
  1314. }
  1315. }
  1316. .selected-tags {
  1317. .selected-tags-title {
  1318. font-size: 28rpx;
  1319. color: #666666;
  1320. margin-bottom: 20rpx;
  1321. display: flex;
  1322. align-items: center;
  1323. justify-content: space-between;
  1324. .max-hint {
  1325. font-size: 24rpx;
  1326. color: #ff6b6b;
  1327. }
  1328. }
  1329. .selected-tags-list {
  1330. display: flex;
  1331. flex-wrap: wrap;
  1332. gap: 16rpx;
  1333. .selected-tag {
  1334. padding: 12rpx 24rpx;
  1335. background: #f2f6f2;
  1336. border-radius: 100rpx;
  1337. font-size: 26rpx;
  1338. color: #333333;
  1339. }
  1340. }
  1341. }
  1342. }
  1343. .popup-buttons {
  1344. padding: 20rpx 30rpx 30rpx;
  1345. display: flex;
  1346. gap: 20rpx;
  1347. background: #ffffff;
  1348. flex-shrink: 0;
  1349. position: relative;
  1350. &::before {
  1351. content: "";
  1352. position: absolute;
  1353. left: 0;
  1354. right: 0;
  1355. top: -20rpx;
  1356. height: 20rpx;
  1357. background: linear-gradient(to top,
  1358. rgba(255, 255, 255, 1),
  1359. rgba(255, 255, 255, 0));
  1360. }
  1361. button {
  1362. flex: 1;
  1363. height: 80rpx;
  1364. border-radius: 12rpx;
  1365. font-size: 28rpx;
  1366. display: flex;
  1367. align-items: center;
  1368. justify-content: center;
  1369. border: none;
  1370. &.btn-cancel {
  1371. background: #ffffff;
  1372. color: #333333;
  1373. border: 2rpx solid #1f1f1f;
  1374. }
  1375. &.btn-confirm {
  1376. background: #333333;
  1377. color: #ffffff;
  1378. &.disabled {
  1379. opacity: 0.5;
  1380. background: #999;
  1381. }
  1382. }
  1383. }
  1384. }
  1385. }
  1386. .birthday-section,
  1387. .input-section,
  1388. .gender-section {
  1389. background: #fff;
  1390. padding: 20rpx;
  1391. border-radius: 20rpx;
  1392. .input-label {
  1393. font-size: 28rpx;
  1394. color: #333;
  1395. padding-bottom: 20rpx;
  1396. }
  1397. }
  1398. </style>