17
This commit is contained in:
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="关于我们" />
|
||||
<view class="logo_area">
|
||||
<image src="@/static/images/about_logo.png" mode=""></image>
|
||||
<view>{{ appversion }}</view>
|
||||
|
||||
<info-item @click="checkUpdate" class="check" title="检测更新" content="" />
|
||||
<info-item @click="openurl('http://baidu.com')" class="check" title="官方网站" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=coom&title=商务合作')" class="check" title="商务合作" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=contract&title=用户协议')" class="check" title="用户协议" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=privacy&title=隐私政策')" class="check" title="隐私政策" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=aboutus&title=关于我们')" class="check" title="关于我们" content="" />
|
||||
<info-item @click="clearcache" class="check" title="清除缓存" content="" />
|
||||
<info-item @click="show = true" class="check" title="上传调试日志" content="" />
|
||||
|
||||
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
|
||||
<view class="slot-content">
|
||||
<u--input placeholder="日志数量" border="surround" v-model="line"></u--input>
|
||||
</view>
|
||||
</u-modal>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import {version } from '@/common/config'
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import {PageEvents } from "@/constant";
|
||||
import InfoItem from "../selfInfo/InfoItem.vue";
|
||||
import {checkUpgrade} from "@/api/login.js"
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
InfoItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
line: 10000,
|
||||
appversion: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getAppVersion();
|
||||
},
|
||||
mounted() {
|
||||
IMSDK.subscribe('uploadLogsProgress', this.uploadHandler);
|
||||
},
|
||||
beforeDestroy() {
|
||||
IMSDK.unsubscribe('uploadLogsProgress', this.uploadHandler);
|
||||
},
|
||||
methods: {
|
||||
uploadLog() {
|
||||
this.show = false
|
||||
IMSDK.asyncApi('uploadLogs',IMSDK.uuid(), {
|
||||
line: this.line,
|
||||
ex: ""
|
||||
})
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true,
|
||||
});
|
||||
},
|
||||
uploadHandler({data: {current,size},}) {
|
||||
console.log('uploadHandler', current, size)
|
||||
if (current >= size) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
getAppVersion() {
|
||||
let system = uni.getSystemInfoSync();
|
||||
const _this = this;
|
||||
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
|
||||
console.log(inf);
|
||||
_this.appversion = inf.version
|
||||
});
|
||||
},
|
||||
|
||||
checkRespHandler() {
|
||||
this.loading = false;
|
||||
},
|
||||
goto(url){
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
clearcache(){
|
||||
|
||||
},
|
||||
openurl(url){
|
||||
// #ifdef APP
|
||||
plus.runtime.openWeb(url)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
window.open(url);
|
||||
// #endif
|
||||
},
|
||||
// 验证是否升级
|
||||
checkUpdate() {
|
||||
this.loading = true;
|
||||
const _this = this;
|
||||
let system = uni.getSystemInfoSync();
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
||||
_this.loading = false;
|
||||
if(!res.data){
|
||||
uni.showToast({
|
||||
title:"已经是最新版本"
|
||||
})
|
||||
return ;
|
||||
}
|
||||
let skip_version = uni.getStorageSync('skip_version')
|
||||
if(res && res.version!=skip_version){
|
||||
uni.$emit('closeWebview')
|
||||
_this.setShow(_this.current, false)
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/upgrade?model=' + JSON.stringify(res),
|
||||
animationType:"fade-in"
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.logo_area {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 48rpx 0 16rpx 0;
|
||||
color: $uni-text-color;
|
||||
|
||||
image {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.check {
|
||||
margin-top: 26rpx;
|
||||
border-top: 1px #e8eaef solid;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 0;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.btn_row {
|
||||
padding: 0 44rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="账号设置" />
|
||||
|
||||
<view class="info_wrap">
|
||||
<setting-item @click="toBlockList" title="通讯录黑名单" :border="false" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import SettingItem from "@/components/SettingItem/index.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
MyAvatar,
|
||||
SettingItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toBlockList() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/user/blockList/index",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.info_wrap {
|
||||
background-color: #fff;
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
border-radius: 6px;
|
||||
|
||||
.qr_icon {
|
||||
width: 22px;
|
||||
height: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="通讯录黑名单" />
|
||||
|
||||
<u-list v-if="blockList.length > 0" class="block_list" height="1">
|
||||
<u-list-item v-for="item in blockList" :key="item.userID">
|
||||
<user-item :item="item">
|
||||
<view @click="tryRemove(item)" class="user_action" slot="action">
|
||||
移除
|
||||
</view>
|
||||
</user-item>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
|
||||
<view v-else class="empty">
|
||||
<image src="@/static/images/block_empty.png"></image>
|
||||
<text class="empty_text">暂无黑名单</text>
|
||||
</view>
|
||||
<!-- <u-empty icon="/static/images/block_empty.png" v-else text="暂无黑名单" iconSize="20" /> -->
|
||||
|
||||
<u-modal
|
||||
width="500rpx"
|
||||
showCancelButton
|
||||
:show="showComfirm"
|
||||
@confirm="confirm"
|
||||
@cancel="closeModal"
|
||||
content="确定将用户移除黑名单吗?"
|
||||
:asyncClose="true"
|
||||
></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import UserItem from "@/components/UserItem/index.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
MyAvatar,
|
||||
UserItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showComfirm: false,
|
||||
selectedUser: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
blockList() {
|
||||
return this.$store.getters.storeBlackList;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
tryRemove(item) {
|
||||
this.selectedUser = {
|
||||
...item,
|
||||
};
|
||||
this.showComfirm = true;
|
||||
},
|
||||
confirm() {
|
||||
IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.RemoveBlack,
|
||||
IMSDK.uuid(),
|
||||
this.selectedUser.userID,
|
||||
)
|
||||
.then(() => uni.$u.toast("移除成功"))
|
||||
.catch(() => uni.$u.toast("移除失败"))
|
||||
.finally(() => (this.showComfirm = false));
|
||||
},
|
||||
closeModal() {
|
||||
this.showComfirm = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.block_list {
|
||||
flex: 1;
|
||||
margin-top: 24rpx;
|
||||
|
||||
.user_item {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.user_action {
|
||||
position: absolute;
|
||||
right: 44rpx;
|
||||
font-size: 28rpx;
|
||||
color: $uni-color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
@include centerBox();
|
||||
flex-direction: column;
|
||||
margin-top: 25vh !important;
|
||||
|
||||
&_text {
|
||||
margin-top: 26rpx;
|
||||
color: #8e9ab0;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 237rpx;
|
||||
height: 244rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<view class="user_page">
|
||||
<view class="uni-white-bg">
|
||||
<view class="self_info_row"></view>
|
||||
|
||||
<view class="info_card">
|
||||
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="64" />
|
||||
|
||||
<view class="id_row">
|
||||
<text class="nickname">{{ selfInfo.nickname }}</text>
|
||||
<view class="id_row_copy" @click="copy">
|
||||
<text class="id">{{ selfInfo.userID }}</text>
|
||||
<image style="width: 32rpx; height: 32rpx" src="@/static/images/id_copy.png" mode="" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="qr" @click="toSelfQr">
|
||||
<img src="static/images/self_info_qr.png" alt="" />
|
||||
<img src="static/images/common_right.png" alt="" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- v-if="userinfo.role_id==2" -->
|
||||
<view class="vipbar" @click="goto('/pages/user/vip/vip')">
|
||||
<img src="/static/images/user/member_crown.png" alt="" />
|
||||
<text>会员到期时间:{{userinfo.expire_at}}</text>
|
||||
<u-button>我的权益</u-button>
|
||||
</view>
|
||||
<view class="vipbar" @click="goto('/pages/user/vip/vip')">
|
||||
<img src="/static/images/user/member_crown.png" alt="" />
|
||||
<text>开通会员立享特权</text>
|
||||
<u-button>开通</u-button>
|
||||
</view>
|
||||
<u-alert title="我的信息" type = "warning" :closable="closable" :description = "description"></u-alert>
|
||||
|
||||
<uni-list style="margin: 20rpx auto;width: 100%;">
|
||||
<uni-list-item title="我的信息" thumb="/static/images/profile_menu_info.png" to="/pages/user/selfInfo/index" clickable showArrow ></uni-list-item>
|
||||
<uni-list-item title="账号设置" thumb="/static/images/profile_menu_account.png" to="/pages/user/messageNotification/index" clickable showArrow ></uni-list-item>
|
||||
<uni-list-item title="关于我们" thumb="/static/images/profile_menu_about.png" to="/pages/user/accountSetting/index" clickable showArrow ></uni-list-item>
|
||||
</uni-list>
|
||||
<uni-list>
|
||||
<uni-list-item title="退出登录" thumb="/static/images/profile_menu_logout.png" @click="logout" clickable showArrow ></uni-list-item>
|
||||
</uni-list>
|
||||
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import util from "@/util";
|
||||
export default {
|
||||
components: {
|
||||
MyAvatar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
profileMenus: [
|
||||
{
|
||||
idx: 4,
|
||||
title: "退出登录",
|
||||
icon: require("static/images/profile_menu_logout.png"),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
selfInfo() {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...util,
|
||||
copy() {
|
||||
console.log(this.selfInfo)
|
||||
uni.setClipboardData({
|
||||
showToast: false,
|
||||
data: this.selfInfo.userID,
|
||||
success: function() {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "复制成功",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
logoutConfirm() {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
|
||||
uni.removeStorage({
|
||||
key: "IMToken",
|
||||
});
|
||||
uni.removeStorage({
|
||||
key: "BusinessToken",
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
}).finally(() => {
|
||||
uni.$u.route("/pages/common/login/index");
|
||||
});
|
||||
},
|
||||
|
||||
logout(){
|
||||
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定要退出当前账号吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "取消",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.logoutConfirm();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
toSelfQr() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userOrGroupQrCode`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/uni_modules/uni-scss/index.scss';
|
||||
.user_page {
|
||||
background-color: #ececec;
|
||||
.vipbar{
|
||||
background: #0c1c33;
|
||||
color: #FFF;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.self_info_row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 276rpx;
|
||||
//background-image: url("@/static/images/profile_top_bg.png");
|
||||
background-repeat: round;
|
||||
}
|
||||
|
||||
.info_card {
|
||||
width: 640rpx;
|
||||
height: 196rpx;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
margin: -120rpx auto 0 auto;
|
||||
padding: 0 36rpx;
|
||||
color: #0c1c33;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.id_row {
|
||||
@include vCenterBox();
|
||||
display: flex;
|
||||
//height: 46px;
|
||||
margin-left: 16rpx;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
|
||||
&_copy {
|
||||
@include vCenterBox();
|
||||
}
|
||||
|
||||
.nickname {
|
||||
@include nomalEllipsis();
|
||||
max-width: 400rpx;
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.id {
|
||||
color: #8e9ab0;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view @click="clickItem" class="info_item">
|
||||
<view class="left_label">
|
||||
<text>{{ title }}</text>
|
||||
</view>
|
||||
<view class="right_value">
|
||||
<slot name="value">
|
||||
<text class="content">{{ content }}</text>
|
||||
</slot>
|
||||
<u-icon v-if="showArrow" name="arrow-right" size="16" color="#999"></u-icon>
|
||||
</view>
|
||||
<u-loading-icon v-show="loading" class="loading_icon"></u-loading-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
title: String,
|
||||
content: String,
|
||||
showArrow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
clickItem() {
|
||||
this.$emit("click");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info_item {
|
||||
@include btwBox();
|
||||
height: 82rpx;
|
||||
padding: 0 44rpx;
|
||||
color: $uni-text-color;
|
||||
// border-bottom: 1px solid rgba(153,153,153,0.3);
|
||||
position: relative;
|
||||
|
||||
.right_value {
|
||||
@include vCenterBox();
|
||||
|
||||
.content {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.loading_icon {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="个人资料" />
|
||||
|
||||
<view class="info_wrap">
|
||||
<info-item :loading="loadingState.faceURL" @click="updateAvatar" title="头像">
|
||||
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="30" slot="value" />
|
||||
</info-item>
|
||||
<info-item @click="updateNickname" title="姓名" :content="selfInfo.nickname" />
|
||||
<info-item :loading="loadingState.gender" @click="updateGender" title="性别" :content="getGender" />
|
||||
<info-item :loading="loadingState.birth" @click="() => (showDatePicker = true)" title="生日"
|
||||
:content="getBirth" />
|
||||
</view>
|
||||
|
||||
<view class="info_wrap">
|
||||
<info-item :showArrow="false" title="手机号码" :content="selfInfo.mobile || '-'" />
|
||||
<info-item :showArrow="false" title="邮箱" :content="selfInfo.email || '-'" />
|
||||
</view>
|
||||
|
||||
<u-datetime-picker :minDate="0" :maxDate="nowDate" :show="showDatePicker" @confirm="confirmDate"
|
||||
@cancel="() => (showDatePicker = false)" v-model="selfInfo.birth" mode="date" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
businessInfoUpdate
|
||||
} from "@/api/login";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import dayjs from "dayjs";
|
||||
import InfoItem from "./InfoItem.vue";
|
||||
import util from "@/util";
|
||||
import {
|
||||
getPurePath
|
||||
} from "@/util/common";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
MyAvatar,
|
||||
InfoItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showDatePicker: false,
|
||||
loadingState: {
|
||||
faceURL: false,
|
||||
gender: false,
|
||||
birth: false,
|
||||
},
|
||||
nowDate: Date.now(),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
selfInfo() {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
},
|
||||
getGender() {
|
||||
if (this.selfInfo.sex === 0) {
|
||||
return "保密";
|
||||
}
|
||||
if (this.selfInfo.sex === 1) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
},
|
||||
getBirth() {
|
||||
console.log(this.selfInfo);
|
||||
const birth = this.selfInfo.birthday ?? 0;
|
||||
return dayjs(birth).format("YYYY-MM-DD");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...util,
|
||||
updateNickname() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/markOrIDPage/index?isSelfNickname=true&sourceInfo=${JSON.stringify(this.selfInfo)}`,
|
||||
});
|
||||
},
|
||||
updateGender() {
|
||||
uni.showActionSheet({
|
||||
itemList: ['保密',"男", "女"],
|
||||
success: async ({
|
||||
tapIndex
|
||||
}) => {
|
||||
this.loadingState.gender = true;
|
||||
await this.updateSelfInfo({gender: tapIndex,},"gender",);
|
||||
},
|
||||
});
|
||||
},
|
||||
updateAvatar() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
success: async ({
|
||||
tempFilePaths
|
||||
}) => {
|
||||
const path = tempFilePaths[0];
|
||||
const nameIdx = path.lastIndexOf("/") + 1;
|
||||
const typeIdx = path.lastIndexOf(".") + 1;
|
||||
const fileName = path.slice(nameIdx);
|
||||
const fileType = path.slice(typeIdx);
|
||||
this.loadingState.faceURL = true;
|
||||
const {
|
||||
data: {
|
||||
url
|
||||
},
|
||||
} = await IMSDK.asyncApi(IMSDK.IMMethods.UploadFile, IMSDK.uuid(), {
|
||||
filepath: getPurePath(tempFilePaths[0]),
|
||||
name: fileName,
|
||||
contentType: fileType,
|
||||
uuid: IMSDK.uuid(),
|
||||
});
|
||||
console.log(url);
|
||||
this.updateSelfInfo({
|
||||
faceURL: url,
|
||||
},
|
||||
"faceURL",
|
||||
);
|
||||
this.loadingState.faceURL = false;
|
||||
},
|
||||
});
|
||||
},
|
||||
toQrCode() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userOrGroupQrCode`,
|
||||
});
|
||||
},
|
||||
copyID() {
|
||||
uni.setClipboardData({
|
||||
data: this.selfInfo.userID,
|
||||
success: () => {
|
||||
uni.hideToast();
|
||||
this.$nextTick(() => {
|
||||
uni.$u.toast("复制成功");
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
async updateSelfInfo(data, key) {
|
||||
try {
|
||||
console.log(data);
|
||||
await businessInfoUpdate({
|
||||
userID: this.selfInfo.userID,
|
||||
...data,
|
||||
});
|
||||
await this.$store.dispatch("user/updateBusinessInfo");
|
||||
uni.$u.toast("修改成功");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
uni.$u.toast("修改失败");
|
||||
}
|
||||
this.loadingState[key] = false;
|
||||
},
|
||||
confirmDate({value}) {
|
||||
this.loadingState.birth = true;
|
||||
this.updateSelfInfo({birth: value,},"birth",);
|
||||
this.showDatePicker = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.info_wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
|
||||
.qr_icon {
|
||||
width: 22px;
|
||||
height: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-popup ref="popup" :closeOnClickOverlay="closeOnClickOverlay" mode="center" bgColor="none">
|
||||
<view :class="['n-ps-all-' + padding, 'n-bg-inverse', 'n-radius-base']" :style="customStyle">
|
||||
<view class="n-flex-column n-align-center">
|
||||
<text class="n-weight-7 n-color-text" :style="{fontSize:'34rpx'}">{{title}}</text>
|
||||
<text class="n-size-ss n-ms-top-s n-color-third" v-if="label">{{label}}</text>
|
||||
</view>
|
||||
<view class="n-flex-column n-align-center n-ms-bottom-ll" v-if="content">
|
||||
<text class="n-size-base n-ms-top-ll n-color-second">{{content}}</text>
|
||||
</view>
|
||||
<u-form class="n-ms-top-l" v-else labelWidth="40rpx" labelPosition="left">
|
||||
<u-form-item :class="['n-radius-' + inputRadius, 'n-bg-page', 'n-ps-base', 'n-ms-bottom-base']">
|
||||
<u-input v-model="input" :type="inputType" :focus="true" :maxlength="maxlength" :placeholder="place" border="none" clearable>
|
||||
<template v-slot:suffix>
|
||||
<text class="n-size-ss n-color-error" v-if="captcha" @click="sendSms">{{code_text}}</text>
|
||||
</template>
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<u-button class="n-ms-top-base" @click="submit" :text="buttonText" :color="buttonColor" type="error" shape="circle" throttleTime="1000"></u-button>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 验证码 -->
|
||||
<u-code ref="code" @change="changeCode" :seconds="seconds" :uniqueKey="captchaType" endText="获取验证码"></u-code>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name:"m-popup",
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '提示'
|
||||
},
|
||||
place: {
|
||||
type: String,
|
||||
default: '请输入内容'
|
||||
},
|
||||
content: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
captcha: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
padding: {
|
||||
type: String,
|
||||
default: 'base'
|
||||
},
|
||||
redirect: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
maxlength: {
|
||||
type: [String, Number],
|
||||
default: 10
|
||||
},
|
||||
inputType: {
|
||||
type: String,
|
||||
default: 'text'
|
||||
},
|
||||
buttonText: {
|
||||
type: String,
|
||||
default: '立即提交'
|
||||
},
|
||||
captchaType: {
|
||||
type: String,
|
||||
default: 'notice'
|
||||
},
|
||||
inputRadius: {
|
||||
type: String,
|
||||
default: 'll'
|
||||
},
|
||||
buttonColor: {
|
||||
type: String,
|
||||
default: '#fc3463'
|
||||
},
|
||||
customStyle: {
|
||||
type: Object,
|
||||
default(){
|
||||
return {width:'600rpx',marginBottom:'200rpx'}
|
||||
}
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
input: '',
|
||||
seconds: 60,
|
||||
code_text: '获取验证码'
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 展示弹窗
|
||||
open() {
|
||||
// 发送验证码
|
||||
if(this.captcha){
|
||||
this.sendSms()
|
||||
}
|
||||
this.$refs['popup'].open()
|
||||
},
|
||||
// 关闭弹窗
|
||||
close() {
|
||||
uni.hideKeyboard()
|
||||
this.$refs['popup'].close()
|
||||
},
|
||||
// 提交数据
|
||||
submit() {
|
||||
// 跳转链接
|
||||
if(this.redirect) {
|
||||
return uni.navigateTo({
|
||||
url:this.redirect
|
||||
})
|
||||
}
|
||||
// 输入提示
|
||||
if(!this.input) return showToast(this.place)
|
||||
|
||||
this.$emit('submit', this.input)
|
||||
|
||||
this.close()
|
||||
this.input = ''
|
||||
},
|
||||
// 获取验证码
|
||||
sendSms() {
|
||||
if(this.$refs['code'].canGetCode){
|
||||
let userinfo = getApp().globalData.userinfo
|
||||
sendSms({type:this.captchaType, mobile:userinfo.mobile}).then(res=>{
|
||||
this.$refs['code'].start()
|
||||
})
|
||||
}
|
||||
},
|
||||
// 验证码变化
|
||||
changeCode(evt) {
|
||||
this.code_text = evt
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-nav-bar
|
||||
left-icon="back"
|
||||
title="我的会员"
|
||||
@clickLeft="goto(1)"
|
||||
>
|
||||
</uni-nav-bar>
|
||||
<view class="m-navbg"></view>
|
||||
<view class="m-card n-ms-base n-ps-all-ll n-radius-base n-position-relative">
|
||||
<view class="n-flex-row n-align-center">
|
||||
<image class="m-avatar" :src="userinfo.avatar"></image>
|
||||
<view class="n-ms-left-base">
|
||||
<text class="m-card-text n-size-l n-weight-7">{{userinfo.nickname}}</text>
|
||||
<text class="m-card-text n-size-ss n-weight-7 n-ms-top-ss">{{userinfo.username}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="m-card-text n-size-s" :style="{marginTop:'50rpx'}">会员到期时间:{{userinfo.role_id==2 ? userinfo.expire_at:'未开通'}}</text>
|
||||
<image class="m-card-crown n-position-absolute" src="/static/images/user/member_crown.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="n-ps-base n-ms-top-ll">
|
||||
<text class="n-size-l n-weight-7">会员权益</text>
|
||||
<view class="n-flex-row n-wrap-wrap n-ms-top-ss">
|
||||
<u-cell-group>
|
||||
<u-cell :class="[idx%2==0 ? 'n-ms-right-s':'', 'n-bg-page', 'n-radius-s', 'n-ms-top-s', 'n-ps-tb-ss']"
|
||||
v-for="(item, idx) in powerList" :key="idx"
|
||||
:icon="item.image_text"
|
||||
:title="item.title"
|
||||
:label="item.content"
|
||||
:border="false"
|
||||
:iconStyle="{width:'80rpx',height:'80rpx',borderRadius:'40rpx'}" >
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-gap></u-gap>
|
||||
<view class="n-ps-base">
|
||||
<text class="n-size-l n-weight-7 n-ms-top-ss">会员套餐</text>
|
||||
<scroll-view class="n-flex-row n-ms-top-ll n-wrap-nowrap" :scroll-x="true" :show-scrollbar="false">
|
||||
<view :class="[idx==current ? 'm-thali-active':'m-thali', 'n-ps-all-ll', 'n-ms-right-l', 'n-flex-column', 'n-radius-base', 'n-align-center', 'n-position-relative']" v-for="(item, idx) in thaliList" :key="idx" @click="current=idx">
|
||||
<text class="n-size-l n-ms-top-s n-weight-7">{{item.title}}</text>
|
||||
<view class="n-flex-row n-align-end n-ms-top-base">
|
||||
<text class="m-card-text n-size-s">¥</text>
|
||||
<text class="m-card-text n-size-ll">{{item.price}}</text>
|
||||
</view>
|
||||
<text class="n-size-ss n-ms-top-ss n-color-forth n-text-decoration-through">¥{{item.orig_price}}</text>
|
||||
<u-tag class="n-ms-bottom-s n-ms-top-base"
|
||||
:text="'立省' + (item.orig_price - item.price) + '元'"
|
||||
size="mini" shape="circle"
|
||||
bgColor="#efcf95"
|
||||
borderColor="#efcf95"></u-tag>
|
||||
<!-- 标签 -->
|
||||
<u-button class="n-position-absolute" v-if="item.label" :text="item.label" :style="{top:0,left:0}" size="mini" color="#fc393f"></u-button>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="n-flex-row n-ms-top-l n-justify-center">
|
||||
<view class="n-flex-row n-wrap-wrap n-align-start n-ms-top-base n-align-center">
|
||||
<view>
|
||||
<u-checkbox-group activeColor="#efcf95" shape="circle">
|
||||
<u-checkbox name="1" size="17" @change="change"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<text class="n-size-ss n-lh-base n-color-third">已阅读并同意</text>
|
||||
<text class="n-size-ss n-lh-base n-color-link" v-for="(item, idx) in contractList" :key="idx"
|
||||
@click="goto(item.router)" :style="{color:'#8e6927'}">《{{item.title}}》</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="n-flex-row">
|
||||
<u-button class="n-flex-1 n-ms-top-base n-ms-right-base" v-if="config.member_link" @click="goto('/pages/common/webview' + queryParams({src:config.member_link,title:'购买激活码'}))" text="购买激活码" shape="circle" color="#fdc384" throttleTime="1000" plain></u-button>
|
||||
<u-button class="n-flex-1 n-ms-top-base" @click="showPopup" text="兑换会员" shape="circle" color="linear-gradient(to right, #fee1b7, #fdc384)" throttleTime="1000"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 兑换会员弹窗 -->
|
||||
<MPopup ref="popup" @submit="submit" title="兑换会员" place="请输入激活码" padding="l" buttonText="立即兑换" buttonColor="#fdc384"></MPopup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MPopup from "./m-popup";
|
||||
import util from "@/util/index.js"
|
||||
export default {
|
||||
components:{MPopup},
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
userinfo: {},
|
||||
thaliList: [],
|
||||
powerList: [],
|
||||
contractList: [],
|
||||
contractValue: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selfInfo() {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
},
|
||||
config() {
|
||||
return this.$store.getters.config;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
// 获取用户信息
|
||||
this.getUserinfo()
|
||||
// 获取会员套餐
|
||||
this.getMemberThali()
|
||||
// 获取会员权益
|
||||
this.getMemberPower()
|
||||
this.contractList = [
|
||||
{title:'用户协议', router:'/pages/common/webview' + this.queryParams({src:'contract', title:'用户协议'})},
|
||||
];
|
||||
},
|
||||
methods: {
|
||||
goto:util.goto,
|
||||
queryParams(){
|
||||
return "1";
|
||||
},
|
||||
// 数据提交
|
||||
submit(code) {
|
||||
return 1;
|
||||
memberExchange({code:code}, {custom:{auth:true}}).then(res=>{
|
||||
// 更新用户信息
|
||||
this.getUserinfo(true)
|
||||
})
|
||||
},
|
||||
// 展示弹窗
|
||||
showPopup() {
|
||||
if(!this.contractValue){
|
||||
return showToast('请阅读并同意用户协议')
|
||||
}
|
||||
this.$refs['popup'].open()
|
||||
},
|
||||
// 获取用户信息
|
||||
async getUserinfo(refresh) {
|
||||
await this.$store.dispatch("user/updateBusinessInfo");
|
||||
},
|
||||
// 获取会员套餐
|
||||
getMemberThali() {
|
||||
return 1;
|
||||
uni.$u.http.post('/friendcircle/create',param).then(res => {
|
||||
});
|
||||
getMemberThali((res)=>{ this.thaliList = res })
|
||||
},
|
||||
// 获取会员套餐
|
||||
getMemberPower() {
|
||||
return 1;
|
||||
getMemberPower((res)=>{ this.powerList = res })
|
||||
},
|
||||
change(e){
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// 获取用户信息
|
||||
this.getUserinfo()
|
||||
// 获取会员套餐
|
||||
this.getMemberThali()
|
||||
// 获取会员权益
|
||||
this.getMemberPower()
|
||||
// 获取系统配置
|
||||
this.config = getApp().globalData.config
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.m-card{
|
||||
margin-top: -160rpx;
|
||||
background-image: linear-gradient(to right, #feebc6, #efcf95);
|
||||
&-text{
|
||||
color: #8e6927;
|
||||
}
|
||||
&-crown{
|
||||
right: 10rpx;
|
||||
width: 220rpx;
|
||||
bottom: 10rpx;
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
.m-thali{
|
||||
border: 1px solid #f1f1f1;
|
||||
&-active{
|
||||
background-color: #fef8ec;
|
||||
border: 1px solid #f4c38b;
|
||||
}
|
||||
}
|
||||
.m-navbg{
|
||||
height: 200rpx;
|
||||
background-color: #282623;
|
||||
}
|
||||
.m-avatar{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 60rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user