tutorialdel.vue 5.7 KB

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