123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536 |
- <template>
- <view class="container">
- <view class="cu-list menu text-left solid-top indexlow">
- <view class='cu-item' style='margin-bottom:10px;' @click="switchPicture">
- <view>
- <text>头像</text>
- </view>
- <view style='align-items: center;' class="flex">
- <view class="pictures">
- <image :src="headUrl" class="picture"></image>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- </view>
- <view class='cu-item' style='margin-bottom:10px;' @click="nickname(username)">
- <view>
- <text>用户名</text>
- </view>
- <view style='align-items: center;' class="flex">
- <view class="username">
- {{username}}
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- </view>
- <view class='cu-item' style='margin-bottom:10px;' @click="nickname1(wechatNo)">
- <view>
- <text>昵称</text>
- </view>
- <view style='align-items: center;' class="flex">
- <view class="username">
- {{wechatNo}}
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- </view>
- <view class='cu-item' style='margin-bottom:10px;' @click='fankui'>
- <view>
- <text>意见反馈</text>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- <view class='cu-item' style='margin-bottom:10px;' @click='clearStorage'>
- <view>
- <text>清除缓存</text>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- <view class='cu-item' style='margin-bottom:10px;' @click='UpdataPassword'>
- <view>
- <text>修改密码</text>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- <!-- <view class='cu-item' style='margin-bottom:10px;' @click='updataEdition'>
- <view>
- <text>检查新版本</text>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view> -->
- <view class='cu-item' style='margin-bottom:10px;' @click='unsubscribe'>
- <view>
- <text>注销账户</text>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- <view class='cu-item' style='margin-bottom:10px;'>
- <view>
- <text>检查更新</text>
- </view>
- <view class="version_css" @click="onAPPUpdate">
- {{version}}
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- </view>
- </view>
- <view class="agreement">
- <view class="text">
- <navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
- class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
- class="path" hover-class="navigator-hover">《隐私政策》</navigator>
- </view>
- </view>
- <view class='exitloginwrap'>
- <button @click='logout()' class='exitlogin'>退出登录</button>
- </view>
- <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
- :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='温馨提示'
- :showCancelButton='false' :content="content" @confirm="goOpenService" @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- import appUpdate from 'common/appUpdate.js'
- import {
- mapState
- } from 'vuex';
- // #ifdef APP-PLUS
- import APPUpdate, {
- getCurrentNo
- } from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
- import * as config from '@/config/index.js'
- // #endif
- export default {
- data() {
- return {
- isShowAlert: false,
- content: '您确定要退出吗?',
- headUrl: "../../static/img/myimg/YongHu@3x.png",
- username: "",
- wechatNo: '',
- gridList: [{
- num: 0,
- name: '退出登录',
- // icon:'cuIcon-exit',
- src: '../../static/img/sign/return@3x.png',
- tips: 0,
- url: '',
- show: true
- }, ],
- version: "1.1.0"
- }
- },
- computed: {
- // ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- this.getList()
- // #ifdef APP-PLUS
- plus.runtime.getProperty(plus.runtime.appid, (info) => {
- //版本号
- this.version = info.version;
- console.log("当前版本为:", this.version)
- this.checkVersion()
- })
- // #endif
- },
- onLoad() {},
- methods: {
- // 检查APP是否有新版本
- onAPPUpdate() {
- // true 没有新版本的时候有提示,默认:false
- if (this.version == "发现新版本,立即更新") {
- // #ifdef APP-PLUS
- APPUpdate(true);
- // #endif
- }
- },
- checkVersion() {
- const baseUrlNew = config.def().baseUrlNew
- uni.request({
- url: baseUrlNew + '/appVersion/selectInfo',
- data: {
- appid: plus.runtime.appid,
- version: this.version,
- imei: "1",
- },
- method: 'GET',
- success: (res) => {
- console.log("查看--------", this.version)
- console.log("查看--------", res)
- if (!res.data.data.version) {
- this.version = "当前为最新版" + this.version
- } else {
- this.version = "发现新版本,立即更新"
- }
- }
- })
- },
- updataEdition() {
- // #ifdef APP-PLUS
- let type = uni.getSystemInfoSync().platform
- if (type == "android") {
- uni.request({
- url: 'https://api2.eliangeyun.com/appVersion/selectInfo',
- data: {
- appid: plus.runtime.appid,
- version: this.version,
- imei: "1"
- },
- method: 'GET',
- success: (res) => {
- if (res.statusCode === 200) {
- console.log("uni.request update success", res)
- plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
- let client_version = wgtinfo.version
- var flag_update = client_version.split(".").splice(0, 2).join(
- ".") != res.data.data.version.split(".").splice(0, 2)
- .join(".")
- var flag_hot = (Number(client_version.split(".")[2]) < Number(res
- .data.data.version.split(".")[2])) & !flag_update
- console.log("client_version", client_version)
- console.log("flag_update", flag_update)
- console.log("flag_hot", flag_hot)
- if (flag_update) {
- console.log("更新弹窗")
- // 提醒用户更新
- uni.showModal({
- title: '更新提示',
- content: res.data.data.note,
- success: (showResult) => {
- if (showResult.confirm) {
- plus.nativeUI.toast("正在准备环境,请稍后!");
- console.log(res.data.data.url, )
- var dtask = plus.downloader
- .createDownload(res.data.data
- .url, {
- method: 'GET',
- filename: '_doc/update/'
- },
- function(d, status) {
- if (status == 200) {
- var path = d
- .filename; //下载apk
- plus.runtime.install(
- path); // 自动安装apk文件
- } else {
- plus.nativeUI.alert(
- '版本更新失败:' +
- status);
- }
- });
- dtask.start();
- }
- }
- })
- } else if (flag_hot) {
- console.log("热更新")
- uni.showLoading({
- title: '正在热更新'
- })
- uni.downloadFile({
- url: res.data.data.wgtUrl,
- success: (downloadResult) => {
- console.log(downloadResult.tempFilePath)
- if (downloadResult.statusCode === 200) {
- plus.nativeUI.toast(
- `正在热更新!${res.data.data.versionCode}`
- );
- plus.runtime.install(downloadResult
- .tempFilePath, {
- force: false
- },
- function() {
- uni.hideLoading()
- plus.nativeUI.toast(
- "热更新成功");
- uni.clearStorageSync();
- plus.nativeUI.toast(
- "缓存清除成功");
- that.$api.doRequest('post',
- '/auth/api/logout')
- .then(res => {
- if (res.data
- .data) {
- that.$store
- .commit(
- 'logout'
- )
- that.$api
- .logout()
- plus.nativeUI
- .toast(
- "登出成功"
- );
- plus.runtime
- .restart();
- plus.nativeUI
- .toast(
- "重启成功"
- );
- }
- })
- plus.runtime.restart();
- },
- function(e) {
- uni.hideLoading()
- console.log(e)
- plus.nativeUI.toast(
- `热更新失败:${e.message}`
- );
- });
- }
- }
- });
- } else {
- this.content = '您当前版本为最新版本'
- this.isShowAlert = true
- }
- });
- }
- }
- })
- }
- // #endif
- },
- UpdataPassword() {
- uni.navigateTo({
- url: `/pages/public/reset?phone=${this.userInfo.phone}`
- })
- },
- clearStorage() {
- let that = this
- uni.clearStorage({
- success: function(res) {
- console.log('success');
- that.goOpenService()
- }
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- goOpenService() {
- if (this.content == '您当前版本为最新版本') {
- this.isShowAlert = false
- return
- }
- uni.hideTabBarRedDot({
- index: 3
- })
- uni.setStorageSync("cangid",'')
- // uni.clearStorageSync();
- var that = this
-
- this.$api.doRequest('post', '/auth/api/logout').then(res => {
- if (res.data.data) {
- }
- })
- this.$store.commit('logout')
- this.$api.logout()
- uni.navigateTo({
- url: `/pages/public/login`
- })
- },
- getList() {
- this.userInfo = uni.getStorageSync('userInfo')
- this.headUrl = this.userInfo.avatarUrl
- if (this.headUrl == null || this.headUrl == "") {
- this.headUrl = "../../static/img/myimg/YongHu@3x.png"
- }
- this.username = this.userInfo.userName
- if (!uni.getStorageSync('userInfo').wechatNo) {
- this.wechatNo = this.userInfo.userName
- } else {
- this.wechatNo = this.userInfo.wechatNo
- }
- },
- switchPicture() {
- uni.navigateTo({
- url: `/pages/user/set_picture`
- })
- },
- nickname(username) {
- uni.navigateTo({
- url: `/pages/user/set_nickname?nickname=${username}`
- })
- },
- nickname1(username) {
- uni.navigateTo({
- url: `/pages/user/set_wechatNo?nickname=${username}`
- })
- },
- exitlogin() {
- },
- fankui() {
- uni.navigateTo({
- url: `/pages/user/fankui`
- })
- },
- unsubscribe() {
- var that = this
- uni.clearStorage({
- success: function(res) {
- console.log('success');
- uni.hideTabBarRedDot({
- index: 3
- })
- that.$api.doRequest('post', '/auth/api/logout').then(res => {
- if (res.data.data) {
- }
- })
- that.$store.commit('logout')
- that.$api.logout()
- // plus.nativeUI.toast(
- // "注销成功");
- uni.navigateTo({
- url: `/pages/public/login`
- })
- }
- })
- },
- logout() {
- // const that = this
- this.isShowAlert = true
- // uni.showModal({
- // title: '询问',
- // content: '您确定要退出吗?',
- // cancelText: '取消',
- // confirmText: '确定',
- // success: (e) => {
- // if (e.confirm) {
- // uni.hideTabBarRedDot({
- // index: 3
- // })
- // uni.clearStorageSync();
- // that.$store.commit('logout')
- // that.$api.logout()
- // uni.navigateTo({
- // url: `/pages/public/login`
- // })
- // }
- // }
- // })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #F5F6FA;
- }
- .container {
- padding: 10px 0 0px;
- }
- .headPortrait {
- width: 100%;
- height: 52px;
- margin-top: 15px;
- background-color: #FFFFFF;
- border-radius: 6px;
- // justify-content: flex-end;
- }
- .title {
- font-size: 16px;
- line-height: 50px;
- font-weight: 600;
- margin-left: 10px;
- }
- .pictures {
- justify-content: flex-end;
- width: 35px;
- height: 35px;
- background-color: #E0FAF6;
- border-radius: 18px;
- }
- .picture {
- width: 35px;
- height: 35px;
- }
- .arrow {
- margin-left: 15px;
- width: 8px;
- height: 12px;
- // justify-content: flex-end
- }
- .username {
- line-height: 50px;
- color: #6D6D72;
- }
- .sign {
- width: 18px;
- height: 18px;
- top: 4px;
- margin-right: 6px;
- }
- .cu-list>.cu-item:after {
- border: none;
- }
- .exitloginwrap {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- padding-bottom: 20px;
- }
- .exitlogin {
- width: 90%;
- background: #fff;
- border-radius: 30px;
- color: #FB1E1E;
- font-size: 17px;
- }
- .exitlogin:after {
- border: none;
- }
- .version_css {
- // margin-right: 10rpx;
- color: #9D9D9D;
- font-size: 32rpx;
- text-align: center;
- }
- .agreement {
- display: flex;
- margin: 0 auto;
- text-align: center;
- .text {
- margin: 0 auto;
- text-align: center;
- display: flex;
- }
- .path {
- color: #22C572;
- text-align: center;
- }
- }
- </style>
|