USDT.vue 7.6 KB

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