step.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521
  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" @click="openCalendar">
  57. <view class="input-label">我的生日</view>
  58. <view class="birthday-picker">
  59. <view class="uni-input">
  60. <text :class="{ placeholder: !userInfo.birthday }">{{
  61. userInfo.birthday || "选择生日"
  62. }}</text>
  63. <text v-if="userInfo.birthday" class="constellation">{{' ' +
  64. userInfo.xinzuo
  65. }}</text>
  66. </view>
  67. <image src="/static/me/step/dlzc_icon_arrow.png" mode="aspectFit" class="arrow-icon"></image>
  68. </view>
  69. </view>
  70. <uni-calendar :date="userInfo.birthday||'2000-01-01'" ref="calendar" :insert="false" @confirm="confirmBirthday" />
  71. </view>
  72. <!-- 步骤2:兴趣选择 -->
  73. <view v-if="currentStep === 2" class="step-content">
  74. <view class="step-title">亦是 <text>·奇思妙想·</text> 的原野</view>
  75. <view class="interest-section">
  76. <text class="interest-tip">请选择</text>
  77. <view class="interest-circles" @touchstart="handleTouchStart" @touchmove="handleTouchMove"
  78. @touchend="handleTouchEnd">
  79. <view class="interest-circles-container" :style="getContainerStyle()">
  80. <view v-for="(interest, index) in interests" :key="index" class="interest-circle-box" :class="{
  81. active: selectedInterests.includes(interest.id),
  82. disabled:
  83. !selectedInterests.includes(interest.id) && isMaxSelected,
  84. }" @click="toggleInterest(interest.id)" :style="getCircleStyle(index)">
  85. <view class="interest-circle">
  86. <view>{{ interest.name }}</view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 添加兴趣爱好 -->
  92. <view class="add-interests">
  93. <view class="add-title">
  94. 添加兴趣爱好
  95. <text class="add-hint">(最多选择5个)</text>
  96. </view>
  97. <view class="interest-tags">
  98. <view v-for="(tag, index) in selectedTags" :key="index" class="interest-tag">
  99. {{ tag.name }}
  100. <text class="remove-tag" @click.stop="removeTag(tag)">×</text>
  101. </view>
  102. <view class="add-tag" @click="showPopup" v-if="!isMaxSelected">
  103. <image src="/static/me/step/dlzc_icon_tianjia.png" mode="aspectFit" class="add-icon"></image>
  104. 创建新偏好
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <!-- 底部按钮 -->
  111. <view class="bottom-button" @click="handleNext">
  112. {{ currentStep === 1 ? "下一步" : "完成" }}
  113. </view>
  114. <!-- 添加标签弹窗 -->
  115. <uni-popup ref="addTagPopup" type="center" :mask-click="false">
  116. <view class="add-tag-popup">
  117. <view class="popup-title">创建新偏好</view>
  118. <scroll-view scroll-y class="popup-content" :scroll-top="scrollTop" @scroll="onScroll">
  119. <view class="popup-input">
  120. <input type="text" v-model="newTag" :disabled="isMaxSelected" :placeholder="isMaxSelected ? '已达到标签上限' : '输入您的兴趣爱好'
  121. " placeholder-style="color: #999999;" maxlength="5" @confirm="addNewTag" class="tag-input"
  122. :class="{ disabled: isMaxSelected }" />
  123. </view>
  124. <view class="selected-tags" v-if="selectedTags.length > 0">
  125. <view class="selected-tags-title">
  126. 已选标签 ({{ selectedTags.length }}/{{ maxTags }})
  127. <text v-if="isMaxSelected" class="max-hint">已达到上限</text>
  128. </view>
  129. <view class="selected-tags-list">
  130. <view v-for="(tag, index) in selectedTags" :key="index" class="selected-tag">
  131. {{ tag.name }}
  132. <text class="remove-tag" @click.stop="removeTag(tag)">×</text>
  133. </view>
  134. </view>
  135. </view>
  136. </scroll-view>
  137. <view class="popup-buttons">
  138. <button class="btn-cancel" @click="closePopup">再考虑一下</button>
  139. <button class="btn-confirm" :class="{ disabled: isMaxSelected || !newTag.trim() }" @click="addNewTag">
  140. 确认添加
  141. </button>
  142. </view>
  143. </view>
  144. </uni-popup>
  145. <!-- 权限申请提示 -->
  146. <!-- <view v-if="showRights" style="
  147. width: 100%;
  148. height: 300rpx;
  149. background-color: rgba(255, 255, 255, 0.9);
  150. position: fixed;
  151. top: 0;
  152. display: flex;
  153. flex-direction: column;
  154. justify-content: center;
  155. align-items: center;
  156. z-index: 999;">
  157. <text style="
  158. width: 90%;
  159. color: #000000;
  160. font-size: 38rpx;
  161. text-align: left;
  162. padding: 10rpx 20rpx;
  163. padding-top: 10rpx;">正在获取相机、存储权限</text>
  164. <text style="
  165. width: 90%;
  166. color: #666666;
  167. font-size: 28rpx;
  168. text-align: left;
  169. padding: 10rpx 20rpx;">该权限用于获取设备拍摄或获取本地应用相册,进行头像或图片上传。</text>
  170. </view> -->
  171. </view>
  172. </template>
  173. <script>
  174. import permission from '@/common/permission.js';
  175. export default {
  176. components: {
  177. },
  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. openCalendar() {
  726. this.$refs.calendar.open();
  727. },
  728. confirmBirthday(e) {
  729. this.userInfo.birthday = e.fulldate;
  730. this.userInfo.xinzuo = this.getConstellation(this.userInfo.birthday);
  731. },
  732. getConstellation(birthday) {
  733. if (!birthday) return '';
  734. const month = parseInt(birthday.split('-')[1]);
  735. const day = parseInt(birthday.split('-')[2]);
  736. // 星座日期范围数组,每个元素包含 [月份, 起始日期, 结束日期, 星座名称]
  737. const constellationRanges = [
  738. [1, 1, 19, "摩羯座"], // 1月1日-1月19日
  739. [1, 20, 31, "水瓶座"], // 1月20日-1月31日
  740. [2, 1, 18, "水瓶座"], // 2月1日-2月18日
  741. [2, 19, 29, "双鱼座"], // 2月19日-2月29日
  742. [3, 1, 20, "双鱼座"], // 3月1日-3月20日
  743. [3, 21, 31, "白羊座"], // 3月21日-3月31日
  744. [4, 1, 19, "白羊座"], // 4月1日-4月19日
  745. [4, 20, 30, "金牛座"], // 4月20日-4月30日
  746. [5, 1, 20, "金牛座"], // 5月1日-5月20日
  747. [5, 21, 31, "双子座"], // 5月21日-5月31日
  748. [6, 1, 21, "双子座"], // 6月1日-6月21日
  749. [6, 22, 30, "巨蟹座"], // 6月22日-6月30日
  750. [7, 1, 22, "巨蟹座"], // 7月1日-7月22日
  751. [7, 23, 31, "狮子座"], // 7月23日-7月31日
  752. [8, 1, 22, "狮子座"], // 8月1日-8月22日
  753. [8, 23, 31, "处女座"], // 8月23日-8月31日
  754. [9, 1, 22, "处女座"], // 9月1日-9月22日
  755. [9, 23, 30, "天秤座"], // 9月23日-9月30日
  756. [10, 1, 23, "天秤座"], // 10月1日-10月23日
  757. [10, 24, 31, "天蝎座"], // 10月24日-10月31日
  758. [11, 1, 22, "天蝎座"], // 11月1日-11月22日
  759. [11, 23, 30, "射手座"], // 11月23日-11月30日
  760. [12, 1, 21, "射手座"], // 12月1日-12月21日
  761. [12, 22, 31, "摩羯座"] // 12月22日-12月31日
  762. ];
  763. // 查找对应的星座
  764. for (const [m, startDay, endDay, constellation] of constellationRanges) {
  765. if (month === m && day >= startDay && day <= endDay) {
  766. return constellation;
  767. }
  768. }
  769. // 如果没找到匹配的星座(这种情况理论上不会发生,因为日期范围是连续的)
  770. return "未知星座";
  771. },
  772. getCircleStyle(index) {
  773. const {
  774. size,
  775. gap,
  776. rowGap,
  777. rows,
  778. baseTop,
  779. offsetLefts,
  780. offsetTops,
  781. baseLeft,
  782. } = this.circleConfig;
  783. const row = index % rows;
  784. const column = Math.floor(index / rows);
  785. let offsetLeft = 0;
  786. let offsetTop = 0;
  787. if (row % 2 == 0) {
  788. offsetLeft = offsetLefts;
  789. } else {
  790. offsetLeft = -offsetLefts;
  791. }
  792. if (column % 2 == 1) {
  793. offsetTop = offsetTops;
  794. } else {
  795. offsetTop = -offsetTops;
  796. }
  797. const left = baseLeft + column * (size + gap) + offsetLeft + "rpx";
  798. const top = baseTop + row * (size + rowGap) + offsetTop + "rpx";
  799. return {
  800. position: "absolute",
  801. left,
  802. top,
  803. width: size + "rpx",
  804. height: size + "rpx",
  805. };
  806. },
  807. getContainerStyle() {
  808. return {
  809. width: this.totalWidth,
  810. height: "648rpx",
  811. position: "relative",
  812. };
  813. },
  814. handleTouchStart(e) {
  815. this.touchStartX = e.touches[0].clientX;
  816. this.touchStartScrollLeft = e.currentTarget.scrollLeft;
  817. },
  818. handleTouchMove(e) {
  819. if (!this.touchStartX) return;
  820. const deltaX = this.touchStartX - e.touches[0].clientX;
  821. e.currentTarget.scrollLeft = this.touchStartScrollLeft + deltaX;
  822. },
  823. handleTouchEnd() {
  824. this.touchStartX = null;
  825. this.touchStartScrollLeft = null;
  826. },
  827. handleNext() {
  828. if (this.currentStep === 1) {
  829. // 验证第一步数据
  830. if (!this.userInfo.nickname) {
  831. uni.showToast({
  832. title: "请输入昵称",
  833. icon: "none",
  834. });
  835. return;
  836. }
  837. if (!this.userInfo.gender) {
  838. uni.showToast({
  839. title: "请选择性别",
  840. icon: "none",
  841. });
  842. return;
  843. }
  844. this.currentStep = 2;
  845. } else {
  846. // 验证第二步数据
  847. if (
  848. this.selectedInterests.length === 0 &&
  849. this.selectedTags.length === 0
  850. ) {
  851. uni.showToast({
  852. title: "请至少选择一个兴趣",
  853. icon: "none",
  854. });
  855. return;
  856. }
  857. // 提交所有数据
  858. this.submitUserInfo();
  859. }
  860. },
  861. onScroll(e) {
  862. this.scrollTop = e.detail.scrollTop;
  863. },
  864. },
  865. };
  866. </script>
  867. <style lang="scss">
  868. .reserveASeat {
  869. width: 100%;
  870. height: calc(var(--status-bar-height) + 20rpx);
  871. }
  872. .popSel {
  873. position: fixed;
  874. z-index: 101;
  875. top: 0;
  876. left: 0;
  877. background-color: #f2f6f2;
  878. width: 100%;
  879. height: 100vh;
  880. overflow-y: scroll;
  881. -webkit-overflow-scrolling: touch;
  882. box-sizing: border-box;
  883. padding-bottom: 100rpx;
  884. }
  885. .tag_all_select {
  886. padding: 20rpx;
  887. height: 100%;
  888. overflow-y: auto;
  889. .tag_items {
  890. display: flex;
  891. flex-wrap: wrap;
  892. gap: 30rpx;
  893. justify-content: center;
  894. align-items: center;
  895. padding-bottom: 50rpx;
  896. .tag_item {
  897. display: flex;
  898. align-items: center;
  899. justify-content: center;
  900. border-radius: 50%;
  901. background: rgba(255, 255, 255, 0.1);
  902. color: #333;
  903. font-size: 26rpx;
  904. transition: all 0.3s ease;
  905. cursor: pointer;
  906. &.small {
  907. width: 120rpx;
  908. height: 120rpx;
  909. }
  910. &.medium {
  911. width: 160rpx;
  912. height: 160rpx;
  913. font-size: 28rpx;
  914. }
  915. &.large {
  916. width: 200rpx;
  917. height: 200rpx;
  918. font-size: 32rpx;
  919. }
  920. &.active {
  921. transform: scale(1.2);
  922. background: rgba(255, 255, 255, 0.2);
  923. box-shadow: 0 0 20rpx rgba(255, 255, 255, 0.3);
  924. z-index: 1;
  925. }
  926. &:not(.active):hover {
  927. transform: scale(1.05);
  928. }
  929. }
  930. }
  931. }
  932. .step-container {
  933. min-height: 100vh;
  934. background: url("../../static/me/step/wd_bg_bianjiziliao.png") top center/100% no-repeat,
  935. #f2f6f2;
  936. padding: 40rpx 0;
  937. padding-bottom: 230rpx;
  938. box-sizing: border-box;
  939. }
  940. .step-header {
  941. margin-bottom: 20rpx;
  942. padding: 0 40rpx;
  943. .step-number {
  944. font-size: 48rpx;
  945. font-weight: bold;
  946. color: #000;
  947. margin-bottom: 20rpx;
  948. display: block;
  949. text-align: center;
  950. }
  951. .progress-container {
  952. height: 6rpx;
  953. background: #f1f1f1;
  954. border-radius: 4rpx;
  955. overflow: hidden;
  956. .progress-inner {
  957. height: 100%;
  958. background: #1f1f1f;
  959. border-radius: 4rpx;
  960. transition: width 0.3s ease;
  961. height: 6rpx;
  962. }
  963. }
  964. }
  965. .step-content {
  966. padding: 0 40rpx;
  967. .step-title {
  968. text-align: center;
  969. font-size: 32rpx;
  970. font-weight: bold;
  971. color: #666;
  972. margin-bottom: 50rpx;
  973. letter-spacing: 1rpx;
  974. text {
  975. font-size: 40rpx;
  976. }
  977. }
  978. }
  979. .avatar-section {
  980. display: flex;
  981. justify-content: center;
  982. margin-bottom: 60rpx;
  983. .avatar-wrapper {
  984. width: 200rpx;
  985. height: 200rpx;
  986. border-radius: 50%;
  987. background: #f8f8f8;
  988. display: flex;
  989. align-items: center;
  990. justify-content: center;
  991. border: 4rpx dashed #e5e5e5;
  992. position: relative;
  993. .avatar {
  994. width: 100%;
  995. height: 100%;
  996. }
  997. .avatar-placeholder {
  998. width: 64rpx;
  999. height: 64rpx;
  1000. position: absolute;
  1001. bottom: 0;
  1002. right: 0;
  1003. .camera-icon {
  1004. width: 100%;
  1005. height: 100%;
  1006. }
  1007. }
  1008. }
  1009. }
  1010. .input-section {
  1011. margin-bottom: 20rpx;
  1012. .input-wrapper {
  1013. position: relative;
  1014. display: flex;
  1015. align-items: center;
  1016. background: #f8f8f8;
  1017. border-radius: 16rpx;
  1018. padding-right: 20rpx;
  1019. input {
  1020. flex: 1;
  1021. height: 88rpx;
  1022. padding: 0 20rpx 0 30rpx;
  1023. font-size: 28rpx;
  1024. color: #333;
  1025. background: transparent;
  1026. &::placeholder {
  1027. color: #999;
  1028. }
  1029. }
  1030. .input-actions {
  1031. display: flex;
  1032. align-items: center;
  1033. gap: 16rpx;
  1034. .close-icon {
  1035. width: 36rpx;
  1036. height: 36rpx;
  1037. }
  1038. .random {
  1039. width: 44rpx;
  1040. height: 44rpx;
  1041. }
  1042. }
  1043. }
  1044. }
  1045. .gender-section {
  1046. margin-bottom: 20rpx;
  1047. .gender-options {
  1048. display: flex;
  1049. gap: 20rpx;
  1050. .gender-item {
  1051. flex: 1;
  1052. background: #f8f8f8;
  1053. border-radius: 20rpx;
  1054. display: flex;
  1055. flex-direction: column;
  1056. align-items: center;
  1057. justify-content: center;
  1058. transition: all 0.3s ease;
  1059. width: 184px;
  1060. height: 168rpx;
  1061. border-radius: 20rpx;
  1062. border: 4rpx solid #e9e9e9;
  1063. &.active {
  1064. background: linear-gradient(180deg,
  1065. #f0ffd9 0%,
  1066. rgba(240, 255, 217, 0) 99%);
  1067. transform: scale(1.02);
  1068. border-color: #1f1f1f;
  1069. }
  1070. .gender-icon {
  1071. width: 80rpx;
  1072. height: 80rpx;
  1073. margin-bottom: 16rpx;
  1074. }
  1075. text {
  1076. font-size: 28rpx;
  1077. color: #333;
  1078. }
  1079. }
  1080. }
  1081. }
  1082. .birthday-section {
  1083. margin-bottom: 20rpx;
  1084. background: #fff;
  1085. padding: 20rpx;
  1086. border-radius: 20rpx;
  1087. .input-label {
  1088. font-size: 28rpx;
  1089. color: #333;
  1090. padding-bottom: 20rpx;
  1091. }
  1092. .birthday-picker {
  1093. height: 88rpx;
  1094. background: #f8f8f8;
  1095. border-radius: 16rpx;
  1096. padding: 0 30rpx;
  1097. display: flex;
  1098. align-items: center;
  1099. justify-content: space-between;
  1100. picker {
  1101. flex: 1;
  1102. height: 100%;
  1103. .uni-input {
  1104. width: 100%;
  1105. height: 100%;
  1106. display: flex;
  1107. align-items: center;
  1108. gap: 12rpx;
  1109. text {
  1110. font-size: 28rpx;
  1111. color: #333;
  1112. &.placeholder {
  1113. color: #999;
  1114. }
  1115. &.constellation {
  1116. font-size: 28rpx;
  1117. color: #1f1f1f;
  1118. padding: 4rpx 12rpx;
  1119. border-radius: 8rpx;
  1120. }
  1121. }
  1122. }
  1123. }
  1124. .arrow-icon {
  1125. width: 32rpx;
  1126. height: 32rpx;
  1127. flex-shrink: 0;
  1128. }
  1129. }
  1130. }
  1131. .interest-section {
  1132. .interest-tip {
  1133. font-size: 28rpx;
  1134. color: #666;
  1135. margin-bottom: 30rpx;
  1136. }
  1137. .interest-circles {
  1138. width: 100%;
  1139. height: 648rpx;
  1140. overflow-x: scroll;
  1141. overflow-y: hidden;
  1142. position: relative;
  1143. margin-bottom: 60rpx;
  1144. padding: 10rpx;
  1145. box-sizing: border-box;
  1146. -webkit-overflow-scrolling: touch;
  1147. &::-webkit-scrollbar {
  1148. display: none;
  1149. }
  1150. -ms-overflow-style: none;
  1151. scrollbar-width: none;
  1152. .interest-circles-container {
  1153. position: relative;
  1154. height: 100%;
  1155. display: flex;
  1156. flex-wrap: wrap;
  1157. gap: 20rpx;
  1158. padding: 20rpx;
  1159. }
  1160. .interest-circle-box {
  1161. width: 132rpx;
  1162. height: 132rpx;
  1163. border-radius: 50%;
  1164. position: relative;
  1165. display: flex;
  1166. align-items: center;
  1167. justify-content: center;
  1168. &.active {
  1169. background: url("../../static/me/step/dlzc_btn_xuanzhong.png") no-repeat center center / 100% 100%;
  1170. }
  1171. &.disabled {
  1172. opacity: 0.5;
  1173. cursor: not-allowed;
  1174. .interest-circle {
  1175. background: rgba(0, 0, 0, 0.02);
  1176. }
  1177. }
  1178. .interest-circle {
  1179. width: 120rpx;
  1180. height: 120rpx;
  1181. display: flex;
  1182. align-items: center;
  1183. justify-content: center;
  1184. border-radius: 50%;
  1185. background: rgba(0, 0, 0, 0.04);
  1186. font-size: 24rpx;
  1187. color: #666;
  1188. transition: all 0.3s ease;
  1189. text-align: center;
  1190. box-sizing: border-box;
  1191. max-width: 120rpx;
  1192. padding: 10rpx;
  1193. >view {
  1194. width: 100%;
  1195. white-space: nowrap;
  1196. overflow: hidden;
  1197. text-overflow: ellipsis;
  1198. }
  1199. }
  1200. }
  1201. }
  1202. }
  1203. .interest-tags {
  1204. display: flex;
  1205. flex-wrap: wrap;
  1206. gap: 20rpx;
  1207. margin-top: 30rpx;
  1208. padding: 0 20rpx;
  1209. .interest-tag {
  1210. padding: 16rpx 24rpx;
  1211. background: #ffffff;
  1212. border-radius: 100rpx;
  1213. font-size: 28rpx;
  1214. color: #333333;
  1215. display: flex;
  1216. align-items: center;
  1217. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  1218. position: relative;
  1219. .remove-tag {
  1220. margin-left: 12rpx;
  1221. font-size: 32rpx;
  1222. color: #333333;
  1223. padding: 0 6rpx;
  1224. display: flex;
  1225. align-items: center;
  1226. position: relative;
  1227. z-index: 1;
  1228. &::after {
  1229. content: "";
  1230. position: absolute;
  1231. left: -8rpx;
  1232. right: -8rpx;
  1233. top: -8rpx;
  1234. bottom: -8rpx;
  1235. z-index: 0;
  1236. }
  1237. }
  1238. }
  1239. .add-tag {
  1240. padding: 16rpx 24rpx;
  1241. background: #ffffff;
  1242. border-radius: 100rpx;
  1243. font-size: 28rpx;
  1244. color: #333333;
  1245. display: flex;
  1246. align-items: center;
  1247. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  1248. .add-icon {
  1249. width: 32rpx;
  1250. height: 32rpx;
  1251. margin-right: 12rpx;
  1252. }
  1253. }
  1254. }
  1255. .bottom-button {
  1256. position: fixed;
  1257. left: 40rpx;
  1258. right: 40rpx;
  1259. bottom: 40rpx;
  1260. height: 88rpx;
  1261. background: #000;
  1262. border-radius: 44rpx;
  1263. color: #fff;
  1264. font-size: 32rpx;
  1265. display: flex;
  1266. align-items: center;
  1267. justify-content: center;
  1268. transition: all 0.3s ease;
  1269. &.step2 {
  1270. background: linear-gradient(90deg, #acf934 0%, #23c343 100%);
  1271. color: #000;
  1272. }
  1273. }
  1274. .add-tag-popup {
  1275. background: #ffffff;
  1276. border-radius: 24rpx;
  1277. width: 580rpx;
  1278. height: 70vh;
  1279. max-height: 800rpx;
  1280. display: flex;
  1281. flex-direction: column;
  1282. .popup-title {
  1283. padding: 40rpx 30rpx 20rpx;
  1284. font-size: 32rpx;
  1285. color: #333333;
  1286. text-align: center;
  1287. font-weight: 600;
  1288. flex-shrink: 0;
  1289. }
  1290. .popup-content {
  1291. flex: 1;
  1292. overflow-y: auto;
  1293. padding: 0 30rpx;
  1294. margin-bottom: 20rpx;
  1295. .popup-input {
  1296. margin-bottom: 30rpx;
  1297. .tag-input {
  1298. width: 100%;
  1299. height: 80rpx;
  1300. background: #f2f6f2;
  1301. border-radius: 12rpx;
  1302. padding: 0 24rpx;
  1303. font-size: 28rpx;
  1304. color: #333333;
  1305. &.disabled {
  1306. background: rgba(0, 0, 0, 0.02);
  1307. color: #999;
  1308. }
  1309. }
  1310. }
  1311. .selected-tags {
  1312. .selected-tags-title {
  1313. font-size: 28rpx;
  1314. color: #666666;
  1315. margin-bottom: 20rpx;
  1316. display: flex;
  1317. align-items: center;
  1318. justify-content: space-between;
  1319. .max-hint {
  1320. font-size: 24rpx;
  1321. color: #ff6b6b;
  1322. }
  1323. }
  1324. .selected-tags-list {
  1325. display: flex;
  1326. flex-wrap: wrap;
  1327. gap: 16rpx;
  1328. .selected-tag {
  1329. padding: 12rpx 24rpx;
  1330. background: #f2f6f2;
  1331. border-radius: 100rpx;
  1332. font-size: 26rpx;
  1333. color: #333333;
  1334. }
  1335. }
  1336. }
  1337. }
  1338. .popup-buttons {
  1339. padding: 20rpx 30rpx 30rpx;
  1340. display: flex;
  1341. gap: 20rpx;
  1342. background: #ffffff;
  1343. flex-shrink: 0;
  1344. position: relative;
  1345. &::before {
  1346. content: "";
  1347. position: absolute;
  1348. left: 0;
  1349. right: 0;
  1350. top: -20rpx;
  1351. height: 20rpx;
  1352. background: linear-gradient(to top,
  1353. rgba(255, 255, 255, 1),
  1354. rgba(255, 255, 255, 0));
  1355. }
  1356. button {
  1357. flex: 1;
  1358. height: 80rpx;
  1359. border-radius: 12rpx;
  1360. font-size: 28rpx;
  1361. display: flex;
  1362. align-items: center;
  1363. justify-content: center;
  1364. border: none;
  1365. &.btn-cancel {
  1366. background: #ffffff;
  1367. color: #333333;
  1368. border: 2rpx solid #1f1f1f;
  1369. }
  1370. &.btn-confirm {
  1371. background: #333333;
  1372. color: #ffffff;
  1373. &.disabled {
  1374. opacity: 0.5;
  1375. background: #999;
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. .birthday-section,
  1382. .input-section,
  1383. .gender-section {
  1384. background: #fff;
  1385. padding: 20rpx;
  1386. border-radius: 20rpx;
  1387. .input-label {
  1388. font-size: 28rpx;
  1389. color: #333;
  1390. padding-bottom: 20rpx;
  1391. }
  1392. }
  1393. </style>