|
|
@@ -1,9 +1,6 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
- <view
|
|
|
- class="content"
|
|
|
- :style="userinfo.is_authentication == 1 ? 'padding-top:30rpx;' : ''"
|
|
|
- >
|
|
|
+ <view class="content" :style="isShiMing ? '' : 'padding-top:30rpx;'">
|
|
|
<!-- 用户信息 -->
|
|
|
<view class="uerInfo mar_t16 flex_r">
|
|
|
<view class="user_img">
|
|
|
@@ -15,8 +12,8 @@
|
|
|
></image>
|
|
|
<view
|
|
|
class="coupon_info flex_r flex_ac"
|
|
|
- v-if="isShiMing"
|
|
|
@tap="goToAutonym"
|
|
|
+ v-if="isShiMing"
|
|
|
>
|
|
|
完成实名认证,享受更多权益
|
|
|
<image
|
|
|
@@ -26,20 +23,15 @@
|
|
|
@tap.stop="closeAuto"
|
|
|
>
|
|
|
</image>
|
|
|
- <view class="sj_icon"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <block v-if="userinfo && userinfo != ''">
|
|
|
+ <block v-if="userinfo.nickname">
|
|
|
<view class="user_con flex_c">
|
|
|
<view class="user_name flex_r flex_ae ellipsis">
|
|
|
<view @click="goto('/pages/my/userinfo')">{{
|
|
|
userinfo.nickname
|
|
|
}}</view>
|
|
|
- <text
|
|
|
- >({{
|
|
|
- userinfo.is_authentication == 0 ? "未实名" : "已实名"
|
|
|
- }})</text
|
|
|
- >
|
|
|
+ <text v-if="isAuthentication">({{ userinfo.is_authentication == 0 ? "未实名" : "已实名" }})</text>
|
|
|
</view>
|
|
|
<view class="flex_r flex_ac">
|
|
|
<view class="user_level clearfix">
|
|
|
@@ -393,11 +385,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-let page = 1;
|
|
|
let app = getApp();
|
|
|
var appEv = app.$vm.$options;
|
|
|
-import authorizeModule from "@/components/authorize-module/index";
|
|
|
import uniCopy from "@/utils/copy";
|
|
|
+import authorizeModule from "@/components/authorize-module/index";
|
|
|
import { get, post } from "@/request/api.js";
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -410,7 +401,7 @@ export default {
|
|
|
shopInfo: {}, // 商铺信息
|
|
|
userInfoAccount: {}, // 账户数据
|
|
|
customerServiceWeiXin: "", // 客服微信
|
|
|
- isShiMing: true,
|
|
|
+ isShiMing: true, //未实名提示弹窗
|
|
|
agentName: "", // 缘起
|
|
|
user_id: undefined,
|
|
|
userinfo: undefined, // 获取用户信息
|
|
|
@@ -420,33 +411,30 @@ export default {
|
|
|
// isGetUserInfo:false,
|
|
|
invited: "",
|
|
|
|
|
|
- updataUserimg: {},
|
|
|
-
|
|
|
allChaYou: "",
|
|
|
+
|
|
|
+ isAuthentication: true, //是否开启实名模块
|
|
|
};
|
|
|
},
|
|
|
- onLoad: function (options) {
|
|
|
+ created () {
|
|
|
+ this.isAuthentication = uni.getStorageSync("isAuthentication");
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
//推荐人ID
|
|
|
if (options.invite) {
|
|
|
app.globalData.agentId = options.invite;
|
|
|
this.invited = options.invite;
|
|
|
}
|
|
|
- post("/my/chayou").then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.allChaYou = res.data.data.below + res.data.data.lower_level;
|
|
|
- }
|
|
|
- });
|
|
|
+ this.closeAuto(); //关闭实名功能
|
|
|
+ this.getchayou(); //获取茶友
|
|
|
},
|
|
|
- onShow: function () {
|
|
|
+ onShow() {
|
|
|
let token = uni.getStorageSync("token");
|
|
|
-
|
|
|
this.userinfo = uni.getStorageSync("userinfo");
|
|
|
- this.isShiMing = this.userinfo.is_authentication == 0 ? true : false;
|
|
|
|
|
|
if (!token) {
|
|
|
this.login();
|
|
|
- }
|
|
|
- if (token) {
|
|
|
+ }else {
|
|
|
this.getuserInfo();
|
|
|
}
|
|
|
},
|
|
|
@@ -475,7 +463,7 @@ export default {
|
|
|
} else {
|
|
|
that.unid = res.data.unid;
|
|
|
that.shopInfo = app.globalData.shopInfo;
|
|
|
- that.showAuth = true;
|
|
|
+ that.showAuth = true; //调取授权弹窗
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -488,6 +476,7 @@ export default {
|
|
|
this.goto("/pages/my/login");
|
|
|
// #endif
|
|
|
},
|
|
|
+ // 获取手机号
|
|
|
onauthGetTelSuccess(da) {
|
|
|
this.showAuth = false;
|
|
|
post("getMobile", {
|
|
|
@@ -500,18 +489,19 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 获取userinfo
|
|
|
getuserInfo() {
|
|
|
post("/user/userinfo").then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
uni.setStorageSync("userinfo", res.data.data);
|
|
|
this.userinfo = res.data.data;
|
|
|
- this.isShiMing = this.userinfo.is_authentication == 0 ? true : false;
|
|
|
+ if(this.isAuthentication) this.isShiMing = this.userinfo.is_authentication == 0;
|
|
|
+ else this.isShiMing = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
//授权并登录
|
|
|
- onAuthSuccess: function () {
|
|
|
+ onAuthSuccess() {
|
|
|
var that = this;
|
|
|
uni.showLoading({
|
|
|
mask: true,
|
|
|
@@ -523,53 +513,42 @@ export default {
|
|
|
},
|
|
|
// 跳转到实名页面
|
|
|
goToAutonym() {
|
|
|
- // post('/user/isPayAuth').then(res => {
|
|
|
- // if(res.code === 0){
|
|
|
- // if(res.data.)
|
|
|
- // }
|
|
|
- // })
|
|
|
- // return
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/autonym-submit/index",
|
|
|
- });
|
|
|
+ this.goto("/pages/autonym-submit/index")
|
|
|
},
|
|
|
- // 关闭实名信息
|
|
|
+ // 关闭实名信息 提示
|
|
|
closeAuto() {
|
|
|
this.isShiMing = false;
|
|
|
},
|
|
|
// 未开放提示信息
|
|
|
- SetHint: function () {
|
|
|
+ SetHint() {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/tea-rule/index",
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
// 跳转到分享页面
|
|
|
- getImgPage: function () {
|
|
|
- let that = this;
|
|
|
- if (this.userinfo.is_authentication == 1) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/invi-img/index",
|
|
|
- });
|
|
|
- } else {
|
|
|
- appEv.errTips("您还未实名");
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/autonym-submit/index",
|
|
|
- });
|
|
|
+ getImgPage() {
|
|
|
+ if(this.isAuthentication){
|
|
|
+ if (this.userinfo.is_authentication == 1) {
|
|
|
+ this.goto("/pages/invi-img/index")
|
|
|
+ }else{
|
|
|
+ appEv.errTips("您还未实名");
|
|
|
+ this.goToAutonym();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.goto("/pages/invi-img/index")
|
|
|
}
|
|
|
},
|
|
|
// 跳转到提现页面
|
|
|
- getToCash: function () {
|
|
|
- let that = this;
|
|
|
- if (this.userinfo.is_authentication == 1) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/cash/index",
|
|
|
- });
|
|
|
- } else {
|
|
|
- appEv.errTips("您还未实名");
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/autonym-submit/index",
|
|
|
- });
|
|
|
+ getToCash() {
|
|
|
+ if(this.isAuthentication){
|
|
|
+ if (this.userinfo.is_authentication == 1) {
|
|
|
+ this.goto("/pages/cash/index")
|
|
|
+ }else{
|
|
|
+ appEv.errTips("您还未实名");
|
|
|
+ this.goToAutonym();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.goto("/pages/cash/index")
|
|
|
}
|
|
|
},
|
|
|
// 复制账号
|
|
|
@@ -604,13 +583,12 @@ export default {
|
|
|
url: "/pages/my-acc-money/my-acc-money",
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
// 更换头像
|
|
|
upheadimg() {
|
|
|
let that = this;
|
|
|
uni.chooseImage({
|
|
|
count: 1, // 最多可以选择的图片张数,默认9
|
|
|
- sizeType: ["compressed"], // original 原图,compressed 压缩图,默认二者都有
|
|
|
+ sizeType: ["original"], // original 原图,compressed 压缩图,默认二者都有
|
|
|
sourceType: ["album", "camera"], // album 从相册选图,camera 使用相机,默认二者都有
|
|
|
success: function (res) {
|
|
|
var arr = res.tempFiles;
|
|
|
@@ -626,6 +604,14 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ // 获取茶友
|
|
|
+ getchayou(){
|
|
|
+ post("my/chayou").then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.allChaYou = res.data.data.below + res.data.data.lower_level;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -657,16 +643,6 @@ page {
|
|
|
width: 26rpx;
|
|
|
}
|
|
|
|
|
|
-.sj_icon {
|
|
|
- position: absolute;
|
|
|
- top: 100%;
|
|
|
- left: 60rpx;
|
|
|
- border-top: 16rpx solid rgba(0, 0, 0, 0.8);
|
|
|
- border-right: 16rpx solid transparent;
|
|
|
- border-left: 16rpx solid transparent;
|
|
|
- border-bottom: 0;
|
|
|
-}
|
|
|
-
|
|
|
.coupon_info {
|
|
|
position: absolute;
|
|
|
top: -70rpx;
|