detailsTpl.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view class="container" style="padding-top: 100rpx;">
  3. <topView :backg="'#1A1A17'"></topView>
  4. <view class="infoBox">
  5. <view class="navBack" @click="navTo">
  6. <u-icon name="arrow-left" size="25" color="#fff" style="position: absolute;left: 0;top: 0;font-weight: bold;"></u-icon>
  7. <view class="title">{{$t("detailsTpl.我的矿机")}}</view>
  8. </view>
  9. <view class="infoItem" v-for="item,index in myLists" :key="index" v-if="item.status == 1">
  10. <view class="itemInfo">
  11. <view class="itemName">{{$t("detailsTpl.当前矿机")}}</view>
  12. <view class="flex infos">
  13. <view class="infoTip flex_item">
  14. <image :src="'https://www.bscnice.com'+item.machine.image" style="width: 130rpx;height:130rpx;border: 2rpx solid #8D7049;
  15. border-radius: 25rpx;"></image>
  16. <view class="nameBox">
  17. <view class="nameTip">{{item.machine.name}}</view>
  18. <view class="price">{{$t("details.价格")}}:<text class="priTip">{{item.machine.price * 1}}NUSD</text></view>
  19. </view>
  20. </view>
  21. <view class="statusBox flex_item">
  22. <view class="status">{{$t("detailsTpl.工作中")}}</view>
  23. <view class="statusTip"></view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="flex numBox">
  28. <view class="numTpl">
  29. <view class="num">{{info.sent * 1}}</view>
  30. <view class="name">{{$t("detailsTpl.已释放")}}</view>
  31. </view>
  32. <view class="partition"></view>
  33. <view class="numTpl">
  34. <view class="num">{{info.wait}}</view>
  35. <view class="name">{{$t("detailsTpl.待释放")}}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="noDate" v-if="myLists.length == 0">{{$t("detailsTpl.暂无工作中的矿机列表")}}</view>
  40. <view class="navList flex">
  41. <view class="navItem" v-for="item,index in navList" :key="index" @click="clickTab(index)">
  42. <view class="navName" :class="{ active: currTab == index }">{{item}}</view>
  43. <image v-if="currTab == index" src="/static/img/img28.png" class="navTip"></image>
  44. </view>
  45. </view>
  46. <view class="listBox" v-if="list.length > 0">
  47. <view class="listTpl flex" v-for="item,index in list" :key="index">
  48. <view class="tpl">
  49. <view class="addr">{{currTab == 0?typeList[item.type]:item.machine.name}}</view>
  50. <view class="time">{{item.createtime }}</view>
  51. </view>
  52. <view class="num add" v-if="currTab == 0">+{{item.money * 1}}</view>
  53. <view class="num" v-if="currTab == 1">-{{item.machine.price * 1}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import topView from '../components/topView.vue';
  61. import { myList,getTokenLog} from '@/api/index.js';
  62. import{ getTime } from '@/utils/rocessor.js';
  63. export default {
  64. components: {
  65. topView
  66. },
  67. data () {
  68. return {
  69. myLists:[],//我的矿机列表
  70. list:[],
  71. navList:[this.$t("detailsTpl.释放记录"),this.$t("detailsTpl.购买记录")],
  72. currTab:0,
  73. info:'',
  74. typeList:''
  75. }
  76. },
  77. onShow () {
  78. this.loadData();
  79. this.getLog()
  80. },
  81. methods: {
  82. clickTab(index){
  83. this.currTab = index
  84. this.list = []
  85. if(index == 0){
  86. this.getLog()
  87. }else{
  88. this.loadData()
  89. }
  90. },
  91. loadData () {
  92. let obj = this
  93. myList({}).then(function(res){
  94. res.data.list.forEach(item => {
  95. item.createtime = getTime(item.createtime)
  96. })
  97. obj.myLists = res.data.list
  98. obj.info = res.data
  99. if(obj.currTab == 1){
  100. obj.list = res.data.list
  101. }
  102. })
  103. },
  104. getLog(){
  105. let obj = this
  106. getTokenLog({
  107. page:1,
  108. limit:100000,
  109. token:'NICE',
  110. pm:'',
  111. type:'day_mining'
  112. }).then(function(res){
  113. res.data.list.forEach(item => {
  114. item.createtime = getTime(item.createtime)
  115. })
  116. obj.list = res.data.list
  117. obj.typeList = res.data.type
  118. })
  119. },
  120. change(currentPage,type) {
  121. this.page.currentPage = currentPage;
  122. this.loadData()
  123. },
  124. navTo(){
  125. uni.navigateBack({
  126. delta: 1
  127. });
  128. },
  129. },
  130. }
  131. </script>
  132. <style lang="scss">
  133. page {
  134. width: 100%;
  135. min-height: 100vh;
  136. .container {
  137. width: 100%;
  138. min-height: 100vh;
  139. padding-bottom: 25rpx;
  140. }
  141. }
  142. .noDate{
  143. text-align: center;
  144. padding-top: 25rpx;
  145. opacity: 0.3;
  146. }
  147. .infoBox{
  148. padding: 0rpx 25rpx;
  149. color: #fff;
  150. .infoItem{
  151. margin-bottom: 25rpx;
  152. background: #1A1A17;
  153. padding: 35rpx 0rpx;
  154. border-radius: 20rpx;
  155. .numBox{
  156. padding-top: 25rpx;
  157. .numTpl{
  158. width: 45%;
  159. text-align: center;
  160. .name{
  161. font-weight: 500;
  162. font-size: 26rpx;
  163. color: #FFFFFF;
  164. padding-top: 10rpx;
  165. }
  166. .num{
  167. font-weight: bold;
  168. font-size: 34rpx;
  169. color: #FFFFFF;
  170. }
  171. }
  172. .partition{
  173. width: 2rpx;
  174. height: 119rpx;
  175. background: linear-gradient(0deg, rgba(255,255,255,0), #FFFFFF, rgba(255,255,255,0));
  176. }
  177. }
  178. }
  179. }
  180. .itemInfo{
  181. padding: 0rpx 25rpx;
  182. .itemName{
  183. font-weight: bold;
  184. font-size: 27rpx;
  185. padding-bottom: 20rpx;
  186. }
  187. .infos{
  188. border-bottom: 1rpx solid rgba(221, 225, 235, 0.2);
  189. padding-bottom: 25rpx;
  190. .infoTip{
  191. align-items: flex-start;
  192. .nameBox{
  193. padding-left: 25rpx;
  194. .nameTip{
  195. font-weight: bold;
  196. font-size: 32rpx;
  197. color: #FFFFFF;
  198. }
  199. .price{
  200. font-weight: 500;
  201. font-size: 24rpx;
  202. color: #999999;
  203. padding-top: 30rpx;
  204. .priTip{
  205. font-weight: 500;
  206. font-size: 26rpx;
  207. color: #999999;
  208. line-height: 44rpx;
  209. background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
  210. -webkit-background-clip: text;
  211. -webkit-text-fill-color: transparent;
  212. }
  213. }
  214. }
  215. }
  216. .statusBox{
  217. .status{
  218. font-weight: bold;
  219. font-size: 32rpx;
  220. color: #999999;
  221. background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
  222. -webkit-background-clip: text;
  223. -webkit-text-fill-color: transparent;
  224. }
  225. .statusTip{
  226. margin-left: 15rpx;
  227. width: 15rpx;
  228. height: 15rpx;
  229. background: linear-gradient(137deg, #FFF0CF, #CBA16B, #FCE9CF, #C29963);
  230. border-radius: 50%;
  231. }
  232. }
  233. }
  234. }
  235. .listBox{
  236. margin-top: 25rpx;
  237. background: #1A1A17;
  238. padding: 0rpx 25rpx;
  239. border: 4rpx solid #D7B381;
  240. border-radius: 30rpx;
  241. .listTpl{
  242. padding: 30rpx 0rpx;
  243. border-bottom: 1rpx solid rgba(240, 240, 240, 0.3);
  244. .tpl{
  245. .addr{
  246. }
  247. .time{
  248. font-weight: 500;
  249. font-size: 22rpx;
  250. padding-top: 15rpx;
  251. color: #999999;
  252. }
  253. }
  254. .num{
  255. font-weight: 400;
  256. font-size: 36rpx;
  257. color: #fff;
  258. }
  259. .add{
  260. color: #4C5D97;
  261. background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
  262. -webkit-background-clip: text;
  263. -webkit-text-fill-color: transparent;
  264. }
  265. }
  266. .listTpl:last-child{
  267. border-bottom: none !important;
  268. }
  269. }
  270. .navList{
  271. padding: 43rpx 120rpx;
  272. .navItem{
  273. width: 120rpx;
  274. position: relative;
  275. .navName{
  276. font-weight: bold;
  277. font-size: 29rpx;
  278. color: #FFFFFF;
  279. }
  280. .active{
  281. font-weight: bold;
  282. font-size: 29rpx;
  283. color: #FFFFFF;
  284. background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
  285. -webkit-background-clip: text;
  286. -webkit-text-fill-color: transparent;
  287. }
  288. .navTip{
  289. position: absolute;
  290. top: 45rpx;
  291. left: 35rpx;
  292. width: 45rpx;
  293. height: 11rpx;
  294. }
  295. }
  296. }
  297. .navBack{
  298. position: relative;
  299. color: #fff;
  300. text-align: center;
  301. margin: 30rpx 0rpx 40rpx 0rpx;
  302. .title{
  303. font-weight: bold;
  304. font-size: 34rpx;
  305. }
  306. }
  307. </style>