setpassword.vue 5.6 KB

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