M_purchase.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="page">
  3. <view class="topBody">
  4. <view class="header">
  5. </view>
  6. <view class="myinfo">
  7. <view class="line"></view>
  8. <view class="purchaseList" style="margin-top: 60rpx;">
  9. <view class="item" :class ="index==sel?'itemSel':''" v-for="(item,index) in purchList">
  10. <view class="num1">
  11. <view class="name">{{ item.value }}M{{$t('txt.币')}}</view>
  12. </view>
  13. <view class="num2">
  14. <view class="name">{{ item.cost }}{{$t('txt.¥')}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view style="padding-top: 20rpx;margin-left: 10rpx;" class="jinchu">
  19. <text style="color:#FFFFFF;font-size: 32rpx;font-weight: bold;">{{$t('txt.支付方式')}}</text>
  20. </view>
  21. <view class="mingxiList">
  22. <view class="left">
  23. <image class="icon" src="../../static/me/icon_wechat.png" mode="widthFix" />
  24. <text style="font-size: 28rpx;margin-left: 20rpx;color: #ffffff;">{{$t('txt.微信支付')}}</text>
  25. </view>
  26. <view class="right">
  27. <image class="icon" src="../../static/me/icon_select.png" mode="heightFix" />
  28. </view>
  29. </view>
  30. <view class="line"></view>
  31. <view class="mingxiList">
  32. <view class="left">
  33. <image class="icon" src="../../static/me/icon_alipay.png" mode="widthFix" />
  34. <text style="font-size: 28rpx;margin-left: 20rpx;color: #ffffff;">{{$t('txt.支付宝支付')}}</text>
  35. </view>
  36. <view class="right">
  37. <image class="icon" src="../../static/me/icon_unsel.png" mode="heightFix" />
  38. </view>
  39. </view>
  40. <view class="line"></view>
  41. <view class="btn_submit">{{$t('txt.立即支付')}}{{$t('txt.¥')}}{{ purchList[sel].cost }}</view>
  42. <view class="bottom">
  43. <text style="font-size: 28rpx;color: #FFFFFF;">{{$t('txt.点击支付即代表同意')}}</text>
  44. <text style="font-size: 28rpx;color: #FF2A95;">{{$t('txt.M币充值协议')}}</text>
  45. </view>
  46. </view>
  47. <view class="blankHeight"></view>
  48. </view>
  49. <!-- 提示框 -->
  50. <DialogBox ref="DialogBox"></DialogBox>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. components: {},
  56. data() {
  57. return {
  58. title: '',
  59. sel: 1,
  60. M_coinInfo: {
  61. myMcoin: 0
  62. },
  63. purchList: {
  64. "0": {
  65. value: 50,
  66. cost: 5
  67. },
  68. "1": {
  69. value: 100,
  70. cost: 10
  71. },
  72. "2": {
  73. value: 250,
  74. cost: 25
  75. },
  76. "3": {
  77. value: 500,
  78. cost: 50
  79. },
  80. "4": {
  81. value: 1000,
  82. cost: 100
  83. },
  84. "5": {
  85. value: 5000,
  86. cost: 500
  87. },
  88. "6": {
  89. value: 10000,
  90. cost: 1000
  91. },
  92. "7": {
  93. value: 20000,
  94. cost: 2000
  95. },
  96. "8": {
  97. value: 50000,
  98. cost: 5000
  99. },
  100. },
  101. }
  102. },
  103. onLoad() {
  104. // setTimeout(function() {
  105. // uni.setNavigationBarColor({
  106. // frontColor: '#ffffff',
  107. // backgroundColor: '#00000000',
  108. // animation: {
  109. // duration: 400,
  110. // timingFunc: 'easeIn'
  111. // }
  112. // })
  113. // }, 200);
  114. },
  115. onShow() {
  116. this.loadData();
  117. },
  118. methods: {
  119. onBack() {},
  120. chkSel() {
  121. if (this.sel == 1) {
  122. this.sel = 0;
  123. } else {
  124. this.sel = 1;
  125. }
  126. },
  127. loadData() {
  128. console.log("this.globalData", getApp().globalData);
  129. let obj2 = {
  130. is_first: 0
  131. }
  132. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  133. console.log(postData);
  134. uni.request({
  135. url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例,并非真实接口地址。
  136. data: postData,
  137. method: 'POST',
  138. header: {
  139. 'content-type': 'application/json', //自定义请求头信息
  140. 'Access-Control-Allow-Origin': '*'
  141. },
  142. success: (res) => {
  143. console.log('data:', res.data);
  144. this.myinfo = res.data;
  145. }
  146. });
  147. },
  148. }
  149. }
  150. </script>
  151. <style scoped lang="scss">
  152. @import 'M_purchase.scss';
  153. </style>