Browse Source

对接登录

master
前端-胡立永 9 months ago
parent
commit
ab1393d24b
9 changed files with 597 additions and 592 deletions
  1. +1
    -1
      README.md
  2. +1
    -1
      api/api.js
  3. +3
    -2
      api/http.js
  4. +2
    -2
      config.js
  5. +448
    -452
      pages/index/index.vue
  6. +25
    -9
      pages_order/auth/loginAndRegisterAndForgetPassword.vue
  7. +103
    -99
      pages_order/auth/wxLogin.vue
  8. +13
    -25
      store/store.js
  9. +1
    -1
      uni_modules/uv-ui-tools/libs/css/color.scss

+ 1
- 1
README.md View File

@ -1,4 +1,4 @@
#酒店桌布小程序
#铝交易微信公众号
![](./doc/home.png)
![](./doc/home-s.png)


+ 1
- 1
api/api.js View File

@ -166,7 +166,7 @@ export function api(key, data, callback, loadingTitle) {
if (req.auth) {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
url: '/pages_order/auth/loginAndRegisterAndForgetPassword'
})
console.error('需要登录')
return


+ 3
- 2
api/http.js View File

@ -16,7 +16,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
method: method,
header: {
'X-Access-Token': uni.getStorageSync('token'),
'Content-Type' : method == 'POST' ? 'application/x-www-form-urlencoded' : 'application/json'
'Content-Type' : 'application/json'
// 'Content-Type' : method == 'POST' ? 'application/x-www-form-urlencoded' : 'application/json'
},
success: (res) => {
@ -30,7 +31,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
uni.removeStorageSync('token')
console.error('登录过期');
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
url: '/pages_order/auth/loginAndRegisterAndForgetPassword'
})
}


+ 2
- 2
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置
@ -16,7 +16,7 @@ const config = {
baseUrl : 'http://www.gcosc.fun:82',
},
prod : {
baseUrl : 'http://xxx.xxx.xxx/xxx',
baseUrl : 'http://42.194.239.145:8014/aluminium-prod',
}
}


+ 448
- 452
pages/index/index.vue View File

