my.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560
  1. <template>
  2. <view class="my-container">
  3. <view class="container-bg"></view>
  4. <cu-custom bgColor="#fff">
  5. <view slot="content" style="color: #FFFFFF">UU睡眠</view>
  6. </cu-custom>
  7. <view class="flex-col justify-start page">
  8. <view class="flex-col group_2 space-y-10">
  9. <view v-if="memberId" class="flex-col justify-start items-start my_device_header">
  10. <view class="flex-col section pos">
  11. <view class="flex-col my_device_profile">
  12. <view class="flex-row space-x-19">
  13. <image v-if="userInfo.face" class="shrink-0 image_5" :src="userInfo.face" @click="handleUpdateFace"/>
  14. <image v-else class="shrink-0 image_5" src="http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/389DD3BFC0D343EB9465D84BEA657D67.png" @click="handleUpdateFace"/>
  15. <view class="flex-col flex-auto self-center space-y-14">
  16. <view class="flex-row space-x-8">
  17. <text class="text_2">{{ userInfo.nickname }}</text>
  18. <view class="flex-row shrink-0 section_3 space-x-4">
  19. <text class="font_2" @click="handleUpdateName"><text class="cuIcon-write"></text>编辑</text>
  20. </view>
  21. </view>
  22. <view class="flex-row items-center space-x-6">
  23. <text class="font_3 text_3"><text class="cuIcon-phone margin-right-sm"></text>{{ userInfo.mobile }}</text>
  24. </view>
  25. </view>
  26. <image @click="goPage('/pages/log/warn/index')" class="shrink-0 self-start image_6" src="../../static/mine/myIconAlert.png"/>
  27. </view>
  28. <view class="flex-row justify-between relative group_4">
  29. <view class="flex-col justify-start items-center self-center text-wrapper">
  30. <text class="font_4" @click="loginOut">重新绑定</text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- <view class="flex-col items-center text-center power-module">-->
  35. <!-- <image-->
  36. <!-- class="image_9"-->
  37. <!-- src="../../static/mine/myIconPower.png"-->
  38. <!-- />-->
  39. <!-- <text class="self-end text_4">1,548</text>-->
  40. <!-- </view>-->
  41. </view>
  42. </view>
  43. <view v-else class="flex-col justify-start items-start my_device_header">
  44. <view class="flex-col section pos">
  45. <view class="flex-col my_device_profile">
  46. <view @click="handleAuth" class="flex-row space-x-19">
  47. <image class="shrink-0 image_5" src="http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/389DD3BFC0D343EB9465D84BEA657D67.png"/>
  48. <view class="flex-col flex-auto self-center space-y-14">
  49. <view class="flex-row space-x-8">
  50. <text class="text_2">未登录用户</text>
  51. </view>
  52. </view>
  53. <image class="shrink-0 self-start image_6" src="../../static/mine/myIconAlert.png"/>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="flex-col group_5 space-y-30">
  59. <view class="flex-col space-y-10 my_devices">
  60. <view class="flex-row justify-between">
  61. <text class="font_1 text_5 pos_2">我的设备</text>
  62. <view class="flex-row items-center section_4 pos_3">
  63. <text class="font_5" @click="addBindDevice">添加设备<text class="cuIcon-add"></text></text>
  64. </view>
  65. </view>
  66. <!-- device = 0 -->
  67. <view v-if="deviceList.length === 0">
  68. <view class="flex-row justify-center items-center home_add_devive space-x-10" @click="addBindDevice">
  69. <image class="image_4" src="../../static/home/homeIconAdd.png"/>
  70. <view class="text_5" @click="addBindDevice">添加设备</view>
  71. </view>
  72. <view class="flex-row justify-center items-center home_add_devive space-x-10 margin-top-xs" @click="goBuy">
  73. <image class="image_4" src="../../static/home/homeIconAdd.png"/>
  74. <view class="text_5" @click="goBuy">购买设备</view>
  75. </view>
  76. </view>
  77. <view v-if="deviceList.length > 0" v-for="(item, index) in deviceList" :key="index" class="flex-col my_device_default space-y-6">
  78. <view class="flex-row justify-between items-end">
  79. <view class="flex-col space-y-16">
  80. <view class="flex-row space-x-8">
  81. <text class="font_4 text_6 text_8">设备</text>
  82. <text class="font_6">睡眠床垫</text>
  83. <text class="font_4 text_6 text_8">使用人</text>
  84. <text v-if="!item.user_name" class="font_6" @click="changeUserNameShow(item.user_name, item.device_id)">自己<text class="cuIcon-write"></text></text>
  85. <text v-else class="font_6" @click="changeUserNameShow(item.user_name, item.device_id)">{{ item.user_name }}<text class="cuIcon-write"></text></text>
  86. </view>
  87. <view class="flex-row items-baseline">
  88. <text class="font_3 text_6 text_9">SN</text>
  89. <text class="font_3 text_10">{{ item.imei }}</text>
  90. <text class="font_8 text_11 text_12" @click="deleteDevice(item.id, index, item.imei)">取消绑定</text>
  91. </view>
  92. </view>
  93. <view class="flex-col group_6 space-y-6" @click="goLookSleepReport(item.imei)">
  94. <text class="self-center font_2 text_6 text_7">香睡指数</text>
  95. <text class="self-start font_7">{{ item.score_value }}</text>
  96. </view>
  97. </view>
  98. <text class="self-end font_9">{{ item.score_desc }}</text>
  99. <view class="flex-row items-center space-x-20">
  100. <view class="flex-row items-center flex-auto">
  101. <image class="shrink-0 image_10 image_12" src="../../static/mine/myIconLink.png"/>
  102. <text class="font_5 text_13" @click="handleShareData">远程关爱</text>
  103. <image class="shrink-0 image_10 image_12" src="../../static/mine/myIconSetting.png"/>
  104. <text class="font_5 text_13" @click="getPages('/pages/user/alertSetting/index?imei=' + item.imei)">报警设置</text>
  105. <text class="cuIcon-card text-yellow image_10 image_12" style="font-size: 0.75rem;"></text>
  106. <text class="font_5 text_13" @click="getPages('/pages/log/iot/index?imei=' + item.imei + '&dtype=' + dtype)" >卡片详情</text>
  107. </view>
  108. <text class="font_10 text_16">{{ item.report_time }}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="flex-col space-y-8">
  113. <view v-if="memberId" class="flex-row justify-between">
  114. <text class="font_1">语音短信</text>
  115. <view class="flex-row items-center section_7" @click="goPage('/pages/log/smsVoice/package')">
  116. <text class="font_5">购买套餐<text class="cuIcon-goodsnew"></text></text>
  117. </view>
  118. </view>
  119. <view class="flex-col space-y-30">
  120. <view v-if="memberId" class="flex-row justify-between my_record">
  121. <view class="flex-col self-center space-y-14">
  122. <view class="flex-row items-center space-x-6" @click="goPage('/pages/log/packageBuy/index')">
  123. <text class="font_11"><text class="cuIcon-rechargefill text-orange margin-right-sm"></text>购买记录</text>
  124. </view>
  125. <view class="flex-row items-center space-x-6" @click="goPage('/pages/log/smsVoice/index')">
  126. <text class="font_11"><text class="cuIcon-noticefill text-cyan margin-right-sm"></text>发送记录</text>
  127. </view>
  128. </view>
  129. <view class="self-center section_9"></view>
  130. <view class="flex-col self-center space-y-6" @click="goPage('/pages/log/packageBuy/index')">
  131. <view class="flex-row space-x-4">
  132. <text class="self-center font_12 text_25">{{ smsCount }}</text>
  133. <text class="self-start font_11 text_26">次</text>
  134. </view>
  135. <text class="font_13">剩余短信</text>
  136. </view>
  137. <view class="flex-col self-center group_12 space-y-6" @click="goPage('/pages/log/packageBuy/index')">
  138. <view class="flex-row group_13">
  139. <text class="self-center font_12">{{ voiceCount }}</text>
  140. <text class="self-start font_11 text_27">次</text>
  141. </view>
  142. <text class="self-start font_13">剩余语音</text>
  143. </view>
  144. </view>
  145. <view v-if="myBg" class="flex-row justify-center items-center space-x-10 my_shop" :style="'background-image: url(' + myBg + ')'" @click="goBuy">
  146. <!-- <image class="image_4" src="../../static/home/shop.png"/>-->
  147. <!-- <view class="text_5" @click="goBuy">必有好物<text class="text-xs margin-left">官方旗舰店</text></view>-->
  148. </view>
  149. <view class="flex-col justify-start my_settings">
  150. <view class="grid">
  151. <!-- <view class="flex-col items-center relative grid-item space-y-8">-->
  152. <!-- <image-->
  153. <!-- class="image_17"-->
  154. <!-- src="../../static/mine/myWifi.png"-->
  155. <!-- />-->
  156. <!-- <text class="font_13 text_28">WIFI连接</text>-->
  157. <!-- </view>-->
  158. <view v-if="memberId" class="flex-col items-center relative grid-item space-y-8" @click="goDevicePage('/pages/user/broadcastDevice/index')">
  159. <image class="image_17" src="../../static/mine/myIconPromt.png"/>
  160. <text class="font_13 text_28">播报设备</text>
  161. </view>
  162. <view class="flex-col items-center relative grid-item space-y-8" @click="goLookArticles('免责声明','MATTRESS_DISCLAIMERS')">
  163. <image class="image_17" src="../../static/mine/myAnnouncement.png"/>
  164. <text class="font_13 text_28">免责声明</text>
  165. </view>
  166. <view class="flex-col items-center relative grid-item space-y-8" @click="goLookArticles('产品介绍', 'MATTRESS_PRODUCT_INTRODUCTION')">
  167. <image class="image_17" src="../../static/mine/myProduct.png"/>
  168. <text class="font_13 text_28">产品介绍</text>
  169. </view>
  170. <view class="flex-col items-center relative grid-item space-y-8" @click="goLookArticles('使用帮助', 'MATTRESS_HELP')">
  171. <image class="image_17" src="../../static/mine/myHelp.png"/>
  172. <text class="font_13 text_28">使用帮助</text>
  173. </view>
  174. <view class="flex-col items-center relative grid-item space-y-8" @click="goLookArticles('隐私政策', 'MATTRESS_PRIVACY_POLICY')">
  175. <image class="image_17" src="../../static/mine/mySecret.png"/>
  176. <text class="font_13 text_28">隐私政策</text>
  177. </view>
  178. <view class="flex-col items-center relative grid-item space-y-8" @click="goLookArticles('用户协议','MATTRESS_USER_AGREEMENT')">
  179. <image class="image_17" src="../../static/mine/myUserAgree.png"/>
  180. <text class="font_13 text_28">用户协议</text>
  181. </view>
  182. <view class="flex-col items-center relative grid-item space-y-8" @click="goBuy">
  183. <image class="image_17" src="../../static/mine/shop.png"/>
  184. <text class="font_13 text_28">好物商城</text>
  185. </view>
  186. <!-- <view class="flex-col items-center relative grid-item space-y-8">-->
  187. <!-- <image-->
  188. <!-- class="image_17"-->
  189. <!-- src="../../static/mine/myState.png"-->
  190. <!-- />-->
  191. <!-- <text class="font_13 text_28">配网说明</text>-->
  192. <!-- </view>-->
  193. <!-- <view class="flex-col items-center relative grid-item space-y-8">-->
  194. <!-- <image-->
  195. <!-- class="image_17"-->
  196. <!-- src="../../static/mine/myOrder.png"-->
  197. <!-- />-->
  198. <!-- <text class="font_13 text_28">我的订单</text>-->
  199. <!-- </view>-->
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. <view class="cu-modal" :class="bindShow?'show':''">
  208. <view class="cu-dialog">
  209. <view class="cu-bar bg-white justify-end">
  210. <view style="color: black" class="content">设备绑定</view>
  211. <view class="action" @tap="bindShow=false">
  212. <text class="cuIcon-close text-red"></text>
  213. </view>
  214. </view>
  215. <view class="">
  216. <form>
  217. <view class="cu-form-group solid-bottom">
  218. <view class="title">扫描二维码</view>
  219. <input type="text" v-model="bindSn" class="text-left" placeholder="输入或扫描IMEI"/>
  220. <text class="cuIcon-scan text-xxl text-green" style="font-size: 50rpx;"
  221. @click="scan"></text>
  222. </view>
  223. </form>
  224. </view>
  225. <view class="cu-bar bg-white justify-end">
  226. <!-- <view class="action">-->
  227. <!-- <button class="cu-btn bg-cyan" @tap="goBuy">去购买</button>-->
  228. <!-- </view>-->
  229. <view class="action">
  230. <button class="cu-btn bg-green margin-left" @tap="bindDevice">确定</button>
  231. </view>
  232. </view>
  233. </view>
  234. </view>
  235. <view class="cu-modal" :class="updateShow?'show':''">
  236. <view class="cu-dialog">
  237. <view class="cu-bar bg-white justify-end">
  238. <view style="color: black" class="content">编辑昵称</view>
  239. <view class="action" @tap="updateShow=false">
  240. <text class="cuIcon-close text-red"></text>
  241. </view>
  242. </view>
  243. <view class="">
  244. <form>
  245. <view class="cu-form-group solid-bottom">
  246. <view class="title">昵称</view>
  247. <input type="text" v-model="nickname" class="text-left" placeholder="请输入昵称"/>
  248. </view>
  249. <view class="cu-form-group">
  250. <view class="text-df text-gray">设置昵称,以便播报,6字以内</view>
  251. </view>
  252. </form>
  253. </view>
  254. <view class="cu-bar bg-white justify-end">
  255. <view class="action">
  256. <button class="cu-btn bg-green margin-left" @tap="updateNickName">确定</button>
  257. </view>
  258. </view>
  259. </view>
  260. </view>
  261. <view class="cu-modal" :class="updateUserNameShow?'show':''" @tap="updateUserNameShow=false">
  262. <view class="cu-dialog" @tap.stop="">
  263. <view class="cu-bar bg-white justify-end">
  264. <view style="color: black" class="content">编辑使用人昵称</view>
  265. <view class="action" @tap="updateUserNameShow=false">
  266. <text class="cuIcon-close text-red"></text>
  267. </view>
  268. </view>
  269. <view class="">
  270. <form>
  271. <view class="cu-form-group solid-bottom">
  272. <view class="title">使用人</view>
  273. <input type="text" v-model="updateDeviceFrom.userName" class="text-left" placeholder="请输入昵称" :maxlength="6"/>
  274. </view>
  275. </form>
  276. </view>
  277. <view class="cu-bar bg-white justify-end">
  278. <view class="action">
  279. <button class="cu-btn bg-green margin-left" @tap="updateUserName">确定</button>
  280. </view>
  281. </view>
  282. </view>
  283. </view>
  284. </view>
  285. </template>
  286. <script>
  287. import { mapActions } from 'vuex'
  288. import Storage from '@/utils/storage'
  289. import * as Foundation from '@/ui-utils/Foundation'
  290. import * as API_deviceMemberBind from '@/api/device_member_bind'
  291. import * as API_SLEEP_REPORT from '@/api/sleep_report'
  292. import * as API_MEMBER_WARN_SWITCH from '@/api/member_warn_switch'
  293. import * as deviceDtypeEnum from '@/utils/enum/DeviceDTypeEnum'
  294. import { getArticleByPosition } from '../articles'
  295. export default {
  296. data() {
  297. return {
  298. deviceList: [],
  299. unionId: '',
  300. memberId: '',
  301. bindSn: '',
  302. bindShow: false,
  303. updateShow: false,
  304. userInfo: null,
  305. nickname: '',
  306. smsCount: 0,
  307. voiceCount: 0,
  308. showCount: 0,
  309. dtype: null,
  310. updateUserNameShow: false,
  311. updateDeviceFrom: {
  312. userName: '',
  313. id: null
  314. },
  315. myBg: null
  316. };
  317. },
  318. onShow() {
  319. this.deviceList = Storage.getItem('myBindDevices')
  320. if (this.memberId) {
  321. if (this.deviceList) {
  322. this.showCount ++;
  323. if (this.showCount === 3) {
  324. this.API_getNewReport()
  325. } else {
  326. const res = Storage.getItem('user-new-report')
  327. this.handleReport(res)
  328. }
  329. }
  330. this.getSmsVoiceQty()
  331. } else {
  332. this.memberId = Storage.getItem('uid')
  333. }
  334. this.userInfo = Storage.getItem('userInfo')
  335. this.dtype = deviceDtypeEnum.DEVICE_TYPE.SMCD
  336. },
  337. mounted() {
  338. this.memberId = Storage.getItem('uid')
  339. if (this.memberId) {
  340. this.unionId = this.userInfo.union_id
  341. if (this.userInfo.nickname.length > 6 || this.userInfo.mobile === this.userInfo.nickname || this.userInfo.nickname === '微信用户') {
  342. const _this = this
  343. uni.showModal({
  344. title: '提示',
  345. content: "您还未设置昵称,是否设置呢?",
  346. confirmText: "确定",
  347. showCancel: true,
  348. success: function(res) {
  349. if (res.confirm) {
  350. _this.handleUpdateName()
  351. }
  352. }
  353. })
  354. }
  355. if (this.deviceList) {
  356. this.API_getNewReport()
  357. }
  358. this.getSmsVoiceQty()
  359. this.getMyBg()
  360. }
  361. },
  362. methods: {
  363. API_getNewReport() {
  364. const _this = this
  365. let imei = ''
  366. this.deviceList.forEach(item => {
  367. imei += item.imei + ','
  368. })
  369. imei = imei.substring(0, imei.length - 1)
  370. API_SLEEP_REPORT.getNewReportBySn({sns: imei, unionId: this.unionId}).then(res => {
  371. Storage.setItem("user-new-report", res)
  372. _this.handleReport(res)
  373. })
  374. },
  375. handleReport(res) {
  376. res.forEach(t => {
  377. this.deviceList.forEach(tt => {
  378. if (t.sn === tt.imei) {
  379. this.$set(tt, 'report_time', Foundation.unixToDate(t.report_time, "yyyy/MM/dd"))
  380. this.$set(tt, 'score_value', t.score_value)
  381. this.$set(tt, 'score_desc', t.score_desc)
  382. }
  383. })
  384. })
  385. },
  386. API_getDeviceList() {
  387. const _this = this
  388. API_deviceMemberBind.getDeviceByDtypeAndMemberId({dtype: this.dtype, memberId: this.memberId}).then(res => {
  389. if (res.length === 0) {
  390. Storage.removeItem("nowChangeDevice")
  391. Storage.removeItem("myBindDevices")
  392. } else {
  393. _this.deviceList = res
  394. let nowDevice = Storage.getItem("nowChangeDevice")
  395. if (!nowDevice) {
  396. Storage.setItem("nowChangeDevice", res[0].imei)
  397. }
  398. Storage.setItem("myBindDevices", res)
  399. _this.API_getNewReport()
  400. }
  401. })
  402. },
  403. getSmsVoiceQty() {
  404. const _this = this
  405. API_MEMBER_WARN_SWITCH.getByMemberUnionId(this.userInfo.union_id).then(res => {
  406. if (res) {
  407. _this.smsCount = res.sms_qty
  408. _this.voiceCount = res.voice_qty
  409. }
  410. })
  411. },
  412. handleAuth() {
  413. uni.navigateTo({
  414. url: '/pages/login/auth'
  415. })
  416. },
  417. handleShareData() {
  418. uni.navigateTo({
  419. url: '/pages/user/shareUser/index'
  420. })
  421. },
  422. getPages(url) {
  423. uni.navigateTo({
  424. url: url
  425. });
  426. },
  427. // 扫描条码
  428. scan() {
  429. let _this = this
  430. uni.scanCode({
  431. success: function (res) {
  432. console.log(res, res.result.length)
  433. if (res.result.length > 20) {
  434. if (res.scanType === 'QR_CODE') {
  435. const urlStr = res.result
  436. const qs = Foundation.getQueryObject(urlStr)
  437. if (qs.mac && qs.type === 'MATTRESS') {
  438. _this.bindSn = qs.mac
  439. } else {
  440. uni.showToast({
  441. title: '请扫码正确的睡眠床垫二维码',
  442. icon: 'none',
  443. duration: 5000
  444. })
  445. }
  446. } else {
  447. _this.bindSn = res.result
  448. }
  449. } else {
  450. let str = res.result.split(':')
  451. if (str.length > 1) {
  452. _this.bindSn = str[1]
  453. } else {
  454. _this.bindSn = res.result
  455. }
  456. }
  457. },
  458. fail: (err) => {
  459. console.log(err)
  460. // #ifdef MP
  461. uni.getSetting({
  462. success: (res) => {
  463. let authStatus = res.authSetting['scope.camera'];
  464. if (!authStatus) {
  465. uni.showModal({
  466. title: '授权失败',
  467. content: 'app需要使用您的相机,请在设置界面打开相关权限',
  468. success: (res) => {
  469. if (res.confirm) {
  470. uni.openSetting()
  471. }
  472. }
  473. })
  474. }
  475. }
  476. })
  477. // #endif
  478. }
  479. })
  480. },
  481. bindDevice() {
  482. if (!this.bindSn) {
  483. uni.showToast({
  484. title: '请输入或绑定正确的二维码',
  485. icon: 'none',
  486. duration: 5000
  487. })
  488. return
  489. }
  490. const params = {
  491. imei: this.bindSn,
  492. memberId: this.memberId,
  493. dtype: this.dtype
  494. }
  495. this.bindShow = false
  496. let _this = this
  497. API_deviceMemberBind.bindDeviceByDtype(params).then(res => {
  498. if (res.success) {
  499. _this.bindSn = ''
  500. uni.showToast({
  501. title: '绑定成功',
  502. })
  503. _this.API_getDeviceList()
  504. } else {
  505. uni.showToast({
  506. title: res.message,
  507. icon: 'none',
  508. duration: 5000
  509. })
  510. }
  511. })
  512. },
  513. // 删除绑定的设备
  514. deleteDevice(id, index, imei){
  515. const _this = this
  516. uni.showModal({
  517. title: '提示',
  518. content: '确定要解绑吗',
  519. success: function (r) {
  520. if (r.confirm) {
  521. API_deviceMemberBind.delSleepMattress({id: id, imei: imei}).then(res=>{
  522. uni.showToast({
  523. title: '解绑成功',
  524. icon: 'none',
  525. duration: 3000
  526. })
  527. _this.deviceList.splice(index, 1)
  528. if (_this.deviceList.length > 0) {
  529. const nowDevice = Storage.getItem('nowChangeDevice')
  530. if (nowDevice === imei) {
  531. Storage.setItem("nowChangeDevice", _this.deviceList[0].imei)
  532. }
  533. Storage.setItem("myBindDevices", _this.deviceList)
  534. } else {
  535. Storage.removeItem('nowChangeDevice')
  536. Storage.removeItem('myBindDevices')
  537. }
  538. })
  539. }
  540. }
  541. })
  542. },
  543. loginOut() {
  544. const _this = this
  545. uni.showModal({
  546. title: '提示',
  547. content: "确定要退出重新绑定账号吗?",
  548. confirmText: "确定",
  549. showCancel: true,
  550. success: function(res) {
  551. if (res.confirm) {
  552. _this.logout().then(() => {
  553. Storage.removeItem("nowChangeDevice")
  554. Storage.removeItem("myBindDevices")
  555. uni.reLaunch({
  556. url:'/pages/login/index'
  557. })
  558. })
  559. }
  560. }
  561. })
  562. },
  563. addBindDevice() {
  564. if (this.memberId) {
  565. this.bindShow = 'show'
  566. } else {
  567. uni.showModal({
  568. title: '提示',
  569. content: "您还没有登录,是否前往登录?",
  570. confirmText: "确定",
  571. showCancel: true,
  572. success: function(res) {
  573. if (res.confirm) {
  574. uni.reLaunch({
  575. url:'/pages/login/auth'
  576. })
  577. }
  578. }
  579. })
  580. }
  581. },
  582. /** 头像发生改变 */
  583. handleUpdateFace(event) {
  584. let that = this
  585. wx.showActionSheet({
  586. itemList: ['从相册中选择', '拍照'],
  587. itemColor: '#CED63A',
  588. success(res) {
  589. if (!res.cancel) {
  590. if (res.tapIndex === 0) {
  591. that.chooseWxImage('album')
  592. } else if (res.tapIndex === 1) {
  593. that.chooseWxImage('camera')
  594. }
  595. }
  596. }
  597. })
  598. },
  599. /** 选择头像 */
  600. chooseWxImage(type) {
  601. let that = this
  602. wx.chooseImage({
  603. count: 1,
  604. sizeType: ['original', 'compressed'],
  605. sourceType: [type],
  606. success(res) {
  607. const tempFilePaths = res.tempFilePaths
  608. wx.uploadFile({
  609. url: that.MixinUploadApi,
  610. filePath: tempFilePaths[0],
  611. name: 'file',
  612. header: { uuid: Storage.getItem('uuid') },
  613. success(response) {
  614. const data = typeof response.data === 'string' ? JSON.parse(response.data) : response.data
  615. that.userInfo.face = data.url
  616. const params = {
  617. face: data.url,
  618. nickname: that.userInfo.nickname
  619. }
  620. that.API_updateUser(params)
  621. }
  622. })
  623. }
  624. })
  625. },
  626. API_updateUser(params) {
  627. const _this = this
  628. this.saveUserInfo(params).then(() => {
  629. uni.showToast({
  630. title: '修改成功',
  631. icon: 'none'
  632. })
  633. this.$store.dispatch('getUserDataAction').then((res)=>{
  634. _this.userInfo = res
  635. })
  636. })
  637. },
  638. handleUpdateName() {
  639. this.nickname = this.userInfo.nickname
  640. this.updateShow = true
  641. },
  642. updateNickName() {
  643. if (this.nickname === '') {
  644. uni.showToast({
  645. title: '请输入昵称',
  646. icon: 'none',
  647. duration: 3000
  648. })
  649. return
  650. }
  651. if (this.nickname.length > 6) {
  652. uni.showToast({title: '昵称长度不能超过6个', icon: 'none', duration: 3000})
  653. return
  654. }
  655. this.updateShow = false
  656. const params = {
  657. face: this.userInfo.face,
  658. nickname: this.nickname
  659. }
  660. this.API_updateUser(params)
  661. },
  662. goPage(path) {
  663. if (this.unionId) {
  664. uni.navigateTo({
  665. url: path + '?unionId=' + this.unionId
  666. })
  667. }
  668. },
  669. goDevicePage(path) {
  670. if (this.memberId) {
  671. uni.navigateTo({
  672. url: path + '?memberId=' + this.memberId
  673. })
  674. } else {
  675. uni.showModal({
  676. title: '提示',
  677. content: "您还没有登录,是否前往登录?",
  678. confirmText: "确定",
  679. showCancel: true,
  680. success: function(res) {
  681. if (res.confirm) {
  682. uni.reLaunch({
  683. url:'/pages/login/auth'
  684. })
  685. }
  686. }
  687. })
  688. }
  689. },
  690. goLookArticles(name, position) {
  691. uni.navigateTo({
  692. url: '/pages/articles/index?position=' + position + '&name=' + name
  693. })
  694. },
  695. goLookSleepReport(imei) {
  696. uni.navigateTo({
  697. url: '/pages/log/report/friendReport?sn=' + imei
  698. })
  699. },
  700. changeUserNameShow(name, id) {
  701. this.updateDeviceFrom = {
  702. userName: name,
  703. id: id
  704. }
  705. this.updateUserNameShow = 'show'
  706. },
  707. updateUserName() {
  708. console.log('this.userName===', this.updateDeviceFrom)
  709. if (!this.updateDeviceFrom.userName) {
  710. uni.showToast({title: '请输入使用人昵称', icon: 'none', duration: 3000})
  711. return
  712. }
  713. if (this.updateDeviceFrom.userName.length > 6) {
  714. uni.showToast({title: '昵称长度不能超过6个', icon: 'none', duration: 3000})
  715. return
  716. }
  717. this.updateUserNameShow = false
  718. API_deviceMemberBind.editDevice({userName: this.updateDeviceFrom.userName}, this.updateDeviceFrom.id).then(res => {
  719. this.API_getDeviceList()
  720. })
  721. },
  722. getMyBg() {
  723. getArticleByPosition('MATTRESS_AD').then(res => {
  724. this.myBg = res.outside_url
  725. })
  726. },
  727. ...mapActions({
  728. logout: 'logoutAction',
  729. saveUserInfo: 'saveUserInfoAction'
  730. })
  731. }
  732. };
  733. </script>
  734. <style lang="scss" scoped>
  735. .home_add_devive {
  736. padding: 2.75rem 0;
  737. background-color: rgba(14, 52, 147, 1);
  738. border-radius: 1rem;
  739. backdrop-filter: blur(0.63rem);
  740. .text_5 {
  741. color: #ffffff;
  742. font-size: 1.3rem;
  743. font-family: PingFangSC;
  744. line-height: 1.38rem;
  745. margin-left: 0.5rem
  746. }
  747. }
  748. .power-module {
  749. position: absolute;
  750. right: 1.63rem;
  751. top: 10rem;
  752. .image_9 {
  753. width: 22px;
  754. height: 22px;
  755. }
  756. .text_4 {
  757. font-size: 16px;
  758. font-weight: 500;
  759. letter-spacing: 0px;
  760. line-height: 16px;
  761. color: rgba(255, 255, 255, 1);
  762. vertical-align: top;
  763. text-align: center;
  764. margin-top: 0.3rem;
  765. }
  766. }
  767. .container-bg {
  768. position: fixed;
  769. left: -130px;
  770. top: -130px;
  771. width: 480px;
  772. height: 344px;
  773. opacity: 1;
  774. border-radius: 63px;
  775. -webkit-transform: rotate(-315deg);
  776. transform: rotate(-315deg);
  777. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  778. }
  779. .page {
  780. padding-bottom: 3.13rem;
  781. background-color: #000000;
  782. width: 100%;
  783. overflow-y: auto;
  784. overflow-x: hidden;
  785. height: 100%;
  786. .group_2 {
  787. padding-bottom: 1.25rem;
  788. height: 61.06rem;
  789. overflow-y: auto;
  790. .my_device_header {
  791. padding: 0.25rem 0 2.75rem;
  792. overflow-x: hidden;
  793. z-index: 100;
  794. .image {
  795. margin-left: -6.38rem;
  796. border-radius: 3.94rem;
  797. width: 32.63rem;
  798. height: 25.44rem;
  799. }
  800. .section {
  801. // background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/649415135a7e3f0310661c1e/649415b654fe0000116ae544/16874493388853192993.png');
  802. background-size: 100% 100%;
  803. background-repeat: no-repeat;
  804. .section_2 {
  805. padding: 1.13rem 0.88rem 0.75rem;
  806. background-color: #ffffff4d;
  807. .space-x-6-reverse {
  808. & > view:not(:last-child),
  809. & > text:not(:last-child),
  810. & > image:not(:last-child) {
  811. margin-right: 0.38rem;
  812. }
  813. .image_2 {
  814. width: 1.06rem;
  815. height: 0.69rem;
  816. }
  817. .image_3 {
  818. width: 0.94rem;
  819. height: 0.69rem;
  820. }
  821. .image_4 {
  822. width: 1.5rem;
  823. height: 0.72rem;
  824. }
  825. }
  826. .text {
  827. font-size: 1.16rem;
  828. }
  829. }
  830. .space-y-32 {
  831. & > view:not(:first-child),
  832. & > text:not(:first-child),
  833. & > image:not(:first-child) {
  834. margin-top: 2rem;
  835. }
  836. }
  837. .my_device_profile {
  838. margin-top: 1.5rem;
  839. padding-left: 2.19rem;
  840. padding-right: 1.5rem;
  841. height: 6.09rem;
  842. .space-x-19 {
  843. & > view:not(:first-child),
  844. & > text:not(:first-child),
  845. & > image:not(:first-child) {
  846. margin-left: 1.19rem;
  847. }
  848. .image_5 {
  849. border-radius: 50%;
  850. width: 4.69rem;
  851. height: 4.69rem;
  852. }
  853. .image_6 {
  854. margin-top: 0.69rem;
  855. width: 1.16rem;
  856. height: 1.25rem;
  857. }
  858. }
  859. .group_4 {
  860. margin-top: -0.31rem;
  861. padding: 0 1.13rem;
  862. .text-wrapper {
  863. margin-left: 4.63rem;
  864. padding: 0.38rem 0;
  865. background-color: #ffffff66;
  866. border-radius: 6.25rem;
  867. width: 4.81rem;
  868. height: 1.5rem;
  869. }
  870. .image_9 {
  871. margin-top: 0.38rem;
  872. width: 1.31rem;
  873. height: 1.31rem;
  874. }
  875. }
  876. }
  877. }
  878. .text_5 {
  879. line-height: 1.03rem;
  880. }
  881. .pos_2 {
  882. position: absolute;
  883. left: 1.28rem;
  884. bottom: 0;
  885. }
  886. .section_4 {
  887. padding: 0.13rem 0.25rem 0.13rem 0.5rem;
  888. border-radius: 0.56rem;
  889. border: solid 0.063rem #4d9efa;
  890. }
  891. .pos_3 {
  892. position: absolute;
  893. right: 1.25rem;
  894. top: 26.28rem;
  895. }
  896. }
  897. .group_5 {
  898. padding: 0 1.25rem;
  899. .my_devices {
  900. .section_4 {
  901. padding: 0.13rem 0.25rem 0.13rem 0.5rem;
  902. border-radius: 0.56rem;
  903. border: solid 0.063rem #4d9efa;
  904. }
  905. }
  906. .space-y-8 {
  907. & > view:not(:first-child),
  908. & > text:not(:first-child),
  909. & > image:not(:first-child) {
  910. margin-top: 0.5rem;
  911. }
  912. .section_7 {
  913. padding: 0.19rem 0.25rem 0 0.5rem;
  914. border-radius: 0.56rem;
  915. height: 1.13rem;
  916. border: solid 0.063rem #4d9efa;
  917. }
  918. }
  919. }
  920. .space-y-30 {
  921. & > view:not(:first-child),
  922. & > text:not(:first-child),
  923. & > image:not(:first-child) {
  924. margin-top: 1rem;
  925. }
  926. z-index: 100;
  927. .my_record {
  928. padding: 1rem 1.25rem;
  929. background-color: #1241b8cc;
  930. border-radius: 1rem;
  931. .section_9 {
  932. background-color: #f2f2f2;
  933. width: 0.063rem;
  934. height: 2.5rem;
  935. }
  936. .group_12 {
  937. width: 3.78rem;
  938. .group_13 {
  939. padding: 0 0.13rem;
  940. .text_27 {
  941. margin-top: 0.5rem;
  942. }
  943. }
  944. }
  945. }
  946. .image_4 {
  947. width: 1.5rem;
  948. height: 1.5rem;
  949. }
  950. .my_shop {
  951. //background-image: url('/static/mine/shop (1).png');
  952. background-size: 100% 100%;
  953. background-repeat: no-repeat;
  954. padding: 2.3rem 1.05rem;
  955. background-color: rgba(250, 5, 74, 0.8);
  956. border-radius: 1rem;
  957. backdrop-filter: blur(0.63rem);
  958. .text_5 {
  959. color: #ffffff;
  960. font-size: 1.3rem;
  961. font-family: PingFangSC;
  962. line-height: 1.38rem;
  963. margin-left: 0.5rem
  964. }
  965. }
  966. .my_settings {
  967. padding: 0.63rem 0;
  968. background-color: #1241b8cc;
  969. border-radius: 1rem;
  970. .grid {
  971. padding: 0 1.06rem;
  972. height: 14.81rem;
  973. display: grid;
  974. grid-template-columns: repeat(4, 1fr);
  975. .grid-item {
  976. padding: 0.63rem 0;
  977. .image_17 {
  978. border-radius: 1.25rem;
  979. width: 2.5rem;
  980. height: 2.5rem;
  981. }
  982. .text_28 {
  983. opacity: 0.99;
  984. }
  985. }
  986. }
  987. }
  988. }
  989. .space-x-8 {
  990. & > view:not(:first-child),
  991. & > text:not(:first-child),
  992. & > image:not(:first-child) {
  993. margin-left: 0.5rem;
  994. }
  995. .text_2 {
  996. color: #ffffff;
  997. font-size: 1.25rem;
  998. font-family: PingFangSC;
  999. line-height: 1.16rem;
  1000. }
  1001. .section_3 {
  1002. padding: 0.25rem 0.63rem;
  1003. background-color: #ffffff26;
  1004. border-radius: 0.63rem;
  1005. height: 1.25rem;
  1006. }
  1007. .text_8 {
  1008. line-height: 0.78rem;
  1009. }
  1010. .text_20 {
  1011. line-height: 0.63rem;
  1012. }
  1013. }
  1014. .font_4 {
  1015. font-size: 0.88rem;
  1016. font-family: PingFangSC;
  1017. line-height: 0.81rem;
  1018. color: #ffffff;
  1019. }
  1020. .font_3 {
  1021. font-size: 0.88rem;
  1022. font-family: PingFangSC;
  1023. line-height: 0.59rem;
  1024. color: #ffffff;
  1025. }
  1026. .text_6 {
  1027. opacity: 0.5;
  1028. }
  1029. .font_2 {
  1030. font-size: 0.63rem;
  1031. font-family: PingFangSC;
  1032. line-height: 0.59rem;
  1033. color: #ffffff;
  1034. }
  1035. .font_5 {
  1036. font-size: 0.75rem;
  1037. font-family: PingFangSC;
  1038. line-height: 0.69rem;
  1039. color: #4d9efa;
  1040. }
  1041. .font_6 {
  1042. font-size: 0.88rem;
  1043. font-family: PingFangSC;
  1044. line-height: 0.81rem;
  1045. color: #d8d8d8;
  1046. }
  1047. .font_1 {
  1048. font-size: 1.13rem;
  1049. font-family: PingFangSC;
  1050. line-height: 1.06rem;
  1051. color: #ffffff;
  1052. }
  1053. .image_7 {
  1054. width: 0.63rem;
  1055. height: 0.63rem;
  1056. }
  1057. .space-y-14 {
  1058. & > view:not(:first-child),
  1059. & > text:not(:first-child),
  1060. & > image:not(:first-child) {
  1061. margin-top: 0.88rem;
  1062. }
  1063. .space-x-6 {
  1064. & > view:not(:first-child),
  1065. & > text:not(:first-child),
  1066. & > image:not(:first-child) {
  1067. margin-left: 0.38rem;
  1068. }
  1069. .image_8 {
  1070. width: 0.88rem;
  1071. height: 0.88rem;
  1072. }
  1073. .text_3 {
  1074. line-height: 0.63rem;
  1075. }
  1076. }
  1077. }
  1078. .space-x-4 {
  1079. & > view:not(:first-child),
  1080. & > text:not(:first-child),
  1081. & > image:not(:first-child) {
  1082. margin-left: 0.25rem;
  1083. }
  1084. .text_25 {
  1085. line-height: 1.09rem;
  1086. }
  1087. .text_26 {
  1088. margin-top: 0.5rem;
  1089. }
  1090. }
  1091. .font_11 {
  1092. font-size: 0.75rem;
  1093. font-family: PingFangSC;
  1094. line-height: 0.69rem;
  1095. color: #ffffff;
  1096. }
  1097. .font_12 {
  1098. font-size: 1.5rem;
  1099. font-family: PingFangSC;
  1100. line-height: 1.06rem;
  1101. color: #ffffff;
  1102. }
  1103. }
  1104. .space-y-10 {
  1105. & > view:not(:first-child),
  1106. & > text:not(:first-child),
  1107. & > image:not(:first-child) {
  1108. margin-top: 0.63rem;
  1109. }
  1110. .my_device_default {
  1111. padding: 0.63rem 0.75rem 0.63rem 1.25rem;
  1112. background-color: #1241b8cc;
  1113. border-radius: 1rem;
  1114. .group_6 {
  1115. margin-bottom: 0.25rem;
  1116. width: 3.56rem;
  1117. .text_7 {
  1118. line-height: 0.56rem;
  1119. }
  1120. }
  1121. }
  1122. .my_device {
  1123. padding-bottom: 0.63rem;
  1124. background-color: #1241b8cc;
  1125. border-radius: 1rem;
  1126. .group_7 {
  1127. width: 10.84rem;
  1128. .group_8 {
  1129. width: 3.09rem;
  1130. .group_9 {
  1131. padding-top: 1.63rem;
  1132. .text_18 {
  1133. line-height: 0.78rem;
  1134. }
  1135. .image_13 {
  1136. width: 2.38rem;
  1137. height: 2.38rem;
  1138. }
  1139. .pos_4 {
  1140. position: absolute;
  1141. left: 0;
  1142. bottom: 0;
  1143. }
  1144. }
  1145. .text_19 {
  1146. line-height: 0.63rem;
  1147. }
  1148. }
  1149. }
  1150. .group_10 {
  1151. margin-right: 1.25rem;
  1152. .text_17 {
  1153. line-height: 0.56rem;
  1154. }
  1155. }
  1156. .text_21 {
  1157. margin-right: 0.75rem;
  1158. }
  1159. .group_11 {
  1160. padding-left: 1.25rem;
  1161. padding-right: 1rem;
  1162. .image_14 {
  1163. width: 0.81rem;
  1164. height: 0.81rem;
  1165. }
  1166. .text_22 {
  1167. margin-left: 0.13rem;
  1168. }
  1169. .image_15 {
  1170. margin-left: 0.88rem;
  1171. }
  1172. .text_23 {
  1173. margin-left: 0.13rem;
  1174. }
  1175. .image_16 {
  1176. margin-left: 0.88rem;
  1177. }
  1178. .text_24 {
  1179. margin-left: 0.13rem;
  1180. }
  1181. }
  1182. }
  1183. .space-y-16 {
  1184. & > view:not(:first-child),
  1185. & > text:not(:first-child),
  1186. & > image:not(:first-child) {
  1187. margin-top: 1rem;
  1188. }
  1189. .text_9 {
  1190. line-height: 0.63rem;
  1191. }
  1192. .text_10 {
  1193. margin-left: 1.25rem;
  1194. line-height: 0.63rem;
  1195. }
  1196. .font_8 {
  1197. font-size: 0.63rem;
  1198. font-family: PingFangSC;
  1199. line-height: 0.59rem;
  1200. color: #a4caf5;
  1201. }
  1202. .text_11 {
  1203. text-decoration: underline;
  1204. }
  1205. .text_12 {
  1206. margin-left: 0.5rem;
  1207. }
  1208. }
  1209. .font_7 {
  1210. font-size: 3rem;
  1211. font-family: PingFangSC;
  1212. line-height: 2.19rem;
  1213. color: #ffffff;
  1214. }
  1215. .font_9 {
  1216. font-size: 0.88rem;
  1217. font-family: PingFangSC;
  1218. line-height: 0.81rem;
  1219. color: #4d9efa;
  1220. }
  1221. .space-x-20 {
  1222. & > view:not(:first-child),
  1223. & > text:not(:first-child),
  1224. & > image:not(:first-child) {
  1225. margin-left: 1.25rem;
  1226. }
  1227. .text_13 {
  1228. margin-left: 0.13rem;
  1229. }
  1230. .image_12 {
  1231. margin-left: 0.88rem;
  1232. }
  1233. .text_16 {
  1234. margin-right: 0.13rem;
  1235. }
  1236. }
  1237. .font_10 {
  1238. font-size: 0.63rem;
  1239. font-family: PingFangSC;
  1240. line-height: 0.5rem;
  1241. color: #4d9efa;
  1242. }
  1243. }
  1244. .image_10 {
  1245. width: 0.75rem;
  1246. height: 0.75rem;
  1247. }
  1248. .space-y-6 {
  1249. & > view:not(:first-child),
  1250. & > text:not(:first-child),
  1251. & > image:not(:first-child) {
  1252. margin-top: 0.38rem;
  1253. }
  1254. }
  1255. .font_13 {
  1256. font-size: 0.63rem;
  1257. font-family: PingFangSC;
  1258. line-height: 0.59rem;
  1259. color: #4d9efa;
  1260. }
  1261. }
  1262. .my-container {
  1263. width: 100%;
  1264. height: 100%;
  1265. position: relative;
  1266. background-color: #000000;
  1267. .mask-container {
  1268. overflow: hidden;
  1269. position: absolute;
  1270. height: 30%;
  1271. width: 100%;
  1272. background-size: cover;
  1273. background-position: center;
  1274. &:after {
  1275. content: '';
  1276. position: absolute;
  1277. width: 130%;
  1278. height: 130%;
  1279. left: 0;
  1280. top: 0;
  1281. z-index: 1;
  1282. filter: blur(10px);
  1283. transform: translate(-3rem, -3rem);
  1284. background: inherit;
  1285. background-size: 100% 100%;
  1286. }
  1287. .cover-mask {
  1288. position: absolute;
  1289. height: 100%;
  1290. width: 100%;
  1291. z-index: 3;
  1292. background-color: rgba(0, 0, 0, 0.8);
  1293. }
  1294. .head-img {
  1295. width: 108px;
  1296. height: 108px;
  1297. position: absolute;
  1298. top: 50%;
  1299. left: 50%;
  1300. transform: translate(-50%, -50%);
  1301. z-index: 99;
  1302. border-radius: 50%;
  1303. overflow: hidden;
  1304. }
  1305. .username {
  1306. position: absolute;
  1307. left: 50%;
  1308. bottom: 20px;
  1309. transform: translateX(-50%);
  1310. z-index: 99;
  1311. color: #fff;
  1312. font-size: 36 rpx;
  1313. }
  1314. }
  1315. .recommend-main {
  1316. width: 100%;
  1317. position: absolute;
  1318. top: 30%;
  1319. bottom: 50px;
  1320. .tabs {
  1321. box-shadow: 0 0 0.8px rgb(0, 0, 0 / 10%);
  1322. width: 100%;
  1323. height: 45px;
  1324. align-items: center;
  1325. .tab-item {
  1326. flex: 1;
  1327. font-size: 32 rpx;
  1328. text-align: center;
  1329. color: rgba(0, 0, 0, 0.5);
  1330. &.active {
  1331. color: rgb(248, 78, 81);
  1332. }
  1333. }
  1334. }
  1335. .music-title {
  1336. padding-left: 20px;
  1337. margin: 15px 0;
  1338. box-sizing: border-box;
  1339. color: #000;
  1340. font-size: 32 rpx;
  1341. font-weight: 600;
  1342. .playIcon {
  1343. margin-right: 8px;
  1344. font-size: 40 rpx;
  1345. }
  1346. .light-text {
  1347. font-size: 24 rpx;
  1348. margin-left: 6px;
  1349. color: rgba(0, 0, 0, 0.5);
  1350. }
  1351. }
  1352. .music-item {
  1353. height: 70px;
  1354. box-sizing: border-box;
  1355. padding: 0 20px;
  1356. align-items: center;
  1357. margin-bottom: 10px;
  1358. position: relative;
  1359. &:last-of-type {
  1360. margin-bottom: 0;
  1361. }
  1362. &.active {
  1363. background-image: linear-gradient(to right, rgba(247, 73, 79, 0.1), rgba(247, 73, 79, 0.05));
  1364. .music-info {
  1365. .music-name,
  1366. .small-icon,
  1367. .music-singer {
  1368. color: #f84e51 !important;
  1369. }
  1370. &::before {
  1371. content: '';
  1372. width: 4px;
  1373. height: 65px;
  1374. background-image: linear-gradient(to bottom, rgb(253, 117, 102), rgb(247, 73, 79));
  1375. position: absolute;
  1376. left: 0px;
  1377. top: 3px;
  1378. }
  1379. }
  1380. }
  1381. .music-img {
  1382. width: 58px !important;
  1383. height: 58px !important;
  1384. border-radius: 6px;
  1385. }
  1386. .music-info {
  1387. margin-right: 15px;
  1388. margin-left: 15px;
  1389. width: calc(100vw - 135px);
  1390. text-align: left;
  1391. .music-name {
  1392. font-size: 30 rpx;
  1393. margin-bottom: 7px;
  1394. color: #000;
  1395. }
  1396. .music-singer {
  1397. color: rgba(0, 0, 0, 0.5);
  1398. font-size: 24 rpx;
  1399. align-items: center;
  1400. .small-icon {
  1401. margin-right: 6px;
  1402. transform: scale(0.9);
  1403. color: rgba(0, 0, 0, 0.5);
  1404. font-size: 12px;
  1405. padding: 1px 3px;
  1406. border: 1px solid rgba(0, 0, 0, 0.2);
  1407. border-radius: 4px;
  1408. }
  1409. }
  1410. }
  1411. }
  1412. }
  1413. }
  1414. </style>