This commit is contained in:
Gdpao 2020-07-29 15:04:57 +08:00
parent f21df2f107
commit 8bb1cdfd39
6 changed files with 163 additions and 122 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
.vscode
/node_modules/*
unpackage
manifest.json
manifest.json
deming.keystore

View File

@ -1,5 +1,9 @@
import Vue from 'vue'
import Vuex from 'vuex'
import {
mapMutations
} from 'vuex';
Vue.use(Vuex)
const store = new Vuex.Store({
@ -12,6 +16,8 @@ const store = new Vuex.Store({
pintuangroup_headid: '', // 拼团团长id 有为开团 无为参团
groupbuyInfo: {}, // 秒杀详情
loadmore: {}, // 下拉加载返回的数据
hasLogin: false, // 登录状态
token: "" // 储存token
},
getters: {
getOrderAddress(state) {
@ -25,6 +31,23 @@ const store = new Vuex.Store({
}
},
mutations: {
// 登录
loginIn(state, token) {
state.hasLogin = true;
state.token = token;
uni.setStorage({
key: "token",
data: token
})
},
// 退出登录
logout(state) {
state.hasLogin = false;
state.token = "";
uni.removeStorage({
key: "token"
})
},
setOrderType(state, type) {
state.orderType = type;
},
@ -48,7 +71,7 @@ const store = new Vuex.Store({
},
setLoadMore(state, info) {
state.loadmore = info;
},
}
}
})
export default store;
export default store;

View File

@ -1,6 +1,6 @@
{
"name" : "deming",
"appid" : "__UNI__62A680B",
"appid" : "__UNI__EBFF00A",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -18,7 +18,12 @@
},
/* */
"modules" : {
"OAuth" : {}
"OAuth" : {},
"Share" : {},
"Push" : {},
"Maps" : {},
"LivePusher" : {},
"Payment" : {}
},
/* */
"distribute" : {
@ -37,6 +42,7 @@
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
@ -46,6 +52,7 @@
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
@ -58,7 +65,14 @@
"qq" : {
"appid" : "101884160"
}
}
},
"maps" : {
"amap" : {
"appkey_ios" : "eafe430aa31fa033dcf45a0e87032653",
"appkey_android" : "8045e8a4cd6d544690c786265b248f91"
}
},
"share" : {}
}
}
},

View File