@ -1,459 +1,455 @@
<template>
<view class="page">
<!--顶部栏-->
<topbar showRight="1" ></topbar>
<!-- 语言切换 -->
<!--<view style="padding: 20rpx;"-->
<!-- @click="$refs.changeLanguage.open()">-->
<!-- {{ $t('pages.index.index.language') }}-->
<!--</view>-->
<!--<changeLanguage ref="changeLanguage"/>-->
<!-- 供应商 -->
<view class="supplier" v-if="userShop">
<!--上面第一个-->
<view class="topItem">
<view class="imageFrame">
<img src="../../static/image/index/4.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 下面三个-->
<view class="threeHeOne">
<!-- 第一个-->
<view class="oneItem">
<view class="left">
<!--<span>Company Profile</span>-->
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('other.aluminumProducts') }}</span>
</view>
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
</view>
<!-- 第二个-->
<view class="twoItem">
<view class="left">
<img src="../../static/image/index/2.png" style="width:100%;height:100%;">
</view>
<view class="right">
<img src="../../static/image/index/3.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 第三个-->
<view class="threeItem">
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
<view class="left">
<!--<span>Company Profile</span>-->
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('pages.index.index.aluminiumProduct') }}</span>
</view>
</view>
</view>
<!--报价和挂单-->
<view class="btns">
<span @click="goToPage(0)" class="oneBtn">
{{ $t('other.supplierQuotation') }}
</span>
<span @click="goToPage(1)" class="twoBtn">
{{ $t('other.supplierBilLading') }}
</span>
</view>
</view>
<!-- 采购商 -->
<view class="purchaser" v-else>
<!--上面第一个-->
<view class="topItem">
<view class="imageFrame">
<img src="../../static/image/index/4.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 下面三个-->
<view class="threeHeOne">
<!-- 第一个-->
<view class="oneItem">
<view class="left">
<span>Company Profile</span>
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('pages.index.index.aluminiumProduct') }}</span>
</view>
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
</view>
<!-- 第二个-->
<view class="twoItem">
<view class="left">
<img src="../../static/image/index/2.png" style="width:100%;height:100%;">
</view>
<view class="right">
<img src="../../static/image/index/3.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 第三个-->
<view class="threeItem">
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
<view class="left">
<span>Company Profile</span>
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('pages.index.index.aluminiumProduct') }}</span>
</view>
</view>
</view>
</view>
<tabber select="0"/>
</view>
<view class="page">
<!--顶部栏-->
<topbar showRight="1"></topbar>
<!-- 语言切换 -->
<!--<view style="padding: 20rpx;"-->
<!-- @click="$refs.changeLanguage.open()">-->
<!-- {{ $t('pages.index.index.language') }}-->
<!--</view>-->
<!--<changeLanguage ref="changeLanguage"/>-->
<!-- 供应商 -->
<view class="supplier" v-if="userShop">
<!--上面第一个-->
<view class="topItem">
<view class="imageFrame">
<img src="../../static/image/index/4.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 下面三个-->
<view class="threeHeOne">
<!-- 第一个-->
<view class="oneItem">
<view class="left">
<!--<span>Company Profile</span>-->
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('other.aluminumProducts') }}</span>
</view>
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
</view>
<!-- 第二个-->
<view class="twoItem">
<view class="left">
<img src="../../static/image/index/2.png" style="width:100%;height:100%;">
</view>
<view class="right">
<img src="../../static/image/index/3.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 第三个-->
<view class="threeItem">
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
<view class="left">
<!--<span>Company Profile</span>-->
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('pages.index.index.aluminiumProduct') }}</span>
</view>
</view>
</view>
<!--报价和挂单-->
<view class="btns">
<span @click="goToPage(0)" class="oneBtn">
{{ $t('other.supplierQuotation') }}
</span>
<span @click="goToPage(1)" class="twoBtn">
{{ $t('other.supplierBilLading') }}
</span>
</view>
</view>
<!-- 采购商 -->
<view class="purchaser" v-else>
<!--上面第一个-->
<view class="topItem">
<view class="imageFrame">
<img src="../../static/image/index/4.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 下面三个-->
<view class="threeHeOne">
<!-- 第一个-->
<view class="oneItem">
<view class="left">
<span>Company Profile</span>
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('pages.index.index.aluminiumProduct') }}</span>
</view>
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
</view>
<!-- 第二个-->
<view class="twoItem">
<view class="left">
<img src="../../static/image/index/2.png" style="width:100%;height:100%;">
</view>
<view class="right">
<img src="../../static/image/index/3.png" style="width:100%;height:100%;">
</view>
</view>
<!-- 第三个-->
<view class="threeItem">
<view class="right">
随着全球经济的快速发展我们这家领先的企业公司应运而生致力于为客户提供卓越的服务和优质的产品我们公司成立于2001年总部位于深圳市横岗大厦拥有广泛的业务领域和专业的团队专注于实现客户的期望和需求
</view>
<view class="left">
<span>Company Profile</span>
<span> {{ $t('pages.index.index.companyProfile') }}</span>
<span class="subText"> {{ $t('pages.index.index.aluminiumProduct') }}</span>
</view>
</view>
</view>
</view>
<tabber select="0" />
</view>
</template>
<script>
import topbar from '@/components/base/topbar.vue'
import tabber from '@/components/base/tabbar.vue'
import productList from '@/components/user/productList.vue'
import {mapGetters} from 'vuex'
import changeLanguage from '@/components/base/changeLanguage.vue'
export default {
components: {
tabber,topbar,
productList,
changeLanguage
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
title: ''
},
}
},
computed: {
...mapGetters(['userShop']),
},
onShow(){
this.checkLogin()
},
methods: {
checkLogin(){
if(!uni.getStorageSync('token')){
console.log("先登录")
uni.navigateTo({
url:'/pages_order/auth/loginAndRegisterAndForgetPassword'
})
// this.$store.commit('login')
// this.$refs.popup.open();
}
},
goToPage(titleIndex) {
uni.navigateTo({url:'/pages_order/order/offerOrBillLading?titleIndex='+titleIndex})
},
}
}
import topbar from '@/components/base/topbar.vue'
import tabber from '@/components/base/tabbar.vue'
import productList from '@/components/user/productList.vue'
import {
mapGetters
} from 'vuex'
import changeLanguage from '@/components/base/changeLanguage.vue'
export default {
components: {
tabber,
topbar,
productList,
changeLanguage
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
title: ''
},
}
},
onShow(){
this.getImagePhoneOther()
},
computed: {
...mapGetters(['userShop']),
},
methods: {
goToPage(titleIndex) {
uni.navigateTo({
url: '/pages_order/order/offerOrBillLading?titleIndex=' + titleIndex
})
},
getImagePhoneOther(){
this.$api('getImagePhoneOther', res => {
})
},
}
}
</script>
<style scoped lang="scss">
* {
box-sizing: border-box;
}
.page {
background-color: #2e394d;
//
.supplier {
display: flex;
flex-direction: column;
height: calc(100vh - 120rpx - 120rpx);
background-color: #2e394d;
.topItem {
display: flex;
justify-content: center;
align-items: center;
height: 30%;
background-image: url('../../static/image/index/1.png');
background-size: cover;
.imageFrame {
width: 90%;
height: 90%;
//padding:80rpx;
}
}
.threeHeOne {
display: flex;
padding: 20rpx 40rpx 10rpx;
flex-direction: column;
height: 60%;
.oneItem {
display: flex;
height: 33%;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
width: 80%;
background-color: #2e394d;
padding: 0 20rpx;
}
}
.right {
//height: 30%;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
.twoItem {
display: flex;
justify-content: space-between;
gap: 20rpx;
height: 33%;
margin-top: 20rpx;
padding: 10rpx;
.left {
width: 60%;
padding: 20rpx;
background-color: #1e293d;
}
.right {
width: 40%;
padding: 20rpx;
background-color: #1e293d;
}
}
.threeItem {
display: flex;
//width: 100vw;
height: 33%;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 20rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
background-color: #2e394d;
width: 80%;
padding: 0 20rpx;
}
}
.right {
//height: 200rpx;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
}
.btns {
display: flex;
justify-content: center;
align-items: center;
gap: 40rpx;
.oneBtn {
display: flex;
align-items: center;
justify-content: center;
width: 40%;
height: 70rpx;
border-radius: 40rpx;
color: #1F1C39;
font-size: 28rpx;
margin: 20rpx 10rpx 0 0;
background: #f2f2f2;
//margin-top: 20rpx;
border-radius: 40rpx;
}
.twoBtn {
display: flex;
align-items: center;
justify-content: center;
width: 40%;
height: 70rpx;
border-radius: 40rpx;
color: #1F1C39;
font-size: 28rpx;
margin: 20rpx 10rpx 0 0;
background: #f2f2f2;
//margin-top: 20rpx;
border-radius: 40rpx;
}
}
}
//
.purchaser {
display: flex;
flex-direction: column;
//gap: 40rpx;
background-color: #2e394d;
.topItem {
display: flex;
justify-content: center;
align-items: center;
height: 280rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
.imageFrame {
width: 90%;
height: 90%;
//padding:80rpx;
}
}
.threeHeOne {
display: flex;
padding: 20rpx 40rpx 10rpx;
flex-direction: column;
.oneItem {
display: flex;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
background-color: #2e394d;
padding: 0 20rpx;
}
}
.right {
height: 180rpx;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
.twoItem {
display: flex;
justify-content: space-between;
gap: 20rpx;
height: 280rpx;
margin-top: 20rpx;
padding: 10rpx;
.left {
width: 60%;
padding: 20rpx;
background-color: #1e293d;
}
.right {
width: 40%;
padding: 20rpx;
background-color: #1e293d;
}
}
.threeItem {
display: flex;
//width: 100vw;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 20rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
background-color: #2e394d;
padding: 0 20rpx;
}
}
.right {
height: 200rpx;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
}
}
}
</style>
* {
box-sizing: border-box;
}
.page {
background-color: #2e394d;
//
.supplier {
display: flex;
flex-direction: column;
height: calc(100vh - 120rpx - 120rpx);
background-color: #2e394d;
.topItem {
display: flex;
justify-content: center;
align-items: center;
height: 30%;
background-image: url('../../static/image/index/1.png');
background-size: cover;
.imageFrame {
width: 90%;
height: 90%;
//padding:80rpx;
}
}
.threeHeOne {
display: flex;
padding: 20rpx 40rpx 10rpx;
flex-direction: column;
height: 60%;
.oneItem {
display: flex;
height: 33%;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
width: 80%;
background-color: #2e394d;
padding: 0 20rpx;
}
}
.right {
//height: 30%;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
.twoItem {
display: flex;
justify-content: space-between;
gap: 20rpx;
height: 33%;
margin-top: 20rpx;
padding: 10rpx;
.left {
width: 60%;
padding: 20rpx;
background-color: #1e293d;
}
.right {
width: 40%;
padding: 20rpx;
background-color: #1e293d;
}
}
.threeItem {
display: flex;
//width: 100vw;
height: 33%;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 20rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
background-color: #2e394d;
width: 80%;
padding: 0 20rpx;
}
}
.right {
//height: 200rpx;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
}
.btns {
display: flex;
justify-content: center;
align-items: center;
gap: 40rpx;
.oneBtn {
display: flex;
align-items: center;
justify-content: center;
width: 40%;
height: 70rpx;
border-radius: 40rpx;
color: #1F1C39;
font-size: 28rpx;
margin: 20rpx 10rpx 0 0;
background: #f2f2f2;
//margin-top: 20rpx;
border-radius: 40rpx;
}
.twoBtn {
display: flex;
align-items: center;
justify-content: center;
width: 40%;
height: 70rpx;
border-radius: 40rpx;
color: #1F1C39;
font-size: 28rpx;
margin: 20rpx 10rpx 0 0;
background: #f2f2f2;
//margin-top: 20rpx;
border-radius: 40rpx;
}
}
}
//
.purchaser {
display: flex;
flex-direction: column;
//gap: 40rpx;
background-color: #2e394d;
.topItem {
display: flex;
justify-content: center;
align-items: center;
height: 280rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
.imageFrame {
width: 90%;
height: 90%;
//padding:80rpx;
}
}
.threeHeOne {
display: flex;
padding: 20rpx 40rpx 10rpx;
flex-direction: column;
.oneItem {
display: flex;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
background-color: #2e394d;
padding: 0 20rpx;
}
}
.right {
height: 180rpx;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
.twoItem {
display: flex;
justify-content: space-between;
gap: 20rpx;
height: 280rpx;
margin-top: 20rpx;
padding: 10rpx;
.left {
width: 60%;
padding: 20rpx;
background-color: #1e293d;
}
.right {
width: 40%;
padding: 20rpx;
background-color: #1e293d;
}
}
.threeItem {
display: flex;
//width: 100vw;
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 20rpx;
width: 33%;
background-color: #1e293d;
color: white;
font-size: 26rpx;
.subText {
background-color: #2e394d;
padding: 0 20rpx;
}
}
.right {
height: 200rpx;
width: 66%;
padding: 20rpx;
background-image: url('../../static/image/index/1.png');
background-size: cover;
font-size: 20rpx;
color: white;
}
}
}
}
}
</style>

