Browse Source

更新

master
xiaobo 2 months ago
parent
commit
e4f0ff41fc
13 changed files with 932 additions and 126 deletions
  1. +3
    -108
      api/model/index.js
  2. +5
    -0
      api/model/login.js
  3. +188
    -0
      components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
  4. +2
    -2
      config.js
  5. +19
    -0
      pages.json
  6. +17
    -8
      pages/index/center.vue
  7. +12
    -6
      pages/index/index.vue
  8. +347
    -0
      pages_login/loginAndRegisterAndForgetPassword.vue
  9. +118
    -0
      pages_login/wxLogin.vue
  10. +214
    -0
      pages_login/wxUserInfo.vue
  11. BIN
      static/image/home/hdqd-img.png
  12. BIN
      static/image/logo-img.jpg
  13. +7
    -2
      store/store.js

+ 3
- 108
api/model/index.js View File

@ -4,116 +4,11 @@
const api = {
// 获取首页轮播图
getRiceBanner: {
url: '/rice_index/getRiceBanner',
banner: {
url: '/index_common/getBanner',
method: 'GET',
},
// 获取首页常规产品
getRiceCommonProductList: {
url: '/rice_index/getRiceCommonProductList',
method: 'GET',
},
// 获取首页跳转图标
getRiceIconList: {
url: '/rice_index/getRiceIconList',
method: 'GET',
},
// 获取首页新闻详情
getRiceNewsDetail: {
url: '/rice_index/getCommonNewsDetail',
method: 'GET',
},
// 获取首页新闻列表
getRiceNewsList: {
url: '/rice_index/getRiceNewsList',
method: 'GET',
},
// 获取首页公告列表
getRiceNoticeList: {
url: '/rice_index/getRiceNoticeList',
method: 'GET',
},
// 获取首页商品详情
getRiceProductDetail: {
url: '/rice_index/getRiceProductDetail',
method: 'GET',
},
// 获取首页体验产品
getRiceProductList: {
url: '/rice_index/getRiceProductList',
method: 'GET',
},
// 查询分类接口
getCategoryList: {
url: '/rice_index/getCategoryList',
method: 'GET',
},
// 获取分类分页商品列表接口
getClassShopPageList: {
url: '/rice_index/getClassShopPageList',
method: 'GET',
},
// 加入购物车
addCart: {
url: '/rice_index/addCart',
method: 'GET',
auth : true,
showLoading : true,
},
// 删除购物车信息
deleteCart: {
url: '/rice_index/deleteCart',
method: 'DELETE',
auth : true,
showLoading : true,
},
// 修改购物车信息数量
updateCartNum: {
url: '/rice_index/updateCartNum',
method: 'POST',
auth : true,
debounce : 300,
},
// 创建订单
createOrder: {
url: '/rice_index/createOrder',
method: 'GET',
auth : true,
limit : 1000,
showLoading : true,
},
// 创建订单-再次支付
createOrderTwo: {
url: '/rice_index/createOrderTwo',
method: 'GET',
auth : true,
limit : 1000,
showLoading : true,
},
// 多商品创建订单
createSumOrder: {
url: '/rice_index/createSumOrder',
method: 'POST',
auth : true,
limit : 1000,
showLoading : true,
},
// 多商品订单再次支付
createSumOrderAgain: {
url: '/rice_index/createSumOrderAgain',
method: 'POST',
auth : true,
limit : 1000,
showLoading : true,
},
// 确认收货
confirmOrder: {
url: '/rice_index/confirmOrder',
method: 'GET',
auth : true,
limit : 1000,
showLoading : true,
},
}
export default api

+ 5
- 0
api/model/login.js View File

@ -24,6 +24,11 @@ const api = {
method: 'GET',
auth: true,
},
bindPhone: {
url: '/login_common/bindPhone',
method: 'GET',
auth: true,
},
}
export default api

+ 188
- 0
components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue View File

