USDT.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view class="content">
  3. <view class="header">
  4. <view class="money">
  5. <image src="../../static/icon/logo.png" mode=""></image>
  6. <view class="">
  7. 3330.30
  8. </view>
  9. </view>
  10. <view class="header-right">
  11. <view @click="navTo('/pages/money/USDThuzhuan')">USDT互转</view>
  12. <view @click="navTo('/pages/money/conversionIntegral')">转换积分</view>
  13. </view>
  14. </view>
  15. <view class="list">
  16. <scroll-view scroll-y="true" class="scroll-y">
  17. <view class="item" v-for="l in list">
  18. <view class="item-left">
  19. <image src="../../static/icon/money.png" mode=""></image>
  20. <text>{{l.type}}</text>
  21. <text>{{l.time}}</text>
  22. </view>
  23. <view class="item-right">
  24. {{l.money}}
  25. </view>
  26. </view>
  27. </scroll-view>
  28. </view>
  29. <view class="footer">
  30. <view class="recharge" @click="navTo('/pages/money/recharge')">
  31. 充币
  32. </view>
  33. <view class="withdrawal" @click="navTo('/pages/money/withdrawal')">
  34. 提币
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import { getMoneyStyle } from '@/utils/rocessor.js';
  41. // #ifdef H5
  42. import { rechargeWechat,exchange } from '@/api/wallet.js';
  43. // #endif
  44. // #ifdef MP
  45. import { rechargeRoutine } from '@/api/wallet.js';
  46. // #endif
  47. import { mapState } from 'vuex';
  48. export default {
  49. filters: {
  50. getMoneyStyle
  51. },
  52. data() {
  53. return {
  54. type: 'weixin',
  55. money: '', //充值金额
  56. payLoding: false ,//是否加载中
  57. list: [{
  58. type: "充币",
  59. time: "2018-05-12 16:24:45",
  60. money: 9898,
  61. }],
  62. page: 1,
  63. limit: 10
  64. };
  65. },
  66. onLoad(options) {},
  67. computed: {
  68. // #ifdef H5
  69. ...mapState(['weichatObj'])
  70. // #endif
  71. },
  72. mounted() {
  73. this.getExchange()
  74. },
  75. methods: {
  76. // 跳转
  77. navTo(url) {
  78. uni.navigateTo({
  79. url: url
  80. });
  81. },
  82. getExchange() {
  83. let data = {
  84. page: this.page,
  85. limit: this.limit
  86. }
  87. exchange( data ).then(res => {
  88. console.log(res.data)
  89. })
  90. },
  91. // 切换选中对象
  92. tabRadio(e) {
  93. this.type = e;
  94. },
  95. // 提交
  96. confirm() {
  97. let obj = this;
  98. obj.payLoding = true;
  99. // #ifdef H5
  100. rechargeWechat({ price: this.money, from: this.type })
  101. .then(e => {
  102. let da = e.data.data;
  103. obj.weichatObj.chooseWXPay({
  104. timestamp: da.timestamp,
  105. nonceStr: da.nonceStr,
  106. package: da.package,
  107. signType: da.signType,
  108. paySign: da.paySign,
  109. success: function(res) {
  110. uni.showToast({
  111. title: '充值成功',
  112. duration: 2000,
  113. position: 'top'
  114. });
  115. }
  116. });
  117. obj.payLoding = false;
  118. })
  119. .catch(e => {
  120. obj.payLoding = false;
  121. console.log(e);
  122. });
  123. // #endif
  124. // #ifdef MP
  125. rechargeRoutine({ price: this.money})
  126. .then(e => {
  127. let da = e.data;
  128. wx.requestPayment({
  129. timeStamp: da.timestamp,
  130. nonceStr: da.nonceStr,
  131. package: da.package,
  132. signType: da.signType,
  133. paySign: da.paySign,
  134. success: function(res) {
  135. uni.redirectTo({
  136. url: '/pages/money/paySuccess'
  137. });
  138. },
  139. })
  140. obj.payLoding = false;
  141. })
  142. .catch(e => {
  143. obj.payLoding = false;
  144. console.log(e);
  145. });
  146. // #endif
  147. },
  148. //获取订单列表
  149. loadData(source) {
  150. console.log(source);
  151. //这里是将订单挂载到tab列表下
  152. let index = this.tabCurrentIndex;
  153. let navItem = this.navList[index];
  154. let state = navItem.state;
  155. if (source === 'tabChange' && navItem.loaded === true) {
  156. //tab切换只有第一次需要加载数据
  157. return;
  158. }
  159. if (navItem.loadingType === 'loading') {
  160. //防止重复加载
  161. return;
  162. }
  163. navItem.loadingType = 'loading';
  164. setTimeout(() => {
  165. let orderList = [];
  166. orderList.forEach(item => {
  167. navItem.orderList.push(item);
  168. });
  169. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  170. this.$set(navItem, 'loaded', true);
  171. //判断是否还有数据, 有改为 more, 没有改为noMore
  172. navItem.loadingType = 'more';
  173. }, 600);
  174. }
  175. }
  176. };
  177. </script>
  178. <style lang="scss">
  179. page {
  180. height: 100%;
  181. background-color: #fff;
  182. }
  183. // .add-btn {
  184. // &.modified {
  185. // color: $base-color;
  186. // }
  187. // &.up {
  188. // background-color: $base-color;
  189. // color: #fff;
  190. // }
  191. // display: flex;
  192. // align-items: center;
  193. // justify-content: center;
  194. // width: 690rpx;
  195. // height: 80rpx;
  196. // margin: 0 auto;
  197. // margin-top: 30rpx;
  198. // font-size: $font-lg;
  199. // border-radius: 10rpx;
  200. // // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  201. // }
  202. .content {
  203. height: 100%;
  204. }
  205. .header {
  206. height: 350rpx;
  207. .money {
  208. text-align: center;
  209. height: 300rpx;
  210. padding: calc(50% - 300rpx) 0;
  211. image {
  212. width: 140rpx;
  213. height: 140rpx;
  214. }
  215. view {
  216. height: 60rpx;
  217. line-height: 60rpx;
  218. }
  219. }
  220. .header-right {
  221. position: absolute;
  222. right: 0;
  223. top: 80rpx;
  224. view {
  225. text-align: center;
  226. border-radius: 10rpx 0 0 10rpx;
  227. margin-bottom: 10rpx;
  228. padding: 10rpx;
  229. background: linear-gradient(90deg, #438BED 0%, #44BFEC 100%);
  230. color: #fff;
  231. font-size: 28rpx;
  232. }
  233. view:nth-child(2) {
  234. background: linear-gradient(90deg, #FFB238 0%, #FFE138 100%);
  235. }
  236. }
  237. }
  238. .list {
  239. height: calc(100% - 350rpx - 100rpx - 10rpx);//350rpx头部100rpx底部30rpx
  240. .scroll-y {
  241. height: 100%;
  242. }
  243. .item {
  244. display: flex;
  245. justify-content: space-between;
  246. padding: 50rpx;
  247. margin: 30rpx;
  248. border-radius: 20rpx;
  249. box-shadow:0 0 20rpx 6rpx #f1f1f1;
  250. .item-left {
  251. image {
  252. width: 35rpx;
  253. height: 40rpx;
  254. margin-bottom: -10rpx;
  255. margin-right: 20rpx;
  256. }
  257. text:nth-child(2) {
  258. color: #333333;
  259. margin-right: 20rpx;
  260. }
  261. text:nth-child(3) {
  262. color: #999999;
  263. font-size: 20rpx;
  264. }
  265. }
  266. .item-right {
  267. color: #FB3A2F;
  268. font-size: 38rpx;
  269. }
  270. }
  271. }
  272. // .row-box {
  273. // margin-top: 30rpx;
  274. // padding: 20rpx 30rpx;
  275. // background: #fff;
  276. // .title {
  277. // font-size: $font-base + 2rpx;
  278. // color: $font-color-dark;
  279. // }
  280. // .row {
  281. // display: flex;
  282. // align-items: center;
  283. // position: relative;
  284. // height: 80rpx;
  285. // .tit {
  286. // flex-shrink: 0;
  287. // width: 40rpx;
  288. // font-size: 30rpx;
  289. // color: $font-color-dark;
  290. // }
  291. // .input {
  292. // flex: 1;
  293. // font-size: 30rpx;
  294. // color: $font-color-dark;
  295. // }
  296. // .iconlocation {
  297. // font-size: 36rpx;
  298. // color: $font-color-light;
  299. // }
  300. // .buttom {
  301. // color: $font-color;
  302. // font-size: $font-base;
  303. // }
  304. // }
  305. // }
  306. // .list {
  307. // padding-left: 30rpx;
  308. // margin-top: 30rpx;
  309. // background-color: #ffffff;
  310. // .box {
  311. // display: flex;
  312. // align-items: center;
  313. // width: 100%;
  314. // height: 120rpx;
  315. // border-bottom: 1px solid $border-color-light;
  316. // .icon {
  317. // font-size: 48rpx;
  318. // padding-right: 20rpx;
  319. // }
  320. // .iconweixin1 {
  321. // color: #18bf16;
  322. // }
  323. // .iconzhifubao {
  324. // color: #08aaec;
  325. // }
  326. // .title-box {
  327. // flex-grow: 1;
  328. // text-align: left;
  329. // .title {
  330. // font-size: $font-base + 2rpx;
  331. // color: $font-color-base;
  332. // }
  333. // .node {
  334. // font-size: $font-sm;
  335. // color: $font-color-light;
  336. // }
  337. // }
  338. // }
  339. // }
  340. // /deep/ .uni-radio-input {
  341. // width: 45rpx;
  342. // height: 45rpx;
  343. // }
  344. .footer {
  345. height: 100rpx;
  346. position: absolute;
  347. bottom: 0;
  348. display: flex;
  349. text-align: center;
  350. width: 100%;
  351. view {
  352. width: 50%;
  353. line-height: 100rpx;
  354. // padding: 20rpx;
  355. color: #fff;
  356. }
  357. .recharge {
  358. background-color: #FFB238;
  359. }
  360. .withdrawal {
  361. background-color: #438BED;
  362. }
  363. }
  364. </style>