USDT.vue 8.8 KB

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