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.

239 lines
5.9 KiB

10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <!-- 修改用户信息(二合一) -->
  2. <template>
  3. <view class="modify-user">
  4. <navbar :leftClick="leftClick"></navbar>
  5. <!-- 修改钱包地址 -->
  6. <view class="edit-user content" v-if="$route.query.type == 2">
  7. <view class="edit-list">
  8. <view class="edit-item">
  9. <view class="title">{{ $t('page.modifyUser.network') }}</view>
  10. <input type="text" disabled value="USDT-TRC20" />
  11. </view>
  12. <view class="edit-item" v-if="userInfo.moneyAddress">
  13. <view class="title">{{ $t('page.center.wallet') }}</view>
  14. <input type="text"
  15. disabled
  16. :placeholder="$t('page.modifyUser.wallet-placeholder')"
  17. v-model="form.moneyAddress" />
  18. </view>
  19. <view class="edit-item" v-else>
  20. <view class="title">{{ $t('page.center.wallet') }}</view>
  21. <input type="text"
  22. :placeholder="$t('page.modifyUser.wallet-placeholder')"
  23. v-model="form.moneyAddress" />
  24. </view>
  25. <view class="edit-item">
  26. <view class="title">{{ $t('page.modifyUser.payment') }}</view>
  27. <input type="password" :placeholder="$t('page.modifyUser.payment-placeholder')"
  28. v-model="form.newPassword" />
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 修改pin -->
  33. <view class="edit-user content" v-else>
  34. <view class="edit-list">
  35. <view class="edit-item">
  36. <view class="title">{{ $t('page.modifyUser.oldPassword') }}</view>
  37. <input type="password" v-model="form.oldPassword" />
  38. </view>
  39. <view class="edit-item">
  40. <view class="title">{{ $t('page.modifyUser.newPassword') }}</view>
  41. <input type="password" v-model="form.newPassword" />
  42. </view>
  43. <!-- <view class="edit-item">
  44. <view class="title">{{ $t('page.modifyUser.confirmNewPassword') }}</view>
  45. <input type="text" :placeholder="$t('page.modifyUser.newPassword')" v-model="form.confirmNewPassword"/>
  46. </view> -->
  47. </view>
  48. </view>
  49. <!-- <view class="box">
  50. <view class="edit-item">
  51. <view class="title">{{ $t('page.modifyUser.oldPassword') }}</view>
  52. <input type="text" :placeholder="$t('page.modifyUser.oldPasswordPlaceholder')" v-model="form.oldPassword"/>
  53. </view>
  54. <view class="edit-item">
  55. <view class="title">{{ $t('page.modifyUser.newPassword') }}</view>
  56. <input type="text" :placeholder="$t('page.modifyUser.newPasswordPlaceholder')" v-model="form.newPassword"/>
  57. </view>
  58. </view> -->
  59. <!-- 提交按钮 -->
  60. <view class="confirm content"
  61. v-if="!userInfo.moneyAddress || $route.query.type != 2"
  62. @click="submit">{{ $t('page.modifyUser.confirm') }}</view>
  63. <!-- 提示信息 -->
  64. <!-- <view class="tips content">{{ $t(`page.modifyUser.${tips[$route.query.type]}`) }}</view> -->
  65. </view>
  66. </template>
  67. <script>
  68. import navbar from '@/components/base/m-navbar.vue'
  69. export default {
  70. components: {
  71. navbar
  72. },
  73. data() {
  74. return {
  75. titles: ['editPinTitle', 'editPasswordTitle'],
  76. tips: ['pinTips', 'passwordTips'],
  77. form: {
  78. oldPassword: '',
  79. newPassword: '',
  80. confirmNewPassword: '',
  81. moneyAddress : ''
  82. },
  83. userInfo: {
  84. moneyAddress : '123'
  85. },
  86. }
  87. },
  88. onShow() {
  89. this.getUserInfo()
  90. },
  91. methods: {
  92. leftClick() {
  93. uni.navigateTo({
  94. url: '/pages/center/center'
  95. })
  96. },
  97. //获取用户信息
  98. getUserInfo() {
  99. this.request('userInfo').then(res => {
  100. if (res.code == 200) {
  101. this.userInfo = res.result.userInfo
  102. this.vipInfo = res.result.vip
  103. this.form.moneyAddress = this.userInfo.moneyAddress
  104. }
  105. })
  106. },
  107. //提交
  108. submit() {
  109. this.$play()
  110. if (this.$route.query.type == 0) { //修改pin逻辑
  111. this.request('editPayPass', {}, {
  112. oldPayPass: this.form.oldPassword,
  113. payPass: this.form.newPassword,
  114. okPayPass: this.form.confirmNewPassword,
  115. }).then(res => {
  116. if (res.code == 200) {
  117. console.log(res.message);
  118. uni.$u.toast(this.$t(`message.${res.message}`))
  119. setTimeout(() => uni.navigateTo({
  120. url: '/pages/center/center'
  121. }), 1000)
  122. }
  123. })
  124. } else if (this.$route.query.type == 1) { //修改密码逻辑
  125. this.request('editPass', {}, {
  126. oldPass: this.form.oldPassword,
  127. password: this.form.newPassword,
  128. okPassword: this.form.confirmNewPassword,
  129. }).then(res => {
  130. if (res.code == 200) {
  131. uni.$u.toast(this.$t(`message.${res.message}`))
  132. setTimeout(() => uni.navigateTo({
  133. url: '/pages/center/center'
  134. }), 1000)
  135. }
  136. })
  137. } else { //修改钱包地址
  138. this.request('editMoneyAddress', {}, {
  139. moneyAddress : this.form.moneyAddress,
  140. payPass : this.form.newPassword
  141. }).then(res => {
  142. if (res.code == 200) {
  143. uni.$u.toast(this.$t(`message.${res.message}`))
  144. setTimeout(() => uni.navigateTo({
  145. url: '/pages/center/center'
  146. }), 500)
  147. }
  148. })
  149. }
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .modify-user {
  156. width: 750rpx;
  157. min-height: 100vh;
  158. // background-color: black;
  159. margin: 0 auto;
  160. background-size: 100%;
  161. background-repeat: no-repeat;
  162. .content {
  163. width: 96%;
  164. margin: 0 auto;
  165. }
  166. .edit-user {
  167. padding-top: 20rpx;
  168. .edit-list {
  169. .edit-item {
  170. box-sizing: border-box;
  171. padding: 15rpx;
  172. display: flex;
  173. align-items: center;
  174. border-bottom: 1px solid #33333333;
  175. .title {
  176. color: $uni-text-color;
  177. font-size: 28rpx;
  178. margin-top: 10rpx;
  179. min-width: 25%;
  180. }
  181. input {
  182. color: $uni-text-color;
  183. text-indent: 1em;
  184. height: 60rpx;
  185. font-size: 28rpx;
  186. margin-top: 15rpx;
  187. }
  188. }
  189. }
  190. }
  191. .confirm {
  192. display: flex;
  193. align-items: center;
  194. justify-content: center;
  195. background: $uni-bg-color-app;
  196. margin: 30rpx auto;
  197. border-radius: 20rpx;
  198. height: 100rpx;
  199. font-size: 35rpx;
  200. font-weight: bold;
  201. color: $uni-text-color-inverse;
  202. }
  203. .tips {
  204. color: rgb(191, 118, 112);
  205. text-align: center;
  206. font-size: 26rpx;
  207. padding: 0rpx 20rpx;
  208. box-sizing: border-box;
  209. }
  210. }
  211. </style>