index.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174
  1. <!-- 我的页面 -->
  2. <template>
  3. <view class="mine-root">
  4. <mine-drawer-shell :open="panelOpen" :dismiss-tip="$t('mine.back')" @close="closeSettingsPanel">
  5. <view class="mine-page">
  6. <scroll-view class="mine-scroll" scroll-y :style="{ height: scrollHeight + 'px' }" :show-scrollbar="false"
  7. :lower-threshold="120" :refresher-enabled="!panelOpen" :refresher-triggered="pullRefreshing"
  8. refresher-background="#f4f6fb" refresher-default-style="black" @refresherrefresh="onRefresherRefresh"
  9. @refresherrestore="onRefresherEnd" @refresherabort="onRefresherEnd" @scrolltolower="onScrollToLower">
  10. <view class="mine-hero">
  11. <view v-if="showMailBtn" class="mine-mail-btn" :class="{ 'mine-mail-btn--card': showMailBtnBg }"
  12. :style="{ top: (statusBar + 12) + 'px' }" @tap="onMail">
  13. <image class="mine-mail-icon" src="/static/icon/icon-notification.png" mode="aspectFit" />
  14. <view v-if="showMailBadge" class="mine-mail-dot" />
  15. </view>
  16. <view class="mine-cover">
  17. <image v-if="coverUrl" class="mine-cover-img" :src="coverUrl" mode="aspectFill" />
  18. <view v-else class="mine-cover-placeholder" />
  19. <view class="mine-cover-fade" />
  20. </view>
  21. <view class="mine-profile" :style="profilePadStyle">
  22. <view class="mine-avatar-wrap" @tap="onAvatarTap">
  23. <image v-if="signedIn && avatarDisplayUrl" class="mine-avatar" :src="avatarDisplayUrl"
  24. mode="aspectFill" />
  25. <view v-else class="mine-avatar mine-avatar--empty" />
  26. <!-- #ifdef MP-WEIXIN -->
  27. <button v-if="signedIn && isSelf" class="mine-avatar-cam-btn" open-type="chooseAvatar"
  28. @chooseavatar="onWeixinChooseAvatar" @tap.stop>
  29. <view class="mine-avatar-cam">
  30. <text class="mine-avatar-cam-icon">📷</text>
  31. </view>
  32. </button>
  33. <!-- #endif -->
  34. <!-- #ifndef MP-WEIXIN -->
  35. <view v-if="signedIn && isSelf" class="mine-avatar-cam" @tap.stop="onChangeAvatar">
  36. <text class="mine-avatar-cam-icon">📷</text>
  37. </view>
  38. <!-- #endif -->
  39. <!-- 新增:編輯按鈕(頭像右邊) -->
  40. <view v-if="signedIn && isSelf" class="mine-edit-btn" @tap="onEditProfile">
  41. <text class="mine-edit-icon">✏️</text>
  42. </view>
  43. </view>
  44. <text class="mine-name">{{ displayName }}</text>
  45. <text class="mine-bio">{{ displayBio }}</text>
  46. <!-- <view v-if="signedIn && isSelf && profile.user_no" class="mine-account" @tap.stop="copyAccount">
  47. <text class="mine-account-label">{{ copy.accountLabel }}</text>
  48. <text class="mine-account-no">{{ profile.user_no }}</text>
  49. <text class="mine-account-copy">{{ copy.copyBtn }}</text>
  50. </view> -->
  51. <button v-if="signedIn && !isSelf" class="mine-follow-btn" :disabled="followBusy" @tap="onFollowTap">
  52. {{ profile.isFollow === 1 ? copy.followed : copy.follow }}
  53. </button>
  54. <view v-if="!signedIn" class="mine-guest-bar">
  55. <text class="mine-guest-bar-txt">{{ copy.guestBar }}</text>
  56. <button class="mine-guest-bar-btn" size="mini" @tap="goLogin">{{ copy.loginCta }}</button>
  57. </view>
  58. <view class="mine-stats">
  59. <view class="mine-stat" @tap="onStatTap('fans')">
  60. <text class="mine-stat-num">{{ fmtCount(profile.fans) }}</text>
  61. <text class="mine-stat-label">{{ copy.statFans }}</text>
  62. </view>
  63. <view class="mine-stat" @tap="onStatTap('follow')">
  64. <text class="mine-stat-num">{{ fmtCount(profile.follow) }}</text>
  65. <text class="mine-stat-label">{{ copy.statFollow }}</text>
  66. </view>
  67. <view class="mine-stat" @tap="onStatTap('views')">
  68. <text class="mine-stat-num">{{ fmtCount(viewCount) }}</text>
  69. <text class="mine-stat-label">{{ copy.statViews }}</text>
  70. </view>
  71. <view class="mine-stat" @tap="onStatTap('praised')">
  72. <text class="mine-stat-num">{{ fmtCount(profile.praised) }}</text>
  73. <text class="mine-stat-label">{{ copy.statLikes }}</text>
  74. </view>
  75. </view>
  76. <!-- 钻石余额(仅本人) -->
  77. <view class="mine-diamond-bar" v-if="signedIn && isSelf" @tap="goDiamondTopUp">
  78. <view class="mine-diamond-left">
  79. <image class="mine-diamond-icon" src="/static/icon/ic_diamond.png" mode="aspectFit" />
  80. <text class="mine-diamond-label">{{ copy.diamond }}</text>
  81. </view>
  82. <view class="mine-diamond-right">
  83. <text class="mine-diamond-value">{{ diamondDisplay }}</text>
  84. <text class="wlIcon-fanhui2 mine-diamond-arrow"></text>
  85. </view>
  86. </view>
  87. <!-- 领券中心和我的优惠卷入口 -->
  88. <view class="mine-assets-bar" v-if="signedIn && isSelf">
  89. <view class="mine-assets-card" @tap="goCoupon">
  90. <view class="mine-assets-info">
  91. <text class="mine-assets-title">{{ $t('mine.couponCenter') }}</text>
  92. <text class="mine-assets-desc">{{ $t('mine.receiveCoupon') }} <text
  93. class="wlIcon-fanhui2 mine-assets-arrow"></text></text>
  94. </view>
  95. <text class="wlIcon-31hongbao mine-assets-icon"></text>
  96. </view>
  97. <view class="mine-assets-divider"></view>
  98. <view class="mine-assets-card" @tap="goMyCouponList">
  99. <view class="mine-assets-info">
  100. <text class="mine-assets-title">{{ $t('mall.coupon') }}</text>
  101. <text class="mine-assets-desc">{{ $t('mine.myCoupon') }}<text
  102. class="wlIcon-fanhui2 mine-assets-arrow"></text> </text>
  103. </view>
  104. <text class="wlIcon-qianbao mine-assets-icon"></text>
  105. </view>
  106. </view>
  107. <!-- 购物车、收藏、关注店铺、足迹入口 -->
  108. <view class="mine-shortcut-bar" v-if="signedIn && isSelf">
  109. <view class="mine-shortcut-item" @tap="goCart">
  110. <text class="wlIcon-gouwuche mine-shortcut-icon"></text>
  111. <text class="mine-shortcut-text">{{ $t('mall.cart') }}</text>
  112. </view>
  113. <view class="mine-shortcut-item" @tap="goFavorite">
  114. <text class="wlIcon-shoucang mine-shortcut-icon"></text>
  115. <text class="mine-shortcut-text">{{ $t('mall.collect') }}</text>
  116. </view>
  117. <view class="mine-shortcut-item" @tap="goFollowShop">
  118. <text class="wlIcon-dianpu mine-shortcut-icon"></text>
  119. <text class="mine-shortcut-text">{{ $t('mine.followShop') }}</text>
  120. </view>
  121. <view class="mine-shortcut-item" @tap="goFootprint">
  122. <text class="wlIcon-zuji mine-shortcut-icon"></text>
  123. <text class="mine-shortcut-text">{{ $t('mine.footprint') }}</text>
  124. </view>
  125. </view>
  126. <!-- 订单快捷入口 -->
  127. <view class="mine-order-bar" v-if="signedIn && isSelf">
  128. <view class="mine-order-bar-item" @tap="goOrderList(1)">
  129. <text class="wlIcon-31daifukuan mine-order-bar-icon"></text>
  130. <text class="mine-order-bar-text">{{ $t('order.pendingPayment') }}</text>
  131. <view class="cu-tag badge bg-orange mine-order-bar-badge" v-if="orderStats.pay > 0">{{ orderStats.pay
  132. > 99 ? '99+' : orderStats.pay }}</view>
  133. </view>
  134. <view class="mine-order-bar-item" @tap="goOrderList(2)">
  135. <text class="wlIcon-31daifahuo mine-order-bar-icon"></text>
  136. <text class="mine-order-bar-text">{{ $t('order.pendingShipment') }}</text>
  137. <view class="cu-tag badge bg-orange mine-order-bar-badge" v-if="orderStats.delive > 0">{{
  138. orderStats.delive > 99 ? '99+' : orderStats.delive }}</view>
  139. </view>
  140. <view class="mine-order-bar-item" @tap="goOrderList(3)">
  141. <text class="wlIcon-31daishouhuo mine-order-bar-icon"></text>
  142. <text class="mine-order-bar-text">{{ $t('order.pendingReceipt') }}</text>
  143. <view class="cu-tag badge bg-orange mine-order-bar-badge" v-if="orderStats.receiving > 0">{{
  144. orderStats.receiving > 99 ? '99+' : orderStats.receiving }}</view>
  145. </view>
  146. <view class="mine-order-bar-item" @tap="goOrderList(4)">
  147. <text class="wlIcon-31daipingjia mine-order-bar-icon"></text>
  148. <text class="mine-order-bar-text">{{ $t('order.pendingReview') }}</text>
  149. <view class="cu-tag badge bg-orange mine-order-bar-badge" v-if="orderStats.evaluate > 0">{{
  150. orderStats.evaluate > 99 ? '99+' : orderStats.evaluate }}</view>
  151. </view>
  152. <view class="mine-order-bar-item solid-left" @tap="goRefundList()">
  153. <text class="wlIcon-31youhuiquan mine-order-bar-icon"></text>
  154. <text class="mine-order-bar-text">{{ $t('order.refundAfterSales') }}</text>
  155. <view class="cu-tag badge bg-orange mine-order-bar-badge" v-if="orderStats.customer > 0">{{
  156. orderStats.customer > 99 ? '99+' : orderStats.customer }}</view>
  157. </view>
  158. </view>
  159. <!-- 操作按钮 -->
  160. <view v-if="displayActions.length" class="mine-actions">
  161. <view v-for="act in displayActions" :key="act.key" class="mine-action" @tap="onAction(act.key)">
  162. <!-- <view class="mine-action-icon-wrap">
  163. <image class="mine-action-icon-img" :src="act.iconSrc" mode="aspectFit" />
  164. </view> -->
  165. <view class="mine-action-icon-wrap">
  166. <text v-if="act.iconClass" class="mine-action-icon-font" :class="act.iconClass"></text>
  167. <image v-else class="mine-action-icon-img" :src="act.iconSrc" mode="aspectFit" />
  168. </view>
  169. <text class="mine-action-label">{{ act.label }}</text>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <view class="mine-body">
  175. <view class="mine-tabs">
  176. <view v-for="tab in visibleTabs" :key="tab.key" class="mine-tab-pill"
  177. :class="{ 'mine-tab-pill--on': activeTab === tab.key }" @tap="switchTab(tab.key)">
  178. <text class="mine-tab-pill-text">{{ tab.label }}</text>
  179. </view>
  180. </view>
  181. <view v-if="isGuestHome" class="mine-empty mine-empty--guest">
  182. <text class="mine-empty-txt">{{ copy.loginHint }}</text>
  183. <button class="mine-primary-btn" size="mini" @tap="goLogin">
  184. {{ copy.loginCta }}
  185. </button>
  186. </view>
  187. <view v-else-if="!activeFeed.loaded && !activeFeed.loading" class="mine-empty">
  188. <text class="mine-empty-txt">{{ copy.loading }}</text>
  189. </view>
  190. <view v-else-if="activeFeed.loading && !activeFeed.items.length" class="mine-empty">
  191. <text class="mine-empty-txt">{{ copy.loading }}</text>
  192. </view>
  193. <view v-else-if="activeFeed.loaded && !activeFeed.items.length" class="mine-empty">
  194. <image v-if="emptyImageUrl" class="mine-empty-img" :src="emptyImageUrl" mode="aspectFit" />
  195. <text class="mine-empty-txt">{{ emptyHint }}</text>
  196. <button v-if="!signedIn" class="mine-primary-btn" size="mini" @tap="goLogin">
  197. {{ copy.loginCta }}
  198. </button>
  199. <button v-else-if="isSelf && activeTab === 'series'" class="mine-primary-btn" size="mini"
  200. @tap="onCreateSeries">
  201. {{ copy.createSeries }}
  202. </button>
  203. </view>
  204. <view v-else-if="activeTab === 'series'" class="mine-grid">
  205. <view v-for="(item, index) in activeFeed.items" :key="gridKey(item, index)" class="mine-card"
  206. @tap="openItem(item)">
  207. <view class="mine-card-media">
  208. <image class="mine-card-img" :src="cardCover(item)" mode="aspectFill" />
  209. </view>
  210. <view class="mine-card-series">
  211. <text class="mine-card-series-title">{{ item.title || copy.unnamedSeries }}</text>
  212. <view v-if="isSelf" class="mine-card-self">
  213. <text class="mine-card-action" @tap.stop="onEditSeries(item)">{{ copy.edit }}</text>
  214. <text class="mine-card-action mine-card-action--del" @tap.stop="onDeleteItem(index)">{{ copy.delete
  215. }}</text>
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. <view v-else class="mine-works-list">
  221. <view v-for="(item, index) in activeFeed.items" :key="gridKey(item, index)" class="mine-works-item">
  222. <view class="mine-works-cover" @tap="openItem(item)">
  223. <image v-if="workCover(item)" class="mine-works-cover-img" :src="workCover(item)" mode="aspectFill" />
  224. <view v-else class="mine-works-cover-empty" />
  225. <view v-if="item.type === 'video'" class="mine-works-video-badge">
  226. <text class="mine-works-video-badge-icon">▶</text>
  227. </view>
  228. <view v-if="item.state && item.state !== 'normal'" class="mine-works-state">
  229. <text class="mine-works-state-txt">{{ stateLabel(item.state) }}</text>
  230. </view>
  231. </view>
  232. <view class="mine-works-body">
  233. <view class="mine-works-desc" @tap="openItem(item)">
  234. <text v-if="item.type_text" class="mine-works-tag">{{ item.type_text }}</text>
  235. <text class="mine-works-text">{{ formatContent(item.content) || ' ' }}</text>
  236. </view>
  237. <view class="mine-works-foot">
  238. <view class="mine-works-foot-left">
  239. <text class="mine-works-date">{{ formatDate(item.createtime) }} {{ copy.publishedAt }}</text>
  240. <text v-if="isSelf && activeTab === 'works'" class="mine-works-del"
  241. @tap.stop="onDeleteItem(index)">{{ copy.delete }}</text>
  242. </view>
  243. <view class="mine-works-like" :class="{ 'mine-works-like--on': item.isLike === 1 }"
  244. @tap.stop="onLikeItem(index)">
  245. <text class="mine-works-like-icon">♥</text>
  246. <text class="mine-works-like-num">{{ item.likes || 0 }}</text>
  247. </view>
  248. </view>
  249. </view>
  250. </view>
  251. </view>
  252. <view v-if="!isGuestHome && activeFeed.items.length" class="mine-more">
  253. <text class="mine-more-txt">{{ loadMoreText }}</text>
  254. </view>
  255. </view>
  256. <view v-show="!panelOpen" class="mine-tabbar-space" :style="{ height: listBottomPad + 'px' }" />
  257. </scroll-view>
  258. <view v-if="isSelf && activeTab === 'series' && !isGuestHome" class="mine-series-fab" @tap="onCreateSeries">
  259. <text class="mine-series-fab-icon">+</text>
  260. </view>
  261. </view>
  262. <mine-side-panel slot="drawer" :active="panelOpen" @close="closeSettingsPanel" @publish="onPublish"
  263. @open-security="onPanelOpenSecurity" @navigate="onPanelNavigate" />
  264. </mine-drawer-shell>
  265. <app-tabbar v-show="!panelOpen" active="mine" />
  266. <!-- #ifndef MP-WEIXIN -->
  267. <view v-if="avatarCropUrl" class="mine-avatar-crop-layer">
  268. <image-cutter :url="avatarCropUrl" :fixed="true" :width="200" :height="200" :max-width="500" :max-height="500"
  269. :blob="false" @ok="onAvatarCropOk" @cancel="onAvatarCropCancel" />
  270. </view>
  271. <!-- #endif -->
  272. </view>
  273. </template>
  274. <script>
  275. import { mapState } from 'vuex'
  276. import { fetchOrderStats } from '@/features/mall/mall-gateway'
  277. import AppTabbar from '@/components/app-tabbar/app-tabbar.vue'
  278. import MineDrawerShell from '@/components/mine-drawer-shell/mine-drawer-shell.vue'
  279. import MineSidePanel from '@/components/mine-side-panel/mine-side-panel.vue'
  280. import { detailPageUrl, videoDetailUrl } from '@/features/dynamics/post-media'
  281. import {
  282. fetchProfileCard,
  283. fetchProfileContentPage,
  284. fetchProfileSeriesPage,
  285. toggleProfileFollow,
  286. toggleProfileLike,
  287. removeProfileContent,
  288. removeProfileSeries,
  289. fetchWalletSnapshot
  290. } from '@/features/profile/profile-gateway'
  291. import { fetchRealnameStatus } from '@/features/account/realname-gateway'
  292. import {
  293. normalizeRealnameFlag,
  294. shouldOpenRealnameDetail,
  295. REALNAME_NONE
  296. } from '@/features/mine-panel/realname-bridge'
  297. import { uploadAndUpdateAvatar } from '@/features/account/avatar-gateway'
  298. import { absolutizeMedia } from '@/features/feed/media-resolve'
  299. import ImageCutter from '@/components/image-cutter/image-cutter.vue'
  300. const EMPTY_IMAGE_PATH = '/assets/img/empty.png'
  301. const TABBAR_H = 100
  302. const TAB_DEFS = [
  303. { key: 'works', labelKey: 'mine.tabWorks' },
  304. { key: 'likes', labelKey: 'mine.tabLikes' },
  305. { key: 'series', labelKey: 'mine.tabSeries', ownerOnly: true, hidden: true }
  306. ]
  307. function filterVisibleTabs(tabs, isSelf) {
  308. return tabs.filter((t) => {
  309. if (t.hidden) return false
  310. if (t.ownerOnly && !isSelf) return false
  311. return true
  312. })
  313. }
  314. const ACTION_DEFS = [
  315. { key: 'comment', labelKey: 'mine.actionComment', iconClass: 'wlIcon-icon_pinglun wanl-text-red' },
  316. { key: 'address', labelKey: 'mine.actionAddress', iconClass: 'wlIcon-dizhi wanl-text-yellow' },
  317. { key: 'smartAssistant', labelKey: 'mine.actionSmartAssistant', iconClass: 'wlIcon-kefu wanl-text-green' },
  318. { key: 'settings', labelKey: 'mine.actionSettings', iconClass: 'wlIcon-shezhi wanl-text-purple' }
  319. ]
  320. const GUEST_TABS = [{ key: 'works', labelKey: 'mine.tabWorks' }]
  321. function emptyProfile() {
  322. return {
  323. user_no: '',
  324. user: { avatar: '', nickname: '—', bio: '' },
  325. follow: 0,
  326. fans: 0,
  327. praised: 0,
  328. look_number: 0,
  329. works: 0,
  330. views: 0,
  331. isFollow: 0,
  332. image: '',
  333. shop: null
  334. }
  335. }
  336. function emptyFeedState() {
  337. return {
  338. items: [],
  339. page: 1,
  340. lastPage: 1,
  341. loading: false,
  342. loaded: false,
  343. status: 'more'
  344. }
  345. }
  346. export default {
  347. components: { AppTabbar, MineDrawerShell, MineSidePanel, ImageCutter },
  348. data() {
  349. return {
  350. panelOpen: false,
  351. statusBar: 0,
  352. safeBottom: 0,
  353. windowHeight: 667,
  354. pullRefreshing: false,
  355. targetUserId: null,
  356. isSelf: false,
  357. followBusy: false,
  358. activeTab: 'works',
  359. profile: emptyProfile(),
  360. feeds: {
  361. works: emptyFeedState(),
  362. likes: emptyFeedState(),
  363. series: emptyFeedState()
  364. },
  365. refreshing: false,
  366. pendingReload: false,
  367. showMailBadge: false,
  368. showMailBtnBg: false,
  369. avatarCropUrl: '',
  370. avatarUploading: false,
  371. avatarPreviewPath: '',
  372. diamondBalance: null
  373. }
  374. },
  375. computed: {
  376. ...mapState({
  377. storeUser: (state) => state.user,
  378. orderStats: (state) => state.statistics.order
  379. }),
  380. copy() {
  381. const t = this.$t.bind(this)
  382. return {
  383. accountLabel: t('mine.accountLabel'),
  384. copyBtn: t('mine.copyBtn'),
  385. statFans: t('mine.statFans'),
  386. statFollow: t('mine.statFollow'),
  387. statViews: t('mine.statViews'),
  388. statLikes: t('mine.statLikes'),
  389. loginCta: t('mine.loginCta'),
  390. loginHint: t('mine.loginHint'),
  391. guestName: t('mine.guestName'),
  392. guestBio: t('mine.guestBio'),
  393. guestBar: t('mine.guestBar'),
  394. defaultBio: t('mine.defaultBio'),
  395. follow: t('mine.follow'),
  396. followed: t('mine.followed'),
  397. loading: t('mine.loading'),
  398. noMore: t('mine.noMore'),
  399. loadMore: t('mine.loadMore'),
  400. deleteConfirm: t('mine.deleteConfirm'),
  401. deleteSeriesConfirm: t('mine.deleteSeriesConfirm'),
  402. emptyWorks: t('mine.emptyWorks'),
  403. emptyLikes: t('mine.emptyLikes'),
  404. emptySeries: t('mine.emptySeries'),
  405. dev: t('mine.dev'),
  406. unnamedSeries: t('mine.unnamedSeries'),
  407. edit: t('mine.edit'),
  408. delete: t('mine.delete'),
  409. publishBtn: t('mine.publishBtn'),
  410. createSeries: t('mine.createSeries'),
  411. publishedAt: t('mine.publishedAt'),
  412. editSeries: t('mine.editSeries'),
  413. loadFailed: t('mine.loadFailed'),
  414. actionFailed: t('mine.actionFailed'),
  415. deleted: t('mine.deleted'),
  416. deleteFailed: t('mine.deleteFailed'),
  417. avatarUploading: t('mine.avatarUploading'),
  418. avatarUpdated: t('mine.avatarUpdated'),
  419. avatarUploadFailed: t('mine.avatarUploadFailed'),
  420. editProfile: t('mine.editProfile'),
  421. seriesDetail: t('mine.seriesDetail'),
  422. needLogin: t('mine.needLogin'),
  423. viewsTip: t('mine.viewsTip'),
  424. diamond: t('money.diamond')
  425. }
  426. },
  427. signedIn() {
  428. return !!this.storeUser.isLogin
  429. },
  430. diamondDisplay() {
  431. const n = Number(this.diamondBalance)
  432. if (!Number.isFinite(n)) return '0.00'
  433. return n.toFixed(2)
  434. },
  435. isGuestHome() {
  436. return !this.signedIn && !this.targetUserId
  437. },
  438. displayName() {
  439. if (this.signedIn) return this.profile.user.nickname || '—'
  440. return this.copy.guestName
  441. },
  442. profileBioText() {
  443. const raw =
  444. (this.profile.user && this.profile.user.bio) ||
  445. this.profile.bio ||
  446. ''
  447. return String(raw)
  448. .replace(/<[^>]+>/g, '')
  449. .replace(/&nbsp;/g, ' ')
  450. .trim()
  451. },
  452. displayBio() {
  453. if (this.isGuestHome) return this.copy.guestBio
  454. return this.profileBioText || this.copy.defaultBio
  455. },
  456. displayActions() {
  457. // 仅在浏览他人主页时隐藏;Tab 本人页 / 游客始终展示
  458. if (this.signedIn && this.targetUserId && !this.isSelf) return []
  459. return ACTION_DEFS.map((item) => ({
  460. ...item,
  461. label: this.$t(item.labelKey)
  462. }))
  463. },
  464. visibleTabs() {
  465. const tabs = !this.signedIn ? GUEST_TABS : TAB_DEFS
  466. return filterVisibleTabs(tabs, this.isSelf).map((item) => ({
  467. ...item,
  468. label: this.$t(item.labelKey)
  469. }))
  470. },
  471. activeFeed() {
  472. return this.feeds[this.activeTab] || emptyFeedState()
  473. },
  474. tabbarPad() {
  475. return uni.upx2px(TABBAR_H)
  476. },
  477. tabbarTotalHeight() {
  478. return this.tabbarPad + (this.safeBottom || 0)
  479. },
  480. scrollHeight() {
  481. return Math.max(200, this.windowHeight - this.tabbarTotalHeight)
  482. },
  483. listBottomPad() {
  484. return this.tabbarTotalHeight + uni.upx2px(24)
  485. },
  486. coverUrl() {
  487. if (!this.profile.image) return ''
  488. return this.$appKit.oss(this.profile.image, 750, 320, 1, 'transparent', 'jpg')
  489. },
  490. avatarUrl() {
  491. return this.$appKit.oss(this.profile.user.avatar, 200, 200, 2, 'avatar')
  492. },
  493. avatarDisplayUrl() {
  494. if (this.avatarPreviewPath) return this.avatarPreviewPath
  495. return this.avatarUrl
  496. },
  497. viewCount() {
  498. const v = this.profile.look_number ?? this.profile.views ?? this.profile.works ?? 0
  499. const n = Number(v)
  500. return Number.isFinite(n) && n >= 0 ? n : 0
  501. },
  502. emptyHint() {
  503. if (this.isGuestHome) return this.copy.loginHint
  504. if (this.activeTab === 'likes') return this.copy.emptyLikes
  505. if (this.activeTab === 'series') return this.copy.emptySeries
  506. return this.copy.emptyWorks
  507. },
  508. emptyImageUrl() {
  509. return absolutizeMedia(EMPTY_IMAGE_PATH)
  510. },
  511. loadMoreText() {
  512. if (this.activeFeed.status === 'loading') return this.copy.loading
  513. if (this.activeFeed.status === 'noMore') return this.copy.noMore
  514. return this.copy.loadMore
  515. },
  516. profilePadStyle() {
  517. const top = (this.statusBar || 0) + uni.upx2px(32)
  518. return { paddingTop: `${top}px` }
  519. },
  520. showMailBtn() {
  521. return !this.targetUserId || this.isSelf
  522. }
  523. },
  524. watch: {
  525. '$store.state.user.isLogin'(val) {
  526. if (val) {
  527. this.resetAllFeeds()
  528. this.reloadAll({ silent: true })
  529. } else {
  530. this.resetGuest()
  531. }
  532. }
  533. },
  534. onLoad(query) {
  535. try {
  536. const info = uni.getSystemInfoSync()
  537. this.statusBar = info.statusBarHeight || 0
  538. this.safeBottom = (info.safeAreaInsets && info.safeAreaInsets.bottom) || 0
  539. this.windowHeight = info.windowHeight || 667
  540. } catch (_) { }
  541. if (query && query.id) this.targetUserId = query.id
  542. this.reloadAll({ silent: true })
  543. },
  544. onShow() {
  545. setTimeout(() => {
  546. try { uni.hideTabBar({ animation: false }) } catch (_) { }
  547. }, 0)
  548. this.reloadAll({ silent: true })
  549. },
  550. onHide() {
  551. this.panelOpen = false
  552. },
  553. onBackPress() {
  554. if (this.panelOpen) {
  555. this.closeSettingsPanel()
  556. return true
  557. }
  558. return false
  559. },
  560. methods: {
  561. async loadOrderStats() {
  562. try {
  563. const stats = await fetchOrderStats()
  564. this.$store.commit('statistics/order', stats)
  565. } catch (e) {
  566. console.error('[mine] 加载订单统计失败:', e)
  567. }
  568. },
  569. openSettingsPanel() {
  570. this.panelOpen = true
  571. },
  572. closeSettingsPanel() {
  573. this.panelOpen = false
  574. },
  575. fmtCount(n) {
  576. const val = Number(n)
  577. if (!Number.isFinite(val) || val < 0) return 0
  578. return this.$appKit.toFormat(val, 'thousand')
  579. },
  580. resetGuest() {
  581. this.isSelf = false
  582. this.profile = emptyProfile()
  583. this.diamondBalance = null
  584. this.resetAllFeeds()
  585. },
  586. resetAllFeeds() {
  587. Object.keys(this.feeds).forEach((k) => {
  588. this.feeds[k] = emptyFeedState()
  589. })
  590. },
  591. ensureActiveTabVisible() {
  592. const keys = this.visibleTabs.map((t) => t.key)
  593. if (!keys.includes(this.activeTab)) {
  594. this.activeTab = keys[0] || 'works'
  595. }
  596. },
  597. requireLogin() {
  598. return this.$appKit && this.$appKit.requireLogin()
  599. },
  600. onMail() {
  601. uni.navigateTo({ url: '/pages/notice/sys-notice/index' })
  602. },
  603. onRefresherRefresh() {
  604. if (this.panelOpen) {
  605. this.pullRefreshing = false
  606. return
  607. }
  608. this.pullRefresh()
  609. },
  610. onRefresherEnd() {
  611. this.pullRefreshing = false
  612. },
  613. async pullRefresh() {
  614. if (this.panelOpen || this.pullRefreshing) return
  615. this.pullRefreshing = true
  616. try {
  617. await this.reloadAll({ silent: true })
  618. } finally {
  619. this.pullRefreshing = false
  620. }
  621. },
  622. onScrollToLower() {
  623. if (this.panelOpen) return
  624. this.loadFindData('append')
  625. },
  626. async reloadAll({ silent = false } = {}) {
  627. if (this.refreshing) {
  628. this.pendingReload = true
  629. return
  630. }
  631. this.refreshing = true
  632. try {
  633. if (!this.signedIn && !this.targetUserId) {
  634. this.resetGuest()
  635. this.activeTab = 'works'
  636. const feed = this.feeds.works
  637. feed.items = []
  638. feed.page = 1
  639. feed.lastPage = 1
  640. feed.loading = false
  641. feed.loaded = true
  642. feed.status = 'noMore'
  643. return
  644. }
  645. this.ensureActiveTabVisible()
  646. await this.loadProfile()
  647. if (this.signedIn && this.isSelf) {
  648. await this.loadDiamondBalance()
  649. await this.loadOrderStats()
  650. } else {
  651. this.diamondBalance = null
  652. }
  653. await this.loadFindData(silent ? 'silentRefresh' : 'refresh')
  654. } catch (err) {
  655. if (!silent) {
  656. this.$appKit.msg(err.message || this.copy.loadFailed)
  657. }
  658. } finally {
  659. this.refreshing = false
  660. if (this.pendingReload) {
  661. this.pendingReload = false
  662. this.reloadAll({ silent: true })
  663. }
  664. }
  665. },
  666. onPublish() {
  667. if (!this.requireLogin()) return
  668. uni.navigateTo({ url: '/pages/dynamics/publish' })
  669. },
  670. onPanelOpenSecurity() {
  671. if (!this.requireLogin()) return
  672. this.onPanelNavigate({ url: '/pages/account/security' })
  673. },
  674. async loadProfile() {
  675. const card = await fetchProfileCard(this.targetUserId)
  676. const userNo = card.user_no || (card.user && card.user.user_no) || ''
  677. this.profile = {
  678. ...emptyProfile(),
  679. ...card,
  680. user_no: userNo,
  681. user: {
  682. ...emptyProfile().user,
  683. ...(card.user || {}),
  684. bio: ((card.user && card.user.bio) || card.bio || '').trim()
  685. }
  686. }
  687. if (this.signedIn && Number(card.user_id) === Number(this.storeUser.id)) {
  688. this.isSelf = true
  689. } else if (this.signedIn && !this.targetUserId) {
  690. this.isSelf = true
  691. } else {
  692. this.isSelf = false
  693. }
  694. if (!this.isSelf && this.activeTab === 'series') {
  695. this.activeTab = 'works'
  696. }
  697. this.ensureActiveTabVisible()
  698. },
  699. switchTab(key) {
  700. const tab = TAB_DEFS.find((t) => t.key === key) || GUEST_TABS.find((t) => t.key === key)
  701. if (tab && tab.hidden) return
  702. if (this.isGuestHome) {
  703. this.requireLogin()
  704. return
  705. }
  706. if (!this.signedIn && key !== 'works') {
  707. this.requireLogin()
  708. return
  709. }
  710. const sameTab = this.activeTab === key
  711. this.activeTab = key
  712. this.loadFindData(sameTab ? 'refresh' : 'tabChange')
  713. },
  714. /** 同 myuser.vue loadFindData / loadCompilationList */
  715. async loadFindData(source = 'append') {
  716. if (this.isGuestHome) return
  717. if (!this.profile.user_no) return
  718. const feed = this.feeds[this.activeTab]
  719. if (!feed) return
  720. const isRefresh = source === 'refresh' || source === 'silentRefresh'
  721. if (isRefresh) {
  722. feed.page = 1
  723. feed.status = 'more'
  724. feed.loaded = false
  725. if (source === 'refresh') feed.items = []
  726. }
  727. if (feed.status === 'noMore' && source === 'append') return
  728. if (source === 'tabChange' && feed.loaded) return
  729. if (feed.status === 'loading') return
  730. feed.status = 'loading'
  731. feed.loading = true
  732. try {
  733. let pack
  734. if (this.activeTab === 'series') {
  735. pack = await fetchProfileSeriesPage(this.profile.user_no, feed.page)
  736. } else {
  737. const isMyfindWorks = this.activeTab === 'works' && this.isSelf
  738. pack = await fetchProfileContentPage({
  739. tabKey: this.activeTab,
  740. userNo: this.profile.user_no,
  741. page: feed.page,
  742. isOwner: isMyfindWorks
  743. })
  744. }
  745. feed.page = pack.currentPage
  746. if (pack.currentPage >= pack.lastPage) {
  747. feed.status = 'noMore'
  748. } else {
  749. feed.status = 'more'
  750. feed.page = pack.currentPage + 1
  751. }
  752. const incoming = pack.rows || []
  753. if (isRefresh) {
  754. feed.items = incoming
  755. } else {
  756. feed.items = feed.items.concat(incoming)
  757. }
  758. feed.loaded = true
  759. } catch (err) {
  760. feed.status = 'more'
  761. feed.loaded = true
  762. if (source !== 'silentRefresh') {
  763. this.$appKit.msg(err.message || this.copy.loadFailed)
  764. }
  765. } finally {
  766. feed.loading = false
  767. }
  768. },
  769. formatContent(content) {
  770. if (!content) return ''
  771. return String(content).replace(/<\/?.+?>/g, '').replace(/ /g, '').trim()
  772. },
  773. formatDate(ts) {
  774. if (!ts) return ''
  775. return this.$appKit.timeFormat(ts, 'mm-dd') || ''
  776. },
  777. copyAccount() {
  778. if (!this.profile.user_no) return
  779. this.$appKit.copy(this.profile.user_no)
  780. },
  781. onCreateSeries() {
  782. if (!this.requireLogin()) return
  783. this.hintSoon(this.copy.createSeries)
  784. },
  785. onEditSeries(item) {
  786. if (!this.isSelf || !item) return
  787. this.hintSoon(this.copy.editSeries)
  788. },
  789. onStatTap(type) {
  790. if (!this.requireLogin()) return
  791. if (!this.profile.user_no) {
  792. this.$appKit.msg(this.copy.loading)
  793. return
  794. }
  795. if (type === 'praised') {
  796. this.showPraiseTip()
  797. return
  798. }
  799. if (type === 'views') {
  800. this.showViewsTip()
  801. return
  802. }
  803. if (type === 'fans') {
  804. uni.navigateTo({
  805. url: `/pages/mine/fans?id=${encodeURIComponent(this.profile.user_no)}`
  806. })
  807. return
  808. }
  809. if (type === 'follow') {
  810. uni.navigateTo({
  811. url: `/pages/mine/follow?id=${encodeURIComponent(this.profile.user_no)}`
  812. })
  813. return
  814. }
  815. },
  816. gridKey(item, index) {
  817. return item.id || item.series_id || `row-${index}`
  818. },
  819. cardCover(item) {
  820. if (this.activeTab === 'series') {
  821. const path = item.image || item.cover || ''
  822. return path ? this.$appKit.oss(path, 400, 520) : ''
  823. }
  824. return this.workCover(item)
  825. },
  826. workCover(item) {
  827. if (!item) return ''
  828. const images = Array.isArray(item.images) ? item.images : []
  829. const path = images[0] || (item.video && item.video.cover_url) || item.image || item.cover || ''
  830. if (!path) return ''
  831. return this.$appKit.oss(path, 400, 920)
  832. },
  833. stateLabel(state) {
  834. const map = {
  835. examine: 'mine.stateExamine',
  836. hazard: 'mine.stateHazard',
  837. transcoding: 'mine.stateTranscoding',
  838. screenshot: 'mine.stateScreenshot',
  839. publish: 'mine.statePublish'
  840. }
  841. const key = map[state]
  842. return key ? this.$t(key) : state
  843. },
  844. openItem(item) {
  845. if (this.activeTab === 'series') {
  846. this.hintSoon(this.copy.seriesDetail)
  847. return
  848. }
  849. if (item.state && item.state !== 'normal') {
  850. this.$appKit.msg(this.stateLabel(item.state))
  851. return
  852. }
  853. if (item.type === 'video') {
  854. uni.navigateTo({
  855. url: videoDetailUrl(item.id, { labelId: item.label_id })
  856. })
  857. return
  858. }
  859. if (item.type === 'live' && item.live_id) {
  860. uni.navigateTo({ url: `/pages/live/watch?id=${item.live_id}` })
  861. return
  862. }
  863. if (item.id) {
  864. uni.navigateTo({ url: detailPageUrl(item.id) })
  865. }
  866. },
  867. openItemComments(item) {
  868. if (!item || !item.id) return
  869. if (item.state && item.state !== 'normal') {
  870. this.$appKit.msg(this.stateLabel(item.state))
  871. return
  872. }
  873. uni.navigateTo({ url: detailPageUrl(item.id, { focus: 'comments' }) })
  874. },
  875. async onFollowTap() {
  876. if (!this.requireLogin()) return
  877. if (this.followBusy) return
  878. this.followBusy = true
  879. try {
  880. const flag = await toggleProfileFollow(this.profile.user_no)
  881. if (flag === 0 || flag === '0') {
  882. this.profile.isFollow = 0
  883. this.profile.fans = Math.max(0, Number(this.profile.fans || 0) - 1)
  884. } else {
  885. this.profile.isFollow = 1
  886. this.profile.fans = Number(this.profile.fans || 0) + 1
  887. }
  888. } catch (err) {
  889. this.$appKit.msg(err.message || this.copy.actionFailed)
  890. } finally {
  891. this.followBusy = false
  892. }
  893. },
  894. async onLikeItem(index) {
  895. if (!this.requireLogin()) return
  896. const row = this.activeFeed.items[index]
  897. if (!row || !row.id) return
  898. try {
  899. const flag = await toggleProfileLike(row.id)
  900. if (flag === 0 || flag === '0') {
  901. row.likes = Math.max(0, Number(row.likes || 0) - 1)
  902. row.isLike = 0
  903. } else {
  904. row.likes = Number(row.likes || 0) + 1
  905. row.isLike = 1
  906. }
  907. } catch (err) {
  908. this.$appKit.msg(err.message || this.copy.actionFailed)
  909. }
  910. },
  911. onDeleteItem(index) {
  912. if (!this.isSelf) return
  913. const row = this.activeFeed.items[index]
  914. if (!row) return
  915. const isSeries = this.activeTab === 'series'
  916. uni.showModal({
  917. content: isSeries ? this.copy.deleteSeriesConfirm : this.copy.deleteConfirm,
  918. success: async (res) => {
  919. if (!res.confirm) return
  920. try {
  921. if (isSeries) {
  922. await removeProfileSeries(row.id || row.series_id)
  923. } else {
  924. await removeProfileContent(row.id)
  925. }
  926. this.activeFeed.items.splice(index, 1)
  927. this.$appKit.msg(this.copy.deleted)
  928. if (!this.activeFeed.items.length) {
  929. this.loadFindData('refresh')
  930. }
  931. } catch (err) {
  932. this.$appKit.msg(err.message || this.copy.deleteFailed)
  933. }
  934. }
  935. })
  936. },
  937. showPraiseTip() {
  938. const name = this.profile.user.nickname || ''
  939. const n = this.fmtCount(this.profile.praised)
  940. uni.showModal({
  941. content: this.$t('mine.praiseModal', { name, count: n }),
  942. showCancel: false
  943. })
  944. },
  945. showViewsTip() {
  946. const name = this.profile.user.nickname || ''
  947. const n = this.fmtCount(this.viewCount)
  948. uni.showModal({
  949. content: this.$t('mine.viewsModal', { name, count: n }),
  950. showCancel: false
  951. })
  952. },
  953. onAvatarTap() {
  954. if (!this.requireLogin()) return
  955. },
  956. onChangeAvatar() {
  957. if (!this.requireLogin() || !this.isSelf || this.avatarUploading) return
  958. uni.chooseImage({
  959. count: 1,
  960. sizeType: ['compressed'],
  961. sourceType: ['album', 'camera'],
  962. success: (res) => {
  963. const path = res.tempFilePaths && res.tempFilePaths[0]
  964. if (path) this.avatarCropUrl = path
  965. }
  966. })
  967. },
  968. onAvatarCropCancel() {
  969. this.avatarCropUrl = ''
  970. },
  971. onAvatarCropOk(e) {
  972. this.avatarCropUrl = ''
  973. const path = e && e.path
  974. if (path) this.submitAvatarFile(path)
  975. },
  976. onWeixinChooseAvatar(e) {
  977. const path = e && e.detail && e.detail.avatarUrl
  978. if (path) this.submitAvatarFile(path)
  979. },
  980. async submitAvatarFile(filePath) {
  981. if (!filePath || this.avatarUploading) return
  982. this.avatarUploading = true
  983. this.avatarPreviewPath = filePath
  984. uni.showLoading({ mask: true, title: this.copy.avatarUploading })
  985. try {
  986. const avatar = await uploadAndUpdateAvatar(filePath)
  987. this.$store.commit('user/apply', { avatar })
  988. const user = { ...(this.profile.user || {}), avatar }
  989. this.profile = { ...this.profile, user }
  990. this.avatarPreviewPath = ''
  991. this.$appKit.msg(this.copy.avatarUpdated)
  992. } catch (err) {
  993. this.avatarPreviewPath = ''
  994. this.$appKit.msg((err && err.message) || this.copy.avatarUploadFailed)
  995. } finally {
  996. this.avatarUploading = false
  997. uni.hideLoading()
  998. }
  999. },
  1000. onEditProfile() {
  1001. if (!this.requireLogin()) return
  1002. uni.navigateTo({
  1003. url: '/pages/account/profile-edit',
  1004. fail: () => this.$appKit.to('/pages/account/profile-edit')
  1005. })
  1006. },
  1007. onPanelNavigate(payload) {
  1008. const url = payload && payload.url
  1009. if (!url) return
  1010. const opts = { url }
  1011. if (payload.animationType) {
  1012. opts.animationType = payload.animationType
  1013. opts.animationDuration = payload.animationDuration != null ? payload.animationDuration : 300
  1014. }
  1015. opts.fail = (err) => {
  1016. if (this.$appKit && this.$appKit.to) {
  1017. this.$appKit.to(url, payload.animationType, payload.animationDuration)
  1018. } else {
  1019. console.warn('[mine] panel navigate failed', url, err)
  1020. }
  1021. }
  1022. uni.navigateTo(opts)
  1023. },
  1024. onAction(key) {
  1025. if (!this.requireLogin()) return
  1026. switch (key) {
  1027. case 'comment':
  1028. uni.navigateTo({ url: '/pages/user/comment/comment' })
  1029. break
  1030. case 'address':
  1031. uni.navigateTo({ url: '/pages/user/address/address' })
  1032. break
  1033. case 'smartAssistant':
  1034. uni.navigateTo({ url: '/pages/user/service' })
  1035. break
  1036. case 'settings':
  1037. this.openSettingsPanel()
  1038. break
  1039. default:
  1040. this.hintSoon()
  1041. }
  1042. },
  1043. goLogin() {
  1044. this.requireLogin()
  1045. },
  1046. goOrderList(state) {
  1047. uni.navigateTo({ url: `/pages/order/list?state=${state}` })
  1048. },
  1049. goRefundList() {
  1050. uni.navigateTo({ url: '/pages/user/refund/lists' })
  1051. },
  1052. goCoupon() {
  1053. uni.navigateTo({ url: '/pages/user/coupon/list' })
  1054. },
  1055. goMyCouponList() {
  1056. uni.navigateTo({ url: '/pages/user/coupon/mycard' })
  1057. },
  1058. goDiamondTopUp() {
  1059. if (!this.requireLogin()) return
  1060. uni.navigateTo({ url: '/pages/user/money/diamond-top-up' })
  1061. },
  1062. async loadDiamondBalance() {
  1063. try {
  1064. const snap = await fetchWalletSnapshot()
  1065. this.diamondBalance = snap && snap.diamond != null ? Number(snap.diamond) || 0 : 0
  1066. } catch (_) {
  1067. this.diamondBalance = 0
  1068. }
  1069. },
  1070. // 购物车
  1071. goCart() {
  1072. uni.navigateTo({ url: '/pages/cart/index' })
  1073. },
  1074. // 收藏列表
  1075. goFavorite() {
  1076. uni.navigateTo({ url: '/pages/user/collect' })
  1077. },
  1078. // 关注列表
  1079. goFollowShop() {
  1080. uni.navigateTo({ url: '/pages/user/follow' })
  1081. },
  1082. // 足迹列表
  1083. goFootprint() {
  1084. uni.navigateTo({ url: '/pages/user/footprint' })
  1085. },
  1086. hintSoon(label) {
  1087. this.$appKit.msg(label || this.copy.dev)
  1088. }
  1089. }
  1090. }
  1091. </script>
  1092. <style scoped>
  1093. .mine-root {
  1094. min-height: 100vh;
  1095. width: 100%;
  1096. position: relative;
  1097. }
  1098. .mine-page {
  1099. height: 100vh;
  1100. width: 100%;
  1101. display: flex;
  1102. flex-direction: column;
  1103. overflow: hidden;
  1104. box-sizing: border-box;
  1105. background-color: #f4f6fb;
  1106. }
  1107. .mine-scroll {
  1108. flex: 1;
  1109. width: 100%;
  1110. min-height: 0;
  1111. }
  1112. .mine-hero {
  1113. position: relative;
  1114. width: 100%;
  1115. min-height: 420rpx;
  1116. }
  1117. .mine-mail-btn {
  1118. position: absolute;
  1119. right: 32rpx;
  1120. z-index: 3;
  1121. width: 72rpx;
  1122. height: 72rpx;
  1123. border-radius: 50%;
  1124. background-color: rgba(0, 0, 0, 0.28);
  1125. display: flex;
  1126. align-items: center;
  1127. justify-content: center;
  1128. }
  1129. .mine-mail-btn--card {
  1130. border-radius: 20rpx;
  1131. background-color: rgba(255, 255, 255, 0.92);
  1132. box-shadow: 0 6rpx 20rpx rgba(74, 140, 255, 0.12);
  1133. }
  1134. .mine-mail-icon {
  1135. width: 40rpx;
  1136. height: 40rpx;
  1137. flex-shrink: 0;
  1138. }
  1139. .mine-mail-dot {
  1140. position: absolute;
  1141. top: 12rpx;
  1142. right: 12rpx;
  1143. width: 14rpx;
  1144. height: 14rpx;
  1145. border-radius: 7rpx;
  1146. background-color: #ff4d4f;
  1147. }
  1148. .mine-cover {
  1149. position: absolute;
  1150. top: 0;
  1151. left: 0;
  1152. right: 0;
  1153. width: 100%;
  1154. height: 420rpx;
  1155. overflow: hidden;
  1156. }
  1157. .mine-cover-img,
  1158. .mine-cover-placeholder {
  1159. width: 100%;
  1160. height: 100%;
  1161. }
  1162. .mine-cover-placeholder {
  1163. background: linear-gradient(160deg, #8ec5ff 0%, #e0ecff 55%, #f4f6fb 100%);
  1164. }
  1165. .mine-cover-fade {
  1166. position: absolute;
  1167. left: 0;
  1168. right: 0;
  1169. bottom: 0;
  1170. height: 220rpx;
  1171. background: linear-gradient(to bottom, rgba(244, 246, 251, 0), rgba(244, 246, 251, 1));
  1172. }
  1173. .mine-profile {
  1174. position: relative;
  1175. z-index: 2;
  1176. display: flex;
  1177. flex-direction: column;
  1178. align-items: center;
  1179. width: 100%;
  1180. padding-left: 28rpx;
  1181. padding-right: 28rpx;
  1182. padding-bottom: 24rpx;
  1183. box-sizing: border-box;
  1184. }
  1185. .mine-guest-bar {
  1186. display: flex;
  1187. flex-direction: row;
  1188. align-items: center;
  1189. justify-content: space-between;
  1190. width: 100%;
  1191. margin-top: 20rpx;
  1192. padding: 16rpx 20rpx;
  1193. border-radius: 16rpx;
  1194. background-color: rgba(74, 140, 255, 0.1);
  1195. box-sizing: border-box;
  1196. }
  1197. .mine-guest-bar-txt {
  1198. flex: 1;
  1199. font-size: 24rpx;
  1200. color: #4a8cff;
  1201. line-height: 1.4;
  1202. padding-right: 16rpx;
  1203. }
  1204. .mine-guest-bar-btn {
  1205. flex-shrink: 0;
  1206. padding: 0 24rpx;
  1207. height: 56rpx;
  1208. line-height: 56rpx;
  1209. font-size: 24rpx;
  1210. color: #ffffff;
  1211. background: linear-gradient(135deg, #4a8cff 0%, #6ec8ff 100%);
  1212. border-radius: 999rpx;
  1213. border: none;
  1214. }
  1215. .mine-avatar-wrap {
  1216. position: relative;
  1217. display: flex;
  1218. flex-direction: row;
  1219. justify-content: center;
  1220. align-items: center;
  1221. margin-bottom: 20rpx;
  1222. }
  1223. .mine-avatar {
  1224. width: 176rpx;
  1225. height: 176rpx;
  1226. border-radius: 88rpx;
  1227. border: 6rpx solid #ffffff;
  1228. background-color: #e8edf5;
  1229. box-shadow: 0 12rpx 40rpx rgba(74, 140, 255, 0.18);
  1230. }
  1231. .mine-avatar--empty {
  1232. background-color: #dce4f0;
  1233. }
  1234. .mine-avatar-cam {
  1235. position: absolute;
  1236. left: 8rpx;
  1237. bottom: 8rpx;
  1238. width: 52rpx;
  1239. height: 52rpx;
  1240. border-radius: 26rpx;
  1241. background-color: #1a1d26;
  1242. display: flex;
  1243. align-items: center;
  1244. justify-content: center;
  1245. border: 4rpx solid #ffffff;
  1246. }
  1247. .mine-avatar-cam-icon {
  1248. font-size: 24rpx;
  1249. line-height: 1;
  1250. }
  1251. .mine-avatar-cam-btn {
  1252. position: absolute;
  1253. left: 8rpx;
  1254. bottom: 8rpx;
  1255. padding: 0;
  1256. margin: 0;
  1257. background: transparent;
  1258. border: none;
  1259. line-height: 1;
  1260. }
  1261. .mine-avatar-cam-btn::after {
  1262. border: none;
  1263. }
  1264. .mine-avatar-crop-layer {
  1265. position: fixed;
  1266. left: 0;
  1267. top: 0;
  1268. right: 0;
  1269. bottom: 0;
  1270. z-index: 10100;
  1271. }
  1272. /* 编辑按钮样式 */
  1273. .mine-edit-btn {
  1274. position: absolute;
  1275. bottom: 0;
  1276. right: -6rpx;
  1277. width: 48rpx;
  1278. height: 48rpx;
  1279. border-radius: 24rpx;
  1280. background: #ffffff;
  1281. border: 2rpx solid #e8edf5;
  1282. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  1283. display: flex;
  1284. align-items: center;
  1285. justify-content: center;
  1286. }
  1287. .mine-edit-icon {
  1288. font-size: 32rpx;
  1289. /* 反转图标 */
  1290. transform: scaleX(-1);
  1291. display: inline-block;
  1292. /* 讓 transform 生效 */
  1293. }
  1294. .mine-name {
  1295. display: block;
  1296. text-align: center;
  1297. font-size: 40rpx;
  1298. font-weight: 700;
  1299. color: #1a1d26;
  1300. line-height: 1.3;
  1301. }
  1302. .mine-bio {
  1303. display: block;
  1304. margin-top: 12rpx;
  1305. text-align: center;
  1306. font-size: 26rpx;
  1307. color: #8a8d9e;
  1308. line-height: 1.5;
  1309. padding: 0 16rpx;
  1310. }
  1311. .mine-account {
  1312. display: flex;
  1313. flex-direction: row;
  1314. align-items: center;
  1315. margin-top: 16rpx;
  1316. padding: 8rpx 20rpx;
  1317. border-radius: 999rpx;
  1318. background-color: rgba(255, 255, 255, 0.72);
  1319. }
  1320. .mine-account-label,
  1321. .mine-account-no,
  1322. .mine-account-copy {
  1323. font-size: 22rpx;
  1324. color: #8a8d9e;
  1325. }
  1326. .mine-account-no {
  1327. margin: 0 12rpx;
  1328. color: #4b5563;
  1329. }
  1330. .mine-account-copy {
  1331. color: #4a8cff;
  1332. }
  1333. .mine-follow-btn {
  1334. align-self: center;
  1335. margin-top: 20rpx;
  1336. padding: 0 48rpx;
  1337. height: 64rpx;
  1338. line-height: 64rpx;
  1339. font-size: 26rpx;
  1340. color: #ffffff;
  1341. background: linear-gradient(135deg, #4a8cff 0%, #6ec8ff 100%);
  1342. border-radius: 999rpx;
  1343. border: none;
  1344. }
  1345. .mine-login-btn,
  1346. .mine-primary-btn {
  1347. margin-top: 24rpx;
  1348. padding: 0 40rpx;
  1349. height: 72rpx;
  1350. line-height: 72rpx;
  1351. font-size: 28rpx;
  1352. color: #ffffff;
  1353. background: linear-gradient(135deg, #4a8cff 0%, #6ec8ff 100%);
  1354. border-radius: 999rpx;
  1355. border: none;
  1356. }
  1357. .mine-stats {
  1358. display: flex;
  1359. flex-direction: row;
  1360. width: 100%;
  1361. margin-top: 32rpx;
  1362. padding: 0 8rpx;
  1363. box-sizing: border-box;
  1364. }
  1365. .mine-stat {
  1366. flex: 1;
  1367. text-align: center;
  1368. }
  1369. .mine-stat-num {
  1370. display: block;
  1371. font-size: 36rpx;
  1372. font-weight: 700;
  1373. color: #1a1d26;
  1374. line-height: 1.2;
  1375. }
  1376. .mine-stat-label {
  1377. display: block;
  1378. margin-top: 8rpx;
  1379. font-size: 24rpx;
  1380. color: #8a8d9e;
  1381. }
  1382. /* 购物车、收藏、关注店铺、足迹入口样式 */
  1383. .mine-shortcut-bar {
  1384. display: flex;
  1385. justify-content: space-around;
  1386. width: 100%;
  1387. margin-top: 20rpx;
  1388. padding: 24rpx 16rpx;
  1389. box-sizing: border-box;
  1390. background: #ffffff;
  1391. border-radius: 20rpx;
  1392. border: 2rpx solid #e8edf5;
  1393. }
  1394. .mine-shortcut-item {
  1395. display: flex;
  1396. flex-direction: column;
  1397. align-items: center;
  1398. position: relative;
  1399. }
  1400. .mine-shortcut-icon {
  1401. font-size: 40rpx;
  1402. line-height: 1;
  1403. color: #ff6b35;
  1404. }
  1405. .mine-shortcut-text {
  1406. font-size: 22rpx;
  1407. color: #8a8d9e;
  1408. margin-top: 8rpx;
  1409. white-space: nowrap;
  1410. }
  1411. /* 订单快捷入口条 */
  1412. .mine-order-bar {
  1413. display: flex;
  1414. justify-content: space-between;
  1415. width: 100%;
  1416. margin-top: 20rpx;
  1417. padding: 24rpx 16rpx;
  1418. box-sizing: border-box;
  1419. background: #ffffff;
  1420. border-radius: 20rpx;
  1421. border: 2rpx solid #e8edf5;
  1422. }
  1423. .mine-order-bar-item {
  1424. display: flex;
  1425. flex-direction: column;
  1426. align-items: center;
  1427. position: relative;
  1428. min-width: 0;
  1429. }
  1430. .mine-order-bar-icon {
  1431. font-size: 40rpx;
  1432. line-height: 1;
  1433. }
  1434. .mine-order-bar-text {
  1435. font-size: 22rpx;
  1436. color: #8a8d9e;
  1437. margin-top: 8rpx;
  1438. white-space: nowrap;
  1439. }
  1440. .mine-order-bar-sub {
  1441. font-size: 18rpx;
  1442. color: #b0b5c3;
  1443. margin-top: 2rpx;
  1444. white-space: nowrap;
  1445. }
  1446. .mine-order-bar-badge {
  1447. position: absolute;
  1448. top: -6rpx;
  1449. right: -10rpx;
  1450. transform: scale(0.8);
  1451. }
  1452. .mine-assets-bar {
  1453. display: flex;
  1454. align-items: center;
  1455. width: 100%;
  1456. margin-top: 28rpx;
  1457. padding: 0 16rpx;
  1458. box-sizing: border-box;
  1459. background: #ffffff;
  1460. border-radius: 20rpx;
  1461. border: 2rpx solid #e8edf5;
  1462. }
  1463. .mine-diamond-bar {
  1464. display: flex;
  1465. flex-direction: row;
  1466. align-items: center;
  1467. justify-content: space-between;
  1468. width: 100%;
  1469. margin-top: 28rpx;
  1470. padding: 28rpx 28rpx;
  1471. box-sizing: border-box;
  1472. background: #ffffff;
  1473. border-radius: 20rpx;
  1474. border: 2rpx solid #e8edf5;
  1475. }
  1476. .mine-diamond-left {
  1477. display: flex;
  1478. flex-direction: row;
  1479. align-items: center;
  1480. }
  1481. .mine-diamond-icon {
  1482. width: 44rpx;
  1483. height: 44rpx;
  1484. margin-right: 16rpx;
  1485. }
  1486. .mine-diamond-label {
  1487. font-size: 28rpx;
  1488. color: #121836;
  1489. font-weight: 600;
  1490. line-height: 40rpx;
  1491. }
  1492. .mine-diamond-right {
  1493. display: flex;
  1494. flex-direction: row;
  1495. align-items: center;
  1496. }
  1497. .mine-diamond-value {
  1498. font-size: 34rpx;
  1499. font-weight: 700;
  1500. color: #ff6b35;
  1501. line-height: 44rpx;
  1502. }
  1503. .mine-diamond-arrow {
  1504. font-size: 22rpx;
  1505. color: #b0b5c3;
  1506. margin-left: 10rpx;
  1507. }
  1508. .mine-assets-card {
  1509. flex: 1;
  1510. display: flex;
  1511. align-items: center;
  1512. justify-content: space-between;
  1513. padding: 24rpx 20rpx 24rpx 24rpx;
  1514. }
  1515. .mine-assets-info {
  1516. display: flex;
  1517. flex-direction: column;
  1518. }
  1519. .mine-assets-title {
  1520. font-size: 28rpx;
  1521. font-weight: bold;
  1522. color: #121836;
  1523. line-height: 40rpx;
  1524. }
  1525. .mine-assets-desc {
  1526. font-size: 20rpx;
  1527. color: #ff6b35;
  1528. line-height: 28rpx;
  1529. }
  1530. .mine-assets-arrow {
  1531. font-size: 18rpx;
  1532. color: #b0b5c3;
  1533. margin-left: 4rpx;
  1534. }
  1535. .mine-assets-icon {
  1536. font-size: 48rpx;
  1537. color: #ff6b35;
  1538. flex-shrink: 0;
  1539. margin-right: 12rpx;
  1540. }
  1541. .mine-assets-divider {
  1542. width: 2rpx;
  1543. height: 60rpx;
  1544. background: #e8edf5;
  1545. flex-shrink: 0;
  1546. }
  1547. .mine-user-assets {
  1548. display: flex;
  1549. justify-content: space-around;
  1550. width: 100%;
  1551. max-width: 640rpx;
  1552. margin-top: 20rpx;
  1553. padding: 28rpx 16rpx;
  1554. box-sizing: border-box;
  1555. background: #ffffff;
  1556. border-radius: 20rpx;
  1557. border: 2rpx solid #e8edf5;
  1558. }
  1559. .mine-user-assets-item {
  1560. display: flex;
  1561. flex-direction: column;
  1562. align-items: center;
  1563. flex: 1;
  1564. }
  1565. .mine-user-assets-value {
  1566. font-size: 36rpx;
  1567. font-weight: bold;
  1568. color: #121836;
  1569. line-height: 50rpx;
  1570. }
  1571. .mine-user-assets-label {
  1572. font-size: 22rpx;
  1573. color: #8a8d9e;
  1574. margin-top: 4rpx;
  1575. }
  1576. /* 分隔线 */
  1577. .solid-left {
  1578. border-left: 1px solid rgba(0, 0, 0, 0.06);
  1579. padding-left: 20rpx;
  1580. margin-left: 10rpx;
  1581. }
  1582. .bg-orange {
  1583. background-color: #ff6b35 !important;
  1584. }
  1585. .mine-actions {
  1586. display: flex;
  1587. flex-direction: row;
  1588. flex-wrap: wrap;
  1589. justify-content: flex-start;
  1590. width: 100%;
  1591. margin-top: 36rpx;
  1592. padding: 0 12rpx;
  1593. box-sizing: border-box;
  1594. }
  1595. .mine-action {
  1596. width: 20%;
  1597. display: flex;
  1598. flex-direction: column;
  1599. align-items: center;
  1600. margin-bottom: 20rpx;
  1601. }
  1602. .mine-action-icon-wrap {
  1603. width: 96rpx;
  1604. height: 96rpx;
  1605. border-radius: 48rpx;
  1606. background-color: #ffffff;
  1607. border: 2rpx solid #e8edf5;
  1608. box-shadow: 0 6rpx 20rpx rgba(74, 140, 255, 0.08);
  1609. display: flex;
  1610. align-items: center;
  1611. justify-content: center;
  1612. }
  1613. .mine-action-icon-img {
  1614. display: block;
  1615. width: 48rpx;
  1616. height: 48rpx;
  1617. flex-shrink: 0;
  1618. }
  1619. .mine-action-icon-font {
  1620. font-size: 44rpx;
  1621. line-height: 1;
  1622. }
  1623. .mine-action-label {
  1624. margin-top: 12rpx;
  1625. font-size: 22rpx;
  1626. color: #8a8d9e;
  1627. text-align: center;
  1628. }
  1629. .mine-body {
  1630. position: relative;
  1631. z-index: 1;
  1632. padding: 8rpx 28rpx 0;
  1633. box-sizing: border-box;
  1634. }
  1635. .mine-tabs {
  1636. display: flex;
  1637. flex-direction: row;
  1638. flex-wrap: wrap;
  1639. margin-bottom: 24rpx;
  1640. }
  1641. .mine-tab-pill {
  1642. padding: 12rpx 28rpx;
  1643. margin-right: 16rpx;
  1644. margin-bottom: 8rpx;
  1645. border-radius: 999rpx;
  1646. background-color: #eef1f6;
  1647. }
  1648. .mine-tab-pill--on {
  1649. background-color: #ffffff;
  1650. box-shadow: 0 4rpx 16rpx rgba(74, 140, 255, 0.12);
  1651. }
  1652. .mine-tab-pill-text {
  1653. font-size: 28rpx;
  1654. color: #8a8d9e;
  1655. }
  1656. .mine-tab-pill--on .mine-tab-pill-text {
  1657. color: #4a8cff;
  1658. font-weight: 600;
  1659. }
  1660. .mine-works-list {
  1661. display: flex;
  1662. flex-direction: row;
  1663. flex-wrap: wrap;
  1664. justify-content: space-between;
  1665. width: 100%;
  1666. box-sizing: border-box;
  1667. }
  1668. .mine-works-item {
  1669. width: 48%;
  1670. margin-bottom: 40rpx;
  1671. box-sizing: border-box;
  1672. overflow: hidden;
  1673. }
  1674. .mine-works-cover {
  1675. position: relative;
  1676. width: 100%;
  1677. height: 460rpx;
  1678. border-radius: 16rpx;
  1679. overflow: hidden;
  1680. background-color: #e8edf5;
  1681. }
  1682. .mine-works-cover-img,
  1683. .mine-works-cover-empty {
  1684. width: 100%;
  1685. height: 100%;
  1686. }
  1687. .mine-works-cover-empty {
  1688. background-color: #e8edf5;
  1689. }
  1690. .mine-works-video-badge {
  1691. position: absolute;
  1692. right: 16rpx;
  1693. top: 16rpx;
  1694. width: 48rpx;
  1695. height: 48rpx;
  1696. border-radius: 24rpx;
  1697. background-color: rgba(0, 0, 0, 0.45);
  1698. display: flex;
  1699. align-items: center;
  1700. justify-content: center;
  1701. }
  1702. .mine-works-video-badge-icon {
  1703. color: #ffffff;
  1704. font-size: 22rpx;
  1705. }
  1706. .mine-works-state {
  1707. position: absolute;
  1708. left: 0;
  1709. right: 0;
  1710. top: 0;
  1711. bottom: 0;
  1712. background-color: rgba(0, 0, 0, 0.42);
  1713. display: flex;
  1714. align-items: center;
  1715. justify-content: center;
  1716. padding: 16rpx;
  1717. box-sizing: border-box;
  1718. }
  1719. .mine-works-state-txt {
  1720. color: #ffffff;
  1721. font-size: 26rpx;
  1722. text-align: center;
  1723. line-height: 1.4;
  1724. }
  1725. .mine-works-body {
  1726. padding: 12rpx 4rpx 0;
  1727. }
  1728. .mine-works-desc {
  1729. min-height: 72rpx;
  1730. }
  1731. .mine-works-tag {
  1732. display: inline-block;
  1733. margin-right: 8rpx;
  1734. padding: 2rpx 10rpx;
  1735. border-radius: 8rpx;
  1736. background-color: #eef4ff;
  1737. font-size: 20rpx;
  1738. color: #4a8cff;
  1739. vertical-align: middle;
  1740. }
  1741. .mine-works-text {
  1742. font-size: 24rpx;
  1743. color: #4b5563;
  1744. line-height: 1.45;
  1745. display: -webkit-box;
  1746. -webkit-box-orient: vertical;
  1747. -webkit-line-clamp: 2;
  1748. line-clamp: 2;
  1749. overflow: hidden;
  1750. }
  1751. .mine-works-foot {
  1752. display: flex;
  1753. flex-direction: row;
  1754. align-items: center;
  1755. justify-content: space-between;
  1756. margin-top: 12rpx;
  1757. }
  1758. .mine-works-foot-left {
  1759. display: flex;
  1760. flex-direction: row;
  1761. align-items: center;
  1762. flex: 1;
  1763. min-width: 0;
  1764. }
  1765. .mine-works-date {
  1766. font-size: 22rpx;
  1767. color: #b0b4c0;
  1768. }
  1769. .mine-works-del {
  1770. margin-left: 12rpx;
  1771. font-size: 22rpx;
  1772. color: #ff4d6a;
  1773. flex-shrink: 0;
  1774. }
  1775. .mine-works-like {
  1776. display: flex;
  1777. flex-direction: row;
  1778. align-items: center;
  1779. flex-shrink: 0;
  1780. margin-left: 8rpx;
  1781. }
  1782. .mine-works-like-icon {
  1783. font-size: 26rpx;
  1784. color: #b0b4c0;
  1785. line-height: 1;
  1786. }
  1787. .mine-works-like--on .mine-works-like-icon,
  1788. .mine-works-like--on .mine-works-like-num {
  1789. color: #ff4d6a;
  1790. }
  1791. .mine-works-like-num {
  1792. margin-left: 6rpx;
  1793. font-size: 22rpx;
  1794. color: #8a8d9e;
  1795. }
  1796. .mine-grid {
  1797. display: flex;
  1798. flex-direction: row;
  1799. flex-wrap: wrap;
  1800. justify-content: space-between;
  1801. width: 100%;
  1802. box-sizing: border-box;
  1803. }
  1804. .mine-card {
  1805. width: 48%;
  1806. margin-bottom: 28rpx;
  1807. box-sizing: border-box;
  1808. }
  1809. .mine-card-media {
  1810. position: relative;
  1811. width: 100%;
  1812. height: 420rpx;
  1813. border-radius: 24rpx;
  1814. overflow: hidden;
  1815. background-color: #e8edf5;
  1816. }
  1817. .mine-card-img {
  1818. width: 100%;
  1819. height: 100%;
  1820. }
  1821. .mine-card-play {
  1822. position: absolute;
  1823. right: 16rpx;
  1824. top: 16rpx;
  1825. width: 48rpx;
  1826. height: 48rpx;
  1827. border-radius: 24rpx;
  1828. background-color: rgba(0, 0, 0, 0.45);
  1829. display: flex;
  1830. align-items: center;
  1831. justify-content: center;
  1832. }
  1833. .mine-card-play-icon {
  1834. color: #ffffff;
  1835. font-size: 22rpx;
  1836. }
  1837. .mine-card-mask {
  1838. position: absolute;
  1839. left: 0;
  1840. right: 0;
  1841. top: 0;
  1842. bottom: 0;
  1843. background-color: rgba(0, 0, 0, 0.45);
  1844. display: flex;
  1845. align-items: center;
  1846. justify-content: center;
  1847. }
  1848. .mine-card-mask-txt {
  1849. color: #ffffff;
  1850. font-size: 26rpx;
  1851. }
  1852. .mine-card-del {
  1853. position: absolute;
  1854. right: 12rpx;
  1855. top: 12rpx;
  1856. width: 44rpx;
  1857. height: 44rpx;
  1858. border-radius: 22rpx;
  1859. background-color: rgba(0, 0, 0, 0.5);
  1860. display: flex;
  1861. align-items: center;
  1862. justify-content: center;
  1863. }
  1864. .mine-card-del-txt {
  1865. color: #ffffff;
  1866. font-size: 32rpx;
  1867. line-height: 1;
  1868. }
  1869. .mine-card-meta {
  1870. display: flex;
  1871. flex-direction: row;
  1872. align-items: center;
  1873. margin-top: 12rpx;
  1874. padding: 0 4rpx;
  1875. }
  1876. .mine-card-stat {
  1877. display: flex;
  1878. flex-direction: row;
  1879. align-items: center;
  1880. margin-right: 24rpx;
  1881. }
  1882. .mine-card-stat-icon {
  1883. font-size: 28rpx;
  1884. color: #b0b4c0;
  1885. line-height: 1;
  1886. }
  1887. .mine-card-stat-icon--on {
  1888. color: #ff4d6a;
  1889. }
  1890. .mine-card-stat-icon--muted {
  1891. font-size: 26rpx;
  1892. }
  1893. .mine-card-stat-num {
  1894. margin-left: 8rpx;
  1895. font-size: 24rpx;
  1896. color: #8a8d9e;
  1897. }
  1898. .mine-empty--guest {
  1899. padding-top: 48rpx;
  1900. }
  1901. .mine-card-caption {
  1902. margin-top: 12rpx;
  1903. padding: 0 4rpx;
  1904. }
  1905. .mine-card-tag {
  1906. display: inline-block;
  1907. margin-right: 8rpx;
  1908. padding: 2rpx 10rpx;
  1909. border-radius: 8rpx;
  1910. background-color: #eef4ff;
  1911. font-size: 20rpx;
  1912. color: #4a8cff;
  1913. vertical-align: middle;
  1914. }
  1915. .mine-card-text {
  1916. font-size: 24rpx;
  1917. color: #4b5563;
  1918. line-height: 1.4;
  1919. display: -webkit-box;
  1920. -webkit-box-orient: vertical;
  1921. -webkit-line-clamp: 2;
  1922. line-clamp: 2;
  1923. overflow: hidden;
  1924. }
  1925. .mine-card-series {
  1926. margin-top: 12rpx;
  1927. padding: 0 4rpx;
  1928. }
  1929. .mine-card-series-title {
  1930. display: block;
  1931. font-size: 26rpx;
  1932. color: #1f2937;
  1933. font-weight: 600;
  1934. line-height: 1.4;
  1935. }
  1936. .mine-card-self {
  1937. display: flex;
  1938. flex-direction: row;
  1939. align-items: center;
  1940. justify-content: space-between;
  1941. margin-top: 10rpx;
  1942. padding: 0 4rpx;
  1943. }
  1944. .mine-card-date {
  1945. font-size: 22rpx;
  1946. color: #b0b4c0;
  1947. }
  1948. .mine-card-action {
  1949. font-size: 22rpx;
  1950. color: #4a8cff;
  1951. margin-left: 16rpx;
  1952. }
  1953. .mine-card-action--del {
  1954. color: #ff4d6a;
  1955. }
  1956. .mine-series-fab {
  1957. position: fixed;
  1958. right: 32rpx;
  1959. bottom: 220rpx;
  1960. width: 96rpx;
  1961. height: 96rpx;
  1962. border-radius: 48rpx;
  1963. background: linear-gradient(135deg, #4a8cff, #6ea8ff);
  1964. box-shadow: 0 8rpx 24rpx rgba(74, 140, 255, 0.35);
  1965. display: flex;
  1966. align-items: center;
  1967. justify-content: center;
  1968. z-index: 20;
  1969. }
  1970. .mine-series-fab-icon {
  1971. color: #ffffff;
  1972. font-size: 44rpx;
  1973. line-height: 1;
  1974. }
  1975. .mine-empty {
  1976. padding: 80rpx 32rpx;
  1977. text-align: center;
  1978. }
  1979. .mine-empty-img {
  1980. width: 320rpx;
  1981. height: 320rpx;
  1982. margin: 0 auto 24rpx;
  1983. }
  1984. .mine-empty-txt {
  1985. display: block;
  1986. font-size: 28rpx;
  1987. color: #8a8d9e;
  1988. margin-bottom: 24rpx;
  1989. }
  1990. .mine-more {
  1991. padding: 16rpx 0 32rpx;
  1992. text-align: center;
  1993. }
  1994. .mine-more-txt {
  1995. font-size: 24rpx;
  1996. color: #b0b4c0;
  1997. }
  1998. .mine-tabbar-space {
  1999. width: 100%;
  2000. }
  2001. </style>