rule.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="content">
  3. <view class="headTop" @click="back()" :style="{paddingTop:statusBarHeight+'rpx'}">
  4. <!-- <view class="iconfont icon" style="transform:rotate(90deg);">&#xeb8d;</view> -->
  5. <p class="p">参与规则</p>
  6. </view>
  7. <view class="wrap leakagebox" v-if="content">
  8. <view v-html="content"></view>
  9. </view>
  10. <view class="noMore" v-else>暫無數據</view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. createWeb3Modal,
  16. defaultWagmiConfig,
  17. useWeb3ModalState,
  18. useWeb3Modal
  19. } from '@web3modal/wagmi/vue'
  20. import {
  21. mainnet,
  22. arbitrum,
  23. optimism,
  24. bsc,
  25. polygon
  26. } from '@wagmi/core/chains'
  27. import {
  28. getAccount, //地址
  29. writeContract,
  30. disconnect, //断开
  31. watchAccount,
  32. createConfig, //创建客户端
  33. configureChains, //配置链
  34. getNetwork, //获取链
  35. getWalletClient,
  36. fetchToken,
  37. connect, //链接
  38. watchContractEvent,
  39. watchNetwork,
  40. sendTransaction,
  41. signMessage,
  42. prepareSendTransaction
  43. } from '@wagmi/core'
  44. import {
  45. publicProvider
  46. } from '@wagmi/core/providers/public'
  47. import {
  48. InjectedConnector
  49. } from '@wagmi/core/connectors/injected'
  50. import {
  51. parseEther
  52. } from 'viem'
  53. const projectId = 'c46fe115e62fd8cc283e8db10b3a7fa7'
  54. // 2. Create wagmiConfig
  55. const metadata = {
  56. name: 'Web3Modal',
  57. description: 'Web3Modal Example',
  58. url: 'https://web3modal.com',
  59. icons: ['https://avatars.githubusercontent.com/u/37784886']
  60. }
  61. const chains = [bsc]
  62. const wagmiConfig = defaultWagmiConfig({
  63. chains,
  64. projectId,
  65. metadata
  66. })
  67. // 3. Create modal
  68. const modal = createWeb3Modal({
  69. wagmiConfig,
  70. projectId,
  71. chains,
  72. optionalChains: [{
  73. chainId: 128,
  74. chainName: "HECO",
  75. nativeCurrency: {
  76. name: "HECO",
  77. symbol: "HT",
  78. decimals: 18,
  79. },
  80. rpcUrls: ["https://http-mainnet.hecochain.com/ "]
  81. },
  82. {
  83. chainId: 137,
  84. chainName: "MATIC",
  85. nativeCurrency: {
  86. name: "MATIC",
  87. symbol: "MATIC",
  88. decimals: 18,
  89. },
  90. rpcUrls: ["https://matic.mytokenpocket.vip/ "],
  91. }
  92. ],
  93. defaultChain: bsc,
  94. tokens: {
  95. 1: {
  96. address: '0xdac17f958d2ee523a2206206994597c13d831ec7',
  97. image: 'token_image_url' //optional ETH
  98. },
  99. 56: {
  100. address: '0x55d398326f99059ff775485246999027b3197955',
  101. image: 'token_image_url' //optional BSC
  102. },
  103. 137: {
  104. address: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
  105. image: 'token_image_url' //optional MATIC
  106. },
  107. 128: {
  108. address: '0xa71edc38d189767582c38a3145b5873052c3e47a',
  109. image: 'token_image_url' //optional HT
  110. }
  111. },
  112. //主题覆盖
  113. themeVariables: {
  114. '--w3m-accent': '#02cc66',
  115. },
  116. //主题亮,暗
  117. themeMode: 'light'
  118. })
  119. export default {
  120. data() {
  121. return {
  122. statusBarHeight:'',
  123. content:''
  124. }
  125. },
  126. computed: {
  127. i18n() {
  128. return this.$t('lang')
  129. }
  130. },
  131. onLoad() {
  132. uni.startPullDownRefresh(); //这里表示当进入页面的时候就开始执行下拉刷新动画
  133. this.getList()
  134. //获取状态栏+导航栏的高度
  135. let _that = this;
  136. uni.getSystemInfo({
  137. success(e) {
  138. if (e.platform == "ios") {
  139. _that.statusBarHeight = e.statusBarHeight + 45;
  140. } else {
  141. _that.statusBarHeight = e.statusBarHeight + 50;
  142. }
  143. }
  144. })
  145. },
  146. //监听该页面用户下拉刷新事件
  147. onPullDownRefresh() {
  148. this.getList()
  149. setTimeout(function () {
  150. uni.stopPullDownRefresh();
  151. }, 1000);
  152. },
  153. methods: {
  154. getList(){
  155. this.$http.guize().then(res => {
  156. var datas =res.data
  157. if(datas.code == 200 ){
  158. this.content = datas.data.content.replace(/\<img/gi, '<img class="maximg" ')
  159. }else{
  160. // uni.showToast({
  161. // title:datas.msg,
  162. // icon:'none',
  163. // })
  164. }
  165. }).catch(err => {
  166. // uni.showToast({
  167. // title:err,
  168. // icon:'none',
  169. // })
  170. })
  171. },
  172. back(){
  173. uni.navigateBack()
  174. }
  175. },
  176. }
  177. </script>
  178. <style scoped lang="scss">
  179. .headTop{
  180. width: 94%;
  181. margin: 0 3%;
  182. font-size: 34rpx;
  183. display: flex;
  184. align-items: center;
  185. padding-bottom: 20rpx;
  186. .icon{
  187. display: block;
  188. width:10%;
  189. font-size: 45rpx;
  190. color: #000;
  191. }
  192. .p{
  193. width: 100%;
  194. text-align: center;
  195. display: block;
  196. white-space: nowrap;
  197. /* 强制性的在一行显示所有的文本,直到文本结束或者遭遇br标签对象才换行*/
  198. overflow: hidden;
  199. text-overflow: ellipsis;/* 溢出的文字隐藏起来*/
  200. }
  201. }
  202. .leakagebox{
  203. position: relative;
  204. font-size: 28rpx;
  205. color: #333;
  206. line-height: 80rpx;
  207. }
  208. .mallList{
  209. margin-top: 40rpx;
  210. flex-wrap: wrap;
  211. .listli{
  212. width: 41%;
  213. padding:30rpx 24rpx;
  214. // border-radius: 8rpx;
  215. // background-color: #fff;
  216. // box-shadow: 0px 1px 5px 0px #C9D9F199;
  217. margin-bottom: 30rpx;
  218. margin-right: 28rpx;
  219. }
  220. .listli:nth-child(2n){
  221. margin-right: 0;
  222. }
  223. .rows {
  224. background-color: #fff;
  225. border-radius: 20rpx;
  226. //padding: 32rpx 0;
  227. .title {
  228. margin-bottom: 20rpx;
  229. .titfl {
  230. color: #333333;
  231. font-size: 32rpx;
  232. font-weight: 700;
  233. .typeTips{
  234. width: 20rpx;
  235. height: 20rpx;
  236. border-radius: 50rpx;
  237. margin-left: 20rpx;
  238. }
  239. .red{
  240. background-color: red;
  241. }
  242. .green{
  243. background-color: #14C670;
  244. }
  245. }
  246. .price {
  247. color: #F5A94F;
  248. }
  249. }
  250. .listimg {
  251. width: 48rpx;
  252. height: 48rpx;
  253. margin-right: 10rpx;
  254. }
  255. .iconimg {
  256. width: 36rpx;
  257. height: 36rpx;
  258. }
  259. .rowsfl {
  260. font-size: 28rpx;
  261. .times {
  262. margin-bottom: 24rpx;
  263. color: #828282;
  264. span {
  265. color: #333333;
  266. }
  267. }
  268. }
  269. .rowsfr {
  270. background: linear-gradient(90.89deg, #38F957 49.57%, #1DEEE1 99.24%);
  271. width: 80%;
  272. height: 64rpx;
  273. text-align: center;
  274. line-height: 64rpx;
  275. color: #040616;
  276. font-size: 28rpx;
  277. border-radius: 8rpx;
  278. margin-left: 10%;
  279. margin-top: 12rpx;
  280. }
  281. }
  282. }
  283. </style>