step.vue 42 KB

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