This commit is contained in:
Sliverber 2024-02-27 15:35:03 +08:00
parent a4a29feecb
commit e3d3900465
9 changed files with 114 additions and 28 deletions

View File

@ -155,6 +155,11 @@
scope
} = option.query;
console.log(option.query,'option.queryoption.queryoption.query');
if(option.query.channelId){
uni.setStorageSync('channelId', option.query.channelId);
}
if (code && code != uni.getStorageSync('snsapiCode') && location.pathname.indexOf(
'/pages/users/wechat_login/index') === -1) {
// code

View File

@ -10,6 +10,7 @@ export function getInformation() {
// 查询用户是否已经保存过信息
export function getidentity(data) {
console.log(data,'datadata');
return request.get('api/front/identity/info', data, {
noAuth: true
});

View File

@ -34,7 +34,9 @@ export function loginH5(data) {
export function loginMobile(data) {
return request.post("login/mobile", data, { noAuth : true });
}
export function loginMobiles(data) {
return request.post("bindPhone", data, { noAuth : true });
}
/**
* 验证码key
*/

View File

@ -1,9 +1,9 @@
//移动端商城API
// let domain = 'http://117.50.163.143:20410'
// let domain = 'http://117.50.215.20:20410'
let domain = 'http://192.168.2.26:20411'
// let domain = 'http://192.168.2.26:20411'
// let domain = 'http://106.75.49.247:20410'
// let domain = 'https://yruibao.com/prod'
let domain = 'https://yruibao.com/prod'
module.exports = {
// 请求域名 格式: https://您的域名
// #ifdef MP || APP-PLUS

View File

@ -1,6 +1,6 @@
{
"name" : "先享后付",
"appid" : "__UNI__E7B7107", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B
"appid" : "__UNI__EA8F22D", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B
"description" : "crmeb商城",
"versionName" : "2.1",
"versionCode" : 2,

View File

@ -738,6 +738,19 @@
}
}
},
{
"path": "logins/index",
"style": {
"navigationBarTitleText": "绑定手机号",
"app-plus": {
// #ifdef APP-PLUS
"titleNView": {
"type": "default"
}
// #endif
}
}
},
{
"path": "goods_comment_list/index",
"style": {

View File

@ -470,6 +470,22 @@
}
},
onShow() {
let self = this;
if (!self.$Cache.getItem('cityList')) getCityList()
// #ifdef APP-PLUS
let barHeight = uni.getSystemInfoSync().statusBarHeight;
self.marTop = barHeight + 40; //
setTimeout(() => {
if (self.appUpdate.openUpgrade == 'true') {
self.appVersionConfig();
}
}, 1000)
// #endif
uni.showTabBar();
let currentUrl = window.location.href;
// URL
@ -498,19 +514,6 @@
}else{
}
let self = this;
if (!self.$Cache.getItem('cityList')) getCityList()
// #ifdef APP-PLUS
let barHeight = uni.getSystemInfoSync().statusBarHeight;
self.marTop = barHeight + 40; //
setTimeout(() => {
if (self.appUpdate.openUpgrade == 'true') {
self.appVersionConfig();
}
}, 1000)
// #endif
uni.showTabBar();
// ip
// this.getip()
},

View File

@ -152,7 +152,7 @@
import {
getMenuList,
copyrightApi,
getUserInfo
} from '@/api/user.js';
import {
orderData,
@ -332,9 +332,15 @@
if(uni.getStorageSync('loginstause')){
console.log('进入判断3');
}else{
console.log('进入判断4');
if(uni.getStorageSync('loginopen')){
uni.navigateTo({
url:'/pages/users/logins/index'
})
}else{
this.sendwxcode(codeValue)
}
console.log('进入判断4');
// uni.navigateTo({
// url:'/pages/users/login/index'
// })
@ -365,21 +371,58 @@
console.log(code,'wxcodewxcodewxcodewxcode');
// sendwxcodes(code).then(res => {
// console.log('wxcodewxcodewxcodewxcode');
// // uni.setStorageSync('openids', res.data.openId);
// //
// })
uni.request({
// url: 'https://yruibao.com/prod/api/front/login/wxpublic',
url: 'http://192.168.2.26:20411/api/front/login/wxpublic', //
url: 'https://yruibao.com/prod/api/front/login/wxpublic',
// url: 'http://192.168.2.26:20411/api/front/login/wxpublic', //
data: data,
method:'POST',
success: (res) => {
console.log(res.data);
if(res.data.data.isBandPhone==false){
console.log('调换 aaaaaaaaaa');
uni.setStorageSync('loginopen', res.data.data.openid);
uni.navigateTo({
url:'/pages/users/logins/index'
})
}else{
console.log(res.data.data.token,'');
this.$store.commit("LOGIN", {
'token': res.data.data.token
});
// uni.switchTab({
// url:'/pages/index/index'
// })
let login = true
uni.setStorageSync('loginstause',login);
let data = res.data.data;
this.getUserInfo(data)
}
// this.text = 'request success';
}
});
},
getUserInfo(data){
console.log(data,'dadadada');
this.$store.commit("SETUID", data.uid);
getUserInfo().then(res => {
this.$store.commit("UPDATE_USERINFO", res.data);
console.log('成功登录了');
this.$forceUpdate()
let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
if (backUrl.indexOf('/pages/users/login/index') !== -1) {
backUrl = '/pages/index/index';
}
uni.reLaunch({
url: backUrl
});
})
},
//
getidentityq:function(){
let data = {

View File

@ -2,7 +2,7 @@
<div class="login-wrapper" :data-theme="theme">
<div class="shading">
<!-- <image :src="logoUrl"/> -->
<image :src="logoUrl"/>
<!-- <image :src="logoUrl"/> -->
<!-- <image src="/static/images/logo2.png" v-if="!logoUrl" /> -->
</div>
<div class="whiteBg" v-if="formItem === 1">
@ -46,7 +46,7 @@
</div>
</div>
</div>
<div class="logon bg_color" @click="loginMobile" v-if="current !== 0">登录</div>
<div class="logon bg_color" @click="loginMobile" v-if="current !== 0">绑定手机号</div>
<div class="logon bg_color" @click="submit" v-if="current === 0">登录</div>
<!-- #ifndef APP-PLUS -->
<div class="tips">
@ -82,11 +82,12 @@
</div>
</template>
<script>
import Cache from '@/utils/cache';
import dayjs from "@/plugin/dayjs/dayjs.min.js";
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
loginH5,
loginMobile,
loginMobiles,
registerVerify,
register,
// getCodeApi,
@ -137,6 +138,7 @@
}
},
mounted: function() {
this.getCode();
this.getLogoImage();
},
@ -150,6 +152,11 @@
}
});
},
onShow() {
let abb=uni.getStorageSync('channelId')
console.log(abb,'abbabbabbabbabb');
},
methods: {
//
appleLogin() {
@ -312,10 +319,20 @@
uni.showLoading({
title: '登录中'
})
loginMobile({
let channelId=''
let abb=uni.getStorageSync('channelId')
if(abb!=undefined){
channelId=abb
}
let openid= uni.getStorageSync('loginstause');
loginMobiles({
phone: that.account,
captcha: that.captcha,
spread_spid: that.$Cache.get("spread"),
openid:openid,
channelId:channelId,
// spread_spid: that.$Cache.get("spread"),
})
@ -327,6 +344,8 @@
});
uni.hideLoading();
that.getUserInfo(data);
let login = true
uni.setStorageSync('loginstause',login);
})
.catch(res => {
uni.hideLoading();