@ -0,0 +1,188 @@
<template>
<uv-popup ref="popup" z-index="99999" :closeOnClickOverlay="false"
:customStyle="{ backgroundColor: 'transparent' }">
<view class="privacyPopup">
<view class="icon">
<image src="@/static/image/PrivacyAgreementPoup/icon.png" mode="widthFix"></image>
</view>
<view class="title">
<view>协议与隐私政策</view>
</view>
<view class="content_pri">
<view class="text">
请您务必审慎阅读充分理解用户协议和隐私政策各条款包括但不限于用户注意事项用户行为规范以及为了向你提供服务而收集使用存储你个人信息的情况等你可阅读<text
class="blk" @tap="handleOpenPrivacyContract">工程项目打卡平台用户服务协议</text><text
class="blk" @tap="handleOpenPrivacyContract">工程项目打卡平台隐私权政策</text>了解详细信息如你同意请点击下方按钮开始接受我们的服务
</view>
</view>
<!-- <view class="config">
<uv-checkbox-group v-model="checkboxValue" shape="circle">
<view class="content">
<view style="display: flex;">
<uv-checkbox size="30rpx" :name="1"></uv-checkbox>
同意<text @tap="handleOpenPrivacyContract">工程项目打卡平台用户服务协议</text>
</view>
<view class="">
以及<text @tap="handleOpenPrivacyContract">工程项目打卡平台隐私权政策</text>
</view>
</view>
</uv-checkbox-group>
</view> -->
<view class="pri_btn">
<button class="confuse_btn" @click="confusePrivacy">拒绝</button>
<button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
</view>
</view>
</uv-popup>
</template>
<script>
export default {
name: 'PrivacyAgreementPoup',
data() {
return {
resolvePrivacyAuthorization: {},
checkboxValue: false
}
},
mounted() {
if (wx.getPrivacySetting) {
wx.getPrivacySetting({
success: res => {
// console.log(res)
if (res.needAuthorization) {
//
this.init()
}
},
fail: () => {}
})
}
},
methods: {
//
init(resolve) {
this.$refs.popup.open('center')
this.resolvePrivacyAuthorization = resolve
},
//
goToPrivacy() {
wx.openPrivacyContract({
success: () => {
console.log('打开成功');
}, //
fail: () => {
uni.showToast({
title: '打开失败,稍后重试',
icon: 'none'
})
} //
})
},
//
confusePrivacy() {
this.$refs.popup.close()
this.resolvePrivacyAuthorization({
event: 'disagree'
})
},
//
handleAgreePrivacyAuthorization() {
// id
this.resolvePrivacyAuthorization({
buttonId: 'agree-btn',
event: 'agree'
})
this.$refs.popup.close()
},
handleOpenPrivacyContract() {
//
wx.openPrivacyContract({
success: () => {}, //
fail: () => {}, //
complete: () => {}
})
}
}
}
</script>
<style lang="scss" scoped>
.privacyPopup {
width: 90%;
margin: 0rpx auto;
background: white;
border-radius: 20rpx;
box-sizing: border-box;
padding: 40rpx 30rpx;
.icon {
display: flex;
justify-content: center;
image {
width: 100rpx;
}
}
.title {
text-align: center;
font-size: 36rpx;
margin: 30rpx 0rpx;
}
.content_pri {
margin-bottom: 30rpx;
font-size: 28rpx;
color: #707070;
.text {
.blk {
color: black;
}
}
}
.config {
font-size: 28rpx;
text-align: center;
line-height: 40rpx;
margin-bottom: 30rpx;
text {
color: #00aaff;
}
.content {
display: flex;
}
}
.pri_btn {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
button {
width: 40%;
padding: 5rpx 0rpx;
// background: $main-color;
outline: none;
color: white;
font-size: 30rpx;
&:nth-child(1){
background: #F2F2F2;
color: #707070;
}
}
}
}
</style>

+ 2
- 2
config.js View File

@ -13,10 +13,10 @@ const type = 'prod'
// 环境配置
const config = {
dev : {
baseUrl : 'http://h5.xzaiyp.top/rice-admin',
baseUrl : 'https://popularize-admin.hhlm1688.com/popularize-admin',
},
prod : {
baseUrl : 'https://admin.szqwdgidm.com/rice-admin',
baseUrl : 'https://popularize-admin.hhlm1688.com/popularize-admin',
}
}


+ 19
- 0
pages.json View File

