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 .vscode
/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"
@ -32,12 +33,12 @@
</view> </view>
<!-- 注册 --> <!-- 注册 -->
<view class="more_Login"> <view class="more_Login">
<text @click="registerUrl()">{{register}}</text> <text @click="registerUrl()">{{register}}</text>
<text class="other" @click="mask_u">其他方式登录</text> <text class="other" @click="mask_u">其他方式登录</text>
</view> </view>
<!-- denglu QQ weixin --> <!-- denglu QQ weixin -->
<view class="buttones"> <view class="buttones">
<view @click="loginOn">{{login}}</view> <view @click="loginOn">{{login}}</view>
</view> </view>
<u-mask :show="show" @click="show = false"> <u-mask :show="show" @click="show = false">
<view class="warp"> <view class="warp">
@ -50,7 +51,7 @@
<image src="../../static/pageA/weixin.png" class="image"></image> <image src="../../static/pageA/weixin.png" class="image"></image>
<view>微信登录</view> <view>微信登录</view>
</view> </view>
<view class="rect_butoon" @click="show = false">取消</view> <view class="rect_butoon" @click="show = false">取消</view>
</view> </view>
</view> </view>
</u-mask> </u-mask>
@ -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,14 +110,15 @@
}) })
}, },
// //
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
}); });
}, },
// //
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,8 +142,8 @@
}); });
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({
@ -176,9 +180,9 @@
// } // }
// }); // });
} }
// 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,
@ -192,11 +196,11 @@
type: 'error' type: 'error'
}) })
} }
}) })
}, },
// 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,98 +14,99 @@
<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 {
data() { mapMutations
return { } from 'vuex';
checked: false, export default {
tips: { data() {
text: '您可选择以下操作', return {
color: '#999999', checked: false,
fontSize: 24 tips: {
}, text: '您可选择以下操作',
sheetStatus: false, color: '#999999',
list: [ fontSize: 24
{
text: '换个账号登录',
color: '#FF780F',
fontSize: 28
}, },
{ sheetStatus: false,
text: '退出登录', list: [{
color: '#FF780F', text: '换个账号登录',
fontSize: 28 color: '#FF780F',
} fontSize: 28
], },
settingList: [ {
{ text: '退出登录',
title: '个人信息', color: '#FF780F',
link: '../mine/MineInfo' fontSize: 28
}, }
{ ],
title: '收货地址', settingList: [{
link: '../more/Address' title: '个人信息',
}, link: '../mine/MineInfo'
{ },
title: '证件中心', {
link: '../mine/ArticleDetails?type=1' title: '收货地址',
}, link: '../more/Address'
{ },
title: '屏蔽用户', {
link: './ShieldUsers' title: '证件中心',
}, link: '../mine/ArticleDetails?type=1'
{ },
title: '关于我们', {
link: '../mine/ArticleDetails?type=2' title: '屏蔽用户',
}, link: './ShieldUsers'
{ },
title: '帮助与反馈', {
link: './feedback' title: '关于我们',
}, link: '../mine/ArticleDetails?type=2'
] },
} {
}, title: '帮助与反馈',
methods: { link: './feedback'
choiceOption(index) { },
console.log(index); ]
}
// console.log(`${index + 1}${this.list[index].text}`)
}, },
toNextPage(url, ...params) { methods: {
uni.navigateTo({ ...mapMutations(['logout']),
url: url // 退 0 | 1退
}); choiceOption(index) {
} console.log(index);
}, if (index == 1) {
}; this.logout();
}
},
toNextPage(url, ...params) {
uni.navigateTo({
url: url
});
}
},
};
</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 {
display: flex; .list-item {
align-items: center; display: flex;
justify-content: space-between; align-items: center;
height: 98rpx; justify-content: space-between;
border-top: 2rpx solid #EBEBEB; height: 98rpx;
background-color: #ffffff; border-top: 2rpx solid #EBEBEB;
padding: 0 30rpx; background-color: #ffffff;
font-size: 30rpx; padding: 0 30rpx;
color: rgba(51,51,51,1); font-size: 30rpx;
> image { color: rgba(51, 51, 51, 1);
width: 14rpx;
height: 24rpx; >image {
width: 14rpx;
height: 24rpx;
}
} }
} }
} </style>
</style>