|
|
@@ -0,0 +1,416 @@
|
|
|
+<template>
|
|
|
+ <view class="container">
|
|
|
+ <!-- 顶部 -->
|
|
|
+ <view class="head">
|
|
|
+ <view class="head_info flex_r flex_ac flex_jb">
|
|
|
+ <view class="flex_grow flex_r flex_ac">
|
|
|
+ <image class="head_img" :src="higherInfo.head_pic" mode=""></image>
|
|
|
+ <view class="flex_c flex_grow">
|
|
|
+ <view class="userInfo flex_r flex_ac">
|
|
|
+ <view class="user_name">{{ higherInfo.nickname }}</view>
|
|
|
+ <!-- <view class="level flex_r flex_ac flex_jc">{{
|
|
|
+ higherInfo.higherUp
|
|
|
+ }}</view> -->
|
|
|
+ </view>
|
|
|
+ <view class="flex_r flex_ac mar_t16">
|
|
|
+ <view class="account">{{ higherInfo.mobile || "" }}</view>
|
|
|
+ <view class="copyBalance" @tap="copyAccount(higherInfo.mobile)"
|
|
|
+ >复制</view
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="head_option flex_r flex_ac">
|
|
|
+ <!-- <image
|
|
|
+ class="option_weixin"
|
|
|
+ src="/static/weixin.png"
|
|
|
+ mode=""
|
|
|
+ @tap="copyText"
|
|
|
+ ></image> -->
|
|
|
+ <view class="option_hr"></view>
|
|
|
+ <image
|
|
|
+ class="option_phone"
|
|
|
+ src="/static/dianhua.png"
|
|
|
+ mode=""
|
|
|
+ @tap="dial(higherInfo.mobile)"
|
|
|
+ ></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="head_time flex_r flex_ac"
|
|
|
+ >注册时间:{{ $day(higherInfo.reg_time * 1000).format('YYYY-MM-DD HH:mm:ss') }}</view
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ <!-- 顶部-end -->
|
|
|
+
|
|
|
+ <!-- 茶友数量 -->
|
|
|
+ <view class="tea_con mar_t30">
|
|
|
+ <view class="tea_total flex_r flex_ac flex_jc">
|
|
|
+ <view class="total_con flex_c flex_ac flex_jc">
|
|
|
+ <view class="total_num"
|
|
|
+ >{{ myQuanTeaFriendNum || 0 }}<text>人</text></view
|
|
|
+ >
|
|
|
+ <view class="total_text">茶友总数</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="tea_info flex_r flex_ac">
|
|
|
+ <view
|
|
|
+ class="info_list flex_c flex_ac flex_jc borRight"
|
|
|
+ @tap="getToTeaList"
|
|
|
+ >
|
|
|
+ <view class="list_num">{{ myTeaFriendNum || 0 }}<text>人</text></view>
|
|
|
+ <view class="list_text">我的茶友</view>
|
|
|
+ </view>
|
|
|
+ <view class="info_list flex_c flex_ac flex_jc">
|
|
|
+ <view class="list_num"
|
|
|
+ >{{ myZhuanTeaFriendNum || 0 }}<text>人</text></view
|
|
|
+ >
|
|
|
+ <view class="list_text">转介绍茶友</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 茶友数量-end -->
|
|
|
+
|
|
|
+ <!-- <view class="setBtn flex_r flex_ac flex_jc" @tap="setContact"
|
|
|
+ >设置联系方式</view
|
|
|
+ > -->
|
|
|
+
|
|
|
+ <!-- 设置联系方式 -->
|
|
|
+ <popup ref="popup" type="center">
|
|
|
+ <view class="msg_con">
|
|
|
+ <view class="msg_head flex_r flex_ac flex_jb">
|
|
|
+ <view class="msg_title">填写信息</view>
|
|
|
+ <image
|
|
|
+ class="msg_close"
|
|
|
+ src="/static/cuowu_icon.png"
|
|
|
+ mode=""
|
|
|
+ @tap="closePopup"
|
|
|
+ ></image>
|
|
|
+ </view>
|
|
|
+ <view class="from">
|
|
|
+ <view class="from_list">
|
|
|
+ <input type="text" v-model="wxcode" placeholder="请输入微信号" />
|
|
|
+ </view>
|
|
|
+ <view class="from_list">
|
|
|
+ <input type="text" v-model="mobile" placeholder="请输入手机号" />
|
|
|
+ </view>
|
|
|
+ <view class="confimBtn flex_r flex_ac flex_jc" @tap="setUserInfo"
|
|
|
+ >提交</view
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </popup>
|
|
|
+ <!-- 设置联系方式-end -->
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+let app = getApp();
|
|
|
+// let reqApi = new ReqApi();
|
|
|
+var appEv = app.$vm.$options;
|
|
|
+// import { ReqApi } from "@/utils/reqTools.js";
|
|
|
+// import uniCopy from "@/js_sdk/xb-copy/uni-copy.js";
|
|
|
+import uniCopy from "../../utils/copy";
|
|
|
+import popup from "@/components/uni-popup/uni-popup.vue";
|
|
|
+import { post } from "@/request/api.js";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ popup,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ higherInfo: "",
|
|
|
+ myTeaFriendNum: "",
|
|
|
+ myZhuanTeaFriendNum: "",
|
|
|
+ myQuanTeaFriendNum: "",
|
|
|
+ wxcode: "",
|
|
|
+ mobile: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad: function () {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ loadData() {
|
|
|
+ post("/my/chayou").then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.higherInfo = res.data.data.superior;
|
|
|
+ this.myTeaFriendNum = res.data.data.below;
|
|
|
+ this.myZhuanTeaFriendNum = res.data.data.lower_level;
|
|
|
+ this.myQuanTeaFriendNum =
|
|
|
+ res.data.data.below + res.data.data.lower_level;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 填写我的信息
|
|
|
+ setUserInfo: function () {
|
|
|
+ let that = this;
|
|
|
+ let data = {
|
|
|
+ phone: this.mobile,
|
|
|
+ wxNumber: this.wxcode,
|
|
|
+ };
|
|
|
+ const info = reqApi.setUserInfo(data);
|
|
|
+ if (info) {
|
|
|
+ info.then((res) => {
|
|
|
+ if (res.data.status == 200) {
|
|
|
+ appEv.errTips(res.data.msg);
|
|
|
+ that.$refs.popup.close();
|
|
|
+ that.mobile = "";
|
|
|
+ that.wxcode = "";
|
|
|
+ } else {
|
|
|
+ appEv.errTips(res.data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 复制微信号
|
|
|
+ copyText: function () {
|
|
|
+ let that = this;
|
|
|
+ if (that.higherInfo.higherNumber == "") {
|
|
|
+ appEv.errTips("用户暂未设置微信");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ uniCopy({
|
|
|
+ content: that.higherInfo.higherNumber,
|
|
|
+ success: (res) => {},
|
|
|
+ error: (e) => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 复制账号
|
|
|
+ copyAccount: function (e) {
|
|
|
+ uniCopy({
|
|
|
+ content: e,
|
|
|
+ success: (res) => {},
|
|
|
+ error: (e) => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 设置联系方式
|
|
|
+ setContact: function () {
|
|
|
+ let that = this;
|
|
|
+ that.$refs.popup.open();
|
|
|
+ },
|
|
|
+ // 关闭窗口
|
|
|
+ closePopup: function () {
|
|
|
+ this.$refs.popup.close();
|
|
|
+ },
|
|
|
+ // 跳转到我的茶友列表
|
|
|
+ getToTeaList: function () {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/tea-list/index",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 拨打电话
|
|
|
+ dial: function (e) {
|
|
|
+ let that = this;
|
|
|
+ if (that.higherInfo.higherPhone == "") {
|
|
|
+ appEv.errTips("用户暂未设置电话");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ uni.makePhoneCall({
|
|
|
+ phoneNumber: e, //仅为示例
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+page {
|
|
|
+ background: #f5f5f5;
|
|
|
+}
|
|
|
+// 页面配置
|
|
|
+.container {
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+// 页面配置-end
|
|
|
+
|
|
|
+// 顶部
|
|
|
+.account {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #7f7f7f;
|
|
|
+}
|
|
|
+.option_weixin {
|
|
|
+ width: 42rpx;
|
|
|
+ height: 35rpx;
|
|
|
+}
|
|
|
+.option_phone {
|
|
|
+ width: 36rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ margin-left: 30rpx;
|
|
|
+}
|
|
|
+.user_name {
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #363638;
|
|
|
+ margin-right: 12rpx;
|
|
|
+}
|
|
|
+.head {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+.head_img {
|
|
|
+ width: 79rpx;
|
|
|
+ height: 79rpx;
|
|
|
+ margin-right: 30rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+}
|
|
|
+.option_hr {
|
|
|
+ width: 3rpx;
|
|
|
+ height: 66rpx;
|
|
|
+ background: rgba(0, 0, 0, 0.12);
|
|
|
+ margin-left: 30rpx;
|
|
|
+}
|
|
|
+.copyBalance {
|
|
|
+ padding: 0 10rpx;
|
|
|
+ background: #1cbe8c;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 22rpx;
|
|
|
+ margin-left: 12rpx;
|
|
|
+}
|
|
|
+.level {
|
|
|
+ width: 74rpx;
|
|
|
+ height: 26rpx;
|
|
|
+ background: #1cbe8c;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 20rpx;
|
|
|
+ line-height: 1;
|
|
|
+}
|
|
|
+.head_time {
|
|
|
+ width: 100%;
|
|
|
+ height: 94rpx;
|
|
|
+ padding: 0 24rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #606060;
|
|
|
+}
|
|
|
+.head_info {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 40rpx 24rpx 60rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
|
|
|
+}
|
|
|
+// 顶部-end
|
|
|
+
|
|
|
+// 茶友数量
|
|
|
+.list_num {
|
|
|
+ font-size: 36rpx;
|
|
|
+ color: #1cbe8c;
|
|
|
+}
|
|
|
+.total_num {
|
|
|
+ font-size: 40rpx;
|
|
|
+ color: #232323;
|
|
|
+}
|
|
|
+.list_text {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #606060;
|
|
|
+}
|
|
|
+.list_num text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #1cbe8c;
|
|
|
+}
|
|
|
+.total_num text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #232323;
|
|
|
+}
|
|
|
+.borRight {
|
|
|
+ border-right: 3rpx solid rgba(0, 0, 0, 0.12);
|
|
|
+}
|
|
|
+.info_list {
|
|
|
+ height: 100%;
|
|
|
+ width: 50%;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.total_text {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #606060;
|
|
|
+ margin-top: 12rpx;
|
|
|
+}
|
|
|
+.tea_con {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+.tea_info {
|
|
|
+ width: 100%;
|
|
|
+ height: 156rpx;
|
|
|
+ padding: 16rpx 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.tea_total {
|
|
|
+ width: 100%;
|
|
|
+ height: 260rpx;
|
|
|
+ border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
|
|
|
+}
|
|
|
+.total_con {
|
|
|
+ width: 164rpx;
|
|
|
+ height: 164rpx;
|
|
|
+ border: 6rpx solid #1cbe8c;
|
|
|
+ border-radius: 50%;
|
|
|
+}
|
|
|
+// 茶友数量-end
|
|
|
+
|
|
|
+// 设置联系方式
|
|
|
+.setBtn {
|
|
|
+ width: 100%;
|
|
|
+ height: 83rpx;
|
|
|
+ background: #1cbe8c;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 36rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ margin-top: 128rpx;
|
|
|
+}
|
|
|
+// 设置联系方式-end
|
|
|
+
|
|
|
+// 设置联系方式弹窗
|
|
|
+.msg_close {
|
|
|
+ width: 31rpx;
|
|
|
+ height: 31rpx;
|
|
|
+}
|
|
|
+.msg_title {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #252525;
|
|
|
+}
|
|
|
+.from_list input {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+.msg_con {
|
|
|
+ width: 650rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+.from {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 24rpx 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.confimBtn {
|
|
|
+ width: 100%;
|
|
|
+ height: 60rpx;
|
|
|
+ background: #1cbe8c;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 34rpx;
|
|
|
+}
|
|
|
+.msg_head {
|
|
|
+ width: 100%;
|
|
|
+ height: 88rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
|
|
|
+}
|
|
|
+.from_list {
|
|
|
+ width: 100%;
|
|
|
+ height: 60rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 2rpx;
|
|
|
+ margin-bottom: 24rpx;
|
|
|
+ background: #efefef;
|
|
|
+}
|
|
|
+// 设置联系方式弹窗-end
|
|
|
+</style>
|