| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- <template>
- <view class="">
- <customNav :shownav="true" :title="$t('index.dengluzhuce')" titledetl=""></customNav>
- <image class="topimag" src="/static/defimages/denglutop.png" mode="widthFix"></image>
- <view class="contentV">
- <text class="titlev">{{$t('index.huanying')}}</text>
- <!-- <view class="">
- <view class="contentInRowS duoyuyanctv" @click="duoyuyan">
- <view class="contentInRowL">
- <image class="duoyuyIcon" src="/static/images/yuyan@3x.png" mode="scaleToFill"></image>
- <text>Ngôn ngữ/语言</text>
- </view>
- <image style="width: 30rpx;" src="/static/images/fanhui@3x.png" mode="widthFix"></image>
- </view>
- </view> -->
- <view class="yzmctV">
- <view class="xialakuangct" @click="popgjm">
- <text>{{guojiadaima}}</text>
- <image style="width: 36rpx;height: 36rpx;padding-right: 16rpx;" src="/static/images/xiala@3x.png"
- mode="scaleToFill"></image>
- </view>
- <input class="noinputV" type="number" :placeholder="$t('index.shoujihao')" @input="phoneinput">
- </view>
- <view class="yzmctV noinputVcode">
- <input class="yzminputV" type="text" :placeholder="$t('index.yanzhengma')" @input="smsCodeinput">
- <text class="yzmbt" @click="getSMScode">{{smsCodeNote}}</text>
- </view>
- <view class="yzmctV">
- <text class="querenBt" @click="loginAC">{{$t('index.dengluzhuce')}}</text>
- </view>
- <view class="contentInRowC" style="margin-top: 40rpx;" @click="yueduyszc">
- <text class="linktext">{{$t('index.yuedu')}}{{$t('index.yinsizc')}}</text>
- </view>
- </view>
- <popViewGG :tips="$t('index.gjqhxz')" :show="showpop" :maskClosable="true" :isCancel="true"
- @chooseCancel="chooseCancel">
- <picker-view :indicator-style="indicatorStyle" :value="pvalue" @change="bindChange" class="picker-view">
- <picker-view-column>
- <view class="item" v-for="(item,index) in range" :key="index">{{item}}</view>
- </picker-view-column>
- </picker-view>
- </popViewGG>
- </view>
- </template>
- <script>
- import api from "@/pages/api/api.js";
- export default {
- data() {
- return {
- pvalue: [0],
- indicatorStyle: `height: 50px;`,
- range: ["+84", "+886", "+86"],
- showpop: false,
- phone: '',
- smsCode: '',
- smsCodeNote: '',
- timer: '',
- timeCall: 0,
- guojiadaima: '+84',
- cid: ''
- }
- },
- onShow() {
- var that = this;
- this.smsCodeNote = this.$t('index.huoquyzm');
- // uni.getPushClientId({
- // success: (res) => {
- // that.cid = res.cid;
- // console.log('客户端推送标识:',that.cid)
- // uni.setStorageSync("cid",that.cid);
- // },
- // fail(err) {
- // // uni.showToast({
- // // title:'获取推送标识失败',
- // // icon: 'none',
- // // duration: 4000
- // // })
- // console.log(err)
- // }
- // });
- //this.UpdataToken();
- },
- methods: {
- bindChange(e) {
- var val = e.detail.value[0];
- this.guojiadaima = this.range[val];
- },
- popgjm() {
- this.showpop = true;
- },
- chooseCancel() {
- this.showpop = false;
- },
- duoyuyan() {
- uni.navigateTo({
- url: '/pages/UserCenter/yonghushezhi/duoyuyan'
- })
- },
- phoneinput(event) {
- this.phone = event.target.value;
- },
- smsCodeinput(event) {
- this.smsCode = event.target.value;
- },
- yueduyszc() {
- uni.navigateTo({
- url: '/pages/index/mindex/yinszhengc'
- })
- },
- getSMScode() {
- if (this.phone.length <= 0) {
- uni.showToast({
- title: this.$t('index.shoujihao'),
- icon: 'none',
- duration: 3500
- })
- return;
- }
- var top = this.phone.substring(0, 1);
- if (top == '0') {
- this.phone = this.phone.slice(1);
- }
- console.log(this.phone)
- if (this.timeCall == 0) {
- this.getSMScodeact();
- this.timeCall = 60;
- } else {
- return;
- }
- var that = this;
- this.timer = setInterval(() => {
- that.timeCall = that.timeCall - 1;
- if (that.timeCall == 0) {
- clearInterval(that.timer);
- that.smsCodeNote = that.$t('index.huoquyzm');
- } else {
- that.smsCodeNote = that.$t('index.chongxhq') + '(' + that.timeCall + ')';
- }
- }, 1000);
- },
- getSMScodeact() {
- console.log("getSMScodeact");
- api('smsCode', {
- phone: this.guojiadaima + this.phone
- }, res => {
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 1500
- })
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- loginAC() {
- if (this.phone.length <= 0) {
- uni.showToast({
- title: this.$t('index.shoujihao'),
- icon: 'none',
- duration: 3500
- })
- return;
- }
- var top = this.phone.substring(0, 1);
- if (top == '0') {
- this.phone = this.phone.slice(1);
- }
- if (this.smsCode.length <= 0) {
- uni.showToast({
- title: this.$t('index.yanzhengma'),
- icon: 'none',
- duration: 3500
- })
- return;
- }
- this.loginUp();
- },
- loginUp() {
- console.log(this.guojiadaima + this.phone, this.smsCode, this.cid)
- api('loginBySmsCode', {
- phone: this.guojiadaima + this.phone,
- code: this.smsCode,
- cid: this.cid
- }, res => {
- console.log(res)
- if (res.data.code == 200) {
- if (typeof plus !== 'undefined' && plus.nativeUI && plus.nativeUI.toast) {
- plus.nativeUI.toast(this.$t('api.dengluchengg'), {
- icon: "none",
- duration: "long",
- align: "center",
- verticalAlign: "bottom"
- });
- } else {
- uni.showToast({
- title: this.$t('api.dengluchengg'),
- icon: 'none',
- duration: 3500
- });
- }
- getApp().globalData.token = res.data.token;
- uni.setStorageSync("token", res.data.token);
- uni.setStorageSync("userId", res.data.data.userId);
- uni.setStorageSync('userInfo', res.data.data);
- getApp().globalData.initgoEasy();
- uni.navigateBack();
- return;
- }
- if (res.data.code == 500) {
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 3500
- })
- return;
- }
- uni.showToast({
- title: this.$t('api.denglusb'),
- icon: 'none',
- duration: 3500
- })
- }, failc => {
- uni.showToast({
- title: this.$t('api.denglushibai'),
- icon: 'none',
- duration: 2500
- })
- })
- },
- }
- }
- </script>
- <style>
- page {
- background-color: white;
- }
- .topimag {
- width: 100%;
- }
- .contentV {
- display: flex;
- width: 92%;
- margin-left: 4%;
- flex-direction: column;
- justify-content: flex-start;
- }
- .titlev {
- width: 100%;
- height: 60rpx;
- line-height: 60rpx;
- font-size: 36rpx;
- font-weight: bold;
- text-align: left;
- }
- .yzmctV {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- margin-top: 30rpx;
- width: 100%;
- }
- .noinputV {
- width: 73%;
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 10rpx;
- border: 2rpx solid #F2F3F7;
- background-color: #F2F3F7;
- }
- .yzminputV {
- width: 73%;
- }
- .noinputVcode {
- width: 99%;
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 10rpx;
- border: 2rpx solid #F2F3F7;
- background-color: #F2F3F7;
- }
- .yzmbt {
- color: white;
- font-size: 26rpx;
- width: 170rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- margin-left: auto;
- margin-right: 10rpx;
- border-radius: 2rpx;
- background-color: #60BA63;
- }
- .querenBt {
- margin-top: 30rpx;
- width: 100%;
- height: 60rpx;
- line-height: 60rpx;
- padding: 10rpx;
- border-radius: 20rpx;
- border: solid #00A6FF;
- border-width: 0px 0px 6rpx 0px;
- text-align: center;
- justify-content: center;
- background-color: #00A6FF;
- color: white;
- box-shadow: 0rpx 0rpx 10rpx 0rpx #00A6FF;
- }
- .linktext {
- font-size: 24rpx;
- color: skyblue;
- text-decoration: underline;
- }
- .notetext {
- color: darkgray;
- font-size: 24rpx;
- text-align: center;
- }
- .xialakuangct {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- padding-left: 16rpx;
- margin-right: 20rpx;
- width: 140rpx;
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 10rpx;
- border: 2rpx solid #F2F3F7;
- background-color: #F2F3F7;
- }
- .xialakuang {
- width: 100%;
- }
- .lineview {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- background-color: whitesmoke;
- border: solid darkgray;
- border-width: 0px 0px 1rpx 0px;
- width: 80%;
- margin-bottom: 12rpx;
- }
- .picker-view {
- width: 750rpx;
- height: 300rpx;
- margin-top: 10rpx;
- }
- .item {
- line-height: 100rpx;
- text-align: center;
- }
- .duoyuyanctv {
- margin-top: 20rpx;
- padding: 30rpx;
- border: solid lavender;
- border-width: 0px 0px 1rpx 0px;
- }
- .duoyuyIcon {
- width: 40rpx;
- height: 40rpx;
- }
- </style>
|