Store.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284
  1. <template>
  2. <van-pull-refresh
  3. success-text="加载成功"
  4. success-duration="500"
  5. class="discover"
  6. v-model="isLoading"
  7. @refresh="onRefresh"
  8. >
  9. <van-sticky ref="top">
  10. <div class="padding-safe-top" style="background: #222426">
  11. <div class="top">
  12. <div class="top-btn">
  13. <div class="btn" :class="{ active: active === 'explore' }" @click="changeActive('explore')">
  14. 我拥有的
  15. </div>
  16. <div class="btn" :class="{ active: active === 'likeIt' }" @click="changeActive('likeIt')">
  17. 我喜欢的
  18. </div>
  19. <div
  20. class="btn"
  21. v-if="showRoom"
  22. :class="{ active: active === 'showRoom' }"
  23. @click="changeActive('showRoom')"
  24. >
  25. 我的展馆
  26. </div>
  27. <div
  28. class="btn"
  29. v-if="!$store.state.reviewPay"
  30. :class="{ active: active === 'creator' }"
  31. @click="changeActive('creator')"
  32. >
  33. 我卖出的
  34. </div>
  35. <div class="btn" :class="{ active: active === 'coupon' }" @click="changeActive('coupon')">
  36. 兑换券
  37. </div>
  38. </div>
  39. <div
  40. class="search"
  41. v-if="isLogin && active !== 'coupon'"
  42. @click="$router.push('/assetSearch?status=' + status)"
  43. >
  44. <div class="search_division"></div>
  45. <img src="@assets/svgs/search.svg" alt="" />
  46. </div>
  47. </div>
  48. <van-tabs
  49. class="darkTabs"
  50. v-model:active="type"
  51. line-width="16"
  52. line-height="2"
  53. :ellipsis="false"
  54. @click="changeTab"
  55. v-if="active != 'likeIt'"
  56. >
  57. <van-tab
  58. :title="item.label"
  59. :name="item.value"
  60. :title-class="item.type === 'select' && sortDes ? sortDes : ''"
  61. :key="index"
  62. v-for="(item, index) in typeOptions"
  63. >
  64. <template v-if="item.type === 'select'" #title>
  65. <div class="tab">
  66. <span>{{ item.label }}</span>
  67. <van-icon size="8" name="arrow-up" />
  68. <van-icon size="8" name="arrow-down" />
  69. </div>
  70. </template>
  71. </van-tab>
  72. </van-tabs>
  73. <van-tabs
  74. class="darkTabs"
  75. v-model:active="type"
  76. line-width="16"
  77. line-height="2"
  78. :ellipsis="false"
  79. @change="change"
  80. v-else-if="active === 'likeIt'"
  81. >
  82. <van-tab
  83. :title="item.label"
  84. :name="item.type"
  85. :title-class="item.type === 'select' && sortDes ? sortDes : ''"
  86. :key="index"
  87. v-for="(item, index) in typeOptionLike"
  88. >
  89. <template v-if="item.type === 'select'" #title>
  90. <div class="tab">
  91. <span>{{ item.label }}</span>
  92. <van-icon size="8" name="arrow-up" />
  93. <van-icon size="8" name="arrow-down" />
  94. </div>
  95. </template>
  96. </van-tab>
  97. </van-tabs>
  98. <div v-if="type == 'metadomainName'" class="metadomainName_list">
  99. <div
  100. v-for="(item, index) in metadomainList"
  101. :key="index"
  102. @click="domainBtn(index)"
  103. :class="metadomainType == item.type ? 'metadomainName_list_con' : ''"
  104. class="metadomainName_list_cons"
  105. >
  106. {{ item.name }}
  107. </div>
  108. </div>
  109. </div>
  110. <!-- <van-button
  111. color="#272828"
  112. round
  113. size="mini"
  114. icon="arrow-down"
  115. icon-position="right"
  116. class="select"
  117. @click="showSelect = true"
  118. >
  119. 全部
  120. </van-button> -->
  121. </van-sticky>
  122. <van-list
  123. class="box-list"
  124. :style="{
  125. paddingBottom: showList.length % 3 === 0 ? '35.73vw' : '20px'
  126. }"
  127. :class="{ couponList: active === 'coupon', roomList: active === 'showRoom' }"
  128. v-model:loading="loading"
  129. :finished="finished"
  130. finished-text=""
  131. @load="getList"
  132. v-if="active != 'likeIt' && type != 'metadomainName'"
  133. >
  134. <template v-for="(item, index) in showList" :key="index">
  135. <coupon-info :info="item" v-if="active == 'coupon'"></coupon-info>
  136. <show-info v-model:info="list[index]" v-else-if="active == 'showRoom'"></show-info>
  137. <div
  138. class="asset-list"
  139. v-else-if="type == 'xingtu'"
  140. :style="{
  141. backgroundImage:
  142. active !== 'coupon' && active !== 'showRoom' && showList.length > 0
  143. ? `url(${require('../assets/png-zhantai.png')})`
  144. : ''
  145. }"
  146. >
  147. <star-asset-info
  148. :info="asset"
  149. v-for="(asset, assetIndex) in item"
  150. :key="assetIndex"
  151. ></star-asset-info>
  152. </div>
  153. <div
  154. class="asset-list"
  155. v-else
  156. :style="{
  157. backgroundImage:
  158. active !== 'coupon' && active !== 'showRoom' && showList.length > 0
  159. ? `url(${require('../assets/png-zhantai.png')})`
  160. : ''
  161. }"
  162. >
  163. <asset-info
  164. :info="asset"
  165. v-for="(asset, assetIndex) in item"
  166. :key="assetIndex"
  167. :num="asset.num"
  168. @showMore="showMore"
  169. ></asset-info>
  170. </div>
  171. </template>
  172. <van-empty
  173. v-if="empty || (showList.length === 0 && !loading)"
  174. :description="active == 'coupon' ? '你还没有优惠券哦~' : '你还没有藏品哦~'"
  175. :image="
  176. require(`@assets/${active == 'coupon' ? 'kong_png_duihuanquanhei' : 'empty_img_asset_dark'}.png`)
  177. "
  178. />
  179. <img src="../assets/icon_zhiding.png" @click="goTop" class="goTop" v-if="bodyScroll > 100" alt="" />
  180. </van-list>
  181. <!-- <div class="domain_list" v-else-if="active != 'likeIt' && type == 'metadomainName'">
  182. <template v-for="(item, index) in showList" :key="index">
  183. <domain-owned :info="asset" v-for="(asset, assetIndex) in item" :key="assetIndex"></domain-owned>
  184. </template>
  185. <van-empty v-if="empty || (showList.length === 0 && !loading)"
  186. :description="active == 'coupon' ? '你还没有优惠券哦~' : '你还没有藏品哦~'" :image="
  187. require(`@assets/${active == 'coupon' ? 'kong_png_duihuanquanhei' : 'empty_img_asset_dark'}.png`)
  188. " />
  189. </div> -->
  190. <van-list
  191. v-else-if="active != 'likeIt' && type == 'metadomainName'"
  192. class="domain_list"
  193. v-model:loading="loading"
  194. :finished="finished"
  195. finished-text=""
  196. @load="getList"
  197. >
  198. <div v-if="metadomainType == 'owned'">
  199. <template v-for="(item, index) in showList" :key="index">
  200. <domain-owned :info="asset" v-for="(asset, assetIndex) in item" :key="assetIndex"></domain-owned>
  201. </template>
  202. </div>
  203. <div v-else-if="metadomainType == 'underReview'">
  204. <template v-for="(item, index) in showList" :key="index">
  205. <domain-owned :info="asset" v-for="(asset, assetIndex) in item" :key="assetIndex"></domain-owned>
  206. </template>
  207. </div>
  208. <div v-else-if="metadomainType == 'myBid'">
  209. <template v-for="(item, index) in showList" :key="index">
  210. <owned-buy
  211. :info="asset"
  212. v-for="(asset, assetIndex) in item"
  213. :key="assetIndex"
  214. @fatherMethods="fatherMethod"
  215. ></owned-buy>
  216. </template>
  217. </div>
  218. <div v-else-if="metadomainType == 'receiveQuotation'">
  219. <template v-for="(item, index) in showList" :key="index">
  220. <receive-quotation :info="item"></receive-quotation>
  221. </template>
  222. </div>
  223. <van-empty
  224. v-if="empty || (showList.length === 0 && !loading)"
  225. :description="
  226. active == 'coupon'
  227. ? '你还没有优惠券哦~'
  228. : metadomainType == 'receiveQuotation'
  229. ? '你还没有收到的报价哦~'
  230. : metadomainType == 'myBid'
  231. ? '你还没有出价的域名哦~'
  232. : '你还没有藏品哦~'
  233. "
  234. :image="
  235. require(`@assets/${active == 'coupon' ? 'kong_png_duihuanquanhei' : 'empty_img_asset_dark'}.png`)
  236. "
  237. />
  238. </van-list>
  239. <div class="list" v-else>
  240. <template v-for="(item, index) in showListLike" :key="index">
  241. <product-info v-model:info="likeList[item.index]" @update:info="init" dark></product-info>
  242. </template>
  243. <van-empty
  244. v-if="showListLike.length === 0"
  245. description="你还没有点赞哦~"
  246. :image="require('@assets/kong_png_dianzan.png')"
  247. />
  248. </div>
  249. <van-action-sheet
  250. ref="action"
  251. v-model:show="showSelect"
  252. description="选择筛选方式"
  253. :actions="actions"
  254. cancel-text="取消"
  255. close-on-click-action
  256. />
  257. <div class="tabbar-placeholder"></div>
  258. </van-pull-refresh>
  259. <van-overlay :show="show" :lock-scroll="false" @click="show = false" z-index="99">
  260. <div class="wrapper" @click.stop>
  261. <div class="wrapper-title">{{ moreTitle }}</div>
  262. <div class="wrapper-box">
  263. <van-list
  264. v-model:loading="assetLoading"
  265. :finished="assetFinished"
  266. :immediate-check="false"
  267. finished-text=""
  268. loading-text="加载中..."
  269. @load="getMoreList"
  270. >
  271. <asset-info-se :info="asset" v-for="asset in assetList" :key="asset.id"></asset-info-se>
  272. </van-list>
  273. </div>
  274. <img src="@assets/icon_fenxiang_close.png" @click="show = false" alt="" class="wrapper-close" />
  275. </div>
  276. </van-overlay>
  277. </template>
  278. <script>
  279. import AssetInfo from '../components/asset/assetInfo.vue';
  280. import DomainOwned from '../components/asset/domainOwned.vue';
  281. import OwnedBuy from '../components/asset/ownedBuy.vue';
  282. import ReceiveQuotation from '../components/asset/receiveQuotation.vue';
  283. import AssetInfoSe from '../components/asset/assetInfoSe.vue';
  284. import ShowInfo from '../components/asset/showInfo.vue';
  285. import CouponInfo from '../components/CouponInfo.vue';
  286. import asset from '../mixins/asset';
  287. import coupon from '../mixins/coupon';
  288. import starAssetInfo from '../components/star/assetInfo.vue';
  289. import ProductInfo from '../components/product/productInfo.vue';
  290. import list from '../mixins/list';
  291. export default {
  292. name: 'store',
  293. mixins: [asset, coupon],
  294. inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll', 'bodyScroll'],
  295. components: {
  296. AssetInfo,
  297. AssetInfoSe,
  298. CouponInfo,
  299. ShowInfo,
  300. starAssetInfo,
  301. ProductInfo,
  302. DomainOwned,
  303. OwnedBuy,
  304. ReceiveQuotation
  305. },
  306. data() {
  307. return {
  308. active: 'explore',
  309. stiky: null,
  310. type: '',
  311. empty: false,
  312. list: [],
  313. likeList: [],
  314. label: '全部',
  315. showSelect: false,
  316. actions: [{ name: '选项一' }, { name: '选项二' }, { name: '选项三' }],
  317. action: null,
  318. loading: false,
  319. finished: false,
  320. page: 0,
  321. name1: '',
  322. name: '',
  323. scrollTop: 0,
  324. sortDes: '',
  325. showRoom: false,
  326. show: false,
  327. moreTitle: '',
  328. assetLoading: false,
  329. assetFinished: false,
  330. assetPage: 0,
  331. assetList: [],
  332. metadomainType: 'owned',
  333. metadomainList: [
  334. {
  335. name: '拥有的',
  336. type: 'owned'
  337. },
  338. {
  339. name: '审核中',
  340. type: 'underReview'
  341. }
  342. // {
  343. // name: '我的出价',
  344. // type: 'myBid'
  345. // },
  346. // {
  347. // name: '收到的报价',
  348. // type: 'receiveQuotation'
  349. // }
  350. ],
  351. typeOptionLike: [
  352. {
  353. label: '全部',
  354. type: ''
  355. },
  356. {
  357. label: '收藏品',
  358. type: 'DEFAULT'
  359. },
  360. {
  361. label: '数字盲盒',
  362. type: 'BLIND_BOX'
  363. }
  364. ]
  365. };
  366. },
  367. computed: {
  368. typeOptions() {
  369. if (this.active === 'explore') {
  370. if (!this.$store.state.reviewPay) {
  371. return [
  372. {
  373. label: '全部',
  374. value: '',
  375. type: ''
  376. },
  377. {
  378. label: '个人作品',
  379. value: 'xingtu',
  380. type: ''
  381. },
  382. {
  383. label: '元域名',
  384. value: 'metadomainName',
  385. type: ''
  386. },
  387. {
  388. label: '拍卖中',
  389. value: 'paimai',
  390. type: ''
  391. },
  392. {
  393. label: '寄售',
  394. value: 'ON_SALE',
  395. type: ''
  396. },
  397. {
  398. label: '封存中',
  399. value: 'lock',
  400. type: ''
  401. },
  402. {
  403. label: '仅展示',
  404. value: 'NORMAL',
  405. type: ''
  406. },
  407. {
  408. label: '未展示',
  409. value: 'NOT_NORMAL',
  410. type: ''
  411. }
  412. ];
  413. } else {
  414. return [
  415. {
  416. label: '全部',
  417. value: '',
  418. type: ''
  419. },
  420. {
  421. label: '仅展示',
  422. value: 'NORMAL',
  423. type: ''
  424. }
  425. ];
  426. }
  427. } else if (this.active === 'showRoom') {
  428. return [
  429. {
  430. label: '全部',
  431. value: '',
  432. type: ''
  433. },
  434. {
  435. label: '展览中',
  436. value: true,
  437. type: ''
  438. },
  439. {
  440. label: '未展览',
  441. value: false,
  442. type: ''
  443. }
  444. ];
  445. } else if (this.active === 'creator') {
  446. return [
  447. {
  448. label: '市场交易',
  449. value: 'TRANSFERRED',
  450. type: ''
  451. },
  452. {
  453. label: '拍卖',
  454. value: 'AUCTIONED',
  455. type: ''
  456. }
  457. // {
  458. // label: '价格',
  459. // value: 'price',
  460. // type: 'select'
  461. // }
  462. ];
  463. } else {
  464. return [
  465. {
  466. label: '未使用',
  467. value: 'CAN_USE',
  468. type: ''
  469. },
  470. {
  471. label: '不可用',
  472. value: 'CANNOT_USE',
  473. type: ''
  474. }
  475. ];
  476. }
  477. },
  478. showList() {
  479. if (this.active === 'coupon') {
  480. return [...this.list].filter(item => {
  481. if (this.type === 'CAN_USE') {
  482. return this.checkTime(item);
  483. } else {
  484. return !this.checkTime(item);
  485. }
  486. });
  487. } else if (this.active == 'showRoom') {
  488. return this.list;
  489. } else if (this.metadomainType == 'receiveQuotation') {
  490. return this.list;
  491. } else {
  492. let list = [...this.list];
  493. let _list = [];
  494. for (let i = 0; i <= Math.floor(list.length / 3); i++) {
  495. _list.push(list.slice(i * 3, (i + 1) * 3));
  496. }
  497. return _list.filter(item => {
  498. return item.length > 0;
  499. });
  500. }
  501. },
  502. showListLike() {
  503. return [...this.likeList]
  504. .map((item, index) => {
  505. return {
  506. ...item,
  507. index
  508. };
  509. })
  510. .filter(item => {
  511. return !this.type || this.type === item.type;
  512. });
  513. },
  514. sort() {
  515. return 'createdAt,desc';
  516. },
  517. url() {
  518. if (this.type === 'xingtu') {
  519. return '/photoAsset/all';
  520. } else if (this.type === 'lock') {
  521. return '/asset/all';
  522. } else if (this.type === 'metadomainName') {
  523. if (this.metadomainType == 'myBid') {
  524. return '/domainAsk/all';
  525. } else {
  526. return 'asset/all';
  527. }
  528. } else if (this.active === 'coupon') {
  529. return '/userCoupon/all';
  530. } else if (this.active === 'showRoom') {
  531. return '/showroom/all';
  532. } else if (this.active === 'explore') {
  533. return '/assetSuperimposition/all';
  534. } else {
  535. return 'asset/all';
  536. }
  537. },
  538. status() {
  539. if (this.active === 'explore') {
  540. if (this.type === 'paimai') {
  541. return 'AUCTIONING';
  542. } else if (this.type === 'metadomainName') {
  543. if (this.metadomainType == 'underReview') {
  544. return 'PENDING';
  545. } else if (this.metadomainType == 'myBid') {
  546. return 'ASKING,FINISH,REFUNDED';
  547. } else {
  548. return 'NORMAL,TRADING,GIFTING,MINTING,AUCTIONING,PENDING';
  549. }
  550. } else {
  551. return 'NORMAL,TRADING,GIFTING,MINTING,AUCTIONING';
  552. }
  553. } else if (this.active === 'creator') {
  554. return this.type || 'TRANSFERRED';
  555. } else {
  556. return '';
  557. }
  558. }
  559. },
  560. mounted() {
  561. if (this.$route.query.type) {
  562. this.type = this.$route.query.type;
  563. }
  564. if (this.$route.query.goBack) {
  565. this.type = 'metadomainName';
  566. this.metadomainType = 'receiveQuotation';
  567. this.getReview();
  568. }
  569. if (window.cordova && StatusBar && StatusBar.isVisible) {
  570. StatusBar.styleLightContent();
  571. }
  572. this.checkLogin();
  573. this.emitter.on('updateList', info => {
  574. console.log(info);
  575. let list = [...this.list];
  576. let assetList = [...this.assetList];
  577. if (assetList.length == 1) {
  578. this.show = false;
  579. }
  580. if (!this.show) {
  581. list.forEach((item, index) => {
  582. if (item.id === info.id || item.assetId === info.id) {
  583. list[index] = {
  584. ...item,
  585. ...info,
  586. num: item.num,
  587. id: item.id,
  588. assetId: item.assetId
  589. };
  590. if (info.status === 'DESTROYED') {
  591. list.splice(index, 1);
  592. }
  593. }
  594. });
  595. this.list = list;
  596. }
  597. if (assetList.length > 1) {
  598. assetList.forEach((item, index) => {
  599. if (item.id === info.id) {
  600. assetList[index] = info;
  601. if (info.status === 'DESTROYED') {
  602. assetList.splice(index, 1);
  603. let _index = [...this.list].findIndex(item => {
  604. return item.prefixName === this.moreTitle;
  605. });
  606. let _info = {};
  607. if (_index !== -1) {
  608. _info = { ...this.list[_index] };
  609. _info.num = _info.num - 1;
  610. }
  611. if (index === 0) {
  612. _info = {
  613. ..._info,
  614. ...assetList[0],
  615. num: _info.num,
  616. id: _info.id,
  617. assetId: assetList[0].id
  618. };
  619. }
  620. this.list[_index] = _info;
  621. }
  622. }
  623. });
  624. this.assetList = assetList;
  625. }
  626. // let list = [...this.list];
  627. // list.forEach((item, index) => {
  628. // if (item.id === info.id) {
  629. // list[index] = info;
  630. // }
  631. // });
  632. this.list = [...this.list].filter(item => {
  633. if (this.type === 'xingtu') {
  634. return item.ownerId === this.$store.state.userInfo.id;
  635. } else {
  636. return item.status !== 'DESTROYED';
  637. }
  638. });
  639. this.$toast.clear();
  640. });
  641. this.emitter.on('refreash', () => {
  642. this.page = 0;
  643. this.getList();
  644. });
  645. if (this.isLogin) {
  646. this.$http
  647. .post(
  648. '/showroom/all',
  649. {
  650. query: {
  651. del: false,
  652. userId: this.$store.state.userInfo.id
  653. }
  654. },
  655. { body: 'json' }
  656. )
  657. .then(res => {
  658. if (!res.empty) {
  659. this.showRoom = true;
  660. }
  661. });
  662. }
  663. },
  664. beforeRouteLeave(to, from, next) {
  665. if (to.path === '/assetDetail' || to.path === '/hall' || to.path === '/starCreateResult') {
  666. this.scrollTop = this.scrollWrapper.scrollTop;
  667. this.setKeeps(['index', 'store']);
  668. } else {
  669. this.scrollTop = 0;
  670. this.setKeeps(['index', 'store'], false);
  671. }
  672. next();
  673. },
  674. activated() {
  675. this.$nextTick(() => {
  676. this.changeScroll(this.scrollTop);
  677. if (window.cordova && StatusBar && StatusBar.isVisible) {
  678. StatusBar.styleLightContent();
  679. }
  680. this.$nextTick(() => {
  681. this.stiky = this.$refs.top.$el.childNodes[0];
  682. this.$el.parentNode.childNodes[1].className =
  683. this.$el.parentNode.childNodes[1].className.replace(/ bgBack/, '') + ' bgBack';
  684. });
  685. });
  686. },
  687. methods: {
  688. fatherMethod() {
  689. this.page = 0;
  690. this.getList().then(() => {
  691. this.isLoading = false;
  692. });
  693. },
  694. showMore(asset) {
  695. console.log(asset);
  696. this.moreTitle = asset.prefixName;
  697. this.show = true;
  698. this.assetLoading = true;
  699. this.getMoreList(true);
  700. //
  701. },
  702. init() {
  703. this.$toast.loading({
  704. message: '加载中...',
  705. forbidClick: true
  706. });
  707. this.empty = false;
  708. this.$http.get('/collection/myLikes').then(res => {
  709. this.likeList = res;
  710. this.empty = res.length === 0;
  711. this.$toast.clear();
  712. });
  713. },
  714. getMoreList(init = false) {
  715. if (init) {
  716. this.assetList = [];
  717. this.assetPage = 0;
  718. }
  719. this.assetLoading = true;
  720. this.assetFinished = false;
  721. return this.$http
  722. .post(
  723. '/asset/all',
  724. {
  725. page: this.assetPage,
  726. size: 50,
  727. query: {
  728. userId: this.$store.state.userInfo.id,
  729. status: this.status,
  730. prefixName: this.moreTitle,
  731. type: 'DEFAULT,BLIND_BOX'
  732. },
  733. sort: 'id,desc'
  734. },
  735. { body: 'json' }
  736. )
  737. .then(res => {
  738. let listArr = [];
  739. if (this.type === 'NORMAL') {
  740. listArr = res.content.filter(item => {
  741. return item.publicShow === true && item.consignment === false;
  742. });
  743. } else if (this.type === 'NOT_NORMAL') {
  744. listArr = res.content.filter(item => {
  745. return item.publicShow === false;
  746. });
  747. } else if (this.type === 'ON_SALE') {
  748. listArr = res.content.filter(item => {
  749. return item.consignment === true;
  750. });
  751. } else {
  752. listArr = res.content;
  753. }
  754. if (res.first) {
  755. this.assetList = listArr;
  756. } else {
  757. this.assetList = [...this.assetList, ...listArr];
  758. }
  759. this.assetLoading = false;
  760. this.assetFinished = res.last;
  761. if (!this.assetFinished) {
  762. this.assetPage = this.assetPage + 1;
  763. }
  764. return Promise.resolve();
  765. });
  766. },
  767. pad(n, width, z) {
  768. z = z || '0';
  769. n = n + '';
  770. return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
  771. },
  772. getList() {
  773. if (this.metadomainType == 'receiveQuotation') {
  774. this.loading = false;
  775. this.getReview();
  776. return;
  777. }
  778. if (!this.isLogin) {
  779. this.empty = true;
  780. this.loading = false;
  781. return Promise.resolve();
  782. }
  783. if (this.page === 0) {
  784. this.list = [];
  785. }
  786. this.finished = false;
  787. this.empty = false;
  788. this.loading = true;
  789. let form = {
  790. page: this.page,
  791. size: 20,
  792. sort: this.sort === 'price' ? this.sort + this.sortDes : this.sort,
  793. query: {
  794. userId: this.$store.state.userInfo.id,
  795. ...this.beforeQuery(),
  796. companyId: 1
  797. }
  798. };
  799. if (this.type === 'xingtu') {
  800. form = {
  801. page: this.page,
  802. size: 20,
  803. sort: this.sort === 'price' ? this.sort + this.sortDes : this.sort,
  804. query: {
  805. ownerId: this.$store.state.userInfo.id,
  806. del: false,
  807. orderStatus: 'NOT_PAID,PROCESSING,FINISH'
  808. }
  809. };
  810. }
  811. return this.$http.post(this.url, form, { body: 'json' }).then(res => {
  812. // if (this.active === 'coupon' || this.active === 'showRoom') {
  813. res.content.forEach(item => {
  814. if (item.endTime) {
  815. item.endTime = this.dayjs(item.endTime).diff(this.dayjs(), 'second');
  816. item.endTime =
  817. Math.floor(item.endTime / 24 / 3600) +
  818. '天' +
  819. this.pad(parseInt(item.endTime / 3600) % 24, 2) +
  820. '时' +
  821. this.pad(parseInt(item.endTime / 60) % 60, 2) +
  822. '分';
  823. }
  824. });
  825. if (res.first) {
  826. this.page = 0;
  827. this.list = res.content;
  828. } else {
  829. this.list = [...this.list, ...res.content];
  830. }
  831. this.empty = res.empty && res.first;
  832. this.loading = false;
  833. this.finished = res.last;
  834. if (!this.finished) {
  835. this.page = this.page + 1;
  836. }
  837. // } else {
  838. // this.list = res;
  839. // this.empty = res.length === 0;
  840. // this.loading = false;
  841. // this.finished = true;
  842. // }
  843. });
  844. },
  845. beforeQuery() {
  846. let form = {};
  847. if (this.active == 'explore') {
  848. form = {
  849. status: this.status
  850. };
  851. if (this.type === 'NORMAL') {
  852. form = {
  853. ...form,
  854. assetType: 'OPEN_SHOW'
  855. };
  856. }
  857. if (this.type === 'metadomainName') {
  858. form = {
  859. ...form,
  860. type: 'DOMAIN'
  861. };
  862. }
  863. if (this.type === 'paimai') {
  864. form = {
  865. ...form,
  866. assetType: 'AUCTIONING'
  867. };
  868. }
  869. if (this.type === 'NOT_NORMAL') {
  870. form = {
  871. ...form,
  872. assetType: 'CLOSE_SHOW'
  873. };
  874. }
  875. if (this.type === 'ON_SALE') {
  876. form = {
  877. ...form,
  878. assetType: 'CONSIGNMENT'
  879. };
  880. }
  881. if (this.type === 'lock') {
  882. form = {
  883. ...form,
  884. lock: true
  885. };
  886. }
  887. if (this.type === 'xingtu') {
  888. form = {
  889. // gifted: false
  890. };
  891. }
  892. } else if (this.active == 'showRoom') {
  893. form = {
  894. publish: this.type
  895. };
  896. } else if (this.active === 'creator') {
  897. form = {
  898. status: this.status
  899. };
  900. } else {
  901. form = {
  902. used: false
  903. };
  904. }
  905. return form;
  906. },
  907. changeActive(active) {
  908. if (active === 'likeIt') {
  909. this.init();
  910. this.active = active;
  911. } else {
  912. this.list = [];
  913. this.metadomainType = 'owned';
  914. this.active = active;
  915. this.loading = true;
  916. setTimeout(() => {
  917. this.$nextTick(() => {
  918. this.type = this.typeOptions[0].type;
  919. this.page = 0;
  920. this.getList();
  921. });
  922. }, 100);
  923. }
  924. },
  925. getReview() {
  926. this.list = [];
  927. this.$http.post('/domainAsk/groupInfo').then(res => {
  928. res.forEach(item => {
  929. item.endTime = this.dayjs(item.endTime).diff(this.dayjs(), 'second');
  930. item.endTime =
  931. Math.floor(item.endTime / 24 / 3600) +
  932. '天' +
  933. this.pad(parseInt(item.endTime / 3600) % 24, 2) +
  934. '时' +
  935. this.pad(parseInt(item.endTime / 60) % 60, 2) +
  936. '分';
  937. });
  938. this.isLoading = false;
  939. this.list = res;
  940. });
  941. },
  942. domainBtn(index) {
  943. this.metadomainType = this.metadomainList[index].type;
  944. if (this.metadomainType == 'receiveQuotation') {
  945. this.getReview();
  946. } else {
  947. this.page = 0;
  948. this.getList().then(() => {
  949. this.isLoading = false;
  950. });
  951. }
  952. // if (this.metadomainType == 'myBid' || this.metadomainType == 'receiveQuotation') {
  953. // this.$toast("版本升级中")
  954. // } else {
  955. // this.getList().then(() => {
  956. // this.isLoading = false;
  957. // });
  958. // }
  959. },
  960. changeTab(info) {
  961. if (info == 'metadomainName') {
  962. this.metadomainType = 'owned';
  963. } else {
  964. this.metadomainType = 'owned';
  965. }
  966. if (info.name === 'price') {
  967. this.sortDes = this.sortDes == 'desc' ? 'asc' : 'desc';
  968. }
  969. if (this.active !== 'coupon') {
  970. this.loading = true;
  971. this.page = 0;
  972. this.getList();
  973. }
  974. },
  975. goTop() {
  976. this.changeScroll(0, true);
  977. },
  978. onRefresh() {
  979. if (this.metadomainType == 'receiveQuotation') {
  980. this.getReview();
  981. } else {
  982. this.page = 0;
  983. this.getList().then(() => {
  984. this.isLoading = false;
  985. });
  986. }
  987. },
  988. change() {
  989. this.$root.$el.scrollTop = 0;
  990. }
  991. }
  992. };
  993. </script>
  994. <style lang="less" scoped>
  995. .top {
  996. display: flex;
  997. background-color: #222426;
  998. width: calc(100vw);
  999. .top-btn {
  1000. padding: 10px 16px;
  1001. padding-right: 0px;
  1002. width: 100%;
  1003. height: 50px;
  1004. box-sizing: border-box;
  1005. overflow-x: auto;
  1006. display: flex;
  1007. align-items: center;
  1008. background: #1c1c1c;
  1009. .btn {
  1010. font-size: @font3;
  1011. line-height: 26px;
  1012. display: inline-block;
  1013. vertical-align: text-bottom;
  1014. color: #939599;
  1015. flex-shrink: 0;
  1016. &.active {
  1017. color: #ffffff;
  1018. font-size: @font3;
  1019. font-weight: bold;
  1020. }
  1021. }
  1022. .btn + .btn {
  1023. margin-left: 20px;
  1024. }
  1025. }
  1026. .search {
  1027. width: 50px;
  1028. height: 50px;
  1029. display: flex;
  1030. align-items: center;
  1031. padding-left: 10px;
  1032. box-sizing: border-box;
  1033. background: #1c1c1c;
  1034. position: relative;
  1035. .search_division {
  1036. position: absolute;
  1037. top: 13px;
  1038. left: 4px;
  1039. width: 1px;
  1040. height: 24px;
  1041. background-color: #272b2e;
  1042. }
  1043. img {
  1044. display: block;
  1045. }
  1046. }
  1047. }
  1048. .metadomainName_list {
  1049. padding: 16px 15px 20px 16px;
  1050. display: flex;
  1051. // justify-content: space-between;
  1052. background: #0f0f0f;
  1053. .metadomainName_list_cons {
  1054. width: calc(20vw - 1px);
  1055. height: 28px;
  1056. background: #1e1e1e;
  1057. border-radius: 4px;
  1058. line-height: 28px;
  1059. text-align: center;
  1060. font-size: 12px;
  1061. font-weight: 400;
  1062. color: rgba(147, 149, 153, 0.6);
  1063. margin-right: 30px;
  1064. }
  1065. .metadomainName_list_con {
  1066. height: 28px;
  1067. border-radius: 4px;
  1068. border: 1px solid #00fe1e;
  1069. box-sizing: border-box;
  1070. color: #00fe1e;
  1071. background: #0f0f0f;
  1072. line-height: 28px;
  1073. margin-right: 30px;
  1074. }
  1075. }
  1076. .domain_list {
  1077. padding: 0px 16px;
  1078. padding-bottom: 50px;
  1079. }
  1080. /deep/.van-sticky--fixed {
  1081. background-color: #222426;
  1082. }
  1083. .van-tabs {
  1084. background: #1c1c1c;
  1085. /deep/.van-tab {
  1086. margin-right: 30px;
  1087. }
  1088. }
  1089. .select {
  1090. position: absolute;
  1091. right: 16px;
  1092. bottom: 9px;
  1093. color: @text3 !important;
  1094. min-width: 96px;
  1095. }
  1096. // /deep/.van-sticky {
  1097. // position: relative;
  1098. // }
  1099. /deep/.scroll-wrapper {
  1100. background-color: #0f0f0f !important;
  1101. }
  1102. .discover {
  1103. background-color: #0f0f0f;
  1104. min-height: 100vh;
  1105. min-height: var(--app-height);
  1106. box-sizing: border-box;
  1107. }
  1108. .list {
  1109. padding: 8px;
  1110. }
  1111. .grid-img {
  1112. display: block;
  1113. }
  1114. .van-grid {
  1115. margin-top: 12px;
  1116. }
  1117. /deep/.van-tabs__nav--line.van-tabs__nav--complete {
  1118. border-top-color: #303133;
  1119. }
  1120. /deep/ .van-grid-item__content {
  1121. padding: 14px 20px 16px;
  1122. }
  1123. /deep/ .van-grid-item__text {
  1124. color: #fff;
  1125. font-size: 13px;
  1126. line-height: 18px;
  1127. margin-top: 4px;
  1128. }
  1129. .title {
  1130. padding: 16px 20px 8px;
  1131. color: @prim;
  1132. font-size: 18px;
  1133. font-weight: bold;
  1134. }
  1135. .box-list {
  1136. // display: flex;
  1137. // flex-wrap: wrap;
  1138. // padding: 8px 8px 100px;
  1139. // padding: 0 0 0 4.2vw;
  1140. background-size: 100vw 42vw;
  1141. background-position: 0 -10vw;
  1142. box-sizing: border-box;
  1143. &.couponList {
  1144. padding: 8px 8px 100px;
  1145. }
  1146. &.roomList {
  1147. padding: 10px 0 100px;
  1148. }
  1149. .asset-list {
  1150. background-size: 100vw auto;
  1151. background-position: 0 -10vw;
  1152. box-sizing: border-box;
  1153. padding: 0 0 0 4.2vw;
  1154. }
  1155. }
  1156. .tab {
  1157. position: relative;
  1158. padding-right: 14px;
  1159. .van-icon {
  1160. position: absolute;
  1161. right: 0;
  1162. &.van-icon-arrow-down {
  1163. top: 8px;
  1164. }
  1165. &.van-icon-arrow-up {
  1166. bottom: 8px;
  1167. }
  1168. }
  1169. }
  1170. /deep/.coupon {
  1171. &::after {
  1172. background-color: #181818;
  1173. }
  1174. .coupon-bottom {
  1175. &::before,
  1176. &::after {
  1177. background-color: #0f0f0f;
  1178. }
  1179. }
  1180. .btn {
  1181. &::after {
  1182. background-color: #181818;
  1183. }
  1184. }
  1185. }
  1186. .goTop {
  1187. position: fixed;
  1188. right: 16px;
  1189. bottom: 70px;
  1190. bottom: calc(env(safe-area-inset-bottom) + 70px);
  1191. width: 44px;
  1192. height: 44px;
  1193. display: block;
  1194. z-index: 20;
  1195. }
  1196. .wrapper-box {
  1197. width: 306px;
  1198. height: 394px;
  1199. background: rgba(255, 255, 255, 0.1);
  1200. border-radius: 16px;
  1201. border: 1px solid #c8c9cc;
  1202. backdrop-filter: blur(10px);
  1203. overflow: auto;
  1204. .van-list {
  1205. padding: 12px 8px;
  1206. min-height: 364px;
  1207. }
  1208. }
  1209. .wrapper {
  1210. position: absolute;
  1211. top: 50%;
  1212. left: 50%;
  1213. transform: translate(-50%, -50%);
  1214. .flex-col();
  1215. .wrapper-title {
  1216. font-size: 20px;
  1217. font-weight: bold;
  1218. color: #ffffff;
  1219. line-height: 24px;
  1220. text-align: center;
  1221. margin-bottom: 30px;
  1222. }
  1223. .wrapper-close {
  1224. width: 40px;
  1225. height: 40px;
  1226. align-self: center;
  1227. margin-top: 10vh;
  1228. }
  1229. }
  1230. </style>