yunshangxie/pages/index/user.vue

251 lines
8.1 KiB
Vue
Raw Normal View History

2023-12-25 17:56:30 +08:00
<template>
<view style="background-color: #EBF4F7;letter-spacing: 1rpx;">
2024-04-20 14:57:39 +08:00
<view :style="{paddingTop: vuex_custom_bar_height +40+ 'rpx'}"
style="background: linear-gradient(50deg, #034EF9 0%, #05ACFF 99%);height: 400rpx;">
<view class="tn-flex tn-flex-center tn-flex-col-center" style="padding: 30rpx;width: 100%;">
2024-05-08 18:14:41 +08:00
<view v-if="login">
<image :src="apiImgUrl+userInfo.photo_image"
style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
</view>
<view v-if="!login">
<image src="/static/def.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
2024-04-20 14:57:39 +08:00
</view>
<view style="width: 100%;">
2024-04-23 11:58:07 +08:00
<view v-if="login" class="tn-flex tn-flex-col-center tn-flex-row-between">
2024-04-20 14:57:39 +08:00
<view style="margin-left: 20rpx;color: #fff">
2024-05-08 18:14:41 +08:00
<view style="font-size: 35rpx;">{{ userInfo.nikename }}</view>
2024-04-24 17:34:38 +08:00
<view style="font-size: 24rpx;margin-top: 10rpx;" v-if="userInfo.status==1">接口返回商会+职位</view>
2024-04-20 14:57:39 +08:00
</view>
2024-05-08 18:14:41 +08:00
<!-- <view @click="tn('/pages/index/my_edit')">-->
<!-- <image src="/static/ico13.png" style="width: 40rpx ;" mode="widthFix"></image>-->
<!-- </view>-->
</view>
<view v-if="!login" class="tn-flex tn-flex-col-center tn-flex-row-between">
<view style="margin-left: 20rpx;color: #fff">
<tn-button @click="loginMod = true">点击登陆</tn-button>
</view>
<!-- <view @click="tn('/pages/index/my_edit')">-->
<!-- <image src="/static/ico13.png" style="width: 40rpx ;" mode="widthFix"></image>-->
<!-- </view>-->
2023-12-25 17:56:30 +08:00
</view>
</view>
</view>
</view>
<view>
<view style="padding: 30rpx;margin-top:-115rpx;background-color: transparent;">
<view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between"
style="text-align: center;padding: 30rpx;background-color: #FFF;border-radius: 20rpx;box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(12,0,5,0.1);">
2024-04-24 17:34:38 +08:00
<view @click="tn('/pages/index/pizz_info?id='+userInfo.association_id)">
2023-12-25 17:56:30 +08:00
<view>
<image src="/static/ico5.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
<view style="margin-top: 10rpx;">
2024-04-23 11:58:07 +08:00
<text>所在商/协会</text>
2023-12-25 17:56:30 +08:00
</view>
</view>
2024-04-20 14:57:39 +08:00
<view @click="tn('/pages/index/events_my')">
2023-12-25 17:56:30 +08:00
<view>
<image src="/static/ico1.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
<view style="margin-top: 10rpx;">
<text>参与活动</text>
</view>
</view>
2024-04-20 14:57:39 +08:00
<view @click="tn('/pages/index/my_desc')">
2023-12-25 17:56:30 +08:00
<view>
<image src="/static/02_2.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
<view style="margin-top: 10rpx;">
<text>协会服务</text>
</view>
</view>
2024-04-24 17:34:38 +08:00
<view @click="tn('/pages/index/my_card?id='+userInfo.member_id)">
2023-12-25 17:56:30 +08:00
<view>
<image src="/static/ico6.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
<view style="margin-top: 10rpx;">
<text>我的名片</text>
</view>
</view>
</view>
</view>
<view style="background-color: #fff;">
<view style="padding:0px 20rpx;">
2024-05-08 18:14:41 +08:00
<!-- <tn-list-cell :arrow="true" @click="tn('/pages/index/my_pizz')">-->
<!-- <view class="tn-flex tn-flex-center tn-flex-col-center">-->
<!-- <image src="/static/ico7.png" style="width: 50rpx;height: 50rpx"></image>-->
<!-- <view style="margin-left: 20rpx;">所在商/协会</view>-->
<!-- </view>-->
<!-- </tn-list-cell>-->
2024-04-20 14:57:39 +08:00
<tn-list-cell :arrow="true" @click="tn('/pages/index/my_apply')">
2023-12-25 17:56:30 +08:00
<view class="tn-flex tn-flex-center tn-flex-col-center">
<image src="/static/ico8.png" style="width: 50rpx;height: 50rpx"></image>
<view style="margin-left: 20rpx;">入会申请记录</view>
</view>
</tn-list-cell>
2024-05-11 18:14:49 +08:00
<tn-list-cell :arrow="true" @click="tn('/pages/index/my_msg')">
2024-05-14 10:20:09 +08:00
<view class="tn-flex tn-flex-center tn-flex-col-center" style="position: relative;">
2024-05-11 18:14:49 +08:00
<image src="/static/ico9.png" style="width: 50rpx;height: 50rpx"></image>
<view style="margin-left: 20rpx;">我的消息</view>
2024-05-14 10:20:09 +08:00
<tn-badge style="position: absolute;right: 40rpx;" backgroundColor="#E83A30"
fontColor="#ffffff">9</tn-badge>
2024-05-11 18:14:49 +08:00
</view>
</tn-list-cell>
2024-05-08 18:14:41 +08:00
<!-- <tn-list-cell :arrow="true" @click="tn('/pages/index/my_assist')">-->
<!-- <view class="tn-flex tn-flex-center tn-flex-col-center">-->
<!-- <image src="/static/ico10.png" style="width: 50rpx;height: 50rpx"></image>-->
<!-- <view style="margin-left: 20rpx;">常见问题</view>-->
<!-- </view>-->
<!-- </tn-list-cell>-->
<tn-list-cell :arrow="true" @click="tn('/pages/index/my_idea')">
2023-12-25 17:56:30 +08:00
<view class="tn-flex tn-flex-center tn-flex-col-center">
2024-05-08 18:14:41 +08:00
<image src="/static/ico12.png" style="width: 50rpx;height: 50rpx"></image>
<view style="margin-left: 20rpx;">意见反馈</view>
2023-12-25 17:56:30 +08:00
</view>
</tn-list-cell>
2024-05-08 18:14:41 +08:00
<tn-list-cell :arrow="true" @click="loginAut">
2023-12-25 17:56:30 +08:00
<view class="tn-flex tn-flex-center tn-flex-col-center">
<image src="/static/ico11.png" style="width: 50rpx;height: 50rpx"></image>
2024-05-08 18:14:41 +08:00
<view style="margin-left: 20rpx;">退出帐号</view>
2023-12-25 17:56:30 +08:00
</view>
</tn-list-cell>
</view>
</view>
</view>
2024-05-08 18:14:41 +08:00
<tn-modal v-model="loginMod" :custom="true">
<view class="custom-modal-content">
<view style="text-align: center;font-size: 34rpx;">会员登陆</view>
<view class="text">
<tn-form ref="form" :labelWidth="120">
<tn-form-item label="手机号" prop="phone">
<tn-input v-model="loginData.phone" />
</tn-form-item>
<tn-form-item label="密码" prop="password">
<tn-input v-model="loginData.password" type="password" />
</tn-form-item>
</tn-form>
<view style="text-align: center;margin-top: 30rpx;">
<tn-button backgroundColor="#E6E6E6" fontColor="#ffffff"
@click="loginMod = false">取消</tn-button>
<tn-button backgroundColor="tn-bg-blue" fontColor="tn-color-white" style="margin-left: 30rpx"
@click="submitLogin">确定
</tn-button>
</view>
</view>
</view>
</tn-modal>
2023-12-25 17:56:30 +08:00
</view>
</template>
<script>
2024-05-08 18:14:41 +08:00
import {
getUserIndex,
loginDo
} from "@/util/api";
import store from "@/store";
2024-04-23 11:58:07 +08:00
2024-05-08 18:14:41 +08:00
export default {
2023-12-25 17:56:30 +08:00
data() {
return {
2024-04-23 11:58:07 +08:00
topCurrent: 0,
2024-05-08 18:14:41 +08:00
login: false,
loginMod: false,
userInfo: {},
apiImgUrl: this.$store.state.imgUrl,
loginData: {
openid: '',
phone: '',
password: '',
association_id: store.state.Gid
},
}
},
mounted() {
var uid = uni.getStorageSync('uid');
2024-05-14 10:20:09 +08:00
this.uid = uid;
this.getUserInfo();
2023-12-25 17:56:30 +08:00
},
methods: {
2024-05-14 10:20:09 +08:00
getUserInfo() {
2024-05-08 18:14:41 +08:00
getUserIndex({
2024-05-14 10:20:09 +08:00
member_b_id: this.uid,
member_id: this.uid
2024-05-08 18:14:41 +08:00
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.userInfo = res.data;
this.login = true;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
submitLogin() {
this.loginData.openid = uni.getStorageSync('openid');
loginDo(this.loginData)
.then(res => {
console.log(res);
if (res.code == 1) {
uni.showToast({
title: '登陆成功!',
icon: 'none',
duration: 2000
});
uni.setStorageSync('uid', res.data.id);
this.userInfo = res.data;
this.login = true;
this.loginMod = false;
} else {
uni.showToast({
title: '帐号或密码错误!',
icon: 'none',
duration: 2000
});
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
loginAut() {
var that = this;
uni.showModal({
title: '提示',
content: '确定要退出吗?',
success: function(res) {
if (res.confirm) {
uni.removeStorageSync('uid');
that.login = false;
}
}
});
},
2024-04-20 14:57:39 +08:00
tn(e) {
2024-05-08 18:14:41 +08:00
var uid = uni.getStorageSync('uid');
if (!uid) {
this.loginMod = true;
return;
}
2024-04-20 14:57:39 +08:00
uni.navigateTo({
url: e
})
}
2023-12-25 17:56:30 +08:00
}
}
</script>
<style>
2024-05-08 18:14:41 +08:00
</style>