RegisterView.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <view class="">
  3. <customNav :shownav="true" :title="$t('user.zhuce')" tinColor="#386EF5" jiantou="0"></customNav>
  4. <view class="contentV">
  5. <view class="yzmctV">
  6. <input class="noinputVcode" type="nickname" :placeholder="$t('user.qsrzhanghao')" @input="dengluzhangh">
  7. </view>
  8. <view class="yzmctV">
  9. <input class="noinputVcode" password type="text" :placeholder="$t('user.qingshurmim')" :password="true" @input="denglumimaA">
  10. </view>
  11. <view class="yzmctV">
  12. <input class="noinputVcode" password type="text" :placeholder="$t('user.qingzaisryc')" :password="true" @input="denglumimaB">
  13. </view>
  14. <view class="yzmctV">
  15. <view class="xialakuangct" @click="popgjm">
  16. <text>{{guojiadaima}}</text>
  17. <image style="width: 36rpx;height: 36rpx;padding-right: 16rpx;" src="/static/imags/xiala@3x.png" mode="scaleToFill"></image>
  18. </view>
  19. <input class="noinputV" type="number" :placeholder="$t('user.qsrshouihao')" @input="phoneinput">
  20. </view>
  21. <!-- <view class="yzmctV noinputVcode">
  22. <input class="" type="text" :placeholder="$t('user.yanzhengma')" @input="smsCodeinput">
  23. <label class="yzmbt" @click="getSMScode">{{yanzmnote}}</label>
  24. </view> -->
  25. <view class="yzmctV">
  26. <view class="contentInRowL xiahuax" style="align-items: center;" @click="liucheng">
  27. <uni-icons custom-prefix="custom-icon" color="black" type="info-filled" size="26" @click="leftbuttonsel(4)"></uni-icons>
  28. <text style="margin-left: 8rpx;">{{$t('RegisterView.zucelc')}}</text>
  29. </view>
  30. </view>
  31. <view class="yzmctV">
  32. <label class="querenBt" @click="loginAC">{{$t('user.zhuce')}}</label>
  33. </view>
  34. <view class="contentColumnC" style="margin-top: 50rpx;" @click="yueduyszc">
  35. <label class="linktext">{{$t('index.yuedu')}}{{$t('index.yinsizc')}}</label>
  36. </view>
  37. </view>
  38. <popViewGG :tips="$t('index.gjqhxz')" :show="showpop" :maskClosable="true" :isCancel="true" @chooseCancel="chooseCancel">
  39. <picker-view :indicator-style="indicatorStyle" :value="pvalue" @change="bindChange" class="picker-view">
  40. <picker-view-column>
  41. <view class="item" v-for="(item,index) in range" :key="index">{{item}}</view>
  42. </picker-view-column>
  43. </picker-view>
  44. </popViewGG>
  45. </view>
  46. </template>
  47. <script>
  48. import api from "@/pages/api/api.js"
  49. import { encrypt,decrypt } from '@/common/jsencrypt.js'
  50. export default {
  51. data() {
  52. return {// paotui123 123456
  53. zhanghao:'',
  54. mimaA:'',
  55. mimaB:'',
  56. phone:'',
  57. smCode:'',
  58. cid:'',
  59. cryptform:'',
  60. guojiadaima:'+886',
  61. pvalue: [0],
  62. indicatorStyle: `height: 50px;`,
  63. range: ["+886","+86"],
  64. showpop:false,
  65. yanzmnote:this.$t('user.huoquyanzhegm'),
  66. timer:'',
  67. timeCall:0,
  68. }
  69. },
  70. onShow() {
  71. var that=this;
  72. uni.getPushClientId({
  73. success: (res) => {
  74. that.cid = res.cid;
  75. //console.log('客户端推送标识:',that.cid)
  76. uni.setStorageSync("cid",that.cid);
  77. },
  78. fail(err) {
  79. console.log(err)
  80. }
  81. });
  82. //this.UpdataToken();
  83. },
  84. methods: {
  85. yueduyszc(){
  86. uni.navigateTo({
  87. url:'/pages/index/yinszhengc'
  88. })
  89. },
  90. dengluzhangh(event){
  91. this.zhanghao = event.target.value;
  92. },
  93. denglumimaA(event){
  94. this.mimaA = event.target.value;
  95. },
  96. denglumimaB(event){
  97. this.mimaB = event.target.value;
  98. },
  99. phoneinput(event){
  100. this.phone = event.target.value;
  101. },
  102. smsCodeinput(event){
  103. this.smCode = event.target.value;
  104. },
  105. bindChange (e) {
  106. var val = e.detail.value[0];
  107. this.guojiadaima=this.range[val];
  108. },
  109. popgjm(){
  110. this.showpop=true;
  111. },
  112. chooseCancel(){
  113. this.showpop=false;
  114. },
  115. getSMScode(){
  116. if(this.phone.length<1){
  117. uni.showToast({
  118. title: this.$t('user.qsrshouihao'),
  119. icon: 'none',
  120. duration: 3500
  121. })
  122. return;
  123. }
  124. var top = this.phone.substring(0,1);
  125. if(top=='0'){
  126. this.phone=this.phone.slice(1);
  127. }
  128. console.log(this.phone)
  129. if(this.timeCall==0){
  130. this.getSMScodeact();
  131. this.timeCall=60;
  132. }
  133. else{
  134. return;
  135. }
  136. var that = this;
  137. this.timer = setInterval(() => {
  138. that.timeCall=that.timeCall-1;
  139. if(that.timeCall==0){
  140. clearInterval(that.timer);
  141. that.yanzmnote = that.$t('user.huoquyanzhegm');
  142. }
  143. else{
  144. that.yanzmnote =that.$t('user.chongxinhq')+'('+that.timeCall+')';
  145. }
  146. }, 1000);
  147. },
  148. getSMScodeact(){
  149. api('smsCode',{
  150. phone:this.guojiadaima+this.phone
  151. },res=>{
  152. console.log(res)
  153. uni.showToast({
  154. title: res.data.msg,
  155. icon: 'none',
  156. duration: 1500
  157. })
  158. },failc=>{
  159. //console.log('getadvertis----',failc)
  160. })
  161. },
  162. loginAC(){
  163. if(this.zhanghao.length<=0){
  164. uni.showToast({
  165. title: this.$t('user.qsrzhanghao'),
  166. icon: 'none',
  167. duration: 1500
  168. })
  169. return
  170. }
  171. if(this.mimaA.length==0||this.mimaB.length==0||this.mimaA!=this.mimaB){
  172. uni.showToast({
  173. title: this.$t('user.qingshurmim'),
  174. icon: 'none',
  175. duration: 1500
  176. })
  177. return;
  178. }
  179. if(this.phone.length<1){
  180. uni.showToast({
  181. title: this.$t('user.qsrshouihao'),
  182. icon: 'none',
  183. duration: 1500
  184. })
  185. return
  186. }
  187. var top = this.phone.substring(0,1);
  188. if(top=='0'){
  189. this.phone=this.phone.slice(1);
  190. }
  191. console.log(this.phone)
  192. // if(this.smCode.length<=0){
  193. // uni.showToast({
  194. // title: this.$t('user.yanzhengma'),
  195. // icon: 'none',
  196. // duration: 1500
  197. // })
  198. // return
  199. // }
  200. this.loginUp();
  201. },
  202. loginUp(){
  203. var that = this;
  204. api('addshanghu',{
  205. userName:this.zhanghao,
  206. password:encrypt(this.mimaA),
  207. telPhone:this.guojiadaima+this.phone, //手机号码
  208. code:"8888",//this.smCode, //手机验证码
  209. cid:this.cid
  210. },res=>{
  211. console.log(res)
  212. if(res.data.code==200){
  213. plus.nativeUI.toast(this.$t('user.zhucechengg'), {
  214. icon : "none",// eg. "/img/add.png"
  215. duration : "long",// 持续3.5s,short---2s
  216. align : "center",// 水平居中
  217. verticalAlign : "bottom"// 垂直底部
  218. });
  219. uni.navigateBack();
  220. return;
  221. }
  222. if(res.data.code==500){
  223. uni.showToast({
  224. title: res.data.msg,
  225. icon: 'none',
  226. duration: 3500
  227. })
  228. return;
  229. }
  230. uni.showToast({
  231. title: res.data.msg,
  232. icon: 'none',
  233. duration: 3500
  234. })
  235. },failc=>{
  236. //console.log('getadvertis----',failc)
  237. uni.showToast({
  238. title: that.$t('user.shezhishibai'),
  239. icon: 'none',
  240. duration: 2500
  241. })
  242. });
  243. },
  244. liucheng(){
  245. uni.navigateTo({
  246. url:'/pages/index/Openwebview?url='+'https://cityexpress168.com.vn/doi-tac-nha-hang'
  247. })
  248. },
  249. }
  250. }
  251. </script>
  252. <style lang="scss">
  253. page{
  254. background-color:white;
  255. }
  256. .topimag{
  257. width: 100%;
  258. }
  259. .contentVB{
  260. position: fixed;
  261. flex-direction: row;
  262. justify-content: center;
  263. align-items: center;
  264. bottom: 30rpx;
  265. width: 100%;
  266. }
  267. .contentV{
  268. display: flex;
  269. width: 92%;
  270. margin-left: 4%;
  271. flex-direction: column;
  272. justify-content: flex-start;
  273. }
  274. .titlev{
  275. width: 100%;
  276. height: 60rpx;
  277. line-height: 60rpx;
  278. font-size: 40rpx;
  279. font-weight: bold;
  280. text-align: left;
  281. }
  282. .yzmctV{
  283. display: flex;
  284. flex-direction: row;
  285. align-items: center;
  286. justify-content:flex-start;
  287. margin-top: 30rpx;
  288. width: 100%;
  289. }
  290. .yzmctVS{
  291. display: flex;
  292. flex-direction: row;
  293. align-items: center;
  294. justify-content:space-between;
  295. margin-top: 30rpx;
  296. width: 100%;
  297. }
  298. .noinputV{
  299. width: 73%;
  300. height: 80rpx;
  301. line-height: 80rpx;
  302. border-radius: 10rpx;
  303. border: 2rpx solid #F2F3F7;
  304. background-color: #F2F3F7;
  305. }
  306. .noinputVcode{
  307. width: 100%;
  308. height: 80rpx;
  309. line-height: 80rpx;
  310. border-radius: 10rpx;
  311. border: 2rpx solid #F2F3F7;
  312. background-color: #F2F3F7;
  313. }
  314. .yzmbt{
  315. color: white;
  316. font-size: 26rpx;
  317. width: 170rpx;
  318. height: 60rpx;
  319. line-height: 60rpx;
  320. text-align: center;
  321. margin-left: auto;
  322. margin-right: 10rpx;
  323. border-radius: 2rpx;
  324. background-color:#60BA63;
  325. }
  326. .yzmdl{
  327. color: white;
  328. font-size: 26rpx;
  329. width: 170rpx;
  330. height: 60rpx;
  331. line-height: 60rpx;
  332. text-align: center;
  333. margin-top: 26rpx;
  334. border-radius: 2rpx;
  335. background-color:#40AE36;
  336. }
  337. .querenBt{
  338. margin-top: 30rpx;
  339. width: 100%;
  340. height: 60rpx;
  341. line-height: 60rpx;
  342. padding: 10rpx;
  343. border-radius: 20rpx;
  344. text-align: center;
  345. justify-content: center;
  346. background-color: #40AE36;
  347. color: white;
  348. box-shadow: 0px 0rpx 10rpx 0rpx #40AE36;
  349. }
  350. .linktext{
  351. font-size: 24rpx;
  352. color:skyblue;
  353. text-decoration:underline;
  354. }
  355. .notetext{
  356. color: darkgray;
  357. font-size: 24rpx;
  358. text-align: center;
  359. }
  360. .xialakuangct{
  361. display: flex;
  362. flex-direction: row;
  363. align-items: center;
  364. justify-content:space-between;
  365. padding-left: 16rpx;
  366. margin-right: 20rpx;
  367. width: 140rpx;
  368. height: 80rpx;
  369. line-height: 80rpx;
  370. border-radius: 10rpx;
  371. border: 2rpx solid #F2F3F7;
  372. background-color: #F2F3F7;
  373. }
  374. .xialakuang{
  375. width: 100%;
  376. }
  377. .lineview{
  378. display: flex;
  379. flex-direction: row;
  380. align-items: center;
  381. justify-content: center;
  382. background-color: whitesmoke;
  383. border: solid darkgray;
  384. border-width: 0px 0px 1rpx 0px;
  385. width: 80%;
  386. margin-bottom: 12rpx;
  387. }
  388. .picker-view {
  389. width: 750rpx;
  390. height: 300rpx;
  391. margin-top: 10rpx;
  392. }
  393. .item {
  394. line-height: 90rpx;
  395. text-align: center;
  396. }
  397. .duoyuyanctv{
  398. margin-top: 20rpx;
  399. padding: 30rpx;
  400. border: solid lavender;
  401. border-width: 0px 0px 1rpx 0px;
  402. }
  403. .duoyuyIcon{
  404. width: 40rpx;
  405. height: 40rpx;
  406. }
  407. .picker-view {
  408. width: 750rpx;
  409. height: 300rpx;
  410. margin-top: 10rpx;
  411. }
  412. .item {
  413. line-height: 100rpx;
  414. text-align: center;
  415. }
  416. .noinputVcode{
  417. width: 100%;
  418. height: 80rpx;
  419. line-height: 80rpx;
  420. border-radius: 10rpx;
  421. border: 2rpx solid #F2F3F7;
  422. background-color: #F2F3F7;
  423. }
  424. .xiahuax{
  425. border: solid darkgray;
  426. border-width: 0px 0px 2rpx 0px;
  427. }
  428. </style>