+ 25
- 9
pages_order/auth/loginAndRegisterAndForgetPassword.vue View File

@ -18,7 +18,7 @@
<!-- 用户名&密码&隐私条款 -->
<view class="form">
<view>
<uv-input v-model="form.account" placeholder="请输入账号" border="surround" shape='circle'
<uv-input v-model="form.username" placeholder="请输入账号" border="surround" shape='circle'
clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
</view>
<view>
@ -64,7 +64,7 @@
<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'
<uv-button @tap="getCode" iconSize='10rpx' color='#1f1c39'
shape='circle'>{{tips}}</uv-button>
</view>
</view>
@ -89,7 +89,7 @@
</view>
<!-- tab -->
<!-- <view class="bottomTab">
<view class="bottomTab">
<span :class="titleIndex==0 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
@click='changePage(0)'>注册账号</span>
<span style="color: #9c9fa4">|</span>
@ -98,7 +98,7 @@
<span style="color: #9c9fa4">|</span>
<span :class="titleIndex==2 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
@click='changePage(2)'>忘记密码</span>
</view> -->
</view>
</view>
@ -123,8 +123,10 @@
titleList: ['注册', '登录', '重置密码'],
checkboxValue: [],
form: {
account: '13135294009',
password: 'lzx123456',
username: 'h',
password: 'l',
loginModel : 0,
captcha : '',
},
form1: {
userName: '',
@ -146,13 +148,27 @@
}
if(this.$utils.verificationAll(this.form, {
account: '请输入账号',
username: '请输入账号',
password: '请输入密码',
})){
return
}
this.$store.commit('accountLogin', this.form)
if(this.titleIndex == 0){
//
this.$api('registerUser', this.form, res =>{
if(res.code == 200){
this.titleIndex = 1
uni.showToast({
title: '注册成功,请登录!',
icon : 'none'
})
}
})
}else if(this.titleIndex == 1){
//
this.$store.commit('login', this.form)
}
},
//
changePage(index) {
@ -267,7 +283,7 @@
height: 80rpx;
color: #FFF;
background-color: $uni-color;
border: 1px solid red;
box-shadow: 0 0 4rpx 4rpx rgba($uni-color, 0.2);
border-radius: 100rpx;
font-size: 30rpx;
}