@ -8,11 +8,11 @@
<view class="title">手机登录</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
<input type="tel" placeholder="请输入您的手机号" maxlength="11" v-model="member_mobile" />
</view>
<view class="labales">
<!-- <text></text> -->
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
<input type="number" placeholder="请输入验证码" maxlength="6" v-model="sms_code" />
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile"></identifying>
</view>
@ -22,7 +22,8 @@
<view>
<view></view>
<text>我已详细阅读并同意</text>
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}} </text>
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}}
</text>
</view>
<u-checkbox-group @change="checkboxGroupChange" size="27">
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
@ -32,12 +33,12 @@
</view>
<!-- 注册 -->
<view class="more_Login">
<text @click="registerUrl()">{{register}}</text>
<text @click="registerUrl()">{{register}}</text>
<text class="other" @click="mask_u">其他方式登录</text>
</view>
</view>
<!-- denglu QQ weixin -->
<view class="buttones">
<view @click="loginOn">{{login}}</view>
<view @click="loginOn">{{login}}</view>
</view>
<u-mask :show="show" @click="show = false">
<view class="warp">
@ -50,7 +51,7 @@
<image src="../../static/pageA/weixin.png" class="image"></image>
<view>微信登录</view>
</view>
<view class="rect_butoon" @click="show = false">取消</view>
<view class="rect_butoon" @click="show = false">取消</view>
</view>
</view>
</u-mask>
@ -60,6 +61,7 @@
</template>
<script>
import identifying from '@/components/logininput/identifying'
import { mapMutations } from 'vuex';
export default {
data() {
return {
@ -96,9 +98,10 @@
},
onLoad() {
//
this.apiwelcome()
this.apiwelcome();
},
methods: {
...mapMutations(['loginIn']),
apiwelcome() {
this.$u.api.sendSmsCode({
@ -107,14 +110,15 @@
})
},
//
pact_click(index){
pact_click(index) {
console.log(index)
uni.navigateTo({
url: '/pageA/pactList/pactList?index=' + index
url: '/pageA/pactList/pactList?index=' + index
});
},
//
loginOn() {
let me = this;
// uni.navigateTo({
// url: '/pageE/zhibo/index'
// });
@ -123,8 +127,8 @@
// console.log(this.sms_code)
//
//
let type_phone = this.$u.test.mobile( this.member_mobile)
if( this.member_mobile == ''){
let type_phone = this.$u.test.mobile(this.member_mobile)
if (this.member_mobile == '') {
this.$refs.uToast.show({
title: '手机号不能为空',
type: 'error'
@ -138,8 +142,8 @@
});
return false;
}
if( this.sms_code == ''){
this.$refs.uToast.show({
if (this.sms_code == '') {
this.$refs.uToast.show({
title: '验证码不能为空',
type: 'error'
})
@ -152,16 +156,16 @@
console.log(res)
// console.log(res)
if (res.errCode == 0) {
if(res.data == ''){
if (res.data == '') {
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
return false
}else{
uni.setStorageSync('token', res.data.token);//
} else {
me.loginIn(res.data.token); //
uni.navigateTo({
url : '/pageA/topick/topick'
url: '/pageA/topick/topick'
})
//
// uni.setStorageSync({
@ -176,9 +180,9 @@
// }
// });
}
// token
uni.setStorageSync('token', res.data.token);//
me.loginIn(res.data.token); //
// //
// this.$refs.uToast.show({
// title: res.message,
@ -192,11 +196,11 @@
type: 'error'
})
}
})
})
},
// qq
rect_qq() {
console.log("授权Q")
console.log("授权QQ")
var vm = this;
uni.getProvider({
service: 'oauth',
@ -296,10 +300,12 @@
width: 630rpx;
margin: 0 auto;
}
.u-checkbox__icon-wrap .u-icon{
width: 26rpx!important;
.u-checkbox__icon-wrap .u-icon {
width: 26rpx !important;
height: 26rpx;
}
.more_Login text {
display: inline-block;
width: 50%;
@ -397,7 +403,7 @@
height: 22rpx;
}
.buttones > view {
.buttones>view {
width: 628rpx;
height: 98rpx;
background: rgba(255, 120, 15, 1) !important;

View File

@ -1,7 +1,7 @@
<template>
<view class="photo">
<view class="back">
<image></image>
<u-icon name="close" color="#999999" :size="30"></u-icon>
</view>
<swiper class="swiper">
<swiper-item>
@ -34,11 +34,7 @@
.back{
padding-top: 28rpx;
padding-right: 31rpx;
>image{
width: 31rpx;
height: 31rpx;
float: right;
}
text-align: right;
}
.swiper{
width: 100%;

View File

@ -14,98 +14,99 @@
<view>退出登录</view>
<image src="../static/mine/21.png"></image>
</view>
<u-action-sheet
v-model="sheetStatus"
:list="list"
:tips="tips"
:border-radius="20"
@click="choiceOption">
<u-action-sheet v-model="sheetStatus" :list="list" :tips="tips" :border-radius="20" @click="choiceOption">
</u-action-sheet>
</view>
</template>
<script>
export default {
data() {
return {
checked: false,
tips: {
text: '您可选择以下操作',
color: '#999999',
fontSize: 24
},
sheetStatus: false,
list: [
{
text: '换个账号登录',
color: '#FF780F',
fontSize: 28
import {
mapMutations
} from 'vuex';
export default {
data() {
return {
checked: false,
tips: {
text: '您可选择以下操作',
color: '#999999',
fontSize: 24
},
{
text: '退出登录',
color: '#FF780F',
fontSize: 28
}
],
settingList: [
{
title: '个人信息',
link: '../mine/MineInfo'
},
{
title: '收货地址',
link: '../more/Address'
},
{
title: '证件中心',
link: '../mine/ArticleDetails?type=1'
},
{
title: '屏蔽用户',
link: './ShieldUsers'
},
{
title: '关于我们',
link: '../mine/ArticleDetails?type=2'
},
{
title: '帮助与反馈',
link: './feedback'
},
]
}
},
methods: {
choiceOption(index) {
console.log(index);
// console.log(`${index + 1}${this.list[index].text}`)
sheetStatus: false,
list: [{
text: '换个账号登录',
color: '#FF780F',
fontSize: 28
},
{
text: '退出登录',
color: '#FF780F',
fontSize: 28
}
],
settingList: [{
title: '个人信息',
link: '../mine/MineInfo'
},
{
title: '收货地址',
link: '../more/Address'
},
{
title: '证件中心',
link: '../mine/ArticleDetails?type=1'
},
{
title: '屏蔽用户',
link: './ShieldUsers'
},
{
title: '关于我们',
link: '../mine/ArticleDetails?type=2'
},
{
title: '帮助与反馈',
link: './feedback'
},
]
}
},
toNextPage(url, ...params) {
uni.navigateTo({
url: url
});
}
},
};
methods: {
...mapMutations(['logout']),
// 退 0 | 1退
choiceOption(index) {
console.log(index);
if (index == 1) {
this.logout();
}
},
toNextPage(url, ...params) {
uni.navigateTo({
url: url
});
}
},
};
</script>
<style lang="scss" scoped>
.setting {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
.list-item {
display: flex;
align-items: center;
justify-content: space-between;
height: 98rpx;
border-top: 2rpx solid #EBEBEB;
background-color: #ffffff;
padding: 0 30rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
> image {
width: 14rpx;
height: 24rpx;
.setting {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
.list-item {
display: flex;
align-items: center;
justify-content: space-between;
height: 98rpx;
border-top: 2rpx solid #EBEBEB;
background-color: #ffffff;
padding: 0 30rpx;
font-size: 30rpx;
color: rgba(51, 51, 51, 1);
>image {
width: 14rpx;
height: 24rpx;
}
}
}
}
</style>
</style>