setpassword.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="content">
  3. <view class="headbox">
  4. <view class="numbercat">账号 {{account}}</view>
  5. </view>
  6. <view class="acountbox" >
  7. <view class="inacount">
  8. <text class="acoutitle">原密码</text>
  9. <input type="text" v-model="form.oldPassword" class="checkword" placeholder="至少6位数的字母数字组合的密码"
  10. placeholder-style="font-size:30rpx;color:#BEBDBB" password="true"/>
  11. </view>
  12. <view class="inacount">
  13. <text class="acoutitle">密码</text>
  14. <input type="text" v-model="form.newPassword" class="checkword" placeholder="至少6位数的字母数字组合的密码"
  15. placeholder-style="font-size:30rpx;color:#BEBDBB" password="true"/>
  16. </view>
  17. <view class="inacount">
  18. <text class="acoutitle">确认密码</text>
  19. <input type="text" v-model="form.password" class="checkword" placeholder="至少6位数的字母数字组合的密码"
  20. placeholder-style="font-size:30rpx;color:#BEBDBB" password="true"/>
  21. </view>
  22. <view class=" fonas">
  23. <text>*密码必须是6-16位的英文字母、数字组合</text>
  24. <text @click="forgetPwd" style="color: #D8AB5A;">忘记原密码?</text>
  25. </view>
  26. <view class="logininbtn" @click="suerChange">
  27. <text>确认修改</text>
  28. </view>
  29. </view>
  30. <u-popup :show="show" @close="close" @open="open" mode="center">
  31. <view class="forgetbox">
  32. <!-- <view class="ciclebg">
  33. <image src="../../static/img/forpwdbg.png" mode="aspectFill"></image>
  34. </view> -->
  35. <view class="keybox">
  36. <image src="../../static/img/foricon.png" mode="aspectFill"></image>
  37. </view>
  38. <text class="keytitle">忘记密码</text>
  39. <text class="remindtitle">请电联系管理员,进行密码确定</text>
  40. <view class="surebtn" @click="close()">好的</view>
  41. </view>
  42. </u-popup>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. show: false,
  50. account:'',
  51. form: {
  52. oldPassword:'',
  53. newPassword:'',
  54. password:''
  55. },
  56. }
  57. },
  58. onLoad(o) {
  59. if (o.account) {
  60. this.account = o.account
  61. }
  62. },
  63. methods: {
  64. close() {
  65. this.show = false
  66. },
  67. suerChange(){
  68. if(this.form.oldPassword.length==0){
  69. this.$toast("请输入至少6位数的字母数字组合的密码")
  70. return
  71. }
  72. if(this.form.newPassword.length<6){
  73. this.$toast("请输入至少6位数的字母数字组合的密码")
  74. return
  75. }
  76. if(this.form.password.length<6){
  77. this.$toast("请输入至少6位数的字母数字组合的密码")
  78. return
  79. }
  80. if(this.form.newPassword!=this.form.password){
  81. this.$toast("两次密码输入不一样")
  82. return
  83. }
  84. uni.showLoading()
  85. let form=this.form
  86. delete form.password
  87. uni.$u.http.post('/api/Supplier/password',form, {
  88. custom: {
  89. auth: true
  90. }
  91. }).then((res) => {
  92. uni.hideLoading()
  93. this.form={
  94. oldPassword:'',
  95. newPassword:'',
  96. password:''
  97. }
  98. this.$toast("修改成功")
  99. }).catch((err) => {
  100. console.log(err)
  101. uni.hideLoading()
  102. this.$toast(err.msg)
  103. })
  104. },
  105. forgetPwd(){
  106. this.show = true
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .content {
  113. padding: 0 30rpx;
  114. box-sizing: border-box;
  115. }
  116. .fonas{
  117. display: flex;
  118. justify-content: space-between;
  119. font-size: 24rpx;
  120. padding-top: 20rpx;
  121. }
  122. .headbox {
  123. display: flex;
  124. justify-content: center;
  125. margin: 60rpx auto;
  126. .numbercat{
  127. padding: 15rpx 20rpx;
  128. border-radius: 50rpx;
  129. background-color: #FFF8E5;
  130. color: #1F242A;
  131. font-size: 28rpx;
  132. }
  133. }
  134. .acountbox {
  135. .upmsg{
  136. margin-top: 20rpx;
  137. background-color: #F6F6F6;
  138. width: 690rpx;
  139. height: 399rpx;
  140. border-radius: 20rpx;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. }
  145. .uppic{
  146. display: flex;
  147. align-items: center;
  148. justify-content: center;
  149. width: 500rpx;
  150. height: 250rpx;
  151. background-image: url("@/static/img/upuer.png");
  152. background-size: 100%;
  153. }
  154. .inacount {
  155. flex: 1;
  156. display: flex;
  157. padding: 35rpx 20rpx;
  158. box-sizing: border-box;
  159. // width: 606rpx;
  160. margin-top: 40rpx;
  161. background-color: #F6F6F6;
  162. border-radius: 20rpx;
  163. font-size: 30rpx;
  164. color: #1F242A;
  165. input {
  166. width: 460rpx;
  167. }
  168. }
  169. .acoutitle {
  170. font-weight: 600;
  171. }
  172. .checkword {
  173. padding-left: 20rpx;
  174. color: #1F242A;
  175. font-size: 30rpx;
  176. }
  177. }
  178. .logininbtn {
  179. margin-top: 140rpx;
  180. // width: 606rpx;
  181. box-sizing: border-box;
  182. flex: 1;
  183. border-radius: 20rpx;
  184. border: 1rpx solid #BEBDBB;
  185. height: 100rpx;
  186. text-align: center;
  187. color: #BEBDBB;
  188. line-height: 100rpx;
  189. margin-bottom: 100rpx;
  190. }
  191. .acountall {
  192. display: flex;
  193. justify-content: flex-end;
  194. margin-top: 30rpx;
  195. font-size: 24rpx;
  196. }
  197. .checkag {
  198. margin-top: 200rpx;
  199. font-size: 28rpx;
  200. margin-bottom: 150rpx;
  201. }
  202. .forgetbox{
  203. width: 600rpx;
  204. height: 600rpx;
  205. background-color: #fff;
  206. display: flex;
  207. flex-direction: column;
  208. align-items: center;
  209. position: relative;
  210. background-image: url("@/static/img/forpwdbg.png") ;
  211. background-repeat: no-repeat;
  212. background-position: right 0 top 0;
  213. background-size:367rpx 225rpx;
  214. .ciclebg{
  215. position: relative;
  216. right: 0;
  217. top: 0;
  218. width: 367rpx;
  219. height: 225rpx;
  220. }
  221. .keybox{
  222. margin-top: 84rpx;
  223. width: 196rpx;
  224. height: 161rpx;
  225. image{
  226. width: 100%;
  227. height: 100%;
  228. }
  229. }
  230. .keytitle{
  231. color: #1F242A;
  232. padding-top: 50rpx;
  233. font-size: 36rpx;
  234. font-weight: 600;
  235. }
  236. .remindtitle{
  237. color: #68625B;
  238. font-size: 28rpx;
  239. padding-top: 30rpx;
  240. }
  241. .surebtn{
  242. width: 314rpx;
  243. height: 84rpx;
  244. line-height: 84rpx;
  245. border-radius: 43rpx;
  246. background: linear-gradient(to right,#FFE1AD,#D8AB5A);
  247. color: #412900;
  248. margin-top: 86rpx;
  249. text-align: center;
  250. }
  251. }
  252. </style>