register.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <!-- 注册 -->
  2. <template>
  3. <view id="register">
  4. <view class="register_li" v-if="pageStatus==0">
  5. <view class="register_li_min">
  6. <view>*</view>
  7. <view>登录账号:</view>
  8. <input v-model="form.sysUserDto.userName" type="text" placeholder-style="color:#999;" placeholder="请输入登录账号">
  9. </view>
  10. <view class="register_li_min">
  11. <view>*</view>
  12. <view>登录密码:</view>
  13. <input v-model="form.sysUserDto.password" type="text" placeholder-style="color:#999;" placeholder="请输入登录密码">
  14. </view>
  15. <view class="register_li_min" style="border-bottom:0;">
  16. <view>*</view>
  17. <view>确认密码:</view>
  18. <input v-model="form.sysUserDto.repassword" type="text" placeholder-style="color:#999;" placeholder="请再次确认密码">
  19. </view>
  20. </view>
  21. <view class="register_li">
  22. <view class="register_li_min">
  23. <view>*</view>
  24. <view>企业名称:</view>
  25. <input v-model="form.companyName" @blur="nameCheck()" maxlength="20"type="text" placeholder-style="color:#999;" placeholder="请输入供应商名称">
  26. </view>
  27. <view class="register_li_min">
  28. <view style="margin-left: 12rpx;"></view>
  29. <view>企业简称:</view>
  30. <input v-model="form.companyShort" maxlength="10" type="text" placeholder-style="color:#999;" placeholder="请输入供应商简称">
  31. </view>
  32. <view class="register_li_min" >
  33. <view>*</view>
  34. <view>联系人:</view>
  35. <input v-model="form.contacts" maxlength="10" type="text" placeholder-style="color:#999;" placeholder="请输入联系人姓名">
  36. </view>
  37. <view class="register_li_min" >
  38. <view>*</view>
  39. <view>联系方式:</view>
  40. <input v-model="form.phone" type="text" placeholder-style="color:#999;" placeholder="请输入联系方式">
  41. </view>
  42. <view class="register_li_min" style="border-bottom:0;">
  43. <view style="margin-left: 12rpx;"></view>
  44. <view>经营地址:</view>
  45. <input v-model="form.businessAddress" maxlength="30" type="text" placeholder-style="color:#999;" placeholder="请输入经营地址">
  46. </view>
  47. </view>
  48. <view class="sub_btn" @click="nextStep()">下一步</view>
  49. </view>
  50. </template>
  51. <script>
  52. import {supplierCheck,supplierDetail} from '@/api/index.js'
  53. import { config } from '@/api/request/config.js'
  54. export default {
  55. data() {
  56. return {
  57. form:{
  58. sysUserDto:{
  59. userName:'',
  60. password:'',
  61. repassword:'',
  62. },
  63. companyName:'',
  64. companyShort:'',
  65. contacts:'',
  66. phone:'',
  67. businessAddress:'',
  68. id:'',
  69. },
  70. pageStatus:null,//判断是从那个页面进入 0登录页,1驳回页面
  71. license:null,//证件数据
  72. }
  73. },
  74. onLoad(option) {
  75. this.pageStatus=option.pageStatus;
  76. },
  77. onShow(){
  78. },
  79. methods: {
  80. //校验企业名称是否重复
  81. async nameCheck(){
  82. const {data} = await supplierCheck({name:this.form.companyName,})
  83. let res=data.data
  84. if(data.code==200){
  85. }
  86. },
  87. //获取详情
  88. async getInfo(){
  89. let _this = this;
  90. const {data} = await supplierDetail()
  91. let res=data.data
  92. if(data.code==200){
  93. this.form.id=res.id
  94. this.form.companyName=res.companyName
  95. this.form.companyShort=res.companyShort
  96. this.form.contacts=res.contacts
  97. this.form.phone=res.phone
  98. this.form.businessAddress=res.businessAddress
  99. this.license=res.qpSupplierCredentialsVos
  100. }
  101. },
  102. nextStep(){
  103. let _this = this;
  104. if(!this.form.sysUserDto.userName && this.pageStatus==0){
  105. uni.showToast({
  106. title: '请输入登陆账号',
  107. icon:"none",
  108. mask:true,
  109. duration: 2000
  110. });
  111. return
  112. }
  113. if(this.form.sysUserDto.userName){
  114. if(_this.form.sysUserDto.userName.length<6 || _this.form.sysUserDto.userName.length>16){
  115. uni.showToast({
  116. title: '登录账号不能超出16位、不能低于6位',
  117. icon:"none",
  118. mask:true,
  119. duration: 2000
  120. });
  121. form.sysUserDto.userName='';
  122. return
  123. }
  124. let reg=/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]|[`~@!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】、;‘’,。、\s+]/;
  125. let aa= reg.test(_this.form.sysUserDto.userName)
  126. if(reg.test(_this.form.sysUserDto.userName)){
  127. uni.showToast({
  128. title: '登录密码中有中文,空格或特殊字符,请重新输入!',
  129. icon:"none",
  130. mask:true,
  131. duration: 2000
  132. });
  133. _this.form.sysUserDto.userName='';
  134. return
  135. }
  136. }
  137. if(!this.form.sysUserDto.password && this.pageStatus==0){
  138. uni.showToast({
  139. title: '请输入登陆密码',
  140. icon:"none",
  141. mask:true,
  142. duration: 2000
  143. });
  144. return
  145. }
  146. if(_this.form.sysUserDto.password){
  147. if(_this.form.sysUserDto.password.length<6 || _this.form.sysUserDto.password.length>16){
  148. uni.showToast({
  149. title: '登录密码不能超出16位、不能低于6位',
  150. icon:"none",
  151. mask:true,
  152. duration: 2000
  153. });
  154. _this.form.sysUserDto.password='';
  155. return
  156. }
  157. let reg=/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]|[`~@!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】、;‘’,。、\s+]/;
  158. let aa= reg.test(this.form.sysUserDto.password)
  159. if(reg.test(this.form.sysUserDto.password)){
  160. uni.showToast({
  161. title: '登录密码中有中文,空格或特殊字符,请重新输入!',
  162. icon:"none",
  163. mask:true,
  164. duration: 2000
  165. });
  166. this.form.sysUserDto.password='';
  167. return
  168. }
  169. }
  170. if(!this.form.sysUserDto.repassword && this.pageStatus==0){
  171. uni.showToast({
  172. title: '请输入确认密码',
  173. icon:"none",
  174. mask:true,
  175. duration: 2000
  176. });
  177. return
  178. }
  179. if(this.form.sysUserDto.password!==this.form.sysUserDto.repassword){
  180. uni.showToast({
  181. title: '密码输入不一致,请重新输入!',
  182. icon:"none",
  183. mask:true,
  184. duration: 2000
  185. });
  186. return
  187. }
  188. if(!this.form.companyName){
  189. uni.showToast({
  190. title: '请输入企业名称',
  191. icon:"none",
  192. mask:true,
  193. duration: 2000
  194. });
  195. return
  196. }
  197. if(!this.form.contacts){
  198. uni.showToast({
  199. title: '请输入联系人',
  200. icon:"none",
  201. mask:true,
  202. duration: 2000
  203. });
  204. return
  205. }
  206. if(!this.form.phone){
  207. uni.showToast({
  208. title: '请输入手机号码',
  209. icon:"none",
  210. mask:true,
  211. duration: 2000
  212. });
  213. return
  214. }
  215. if(this.form.phone){
  216. let reg=/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(16[0-9])|(17[0,3,5-8])|(18[0-9])|(147))+\d{8}$/;
  217. let aa= reg.test(this.form.phone)
  218. if(!reg.test(this.form.phone)){
  219. uni.showToast({
  220. title: '请输入正确的手机号!',
  221. icon:"none",
  222. mask:true,
  223. duration: 2000
  224. });
  225. this.form.phone='';
  226. return
  227. }
  228. }
  229. uni.navigateTo({
  230. url: '/pages_supplier/register/registerTow?form='+encodeURIComponent(JSON.stringify(this.form))+'&license='+encodeURIComponent(JSON.stringify(this.license)),//安全检查
  231. });
  232. },
  233. },
  234. mounted(){
  235. if(this.pageStatus==1){
  236. this.getInfo();
  237. }
  238. //
  239. },
  240. }
  241. </script>
  242. <style lang="stylus" scoped>
  243. #register{
  244. height:auto;
  245. width:100%;
  246. display flex
  247. flex-direction column;
  248. padding-bottom: 220rpx;
  249. .register_li{
  250. background #fff;
  251. border-radius:20rpx;
  252. margin:20rpx 20rpx 0;
  253. padding:20rpx 0;
  254. box-sizing: border-box;
  255. .register_li_min{
  256. margin:0 26rpx;
  257. display flex;
  258. align-items center;
  259. border-bottom: 1px solid #F5F5F5;
  260. view{
  261. line-height:100rpx;
  262. font-size:28rpx;
  263. }
  264. view:nth-child(1){
  265. color:red;
  266. line-height:28rpx;
  267. margin-right: 12rpx;
  268. }
  269. view:nth-child(2){
  270. width:160rpx;
  271. font-size: 28rpx;
  272. font-family: PingFang SC;
  273. font-weight: 500;
  274. color: #333333;
  275. }
  276. >input{
  277. width 460rpx;
  278. text-align: right;
  279. font-size: 24rpx;
  280. font-family: PingFang SC;
  281. font-weight: 500;
  282. color: #333333;
  283. }
  284. }
  285. }
  286. /* 按钮 */
  287. .sub_btn{
  288. width: 650rpx;
  289. height: 100rpx;
  290. background: #0183FA;
  291. border-radius: 20rpx;
  292. font-size: 28rpx;
  293. font-family: PingFang SC;
  294. font-weight: 500;
  295. color: #FFFFFF;
  296. line-height: 100rpx;
  297. text-align: center;
  298. margin-left: 50rpx;
  299. position: fixed;
  300. bottom:30rpx;
  301. z-index: 1000;
  302. }
  303. }
  304. /deep/.input-value-border{
  305. display :none !important;
  306. }
  307. </style>