RegisterView.vue 9.7 KB

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