index.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. <template>
  2. <view class="app-page">
  3. <view class="top-bar-view">
  4. <view class="top-bg" :style="{background: bgImg ? null : 'linear-gradient(138deg, #ffecaf 0%, #fbf5e3 59%, #f5f6f8 100%)',
  5. opacity: '0.8'}">
  6. <image v-if="bgImg" style="width: 100%;display: block;" mode="widthFix" :src="bgImg"></image>
  7. </view>
  8. <view class="top-box">
  9. <view class="top-bar" :style="
  10. 'height:' +
  11. topData.height +
  12. 'px;' +
  13. 'padding-top:' +
  14. topData.top +
  15. 'px;padding-bottom:20rpx'
  16. ">
  17. </view>
  18. <view class="display-flex-between">
  19. <view class="login-box" @click="checkShowUserRegister()">
  20. <view class="avatar-wrap">
  21. <u--image width="126rpx" height="126rpx" radius="100%" shape="circle" bgColor="#d3c6b5"
  22. customStyle="border-radius:100%;" :src="
  23. avatarUrl != defaultAvatarUrl
  24. ? avatarUrl
  25. : `/static/defaultAvatar.png`
  26. " :fade="true" duration="450"></u--image>
  27. </view>
  28. <view class="user-info-wrap">
  29. <view class="userName-wrap">
  30. <text class="userName display-flex-content-center">{{
  31. userName ? userName : "登录/注册"
  32. }}
  33. </text>
  34. <u-icon
  35. name="edit-pen"
  36. size="20"
  37. ></u-icon>
  38. </view>
  39. <view class="vip-tag"
  40. :style="{background: `url(${user_grade_bg}) no-repeat center left`,marginTop:'8rpx',width:'96rpx',height:'32rpx', backgroundSize: '96rpx 32rpx',}">
  41. <!-- <view class="vip-text">{{userInfo.vip_name}}</view>-->
  42. </view>
  43. <text class="user-phone">{{ userInfo.phone }}</text>
  44. </view>
  45. </view>
  46. <view class="login-box pdt0">
  47. <view @click="JumpSetting()">
  48. <view class="mb5 display-flex-end">
  49. <u-icon
  50. name="setting"
  51. size="26"
  52. ></u-icon>
  53. </view>
  54. <view class="info-list" style="color: #999"
  55. v-if="userInfo.pid &&userInfo.agent && userInfo.agent.username ">
  56. <text>推荐人:{{ userInfo.agent.username }}</text>
  57. </view>
  58. <view class="info-list">
  59. <text>积分:
  60. <text class="info-list-rebate_total">{{ userInfo.integral_total - userInfo.integral_used }}</text>
  61. </text>
  62. </view>
  63. <view class="info-list">
  64. <text>余额:
  65. <text class="info-list-rebate_total">{{ customerInfo.balance_num}}</text>
  66. </text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="jion-vip-wrap" @click="checkShowUserRegister()"
  72. :style="{backgroundImage: `url(${jion_vip_bg})`}">
  73. <view class="title">
  74. 开通服务专享产品权益
  75. </view>
  76. <view class="title" v-if="!userInfo||!(userInfo.vip_code&&userInfo.vip_code>0)">
  77. 开通会员
  78. </view>
  79. </view>
  80. <view class="orders-info-card">
  81. <view class="orders-card">
  82. <view class="card-title">
  83. <text>商城订单</text>
  84. <view class="right" @click="toOrderList(0)">查看全部订单
  85. <view class="ml5">
  86. <u-icon name="arrow-right" size="13"
  87. color="#858585"></u-icon>
  88. </view>
  89. </view>
  90. </view>
  91. <u-line color="#F4F4F4"></u-line>
  92. <view class="menu-box">
  93. <view class="menu-item" @click="toOrderList(item.index)" v-for="(item, index) in shopList">
  94. <view style="position: relative;">
  95. <image :src="item.url" mode="heightFix"></image>
  96. <u-badge :absolute="true" :offset="[-5,-10]" :value="orderNumber[item.numKey]">
  97. </u-badge>
  98. </view>
  99. <text>{{ item.name }}</text>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="member-other-card">
  105. <view v-for="(item, index) in otherList" :key="index"
  106. @click="goToPath(item)">
  107. <u-line color="#E8E8E8"></u-line>
  108. <view class="display-flex-between">
  109. <view class="mt15 mb15 display-flex-content-center" :style="[getKefuStyle(item)]">
  110. <image :src="item.url" class="mr12" mode="heightFix" style="width: 36rpx;height: 36rpx"></image>
  111. <text class="member-other-card-name">{{ item.name }}</text>
  112. <button style="position: absolute;width: 690rpx;height:108rpx;z-index: 999;opacity: 0;;left: 10px"
  113. v-if="item.value == 'concat'" open-type="contact" @contact="contact"></button>
  114. </view>
  115. <view>
  116. <u-icon name="arrow-right" bold color="#333333" size="14"></u-icon>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <!-- <view class="member-info-card">-->
  122. <!-- <view class="member-card">-->
  123. <!-- <text class="card-title">分销商</text>-->
  124. <!-- <u-line color="#F4F4F4"></u-line>-->
  125. <!-- <view class="menu-box">-->
  126. <!-- <view class="menu-item" @click="goToPath(item)" v-for="(item, index) in menuList">-->
  127. <!-- <view class="menu-item-bgColor">-->
  128. <!-- <image :src="item.url" mode="heightFix"></image>-->
  129. <!-- <text>{{ item.name }}</text>-->
  130. <!-- </view>-->
  131. <!-- </view>-->
  132. <!-- </view>-->
  133. <!-- </view>-->
  134. <!-- </view>-->
  135. </view>
  136. </view>
  137. <u-popup :show="showUserRegister" @close="showUserRegister = false" round="18rpx">
  138. <form v-if="!isUserRegister" @submit="saveUserData">
  139. <view class="m-content-view">
  140. <text class="top-view"> {{ shopName }}</text>
  141. <text class="tips">请您授权头像昵称信息,您授权的信息将受到严格保护,请放心使用。</text>
  142. <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"
  143. style="border: 0">
  144. <u--image v-if="avatarUrl !== defaultAvatarUrl" width="149rpx" height="149rpx" radius="100%"
  145. shape="circle" :src="avatarUrl" :fade="true" duration="450" mode="heightFix"></u--image>
  146. <view class="v1" v-else>
  147. <u--image width="80rpx" height="80rpx" radius="100%" shape="circle" :src="avatarUrl"
  148. :fade="true" duration="450" mode="heightFix"></u--image>
  149. <text v-if="avatarUrl === defaultAvatarUrl">获取头像</text>
  150. </view>
  151. </button>
  152. <input name="nickname" v-model="userName" type="nickname" class="m-input" placeholder="请输入昵称"/>
  153. <button class="red-btn" form-type="submit">确认授权</button>
  154. </view>
  155. </form>
  156. </u-popup>
  157. <tabbarCom current="4"></tabbarCom>
  158. </view>
  159. </template>
  160. <script>
  161. import tabbarCom from "@/components/tabbar/tabbar.vue"
  162. import {
  163. uploadBase64File,
  164. getNewRemindCnt,
  165. addAddress,
  166. } from "@/common/api/common.js";
  167. import {
  168. getOrderList
  169. } from "@/common/api/order.js";
  170. import {
  171. updateUserInfo,
  172. getUserInfo,
  173. userBindNickname,
  174. getCustomerInfo
  175. } from "@/common/api/user.js";
  176. const defaultAvatarUrl =
  177. "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0";
  178. import $C from "@/common/utils/config.js";
  179. export default {
  180. components: {
  181. tabbarCom
  182. },
  183. data() {
  184. return {
  185. topData: {
  186. top: 0,
  187. height: 0,
  188. },
  189. shopName: "六感熟眠商城",
  190. bgImg: null,
  191. jion_vip_bg: 'https://work.hkmop.com/static/imgs/jion_vip_bg.png',
  192. user_grade_bg: '', //#f4c530
  193. tips: "登录/注册",
  194. defaultAvatarUrl,
  195. avatarUrl: defaultAvatarUrl,
  196. isUserRegister: false,
  197. showUserRegister: false,
  198. userName: "",
  199. userInfo: undefined,
  200. customerInfo: undefined,
  201. badgeValue: 0,
  202. userData: {},
  203. newRemindCnt: 0,
  204. orderNumber: {},
  205. menuList: [{
  206. name: "推广海报",
  207. url: require("@/static/ic-menu-a.png"),
  208. path: "/subPages/poster/poster",
  209. isVip: true
  210. },
  211. {
  212. name: "我的团队",
  213. url: require("@/static/ic-menu-b.png"),
  214. path: "/subPages/myTeam/myTeam",
  215. isVip: true
  216. },
  217. {
  218. name: "分销订单",
  219. url: require("@/static/ic-menu-c.png"),
  220. path: "/subPages/distribution/distribution",
  221. isVip: true
  222. },
  223. {
  224. name: "提现记录",
  225. url: require("@/static/ic-menu-d.png"),
  226. path: "/subPages/withdrawalManagement/withdrawalManagement",
  227. isVip: true
  228. },
  229. {
  230. name: "提现",
  231. url: require("@/static/ic-menu-e.png"),
  232. path: "/subPages/applyWithdrawal/applyWithdrawal",
  233. isVip: true
  234. },
  235. ],
  236. shopList: [{
  237. name: "待付款",
  238. url: require("@/static/ic-shop-a.png"),
  239. value: '1,2',
  240. index: 1,
  241. numKey: 'toPay'
  242. },
  243. {
  244. name: "待发货",
  245. url: require("@/static/ic-shop-b.png"),
  246. value: '3',
  247. index: 2,
  248. numKey: 'toSend'
  249. },
  250. {
  251. name: "待收货",
  252. url: require("@/static/ic-shop-c.png"),
  253. value: '4',
  254. index: 3,
  255. numKey: 'toConfirm'
  256. },
  257. {
  258. name: "已完成",
  259. url: require("@/static/ic-shop-d.png"),
  260. value: '6,9',
  261. index: 4,
  262. numKey: 'complate'
  263. },
  264. {
  265. name: "退款/售后",
  266. url: require("@/static/ic-shop-e.png"),
  267. index: 5,
  268. numKey: 'afterSales'
  269. },
  270. ],
  271. otherList: [
  272. {
  273. name: "我的活动",
  274. url: require("@/static/ic-other-h.png"),
  275. path: "/subPages/myOrder/myActivityOrder",
  276. isVip: true
  277. },
  278. {
  279. name: "线下消费记录",
  280. url: require("@/static/ic-other-i.png"),
  281. path: "/subPages/storeConsumption/storeConsumptionOrder",
  282. isVip: true
  283. },
  284. // {
  285. // name: "线下消费记录",
  286. // url: require("@/static/ic-other-i.png"),
  287. // path: "/subPages/storeConsumption/storeConsumption?orderNo=SP20250526251999",
  288. // isVip: true
  289. // },
  290. {
  291. name: "课程订单",
  292. url: require("@/static/ic-other-f.png"),
  293. path: "/subPages/myOrder/myCourseOrder",
  294. isVip: true
  295. },
  296. {
  297. name: "服务预约",
  298. url: require("@/static/ic-other-g.png"),
  299. path: "/subPages/myOrder/myServerOrder",
  300. isVip: true
  301. },
  302. {
  303. name: "优惠券",
  304. url: require("@/static/ic-other-a.png"),
  305. path: "/subPages/coupon/coupon",
  306. isVip: true
  307. },
  308. {
  309. name: "地址管理",
  310. url: require("@/static/ic-other-b.png"),
  311. path: "/subPages/addressMg/addressMg",
  312. isVip: true
  313. },
  314. {
  315. name: "我的收藏",
  316. url: require("@/static/ic-other-cooprule.png"),
  317. path: "/subPages/collectList/collectList",
  318. isVip: true
  319. },
  320. {
  321. name: "帮助中心",
  322. url: require("@/static/ic-other-c.png"),
  323. path: "/subPages/helpCenter/helpCenter",
  324. },
  325. {
  326. name: "关于我们",
  327. url: require("@/static/ic-other-d.png"),
  328. path: "/pages/singlePage/index?name=3",
  329. },
  330. {
  331. name: "在线客服",
  332. url: require("@/static/ic-other-e.png"),
  333. value: 'concat'
  334. },
  335. ],
  336. };
  337. },
  338. computed: {
  339. displayBalance() {
  340. const {
  341. balance_total,
  342. balance_used
  343. } = this.userInfo || {};
  344. return balance_total - balance_used;
  345. },
  346. },
  347. created() {
  348. const configs = uni.getStorageSync("configs");
  349. if (configs) {
  350. this.shopName = configs.shop_name
  351. this.bgImg = configs.ucenter_bg
  352. this.jion_vip_bg = configs.user_in_bg
  353. this.user_grade_bg = configs.user_grade_bg
  354. }
  355. },
  356. mounted() {
  357. },
  358. //发送给朋友
  359. onShareAppMessage(res) {
  360. let configs = uni.getStorageSync('configs') || {}
  361. return {
  362. title: configs.shop_share_title,
  363. imageUrl: configs.shop_share_img,
  364. path: `/pages/home/dashboard/index?id=${
  365. JSON.parse(uni.getStorageSync("userInfo")).id
  366. }`,
  367. };
  368. },
  369. // 分享到朋友圈
  370. onShareTimeline() {
  371. let configs = uni.getStorageSync('configs') || {}
  372. return {
  373. title: configs.shop_share_title,
  374. imageUrl: configs.shop_share_img,
  375. path: `/pages/home/dashboard/index?id=${
  376. JSON.parse(uni.getStorageSync("userInfo")).id
  377. }`
  378. };
  379. },
  380. onShow() {
  381. const topData = uni.getMenuButtonBoundingClientRect();
  382. this.topData.top = topData.top;
  383. this.topData.height = topData.height;
  384. this.reUserInfo();
  385. this.getUserInfo();
  386. // this.getOrderListCount()
  387. },
  388. methods: {
  389. contact(res) {
  390. console.log(345555, res)
  391. },
  392. getOrderStatics() {
  393. this.$api.getOrderStatics({goods_kind:'线上商品'}).then(res => {
  394. const {
  395. t1 = 0, t2 = 0, t3 = 0, t4 = 0, t6 = 0, t9 = 0
  396. } = res.data
  397. this.orderNumber = {
  398. toPay: t1 + t2,
  399. toSend: t3,
  400. toConfirm: t4,
  401. complate: t6 + t9,
  402. afterSales: res.data.t - 1 + res.data.t - 2,
  403. }
  404. })
  405. },
  406. getKefuStyle(item){
  407. if(item.value == 'concat'){
  408. return {
  409. display: "relative",
  410. }
  411. }
  412. },
  413. checkShowUserRegister() {
  414. if (!this.isUserRegister) {
  415. this.showUserRegister = true;
  416. return true;
  417. } else {
  418. // if (this.userInfo.vip_code && this.userInfo.vip_code != "0") {
  419. // this.toSubPages("personalDataManagement");
  420. // } else {
  421. // this.toSubPages("register");
  422. //
  423. // }
  424. this.toSubPages("personalDataManagement");
  425. return false;
  426. }
  427. },
  428. JumpSetting() {
  429. this.toSubPages("setting");
  430. },
  431. reUserInfo() {
  432. const userInfo = uni.getStorageSync("userInfo");
  433. if (
  434. userInfo &&
  435. JSON.parse(userInfo).nickname != "" &&
  436. JSON.parse(userInfo).headimg != ""
  437. ) {
  438. this.userInfo = JSON.parse(userInfo);
  439. this.avatarUrl = this.userInfo.headimg;
  440. this.userName = this.userInfo.nickname;
  441. this.isUserRegister = true;
  442. this.getOrderStatics()
  443. } else {
  444. this.isUserRegister = false;
  445. }
  446. },
  447. toOrderList(str = 0) {
  448. if (!this.isUserRegister) {
  449. this.showUserRegister = true;
  450. return true;
  451. }
  452. uni.setStorageSync("orderIndex", str);
  453. uni.navigateTo({
  454. url: "/subPages/myOrder/myOrder",
  455. });
  456. },
  457. goToPath(item) {
  458. if (item.isVip) {
  459. if (!this.isUserRegister) {
  460. this.showUserRegister = true;
  461. return true;
  462. }
  463. }
  464. if (!item.path) {
  465. return;
  466. }
  467. uni.navigateTo({
  468. url: item.path,
  469. });
  470. },
  471. toSubPages(index) {
  472. uni.navigateTo({
  473. url: `/subPages/${index}/index`,
  474. });
  475. },
  476. // 获取未支付数量
  477. getOrderListCount() {
  478. uni.showLoading();
  479. const data = {
  480. status: 2,
  481. page: this.page,
  482. limit: this.limit,
  483. };
  484. getOrderList(data)
  485. .then((res) => {
  486. uni.hideLoading();
  487. console.log("getOrderList==>", res.data.list);
  488. if (res.data) {
  489. this.badgeValue = res.data.page.total;
  490. }
  491. })
  492. .catch(() => {
  493. uni.hideLoading();
  494. });
  495. },
  496. bindNickname(url) {
  497. this.isUserRegister = true;
  498. this.showUserRegister = false;
  499. const data = {
  500. nickname: this.userName,
  501. username: this.userName,
  502. headimg: url,
  503. };
  504. userBindNickname(data).then((res) => {
  505. console.log("绑定昵称等==>", res.data);
  506. if (res.data) {
  507. uni.setStorageSync("token", res.data.token.token);
  508. if (!res.data.headimg) {
  509. res.data.headimg = url;
  510. }
  511. uni.setStorageSync("userInfo", JSON.stringify(res.data));
  512. this.isUserRegister = true;
  513. this.showUserRegister = false;
  514. this.toSubPages("register");
  515. }
  516. });
  517. },
  518. addAddress(addressData) {
  519. this.isUserRegister = true;
  520. this.showUserRegister = false;
  521. const data = {
  522. type: 1,
  523. name: addressData.userName,
  524. phone: addressData.telNumber,
  525. province: addressData.provinceName,
  526. city: addressData.cityName,
  527. area: addressData.countyName,
  528. address: addressData.detailInfo,
  529. };
  530. addAddress(data).then((res) => {
  531. // console.log("addAddress==>", res.data);
  532. if (res.data) {
  533. uni.showToast({
  534. title: "添加成功",
  535. success: (res) => {
  536. },
  537. });
  538. }
  539. });
  540. },
  541. async getUserInfo() {
  542. const data = {};
  543. await getUserInfo(data)
  544. .then((res) => {
  545. if (res.data) {
  546. // uni.clearStorageSync()
  547. uni.setStorageSync("token", res.data.token.token);
  548. uni.setStorageSync("userInfo", JSON.stringify(res.data));
  549. this.userInfo = res.data;
  550. // console.log("getUserInfo==>", this.userInfo);
  551. }
  552. })
  553. .catch(() => {
  554. uni.hideLoading();
  555. });
  556. await this.reUserInfo();
  557. getCustomerInfo({msgFlag:false}).then(res => {
  558. this.customerInfo = res.data||{}
  559. if (this.customerInfo){
  560. this.customerInfo.balance_total = this.customerInfo.balance_total ? parseFloat(this.customerInfo.balance_total) : 0;
  561. this.customerInfo.balance_used = this.customerInfo.balance_used ? parseFloat(this.customerInfo.balance_used) : 0;
  562. this.customerInfo.balance_num = this.customerInfo.balance_total - this.customerInfo.balance_used;
  563. }
  564. })
  565. },
  566. getNewRemindCnt() {
  567. const data = {};
  568. getNewRemindCnt(data)
  569. .then((res) => {
  570. // console.log("getNewRemindCnt==>", res.data);
  571. // if (res.data) {
  572. this.newRemindCnt = res.data || 0;
  573. // }
  574. })
  575. .catch(() => {
  576. uni.hideLoading();
  577. });
  578. },
  579. onChooseAvatar(e) {
  580. const {
  581. avatarUrl
  582. } = e.detail;
  583. console.log("成功授权", avatarUrl);
  584. this.avatarUrl = avatarUrl;
  585. },
  586. saveUserData(e) {
  587. console.log(e.detail.value.nickname);
  588. if (
  589. this.avatarUrl === this.defaultAvatarUrl ||
  590. !e.detail.value.nickname
  591. ) {
  592. uni.showToast({
  593. icon: "none",
  594. title: "请先授权完善信息",
  595. });
  596. return;
  597. }
  598. this.userName = e.detail.value.nickname;
  599. this.showUserRegister = false;
  600. this.getImageInfo();
  601. },
  602. getImageInfo() {
  603. // 获取当前图片信息
  604. uni.getImageInfo({
  605. src: this.avatarUrl,
  606. success: (image) => {
  607. // 做png/jpeg的类型判断————对不同类型的图像添加不同的转换头信息
  608. if (image.type == "png" || image.type == "jpeg") {
  609. // 对符合类型的图片转换为base64类型
  610. uni.getFileSystemManager().readFile({
  611. // 【重点来啦】人家自提供的转码API
  612. filePath: image.path, // 所需转码图像路径
  613. encoding: "base64", // 转码类型
  614. success: (res) => {
  615. // 生成base64
  616. let imageBase64 =
  617. "data:image/" + image.type + ";base64," + res.data;
  618. console.log("转base64后:", imageBase64);
  619. this.uploadBase64File(imageBase64);
  620. },
  621. });
  622. } else {
  623. // 友好一点,不是以上类型做出提醒
  624. uni.showToast({
  625. title: "当前只支持png/jpeg格式",
  626. duration: 2500,
  627. icon: "none",
  628. });
  629. }
  630. },
  631. });
  632. },
  633. uploadBase64File(imageBase64) {
  634. uploadBase64File({
  635. base64: imageBase64,
  636. }, {
  637. "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
  638. })
  639. .then((res) => {
  640. console.log("uploadFile==>", res.data.url);
  641. this.avatarUrl = res.data.url;
  642. this.bindNickname(res.data.url);
  643. })
  644. .catch(() => {
  645. uni.hideLoading();
  646. });
  647. },
  648. },
  649. };
  650. </script>
  651. <style lang="scss" scoped>
  652. .app-page {
  653. width: 100%;
  654. display: flex;
  655. flex-direction: column;
  656. }
  657. .top-bg {
  658. width: 750rpx;
  659. height: 634rpx;
  660. overflow: hidden;
  661. }
  662. .not-regis-box,
  663. .regis-box {
  664. margin-left: 20rpx;
  665. margin-top: 7rpx;
  666. height: 36rpx;
  667. line-height: 36rpx;
  668. padding: 0 10rpx;
  669. font-size: 22rpx;
  670. font-weight: bold;
  671. color: #9a9a9a;
  672. background: #e3e3e3;
  673. border-radius: 7rpx;
  674. display: inline-flex;
  675. align-items: center;
  676. .user-name-text {
  677. margin-left: 6rpx;
  678. }
  679. }
  680. .regis-box {
  681. background: rgba(231, 224, 255, 0.85);
  682. color: #815bff;
  683. }
  684. .top-bar-view {
  685. width: 100%;
  686. position: relative;
  687. display: flex;
  688. align-items: center;
  689. flex-direction: column;
  690. }
  691. .top-box {
  692. position: absolute;
  693. left: 0;
  694. top: 0;
  695. right: 0;
  696. display: flex;
  697. flex-direction: column;
  698. }
  699. .top-bar {
  700. width: 100%;
  701. display: flex;
  702. justify-content: center;
  703. align-items: center;
  704. flex-direction: row;
  705. }
  706. .m-content-view {
  707. width: 100%;
  708. display: flex;
  709. align-items: center;
  710. flex-direction: column;
  711. background-color: #f7f7f7;
  712. border-radius: 24rpx 24rpx 0 0;
  713. }
  714. .top-view {
  715. font-size: 32rpx;
  716. font-family: PingFangSC-Medium, PingFang SC;
  717. font-weight: 500;
  718. color: #1d161f;
  719. line-height: 34rpx;
  720. text-align: left;
  721. margin: 55rpx 49rpx 0;
  722. width: calc(100% - 98rpx);
  723. }
  724. .tips {
  725. font-size: 26rpx;
  726. font-weight: 400;
  727. color: #858585;
  728. line-height: 34rpx;
  729. margin: 21rpx 49rpx 0;
  730. }
  731. .red-btn {
  732. color: white;
  733. background: #f39800;
  734. width: calc(100% - 98rpx);
  735. margin-top: 52rpx;
  736. margin-bottom: 52rpx;
  737. font-size: 32rpx;
  738. line-height: 84rpx;
  739. border-radius: 40rpx;
  740. text-align: center;
  741. }
  742. .red-btn:active {
  743. opacity: 0.7;
  744. }
  745. .v1 {
  746. height: 149rpx;
  747. width: 149rpx;
  748. display: flex;
  749. flex-direction: column;
  750. background: rgba(244, 244, 246, 1);
  751. border-radius: 100%;
  752. align-items: center;
  753. justify-content: center;
  754. }
  755. .avatar-wrapper {
  756. margin-top: 26rpx;
  757. }
  758. .avatar-wrapper button::before {
  759. padding: 0;
  760. border-radius: 20rpx;
  761. border: 0;
  762. }
  763. .avatar {
  764. height: 100rpx;
  765. width: 100rpx;
  766. }
  767. .v1 text {
  768. font-size: 22rpx;
  769. margin-top: -16rpx;
  770. }
  771. // 去掉烦人的边框
  772. button::after {
  773. border: 0; // 或者 border: none;
  774. }
  775. .m-input {
  776. width: calc(100% - 138rpx);
  777. line-height: 117rpx;
  778. padding: 0 20rpx;
  779. margin-top: 44rpx;
  780. background: #ffffff;
  781. border-radius: 15rpx;
  782. height: 117rpx;
  783. }
  784. .mine-box {
  785. width: 100%;
  786. display: flex;
  787. flex-direction: column;
  788. position: relative;
  789. }
  790. .mine-bg {
  791. width: 100%;
  792. display: block;
  793. height: 1334rpx;
  794. }
  795. .mine-view {
  796. left: 0;
  797. top: 0;
  798. right: 0;
  799. width: 100%;
  800. display: flex;
  801. flex-direction: column;
  802. position: absolute;
  803. }
  804. .top-title-view {
  805. display: flex;
  806. width: 100%;
  807. flex-direction: row;
  808. align-items: center;
  809. }
  810. .login-box {
  811. display: flex;
  812. flex-direction: row;
  813. align-items: center;
  814. padding: 10px 30rpx 0;
  815. }
  816. .avatar-wrap {
  817. position: relative;
  818. .vip-tag {
  819. display: flex;
  820. align-items: center;
  821. margin-top: 8rpx;
  822. .vip-text {
  823. font-size: 20rpx;
  824. font-weight: 500;
  825. margin-left: 34rpx;
  826. color: #632400;
  827. width: 122rpx;
  828. line-height: 38rpx;
  829. text-align: center;
  830. border-radius: 0rpx 20rpx 20rpx 0rpx;
  831. }
  832. }
  833. }
  834. .user-info-wrap {
  835. flex: 1;
  836. margin-left: 28rpx;
  837. .userName-wrap {
  838. display: flex;
  839. align-items: center;
  840. font-weight: 400;
  841. font-size: 28rpx;
  842. color: #333333;
  843. line-height: 44rpx;
  844. text-align: left;
  845. font-style: normal;
  846. text-transform: none;
  847. }
  848. }
  849. .userName-box {
  850. display: flex;
  851. flex-direction: row;
  852. align-items: center;
  853. justify-content: flex-start;
  854. }
  855. .userName {
  856. font-size: 28rpx;
  857. // margin-left: 26rpx;
  858. font-family: PingFang;
  859. font-weight: 600;
  860. color: #333333;
  861. line-height: 44rpx;
  862. text-align: left;
  863. font-style: normal;
  864. text-transform: none;
  865. }
  866. .info-list text {
  867. margin-top: 10rpx;
  868. font-size: 22rpx;
  869. // margin-left: 26rpx;
  870. font-family: PingFang;
  871. font-weight: 400;
  872. color: #333333;
  873. line-height: 40rpx;
  874. text-align: left;
  875. font-style: normal;
  876. text-transform: none;
  877. }
  878. .info-list-rebate_total {
  879. //font-family: Aoboshi One, Aoboshi One!important;
  880. //color: #512C19!important;
  881. //line-height: 40rpx!important;
  882. //text-align: left!important;
  883. //font-style: normal!important;
  884. //text-transform: none!important;
  885. //font-weight: 700!important;
  886. //font-size: 40rpx!important;
  887. }
  888. .user-phone {
  889. margin-top: 8rpx;
  890. font-size: 22rpx;
  891. // margin-left: 26rpx;
  892. font-family: PingFang;
  893. font-weight: 400;
  894. color: #333333;
  895. line-height: 28rpx;
  896. text-align: left;
  897. font-style: normal;
  898. text-transform: none;
  899. }
  900. .right-box {
  901. padding-right: 56rpx;
  902. position: relative;
  903. }
  904. .jion-vip-wrap {
  905. background-size: 100% 100%;
  906. display: flex;
  907. justify-content: space-between;
  908. align-items: center;
  909. height: 128rpx;
  910. margin: 40rpx 30rpx 0rpx;
  911. padding: 0 96rpx 0 84rpx;
  912. .title {
  913. font-family: 苹方-Regular, 苹方;
  914. font-weight: 700;
  915. font-size: 28rpx;
  916. color: #512C19;
  917. line-height: 40rpx;
  918. text-align: left;
  919. font-style: normal;
  920. text-transform: none;
  921. }
  922. .docs {
  923. font-family: PingFang SC-Medium, PingFang SC;
  924. font-weight: 400;
  925. font-size: 24rpx;
  926. color: #512C19;
  927. line-height: 36rpx;
  928. text-align: right;
  929. font-style: normal;
  930. text-transform: none;
  931. }
  932. }
  933. .kthy {
  934. flex: 1;
  935. font-size: 26rpx;
  936. font-family: PingFang;
  937. font-weight: 400;
  938. color: #000000;
  939. }
  940. .kthy-btn {
  941. width: 106rpx;
  942. height: 40rpx;
  943. border: 1rpx solid #000000;
  944. border-radius: 4rpx;
  945. font-size: 22rpx;
  946. font-family: PingFang;
  947. font-weight: 400;
  948. color: #010101;
  949. text-align: center;
  950. margin-right: 20rpx;
  951. line-height: 40rpx;
  952. }
  953. .card-box {
  954. width: 690rpx;
  955. margin: 20rpx auto 0 auto;
  956. background: #ffffff;
  957. border-radius: 21rpx;
  958. display: flex;
  959. flex-direction: column;
  960. }
  961. .bottom-item {
  962. width: 100%;
  963. display: flex;
  964. flex-direction: column;
  965. position: relative;
  966. .bottom-item-h {
  967. width: 100%;
  968. display: flex;
  969. flex-direction: row;
  970. text {
  971. flex: 1;
  972. font-size: 26rpx;
  973. margin: 30rpx 40rpx;
  974. font-family: PingFang;
  975. font-weight: 400;
  976. color: #333333;
  977. line-height: 28rpx;
  978. }
  979. }
  980. }
  981. .orders-info-card {
  982. width: 650rpx;
  983. padding: 0 20rpx;
  984. margin: 25rpx auto 0;
  985. border-radius: 18rpx;
  986. overflow: hidden;
  987. display: flex;
  988. flex-direction: column;
  989. background-color: #FFFFFF;
  990. .orders-card {
  991. width: 650rpx;
  992. height: 273rpx;
  993. background: #ffffff;
  994. display: flex;
  995. flex-direction: column;
  996. border-radius: 18rpx 18rpx 18rpx 18rpx;
  997. .card-title {
  998. display: flex;
  999. align-items: center;
  1000. justify-content: space-between;
  1001. .right {
  1002. display: flex;
  1003. align-items: center;
  1004. font-size: 24rpx;
  1005. font-weight: 400;
  1006. color: #858585;
  1007. line-height: 1;
  1008. }
  1009. }
  1010. .menu-box {
  1011. flex: 1;
  1012. width: 100%;
  1013. display: flex;
  1014. flex-direction: row;
  1015. align-items: center;
  1016. .menu-item {
  1017. flex: 1;
  1018. height: 100%;
  1019. display: flex;
  1020. flex-direction: column;
  1021. align-items: center;
  1022. justify-content: center;
  1023. position: relative;
  1024. image {
  1025. width: 46rpx;
  1026. margin-bottom: 14rpx;
  1027. height: 46rpx;
  1028. }
  1029. text {
  1030. font-size: 26rpx;
  1031. font-family: PingFang SC-Medium, PingFang SC;
  1032. font-weight: 500;
  1033. color: #1d161f;
  1034. }
  1035. }
  1036. }
  1037. }
  1038. }
  1039. .member-info-card {
  1040. width: 650rpx;
  1041. padding: 0 20rpx;
  1042. margin: 0rpx auto 180rpx;
  1043. // height: 349rpx;
  1044. border-radius: 18rpx 18rpx 18rpx 18rpx;
  1045. overflow: hidden;
  1046. display: flex;
  1047. flex-direction: column;
  1048. background-color: #FFFFFF;
  1049. .member-card {
  1050. width: 650rpx;
  1051. height: 273rpx;
  1052. background: #ffffff;
  1053. display: flex;
  1054. flex-direction: column;
  1055. border-radius: 18rpx 18rpx 18rpx 18rpx;
  1056. .menu-box {
  1057. flex: 1;
  1058. width: 100%;
  1059. display: flex;
  1060. flex-direction: row;
  1061. align-items: center;
  1062. .menu-item {
  1063. flex: 1;
  1064. height: 100%;
  1065. display: flex;
  1066. flex-direction: column;
  1067. align-items: center;
  1068. justify-content: center;
  1069. position: relative;
  1070. &-bgColor{
  1071. height: 65%;
  1072. width: 85%;
  1073. background: #F6F7F9;
  1074. border-radius: 4rpx 4rpx 4rpx 4rpx;
  1075. display: flex;
  1076. flex-direction: column;
  1077. align-items: center;
  1078. justify-content: center;
  1079. image {
  1080. width: 36rpx;
  1081. margin-bottom: 14rpx;
  1082. height: 36rpx;
  1083. }
  1084. text {
  1085. font-family: PingFang SC, PingFang SC;
  1086. font-weight: 400;
  1087. font-size: 22rpx;
  1088. color: #333333;
  1089. line-height: 32rpx;
  1090. text-align: right;
  1091. font-style: normal;
  1092. text-transform: none;
  1093. }
  1094. }
  1095. }
  1096. }
  1097. }
  1098. }
  1099. .card-title {
  1100. font-size: 28rpx;
  1101. font-family: PingFang SC-Bold, PingFang SC;
  1102. font-weight: bold;
  1103. color: #1d161f;
  1104. padding-left: 10rpx;
  1105. line-height: 91rpx;
  1106. }
  1107. .member-other-card {
  1108. width: 650rpx;
  1109. // height: 273rpx;
  1110. margin: 20rpx auto 20rpx auto;
  1111. padding: 0 20rpx;
  1112. background: #ffffff;
  1113. display: flex;
  1114. flex-direction: column;
  1115. border-radius: 18rpx 18rpx 18rpx 18rpx;
  1116. &-name{
  1117. font-family: PingFang SC, PingFang SC;
  1118. font-weight: 400;
  1119. font-size: 28rpx;
  1120. color: #333333;
  1121. line-height: 48rpx;
  1122. text-align: left;
  1123. font-style: normal;
  1124. text-transform: none;
  1125. }
  1126. }
  1127. </style>