Commit f3a0b200 authored by Smile's avatar Smile

谷歌单独页面注销登录

parent 7664952a
......@@ -7,7 +7,8 @@ export default {
this.$route.path != '/pages/register/register' &&
this.$route.path != '/pages/activityShare/index' &&
this.$route.path != '/pages/register/shareRegister' &&
this.$route.path != '/pages/register/downloadTips'
this.$route.path != '/pages/register/downloadTips' &&
this.$route.path != '/pages/deletion/login'
) {
uni.redirectTo({
url: './pages/login/login'
......
......@@ -12,6 +12,18 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/deletion/login",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/deletion/deletion",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/site/site",
"style": {
......
<template>
<view class="main">
<view class="header-toper">
<view class="start-bar"></view>
<view class="header-toper-title">
<image src="../../static/img/back.png" mode="" @click="backOrder"></image>
<text>{{$lang.lang.deletion.deletionTitle}}</text>
</view>
</view>
<view class="logo1">
<text>{{ $lang.lang.deletion.deletionText }}</text>
</view>
<view class="login-btns">
<view class="" @click="loginOff">{{ $lang.lang.deletion.deletionButton }}</view>
</view>
</view>
</template>
<script>
import storage from "@/utils/storage";
export default {
components: {
},
data() {
return {
}
},
onLoad() {
},
methods: {
backOrder(){
uni.navigateTo({
url:'../deletion/login'
})
},
loginOff() {
let that = this
uni.showModal({
title: '提示',
content: that.$lang.lang.site.logNotice,
success: function (res) {
if (res.confirm) {
that.$request.deleted('/app-api/member/member/cancellation').then((res) => {
if (res.code == 0 && res.data) {
storage.clean()
uni.showToast({
title: that.$lang.lang.site.offSuccess,
icon: 'none'
})
uni.setStorageSync('Authorization', '')
setTimeout(() => {
uni.reLaunch({
url: '../deletion/login'
})
// uni.reLaunch({
// url: '../login/login'
// })
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
}
}
</script>
<style scoped>
page{
width: 100%;
position: relative;
background: url(@/static/img/login-bg2.png) no-repeat;
background-size:cover;
height: 100%;
}
.logo1{
padding: 30% 7%;
color: red;
font-size: 24px;
}
.login-btns{
margin-top:20%;
padding: 0 50upx;
}
.login-btns view{
width: 100%;
height: 96upx;
border-radius: 100upx;
color: var(--c0);
font-size: 36upx;
font-weight: 700;
display: flex;
justify-content: center;
align-items: center;
background: #5BA8DC;
margin-bottom: 60upx;
}
</style>
\ No newline at end of file
<template>
<view class="main">
<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>
<text v-if="loginType == 1" @click="loginChange">{{ $lang.lang.login.textLogin }}</text>
<text v-if="loginType == 2" @click="loginChange">{{ $lang.lang.login.psdLogin }}</text>
</view>
<view class="logo1">
<text>{{ $lang.lang.deletion.deletion }}</text>
</view>
<view class="logo">
<image src="../../static/img/logo.png" mode=""></image>
<text>{{ $lang.lang.login.title }}</text>
</view>
<view class="login-item" v-if="loginType == 1">
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/phone.png" mode=""></image>
</view>
<view class="login-vp">
<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/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.password"
/>
<text class="forget" @click="$request.goPage('../forget/forget')"
>{{ $lang.lang.login.forPsd }}?</text
>
</view>
</view>
</view>
<view class="login-item" v-if="loginType == 2">
<view class="login-v">
<view class="login-vs">
<image src="../../static/img/phone.png" mode=""></image>
</view>
<view class="login-vp">
<view class="area">
<picker :value="areaIndex" :range="areaName" @change="areaChange">
<view class="uni-input">{{ $request.checkAddIcon(areaData[areaIndex]) }}</view>
</picker>
<image src="../../static/img/down.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="code"
placeholder-style="color: #ffffff"
:placeholder="$lang.lang.notices.code"
/>
<text class="code" v-if="leftTime < 60">{{ leftTime }}S</text>
<text class="code" @click="sendCode" v-else>{{ $lang.lang.login.code }}</text>
</view>
</view>
</view>
<view class="login-btns">
<view class="" @click="login">{{ $lang.lang.login.loginBtn }}</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>
<uni-popup ref="userment" type="center">
<view class="lending_content">
<view class="lending_info">
<rich-text :nodes="leviteInfo"></rich-text>
</view>
<view class="lending_btns">
<view @click="$refs.userment.close()">{{ $lang.lang.login.close }}</view>
</view>
</view>
</uni-popup>
<uni-popup ref="vepopup" type="center" :mask-click="false">
<view class="ad-conten">
<image
v-if="!forceUpdate"
@click="closeVe"
class="ad-bg"
src="../../static/img/index_close.png"
></image>
<view class="ad-title">V{{ appVersion }}{{ $lang.lang.notices.newVersion }}</view>
<view class="ad-info">
<rich-text :nodes="veData"></rich-text>
</view>
<view class="ad-btns">
<view class="ad-btn" @click="toupdate">
<view>{{ $lang.lang.notices.update }}</view>
</view>
<view v-if="!forceUpdate" class="ad-btn" @click="closeVe">
<view>{{ $lang.lang.notices.close }}</view>
</view>
</view>
<view class="progress" v-if="showdownLine">
<progress :percent="downloadNum" show-info stroke-width="3" />
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import userAgreement from '../../components/userAgreement/index.vue'
import deletion from "@/static/lang/en/deletion";
export default {
computed: {
deletion() {
return deletion
}
},
components: {
userAgreement
},
data() {
return {
leftTime: 60,
areaIndex: 0,
areaData: [],
areaName: [],
loginType: 1,
closePopup:true,
leviteInfo: '',
mobile: '',
password: '',
code: '',
agree: false,
locale: this.$request.getLocale(),
veData: 0,
versionCode: 0,
appVersion: '',
forceUpdate: 0,
showdownLine: false,
downloadNum: 0, //下载百分比
totalSize: 0 //下载总量
}
},
onLoad() {
this.watchWork()
this.Country()
this.getLeviteData()
//#ifdef APP-PLUS
this.getVersion()
this.getVeData()
//#endif
},
methods: {
showUser() {
this.$refs.userment.open()
},
Country() {
let that = this
that.$request.get('/app-api/ecw/country/list-all').then((res) => {
console.log(res)
if (res.code == 0 && res.data.length > 0) {
for (let i in res.data) {
that.areaData.push(res.data[i].tel)
if (that.locale == 'zh') {
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameZh)
} else {
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameEn)
}
}
}
})
},
areaChange(e) {
this.areaIndex = e.detail.value
},
changeLang(data) {
this.locale = data
this.getLeviteData()
uni.setStorageSync('locale', data)
this.$lang.setLang(data)
},
getLeviteData() {
let that = this
that.$request.get('/app-api/system/need-know/getByKey', { key: '5' }).then((res) => {
if (res.code == 0 && res.data) {
if (that.$lang.locale == 'zh') {
that.leviteInfo = res.data.contentZh
} else {
that.leviteInfo = res.data.contentEn
}
}
})
},
login() {
if (this.mobile == '') {
return uni.showToast({
title: this.$lang.lang.notices.phone,
icon: 'error'
})
}
if (this.password == '' && this.loginType == 1) {
return uni.showToast({
title: this.$lang.lang.notices.password,
icon: 'error'
})
}
if (this.code == '' && this.loginType == 2) {
return uni.showToast({
title: this.$lang.lang.notices.code,
icon: 'error'
})
}
if (!this.agree) {
return uni.showToast({
title: this.$lang.lang.notices.chooseService,
icon: 'none'
})
}
let url = ''
let param = {}
url = this.loginType == 1 ? '/app-api/member/login' : '/app-api/member/sms-login'
param =
this.loginType == 1
? { mobile: this.mobile, password: this.password }
: { areaCode: this.areaData[this.areaIndex], mobile: this.mobile, code: this.code }
let that = this
that.$request.post(url, param).then((res) => {
if (res.code == 0 && res.data) {
uni.setStorageSync('Authorization', res.data.token)
that.getUserInfo()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
sendCode() {
if (this.mobile == '') {
return uni.showToast({
title: this.$lang.lang.notices.phone,
icon: 'error'
})
}
if (this.leftTime < 60) {
return false
}
this.$request
.post('/app-api/member/send-sms-code', {
areaCode: this.areaData[this.areaIndex],
mobile: this.mobile,
scene: 1
})
.then((res) => {
if (res.code == 0) {
this.countDown()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
countDown() {
this.leftTime--
if (this.leftTime > 0) {
setTimeout(this.countDown, 1000)
} else {
this.leftTime = 60
}
},
loginChange() {
this.loginType = this.loginType == 1 ? 2 : 1
},
watchWork() {
let that = this
uni.onNetworkStatusChange(function (res) {
console.log(res.isConnected)
if (res.isConnected && that.areaName.length == 0) {
that.Country()
that.getLeviteData()
}
})
},
toupdate() {
let that = this
if (that.showdownLine) return
// #ifdef APP-PLUS
let platform = uni.getSystemInfoSync().platform.toLocaleLowerCase()
if (platform == 'ios') {
plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990')
} else {
uni.showLoading({
title: this.$lang.lang.notices.startDown
})
that.showdownLine = true
var dtask = plus.downloader.createDownload(that.appUrl, {}, (d, status) => {
uni.hideLoading()
if (status == 200) {
that.closeVe()
that.showdownLine = false
console.log('下载成功安装: ' + d.filename)
plus.runtime.install(d.filename)
} else {
that.showdownLine = false
that.closeVe()
plus.nativeUI.alert(that.$lang.lang.notices.failDown)
}
})
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
// 下载进度
dtask.addEventListener('statechanged', function (download, status) {
if (that.downloadNum == 100) {
uni.hideLoading()
}
switch (download.state) {
case 2:
break
case 3: //进度条百分比 totalSize为总量,baifen为当前下载的百分比
if (that.totalSize == 0) {
that.totalSize = parseInt(download.totalSize)
}
if (parseInt((download.downloadedSize / that.totalSize) * 100) != that.downloadNum) {
that.downloadNum = parseInt((download.downloadedSize / that.totalSize) * 100)
}
break
case 4:
// mui.toast("下载完成");
uni.hideLoading()
break
}
})
dtask.start()
}
// #endif
},
getVersion() {
this.version = uni.getStorageSync('appversion')
this.versionCode = uni.getStorageSync('versionCode')
},
getVeData() {
let that = this
var addType = uni.getSystemInfoSync().platform == 'ios' ? 'userIos' : 'userAndroid'
that.$request
.get('/app-api/system/version/latestVersion', {
appType: addType,
versionCode: that.versionCode
})
.then((res) => {
console.log(res)
if (res.code == 0 && res.data) {
that.veData = res.data.desp
that.appUrl = res.data.appUrl
that.appVersion = res.data.appVersion
that.forceUpdate = res.data.forceUpdate
that.openVe()
}
})
},
openVe() {
this.$refs.vepopup.open()
},
closeVe() {
this.$refs.vepopup.close()
},
// 获取个人信息
async getUserInfo() {
try {
const { code, data } = await this.$request.get('/app-api/member/user/get')
if (code == 0 && data) {
const { country } = data
if (country) {
uni.reLaunch({
url: './deletion'
})
}
}
} catch (err) {
console.log(err)
}
}
}
}
</script>
<style>
@import url(../../static/css/login.css);
</style>
<style scoped>
.logo1{
padding: 10px 50px;
display: flex;
align-items: center;
}
.logo1 uni-text{
text-align: center;
font-size: 20px;
margin-left: 10px;
font-weight: 700;
color: red;
}
</style>
\ No newline at end of file
......@@ -31,6 +31,7 @@ import finsh from './en/finsh.js'
import orderInfo from './en/orderInfo.js'
import price from './en/price.js'
import site from './en/site.js'
import deletion from './en/deletion.js'
export default {
notices,
auth,
......@@ -65,4 +66,5 @@ export default {
orderInfo,
price,
site,
deletion
}
export default {
"deletionTitle": "Delete My Account",
"deletionText": "Warning: Clicking the button below will delete all your data in our application (including account password, personal information, consultations, and suggestions), and this action cannot be undone. Please proceed with caution!",
"deletionButton": "Delete Account",
"deletion": "Note: Please log in before deleting your account."
}
\ No newline at end of file
......@@ -31,6 +31,7 @@ import finsh from './zh/finsh.js'
import orderInfo from './zh/orderInfo.js'
import price from './zh/price.js'
import site from './zh/site.js'
import deletion from './zh/deletion.js'
export default {
notices,
auth,
......@@ -65,4 +66,5 @@ export default {
orderInfo,
price,
site,
deletion
}
export default {
"deletionTitle": "注销我的账户",
"deletionText":"注意:点击以下按钮,将删除您在我应用中的所有数据(包含账号密码、个人资料、咨询、建议),并且不可恢复,请谨慎操作!",
"deletionButton":"注销账户",
"deletion":"注意:注销用户前请先登录"
}
\ No newline at end of file
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