fhlist.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <view class="content">
  3. <view class="wrap fhlist" >
  4. <view class="title flex">節點詳情 </view>
  5. <view class="fhbox flex">
  6. <view class="flex boxnum">
  7. 今日加權 <p class="p">{{fhNums.jinri}}VGT</p>
  8. </view>
  9. <view class="fg"></view>
  10. <view class="flex boxnum">
  11. 總加權 <p class="p">{{fhNums.zong}}VGT</p>
  12. </view>
  13. </view>
  14. <view class="mylist">
  15. <view class="Listbox">
  16. <view class="listTop flex" >
  17. <p style="width: 30%;">地址</p>
  18. <p style="width: 30%;">金額</p>
  19. <p style="width: 40%;">時間</p>
  20. </view>
  21. <view class="listrow" v-if="lists.length>0">
  22. <view class="rowli flex" v-for="(items,indexs) in lists" :key="indexs">
  23. <p style="width: 30%;color: #2F80ED;" >{{items.walletAddress}}</p>
  24. <p style="width: 30%;" >{{items.money}}</p>
  25. <p style="width: 40%;" >{{items.shijian}}</p>
  26. </view>
  27. <uni-load-more :status="status" :icon-size="14" :content-text="contentText"
  28. v-if="totalCount > 10" />
  29. </view>
  30. <view class="noMore" v-else>暫無數據</view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- <view class="noMore" v-else>暫無數據</view> -->
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. createWeb3Modal,
  40. defaultWagmiConfig,
  41. useWeb3ModalState,
  42. useWeb3Modal
  43. } from '@web3modal/wagmi/vue'
  44. import {
  45. mainnet,
  46. arbitrum,
  47. optimism,
  48. bsc,
  49. polygon
  50. } from '@wagmi/core/chains'
  51. import {
  52. getAccount, //地址
  53. writeContract,
  54. disconnect, //断开
  55. watchAccount,
  56. createConfig, //创建客户端
  57. configureChains, //配置链
  58. getNetwork, //获取链
  59. getWalletClient,
  60. fetchToken,
  61. connect, //链接
  62. watchContractEvent,
  63. watchNetwork,
  64. sendTransaction,
  65. signMessage,
  66. prepareSendTransaction
  67. } from '@wagmi/core'
  68. import {
  69. publicProvider
  70. } from '@wagmi/core/providers/public'
  71. import {
  72. InjectedConnector
  73. } from '@wagmi/core/connectors/injected'
  74. import {
  75. parseEther
  76. } from 'viem'
  77. const projectId = 'c46fe115e62fd8cc283e8db10b3a7fa7'
  78. // 2. Create wagmiConfig
  79. const metadata = {
  80. name: 'Web3Modal',
  81. description: 'Web3Modal Example',
  82. url: 'https://web3modal.com',
  83. icons: ['https://avatars.githubusercontent.com/u/37784886']
  84. }
  85. const chains = [bsc]
  86. const wagmiConfig = defaultWagmiConfig({
  87. chains,
  88. projectId,
  89. metadata
  90. })
  91. // 3. Create modal
  92. const modal = createWeb3Modal({
  93. wagmiConfig,
  94. projectId,
  95. chains,
  96. optionalChains: [{
  97. chainId: 128,
  98. chainName: "HECO",
  99. nativeCurrency: {
  100. name: "HECO",
  101. symbol: "HT",
  102. decimals: 18,
  103. },
  104. rpcUrls: ["https://http-mainnet.hecochain.com/ "]
  105. },
  106. {
  107. chainId: 137,
  108. chainName: "MATIC",
  109. nativeCurrency: {
  110. name: "MATIC",
  111. symbol: "MATIC",
  112. decimals: 18,
  113. },
  114. rpcUrls: ["https://matic.mytokenpocket.vip/ "],
  115. }
  116. ],
  117. defaultChain: bsc,
  118. tokens: {
  119. 1: {
  120. address: '0xdac17f958d2ee523a2206206994597c13d831ec7',
  121. image: 'token_image_url' //optional ETH
  122. },
  123. 56: {
  124. address: '0x55d398326f99059ff775485246999027b3197955',
  125. image: 'token_image_url' //optional BSC
  126. },
  127. 137: {
  128. address: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
  129. image: 'token_image_url' //optional MATIC
  130. },
  131. 128: {
  132. address: '0xa71edc38d189767582c38a3145b5873052c3e47a',
  133. image: 'token_image_url' //optional HT
  134. }
  135. },
  136. //主题覆盖
  137. themeVariables: {
  138. '--w3m-accent': '#02cc66',
  139. },
  140. //主题亮,暗
  141. themeMode: 'light'
  142. })
  143. export default {
  144. data() {
  145. return {
  146. statusBarHeight:'',
  147. content:'' ,
  148. fhNums:{},
  149. lists:[],
  150. type:'',
  151. status: 'more',//'上拉加載更多','加載中','沒有更多'
  152. contentText: {
  153. contentdown: '上拉加載更多',
  154. contentrefresh:'加載中',
  155. contentnomore:'沒有更多'
  156. },
  157. page: '1',
  158. totalCount: '',//总条数
  159. }
  160. },
  161. computed: {
  162. i18n() {
  163. return this.$t('lang')
  164. }
  165. },
  166. onLoad(option) {
  167. this.type=option.type
  168. this.getList()
  169. //获取状态栏+导航栏的高度
  170. let _that = this;
  171. uni.getSystemInfo({
  172. success(e) {
  173. if (e.platform == "ios") {
  174. _that.statusBarHeight = e.statusBarHeight + 45;
  175. } else {
  176. _that.statusBarHeight = e.statusBarHeight + 50;
  177. }
  178. }
  179. })
  180. },
  181. //上拉加载更多,onReachBottom上拉触底函数
  182. onReachBottom() {
  183. if (this.totalCount > this.lists.length) {
  184. this.status = 'loading';
  185. setTimeout(() => {
  186. this.page++
  187. this.getList(); //执行的方法
  188. }, 1000) //这里我是延迟一秒在加载方法有个loading效果,如果接口请求慢的话可以去掉
  189. } else { //停止加载
  190. this.status = 'noMore'
  191. }
  192. },
  193. methods: {
  194. getList(){
  195. let data={
  196. walletAddress:uni.getStorageSync('walletAddress'),
  197. cType:uni.getStorageSync('cType'),
  198. type:this.type,
  199. page:this.page
  200. }
  201. this.$http.jiedianxq(data).then(res => {
  202. var datas =res.data
  203. if(datas.code == 200 ){
  204. this.fhNums=datas.data
  205. this.totalCount = datas.data.list.total
  206. if (datas.data.list.total > 0) {
  207. const dataMap = datas.data.list.data
  208. this.lists = this.reload ? dataMap : this.lists.concat(dataMap);
  209. this.reload = false;
  210. } else {
  211. this.lists = [];
  212. }
  213. if (this.totalCount == this.lists.length) {
  214. this.reload = false;
  215. this.status = 'noMore'
  216. }
  217. }else{
  218. uni.showToast({
  219. title:datas.msg,
  220. icon:'none',
  221. })
  222. }
  223. }).catch(err => {
  224. uni.showToast({
  225. title:err,
  226. icon:'none',
  227. })
  228. })
  229. },
  230. back(){
  231. uni.navigateBack()
  232. }
  233. },
  234. }
  235. </script>
  236. <style scoped lang="scss">
  237. .fhlist{
  238. padding-top: 100rpx;
  239. .title{
  240. color: #000;
  241. font-size: 36rpx;
  242. margin-left: 10rpx;
  243. align-items: flex-end;
  244. .p{
  245. color: #333;
  246. font-size: 24rpx;
  247. margin-left: 12rpx;
  248. }
  249. }
  250. .fhbox{
  251. width:94%;
  252. background-color: #fff;
  253. padding: 32rpx 3%;
  254. margin-top:24rpx ;
  255. justify-content: space-around;
  256. .fg{
  257. height: 52rpx;
  258. width: 1rpx;
  259. background-color: #333;
  260. }
  261. .boxnum{
  262. width: 40%;
  263. font-size: 24rpx;
  264. color: #333333;
  265. .p{
  266. font-size: 36rpx;
  267. font-weight: bold;
  268. margin-left: 10rpx;
  269. }
  270. }
  271. }
  272. .mylist{
  273. background-color: #fff;
  274. border-radius: 20rpx;
  275. padding: 24rpx 0;
  276. margin: 40rpx 0; }
  277. .Listbox{
  278. margin: 0 24rpx;
  279. .listTop{
  280. padding: 20rpx 0;
  281. border-bottom: 1rpx solid #DCE1F6;
  282. font-size: 28rpx;
  283. color: #828282;
  284. text-align: center;
  285. }
  286. .listrow{
  287. margin: 20rpx 0;
  288. .rowli{
  289. padding-bottom: 48rpx;
  290. font-size: 28rpx;
  291. color: #4F4F4F;
  292. text-align: center;
  293. flex-wrap:wrap;
  294. .yuyin{
  295. margin-top:20rpx ;
  296. padding: 10rpx 20rpx;
  297. font-size: 28rpx;
  298. color: #828282;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. .leakagebox{
  305. position: relative;
  306. font-size: 28rpx;
  307. color: #333;
  308. line-height: 80rpx;
  309. }
  310. .mallList{
  311. margin-top: 40rpx;
  312. flex-wrap: wrap;
  313. .listli{
  314. width: 41%;
  315. padding:30rpx 24rpx;
  316. // border-radius: 8rpx;
  317. // background-color: #fff;
  318. // box-shadow: 0px 1px 5px 0px #C9D9F199;
  319. margin-bottom: 30rpx;
  320. margin-right: 28rpx;
  321. }
  322. .listli:nth-child(2n){
  323. margin-right: 0;
  324. }
  325. .rows {
  326. background-color: #fff;
  327. border-radius: 20rpx;
  328. //padding: 32rpx 0;
  329. .title {
  330. margin-bottom: 20rpx;
  331. .titfl {
  332. color: #333333;
  333. font-size: 32rpx;
  334. font-weight: 700;
  335. .typeTips{
  336. width: 20rpx;
  337. height: 20rpx;
  338. border-radius: 50rpx;
  339. margin-left: 20rpx;
  340. }
  341. .red{
  342. background-color: red;
  343. }
  344. .green{
  345. background-color: #14C670;
  346. }
  347. }
  348. .price {
  349. color: #F5A94F;
  350. }
  351. }
  352. .listimg {
  353. width: 48rpx;
  354. height: 48rpx;
  355. margin-right: 10rpx;
  356. }
  357. .iconimg {
  358. width: 36rpx;
  359. height: 36rpx;
  360. }
  361. .rowsfl {
  362. font-size: 28rpx;
  363. .times {
  364. margin-bottom: 24rpx;
  365. color: #828282;
  366. span {
  367. color: #333333;
  368. }
  369. }
  370. }
  371. .rowsfr {
  372. background: linear-gradient(90.89deg, #38F957 49.57%, #1DEEE1 99.24%);
  373. width: 80%;
  374. height: 64rpx;
  375. text-align: center;
  376. line-height: 64rpx;
  377. color: #040616;
  378. font-size: 28rpx;
  379. border-radius: 8rpx;
  380. margin-left: 10%;
  381. margin-top: 12rpx;
  382. }
  383. }
  384. }
  385. </style>