zhouzhenyuan 1 year ago
parent 418776b88a
commit 21b7b47172
  1. 1
      pages.json
  2. 296
      pages/login/index.vue
  3. 136
      pages/user/index.vue

@ -841,7 +841,6 @@
{
"path": "help",
"style": {
// "enablePullDownRefresh": true,
"navigationStyle": "default",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "帮助与客服"

@ -1,5 +1,5 @@
<template>
<view class="login">
<template>
<view class="login">
<view class="refund-navbar">
<u-navbar title="" :border-bottom="false" :background="background"></u-navbar>
</view>
@ -8,119 +8,225 @@
<view class="b">若该手机号未注册我们将自动为您注册</view>
</view>
<view class="login-bd">
<view class="a">+86<input type="tel" placeholder="请输入手机号" /></view>
<view class="a">+86<input v-model="phoneNum" type="tel" placeholder="请输入手机号" /></view>
<view class="b">
<input type="number" placeholder="请输入验证码" />获取验证码
<input v-model="semCode" placeholder="请输入验证码" />
<text @click="getCode"
v-if="!showCountDown">获取验证码</text>
<text v-if="showCountDown">{{countdown}}</text>
</view>
<view class="c">
查看并同意<text>用户服务协议</text><text>隐私政策</text>
</view>
</view>
<view class="login-fd login-fd-on">登录</view>
</view>
</template>
<view class="login-fd login-fd-on" @click="login">登录</view>
</view>
</template>
<script>
import img from "@/static/news/login-bg.png"
export default {
data() {
import img from "@/static/news/login-bg.png"
import * as CaptchaApi from '@/api/captcha';
import store from '@/store'
export default {
data() {
return {
showCountDown: false,
currentIndex: 0,
background: {
background: 'url('+ img+') center top no-repeat',
background: 'url(' + img + ') center top no-repeat',
backgroundSize: '100%',
},
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.login{
width: 100%;
background: #fffafb url(@/static/news/login-bg.png) center top no-repeat;
background-size: 100% auto;
min-height: 100vh;
&-hd{
padding: 90rpx 75rpx 75rpx;
overflow: hidden;
.a{
line-height: 80rpx;
font-size: 40rpx;
font-weight: 500;
color: #000000;
}
.b{
font-size: 28rpx;
font-weight: 400;
color: #5A5A5A;
line-height: 50rpx;
},
phoneNum: '',
semCode: '',
countdown: 60,
countDownFun: null,
}
},
methods: {
validatePhoneNumber(phone) {
//
var regExp = /^1[3456789]\d{9}$/;
if (regExp.test(phone)) {
return true; //
} else {
return false; //
}
},
getCode() {
//
const that = this
if (!that.validatePhoneNumber(that.phoneNum)) {
uni.showToast({
title: '请输入正确的手机号'
})
return
}
that.showCountDown = !that.showCountDown
that.countDownFun = setInterval(() => {
if (that.countdown >= 1) {
that.countdown = that.countdown - 1
} else {
that.showCountDown = false
clearInterval(that.countDownFun)
}
}, 1000)
CaptchaApi.sendSmsCaptcha({
form: {
mobile: that.phoneNum
}
}).then(res => {
if (res.status == 200) {
uni.showToast({
title: res.message
})
} else {
uni.showToast({
title: res.message
})
}
})
},
login() {
//
if (!this.validatePhoneNumber(this.phoneNum)) {
uni.showToast({
title: '请输入正确的手机号'
})
return
}
if (this.semCode == '') {
uni.showToast({
title: '请输入验证码'
})
return
}
const that = this;
store.dispatch('Login', {
smsCode: that.semCode,
mobile: that.phoneNum,
isParty: false,
partyData: {},
refereeId: false
}).then(res => {
uni.setStorageSync('token', res.data.token)
uni.showToast({
title: res.message
})
setTimeout(() => that.onNavigateBack(1), 2000)
})
},
onNavigateBack(delta = 1) {
//
const pages = getCurrentPages()
if (pages.length > 1) {
uni.navigateBack({
delta: Number(delta || 1)
})
} else {
this.$navTo('pages/index/index')
}
}
}
}
&-bd{
padding: 0 75rpx;
overflow: hidden;
.a{
padding: 20rpx 0;
border-bottom: 1px solid #F2F2F2;
display: flex;
align-items: center;
font-size: 32rpx;
font-weight: 400;
color: #212121;
input{
flex: 1;
margin-left: 30rpx;
line-height: 50rpx;
border-left: 1px solid #C4C4C4;
padding-left: 30rpx;
</script>
<style lang="scss" scoped>
.login {
width: 100%;
background: #fffafb url(@/static/news/login-bg.png) center top no-repeat;
background-size: 100% auto;
min-height: 100vh;
&-hd {
padding: 90rpx 75rpx 75rpx;
overflow: hidden;
.a {
line-height: 80rpx;
font-size: 40rpx;
font-weight: 500;
color: #000000;
}
.b {
font-size: 28rpx;
color: #212121;
font-weight: 400;
color: #5A5A5A;
line-height: 50rpx;
}
}
.b{
padding: 30rpx 0;
border-bottom: 1px solid #F2F2F2;
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 400;
color: #F3202A;
input{
flex: 1;
margin-right: 30rpx;
line-height: 50rpx;
font-size: 28rpx;
&-bd {
padding: 0 75rpx;
overflow: hidden;
.a {
padding: 20rpx 0;
border-bottom: 1px solid #F2F2F2;
display: flex;
align-items: center;
font-size: 32rpx;
font-weight: 400;
color: #212121;
input {
flex: 1;
margin-left: 30rpx;
line-height: 50rpx;
border-left: 1px solid #C4C4C4;
padding-left: 30rpx;
font-size: 28rpx;
color: #212121;
}
}
.b {
padding: 30rpx 0;
border-bottom: 1px solid #F2F2F2;
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 400;
color: #F3202A;
input {
flex: 1;
margin-right: 30rpx;
line-height: 50rpx;
font-size: 28rpx;
color: #212121;
}
}
.c {
padding: 28rpx 0;
font-size: 28rpx;
font-weight: 400;
color: #A0A0A0;
text {
color: #FF343C;
}
}
}
.c{
padding: 28rpx 0;
&-fd {
width: 680rpx;
line-height: 88rpx;
background: #FFBDBA;
border-radius: 88rpx;
text-align: center;
margin: 0 auto;
margin-top: 120rpx;
font-size: 28rpx;
font-weight: 400;
color: #A0A0A0;
text{
color: #FF343C;
font-weight: 600;
color: #FFFFFF;
&-on {
background-color: #FF343C;
}
}
}
&-fd{
width: 680rpx;
line-height: 88rpx;
background: #FFBDBA;
border-radius: 88rpx;
text-align: center;
margin: 0 auto;
margin-top: 120rpx;
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
&-on{
background-color: #FF343C;
}
}
}
</style>
</style>

@ -1,17 +1,24 @@
<template>
<view class="page">
<view >
<u-navbar title="" :background="background"></u-navbar>
</view>
<view class="section_1">
<view class="box_1">
<image src="/static/default-logo.png" class="image_2"></image>
<view class="group_1">
<view class="image-text_1">
<text lines="1" class="text-group_1">18034562920</text>
<image src="/static/user/weChat.png" class="thumbnail_1"></image>
<view class="image-text_1" v-if="isLogin">
<text lines="1" class="text-group_1">{{userInfo.nick_name}}</text>
<image :src="userInfo.avatar_url" class="thumbnail_1"></image>
</view>
<view class="image-text_1" v-if="!isLogin" @click="goLogin">
未登录
</view>
<view class="text-wrapper_1">
<text lines="1" class="text_1" v-if="userType==1">店长</text>
<text lines="1" class="text_1" v-else-if="userType==2">Plus会员</text>
<text lines="1" class="text_1" v-else-if="userType==3">分销</text>
<view class="text-wrapper_1" v-if="isLogin">
<text lines="1" class="text_1" v-if="userInfo.user_type==40">店长</text>
<text lines="1" class="text_1" v-else-if="userInfo.user_type==30">分销</text>
<text lines="1" class="text_1" v-else-if="userInfo.user_type==20">Plus会员</text>
<text lines="1" class="text_1" v-else-if="userInfo.user_type==10">游客</text>
</view>
</view>
<view class="group_2">
@ -22,7 +29,7 @@
<image src="/static/user/code.png" class="thumbnail_2"></image>
<text lines="1" class="text_3">会员码</text>
</view>
<view class="group_5" v-if="userType!=2" @click="lookMemberCode('3')">
<view class="group_5" v-if="userInfo.user_type!=20&&userInfo.user_type!=10" @click="lookMemberCode('3')">
<image src="/static/user/code.png" class="thumbnail_3"></image>
<text lines="1" class="text_4">分销码</text>
</view>
@ -48,7 +55,7 @@
</view>
</view>
</view> -->
<view class="newplus" v-if="userType!=3&&userType!=1">
<view class="newplus" v-if="userInfo.user_type!=30&&userInfo.user_type!=40">
<view class="memVip" @click="goMember">
<view class="vipLine">
<image src="/static/user/vip.png" mode="" class="vipIcon"></image>
@ -72,7 +79,7 @@
</view>
</view>
</view>
<view class="goodsManage" v-if="userType==1">
<view class="goodsManage" v-if="userInfo.user_type==40">
<view class="manageTitle">
<text lines="1" class="text_5 titleLeft">商品管理</text>
<text lines="1" class="text_6 titleRight">查看全部</text>
@ -80,7 +87,7 @@
src="https://lanhu.oss-cn-beijing.aliyuncs.com/FigmaDDSSlicePNG734520a67fe8e1d927b6d6e351bd2ade.png"
class="thumbnail_4"></image>
</view>
<view class="grounding" v-if="userType==1">
<view class="grounding" v-if="userInfo.user_type==1">
<view class="image-text_2">
<image src="/static/user/shelf.png" class="label_1"></image>
<view class="text-group_2">
@ -98,7 +105,7 @@
</view>
</view>
</view>
<view class="userSell" v-if="userType==1">
<view class="userSell" v-if="userInfo.user_type==40">
<view class="sell">
会员分销
</view>
@ -112,7 +119,7 @@
</view>
</view>
</view>
<view class="coupon" v-if="userType!=1">
<view class="coupon" v-if="userInfo.user_type!=40">
<view class="walletList">
<view class="listItem">
<view class="num">
@ -208,7 +215,7 @@
</view>
</view>
</view>
<view class="goodsManage" v-if="userType!=2">
<view class="goodsManage" v-if="userInfo.user_type!=20&&userInfo.user_type!=10">
<view class="manageTitle">
<text lines="1" class="text_5 titleLeft">分销订单</text>
<text lines="1" class="text_6 titleRight">查看全部</text>
@ -249,7 +256,7 @@
<view class="walletList">
<view class="listItem" @click="myWallet">
<view class="num">
235.00
{{userInfo.balance}}
</view>
<view class="info">
余额
@ -257,7 +264,7 @@
</view>
<view class="listItem">
<view class="num">
2
{{userInfo.income}}
</view>
<view class="info">
收入
@ -265,7 +272,7 @@
</view>
<view class="listItem">
<view class="num">
2
{{userInfo.finace_count}}
</view>
<view class="info">
提现记录
@ -278,25 +285,25 @@
我的服务
</view>
<view class="serve">
<view class="serveIcon" v-if="userType==1" @click="goPage()">
<view class="serveIcon" v-if="userInfo.user_type==40" @click="goPage()">
<image src="/static/user/record.png" mode="" class="icons"></image>
<view class="serveInfo">
发货记录
</view>
</view>
<view class="serveIcon" v-if="userType==1" @click="goPage()">
<view class="serveIcon" v-if="userInfo.user_type==40" @click="goPage()">
<image src="/static/user/car.png" mode="" class="icons"></image>
<view class="serveInfo">
物流查询
</view>
</view>
<view class="serveIcon" v-if="userType==1">
<view class="serveIcon" v-if="userInfo.user_type==40">
<image src="/static/user/member.png" mode="" class="icons"></image>
<view class="serveInfo">
会员价
</view>
</view>
<view class="serveIcon" v-if="userType==1">
<view class="serveIcon" v-if="userInfo.user_type==40">
<image src="/static/user/retail.png" mode="" class="icons"></image>
<view class="serveInfo">
分销价
@ -308,13 +315,13 @@
商家入驻
</view>
</view>
<view class="serveIcon" v-if="userType==1">
<view class="serveIcon" v-if="userInfo.user_type==40">
<image src="/static/user/staff.png" mode="" class="icons"></image>
<view class="serveInfo">
员工管理
</view>
</view>
<view class="serveIcon" v-if="userType==1">
<view class="serveIcon" v-if="userInfo.user_type==40">
<image src="/static/user/setHome.png" mode="" class="icons"></image>
<view class="serveInfo">
店铺设置
@ -329,14 +336,14 @@
<view class="serveIcon" @click="goPage('/pages/invite/index')">
<image src="/static/user/invite.png" mode="" class="icons"></image>
<view class="serveInfo">
邀请会员
邀请朋友
</view>
</view>
<view class="serveIcon">
<image src="/static/user/invites.png" mode="" class="icons"></image>
<view class="serveInfo">
<text v-if="userType!=2">邀请分销</text>
<text v-if="userType==2">加入分销</text>
<text v-if="userInfo.user_type!=20&&userInfo.user_type!=10">邀请分销</text>
<text v-if="userInfo.user_type==20||userInfo.user_type==10">加入分销</text>
</view>
</view>
<view class="serveIcon">
@ -365,7 +372,7 @@
联系我们
</view>
</view>
<view class="serveIcon" @click="goPage('/pages/help/index')">
<view class="serveIcon" @click="goPage('/pages/news1/help')">
<image src="/static/user/help.png" mode="" class="icons"></image>
<view class="serveInfo">
帮助中心
@ -377,19 +384,19 @@
我要找货
</view>
</view>
<view class="serveIcon">
<view class="serveIcon" v-if="userInfo.user_type!=10&&userInfo.user_type!=20">
<image src="/static/user/help.png" mode="" class="icons"></image>
<view class="serveInfo">
数据统计
</view>
</view>
<view class="serveIcon">
<view class="serveIcon" v-if="userInfo.user_type!=10&&userInfo.user_type!=20">
<image src="/static/user/help.png" mode="" class="icons"></image>
<view class="serveInfo">
会员管理
</view>
</view>
<view class="serveIcon">
<view class="serveIcon" @click="goPage('/pages/news1/jinqun')" v-if="userInfo.user_type!=10&&userInfo.user_type!=20">
<image src="/static/user/help.png" mode="" class="icons"></image>
<view class="serveInfo">
进群有礼
@ -397,7 +404,7 @@
</view>
</view>
</view>
<view class="goodsSuggest" v-if="userType!=1">
<view class="goodsSuggest" v-if="userInfo.user_type!=40">
<view class="line">
<image src="/static/user/left.png" mode=""></image>
<text>专属推荐</text>
@ -429,8 +436,8 @@
<view class="memberCode" v-if="memberCode" @click="memberCode=false">
<view class="codeMain">
<view class="myCode">
<text v-if="userType==2">我的专属会员识别码</text>
<text v-if="userType==3">我的专属分销识别码</text>
<text v-if="userInfo.user_type==20">我的专属会员识别码</text>
<text v-if="userInfo.user_type==30">我的专属分销识别码</text>
</view>
<view class="codeImg">
<image src="" mode="" class="img"></image>
@ -443,14 +450,64 @@
</view>
</template>
<script>
import img from "@/static/member/head.png"
import {
checkLogin
} from '@/core/app'
import * as UserApi from '@/api/user'
export default {
data() {
return {
background: {
background: 'url('+ img+') center top no-repeat',
backgroundSize: '100% auto',
},
userType: 2,
memberCode: false,
isLogin: false,
userInfo: {
user_type:40
},
}
},
onShow(options) {
this.onRefreshPage()
},
methods: {
//
onRefreshPage() {
this.isLogin = checkLogin()
console.log(this.isLogin,'是否登录')
//
this.getUserInfo()
},
//
getUserInfo() {
const that = this
return new Promise((resolve, reject) => {
!that.isLogin ? resolve(null) : UserApi.info({}, {
load: that.isFirstload
})
.then(result => {
that.userInfo = result.data.userInfo
resolve(that.userInfo)
})
.catch(err => {
if (err.result && err.result.status == 401) {
that.isLogin = false
resolve(null)
} else {
reject(err)
}
})
})
},
goLogin() {
//
uni.navigateTo({
url: '/pages/login/index'
})
},
goMember() {
uni.navigateTo({
url: '/pages/member/index'
@ -488,9 +545,9 @@
url: '/pages/goods/detail'
})
},
goPage(url){
goPage(url) {
uni.navigateTo({
url:url
url: url
})
},
}
@ -518,18 +575,13 @@
margin: -26rpx 0 0 -60rpx;
}
.image_1 {
width: 158rpx;
height: 56rpx;
margin: 120rpx 0 0 626rpx;
}
.box_1 {
width: 668rpx;
height: 114rpx;
flex-direction: row;
display: flex;
margin: 240rpx 0 0 108rpx;
margin: 50rpx 0 0 108rpx;
}
.image_2 {
@ -1194,7 +1246,7 @@
.myServe {
width: 688rpx;
height: 436rpx;
// height: 436rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;

Loading…
Cancel
Save