zhifubao.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <!-- v-if="shangxian =='否'" -->
  3. <view class="container">
  4. <!-- <list-cell title="收款人姓名" type="text" placeholder="请输入支付宝收款人姓名" v-model="userName"></list-cell>
  5. <list-cell title="支付宝账号" type="number" placeholder="请输入要绑定的支付宝手机号" v-model="mobile" :maxlength="11"></list-cell> -->
  6. <u-form :model="form" ref="uForm">
  7. <u-form-item label="收款人姓名" label-width="250"><u-input type="text" placeholder="请输入支付宝收款人姓名" v-model="userName" /></u-form-item>
  8. <u-form-item label="支付宝账号" label-width="250"><u-input type="text" placeholder="请输入要绑定的支付宝账号" v-model="mobile" /></u-form-item>
  9. </u-form>
  10. <button v-if="btn" class="confirm-btn" @click="toLogin" :disabled="logining">{{btn}}</button>
  11. <view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示:请正确填写收款人的支付宝账户和真实的收款人姓名,否则将无法正常收款</view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. mobile: '',
  20. userName: '',
  21. btn:'绑定账户',
  22. logining: false,
  23. form:{},
  24. shangxian: '是'
  25. }
  26. },
  27. onLoad() {
  28. let userId = this.$queue.getData("userId");
  29. this.shangxian = uni.getStorageSync('shangxian')
  30. if(this.shangxian !='否'){
  31. uni.setNavigationBarTitle({
  32. title: '隐私政策'
  33. });
  34. }else{
  35. uni.setNavigationBarTitle({
  36. title: '提现账户'
  37. });
  38. }
  39. if (userId) {
  40. let userId = this.$queue.getData('userId');
  41. this.$Request.getT("/app/user/selectUserDetails?userId=" + userId).then(res => {
  42. if (res.code === 0 && res.data) {
  43. if (res.data.zhiFuBao) {
  44. this.mobile = res.data.zhiFuBao;
  45. this.btn = '修改账户';
  46. }else{
  47. this.btn = '绑定账户';
  48. }
  49. if (res.data.zhiFuBaoName) {
  50. this.userName = res.data.zhiFuBaoName;
  51. uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
  52. uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
  53. }
  54. }else{
  55. this.btn = '绑定账户';
  56. }
  57. });
  58. }
  59. },
  60. methods: {
  61. inputChange(e) {
  62. const key = e.currentTarget.dataset.key;
  63. this[key] = e.detail.value;
  64. },
  65. navBack() {
  66. uni.navigateBack();
  67. },
  68. toLogin() {
  69. let userId = this.$queue.getData("userId");
  70. let token = uni.getStorageSync("token");
  71. const {
  72. mobile,
  73. userName
  74. } = this;
  75. if (!mobile) {
  76. this.$queue.showToast("请设置收款人支付宝账号");
  77. } else if (!userName) {
  78. this.$queue.showToast("请设置收款人姓名");
  79. } else {
  80. this.$queue.showLoading("修改中...");
  81. this.$Request.postJson("/app/user/updateUser",{
  82. zhiFuBao: mobile,
  83. zhiFuBaoName: userName
  84. }).then(
  85. res => {
  86. if (res.code === 0) {
  87. this.navBack();
  88. } else {
  89. this.$queue.showToast(res.msg)
  90. }
  91. uni.hideLoading();
  92. });
  93. }
  94. },
  95. },
  96. }
  97. </script>
  98. <style lang='scss'>
  99. page {
  100. background: #FFFFFF;
  101. }
  102. .container {
  103. padding: 32upx;
  104. position: relative;
  105. width: 100%;
  106. height: 100%;
  107. overflow: hidden;
  108. background: #fff;
  109. }
  110. .confirm-btn1 {
  111. width: 300px;
  112. height: 42px;
  113. line-height: 42px;
  114. border-radius: 30px;
  115. margin-top: 70upx;
  116. background: whitesmoke;
  117. color: grey;
  118. /* font-size: $font-lg; */
  119. &:after {
  120. border-radius: 60px;
  121. }
  122. }
  123. .wrapper {
  124. position: relative;
  125. z-index: 90;
  126. background: #fff;
  127. padding-bottom: 20px;
  128. }
  129. .back-btn {
  130. position: absolute;
  131. left: 20px;
  132. z-index: 9999;
  133. padding-top: var(--status-bar-height);
  134. top: 20px;
  135. font-size: 20px;
  136. /* color: $font-color-dark; */
  137. }
  138. .left-top-sign {
  139. font-size: 80px;
  140. /* color: $page-color-base; */
  141. position: relative;
  142. }
  143. .right-top-sign {
  144. position: absolute;
  145. top: 40px;
  146. right: -15px;
  147. z-index: 95;
  148. &:before,
  149. &:after {
  150. display: block;
  151. content: "";
  152. width: 20px;
  153. height: 40px;
  154. background: -moz-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
  155. background: -webkit-gradient(linear,
  156. left top,
  157. left right,
  158. color-stop(0, #fa4dbe),
  159. color-stop(100%, #fbaa58));
  160. background: -webkit-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
  161. background: -o-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
  162. background: -ms-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
  163. background: linear-gradient(to left, #fa4dbe 0, #fbaa58 100%);
  164. }
  165. &:before {
  166. transform: rotate(50deg);
  167. border-radius: 0 50px 0 0;
  168. }
  169. &:after {
  170. position: absolute;
  171. right: -198px;
  172. top: 0;
  173. transform: rotate(-50deg);
  174. border-radius: 50px 0 0 0;
  175. /* background: pink; */
  176. }
  177. }
  178. .left-bottom-sign {
  179. position: absolute;
  180. left: -270px;
  181. bottom: -320px;
  182. /*border: 100upx solid #d0d1fd;*/
  183. border-radius: 50%;
  184. padding: 90px;
  185. }
  186. .welcome {
  187. position: relative;
  188. left: 30px;
  189. top: -50px;
  190. font-size: 23px;
  191. color: #555;
  192. text-shadow: 1px 0px 1px rgba(0, 0, 0, .3);
  193. }
  194. .input-content {
  195. padding: 0 20px;
  196. }
  197. .input-item {
  198. display: flex;
  199. flex-direction: column;
  200. align-items: flex-start;
  201. justify-content: center;
  202. padding: 0 30px;
  203. /* background: $page-color-light; */
  204. height: 64px;
  205. border-radius: 4px;
  206. margin-bottom: 30px;
  207. &:last-child {
  208. margin-bottom: 0;
  209. }
  210. .tit {
  211. height: 30px;
  212. line-height: 28px;
  213. /* font-size: $font-sm+2upx;
  214. color: $font-color-base; */
  215. }
  216. input {
  217. height: 40px;
  218. /* font-size: $font-base + 2upx;
  219. color: $font-color-dark; */
  220. width: 100%;
  221. }
  222. }
  223. .confirm-btn {
  224. width: 300px;
  225. height: 42px;
  226. line-height: 42px;
  227. border-radius: 30px;
  228. margin-top: 70upx;
  229. background: #2474FF;
  230. color: #fff;
  231. /* font-size: $font-lg; */
  232. &:after {
  233. border-radius: 60px;
  234. }
  235. }
  236. .forget-section {
  237. /* font-size: $font-sm+2upx;
  238. color: $font-color-spec; */
  239. text-align: center;
  240. margin-top: 40px;
  241. }
  242. .register-section {
  243. position: fixed;
  244. left: 0;
  245. bottom: 30px;
  246. width: 100%;
  247. /* font-size: $font-sm+2upx;
  248. color: $font-color-base; */
  249. text-align: center;
  250. text {
  251. /* color: $font-color-spec; */
  252. margin-left: 10px;
  253. }
  254. }
  255. </style>