RIceWqy 2 years ago
parent f5f7d733ff
commit c0a2dc6eab

@ -3,11 +3,11 @@
<view class="login-wrap cu-dialog form-wrap safe-area-inset-bottom" @tap.stop <view class="login-wrap cu-dialog form-wrap safe-area-inset-bottom" @tap.stop
style="border-radius: 20rpx 20rpx 0 0;"> style="border-radius: 20rpx 20rpx 0 0;">
<!-- 1.账号密码登录 --> <!-- 1.账号密码登录 -->
<view v-if="authType === 'accountLogin'"> <view v-if="authType === 'accountLogin'" >
<!-- 标题 --> <!-- 标题 -->
<view class="head-box u-m-b-60 u-flex-col "> <view class="head-box u-m-b-60 u-flex-col ">
<view class="u-flex u-m-b-20"> <view class="u-flex u-m-b-20">
<view class="head-title u-m-r-40 head-title-animation">账号登录</view> <!-- <view class="head-title u-m-r-40 head-title-animation" style="display:none">账号登录</view> -->
<view class="head-title-active head-title-line" @tap="showAuthModal('smsLogin')"> <view class="head-title-active head-title-line" @tap="showAuthModal('smsLogin')">
短信登录 短信登录
</view> </view>
@ -47,18 +47,19 @@
</button> </button>
</view> </view>
<!-- 2.短信登录 --> <!-- 2.短信登录 -->
<view v-if="authType === 'smsLogin'"> <view v-if="authType === 'smsLogin'">
<view class="head-box u-m-b-60"> <view class="head-box u-m-b-60">
<view class="u-flex u-m-b-20"> <view class="u-flex u-m-b-20">
<view class="head-title-active u-m-r-40" @tap="showAuthModal('accountLogin')"> <view class="head-title-active u-m-r-40" @tap="showAuthModal('accountLogin')" style="display: none;">
账号登录 账号登录
</view> </view>
<view class="head-title head-title-line head-title-animation"> <view class="head-title head-title-line head-title-animation">
短信登录 短信登录
</view> </view>
</view> </view>
<view class="head-subtitle">未注册手机号请先点击下方立即注册</view> <!-- <view class="head-subtitle">未注册手机号请先点击下方立即注册</view> -->
</view> </view>
<view class="form-item u-border-bottom"> <view class="form-item u-border-bottom">
<view class="item-content u-flex u-col-center"> <view class="item-content u-flex u-col-center">
@ -88,7 +89,7 @@
</view> </view>
<view class="message-error">{{ form["smsLogin"].error.code || "" }}</view> <view class="message-error">{{ form["smsLogin"].error.code || "" }}</view>
</view> </view>
<button class="u-reset-button type-btn" @tap="showAuthModal('register')"> <button class="u-reset-button type-btn" @tap="showAuthModal('register')" style="display: none;">
立即注册 立即注册
</button> </button>
</view> </view>
@ -493,13 +494,26 @@ export default {
} }
} }
}, },
mounted() { },
watch: {
authType(newAuthType, oldAuthType) {
//
if (newAuthType === "accountLogin") {
this.$store.commit("setAuthType", "smsLogin");
}
}
},
mounted() {
},
methods: { methods: {
...mapActions(["getUserInfo", "showAuthModal"]), ...mapActions(["getUserInfo", "showAuthModal"]),
// //
checkValue(e, key) { checkValue(e, key) {
console.log("checkValue@@@@")
// this.validation(key); // this.validation(key);
}, },

@ -17,7 +17,7 @@ async function bootstrap() {
Vue.use(uView); Vue.use(uView);
// 加载shopro // 加载shopro
Vue.use(shopro); Vue.use(shopro);
Vue.use(jsonrpc) Vue.use(jsonrpc);
const app = new Vue({ const app = new Vue({
store, store,
...App ...App

@ -23,11 +23,12 @@
<view class="head-img-wrap"> <view class="head-img-wrap">
<image class="head-img" :src="userInfo.avatar || $IMG_URL + '/imgs/base_avatar.png'" <image class="head-img" :src="userInfo.avatar || $IMG_URL + '/imgs/base_avatar.png'"
mode="aspectFill"></image> mode="aspectFill"></image>
<!-- 同步信息 --> <!-- 同步信息 -->
<block v-if="showRefresh"> <block v-if="showRefresh">
<button @tap.stop="showModal = true" <button @tap.stop="showModal = true"
class="u-reset-button u-flex u-row-center u-col-center refresh-btn"> class="u-reset-button u-flex u-row-center u-col-center refresh-btn">
<view class="u-iconfont uicon-reload" style="color: #fff;font-size: 24rpx;"> <view class="u-iconfont uicon-reload" style="color: #fff;font-size: 24rpx;">123123
</view> </view>
</button> </button>
</block> </block>

@ -3,7 +3,7 @@
<view class="address-wrap"> <view class="address-wrap">
<u-form :model="model" :rules="rules" ref="uForm" :errorType="errorType"> <u-form :model="model" :rules="rules" ref="uForm" :errorType="errorType">
<!-- 地址定位 --> <!-- 地址定位 -->
<view class="location-item u-flex u-row-between u-p-20 u-m-b-20" @tap="getLocation"> <view class="location-item u-flex u-row-between u-p-20 u-m-b-20" @tap="getLocation" style="display: none;">
<view class="u-flex"> <view class="u-flex">
<text class="u-iconfont uicon-map-fill" style="#a76f0d;"></text> <text class="u-iconfont uicon-map-fill" style="#a76f0d;"></text>
<text>{{ chooseAddress }}</text> <text>{{ chooseAddress }}</text>

@ -183,7 +183,9 @@ export default {
computed: { computed: {
...mapGetters(["userInfo", "authType"]) ...mapGetters(["userInfo", "authType"])
}, },
onLoad() { onLoad() {
console.log("open user info ")
this.userData = JSON.parse(JSON.stringify(this.userInfo)); this.userData = JSON.parse(JSON.stringify(this.userInfo));
this.getThirdOauthInfo(); this.getThirdOauthInfo();
}, },

@ -14,7 +14,8 @@ export default function http(
shoproRequest.interceptor.request((config, cancel) => { shoproRequest.interceptor.request((config, cancel) => {
let token = uni.getStorageSync('token'); let token = uni.getStorageSync('token');
if (api.auth && !token) { if (api.auth && !token) {
store.dispatch('showAuthModal');
store.dispatch('showAuthModal',"smsLogin");
uni.hideLoading() uni.hideLoading()
throw (`暂未登录,已阻止此次API请求: '${api.url}'`); throw (`暂未登录,已阻止此次API请求: '${api.url}'`);
} }

@ -23,7 +23,7 @@ export default {
shoproRequest.interceptor.request((config, cancel) => { shoproRequest.interceptor.request((config, cancel) => {
let token = uni.getStorageSync('token'); let token = uni.getStorageSync('token');
if (api.auth && !token) { if (api.auth && !token) {
store.dispatch('showAuthModal'); store.dispatch('showAuthModal',"smsLogin");
uni.hideLoading(); uni.hideLoading();
throw (`暂未登录,已阻止此次API请求: '${api.url}'`); throw (`暂未登录,已阻止此次API请求: '${api.url}'`);
} }

@ -12,7 +12,7 @@ const state = {
agentInfo: {}, //分销商信息 agentInfo: {}, //分销商信息
userData: {}, //用户其他相关信息 userData: {}, //用户其他相关信息
subscribeMessageIdsMap: [], //小程序订阅消息模板ids subscribeMessageIdsMap: [], //小程序订阅消息模板ids
authType: '' // smsLogin:手机号登录注册, accountLogin:密码登录, forgotPwd:忘记密码, changePwd:修改密码, bindMobile:绑定手机号 authType: 'smsLogin' // smsLogin:手机号登录注册, accountLogin:密码登录, forgotPwd:忘记密码, changePwd:修改密码, bindMobile:绑定手机号
} }
const getters = { const getters = {
@ -162,6 +162,9 @@ const actions = {
} }
const mutations = { const mutations = {
setAuthType(state, authType) {
state.authType = authType;
},
token(state, payload) { token(state, payload) {
state.token = payload; state.token = payload;
uni.setStorageSync("token", payload); uni.setStorageSync("token", payload);

Loading…
Cancel
Save