ship.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <template>
  2. <view class="page">
  3. <view class="tabBanner flex">
  4. <view class="tabItemBox flex">
  5. <view class="tahItem position-relative" v-for="(item,index) in taber" :class='{action:action==index}'
  6. @click="tabList(index)">
  7. {{item.title}}
  8. <view class="actionIcon" v-if="action==index"></view>
  9. </view>
  10. </view>
  11. <view class="rightMoney flex border-linear-gradient">
  12. <image class="rightTipImg" src="../../static/index/index/icon01.png" mode="scaleToFill"></image>
  13. <text>123123123123.222s</text>
  14. </view>
  15. </view>
  16. <view class="itemList">
  17. <view class="itemBox" v-for="(item,index) in taber[action].list" >
  18. <view class="item flex" @click="item.hide=false">
  19. <view class="itemLeft">
  20. <view class="name flex-start">
  21. <image class="nameTip margin-r-10" src="../../static/user/star.png" mode="scaleToFill">
  22. </image>
  23. <text>
  24. 体验飞船
  25. </text>
  26. </view>
  27. <view class="tip">
  28. 30天预计可挖
  29. </view>
  30. <view class="payMoney flex-start">
  31. <image class="payMoneyTip" src="../../static/index/index/icon01.png" mode="widthFix">
  32. </image>
  33. <text>22</text>
  34. </view>
  35. </view>
  36. <view class="itemRight">
  37. <view class="tiptext">
  38. 消耗:
  39. </view>
  40. <view class="moneyNum flex-center">
  41. <image class="moneyTip margin-r-10" src="../../static/index/index/icon01.png"
  42. mode="widthFix">
  43. </image>
  44. <text>220</text>
  45. </view>
  46. <view class="buttom" @click.stop="openAlert(item)">
  47. 派遣飞船
  48. </view>
  49. </view>
  50. </view>
  51. <view class="itemListTypeBox" :class="{hide:item.hide}">
  52. <view class="listItem flex">
  53. <view class="titleName">
  54. 设备名称
  55. </view>
  56. <view class="typeNum">
  57. 体验飞船
  58. </view>
  59. </view>
  60. <view class="listItem flex">
  61. <view class="titleName">
  62. 状态
  63. </view>
  64. <view class="typeNum">
  65. <text class="strongText">挖矿中</text>
  66. </view>
  67. </view>
  68. <view class="listItem flex">
  69. <view class="titleName">
  70. 合约期限
  71. </view>
  72. <view class="typeNum">
  73. 30天
  74. </view>
  75. </view>
  76. <view class="listItem flex">
  77. <view class="titleName">
  78. 单价
  79. </view>
  80. <view class="typeNum">
  81. <text class="strongText margin-r-10">20</text>
  82. 矿石
  83. </view>
  84. </view>
  85. <view class="listItem flex">
  86. <view class="titleName">
  87. 已挖出
  88. </view>
  89. <view class="typeNum">
  90. <text class="strongText margin-r-10">10</text>
  91. 矿石
  92. </view>
  93. </view>
  94. <view class="listItem flex">
  95. <view class="titleName">
  96. 购买时间
  97. </view>
  98. <view class="typeNum">
  99. 2024.05.13 08:00:30
  100. </view>
  101. </view>
  102. <view class="listItem flex">
  103. <view class="titleName">
  104. 到期期限
  105. </view>
  106. <view class="typeNum">
  107. 2024.05.13 08:00:30
  108. </view>
  109. </view>
  110. <view class="flex-center upButtom" @click.stop="item.hide=true">
  111. <text class="margin-r-10">
  112. 收起详情
  113. </text>
  114. <image class="nextDom" src="../../static/user/back.png" mode="scaleToFill"></image>
  115. </view>
  116. </view>
  117. </view>
  118. <uni-load-more :status="taber[action].loadingType"></uni-load-more>
  119. </view>
  120. <u-popup v-model="show" mode='bottom' closeable @close='show=false'>
  121. <view class="alert">
  122. <view class="alertTitle">
  123. 派遣体验飞船
  124. </view>
  125. <view class="flex alertContent">
  126. <view class="alertMoney">
  127. 需要消耗矿石
  128. </view>
  129. <view class="flex-start">
  130. <image class="alertTip margin-r-10" src="../../static/index/index/icon01.png"
  131. mode="scaleToFill"></image>
  132. <text>100</text>
  133. </view>
  134. </view>
  135. <view class="alertTipText">
  136. <text>我可用矿石</text>
  137. <text class="nuim">21</text>
  138. <text>个</text>
  139. </view>
  140. <view class="buttomAlert">
  141. 确认开启
  142. </view>
  143. </view>
  144. </u-popup>
  145. </view>
  146. </template>
  147. <script>
  148. export default {
  149. data() {
  150. return {
  151. action: 0,
  152. taber: [{
  153. title: '星级飞船',
  154. state: 0,
  155. page: 1,
  156. limit: 10,
  157. loadingType: 'more',
  158. list: [{
  159. hide:false,
  160. }],
  161. loaded: false,
  162. },
  163. {
  164. title: '我的飞船',
  165. state: 1,
  166. page: 1,
  167. limit: 10,
  168. loadingType: 'more',
  169. list: [],
  170. loaded: false,
  171. }
  172. ],
  173. show: false,
  174. // 当前选中的对象
  175. actionItem: {}
  176. };
  177. },
  178. onLoad(options) {
  179. },
  180. onShow() {},
  181. methods: {
  182. // 打开弹窗
  183. openAlert(item) {
  184. this.show = true;
  185. this.actionItem = item;
  186. },
  187. tabList(index) {
  188. this.action = index;
  189. this.loadData('tabChange')
  190. },
  191. loadData(source) {
  192. //这里是将订单挂载到tab列表下
  193. let index = this.action;
  194. let navItem = this.taber[index];
  195. let state = navItem.state;
  196. if (source === 'tabChange' && navItem.loaded === true) {
  197. //tab切换只有第一次需要加载数据
  198. return;
  199. }
  200. if (navItem.loadingType === 'loading') {
  201. //防止重复加载
  202. return;
  203. }
  204. if (navItem.loadingType === 'noMore') {
  205. //防止重复加载
  206. return;
  207. }
  208. // 修改当前对象状态为加载中
  209. navItem.loadingType = 'loading';
  210. // orderList({
  211. // type: state,
  212. // page: navItem.page,
  213. // limit: navItem.limit
  214. // })
  215. // .then(({
  216. // data
  217. // }) => {
  218. // let arr = data.map(e => {
  219. // let b = this.orderStateExp(e.status);
  220. // e.stateTip = b.stateTip;
  221. // e.stateTipColor = b.stateTipColor;
  222. // return e;
  223. // });
  224. // navItem.list = navItem.list.concat(arr);
  225. // // console.log(navItem.list);
  226. // navItem.page++;
  227. // if (navItem.limit == data.length) {
  228. // //判断是否还有数据, 有改为 more, 没有改为noMore
  229. // navItem.loadingType = 'more';
  230. // return;
  231. // } else {
  232. // //判断是否还有数据, 有改为 more, 没有改为noMore
  233. // navItem.loadingType = 'noMore';
  234. // }
  235. // uni.hideLoading();
  236. // this.$set(navItem, 'loaded', true);
  237. // })
  238. // .catch(e => {
  239. // console.log(e);
  240. // });
  241. },
  242. }
  243. };
  244. </script>
  245. <style lang="scss" scoped>
  246. .page {
  247. min-height: calc(100vh);
  248. margin-top: -44px;
  249. padding-top: 44px;
  250. line-height: 1;
  251. background-image: url("../../static/user/user-bg.png");
  252. background-repeat: no-repeat;
  253. background-size: 100% auto;
  254. background-color: rgb(255, 255, 255);
  255. }
  256. .tabBanner {
  257. position: sticky;
  258. padding: 30rpx 0 30rpx 30rpx;
  259. align-items: flex-start;
  260. .tabItemBox {
  261. align-items: flex-start;
  262. .tahItem {
  263. margin-right: 30rpx;
  264. font-weight: bold;
  265. font-size: 28rpx;
  266. &.action {
  267. font-size: 30rpx;
  268. }
  269. .actionIcon {
  270. background: linear-gradient(268deg, rgba(244, 177, 228, 0.99), #9D47C6, #5D289A);
  271. border-radius: 3px;
  272. width: 46rpx;
  273. height: 6rpx;
  274. margin: 0 auto;
  275. margin-top: 10rpx;
  276. }
  277. }
  278. }
  279. .rightMoney {
  280. margin-top: -6rpx;
  281. border-right: none;
  282. padding: 6rpx 20rpx;
  283. border-top-left-radius: 10rpx;
  284. border-bottom-left-radius: 10rpx;
  285. .rightTipImg {
  286. width: 36rpx;
  287. height: 29rpx;
  288. }
  289. }
  290. }
  291. .itemList {
  292. .itemBox {
  293. margin: 0 30rpx 30rpx 30rpx;
  294. border-radius: 20rpx;
  295. background-color: #FFF;
  296. border: 1px solid #C1C1C1;
  297. .itemListTypeBox{
  298. font-weight: 500;
  299. font-size: 28rpx;
  300. color: #222222;
  301. transition: height .3s ease-out;
  302. height: 400rpx;
  303. overflow: hidden;
  304. &.hide{
  305. height: 0rpx;
  306. }
  307. .upButtom{
  308. padding-top: 20rpx;
  309. font-weight: 500;
  310. font-size: 25rpx;
  311. color: #999999;
  312. // padding-bottom: 30rpx;
  313. .nextDom{
  314. width: 10rpx;
  315. height: 17rpx;
  316. transform: rotate(90deg);
  317. }
  318. }
  319. .listItem{
  320. padding: 0rpx 30rpx;
  321. margin-top: 20rpx;
  322. .typeNum{
  323. font-weight: bold;
  324. .strongText{
  325. color:#5E379E;
  326. }
  327. }
  328. }
  329. }
  330. .item {
  331. padding: 10rpx;
  332. background-image: url("../../static/user/listbg.png");
  333. background-size: 100% 100%;
  334. color: #FFFFFF;
  335. font-weight: bold;
  336. .itemLeft {
  337. padding: 20rpx;
  338. .name {
  339. font-size: 28rpx;
  340. }
  341. .nameTip {
  342. width: 30rpx;
  343. height: 30rpx;
  344. }
  345. .tip {
  346. font-size: 26rpx;
  347. opacity: 0.75;
  348. padding: 20rpx 0;
  349. }
  350. .payMoney {
  351. font-weight: 400;
  352. font-size: 44rpx;
  353. .payMoneyTip {
  354. width: 43rpx;
  355. height: 34rpx;
  356. margin-right: 10rpx;
  357. }
  358. }
  359. }
  360. .itemRight {
  361. // background-color: #FFF;
  362. border-radius: 10rpx;
  363. padding: 20rpx;
  364. .tiptext {
  365. font-weight: 500;
  366. font-size: 24rpx;
  367. color: #999999;
  368. }
  369. .moneyNum {
  370. padding: 30rpx 0;
  371. font-weight: bold;
  372. font-size: 33rpx;
  373. color: #000000;
  374. .moneyTip {
  375. width: 43rpx;
  376. height: 34rpx;
  377. }
  378. }
  379. .buttom {
  380. padding: 16rpx 30rpx;
  381. background: linear-gradient(268deg, rgba(113, 87, 185, 0.99), #8667C3, #7258B9);
  382. border-radius: 10rpx;
  383. font-weight: bold;
  384. font-size: 26rpx;
  385. color: #FFFFFF;
  386. }
  387. }
  388. }
  389. }
  390. }
  391. .alert {
  392. padding: 30rpx;
  393. color: #222222;
  394. font-size: 30rpx;
  395. font-weight: bold;
  396. .alertTitle {}
  397. .alertContent {
  398. margin-top: 50rpx;
  399. padding: 30rpx;
  400. background: rgba(0, 0, 0, .07);
  401. border-radius: 10rpx;
  402. .alertTip {
  403. width: 43rpx;
  404. height: 34rpx;
  405. }
  406. }
  407. .alertTipText {
  408. margin-top: 50rpx;
  409. font-weight: 500;
  410. font-size: 29rpx;
  411. .nuim {
  412. color: #5E51ED;
  413. }
  414. }
  415. .buttomAlert {
  416. margin-top: 30rpx;
  417. padding: 30rpx;
  418. text-align: center;
  419. background: linear-gradient(268deg, rgba(113, 87, 185, 0.99), #8667C3, #7258B9);
  420. border-radius: 10rpx;
  421. font-size: 33rpx;
  422. color: #FFFFFF;
  423. }
  424. }
  425. </style>