邀请页面
This commit is contained in:
@@ -27,8 +27,6 @@ const request = (parameter, hideLoding = true) => {
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log(store.getters.getToken)
|
||||
console.log(uni.getStorageSync('token'))
|
||||
// 注入header
|
||||
config.header = {
|
||||
'Accept': 'application/json',
|
||||
|
||||
@@ -21,7 +21,15 @@ const chainSeed = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取邀请码
|
||||
const invitationCode = () => {
|
||||
return request({
|
||||
url: 'user/invite'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
info,
|
||||
chainSeed
|
||||
chainSeed,
|
||||
invitationCode
|
||||
}
|
||||
|
||||
18
pages.json
18
pages.json
@@ -57,7 +57,13 @@
|
||||
"name": "User",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTextStyle": "white",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"backgroundColor": "#34CE98",
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -302,6 +308,13 @@
|
||||
"backgroundColorTop": "#34CE98",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/invitation/invitation",
|
||||
"name": "Invitation",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
@@ -333,8 +346,5 @@
|
||||
},
|
||||
"easycom": {
|
||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
||||
},
|
||||
"condition": { //模式配置,仅开发期间生效
|
||||
"current": 0 //当前激活的模式(list 的索引项)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
<input v-model="code" type="number" maxlength="4" placeholder="输入验证码">
|
||||
<button :disabled="getSms" size="mini" @click="getPhoneCode()">{{sendCode}}</button>
|
||||
</view>
|
||||
<view class="auth-input">
|
||||
<input v-model="parentId" type="number" placeholder="输入邀请码">
|
||||
</view>
|
||||
<view class="auth-button">
|
||||
<button @click="login('code')">登录</button>
|
||||
</view>
|
||||
@@ -36,6 +39,7 @@
|
||||
return {
|
||||
phone : '18245180131',
|
||||
code : '',
|
||||
parentId: '',
|
||||
getSms : false,
|
||||
sendCode: '获取验证码'
|
||||
};
|
||||
@@ -81,8 +85,9 @@
|
||||
title: '登录中'
|
||||
})
|
||||
smsAuth({
|
||||
mobileNo: this.phone,
|
||||
mobileNo : this.phone,
|
||||
code : this.code,
|
||||
parent_id : this.parentId
|
||||
}).then((res) => {
|
||||
this.$store.commit('setToken', res.token_type + ' ' + res.access_token);
|
||||
if(res.is_new){
|
||||
|
||||
142
pages/invitation/invitation.vue
Normal file
142
pages/invitation/invitation.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
|
||||
<template>
|
||||
<view class="invitation">
|
||||
<view class="invitation-refund">
|
||||
<view class="invitation-refund-btn" @click="onBack">
|
||||
<uni-icons type="back" color="white" size="24"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<image class="invitation-back" src="@/static/img/code_back.png" mode="aspectFill"></image>
|
||||
<view class="invitation-content">
|
||||
<view class="invitation-lay">
|
||||
<image class="invitation-code" :src="code"></image>
|
||||
<view class="invitation-text">
|
||||
<view class="invitation-text-code" @click="copyInvite"><text>{{invite}}</text>点击复制</view>
|
||||
<view class="invitation-text-sub">扫码下载共力生态App</view>
|
||||
<view class="invitation-text-sub">邀请好友增加共力分增长</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="invitation-btn">分享邀请</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { invitationCode } from '@/apis/interfaces/user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
invite: '',
|
||||
code : '',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
invitationCode().then(res => {
|
||||
console.log(res)
|
||||
this.invite = res[0].invite
|
||||
this.code = res[0].code
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 返回
|
||||
onBack(){
|
||||
this.$Router.back()
|
||||
},
|
||||
// 复制邀请码
|
||||
copyInvite(){
|
||||
uni.setClipboardData({
|
||||
data: this.invite,
|
||||
success() {
|
||||
uni.showToast({
|
||||
title: '邀请码已复制',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.invitation{
|
||||
position: relative;
|
||||
background: #1c2472;
|
||||
min-height: 100vh;
|
||||
.invitation-refund{
|
||||
@extend .ios-top;
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
left: $margin*2;
|
||||
z-index: 9;
|
||||
.invitation-refund-btn{
|
||||
border-radius: 50%;
|
||||
line-height: 58rpx;
|
||||
width: 58rpx;
|
||||
height: 58rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
}
|
||||
}
|
||||
.invitation-back{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.invitation-content{
|
||||
padding: $padding*2;
|
||||
position: absolute;
|
||||
bottom: 5vh;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.invitation-lay{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
border-radius: $radius;
|
||||
padding: $padding;
|
||||
margin-bottom: $margin;
|
||||
color: white;
|
||||
.invitation-code{
|
||||
width: 168rpx;
|
||||
height: 168rpx;
|
||||
background: white;
|
||||
}
|
||||
.invitation-text{
|
||||
width: calc(100% - 198rpx);
|
||||
.invitation-text-code{
|
||||
font-size: 26rpx;
|
||||
line-height: 50rpx;
|
||||
text{
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
margin-right: 10rpx;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
.invitation-text-sub{
|
||||
font-size: 26rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.invitation-btn{
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
background: linear-gradient(to top left, #2b307f, #83a8de);
|
||||
color: white;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 账户信息 -->
|
||||
<view class="life-header">
|
||||
<view class="life-header-flex">
|
||||
<view class="life-header-item">0.00共力值</view>
|
||||
<view class="life-header-item">0.00GLF</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 共力人生 -->
|
||||
|
||||
@@ -7,30 +7,16 @@
|
||||
<image class="cover" @click="onBtn('Setting', {})" :src="userInfo.avatar || require('@/static/user/cover.png')"
|
||||
mode="aspectFill" />
|
||||
<view class="user-content">
|
||||
<block v-if="$store.state.token != ''">
|
||||
<view class="name">{{ userInfo.nickname }}</view>
|
||||
<view class="tabs" v-if="userInfo.identity.length !== 0">
|
||||
<view class="tabs">
|
||||
<view class="tabs-item">
|
||||
<image src="@/static/user/icon_07.png" />
|
||||
VIP会员
|
||||
<image :src="identity.cover_url" mode="heightFix" />{{identity.identity_text}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tabs" v-else>
|
||||
<view class="tabs-item">
|
||||
<image src="@/static/user/icon_07.png" />
|
||||
普通用户
|
||||
<view class="chainAddress" v-if="userInfo.addr">
|
||||
<text @click="copy(userInfo.addr)">区块地址:{{userInfo.addr.substring(0,5) + '****' + userInfo.addr.substring(userInfo.addr.length - 5)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="chainAddress" v-if="userInfo.chain_address">
|
||||
<u-icon labelPos="left" @click="copy(userInfo.chain_address)" labelSize="14"
|
||||
labelColor="#fff" :label="userInfo.chain_address.substr(0, 20)+'...'" space="10"
|
||||
:name="require('@/static/imgs/copy.png')" size="16" />
|
||||
</view> -->
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="name">未登录</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -38,25 +24,24 @@
|
||||
<view class="vip-card">
|
||||
<view class="title">
|
||||
<image src="@/static/user/icon_06.png" mode="widthFix" />
|
||||
会员
|
||||
共力会员
|
||||
</view>
|
||||
<view class="subtitle">
|
||||
<u-notice-bar :text="cardText" icon="" bgColor="" duration="3000" color="#fcc692" direction="column">
|
||||
</u-notice-bar>
|
||||
</view>
|
||||
<!-- v-if="userInfo.identity.length === 0" -->
|
||||
<view class="btn" @click="onBtn('Vip', {})">开通</view>
|
||||
<view class="btn" @click="onBtn('Vip', {})">{{userInfo.isOpenVip ? '开通': '续费'}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 健康数据 -->
|
||||
<view class="health-flex">
|
||||
<view class="health-flex-item" @click="onBtn('AccountIntegral', {})">
|
||||
<view class="title">共力值</view>
|
||||
<view class="num">0.00</view>
|
||||
<view class="num">{{account.glz}}</view>
|
||||
</view>
|
||||
<view class="health-flex-item" @click="onBtn('AccountDt', {})">
|
||||
<view class="title">DT积分</view>
|
||||
<view class="num">0.00</view>
|
||||
<view class="num">{{account.dt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单 -->
|
||||
@@ -94,7 +79,7 @@
|
||||
地址管理
|
||||
<uni-icons class="forward" type="forward" color="#999" />
|
||||
</view>
|
||||
<view class="btns-box-item">
|
||||
<view class="btns-box-item" @click="onBtn('Invitation', {})">
|
||||
<image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix" />
|
||||
分享邀请
|
||||
<uni-icons class="forward" type="forward" color="#999" />
|
||||
@@ -140,16 +125,25 @@
|
||||
info,
|
||||
chainSeed
|
||||
} from '@/apis/interfaces/user';
|
||||
import userAuth from '@/public/userAuth';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
cardText: ['开通会员加速共力值增长', '前10000名用户专享阶段折扣价格'],
|
||||
cardText: [],
|
||||
userInfo: {
|
||||
nickname: '',
|
||||
avatar: '',
|
||||
identity: []
|
||||
nickname : '',
|
||||
addr : '',
|
||||
avatar : '',
|
||||
isOpenVip : '',
|
||||
},
|
||||
identity : {
|
||||
button_cover_url: '',
|
||||
cover_url : '',
|
||||
identity_text : ''
|
||||
},
|
||||
account : {
|
||||
glz : 0.00,
|
||||
dt : 0.00
|
||||
},
|
||||
mnemonic : '',
|
||||
wordsShow: false
|
||||
@@ -162,12 +156,19 @@
|
||||
// 用户信息
|
||||
getInfo() {
|
||||
if (this.$store.state.token === '') return;
|
||||
info()
|
||||
.then(res => {
|
||||
info().then(res => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.nickname
|
||||
});
|
||||
this.userInfo = res;
|
||||
this.cardText = res.identity_array
|
||||
this.userInfo = {
|
||||
nickname : res.nickname,
|
||||
addr : res.addr,
|
||||
avatar : res.avatar,
|
||||
isOpenVip : res.is_open_vip,
|
||||
}
|
||||
this.identity = res.identity
|
||||
this.account = res.account
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
@@ -310,10 +311,8 @@
|
||||
font-size: $title-size + 8;
|
||||
@extend .nowrap;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
padding-top: 10rpx;
|
||||
|
||||
&-item {
|
||||
background: rgba($color: #000000, $alpha: 0.3);
|
||||
font-size: $title-size-sm - 4;
|
||||
@@ -323,8 +322,8 @@
|
||||
border-radius: 20rpx;
|
||||
|
||||
image {
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 2rpx;
|
||||
margin-right: 8rpx;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="vip-user">
|
||||
<image class="user-cover" :src="user.avatar" mode="aspectFill"></image>
|
||||
<view class="user-nickname">{{user.nickname}}</view>
|
||||
<view class="user-date">到期日期:{{identity.ended_at}}</view>
|
||||
<view class="user-date">到期日期:{{endedAt}}</view>
|
||||
<view class="vip-renewal" v-if="!isOpen">续费</view>
|
||||
</view>
|
||||
<view class="user-cards">
|
||||
@@ -68,8 +68,9 @@
|
||||
identity: {
|
||||
identity_text: '',
|
||||
cover_url: '',
|
||||
ended_at: ''
|
||||
},
|
||||
// 到期时间
|
||||
endedAt: '',
|
||||
// 下级身份
|
||||
nextIdentity:{
|
||||
identity_text: ''
|
||||
@@ -97,6 +98,7 @@
|
||||
this.secondRule = res.second_rule
|
||||
this.nextIdentity = res.next_identity
|
||||
this.identity = res.identity
|
||||
this.endedAt = res.identity_ended_at
|
||||
this.user = res.user
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
|
||||
BIN
static/img/code_back.png
Normal file
BIN
static/img/code_back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 MiB |
File diff suppressed because one or more lines are too long
6976
unpackage/dist/dev/app-plus/app-service.js
vendored
6976
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
735
unpackage/dist/dev/app-plus/app-view.js
vendored
735
unpackage/dist/dev/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/dev/app-plus/manifest.json
vendored
2
unpackage/dist/dev/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
BIN
unpackage/dist/dev/app-plus/static/img/code_back.png
vendored
Normal file
BIN
unpackage/dist/dev/app-plus/static/img/code_back.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 MiB |
Reference in New Issue
Block a user