123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <template>
- <view>
- <u-notify ref="uNotify" message="Hi uView"></u-notify>
- <!--头部-->
- <view class="my_top">
- <image src="../../static/images/top-bg.png" class="bg"></image>
- </view>
- <view class="list animated fadeInDown">
- <!--只有外籍商户和收购商才需要手动认证-->
- <view class="message _error" @click="go('/pages/authentication/index')"
- v-if="user.userType == 5 && user.auth == 0">
- <text class="icon"></text>
- <text>你还未认证,请先认证</text>
- <text class="icon" style="float: right"></text>
- </view>
- <view class="message _error" @click="go('/pages/authentication/purchaser/index')"
- v-if="user.userType == 3 && user.auth == 0">
- <text class="icon"></text>
- <text>你还未认证,请先认证</text>
- <text class="icon" style="float: right"></text>
- </view>
- <view class="message _info" @click="go('/pages/face/faceRegister')"
- v-if="(user.userType == 1 || user.userType == 2) && user.face == 0">
- <text class="icon"></text>
- <text>你还未人脸认证,请先人脸认证</text>
- <text class="icon" style="float: right"></text>
- </view>
- <view class="message _info" v-if="(user.userType == 1 || user.userType == 2) && user.face == 1">
- <text class="icon"></text>
- <text>人脸已认证<text style="color: blue;margin-left: 5px;"></text></text>
- </view>
- <!--用户信息-->
- <view class="user" style="display: flex;">
- <image src="../../static/icon/user.png" mode="widthFix" class="head"></image>
- <view class="con">
- <view class="nickName omit">{{user.name}}({{ user.phone }})</view>
- <view class="tag" v-if="user.userType == 1">边民</view>
- <view class="tag" v-if="user.userType == 2">组长</view>
- <view class="tag" v-if="user.userType == 3">收购商</view>
- <view class="tag" v-if="user.userType == 4">司机</view>
- <view class="tag" v-if="user.userType == 5">商户</view>
- <view class="tag" v-if="user.userType == 6">合作社</view>
- <view class="tag" style="margin-left: 0.5rem;" v-if="user.userType == 1||user.userType == 2"
- @click="go('/pages/wallet/wallet')">服务点数: {{ user.wallet }}</view>
- </view>
- <view class="clear"></view>
- </view>
- <view class="cmd">
- <view class="s_item" @click="go('/pages/personal/bankInfo')">
- <text class="icon ic"></text>
- <text class="title">银行卡</text>
- <text class="icon arrow"></text>
- </view>
- <view v-if="user.userType==1" class="s_item" @click="go('/pages/personal/myGroup')">
- <text class="icon ic"></text>
- <text class="title">我的互助组</text>
- <text class="icon arrow"></text>
- </view>
- <view class="s_item" @click="go('/pages/login/userAgreement?id=1')">
- <text class="icon ic"></text>
- <text class="title">用户协议</text>
- <text class="icon arrow"></text>
- </view>
- <view class="s_item" @click="go('/pages/login/userAgreement?id=2')">
- <text class="icon ic"></text>
- <text class="title">隐私协议</text>
- <text class="icon arrow"></text>
- </view>
- <!-- <view class="s_item" @click="go('/pages/personal/setting')">
- <text class="icon ic"></text>
- <text class="title">设置</text>
- <text class="icon arrow"></text>
- </view> -->
- <view class="s_item" @click="go('/pages/personal/editPassword')">
- <text class="icon ic"></text>
- <text class="title">修改密码</text>
- <text class="icon arrow"></text>
- </view>
- <view class="s_item " @click="go('/pages/personal/group')" v-if="user.userType==1&&!user.groupName">
- <text class="icon ic"></text>
- <text class="title" style="color: firebrick;;font-weight: bold;">加入互助组</text>
- <text class="icon arrow"></text>
- </view>
- <view class="s_item ">
- <text class="icon ic"></text>
- <text class="title">APP版本 {{version}}</text>
- </view>
- </view>
- <button class="btn exit" @click="exitLogin()">退出登录</button>
- <button class="btn exit" @click="cancelAccount()">注销账号</button>
- </view>
- <view class="version">
- <view>
- <view>Copyright@2024-2030</view>
- <view>天保国际物流投资有限公司版权所有</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- user: {},
- version: uni.getAppBaseInfo().appVersion
- };
- },
- onLoad() {
- },
- onShow() {
- this.user = this.getUser();
- this.http.request({
- url: '/sp-admin/app/AppUser/getAuth',
- success: res => {
- this.user.auth = res.data.data.auth;
- this.user.face = res.data.data.face;
- if (this.user.userType == 1) {
- this.user.groupName = res.data.data.groupName;
- this.user.groupId = res.data.data.groupId;
- this.user.leaderName = res.data.data.leaderName;
- this.user.leaderPhone = res.data.data.leaderPhone;
- if (!this.user.groupName) {
- this.$refs.uNotify.show({
- top: 10,
- type: 'error',
- color: '#ffffff',
- bgColor: '#ff5500',
- message: '未加入互助组,请先加入互助组',
- duration: 1000 * 20,
- fontSize: 20,
- safeAreaInsetTop: true
- })
- return;
- }
- }
- uni.setStorageSync('info', this.user);
- }
- });
- if (this.user.userType === 1) {
- this.http.request({
- url: '/level-one-server/app/TbPeople/getById',
- data: {
- id: this.user.fkId
- },
- success: res => {
- this.user.wallet = res.data.data.wallet;
- uni.setStorageSync('info', this.user);
- }
- });
- }
- },
- methods: {
- makePhoneCall(phone) {
- uni.makePhoneCall({
- phoneNumber: phone
- });
- },
- order() {
- if (!this.hasAuth()) {
- uni.navigateTo({
- url: '/pages/authentication/index'
- });
- return;
- }
- //组长
- if (this.user.userType == 2) {
- uni.navigateTo({
- url: 'user'
- });
- }
- //外籍商户
- if (this.user.userType == 5) {
- uni.navigateTo({
- url: '/pages/market/one/merchant/order/list'
- });
- }
- //收购商
- if (this.user.userType == 3) {
- uni.navigateTo({
- url: '/pages/market/two/purchaser/order/list'
- });
- }
- },
-
- wallet() {
- if (!this.hasAuth() && this.user.userType == 1) {
- uni.navigateTo({
- url: '/pages/wallet/wallet'
- });
- return;
- }
- },
- go(url) {
- if (!this.hasAuth() && this.user.userType == 5) {
- uni.navigateTo({
- url: '/pages/authentication/index'
- });
- return;
- }
- if (!this.hasAuth() && this.user.userType == 3) {
- uni.navigateTo({
- url: '/pages/authentication/purchaser/index'
- });
- return;
- }
- uni.navigateTo({
- url: url
- });
- },
- exitLogin() {
- let param = {
- appUserId: this.getUser().id
- };
- uni.showModal({
- title: '提示',
- content: '确定注销登录?',
- success: res => {
- if (res.confirm) {
- uni.removeStorageSync('token');
- uni.removeStorageSync('info');
- uni.removeStorageSync('menu');
- uni.redirectTo({
- url: '/pages/login/login'
- });
- this.http.request({
- url: '/sp-admin/app/AppUser/logout',
- data: param,
- success: res => {
- }
- });
- }
- }
- });
- },
- cancelAccount() {
- let param = {
- id: this.getUser().id
- };
- uni.showModal({
- title: '提示',
- content: '确定注销账号?',
- success: res => {
- if (res.confirm) {
- uni.removeStorageSync('token');
- uni.removeStorageSync('info');
- uni.removeStorageSync('menu');
- uni.redirectTo({
- url: '/pages/login/login'
- });
- this.http.request({
- url: '/sp-admin/app/AppUser/delete',
- data: param,
- success: res => {}
- });
- }
- }
- });
- }
- },
- };
- </script>
- <style lang="scss">
- page {
- background-color: #f5f5f5;
- }
- .my_top {
- position: relative;
- overflow: hidden;
- image {
- width: 100%;
- }
- }
- .list {
- position: relative;
- padding: 0px 20px 10px 20px;
- margin-top: -196px;
- .user {
- background-color: white;
- padding: 20px;
- border-radius: 8px;
- color: $font-c;
- .head {
- float: left;
- width: 55px;
- height: 55px;
- }
- .con {
- float: left;
- padding-left: 15px;
- width: 80%;
- .nickName {
- font-size: 16px;
- font-weight: bold;
- }
- .tag {
- background-color: #6799ad;
- color: white;
- float: left;
- font-size: 13px;
- padding: 2px 6px;
- border-radius: 5px;
- margin-top: 6px;
- }
- }
- .edit {
- float: right;
- font-size: 20px;
- margin-top: 17px;
- }
- }
- }
- .exit {
- margin-top: 20px;
- background-color: white;
- color: #f44336;
- }
- .version {
- margin-left: 15%;
- position: fixed;
- bottom: 25px;
- color: #888484;
- text-align: center;
- }
- </style>
|