@ -161,6 +161,25 @@
}
}
]
},
{
"root": "pages_login",
"pages": [
{
"path": "wxUserInfo",
"style": {
"navigationStyle": "custom" ,
"navigationBarTextStyle": "white"
}
},
{
"path": "wxLogin",
"style": {
"navigationStyle": "custom" ,
"navigationBarTextStyle": "white"
}
}
]
}],
"globalStyle": {
"navigationBarTextStyle": "black",


+ 17
- 8
pages/index/center.vue View File

@ -1,7 +1,7 @@
<template>
<view class="page">
<view class="head-box"></view>
<uv-navbar title="个人中心" :bgColor="bgColor" height="100rpx" :titleStyle="{color:'#fff'}"></uv-navbar>
<uv-navbar title="个人中心" leftIcon=" " :bgColor="bgColor" height="100rpx" :titleStyle="{color:'#fff'}"></uv-navbar>
<view class="content">
<view class="head" @click="toInfo">
@ -10,10 +10,10 @@
</view>
<view class="info" @click="toInfo">
<view class="vip">
但愿人长久
{{token ? userInfo.nickName : '请点击登录'}}
</view>
<view class="tips">
158123321
{{token ? userInfo.phone : ''}}
</view>
</view>
<view class="setting" @click="jump({url:'/pages_my/user-msg'})">
@ -71,7 +71,7 @@
<script>
import tabber from '@/components/base/tabbar.vue'
import { mapState } from 'vuex'
import { mapState,mapGetters } from 'vuex'
import customerServicePopup from '@/components/config/customerServicePopup.vue'
export default {
components: {
@ -79,6 +79,7 @@
customerServicePopup,
},
computed: {
...mapGetters(["token","userInfo"]),
},
data() {
return {
@ -121,6 +122,9 @@
},
onShow() {
},
onLoad() {
console.log('this.userInfo: ',this.userInfo);
},
onPageScroll(e) {
if(e.scrollTop > 50) {
@ -141,10 +145,15 @@
})
},
toInfo() {
console.log(123)
uni.navigateTo({
url:'/pages_my/user-info'
})
if(!this.token) {
uni.navigateTo({
url:'/pages_login/wxLogin'
})
}else{
uni.navigateTo({
url:'/pages_my/user-info'
})
}
}
}
}


+ 12
- 6
pages/index/index.vue View File

