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.

345 lines
7.7 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
8 months ago
9 months ago
8 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
8 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">{{ $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">{{ addressInfo[$store.state.key[$i18n.locale]] }}</view>
  16. <view @click="copy(addressInfo[$store.state.key[$i18n.locale]])" 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 class="steps-content" v-html="$t('page.purse.steps-content')">
  44. <!-- <u-parse :content="$t('page.purse.steps-content')"></u-parse> -->
  45. </view>
  46. </view>
  47. <!-- 客服列表 -->
  48. <serviceList :show="showService" :serverList="serverList" @close="closeServiceList"></serviceList>
  49. <sTabbar select="100" />
  50. </view>
  51. </template>
  52. <script>
  53. import navbar from '@/components/base/m-navbar.vue'
  54. import serviceList from '@/components/serviceList/serviceList.vue';
  55. import sTabbar from '@/components/base/tabBar.vue'
  56. export default {
  57. components: {
  58. navbar,
  59. serviceList,
  60. sTabbar
  61. },
  62. data() {
  63. return {
  64. active : 0,
  65. money : '',
  66. form : {
  67. id : '',
  68. image : '',
  69. money : ''
  70. },
  71. serverList : [],
  72. showService : false,
  73. userInfo : {},
  74. addressInfo : {}
  75. }
  76. },
  77. onShow() {
  78. this.getUserInfo()
  79. this.forgetPass()
  80. this.getPayUrl()
  81. },
  82. methods: {
  83. // leftClick() {
  84. // if(this.$route.query.type){
  85. // return uni.navigateTo({
  86. // url: '/pages/home/home'
  87. // })
  88. // }else{
  89. // uni.navigateTo({
  90. // url: '/pages/center/center'
  91. // })
  92. // }
  93. // },
  94. getPayUrl(){
  95. this.request('getPayUrl').then(res => {
  96. if(res.code == 200){
  97. this.addressInfo = res.result
  98. }
  99. })
  100. },
  101. uploadImage(){
  102. let self = this
  103. this.$Oss.ossUploadImage({
  104. success(res) {
  105. self.form.image = JSON.parse(res.data).message
  106. }
  107. })
  108. },
  109. //获取用户信息
  110. getUserInfo(){
  111. this.request('userInfo').then(res => {
  112. if(res.code == 200){
  113. this.userInfo = res.result.userInfo
  114. this.money = res.result.userInfo.money
  115. }
  116. })
  117. },
  118. //充值
  119. recharge(){
  120. this.$play()
  121. let { money , image } = this.form
  122. if(!money.trim()){
  123. return uni.showToast({ icon: 'none' , title : this.$t('page.purse.money-empty') })
  124. }
  125. if(!image.trim()){
  126. return uni.showToast({ icon: 'none' , title : this.$t('page.purse.image-empty') })
  127. }
  128. if(!this.userInfo.moneyAddress){
  129. return uni.showToast({ icon: 'none' , title : this.$t('page.purse.address-empty') })
  130. }
  131. this.form.moneyAddress = this.userInfo.moneyAddress;
  132. this.request('recharge2',{},this.form).then(res => {
  133. if(res.code == 200){
  134. // uni.$u.toast(this.$t('page.purse.success'))
  135. // uni.showModal({
  136. // title: this.$t('page.purse.success'),
  137. // success: (res) => {
  138. // if (res.confirm) {
  139. // } else if (res.cancel) {
  140. // }
  141. // this.revealServiceList()
  142. // }
  143. // });
  144. uni.showToast({
  145. icon: 'none',
  146. title: this.$t('page.purse.success')
  147. })
  148. setTimeout(() => {
  149. uni.navigateTo({
  150. url: '/pages/center/center'
  151. })
  152. },800)
  153. this.cleanForm()
  154. this.getUserInfo() //刷新用户信息(更新用户余额)
  155. }
  156. })
  157. },
  158. //显示客服列表
  159. revealServiceList(){
  160. this.$play()
  161. this.showService = true;
  162. },
  163. //关闭客服列表
  164. closeServiceList(){
  165. this.showService = false;
  166. },
  167. //忘记密码(获取客服列表)
  168. forgetPass(){
  169. this.request('forgetPass').then(res => {
  170. if(res.code == 200){
  171. this.serverList = res.result
  172. }
  173. })
  174. },
  175. //清空表单数据
  176. cleanForm(){
  177. this.form = {
  178. }
  179. },
  180. //复制内容
  181. copy(content) {
  182. if(!content){
  183. return uni.$u.toast(this.$t('page.purse.addressEmpty'))
  184. }
  185. uni.setClipboardData({
  186. data: content,
  187. success: () => {
  188. uni.showToast({
  189. title: this.$t('page.purse.copySuccess'),
  190. icon: 'none'
  191. })
  192. }
  193. })
  194. }
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .purse {
  200. width: 750rpx;
  201. min-height: 100vh;
  202. margin: 0 auto;
  203. background-size: 100%;
  204. background-repeat: no-repeat;
  205. background: #f6f6f6;
  206. padding-bottom: 300px;
  207. .content {
  208. width: 96%;
  209. margin: 0 auto;
  210. }
  211. .user-money {
  212. background: $uni-bg-color-app;
  213. margin: 20rpx auto 30rpx auto;
  214. border: 4rpx solid #D3EA5E;
  215. border: 4rpx solid $uni-bg-color-app;
  216. padding: 60rpx 0rpx;
  217. font-size: 36rpx;
  218. color: $uni-bg-color;
  219. border-top-right-radius: 60rpx;
  220. .title,
  221. .money {
  222. display: flex;
  223. align-items: flex-end;
  224. height: 60rpx;
  225. font-size: 28rpx;
  226. color: hsla(0, 0%, 100%, .8);
  227. box-sizing: border-box;
  228. padding-left: 30rpx;
  229. .money-unit {
  230. margin-right: 15rpx;
  231. font-size: 28rpx;
  232. font-weight: bold;
  233. color: white;
  234. }
  235. .money-detail{
  236. font-size: 50rpx;
  237. font-weight: bold;
  238. color: white;
  239. }
  240. }
  241. }
  242. .purse-input{
  243. background: white;
  244. border-radius: 20rpx;
  245. padding: 30rpx;
  246. margin-bottom: 15rpx;
  247. box-sizing: border-box;
  248. .title{
  249. padding-bottom: 30rpx;
  250. }
  251. .text{}
  252. .btn{
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. background: black;
  257. color: white;
  258. height: 60rpx;
  259. border-radius: 100rpx;
  260. font-size: 30rpx;
  261. margin-top: 30rpx;
  262. }
  263. image{
  264. width: 150rpx;
  265. height: 150rpx;
  266. border-radius: 10rpx;
  267. }
  268. .image{
  269. width: 150rpx;
  270. height: 150rpx;
  271. border: 1px solid #333;
  272. border-radius: 10rpx;
  273. display: flex;
  274. justify-content: center;
  275. align-items: center;
  276. margin-left: 10rpx;
  277. }
  278. }
  279. .submit-btn{
  280. background: rgb(0, 208, 234);
  281. height: 80rpx;
  282. border-radius: 20rpx;
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. color: white;
  287. font-size: 30rpx;
  288. }
  289. .steps {
  290. width: 90%;
  291. margin: 0rpx auto;
  292. padding-top: 30rpx;
  293. .steps-title {
  294. font-size: 30rpx;
  295. }
  296. .steps-content {
  297. color: #8e8e98;
  298. font-size: 30rpx;
  299. margin-top: 20rpx;
  300. }
  301. }
  302. }
  303. </style>