market.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="container">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <view class="content-money">
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
  7. <view class="header">服务器兑换</view>
  8. </view>
  9. <view class="content-bg"><image src="../../static/img/fwq-bg.png" mode=""></image></view>
  10. <view class="money">
  11. <view class="num">2600</view>
  12. <view class="font">我的购物积分</view>
  13. <view class="all" @click="nav('/pages/money/integralShopping')">查看明细</view>
  14. </view>
  15. </view>
  16. <view class="main">
  17. <view class="main-title">
  18. <image src="../../static/icon/f-l.png" mode=""></image>
  19. <view class="title-font">热门兑换</view>
  20. <image src="../../static/icon/f-r.png" mode=""></image>
  21. </view>
  22. <view class="main-box">
  23. <view class="main-item" v-for="(item, index) in list" :key="index">
  24. <view class="item-bg"><image :src="item.logo" mode=""></image></view>
  25. <view class="item-info">
  26. <view class="item-name">{{ item.name }}</view>
  27. <view class="item-tip">合约周期:{{ item.first_step_time + item.second_step_time }}天 + {{ item.third_step_time }}天</view>
  28. <view class="item-tip">有效空间:{{ item.step }}T</view>
  29. <view class="price">
  30. {{ item.cost_money*1 }}
  31. <text>{{ item.cost_money_type}}</text>
  32. </view>
  33. <view class="btn" @click="go(item)">立即兑换</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import { mining } from '@/api/market.js';
  42. import { wallet } from '@/api/finance.js';
  43. export default {
  44. data() {
  45. return {
  46. tabCurrent: '全部',
  47. tabType: 1,
  48. list: [],
  49. buyId: '',
  50. password: '',
  51. num: ''
  52. };
  53. },
  54. onLoad(option) {
  55. this.loadData();
  56. },
  57. onShow() {},
  58. //下拉刷新
  59. onPullDownRefresh() {
  60. },
  61. methods: {
  62. nav(url) {
  63. uni.navigateTo({
  64. url
  65. });
  66. },
  67. go() {
  68. uni.navigateTo({
  69. url:'/pages/market/details'
  70. })
  71. },
  72. // 点击返回 我的页面
  73. toBack() {
  74. uni.navigateBack({
  75. })
  76. },
  77. // 请求载入数据
  78. async loadData() {
  79. let obj = this;
  80. uni.showLoading({
  81. title: '加载中...'
  82. });
  83. mining({
  84. page: 1,
  85. limit: 1000
  86. }).then(({ data }) => {
  87. uni.hideLoading();
  88. console.log(data.data, '9999999999999999999999999999999999');
  89. obj.list = data.data.map(e => {
  90. e.step = +e.step;
  91. e._cost_money = +e._cost_money.replace(e.cost_money_type, '') + e.cost_money_type;
  92. return e;
  93. });
  94. console.log(obj.list, 'obj.list++++++++++++');
  95. });
  96. },
  97. go(ls) {
  98. uni.navigateTo({
  99. url: '/pages/market/details?id=' + ls.id + '&type=' + ls.type
  100. });
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="scss">
  106. page {
  107. background: #ffffff;
  108. height: 100%;
  109. }
  110. .status_bar {
  111. height: var(--status-bar-height);
  112. width: 100%;
  113. }
  114. .content-money {
  115. padding-bottom: 30rpx;
  116. position: relative;
  117. height: 448rpx;
  118. .content-bg {
  119. position: absolute;
  120. top: 0;
  121. left: 0;
  122. right: 0;
  123. width: 750rpx;
  124. height: 448rpx;
  125. image {
  126. width: 100%;
  127. height: 100%;
  128. }
  129. }
  130. .body-title {
  131. height: 80rpx;
  132. text-align: center;
  133. font-size: 35rpx;
  134. position: relative;
  135. .header {
  136. position: absolute;
  137. left: 0;
  138. top: 0;
  139. width: 100%;
  140. font-size: 36rpx;
  141. font-family: PingFang SC;
  142. font-weight: bold;
  143. color: #fffeff;
  144. height: 80rpx;
  145. font-size: 36rpx;
  146. font-weight: 700;
  147. z-index: 9;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. }
  152. .goback-box {
  153. position: absolute;
  154. left: 18rpx;
  155. top: 0;
  156. height: 80rpx;
  157. display: flex;
  158. align-items: center;
  159. }
  160. .goback {
  161. z-index: 100;
  162. width: 34rpx;
  163. height: 34rpx;
  164. }
  165. }
  166. }
  167. .money {
  168. position: relative;
  169. z-index: 10;
  170. padding-top: 64rpx;
  171. display: flex;
  172. flex-direction: column;
  173. align-items: center;
  174. .num {
  175. font-size: 84rpx;
  176. font-family: PingFang SC;
  177. font-weight: 800;
  178. color: #ffffff;
  179. }
  180. .font {
  181. font-size: 30rpx;
  182. font-family: PingFang SC;
  183. font-weight: 500;
  184. color: #ffffff;
  185. }
  186. .all {
  187. margin-top: 20rpx;
  188. width: 194rpx;
  189. height: 60rpx;
  190. line-height: 60rpx;
  191. border: 1px solid #ffffff;
  192. border-radius: 30rpx;
  193. font-size: 26rpx;
  194. font-family: SourceHanSansCN;
  195. font-weight: 500;
  196. color: #ffffff;
  197. text-align: center;
  198. }
  199. }
  200. .main {
  201. margin-top: 26rpx;
  202. .main-title {
  203. display: flex;
  204. justify-content: center;
  205. align-items: center;
  206. image {
  207. width: 24rpx;
  208. height: 24rpx;
  209. }
  210. .title-font {
  211. width: 170rpx;
  212. font-size: 34rpx;
  213. font-family: PingFang SC;
  214. font-weight: bold;
  215. color: #2E58FF;
  216. text-align: center;
  217. }
  218. }
  219. .main-box {
  220. padding: 16rpx 20rpx 70rpx;
  221. .main-item {
  222. margin-top: 20rpx;
  223. background: #FFFFFF;
  224. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  225. border-radius: 10rpx;
  226. padding: 14rpx;
  227. display: flex;
  228. justify-content: flex-start;
  229. .item-bg {
  230. width: 260rpx;
  231. height: 260rpx;
  232. flex-shrink: 0;
  233. image {
  234. width: 100%;
  235. height: 100%;
  236. }
  237. }
  238. .item-info {
  239. position: relative;
  240. margin-left: 30rpx;
  241. padding-top: 20rpx;
  242. width: 100%;
  243. .item-name {
  244. font-size: 30rpx;
  245. font-family: PingFang SC;
  246. font-weight: bold;
  247. color: #333333;
  248. }
  249. .item-tip {
  250. font-size: 24rpx;
  251. font-family: PingFang SC;
  252. font-weight: 500;
  253. color: #666666;
  254. }
  255. .price {
  256. margin-top: 70rpx;
  257. font-size: 40rpx;
  258. font-family: PingFang SC;
  259. font-weight: bold;
  260. color: #E83F30;
  261. text {
  262. font-size: 22rpx;
  263. }
  264. }
  265. }
  266. .btn {
  267. position: absolute;
  268. right: 24rpx;
  269. bottom: 34rpx;
  270. width: 141rpx;
  271. height: 50rpx;
  272. background: linear-gradient(0deg, #2E58FF, #32C6FF);
  273. border-radius: 25rpx;
  274. text-align: center;
  275. line-height: 50rpx;
  276. font-size: 24rpx;
  277. font-family: PingFang SC;
  278. font-weight: 500;
  279. color: #FFFFFF;
  280. }
  281. }
  282. }
  283. }
  284. </style>