@ -14,7 +14,7 @@
</view>
</view>
<view class="swipe-box">
<uv-swiper :list="list" height="336rpx" radius="30rpx" bgColor="transparent" indicator indicatorMode="dot"></uv-swiper>
<uv-swiper :list="list" keyName="image" height="336rpx" radius="30rpx" bgColor="transparent" indicator indicatorMode="dot"></uv-swiper>
</view>
<view class="ydsk-box">
@ -95,11 +95,7 @@
bgColor:'transparent',
navTitle:'',
keyword:'',
list: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
list: [],
hdList: [
{ id: 0, name: '近期活动' },
{ id: 1, name: '往期活动' },
@ -136,7 +132,17 @@
this.navTitle = ''
}
},
onLoad() {
this.getBanner()
},
methods:{
getBanner() {
this.$api('banner',res=>{
if(res.code == 200) {
this.list = res.result
}
})
},
tabs(val) {
console.log(val);
}


+ 347
- 0
pages_login/loginAndRegisterAndForgetPassword.vue View File

@ -0,0 +1,347 @@
<template>
<view class="refundsOrExchange">
<navbar :title="titleList[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
<view class="frame">
<!-- 登录和注册 -->
<view class="loginRegister" v-if='titleIndex!=2'>
<!-- 标题 -->
<view class="title">{{titleList[titleIndex]}}</view>
<!-- 头像 -->
<view class="userIamge">
<view>
<img src="/static/image/center/11.svg" alt="" style="width: 100%;height: 100%;">
</view>
</view>
<!-- 用户名&密码&隐私条款 -->
<view class="form">
<view>
<uv-input v-model="form.account" placeholder="请输入账号" border="surround" shape='circle'
clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
<view>
<uv-input v-model="form.password" password placeholder="请输入密码" border="surround" shape='circle'
clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
<view>
<uv-checkbox-group v-model="checkboxValue" shape="circle">
<view class="content">
<view style="display: flex;flex-wrap: wrap;">
<uv-checkbox size="30rpx" :name="1"></uv-checkbox>
请你阅读并同意我们的<span style="color: #fd5100"
@click="$refs.popup.open('getPrivacyPolicy')">隐私条款</span><span
style="color: #fd5100"
@click="$refs.popup.open('getUserAgreement')">服务协议</span>
</view>
</view>
</uv-checkbox-group>
</view>
</view>
</view>
<!-- 忘记密码 -->
<view class='forgetPassword' v-if='titleIndex==2'>
<!-- 标题 -->
<view class="title">{{titleList[titleIndex]}}</view>
<!-- 表单 -->
<view class="form1">
<view class="userName">
<uv-input v-model="form1.userName" placeholder="请输入手机号/用户/邮箱" border="surround" shape='circle'
clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
<view class="code">
<view class="left">
<uv-input v-model="form1.code" placeholder="请输入验证码" border="surround" shape='circle'
clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
<view class="right">
<view>
<uv-toast ref="toast"></uv-toast>
<uv-code :seconds="seconds" @end="end" @start="start" ref="code"
@change="codeChange"></uv-code>
<uv-button @tap="getCode" iconSize='10rpx' color='#fd5100'
shape='circle'>{{tips}}</uv-button>
</view>
</view>
</view>
<view class="password1">
<uv-input v-model="form1.password1" placeholder="设置您的新密码(6到50个字符)" password clearable
border="surround" shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
<view class="password2">
<uv-input v-model="form1.password2" placeholder="重新确认密码" password clearable border="surround"
shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
</view>
</view>
<!-- 按钮 -->
<view class="btn"
@click="submit">
<button class='a'>{{titleList[titleIndex]}}</button>
</view>
<!-- tab -->
<!-- <view class="bottomTab">
<span :class="titleIndex==0 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
@click='changePage(0)'>注册账号</span>
<span style="color: #9c9fa4">|</span>
<span :class="titleIndex==1 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
@click='changePage(1)'>账号登录</span>
<span style="color: #9c9fa4">|</span>
<span :class="titleIndex==2 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
@click='changePage(2)'>忘记密码</span>
</view> -->
</view>
<configPopup ref="popup"></configPopup>
</view>
</template>
<script>
import configPopup from '@/components/config/configPopup.vue';
export default {
components: {
configPopup
},
onLoad(option) {
this.titleIndex = option.index || 1
},
data() {
return {
titleIndex: 0,
titleList: ['注册', '登录', '重置密码'],
checkboxValue: [],
form: {
account: '13135294009',
password: 'lzx123456',
},
form1: {
userName: '',
code: '',
password1: '',
password2: '',
},
tips: '获取验证码',
seconds: 60,
}
},
methods: {
submit(){
if(!this.checkboxValue.length){
return uni.showToast({
title: '请先同意隐私协议',
icon:'none'
})
}
if(this.$utils.verificationAll(this.form, {
account: '请输入账号',
password: '请输入密码',
})){
return
}
this.$store.commit('accountLogin', this.form)
},
//
changePage(index) {
this.titleIndex = index
},
confirm() {
},
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.code.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
uni.$uv.toast('验证码已发送');
//
this.$refs.code.start();
}, 2000);
} else {
uni.$uv.toast('请勿重复发送');
}
},
end() {
// uni.$uv.toast('');
},
start() {
// uni.$uv.toast('');
}
}
}
</script>
<style lang="scss" scoped>
* {
box-sizing: border-box;
}
.refundsOrExchange {
background-color: #FFF;
height: 100vh;
.frame {
background-color: #FFF;
.loginRegister {
display: flex;
flex-direction: column;
gap: 40rpx;
.title {
display: flex;
justify-content: center;
align-items: flex-end;
height: 10vh;
color: #000;
font-size: 40rpx;
font-weight: 700;
}
.userIamge {
display: flex;
justify-content: center;
height: 10vh;
>view:nth-of-type(1) {
width: 25%;
height: 100%;
border-radius: 50%;
overflow: hidden;
}
}
.form {
line-height: 50rpx;
>view:nth-of-type(1) {
padding: 20rpx 100rpx;
}
>view:nth-of-type(2) {
padding: 0 100rpx;
}
>view:nth-of-type(3) {
display: flex;
padding: 30rpx 100rpx 0 100rpx;
font-size: 22rpx
}
}
}
.btn {
// height: 5vh;
display: flex;
justify-content: center;
margin: 90rpx 0 0 0;
.a {
display: flex;
justify-content: center;
align-items: center;
width: 70%;
height: 80rpx;
color: #FFF;
background-color: $uni-color;
border: 1px solid red;
border-radius: 100rpx;
font-size: 30rpx;
}
}
.bottomTab {
display: flex;
justify-content: space-between;
height: 10vh;
padding: 0 80rpx;
margin-top: 30rpx;
.tabbarItemActive {
color: $uni-color;
}
.tabbarItemNoActive {
color: #9c9fa4;
}
}
.forgetPassword {
padding: 100rpx 40rpx 0 40rpx;
.title {
display: flex;
justify-content: center;
align-items: flex-end;
height: 10vh;
color: #000;
font-size: 40rpx;
font-weight: 700;
}
.form1 {
display: flex;
flex-direction: column;
gap: 30rpx;
margin-top: 20rpx;
padding: 20rpx 80rpx;
.userName {
// padding: 20rpx 100 rpx;
}
.code {
display: flex;
width: 100%;
.left {
width: 55%;
}
.right {
width: 45%;
height: 100%;
>view:nth-of-type(1) {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
}
}
.password1 {}
.password2 {}
}
}
}
}
</style>

+ 118
- 0
pages_login/wxLogin.vue View File

@ -0,0 +1,118 @@
<template>
<div class="login">
<!-- logo -->
<div class="logo">
<image src="@/static/image/logo-img.jpg" mode=""></image>
</div>
<!-- 标题 -->
<view class="login-title">vtrip</view>
<!-- 登录按钮 -->
<view @click="login" class="login-btn">
<uni-icons type="weixin" size="30" color="#fff"></uni-icons>
<text class="wx">微信登录</text>
</view>
<!-- 隐私政策 -->
<view class="privacy">
<uv-radio-group>
<uv-checkbox-group v-model="consent">
<uv-checkbox :size="30" shape="circle" active-color="#05C160" :name="privacy"></uv-checkbox>
</uv-checkbox-group>
已同意<text class="privacy-title">隐私政策</text>
<text class="privacy-title">服务条款</text>
</uv-radio-group>
</view>
<!-- 隐私政策弹框 -->
<PrivacyAgreementPoup></PrivacyAgreementPoup>
</div>
</template>
<script>
import PrivacyAgreementPoup from '@/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue'
export default {
name : "wxLogin",
components : { PrivacyAgreementPoup },
data() {
return {
consent : []
}
},
methods: {
login() {
if(this.consent.length <= 0){
return uni.showToast({
icon: "none",
title: "请勾选隐私协议"
})
}
this.$store.commit('login')
}
}
}
</script>
<style lang="scss" scoped>
.login {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
background: white;
// logo
.logo {
display: flex;
align-items: center;
justify-content: center;
image {
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
}
}
//
.login-title {
font-size: 40rpx;
font-weight: bold;
margin: 20rpx 0rpx;
}
//
.login-btn {
display: flex;
justify-content: center;
align-items: center;
width: 70%;
background: #05C160;
height: 90rpx;
border-radius: 45rpx;
color: white;
margin-top: 200rpx;
.wx {
margin-left: 10rpx;
}
}
//
.privacy {
display: flex;
align-items: center;
margin-top: 20rpx;
&::v-deep .uv-checkbox-group {
align-items: center !important;
justify-content: center !important;
flex-wrap : nowrap !important;
}
.privacy-title {
color: #05C160;
}
}
}
</style>

+ 214
- 0
pages_login/wxUserInfo.vue View File

@ -0,0 +1,214 @@
<template>
<view class="login">
<view class="logo">
<image src="@/static/image/logo-img.jpg" mode=""></image>
</view>
<view class="title">
vtrip
</view>
<view class="title">
申请获取你的头像昵称
</view>
<button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<view class="line">
<view class="">
头像
</view>
<view class="">
<image :src="userInfoForm.headImage" v-if="userInfoForm.headImage" style="width: 60rpx;height: 60rpx;"
mode=""></image>
<image src="../static/auth/headImage.png" v-else style="width: 50rpx;height: 50rpx;" mode=""></image>
</view>
</view>
</button>
<view class="line">
<view class="">
昵称
</view>
<view class="">
<input type="nickname" placeholder="请输入昵称" style="text-align: right;" id="nickName"
v-model="userInfoForm.nickName" />
</view>
</view>
<view class="line">
<view class="">
手机号
</view>
<view class=""
v-if="userInfoForm.phone">
<input placeholder="请输入手机号" style="text-align: right;"
disabled
v-model="userInfoForm.phone" />
</view>
<view class=""
v-else>
<button
class="getPhoneNumber"
open-type="getPhoneNumber"
@getphonenumber="getPhone">
获取电话号码
</button>
</view>
</view>
<view class="btn" @click="submit">
确认
</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfoForm: {
headImage: '',
nickName: '',
phone : '',
}
};
},
onShow() {},
onLoad() {
this.userInfoForm.phone = this.userInfo.phone || ''
this.userInfoForm.nickName = this.userInfo.nickName || ''
this.userInfoForm.headImage = this.userInfo.headImage || ''
},
computed: {},
methods: {
onChooseAvatar(res) {
let self = this
self.$Oss.ossUpload(res.target.avatarUrl)
.then(url => {
self.userInfoForm.headImage = url
})
},
getPhone(e){
console.log(e,'e')
this.$api('bindPhone', {
phoneCode : e.detail.code
}, res => {
if(res.code == 200){
let phoneObj = JSON.parse(res.result)
if(phoneObj.errmsg == 'ok'){
this.userInfoForm.phone = phoneObj.phone_info.phoneNumber
}else{
uni.showModal({
title: phoneObj.errmsg
})
}
console.log(phoneObj);
}
})
},
submit() {
let self = this
uni.createSelectorQuery().in(this)
.select("#nickName")
.fields({
properties: ["value"],
})
.exec((res) => {
const nickName = res?.[0]?.value
self.userInfoForm.nickName = nickName
if (self.$utils.verificationAll(self.userInfoForm, {
headImage: '请选择头像',
nickName: '请填写昵称',
phone: '请填写昵称',
})) {
return
}
self.$api('updateInfo', {
avatarUrl : self.userInfoForm.headImage,
nickName : self.userInfoForm.nickName,
phone : self.userInfoForm.phone,
}, res => {
if (res.code == 200) {
this.$store.commit('getUserInfo')
uni.reLaunch({
url:'/pages/index/index'
})
}
})
})
},
}
}
</script>
<style lang="scss" scoped>
.login {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #fff;
.logo{
height: 140rpx;
width: 140rpx;
image{
height: 140rpx;
width: 140rpx;
border-radius: 30rpx;
}
margin-bottom: 20rpx;
}
.title {
line-height: 45rpx;
font-weight: 900;
}
.line {
display: flex;
justify-content: space-between;
align-items: center;
width: 80%;
border-bottom: 1px solid #00000023;
padding: 30rpx 0;
margin: 0 auto;
}
.chooseAvatar {
width: 100%;
padding: 0;
margin: 0;
margin-top: 10vh;
border: none;
}
.btn {
// background: $uni-linear-gradient-btn-color;
background: $uni-color;
color: #fff;
width: 80%;
padding: 20rpx 0;
text-align: center;
border-radius: 15rpx;
margin-top: 10vh;
}
.getPhoneNumber{
all: unset;
display: flex;
justify-content: center;
align-items: center;
// background: $uni-linear-gradient-btn-color;
background: $uni-color;
color: #fff;
width: 200rpx;
height: 60rpx;
border-radius: 30rpx;
font-size: 24rpx;
}
}
</style>

