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

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/node_modules/* /node_modules/*
unpackage unpackage
manifest.json manifest.json
deming.keystore

View File

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

View File

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

View File

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

View File

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

View File

@ -14,17 +14,15 @@
<view>退出登录</view> <view>退出登录</view>
<image src="../static/mine/21.png"></image> <image src="../static/mine/21.png"></image>
</view> </view>
<u-action-sheet <u-action-sheet v-model="sheetStatus" :list="list" :tips="tips" :border-radius="20" @click="choiceOption">
v-model="sheetStatus"
:list="list"
:tips="tips"
:border-radius="20"
@click="choiceOption">
</u-action-sheet> </u-action-sheet>
</view> </view>
</template> </template>
<script> <script>
export default { import {
mapMutations
} from 'vuex';
export default {
data() { data() {
return { return {
checked: false, checked: false,
@ -34,8 +32,7 @@ export default {
fontSize: 24 fontSize: 24
}, },
sheetStatus: false, sheetStatus: false,
list: [ list: [{
{
text: '换个账号登录', text: '换个账号登录',
color: '#FF780F', color: '#FF780F',
fontSize: 28 fontSize: 28
@ -46,8 +43,7 @@ export default {
fontSize: 28 fontSize: 28
} }
], ],
settingList: [ settingList: [{
{
title: '个人信息', title: '个人信息',
link: '../mine/MineInfo' link: '../mine/MineInfo'
}, },
@ -75,10 +71,13 @@ export default {
} }
}, },
methods: { methods: {
...mapMutations(['logout']),
// 退 0 | 1退
choiceOption(index) { choiceOption(index) {
console.log(index); console.log(index);
if (index == 1) {
// console.log(`${index + 1}${this.list[index].text}`) this.logout();
}
}, },
toNextPage(url, ...params) { toNextPage(url, ...params) {
uni.navigateTo({ uni.navigateTo({
@ -86,12 +85,13 @@ export default {
}); });
} }
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.setting { .setting {
min-height: calc(100vh - var(--window-top)); min-height: calc(100vh - var(--window-top));
background-color: #ECECEC; background-color: #ECECEC;
.list-item { .list-item {
display: flex; display: flex;
align-items: center; align-items: center;
@ -101,11 +101,12 @@ export default {
background-color: #ffffff; background-color: #ffffff;
padding: 0 30rpx; padding: 0 30rpx;
font-size: 30rpx; font-size: 30rpx;
color: rgba(51,51,51,1); color: rgba(51, 51, 51, 1);
> image {
>image {
width: 14rpx; width: 14rpx;
height: 24rpx; height: 24rpx;
} }
} }
} }
</style> </style>