register.vue 8.7 KB

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