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.

311 lines
6.8 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year 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">{{ $t('page.purse.balance') }}</view>
  8. <view class="money">
  9. <view class="money-unit">{{ $store.state.unit }}</view>
  10. <view class="money-detail">{{ money }}</view>
  11. </view>
  12. </view>
  13. <view class="purse-input content">
  14. <view class="title">{{ $t('page.purse.recharge-address') }}</view>
  15. <view class="text">{{ userInfo.moneyAddress }}</view>
  16. <view @click="copy(userInfo.moneyAddress)" class="btn">{{ $t('page.purse.copy') }}</view>
  17. </view>
  18. <view class="purse-input content">
  19. <view class="title">{{ $t('page.purse.recharge-amount') }}</view>
  20. <input v-model="form.money" type="number" :placeholder="$t('page.purse.recharge-amount-placeholder')" />
  21. </view>
  22. <view class="purse-input content">
  23. <view class="title">{{ $t('page.purse.upload') }}</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 @click="recharge" class="submit-btn content">{{ $t('page.purse.complete-top-up') }}</view>
  34. <view class="steps content">
  35. <view class="steps-title">{{ $t('page.purse.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. money : ''
  67. },
  68. serverList : [],
  69. showService : false,
  70. userInfo : {}
  71. }
  72. },
  73. onShow() {
  74. this.getUserInfo()
  75. this.forgetPass()
  76. },
  77. methods: {
  78. // leftClick() {
  79. // if(this.$route.query.type){
  80. // return uni.navigateTo({
  81. // url: '/pages/home/home'
  82. // })
  83. // }else{
  84. // uni.navigateTo({
  85. // url: '/pages/center/center'
  86. // })
  87. // }
  88. // },
  89. uploadImage(){
  90. let self = this
  91. this.$Oss.ossUploadImage({
  92. success(res) {
  93. self.form.image = res
  94. }
  95. })
  96. },
  97. //获取用户信息
  98. getUserInfo(){
  99. this.request('userInfo').then(res => {
  100. if(res.code == 200){
  101. this.userInfo = res.result.userInfo
  102. this.money = res.result.userInfo.money
  103. }
  104. })
  105. },
  106. //充值
  107. recharge(){
  108. this.$play()
  109. let { money , image } = this.form
  110. if(!money.trim()){
  111. return uni.showToast({ icon: 'none' , title : this.$t('page.purse.money-empty') })
  112. }
  113. if(!image.trim()){
  114. return uni.showToast({ icon: 'none' , title : this.$t('page.purse.image-empty') })
  115. }
  116. if(!this.userInfo.moneyAddress){
  117. return uni.showToast({ icon: 'none' , title : this.$t('page.purse.address-empty') })
  118. }
  119. this.form.moneyAddress = this.userInfo.moneyAddress;
  120. this.request('recharge2',{},this.form).then(res => {
  121. if(res.code == 200){
  122. uni.$u.toast(this.$t('page.purse.success'))
  123. this.cleanForm()
  124. this.revealServiceList()
  125. this.getUserInfo() //刷新用户信息(更新用户余额)
  126. }
  127. })
  128. },
  129. //显示客服列表
  130. revealServiceList(){
  131. this.$play()
  132. this.showService = true;
  133. },
  134. //关闭客服列表
  135. closeServiceList(){
  136. this.showService = false;
  137. },
  138. //忘记密码(获取客服列表)
  139. forgetPass(){
  140. this.request('forgetPass').then(res => {
  141. if(res.code == 200){
  142. this.serverList = res.result
  143. }
  144. })
  145. },
  146. //清空表单数据
  147. cleanForm(){
  148. this.form = {
  149. }
  150. },
  151. //复制内容
  152. copy(content) {
  153. if(!content){
  154. return uni.$u.toast(this.$t('page.purse.addressEmpty'))
  155. }
  156. uni.setClipboardData({
  157. data: content,
  158. success: () => {
  159. uni.showToast({
  160. title: this.$t('page.purse.copySuccess'),
  161. icon: 'none'
  162. })
  163. }
  164. })
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. .purse {
  171. width: 750rpx;
  172. min-height: 100vh;
  173. margin: 0 auto;
  174. background-size: 100%;
  175. background-repeat: no-repeat;
  176. background: #f6f6f6;
  177. padding-bottom: 150rpx;
  178. .content {
  179. width: 96%;
  180. margin: 0 auto;
  181. }
  182. .user-money {
  183. background: $uni-bg-color-app;
  184. margin: 20rpx auto 30rpx auto;
  185. border: 4rpx solid #D3EA5E;
  186. border: 4rpx solid $uni-bg-color-app;
  187. padding: 60rpx 0rpx;
  188. font-size: 36rpx;
  189. color: $uni-bg-color;
  190. border-top-right-radius: 60rpx;
  191. .title,
  192. .money {
  193. display: flex;
  194. align-items: flex-end;
  195. height: 60rpx;
  196. font-size: 28rpx;
  197. color: hsla(0, 0%, 100%, .8);
  198. box-sizing: border-box;
  199. padding-left: 30rpx;
  200. .money-unit {
  201. margin-right: 15rpx;
  202. font-size: 28rpx;
  203. font-weight: bold;
  204. color: white;
  205. }
  206. .money-detail{
  207. font-size: 50rpx;
  208. font-weight: bold;
  209. color: white;
  210. }
  211. }
  212. }
  213. .purse-input{
  214. background: white;
  215. border-radius: 20rpx;
  216. padding: 30rpx;
  217. margin-bottom: 15rpx;
  218. box-sizing: border-box;
  219. .title{
  220. padding-bottom: 30rpx;
  221. }
  222. .text{}
  223. .btn{
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. background: black;
  228. color: white;
  229. height: 60rpx;
  230. border-radius: 100rpx;
  231. font-size: 30rpx;
  232. margin-top: 30rpx;
  233. }
  234. image{
  235. width: 150rpx;
  236. height: 150rpx;
  237. border-radius: 10rpx;
  238. }
  239. .image{
  240. width: 150rpx;
  241. height: 150rpx;
  242. border: 1px solid #333;
  243. border-radius: 10rpx;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. margin-left: 10rpx;
  248. }
  249. }
  250. .submit-btn{
  251. background: rgb(0, 208, 234);
  252. height: 80rpx;
  253. border-radius: 20rpx;
  254. display: flex;
  255. align-items: center;
  256. justify-content: center;
  257. color: white;
  258. font-size: 30rpx;
  259. }
  260. .steps {
  261. width: 90%;
  262. margin: 0rpx auto;
  263. padding-top: 30rpx;
  264. .steps-title {
  265. font-size: 30rpx;
  266. }
  267. .steps-content {
  268. color: #8e8e98;
  269. font-size: 30rpx;
  270. margin-top: 20rpx;
  271. }
  272. }
  273. }
  274. </style>