Commit 3c13d787 authored by chenwei's avatar chenwei

新增分享注册逻辑也页面

parent 1b53d301
<script>
export default {
onLaunch: function() {
let Authorization = uni.getStorageSync('Authorization')
if((!Authorization || Authorization == '')){
if(this.$route.path != '/pages/register/register' && this.$route.path != '/pages/activityShare/index' ){
uni.redirectTo({
url: './pages/login/login'
})
}
}
if(Authorization && !this.$store.state.userInfo){
this.$store.dispatch('updateUserInfo')
export default {
onLaunch: function () {
let Authorization = uni.getStorageSync('Authorization')
if (!Authorization || Authorization == '') {
if (
this.$route.path != '/pages/register/register' &&
this.$route.path != '/pages/activityShare/index' &&
this.$route.path != '/pages/register/shareRegister' &&
this.$route.path != '/pages/register/downloadTips'
) {
uni.redirectTo({
url: './pages/login/login'
})
}
//#ifdef APP-PLUS
plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
// 获取 app的version
let appversion = wgtinfo.version;
let versionCode = wgtinfo.versionCode
// 存缓存 版本号
try {
uni.setStorageSync('appversion', appversion);
uni.setStorageSync('versionCode', versionCode);
} catch (e) {}
console.log( "appversion:" + appversion );
} );
//#endif
},
onShow: function() {
},
onHide: function() {
}
}
}
if (Authorization && !this.$store.state.userInfo) {
this.$store.dispatch('updateUserInfo')
}
//#ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
// 获取 app的version
let appversion = wgtinfo.version
let versionCode = wgtinfo.versionCode
// 存缓存 版本号
try {
uni.setStorageSync('appversion', appversion)
uni.setStorageSync('versionCode', versionCode)
} catch (e) {}
console.log('appversion:' + appversion)
})
//#endif
},
onShow: function () {},
onHide: function () {}
}
</script>
<style>
@import url(@/static/css/main.css);
@import url(@/static/css/main.css);
</style>
......@@ -49,6 +49,18 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/register/shareRegister",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/register/downloadTips",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/consult/consult",
"style": {
......
<template>
<!-- #ifdef H5 -->
<view class="downloadTipsBox" v-if="closePopup">
<image class="logoImg" src="/static/img/logo.76c4d986.png"></image>
<view class="textAlert">{{ $lang.lang.integral.downloadTitle }}</view>
<view class="descText">{{ $lang.lang.integral.downloadTextDesc }} </view>
<view class="downloadTips descText">{{ $lang.lang.integral.downloadTextTips }}</view>
<view class="downloadBtn" @click="handleDownload">{{ $lang.lang.integral.downloadBtn }}</view>
<!-- <view class="closeBtn-l" @click="closePopup = false">X</view> -->
</view>
<!-- #endif -->
</template>
<script>
import userAgreement from '../../components/userAgreement/index.vue'
export default {
components: {
userAgreement
},
data() {
return {
closePopup: true,
areaIndex: 0,
mobile: '',
password: '',
passworded: '',
code: '',
agree: false,
areaData: [],
areaName: [],
leftTime: 60,
referralCode: ''
}
},
onLoad() {
this.Country()
this.referralCode = this.$route.query.code
},
methods: {
handleDownload() {
if (uni.getSystemInfoSync().platform === 'android') {
console.log('运行Android上')
window.open('https://www.pgyer.com/qHcSOD1F', '_blank')
} else {
window.open('https://apps.apple.com/cn/app/e-c-logistics/id6466407990', '_blank')
console.log('运行iOS上')
}
}
}
}
</script>
<style>
.downloadTipsBox {
height: 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
background: #373333c7;
padding: 10upx 54upx;
display: flex;
z-index: 10;
align-items: center;
flex-direction: column;
box-sizing: border-box;
justify-content: center;
}
.textAlert {
padding: 40upx;
font-size: 40upx;
color: #fff;
}
.logoImg {
height: 200rpx;
width: 200rpx;
}
.downloadBtn {
background: #5ba8dc;
padding: 4upx 20upx;
color: #fff;
font-size: 36upx;
border-radius: 100px;
}
.closeBtn-l {
color: #fff;
font-size: 24upx;
padding: 8px;
top: 0px;
position: absolute;
right: 70px;
}
.descText {
color: #fff;
font-size: 26upx;
padding-bottom: 40upx;
}
.downloadTips {
color: red;
width: 100%;
}
</style>
<template>
<view class="main">
<!-- <view class="login-top">
<image src="../../static/img/back.png" @click="$request.backGo()" mode=""></image>
</view> -->
<view class="login-top">
<image
v-if="locale == 'en'"
src="../../static/img/zh.png"
mode=""
@click="changeLang('zh')"
></image>
<image
v-if="locale == 'zh'"
src="../../static/img/en.png"
mode=""
@click="changeLang('en')"
></image>
</view>
<view class="logo">
<image src="../../static/img/logo.png" mode=""></image>
<text>{{ $lang.lang.login.title }}</text>
</view>
<view class="login-item">
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/phone.png" mode=""></image>
</view>
<view class="login-vp login-phone">
<view class="login-area">
<picker :value="areaIndex" :range="areaName" @change="areaChange">
<view class="uni-input">{{ $request.checkAddIcon(areaData[areaIndex]) }}</view>
</picker>
<image src="../../static/img/more.png" mode=""></image>
</view>
<input
class="vp-input"
v-model="mobile"
type="number"
placeholder-style="color: #ffffff"
:placeholder="$lang.lang.notices.phone"
/>
</view>
</view>
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/code.png" mode=""></image>
</view>
<view class="login-vp">
<input
class="vp-input"
v-model="code"
type="number"
placeholder-style="color: #ffffff"
:placeholder="$lang.lang.notices.code"
/>
<view class="login-code" v-if="leftTime < 60">{{ leftTime }}S</view>
<view class="login-code" v-else @click="sendCode">{{ $lang.lang.login.code }}</view>
</view>
</view>
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/pass.png" mode=""></image>
</view>
<view class="login-vp">
<input
class="vp-input"
v-model="password"
type="password"
placeholder-style="color: #ffffff"
:placeholder="$lang.lang.notices.numPsd"
/>
</view>
</view>
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/safe.png" mode=""></image>
</view>
<view class="login-vp">
<input
class="vp-input"
v-model="passworded"
type="password"
placeholder-style="color: #ffffff"
:placeholder="$lang.lang.notices.nextPsd"
/>
</view>
</view>
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/recommend.png" mode=""></image>
</view>
<view class="login-vp">
<input
class="vp-input"
v-model="referralCode"
type="text"
placeholder-style="color: #ffffff"
:placeholder="$lang.lang.notices.recommend"
/>
</view>
</view>
</view>
<view class="login-btns">
<view class="" @click="register">{{ $lang.lang.login.register }}</view>
</view>
<view class="agree" @click="agree = !agree">
<image
:src="agree ? '../../static/img/check_true.png' : '../../static/img/check_false.png'"
mode=""
></image>
<view
>{{ $lang.lang.notices.read
}}<text @click="showUser">{{ $lang.lang.notices.service }}</text></view
>
</view>
<user-agreement ref="userment" />
</view>
</template>
<script>
import userAgreement from '../../components/userAgreement/index.vue'
export default {
components: {
userAgreement
},
data() {
return {
closePopup: true,
areaIndex: 0,
locale: this.$request.getLocale(),
mobile: '',
password: '',
passworded: '',
code: '',
agree: false,
areaData: [],
areaName: [],
leftTime: 60,
referralCode: ''
}
},
onLoad() {
this.Country()
this.referralCode = this.$route.query.code
},
methods: {
changeLang(data) {
this.locale = data
// this.getLeviteData()
uni.setStorageSync('locale', data)
this.$lang.setLang(data)
},
handleDownload() {
if (uni.getSystemInfoSync().platform === 'android') {
console.log('运行Android上')
window.open('https://www.pgyer.com/qHcSOD1F', '_blank')
} else {
window.open('https://apps.apple.com/cn/app/e-c-logistics/id6466407990', '_blank')
console.log('运行iOS上')
}
},
showUser() {
this.$refs.userment.open()
},
Country() {
this.$request.get('/app-api/ecw/country/list-all').then((res) => {
if (res.code == 0 && res.data.length > 0) {
for (let i in res.data) {
this.areaData.push(res.data[i].tel)
if (this.$lang.locale == 'zh') {
this.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameZh)
} else {
this.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameEn)
}
}
}
})
},
areaChange(e) {
this.areaIndex = e.detail.value
},
ismobile(code, mobile) {
this.$request
.get('/app-api/param/validator/mobile', { code: code, mobile: mobile })
.then((res) => {
if (res.code == 0) {
this.$request
.post('/app-api/member/send-sms-code', {
areaCode: this.areaData[this.areaIndex],
mobile: this.mobile,
scene: 0
})
.then((res) => {
if (res.code == 0) {
this.countDown()
} else {
uni.showToast({
title: res.msg || 'error',
icon: 'none'
})
}
})
} else {
uni.showToast({
title: this.$lang.lang.notices.nophone,
icon: 'error'
})
}
})
},
sendCode() {
if (this.mobile == '') {
return uni.showToast({
title: this.$lang.lang.notices.phone,
icon: 'error'
})
}
if (this.leftTime < 60) {
return false
}
this.ismobile(this.areaData[this.areaIndex], this.mobile)
},
countDown() {
this.leftTime--
if (this.leftTime > 0) {
setTimeout(this.countDown, 1000)
} else {
this.leftTime = 60
}
},
register() {
let params = {
areaCode: this.areaData[this.areaIndex],
code: this.code,
englishName: '',
mobile: this.mobile,
password: this.password,
referralCode: this.referralCode,
registerPlatform: '2'
}
if (this.mobile == '') {
return uni.showToast({
title: this.$lang.lang.notices.phone,
icon: 'error'
})
}
if (this.code == '') {
return uni.showToast({
title: this.$lang.lang.notices.code,
icon: 'error'
})
}
if (this.password == '') {
return uni.showToast({
title: this.$lang.lang.notices.password,
icon: 'error'
})
}
if (this.passworded == '') {
return uni.showToast({
title: this.$lang.lang.notices.nextPsd,
icon: 'error'
})
} else {
var reg1 = new RegExp('^(?=.*[0-9])(?=.*[a-zA-Z])(.{6,32})$')
if (!reg1.test(this.passworded)) {
return uni.showToast({
title: this.$lang.lang.notices.numPsd,
icon: 'error'
})
}
}
if (this.password != this.passworded) {
return uni.showToast({
title: this.$lang.lang.notices.different,
icon: 'none'
})
}
if (!this.agree) {
return uni.showToast({
title: this.$lang.lang.notices.chooseService,
icon: 'none'
})
}
this.$request.post('/app-api/member/share-page/reg', params).then((res) => {
if (res.code == 0 && res.data) {
// uni.setStorageSync('Authorization', res.data.token)
uni.reLaunch({
url: '/pages/register/downloadTips'
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
}
}
}
</script>
<style>
@import url(../../static/css/register.css);
.downloadBox {
height: 100upx;
position: absolute;
top: 0;
left: 0;
width: 100%;
background: #373333c7;
padding: 10upx 54upx;
display: flex;
z-index: 10;
align-items: center;
}
.textAlert {
padding: 0 40upx;
color: #fff;
}
.logoImg {
height: 60upx;
width: 60upx;
}
.downloadBtn {
background: #5ba8dc;
padding: 4upx 20upx;
color: #fff;
font-size: 36upx;
border-radius: 100px;
}
.closeBtn-l {
color: #fff;
font-size: 24upx;
padding: 8px;
top: 0px;
position: absolute;
right: 70px;
}
</style>
......@@ -37,5 +37,10 @@ export default {
total: 'Total Score:',
exchangeType: 'Exchange Method:',
deliveryAddress: 'Delivery Address:',
branch: 'branch:'
branch: 'branch:',
downloadTitle: 'E&C logistics APP',
downloadTextDesc:
"E&C Logistics currently provides major services such as shipping bulk cargo, shipping full container, dedicated air transport, sea-air combined transport, special containers, overseas warehouses, e-commerce consolidation, etc., and has gradually expanded to include Valuation Premium, On hold control, and Door to door delivery, financial services, E-Survey and other value-added services.Adhering to the mission of 'Making Sino-African trade more convenient', E&C Logistics continues to improve service quality, strives for innovation, and has built its own with the logistics tracking system, cargo owners can check the status of goods in real time, control/release goods by themselves, download bills of lading, and provide SMS notification reminders at key nodes.",
downloadTextTips: 'Download the login APP and get points',
downloadBtn: 'Download'
}
......@@ -37,5 +37,10 @@ export default {
total: '合计积分:',
exchangeType: '兑换方式:',
deliveryAddress: '邮寄地址:',
branch: '网点:'
branch: '网点:',
downloadTitle: '捷道国际货运APP',
downloadTextDesc:
"E&C Logistics捷道物流目前提供海运散货、海运整柜、专线空运、海空联运、特殊货柜、海外仓、电商集运等主要业务,陆续延伸出了保价赔付、控货、目的港门到门派送、金融服务、企业调研等增值服务。秉承着'让中非贸易更便捷'的使命,捷道物流不断提升服务质量,努力创新,搭建了自有的物流追踪系统,货主可以实时查询货物状态,自行控/放货、下载提单,重点节点提供短信通知提醒。",
downloadTextTips: '下载登录APP,获取积分',
downloadBtn: '立即下载'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment