zhifubao.vue 6.1 KB

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