You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

292 lines
6.1 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <!-- 充值界面 -->
  2. <template>
  3. <view class="purse bx">
  4. <!-- <navbar :leftClick="leftClick" :title="$t('page.purse.recharge')"></navbar> -->
  5. <!-- 用户余额信息 -->
  6. <view class="user-money content">
  7. <view class="title">Balance</view>
  8. <view class="money">
  9. <view class="money-unit">{{ $t('page.purse.unit') }}</view>
  10. <view class="money-detail">{{ money }}</view>
  11. </view>
  12. </view>
  13. <view class="purse-input content">
  14. <view class="title">Recharge address</view>
  15. <view class="text">TMzqKBCtFdjzCk293hLS4MgMJbppxUEhp8</view>
  16. <view @click="copy('TMzqKBCtFdjzCk293hLS4MgMJbppxUEhp8')" class="btn">copy</view>
  17. </view>
  18. <view class="purse-input content">
  19. <view class="title">Recharge amount</view>
  20. <input type="text" placeholder="Please enter recharge amout" />
  21. </view>
  22. <view class="purse-input content">
  23. <view class="title">Upload payment screenshot</view>
  24. <image :src="form.image"
  25. v-if="form.image" mode=""
  26. @click="uploadImage"></image>
  27. <view class="image" v-else
  28. @click="uploadImage">
  29. <u-icon name="plus"></u-icon>
  30. </view>
  31. </view>
  32. <!-- 按钮 -->
  33. <view class="submit-btn content">I have completed the recharge</view>
  34. <view class="steps content">
  35. <view class="steps-title">The steps</view>
  36. <view class="steps-content">
  37. <view>1. Please copy the TRC-20 wallet address for payment in this mall.</view>
  38. <view>2. Make the transfer after verification. If I make a mistake, this mall will not bear your loss.</view>
  39. <view>3. When your payment is successful, please upload the payment voucher.</view>
  40. <view>4. When you are done with this, click: I have completed the payment.</view>
  41. <view>5. When you encounter any problems, be sure to contact our online customer service in time to help you solve them.</view>
  42. </view>
  43. </view>
  44. <!-- 客服列表 -->
  45. <serviceList :show="showService" :serverList="serverList" @close="closeServiceList"></serviceList>
  46. <sTabbar select="100" />
  47. </view>
  48. </template>
  49. <script>
  50. import navbar from '@/components/base/m-navbar.vue'
  51. import serviceList from '@/components/serviceList/serviceList.vue';
  52. import sTabbar from '@/components/base/tabBar.vue'
  53. export default {
  54. components: {
  55. navbar,
  56. serviceList,
  57. sTabbar
  58. },
  59. data() {
  60. return {
  61. active : 0,
  62. money : '',
  63. form : {
  64. id : '',
  65. image : '',
  66. address : ''
  67. },
  68. serverList : [],
  69. showService : false
  70. }
  71. },
  72. onShow() {
  73. this.getUserInfo()
  74. this.forgetPass()
  75. },
  76. methods: {
  77. // leftClick() {
  78. // if(this.$route.query.type){
  79. // return uni.navigateTo({
  80. // url: '/pages/home/home'
  81. // })
  82. // }else{
  83. // uni.navigateTo({
  84. // url: '/pages/center/center'
  85. // })
  86. // }
  87. // },
  88. uploadImage(){
  89. let self = this
  90. uni.chooseImage({
  91. success(res) {
  92. self.form.image = res.tempFilePaths[0]
  93. }
  94. })
  95. },
  96. //获取用户信息
  97. getUserInfo(){
  98. this.request('userInfo').then(res => {
  99. if(res.code == 200){
  100. this.userInfo = res.result.userInfo
  101. this.money = res.result.userInfo.money
  102. }
  103. })
  104. },
  105. //充值
  106. recharge(){
  107. this.$play()
  108. this.request('recharge2',{},this.form).then(res => {
  109. if(res.code == 200){
  110. uni.$u.toast(this.$t('page.purse.success'))
  111. this.cleanForm()
  112. this.revealServiceList()
  113. this.getUserInfo() //刷新用户信息(更新用户余额)
  114. }
  115. })
  116. },
  117. //显示客服列表
  118. revealServiceList(){
  119. this.$play()
  120. this.showService = true;
  121. },
  122. //关闭客服列表
  123. closeServiceList(){
  124. this.showService = false;
  125. },
  126. //忘记密码(获取客服列表)
  127. forgetPass(){
  128. this.request('forgetPass').then(res => {
  129. if(res.code == 200){
  130. this.serverList = res.result
  131. }
  132. })
  133. },
  134. //清空表单数据
  135. cleanForm(){
  136. this.form = {
  137. }
  138. },
  139. //复制内容
  140. copy(content) {
  141. if(!content){
  142. return uni.$u.toast(this.$t('page.purse.addressEmpty'))
  143. }
  144. uni.setClipboardData({
  145. data: content,
  146. success: () => {
  147. uni.showToast({
  148. title: this.$t('page.purse.copySuccess'),
  149. icon: 'none'
  150. })
  151. }
  152. })
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .purse {
  159. width: 750rpx;
  160. min-height: 100vh;
  161. margin: 0 auto;
  162. background-size: 100%;
  163. background-repeat: no-repeat;
  164. background: #f6f6f6;
  165. .content {
  166. width: 96%;
  167. margin: 0 auto;
  168. }
  169. .user-money {
  170. background: $uni-bg-color-app;
  171. margin: 20rpx auto 30rpx auto;
  172. border: 4rpx solid #D3EA5E;
  173. border: 4rpx solid $uni-bg-color-app;
  174. padding: 60rpx 0rpx;
  175. font-size: 36rpx;
  176. color: $uni-bg-color;
  177. border-top-right-radius: 60rpx;
  178. .title,
  179. .money {
  180. display: flex;
  181. align-items: flex-end;
  182. height: 60rpx;
  183. font-size: 28rpx;
  184. color: hsla(0, 0%, 100%, .8);
  185. box-sizing: border-box;
  186. padding-left: 30rpx;
  187. .money-unit {
  188. margin-right: 15rpx;
  189. font-size: 28rpx;
  190. font-weight: bold;
  191. color: white;
  192. }
  193. .money-detail{
  194. font-size: 50rpx;
  195. font-weight: bold;
  196. color: white;
  197. }
  198. }
  199. }
  200. .purse-input{
  201. background: white;
  202. border-radius: 20rpx;
  203. padding: 30rpx;
  204. margin-bottom: 15rpx;
  205. box-sizing: border-box;
  206. .title{
  207. padding-bottom: 30rpx;
  208. }
  209. .text{}
  210. .btn{
  211. display: flex;
  212. align-items: center;
  213. justify-content: center;
  214. background: black;
  215. color: white;
  216. height: 60rpx;
  217. border-radius: 100rpx;
  218. font-size: 30rpx;
  219. margin-top: 30rpx;
  220. }
  221. .image{
  222. width: 150rpx;
  223. height: 150rpx;
  224. border: 1px solid #333;
  225. border-radius: 10rpx;
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. margin-left: 10rpx;
  230. }
  231. }
  232. .submit-btn{
  233. background: rgb(0, 208, 234);
  234. height: 80rpx;
  235. border-radius: 20rpx;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. color: white;
  240. font-size: 30rpx;
  241. }
  242. .steps {
  243. width: 90%;
  244. margin: 0rpx auto;
  245. padding-top: 30rpx;
  246. .steps-title {
  247. font-size: 30rpx;
  248. }
  249. .steps-content {
  250. color: #8e8e98;
  251. font-size: 30rpx;
  252. margin-top: 20rpx;
  253. }
  254. }
  255. }
  256. </style>