+ 103
- 99
pages_order/auth/wxLogin.vue View File

@ -4,150 +4,154 @@
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
</view>
<view class="title">
{{ $t('pageTitle.welcomeToAluminumTradingPlatform') }}
{{ $t('pageTitle.welcomeToAluminumTradingPlatform') }}
</view>
<view class="btn mt"
@click="wxLogin">
<view class="btn mt" @click="wxLogin">
<view class="icon">
<image src="../static/auth/wx.png" mode=""></image>
</view>
<view class="">
{{ $t('pageTitle.wechatAuthorizedLogin') }}
{{ $t('pageTitle.wechatAuthorizedLogin') }}
</view>
</view>
<!-- <view class="btn b2">
使用短信验证登录
</view> -->
<view class="config">
<uv-checkbox-group
v-model="checkboxValue"
shape="circle">
<uv-checkbox-group v-model="checkboxValue" shape="circle">
<view class="content">
<view
style="display: flex;">
<uv-checkbox
size="40rpx"
icon-size="30rpx"
activeColor="#FD5100"
:name="1"
></uv-checkbox>
{{ $t('components.agreeToReadAndAgree') }} <text @click="openConfigDetail('getPrivacyPolicy')"> {{ $t('components.serviceAgreementAndPrivacyTerms') }}</text>
<view style="display: flex;">
<uv-checkbox size="40rpx" icon-size="30rpx" activeColor="#FD5100" :name="1"></uv-checkbox>
{{ $t('components.agreeToReadAndAgree') }} <text @click="openConfigDetail('getPrivacyPolicy')">
{{ $t('components.serviceAgreementAndPrivacyTerms') }}</text>
</view>
<view class="">
{{ $t('components.and') }} <text @click="openConfigDetail('getUserAgreement')"> {{ $t('components.personalInfoProtectionGuideline') }}</text>
{{ $t('components.and') }} <text @click="openConfigDetail('getUserAgreement')">
{{ $t('components.personalInfoProtectionGuideline') }}</text>
</view>
</view>
</uv-checkbox-group>
</view>
<configPopup ref="popup"></configPopup>
</view>
</template>
<script>
import configPopup from '@/components/config/configPopup.vue';
export default {
name : 'Login',
name: 'Login',
data() {
return {
checkboxValue : []
checkboxValue: []
}
},
methods: {
wxLogin(){
if(!this.checkboxValue.length){
return uni.showToast({
title: this.$t('components.agreeToPrivacyAgreement'),
icon: 'none'
});
}
wxLogin() {
if (!this.checkboxValue.length) {
return uni.showToast({
title: this.$t('components.agreeToPrivacyAgreement'),
icon: 'none'
});
}
this.$store.commit('login')
},
//
openConfigDetail(key){
openConfigDetail(key) {
this.$refs.popup.open(key)
}
}
}
</script>
<style scoped lang="scss">
.login{
display: flex;
justify-content: center;
align-items: center;
height: 80vh;
flex-direction: column;
position: relative;
.logo{
height: 140rpx;
width: 140rpx;
background-color: #ddd;
border-radius: 30rpx;
image{
width: 80rpx;
height: 80rpx;
}
margin-bottom: 20rpx;
}
.title{
position: relative;
font-weight: 900;
font-size: 45rpx;
&::after{
content: '';
position: absolute;
left: 0;
top: 100%;
display: block;
height: 8rpx;
width: 210rpx;
background: linear-gradient(to right,$uni-color, #fff);
}
}
.btn{
width: 80%;
height: 100rpx;
background-color: $uni-color;
color: #fff;
.login {
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0;
border-radius: 20rpx;
.icon{
margin-right: 10rpx;
image{
width: 40rpx;
height: 35rpx;
height: 80vh;
flex-direction: column;
position: relative;
.logo {
height: 140rpx;
width: 140rpx;
background-color: #ddd;
border-radius: 30rpx;
image {
width: 80rpx;
height: 80rpx;
}
margin-bottom: 20rpx;
}
}
.b2{
background-color: rgba($uni-color, 0.2);
color: $uni-color;
}
.mt{
margin-top: 200rpx;
}
.config{
position: absolute;
bottom: 0;
font-size: 22rpx;
text-align: center;
line-height: 40rpx;
text{
.title {
position: relative;
font-weight: 900;
font-size: 45rpx;
&::after {
content: '';
position: absolute;
left: 0;
top: 100%;
display: block;
height: 8rpx;
width: 210rpx;
background: linear-gradient(to right, $uni-color, #fff);
}
}
.btn {
width: 80%;
height: 100rpx;
background-color: $uni-color;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0;
border-radius: 20rpx;
.icon {
margin-right: 10rpx;
image {
width: 40rpx;
height: 35rpx;
}
}
}
.b2 {
background-color: rgba($uni-color, 0.2);
color: $uni-color;
}
.mt {
margin-top: 200rpx;
}
.config {
position: absolute;
bottom: 0;
font-size: 22rpx;
text-align: center;
line-height: 40rpx;
text {
color: $uni-color;
}
}
}
}
</style>
</style>

+ 13
- 25
store/store.js View File

@ -36,37 +36,25 @@ const store = new Vuex.Store({
})
})
},
login(state){
login(state, form){
uni.showLoading({
title: '登录中...'
})
uni.login({success(res) {
if(res.errMsg != "login:ok"){
return
}
api('wxLogin', {
code : res.code
}, res => {
uni.hideLoading()
if(res.code != 200){
return
}
api('loginUser', form, res => {
state.userInfo = res.result.userInfo
uni.setStorageSync('token', res.result.token)
uni.hideLoading()
if(!state.userInfo.nickName || !state.userInfo.headImage){
uni.navigateTo({
url: '/pages_order/auth/wxUserInfo'
})
}else{
uni.navigateBack(-1)
}
})
if(res.code != 200){
return
}
state.userInfo = res.result.userInfo
uni.setStorageSync('token', res.result.token)
uni.reLaunch({
url: '/pages/index/index'
})
})
},
getUserInfo(state){


+ 1
- 1
uni_modules/uv-ui-tools/libs/css/color.scss View File

@ -6,7 +6,7 @@ $uv-border-color: #dadbde !default;
$uv-bg-color: #f3f4f6 !default;
$uv-disabled-color: #c8c9cc !default;
$uv-primary: #FD5100 !default;
$uv-primary: #1f1c39 !default;
// $uv-primary: #3c9cff !default;
$uv-primary-dark: #398ade !default;
$uv-primary-disabled: #9acafc !default;


Loading…
Cancel
Save