BIN
static/image/home/hdqd-img.png View File

Before After
Width: 302  |  Height: 292  |  Size: 85 KiB Width: 302  |  Height: 292  |  Size: 18 KiB

BIN
static/image/logo-img.jpg View File

Before After
Width: 1280  |  Height: 1504  |  Size: 32 KiB

+ 7
- 2
store/store.js View File

@ -8,13 +8,16 @@ import api from '@/api/api.js'
//Vuex.Store 构造器选项
const store = new Vuex.Store({
state: {
token:uni.getStorageSync('token') || '',
configList: {}, //配置列表
userInfo : {}, //用户信息
userInfo : uni.getStorageSync('userInfo') ? JSON.parse(uni.getStorageSync('userInfo')) : {}, //用户信息
riceInfo : {},//用户相关信息
category : [],//分类信息
payOrderProduct : [],//支付订单中的商品
},
getters: {
token:state => state.token,
userInfo:state => state.userInfo
},
mutations: {
// 初始化配置
@ -63,11 +66,12 @@ const store = new Vuex.Store({
}
state.userInfo = res.result.userInfo
state.token = res.result.token
uni.setStorageSync('token', res.result.token)
if(!state.userInfo.nickName || !state.userInfo.headImage){
uni.navigateTo({
url: '/pages_order/auth/wxUserInfo'
url: '/pages_login/wxUserInfo'
})
}else{
uni.navigateBack(-1)
@ -79,6 +83,7 @@ const store = new Vuex.Store({
getUserInfo(state){
api('getInfo', res => {
if(res.code == 200){
uni.setStorageSync('userInfo',JSON.stringify(res.result))
state.userInfo = res.result
}
})


Loading…
Cancel
Save