初始化万家商超用户端仓库

This commit is contained in:
wangxiaowei
2025-04-30 14:04:34 +08:00
commit 022c640d89
425 changed files with 160005 additions and 0 deletions

View File

@ -0,0 +1,178 @@
<template>
<view class="page" :style="themeColor">
<view class="flex benben-position-layout flex flex-wrap align-center agreementPolicy_flex_0"
:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub agreementPolicy_fd0_0'>
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
<text class='fu-iconfont2 agreementPolicy_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
data-url="1">&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub'>
<text class='agreementPolicy_fd0_0_c1_c0'>{{title}}</text>
<!-- <text class='agreementPolicy_fd0_0_c1_c0_1' v-if="type=='2'">隐私政策</text> -->
</view>
<view class='flex flex-wrap align-center agreementPolicy_fd0_0_c2'>
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
<view class="ben_fu-jyf-parser_1">
<jyf-parser :html="parser1 | richTextFormat"></jyf-parser>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
"parser1": "",
type: "",
title: ''
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {
let {
type
} = options
if (type !== undefined) this.type = type
switch (this.type - 0){
case 8:
this.title = '用户协议'
break;
case 16:
this.title = '隐私政策'
break;
case 17:
this.title = '到店服务协议'
break;
case 18:
this.title = '商家认证协议'
break;
case 22:
this.title = '积分规则'
break;
case 24:
this.title = '抵用券规则'
break;
case 23:
this.title = '积分规则'
break;
case 25:
this.title = '公司信息'
break;
default:
break;
}
this.getXieyi();
},
onUnload() {
},
onReady() {
},
onShow() {
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
},
onReachBottom(e) {
},
onPageScroll(e) {
},
methods: {
getXieyi(type) {
this.$api.post(global.apiUrls.getXieyi, {aid: this.type}).then(res => {
if (res.data.code == 1) {
let info = res.data.data;
this.parser1 = info.body;
}
})
.catch(err => {
console.log(err);
});
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: #fff;
background-size: 100% auto !important;
}
.agreementPolicy_flex_0 {
background: #fff;
width: 750rpx;
height: 88rpx;
z-index: 10;
top: 0rpx;
background-size: 100% auto !important;
}
.agreementPolicy_fd0_0_c2 {
width: 32rpx;
height: 32rpx;
}
.agreementPolicy_fd0_0_c1_c0_1 {
font-size: 36rpx;
font-weight: 500;
color: #333333;
line-height: 50rpx;
}
.agreementPolicy_fd0_0_c1_c0 {
font-size: 36rpx;
font-weight: 500;
color: #333333;
line-height: 50rpx;
}
.agreementPolicy_fd0_0_c0_c0 {
font-size: 32rpx;
font-weight: 500;
color: #333;
line-height: 88rpx;
}
.agreementPolicy_fd0_0 {
border-bottom: 1px solid rgba(238, 238, 238, 1);
padding: 0rpx 24rpx 0rpx 24rpx;
}
.ben_fu-jyf-parser_1 {
background-color: #fff;
padding-left: 32rpx;
padding-right: 32rpx;
padding-top: 32rpx;
padding-bottom: 32rpx;
}
</style>

View File

@ -0,0 +1,420 @@
<template>
<view class="page">
<!-- background pic end -->
<!-- 表单信息 start -->
<view class="bind-phone form-wapper ">
<!-- 手机号码 start -->
<view class="input-wapper solid-bottom">
<!-- <view class="title">
<image class="image" src="../../static/phone.png" mode="widthFix"></image>
</view> -->
<input type="number" v-model="phone" maxlength="11" placeholder-class="placeholderClass" placeholder="请输入手机号"
name="input" />
</view>
<!-- 手机号码 end -->
<!-- 获取验证码 start -->
<view class="input-wapper solid-bottom ">
<!-- <view class="title">
<image class="image" src="../../static/yzm.png" mode="widthFix"></image>
</view> -->
<input type="number" v-model="vercode" placeholder-class="placeholderClass" placeholder="请输入验证码" name="input" />
<text class="code" @click="getCode">{{ beginning ? time + 's后重新获取' : '发送验证码' }}</text>
</view>
<!-- 获取验证码 end -->
<!-- 输入密码 start -->
<view class="input-wapper solid-bottom ">
<!-- <view class="title">
<image class="image" src="../../static/pwd.png" mode="widthFix"></image>
</view> -->
<view class="pwd flex justify-between align-center">
<input placeholder-class="placeholderClass" v-if="type == 'password'" type="password" v-model="password"
:placeholder="'请输入密码(6~12位字母+数字)'" minlength="6" maxlength="12" />
<input placeholder-class="placeholderClass" v-if="type == 'text'" type="text" v-model="password" :placeholder="'请输入密码(6~12位字母+数字)'"
minlength="6" maxlength="12" />
<view class="pwd-right flex align-center">
<text class='fu-iconfont2 text-xxl' :data-type="type" @click.stop="is_kejian" v-if="type == 'password'">&#xE837;</text>
<text class='fu-iconfont2 text-xxl' :data-type="type" @click.stop="is_kejian" v-if="type == 'text'">&#xEBCC;</text>
<!-- <image src="../../static/open.png" :data-type="type" @click.stop="is_kejian" v-if="type == 'text'" mode="widthFix"></image>
<image src="../../static/close.png" :data-type="type" @click.stop="is_kejian" v-if="type == 'password'" mode="widthFix"></image> -->
</view>
</view>
</view>
<!-- 输入密码 end -->
</view>
<!-- 表单信息 end -->
<!-- 提交按钮 start -->
<view class="btn_cloce" :loading="is_click" @click="handleLogin">确定</view>
<!-- 提交按钮 end -->
<!-- 网络监测 start -->
<fu-notwork></fu-notwork>
<!-- 网络监测 end -->
</view>
</template>
<script>
// 表单验证插件
import {
validate
} from '@/common/utils/index.js'
let _this;
export default {
data() {
return {
openid: '', //openid
nickname: '', //昵称
head_img_url: '', //头像图片
sex: '', //性别
phone: '', //手机号
vercode: '', //验证码
password: '', //密码
loginBtnLoading: false, // 登录按钮加载动画
verCodeBtnLoading: false,
time: 60, //倒计时60S
beginning: false, //显示倒计时
is_click: false,
type: 'password', //密码类型
is_agree: false, // 协议
invite_code: '', //邀请码
is_invite_code: 1, //是否显示邀请码,
authType: '',
bind_type: 1
};
},
onLoad(option) {
_this = this;
let params = uni.getStorageSync('Wxinfo_tmp')
this.openid = params.openid;
this.nickname = params.nickName || '';
this.head_img_url = params.avatarUrl || '';
this.sex = params.gender || '';
this.unionId = params.unionid || '';
},
onBackPress() {
uni.hideKeyboard()
},
methods: {
back(){
uni.navigateBack();
},
//密码是否可见
is_kejian(e) {
let type = e.currentTarget.dataset.type;
if (type == 'password') {
this.type = 'text';
} else {
this.type = 'password';
}
},
/**
* @event 点击获取验证码
* @description 获取验证码
* @property {String} is_test - 是否是测试环境
* @property {String} phone - 手机号
* @property {String} type - 请求类型 1=注册(未注册手机号),2=忘记密码(已经注册的手机号),3=短信登录,4修改手几号
*/
// 发送验证码
getCode() {
let { phone } = this;
if (!phone) {
_this.$message.info('请输入手机号');
return false;
}
if (!validate(phone, 'phone')) {
_this.$message.info('请输入正确的手机号');
return false;
}
if (this.beginning) return false;
this.verCodeBtnLoading = true;
this.beginning = true;
console.log(this.authType);
this.$api
.post(global.apiUrls.GetVerifyCode, {
is_test: global.IS_DEV,
mobile: phone,
type: '5',
auth_type: this.authType,
})
.then(res => {
this.verCodeBtnLoading = false;
if (res.data.code == 1) {
clearInterval(_this.timer);
//开始倒计时
_this.timer = setInterval(() => {
if (_this.time == 1) {
//倒计时结束
clearInterval(_this.timer);
_this.time = 60;
_this.beginning = false;
return;
}
_this.time--;
}, 1000);
_this.$message.info('验证码为' + res.data.data.code + '请注意查收');
} else {
clearInterval(_this.timer);
_this.beginning = false;
_this.$message.info(res.data.msg);
}
});
},
/**
* @description 手机绑定
*/
handleLogin() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
if (this.is_click) {
return;
}
let {
phone,
vercode,
password,
openid,
nickname,
head_img_url,
sex,
type,
unionId,
invite_code,
bind_type
} = this;
if (!phone) {
this.$message.info('请输入手机号');
return false;
}
if (!validate(phone, 'phone')) {
this.$message.info('请输入正确的手机号');
return false;
}
if (!vercode) {
this.$message.info('验证码不能为空');
return false;
}
if (!validate(password, 'password')) {
this.$message.info('请输入6-12位密码');
return false;
}
let clientId=''
// #ifdef APP-PLUS
clientId = plus.push.getClientInfo().clientid || '';
// #endif
let inviteCode = uni.getStorageSync('INVITE_CODE') || '';
// if (inviteCode) {
// this.bindDriverCode(inviteCode);
// }
this.is_click = true;
_this.$api
.post(global.apiUrls.postLoginByWechat, {
third_type: 'wx_miniapp',
account_type: 'mobile',
account: phone,
password: password,
code_type: 5,
code: vercode,
client_id: clientId,
invite_code: inviteCode,
extend_info: JSON.stringify({
unionid: unionId,
openid: openid,
nickname: nickname,
avatar: head_img_url,
gender: sex,
})
})
.then(res => {
console.log(res);
if (res.data.code == 1 && res.data.data) {
_this.$store.commit('updateUserInfo', res.data.data.userinfo);
global.token=res.data.data.userinfo.user_token
global.userInfo=res.data.data.userinfo
uni.setStorageSync('USER_INFO', res.data.data.userinfo)
uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
_this.$message.info(res.data.msg);
uni.$emit("loginSuccess", {msg: 'loginSuccess'});
setTimeout(() => {
setTimeout(() => {
uni.reLaunch({
url: '/pages/tabBar/homePage/homePage'
})
}, 500);
// uni.navigateBack({
// delta:2
// });
}, 500);
_this.$message.info(res.data.msg);
} else {
_this.$message.info(res.data.msg);
}
this.is_click = false;
});
}
}
};
</script>
<style lang="scss">
.page {
width: 100%;
background: #F6F6F6;
height: 100vh;
overflow: hidden;
}
.top_title{
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.bind-phone {
// border-top: 1rpx solid #EEEEEE;
}
// background pic start
.bg {
width: 100%;
position: relative;
.back{
position: absolute;
top: 28rpx;
left: 32rpx;
z-index: 99;
}
.bg_img {
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
}
}
.logo-contnt {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.logo {
width: 180rpx;
height: 180rpx;
background-image: url('/static/logo.png');
background-repeat: no-repeat;
background-size: contain;
border-radius: 40rpx;
overflow: hidden;
}
.desc {
width: 100%;
margin-left: -50%;
height: 56rpx;
line-height: 32rpx;
margin-top: 32rpx;
text-align: center;
font-size: 40rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
// background pic end
.form-wapper {
// margin-top: -44rpx;
width: 100%;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
z-index: 999;
background-color: #fff;
.input-wapper {
position: relative;
display: flex;
width: 100%;
align-items: center;
height: 124rpx;
font-size: 32rpx;
.title {
margin: 0 28rpx 0 0rpx;
width: 34rpx;
height: 100%;
position: relative;
.image {
width: 100%;
height: 100%;
position:absolute;
top: 50%;
transform: translateY(-50%);
}
}
// 发送验证码 start
.code {
position: absolute;
text-align: right;
right: 0;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FF7F1E;
}
.pwd {
flex: 1;
align-items: center;
position: relative;
input {
width: 80%;
}
.pwd-right {
width: 34rpx;
height:100%;
position:absolute;
right:0;
top:50%;
transform:translateY(-50%);
image {
width: 100%;
height: 100%;
}
}
}
}
}
.placeholderClass {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #BFBFBF;
}
// 提交按钮 start
.btn_cloce {
margin: 88rpx 32rpx 0;
border-radius: 88rpx;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
color: #FFFFFF;
font-weight: 500;
height: 88rpx;
background: #FF9300;
opacity: 1;
border-radius: 44rpx;
}
// 提交按钮 end
</style>

View File

@ -0,0 +1,437 @@
<template>
<view class="page">
<!-- background pic end -->
<!-- 表单信息 start -->
<view class="bind-phone form-wapper ">
<!-- 手机号码 start -->
<view class="input-wapper solid-bottom">
<!-- <view class="title">
<image class="image" src="../../static/phone.png" mode="widthFix"></image>
</view> -->
<input type="number" v-model="phone" maxlength="11" placeholder-class="placeholderClass"
placeholder="请输入手机号" name="input" />
</view>
<!-- 手机号码 end -->
<!-- 获取验证码 start -->
<view class="input-wapper solid-bottom ">
<!-- <view class="title">
<image class="image" src="../../static/yzm.png" mode="widthFix"></image>
</view> -->
<input type="number" v-model="vercode" placeholder-class="placeholderClass" placeholder="请输入验证码"
name="input" />
<text class="code" @click="getCode">{{ beginning ? time + 's后重新获取' : '发送验证码' }}</text>
</view>
<!-- 获取验证码 end -->
<!-- 输入密码 start -->
<view class="input-wapper solid-bottom ">
<!-- <view class="title">
<image class="image" src="../../static/pwd.png" mode="widthFix"></image>
</view> -->
<view class="pwd flex justify-between align-center">
<input placeholder-class="placeholderClass" v-if="type == 'password'" type="password"
v-model="password" :placeholder="'请输入密码(6~12位字母+数字)'" minlength="6" maxlength="12" />
<input placeholder-class="placeholderClass" v-if="type == 'text'" type="text" v-model="password"
:placeholder="'请输入密码(6~12位字母+数字)'" minlength="6" maxlength="12" />
<view class="pwd-right flex align-center">
<text class='fu-iconfont2 text-xxl' :data-type="type" @click.stop="is_kejian"
v-if="type == 'password'">&#xE837;</text>
<text class='fu-iconfont2 text-xxl' :data-type="type" @click.stop="is_kejian"
v-if="type == 'text'">&#xEBCC;</text>
<!-- <image src="../../static/open.png" :data-type="type" @click.stop="is_kejian" v-if="type == 'text'" mode="widthFix"></image>
<image src="../../static/close.png" :data-type="type" @click.stop="is_kejian" v-if="type == 'password'" mode="widthFix"></image> -->
</view>
</view>
</view>
<!-- 输入密码 end -->
</view>
<!-- 表单信息 end -->
<!-- 提交按钮 start -->
<view class="btn_cloce" :loading="is_click" @click="handleLogin">确定</view>
<!-- 提交按钮 end -->
<!-- 网络监测 start -->
<fu-notwork></fu-notwork>
<!-- 网络监测 end -->
</view>
</template>
<script>
// 表单验证插件
import {
validate
} from '@/common/utils/index.js'
let _this;
export default {
data() {
return {
openid: '', //openid
nickname: '', //昵称
head_img_url: '', //头像图片
sex: '', //性别
phone: '', //手机号
vercode: '', //验证码
password: '', //密码
loginBtnLoading: false, // 登录按钮加载动画
verCodeBtnLoading: false,
time: 60, //倒计时60S
beginning: false, //显示倒计时
is_click: false,
type: 'password', //密码类型
is_agree: false, // 协议
invite_code: '', //邀请码
is_invite_code: 1, //是否显示邀请码,
authType: '',
bind_type: 1
};
},
onLoad(option) {
_this = this;
let params = uni.getStorageSync('Wxinfo_tmp')
this.openid = params.openid;
this.nickname = params.nickName || '';
this.head_img_url = params.avatarUrl || '';
this.sex = params.gender || '';
this.unionId = params.unionid || '';
},
onBackPress() {
uni.hideKeyboard()
},
methods: {
back() {
uni.navigateBack();
},
//密码是否可见
is_kejian(e) {
let type = e.currentTarget.dataset.type;
if (type == 'password') {
this.type = 'text';
} else {
this.type = 'password';
}
},
/**
* @event 点击获取验证码
* @description 获取验证码
* @property {String} is_test - 是否是测试环境
* @property {String} phone - 手机号
* @property {String} type - 请求类型 1=注册(未注册手机号),2=忘记密码(已经注册的手机号),3=短信登录,4修改手几号
*/
// 发送验证码
getCode() {
let {
phone
} = this;
if (!phone) {
_this.$message.info('请输入手机号');
return false;
}
if (!validate(phone, 'phone')) {
_this.$message.info('请输入正确的手机号');
return false;
}
if (this.beginning) return false;
this.verCodeBtnLoading = true;
this.beginning = true;
console.log(this.authType);
this.$api
.post(global.apiUrls.GetVerifyCode, {
is_test: global.IS_DEV,
mobile: phone,
type: '5',
auth_type: this.authType,
})
.then(res => {
this.verCodeBtnLoading = false;
if (res.data.code == 1) {
clearInterval(_this.timer);
//开始倒计时
_this.timer = setInterval(() => {
if (_this.time == 1) {
//倒计时结束
clearInterval(_this.timer);
_this.time = 60;
_this.beginning = false;
return;
}
_this.time--;
}, 1000);
_this.$message.info('验证码为' + res.data.data.code + '请注意查收');
} else {
clearInterval(_this.timer);
_this.beginning = false;
_this.$message.info(res.data.msg);
}
});
},
/**
* @description 手机绑定
*/
handleLogin() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
if (this.is_click) {
return;
}
let {
phone,
vercode,
password,
openid,
nickname,
head_img_url,
sex,
type,
unionId,
invite_code,
bind_type
} = this;
if (!phone) {
this.$message.info('请输入手机号');
return false;
}
if (!validate(phone, 'phone')) {
this.$message.info('请输入正确的手机号');
return false;
}
if (!vercode) {
this.$message.info('验证码不能为空');
return false;
}
if (!validate(password, 'password')) {
this.$message.info('请输入6-12位密码');
return false;
}
let clientId = ''
// #ifdef APP-PLUS
clientId = plus.push.getClientInfo().clientid || '';
// #endif
let inviteCode = uni.getStorageSync('INVITE_CODE') || '';
// if (inviteCode) {
// this.bindDriverCode(inviteCode);
// }
this.is_click = true;
_this.$api
.post(global.apiUrls.postLoginByWechat, {
third_type: 'wx_miniapp',
account_type: 'mobile',
account: phone,
password: password,
code_type: 5,
code: vercode,
client_id: clientId,
invite_code: inviteCode,
extend_info: JSON.stringify({
unionid: unionId,
openid: openid,
nickname: nickname,
avatar: head_img_url,
gender: sex,
})
})
.then(res => {
console.log(res);
if (res.data.code == 1 && res.data.data) {
_this.$store.commit('updateUserInfo', res.data.data.userinfo);
global.token = res.data.data.userinfo.user_token
global.userInfo = res.data.data.userinfo
uni.setStorageSync('USER_INFO', res.data.data.userinfo)
uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
_this.$message.info(res.data.msg);
uni.$emit("loginSuccess", {
msg: 'loginSuccess'
});
setTimeout(() => {
setTimeout(() => {
uni.reLaunch({
url: '/pages/tabBar/homePage/homePage'
})
}, 500);
// uni.navigateBack({
// delta:2
// });
}, 500);
_this.$message.info(res.data.msg);
} else {
_this.$message.info(res.data.msg);
}
this.is_click = false;
});
}
}
};
</script>
<style lang="scss">
.page {
width: 100%;
background: #F6F6F6;
height: 100vh;
overflow: hidden;
}
.top_title {
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.bind-phone {
// border-top: 1rpx solid #EEEEEE;
}
// background pic start
.bg {
width: 100%;
position: relative;
.back {
position: absolute;
top: 28rpx;
left: 32rpx;
z-index: 99;
}
.bg_img {
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
}
}
.logo-contnt {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.logo {
width: 180rpx;
height: 180rpx;
background-image: url('/static/logo.png');
background-repeat: no-repeat;
background-size: contain;
border-radius: 40rpx;
overflow: hidden;
}
.desc {
width: 100%;
margin-left: -50%;
height: 56rpx;
line-height: 32rpx;
margin-top: 32rpx;
text-align: center;
font-size: 40rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
// background pic end
.form-wapper {
// margin-top: -44rpx;
width: 100%;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
z-index: 999;
background-color: #fff;
.input-wapper {
position: relative;
display: flex;
width: 100%;
align-items: center;
height: 124rpx;
font-size: 32rpx;
.title {
margin: 0 28rpx 0 0rpx;
width: 34rpx;
height: 100%;
position: relative;
.image {
width: 100%;
height: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}
// 发送验证码 start
.code {
position: absolute;
text-align: right;
right: 0;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FF7F1E;
}
.pwd {
flex: 1;
align-items: center;
position: relative;
input {
width: 80%;
}
.pwd-right {
width: 34rpx;
height: 100%;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
image {
width: 100%;
height: 100%;
}
}
}
}
}
.placeholderClass {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #BFBFBF;
}
// 提交按钮 start
.btn_cloce {
margin: 88rpx 32rpx 0;
border-radius: 88rpx;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
color: #FFFFFF;
font-weight: 500;
height: 88rpx;
background: #FF9300;
opacity: 1;
border-radius: 44rpx;
}
// 提交按钮 end
</style>

View File

@ -0,0 +1,183 @@
<template>
<view class="page" :style="themeColor">
<view class="flex benben-position-layout flex flex-wrap align-center bindPhone_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub bindPhone_fd0_0' >
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1" >
<text class='fu-iconfont2 bindPhone_fd0_0_c0_c0' >&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub' >
<text class='bindPhone_fd0_0_c1_c0' >绑定手机号</text>
</view>
<view class='flex flex-wrap align-center bindPhone_fd0_0_c2' >
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}" ></view>
<view class="flex flex-direction flex-wrap align-stretch bindPhone_flex_1" >
<view class='flex flex-wrap align-center bindPhone_fd1_0' >
<input class='flex-sub bindPhone_fd1_0_c0' type="number" placeholder="请输入手机号" confirm-type="done" :maxlength="12" placeholder-style="color:rgba(156, 156, 156, 1);font-size:32rpx" v-model="phone" />
</view>
<view class='flex flex-wrap align-center justify-between bindPhone_fd1_1' >
<input class='bindPhone_fd1_1_c0' type="number" placeholder="请输入您的验证码" confirm-type="done" :maxlength="4" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx" v-model="code" />
<benben-send-verification-code class='flex bindPhone_fd1_1_c1' after-text='后重新获取' before-text='发送验证码' type='5' :phone="phone"></benben-send-verification-code>
</view>
<view class='flex flex-wrap align-center bindPhone_fd1_2' >
<benben-flex-password-diy v-model="Passworld" class-name="flex align-center flex bindPhone_fd1_2_c0" :placeholder="'请输入密码(6~12位字母+数字)'" :maxlength="12" :default-type='true' placeholder-style="color:#999;font-size:32rpx" >
<template #show>
<text class='fu-iconfont2 bindPhone_fd1_2_c0_icon1' data-type="show">&#xE837;</text>
</template>
<template #hide>
<text class='fu-iconfont2 bindPhone_fd1_2_c0_icon2' data-type="hide">&#xEBCC;</text>
</template>
</benben-flex-password-diy>
</view>
</view>
<!---flex布局flex布局开始-->
<view class="flex flex-wrap align-center justify-center benben-flex-layout" >
<button class='bindPhone_fd2_0' @tap.stop="bindPhoneFunc()" >提交</button>
</view>
<!---flex布局flex布局结束-->
</view>
</template>
<script>
import {validate} from '@/common/utils/validate.js'
export default {
components:{},
data(){
return {"phone":"","code":"","Passworld":""};
},
computed:{
themeColor() {
return this.$store.getters.themeColor
},
},
watch:{},
onLoad(options){
},
onUnload() {
},
onReady(){
},
onShow(){
},
onHide(){
},
onResize(){
},
onPullDownRefresh(){
},
onReachBottom(e){
},
onPageScroll(e){
},
methods:{
//绑定手机号
bindPhoneFunc(){
if(!validate(this.phone,'require')){
this.$message.info('手机号不能为空');
return false;
}
if(!validate(this.phone,'phone')){
this.$message.info('请输入正确的手机号');
return false;
}
if(!validate(this.code,'require')){
this.$message.info('验证码不能为空');
return false;
}
if(!validate(this.code,'length','4')){
this.$message.info('请输入四位验证码数字');
return false;
}
if(!validate(this.code,'captcha')){
this.$message.info('请输入正确的验证码');
return false;
}
if(!validate(this.Passworld,'require')){
this.$message.info('密码不能为空');
return false;
}
if(!validate(this.Passworld,'password')){
this.$message.info('请输入正确的密码格式');
return false;
}
this.$urouter.switchTab(`/pages/tabBar/homePage/homePage`);
}
}
};
</script>
<style lang="scss" scoped>
.page{
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background:#fff;background-size: 100% auto !important;
}
.bindPhone_flex_0{
border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
}
.bindPhone_fd0_0_c2{
width:32rpx;height:32rpx;
}
.bindPhone_fd0_0_c1_c0{
font-size:36rpx;font-weight:500;color:#333;line-height:88rpx;
}
.bindPhone_fd0_0_c0_c0{
font-size:32rpx;font-weight:500;color:#333;line-height:88rpx;
}
.bindPhone_fd0_0{
margin:0rpx 32rpx 0rpx 32rpx;
}
.bindPhone_flex_1{
background:#fff;font-size:32rpx;background-size:100% auto !important;padding:0rpx 32rpx 0rpx 32rpx;
}
.bindPhone_fd1_2_c0_icon2{
width:88rpx;line-height:88rpx;text-align:center;font-size:40rpx;
}
.bindPhone_fd1_2_c0_icon1{
width:88rpx;line-height:88rpx;text-align:center;font-size:40rpx;
}
::v-deep .bindPhone_fd1_2_c0{
font-size:32rpx;width:686rpx;
}
.bindPhone_fd1_2{
border-bottom:1px solid rgba(238, 238, 238, 1);padding:32rpx 0rpx 32rpx 0rpx;
}
.bindPhone_fd1_1_c1{
line-height:30rpx;text-align:center;font-size:28rpx;color:#FF7F1E;font-weight:400;
}
.bindPhone_fd1_1_c0{
line-height:45rpx;font-size:32rpx;font-weight:400;color:#333;
}
.bindPhone_fd1_1{
border-bottom:1px solid #eee;padding:32rpx 0rpx 32rpx 0rpx;
}
.bindPhone_fd1_0_c0{
line-height:45rpx;font-size:32rpx;font-weight:400;color:#333;
}
.bindPhone_fd1_0{
border-bottom:1px solid #eee;padding:32rpx 0rpx 32rpx 0rpx;
}
.bindPhone_fd2_0{
background:rgba(255, 147, 0, 1);border-radius:44rpx 44rpx 44rpx 44rpx;font-size:32rpx;color:#fff;width:686rpx;height:88rpx;line-height:88rpx;font-weight:500;margin:88rpx 0rpx 0rpx 0rpx;
}
</style>

View File

@ -0,0 +1,411 @@
<template>
<view class="page">
<!-- background pic end -->
<!-- 表单信息 start -->
<view class="bind-phone form-wapper ">
<!-- 手机号码 start -->
<view class="input-wapper solid-bottom">
<!-- <view class="title">
<image class="image" src="../../static/phone.png" mode="widthFix"></image>
</view> -->
<input type="number" v-model="phone" maxlength="11" placeholder-class="placeholderClass" placeholder="请输入手机号"
name="input" />
</view>
<!-- 手机号码 end -->
<!-- 获取验证码 start -->
<view class="input-wapper solid-bottom ">
<!-- <view class="title">
<image class="image" src="../../static/yzm.png" mode="widthFix"></image>
</view> -->
<input type="number" v-model="vercode" placeholder-class="placeholderClass" placeholder="请输入验证码" name="input" />
<text class="code" @click="getCode">{{ beginning ? time + 's后重新获取' : '发送验证码' }}</text>
</view>
<!-- 获取验证码 end -->
<!-- 输入密码 start -->
<view class="input-wapper solid-bottom ">
<!-- <view class="title">
<image class="image" src="../../static/pwd.png" mode="widthFix"></image>
</view> -->
<view class="pwd flex justify-between align-center">
<input placeholder-class="placeholderClass" v-if="type == 'password'" type="password" v-model="password"
:placeholder="'请输入密码(6~12位字母+数字)'" minlength="6" maxlength="12" />
<input placeholder-class="placeholderClass" v-if="type == 'text'" type="text" v-model="password" :placeholder="'请输入密码(6~12位字母+数字)'"
minlength="6" maxlength="12" />
<view class="pwd-right flex align-center">
<text class='fu-iconfont2 text-xxl' :data-type="type" @click.stop="is_kejian" v-if="type == 'password'">&#xE837;</text>
<text class='fu-iconfont2 text-xxl' :data-type="type" @click.stop="is_kejian" v-if="type == 'text'">&#xEBCC;</text>
<!-- <image src="../../static/open.png" :data-type="type" @click.stop="is_kejian" v-if="type == 'text'" mode="widthFix"></image>
<image src="../../static/close.png" :data-type="type" @click.stop="is_kejian" v-if="type == 'password'" mode="widthFix"></image> -->
</view>
</view>
</view>
<!-- 输入密码 end -->
</view>
<!-- 表单信息 end -->
<!-- 提交按钮 start -->
<view class="btn_cloce" :loading="is_click" @click="handleLogin">确定</view>
<!-- 提交按钮 end -->
<!-- 网络监测 start -->
<fu-notwork></fu-notwork>
<!-- 网络监测 end -->
</view>
</template>
<script>
// 表单验证插件
import {
validate
} from '@/common/utils/index.js'
let _this;
export default {
data() {
return {
openid: '', //openid
nickname: '', //昵称
head_img_url: '', //头像图片
sex: '', //性别
phone: '', //手机号
vercode: '', //验证码
password: '', //密码
loginBtnLoading: false, // 登录按钮加载动画
verCodeBtnLoading: false,
time: 60, //倒计时60S
beginning: false, //显示倒计时
is_click: false,
type: 'password', //密码类型
is_agree: false, // 协议
invite_code: '', //邀请码
is_invite_code: 1, //是否显示邀请码,
authType: '',
bind_type: 1
};
},
onLoad(option) {
_this = this;
this.bind_type = option.bind_type
this.openid = option.openId;
this.nickname = option.nickName || '';
this.head_img_url = option.avatarUrl || '';
this.sex = option.sex || '';
this.unionId = option.unionId || '';
this.authType = option.authType || '';
},
onBackPress() {
uni.hideKeyboard()
},
methods: {
back(){
uni.navigateBack();
},
//密码是否可见
is_kejian(e) {
let type = e.currentTarget.dataset.type;
if (type == 'password') {
this.type = 'text';
} else {
this.type = 'password';
}
},
/**
* @event 点击获取验证码
* @description 获取验证码
* @property {String} is_test - 是否是测试环境
* @property {String} phone - 手机号
* @property {String} type - 请求类型 1=注册(未注册手机号),2=忘记密码(已经注册的手机号),3=短信登录,4修改手几号
*/
// 发送验证码
getCode() {
let { phone } = this;
if (!phone) {
_this.$message.info('请输入手机号');
return false;
}
if (!validate(phone, 'phone')) {
_this.$message.info('请输入正确的手机号');
return false;
}
if (this.beginning) return false;
this.verCodeBtnLoading = true;
this.beginning = true;
console.log(this.authType);
this.$api
.post(global.apiUrls.GetVerifyCode, {
is_test: global.IS_DEV,
mobile: phone,
type: '5',
auth_type: this.authType,
})
.then(res => {
this.verCodeBtnLoading = false;
if (res.data.code == 1) {
clearInterval(_this.timer);
//开始倒计时
_this.timer = setInterval(() => {
if (_this.time == 1) {
//倒计时结束
clearInterval(_this.timer);
_this.time = 60;
_this.beginning = false;
return;
}
_this.time--;
}, 1000);
_this.$message.info('验证码为' + res.data.data.code + '请注意查收');
} else {
clearInterval(_this.timer);
_this.beginning = false;
_this.$message.info(res.data.msg);
}
});
},
/**
* @description 手机绑定
*/
handleLogin() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
if (this.is_click) {
return;
}
let {
phone,
vercode,
password,
openid,
nickname,
head_img_url,
sex,
type,
unionId,
invite_code,
bind_type
} = this;
if (!phone) {
this.$message.info('请输入手机号');
return false;
}
if (!validate(phone, 'phone')) {
this.$message.info('请输入正确的手机号');
return false;
}
if (!vercode) {
this.$message.info('验证码不能为空');
return false;
}
if (!validate(password, 'password')) {
this.$message.info('请输入6-12位密码');
return false;
}
let clientId=''
// #ifdef APP-PLUS
clientId = plus.push.getClientInfo().clientid || '';
// #endif
this.is_click = true;
_this.$api
.post(global.apiUrls.postLoginByWechat, {
third_type: 'wx_app',
account_type: 'mobile',
account: phone,
password: password,
code_type: 5,
code: vercode,
client_id: clientId,
invite_code: invite_code,
extend_info: JSON.stringify({
unionid: unionId,
openid: openid,
nickname: nickname,
avatar: head_img_url,
gender: sex,
})
})
.then(res => {
console.log(res);
if (res.data.code == 1 && res.data.data) {
_this.$store.commit('updateUserInfo', res.data.data.userinfo);
global.token=res.data.data.userinfo.user_token
global.userInfo=res.data.data.userinfo
uni.setStorageSync('USER_INFO', res.data.data.userinfo)
uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
_this.$message.info(res.data.msg);
uni.$emit("loginSuccess", {msg: 'loginSuccess'});
setTimeout(() => {
uni.navigateBack({
delta:2
});
}, 500);
_this.$message.info(res.data.msg);
} else {
_this.$message.info(res.data.msg);
}
this.is_click = false;
});
}
}
};
</script>
<style lang="scss">
.page {
width: 100%;
background: #F6F6F6;
height: 100vh;
overflow: hidden;
}
.top_title{
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.bind-phone {
// border-top: 1rpx solid #EEEEEE;
}
// background pic start
.bg {
width: 100%;
position: relative;
.back{
position: absolute;
top: 28rpx;
left: 32rpx;
z-index: 99;
}
.bg_img {
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
}
}
.logo-contnt {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.logo {
width: 180rpx;
height: 180rpx;
background-image: url('/static/logo.png');
background-repeat: no-repeat;
background-size: contain;
border-radius: 40rpx;
overflow: hidden;
}
.desc {
width: 100%;
margin-left: -50%;
height: 56rpx;
line-height: 32rpx;
margin-top: 32rpx;
text-align: center;
font-size: 40rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
// background pic end
.form-wapper {
// margin-top: -44rpx;
width: 100%;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
z-index: 999;
background-color: #fff;
.input-wapper {
position: relative;
display: flex;
width: 100%;
align-items: center;
height: 124rpx;
font-size: 32rpx;
.title {
margin: 0 28rpx 0 0rpx;
width: 34rpx;
height: 100%;
position: relative;
.image {
width: 100%;
height: 100%;
position:absolute;
top: 50%;
transform: translateY(-50%);
}
}
// 发送验证码 start
.code {
position: absolute;
text-align: right;
right: 0;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FF7F1E;
}
.pwd {
flex: 1;
align-items: center;
position: relative;
input {
width: 80%;
}
.pwd-right {
width: 34rpx;
height:100%;
position:absolute;
right:0;
top:50%;
transform:translateY(-50%);
image {
width: 100%;
height: 100%;
}
}
}
}
}
.placeholderClass {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #BFBFBF;
}
// 提交按钮 start
.btn_cloce {
margin: 88rpx 32rpx 0;
border-radius: 88rpx;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
color: #FFFFFF;
font-weight: 500;
height: 88rpx;
background: #FF9300;
opacity: 1;
border-radius: 44rpx;
}
// 提交按钮 end
</style>

View File

@ -0,0 +1,183 @@
<template>
<view class="page" :style="themeColor">
<view class="flex benben-position-layout flex flex-wrap align-center bindPhone_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub bindPhone_fd0_0' >
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1" >
<text class='fu-iconfont2 bindPhone_fd0_0_c0_c0' >&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub' >
<text class='bindPhone_fd0_0_c1_c0' >绑定手机号</text>
</view>
<view class='flex flex-wrap align-center bindPhone_fd0_0_c2' >
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}" ></view>
<view class="flex flex-direction flex-wrap align-stretch bindPhone_flex_1" >
<view class='flex flex-wrap align-center bindPhone_fd1_0' >
<input class='flex-sub bindPhone_fd1_0_c0' type="number" placeholder="请输入手机号" confirm-type="done" :maxlength="12" placeholder-style="color:rgba(156, 156, 156, 1);font-size:32rpx" v-model="phone" />
</view>
<view class='flex flex-wrap align-center justify-between bindPhone_fd1_1' >
<input class='bindPhone_fd1_1_c0' type="number" placeholder="请输入您的验证码" confirm-type="done" :maxlength="4" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx" v-model="code" />
<benben-send-verification-code class='flex bindPhone_fd1_1_c1' after-text='后重新获取' before-text='发送验证码' type='5' :phone="phone"></benben-send-verification-code>
</view>
<view class='flex flex-wrap align-center bindPhone_fd1_2' >
<benben-flex-password-diy v-model="Passworld" class-name="flex align-center flex bindPhone_fd1_2_c0" :placeholder="'请输入密码(6~12位字母+数字)'" :maxlength="12" :default-type='true' placeholder-style="color:#999;font-size:32rpx" >
<template #show>
<text class='fu-iconfont2 bindPhone_fd1_2_c0_icon1' data-type="show">&#xE837;</text>
</template>
<template #hide>
<text class='fu-iconfont2 bindPhone_fd1_2_c0_icon2' data-type="hide">&#xEBCC;</text>
</template>
</benben-flex-password-diy>
</view>
</view>
<!---flex布局flex布局开始-->
<view class="flex flex-wrap align-center justify-center benben-flex-layout" >
<button class='bindPhone_fd2_0' @tap.stop="bindPhoneFunc()" >提交</button>
</view>
<!---flex布局flex布局结束-->
</view>
</template>
<script>
import {validate} from '@/common/utils/validate.js'
export default {
components:{},
data(){
return {"phone":"","code":"","Passworld":""};
},
computed:{
themeColor() {
return this.$store.getters.themeColor
},
},
watch:{},
onLoad(options){
},
onUnload() {
},
onReady(){
},
onShow(){
},
onHide(){
},
onResize(){
},
onPullDownRefresh(){
},
onReachBottom(e){
},
onPageScroll(e){
},
methods:{
//绑定手机号
bindPhoneFunc(){
if(!validate(this.phone,'require')){
this.$message.info('手机号不能为空');
return false;
}
if(!validate(this.phone,'phone')){
this.$message.info('请输入正确的手机号');
return false;
}
if(!validate(this.code,'require')){
this.$message.info('验证码不能为空');
return false;
}
if(!validate(this.code,'length','4')){
this.$message.info('请输入四位验证码数字');
return false;
}
if(!validate(this.code,'captcha')){
this.$message.info('请输入正确的验证码');
return false;
}
if(!validate(this.Passworld,'require')){
this.$message.info('密码不能为空');
return false;
}
if(!validate(this.Passworld,'password')){
this.$message.info('请输入正确的密码格式');
return false;
}
this.$urouter.switchTab(`/pages/tabBar/homePage/homePage`);
}
}
};
</script>
<style lang="scss" scoped>
.page{
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background:#fff;background-size: 100% auto !important;
}
.bindPhone_flex_0{
border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
}
.bindPhone_fd0_0_c2{
width:32rpx;height:32rpx;
}
.bindPhone_fd0_0_c1_c0{
font-size:36rpx;font-weight:500;color:#333;line-height:88rpx;
}
.bindPhone_fd0_0_c0_c0{
font-size:32rpx;font-weight:500;color:#333;line-height:88rpx;
}
.bindPhone_fd0_0{
margin:0rpx 32rpx 0rpx 32rpx;
}
.bindPhone_flex_1{
background:#fff;font-size:32rpx;background-size:100% auto !important;padding:0rpx 32rpx 0rpx 32rpx;
}
.bindPhone_fd1_2_c0_icon2{
width:88rpx;line-height:88rpx;text-align:center;font-size:40rpx;
}
.bindPhone_fd1_2_c0_icon1{
width:88rpx;line-height:88rpx;text-align:center;font-size:40rpx;
}
::v-deep .bindPhone_fd1_2_c0{
font-size:32rpx;width:686rpx;
}
.bindPhone_fd1_2{
border-bottom:1px solid rgba(238, 238, 238, 1);padding:32rpx 0rpx 32rpx 0rpx;
}
.bindPhone_fd1_1_c1{
line-height:30rpx;text-align:center;font-size:28rpx;color:#FF7F1E;font-weight:400;
}
.bindPhone_fd1_1_c0{
line-height:45rpx;font-size:32rpx;font-weight:400;color:#333;
}
.bindPhone_fd1_1{
border-bottom:1px solid #eee;padding:32rpx 0rpx 32rpx 0rpx;
}
.bindPhone_fd1_0_c0{
line-height:45rpx;font-size:32rpx;font-weight:400;color:#333;
}
.bindPhone_fd1_0{
border-bottom:1px solid #eee;padding:32rpx 0rpx 32rpx 0rpx;
}
.bindPhone_fd2_0{
background:rgba(255, 147, 0, 1);border-radius:44rpx 44rpx 44rpx 44rpx;font-size:32rpx;color:#fff;width:686rpx;height:88rpx;line-height:88rpx;font-weight:500;margin:88rpx 0rpx 0rpx 0rpx;
}
</style>

View File

@ -0,0 +1,544 @@
<template>
<view class="page" :style="themeColor">
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout codeLogin_flex_0">
<view class='flex flex-wrap align-center codeLogin_fd0_0'>
<text class='codeLogin_fd0_0_c0'>欢迎来到萬家商超</text>
</view>
<view class='flex flex-direction flex-wrap align-stretch codeLogin_fd0_1'>
<text class='codeLogin_fd0_1_c0'>账号</text>
<view class='flex flex-wrap align-center justify-between'>
<input type="number" placeholder="请输入手机号" confirm-type="done" :maxlength="11"
placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="mobile" />
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch codeLogin_fd0_2'>
<text class='codeLogin_fd0_2_c0'>验证码</text>
<view class='flex flex-wrap align-center justify-between'>
<input type="number" class="flex-sub" placeholder="请输入验证码" confirm-type="done" :maxlength="4"
placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="code" />
<benben-send-verification-code class='flex codeLogin_fd0_2_c1_c1' after-text='后重新获取' before-text='获取验证码'
type='3' :phone="mobile"></benben-send-verification-code>
</view>
</view>
<view class='flex flex-direction-row-reverse flex-wrap align-center codeLogin_fd0_3'>
<text class='codeLogin_fd0_3_c0' @tap.stop="handleJumpDiy" data-type="redirectTo"
:data-url="`/pages/tabBar/passwordLogin/passwordLogin`">密码登录</text>
</view>
<view class='flex flex-wrap align-center codeLogin_fd0_4'>
<button class='flex-sub codeLogin_fd0_4_c0' @tap.stop="codeLoginFunc()">立即登录</button>
</view>
<view class='flex flex-wrap align-center justify-center codeLogin_fd0_5'>
<text class='codeLogin_fd0_5_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/dl/registerLogin/registerLogin`">注册账号</text>
<view class='flex codeLogin_fd0_5_c1'></view>
<text class='codeLogin_fd0_5_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/dl/forgotPassword/forgotPassword`">忘记密码</text>
</view>
</view>
<!---flex布局flex布局结束-->
<view class="flex flex-direction align-center benben-position-layout flex codeLogin_flex_1" v-if="isPublish">
<view class='flex flex-wrap align-center'>
<view class='flex flex-wrap align-center codeLogin_fd1_0_c0'>
</view>
<text class='codeLogin_fd1_0_c1'>快捷登录</text>
<view class='flex flex-wrap align-center codeLogin_fd1_0_c2'>
</view>
</view>
<image class='codeLogin_fd1_1' :src='STATIC_URL+"116.png"' @tap.stop="wxLogin" data-type="navigateTo"
:data-url="`/pages/dl/quickLogin/quickLogin`"></image>
</view>
<view class="text-center text-sm fixed flex align-center justify-center read">
<image v-if="!isRead" :src='STATIC_URL+"123.png"' mode="widthFix" @tap="handleToggle"></image>
<image v-else :src='STATIC_URL+"122.png"' mode="widthFix" @tap="handleToggle"></image>
已阅读并同意
<text class="alink margin-lr-xs" @tap="navto(8)">用户注册协议</text>
<text class="alink margin-lr-xs" @tap="navto(16)">隐私政策</text>
</view>
<view :style="{height: '300rpx'}"></view>
</view>
</template>
<script>
import {
validate
} from '@/common/utils/validate.js'
export default {
components: {},
data() {
return {
"mobile": "",
"code": "",
isRead: false
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {
// #ifdef APP-PLUS
this.getPublishStatus()
// #endif
},
onUnload() {
},
onReady() {
},
onShow() {
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
},
onReachBottom(e) {
},
onPageScroll(e) {
},
methods: {
handleToggle() {
this.isRead = !this.isRead;
},
/**
* @event 微信登陆
*/
wxLogin() {
let _this = this;
// if (!this.is_select_agree) return this.$message.info('请勾选用户协议');
// #ifdef APP-PLUS
// 如果是app环境打开微信
if (
plus.runtime.isApplicationExist({
pname: "com.tencent.mm",
action: "weixin://",
})
) {
uni.getProvider({
service: "oauth",
success: function(res) {
console.log(res);
// 如果支持微信等,就执行 wx_login_fn 方法
if (~res.provider.indexOf("weixin")) {
_this.wx_login_fn();
}
},
fail: function(err) {
// api错误是打印错误
console.log(err);
},
});
} else {
// 调起失败时提醒用户
this.$message.info("请安装微信后再使用此功能");
}
// #endif
},
/**
* @function 微信授权登录
*/
wx_login_fn() {
let _this = this;
/**
* @desc uniapp的登陆api
* @param {String} provider - 登录服务提供商
* @param {login~success} loginRes - 接口调用成功时的回调函数
*/
uni.login({
provider: "weixin",
/**
* @callback login~success
* @param {Object} loginRes - api返回来的信息
*/
success: function(loginRes) {
/**
* @desc 获取用户信息
* @param {String} provider - 登录服务提供商
* @param {Funtion} success - 接口调用成功时的回调函数
*/
uni.getUserInfo({
provider: "weixin",
/**
* @callback success
* @param {Object} infoRes - api返回来的信息
*/
success: function(infoRes) {
// 显示加载状态
uni.showLoading({
title: "加载中...",
});
/**
* @let {String} nickName - 结构出来的变量昵称
* @let {String} avatarUrl - 解构出来的头像链接
* @let {String} gender - 结构出来的性别
*/
let {
nickName,
avatarUrl,
gender
} = infoRes.userInfo;
// #ifdef APP-PLUS
let clientId = plus.push.getClientInfo().clientid || "";
console.log("clientId", clientId);
// @const {Number} appSystem - 判断设备类型 1ios2安卓
let appSystem = uni.getSystemInfoSync().platform == "ios" ? 1 : 2;
// #endif
console.log(infoRes, "app微信登录");
console.log(infoRes.userInfo.unionId, "app微信登录");
/**
* @description 第三方登录请求接口
*/
_this.$api
.post(global.apiUrls.postUserSocialLogin, {
third_type: 'wx_app',
extend_info: JSON.stringify({
unionid: infoRes.userInfo.unionId,
clientId: clientId || "",
appSystem: appSystem || "",
nickname: nickName,
avatar: avatarUrl,
gender: gender,
openid: infoRes.userInfo.openId,
})
})
.then((res) => {
console.log(res)
// 保存用户信息
global.tempUserLoginInfo = infoRes.userInfo;
// 关闭加载效果
uni.hideLoading();
if (res.data.code == 1) {
console.log(1)
if (res.data.data.userinfo && res.data.data.userinfo.user_token) {
_this.$store.commit('updateUserInfo', res.data.data.userinfo);
global.token=res.data.data.userinfo.user_token
global.userInfo=res.data.data.userinfo
uni.setStorageSync('USER_INFO', res.data.data.userinfo)
uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
_this.$message.info(res.data.msg);
uni.$emit("loginSuccess", {msg: 'loginSuccess'});
setTimeout(() => {
uni.navigateBack({
delta:1
});
}, 500);
// _this.$message.info(res.data.msg);
}
if (res.data.data.result && res.data.data.result.openid) {
uni.navigateTo({
url: `/pages/dl/bindPhone/bindPhone?unionId=${infoRes.userInfo.unionId}&openId=${infoRes.userInfo.openId}&sex=${infoRes.userInfo.gender}&nickName=${infoRes.userInfo.nickName}&avatarUrl=${infoRes.userInfo.avatarUrl}&authType=wx_unionid&bind_type=1`
})
}
// _this.$message.info(res.data.msg);
// /**
// * @description 向Vux发送用户信息保存
// * @param {String} updateUserInfo - 调用的方法名称
// * @param {Object} res.data.data.userinfo - 用户信息
// */
// _this.$store.commit(
// "updateUserInfo",
// res.data.data.userinfo
// );
// uni.$emit("loginSuccess", {msg: 'loginSuccess'});
// setTimeout(() => {
// uni.navigateBack();
// }, 800);
} else if (res.data.code == 0) {
/**
* @description 清除当前页面,跳转到绑定手机页面
*/
// _this.$urouter.redirectTo({
// url: _this.PAGE_BASE_URL + "bind-phone/index",
// params: {
// unionId: infoRes.userInfo.unionId,
// openId: infoRes.userInfo.openId,
// sex: infoRes.userInfo.gender,
// nickName: infoRes.userInfo.nickName,
// avatarUrl: infoRes.userInfo.avatarUrl,
// authType: "wx_unionid",
// bind_type: 1
// },
// });
// 点击手机号账号登录按钮
} else if (res.code == -1) {
_this.$message.info(res.data.msg);
return;
}
})
.catch((err) => {
uni.hideLoading();
console.log(err);
});
},
});
},
error: function(err) {
uni.hideLoading();
console.log(err);
},
});
},
Get5d8b062aefc08(userinfo){
let clientId = '565656565656';
let appSystem = 'appSystem';
// #ifdef APP-PLUS
clientId = plus.push.getClientInfo().clientid || '';
console.log('getClientInfo', plus.push.getClientInfo());
appSystem = uni.getSystemInfoSync().platform == 'ios' ? 1 : 2;
// #endif
this.$api.post(global.apiUrls.Get5d8b062aefc08,{
client_id:clientId
}).then(res=>{
if(res.data.code==1){
this.$store.commit("updateUserInfo", userinfo);
global.token=userinfo.user_token
global.userInfo=userinfo
uni.setStorageSync('USER_INFO', userinfo)
uni.setStorageSync('USER_TOKEN', userinfo.user_token)
uni.$emit('loginSuccess')
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
}
})
},
//验证码登录
codeLoginFunc() {
if (!validate(this.mobile, 'require')) {
this.$message.info('手机号不能为空');
return false;
}
if (!validate(this.mobile, 'phone')) {
this.$message.info('请输入正确的手机号');
return false;
}
if (!validate(this.code, 'require')) {
this.$message.info('验证码不能为空');
return false;
}
if (!validate(this.code, 'captcha')) {
this.$message.info('请输入正确的验证码');
return false;
}
if (!this.isRead) {
return this.$message.info('请先阅读并同意《用户协议》和 《隐私政策》');
}
this.$api.post(global.apiUrls.postCodeLogin, {
mobile: this.mobile,
code: this.code,
type: 3
})
.then(res => {
console.log(res.data.data.userinfo);
this.$message.info(res.data.msg)
if(res.data.code == 1){
global.user_token=res.data.data.userinfo.user_token
this.Get5d8b062aefc08(res.data.data.userinfo)
// this.$store.commit("updateUserInfo", res.data.data.userinfo);
// global.token=res.data.data.userinfo.user_token
// global.userInfo=res.data.data.userinfo
// uni.setStorageSync('USER_INFO', res.data.data.userinfo)
// uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
// setTimeout(() => {
// uni.navigateBack({
// delta: 1
// })
// }, 1000)
}
});
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/117.png) no-repeat, rgba(255, 255, 255, 1);
background-size: 100% auto !important;
}
.codeLogin_flex_0 {
padding: 246rpx 75rpx 0rpx 75rpx;
}
.codeLogin_fd0_5_c2 {
color: #999999;
font-size: 28rpx;
font-weight: 400;
line-height: 34rpx;
}
.codeLogin_fd0_5_c1 {
background: rgba(153, 153, 153, 1);
width: 1rpx;
height: 24rpx;
margin: 0rpx 20rpx 0rpx 20rpx;
transform: scaleX(0.5);
}
.codeLogin_fd0_5_c0 {
color: #999999;
font-size: 28rpx;
font-weight: 400;
line-height: 34rpx;
}
.codeLogin_fd0_5 {
margin: 40rpx 0rpx 0rpx 0rpx;
}
.codeLogin_fd0_4_c0 {
background: rgba(255, 147, 0, 1);
border-radius: 44rpx 44rpx 44rpx 44rpx;
font-size: 32rpx;
color: #fff;
height: 80rpx;
line-height: 80rpx;
}
.codeLogin_fd0_4 {
padding: 48rpx 0rpx 0rpx 0rpx;
}
.codeLogin_fd0_3_c0 {
color: #333333;
font-size: 28rpx;
font-weight: 400;
line-height: 38rpx;
}
.codeLogin_fd0_3 {
margin: 32rpx 0rpx 0rpx 0rpx;
}
.codeLogin_fd0_2_c1_c1 {
line-height: 32rpx;
text-align: center;
font-size: 28rpx;
color: #FF7F1E;
font-weight: 400;
}
.codeLogin_fd0_2_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.codeLogin_fd0_2 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.codeLogin_fd0_1_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.codeLogin_fd0_1 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.codeLogin_fd0_0_c0 {
color: #333333;
font-size: 50rpx;
font-weight: 600;
line-height: 50rpx;
}
.codeLogin_fd0_0 {
margin: 0rpx 0rpx 24rpx 0rpx;
}
.codeLogin_flex_1 {
background: #fff;
width: 750rpx;
height: 300rpx;
overflow: hidden;
z-index: 10;
bottom: calc(0rpx + var(--window-bottom));
background-size: 100% auto !important;
}
.codeLogin_fd1_1 {
width: 80rpx;
height: 80rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 40rpx 0rpx 0rpx 0rpx;
}
.codeLogin_fd1_0_c2 {
background: rgba(238, 238, 238, 1);
background-size: 100% auto !important;
height: 1rpx;
width: 157rpx;
}
.codeLogin_fd1_0_c1 {
line-height: 32rpx;
font-size: 26rpx;
font-weight: 400;
color: #999999;
padding: 0rpx 7rpx 0rpx 7rpx;
}
.codeLogin_fd1_0_c0 {
background: rgba(238, 238, 238, 1);
background-size: 100% auto !important;
height: 1rpx;
width: 157rpx;
}
.fixed {
width: 100%;
text-align: center;
position: fixed;
bottom: 56rpx;
color: #666;
image {
margin-right: 12rpx;
width: 28rpx;
height: 28rpx;
}
}
.read {
bottom: 40rpx;
z-index: 100;
}
.alink {
color: #59A6F4;
}
</style>

View File

@ -0,0 +1,309 @@
<template>
<view class="page" :style="themeColor">
<view class="flex benben-position-layout flex flex-wrap align-center forgotPassword_flex_0"
:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub forgotPassword_fd0_0'>
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
<text class='fu-iconfont2 forgotPassword_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
data-url="1">&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub'>
<text class='forgotPassword_fd0_0_c1_c0'>忘记密码</text>
</view>
<view class='flex flex-wrap align-center forgotPassword_fd0_0_c2'>
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout forgotPassword_flex_1">
<view class='flex flex-wrap align-center forgotPassword_fd1_0'>
<text class='forgotPassword_fd1_0_c0'>欢迎来到萬家商超</text>
</view>
<view class='flex flex-direction flex-wrap align-stretch forgotPassword_fd1_1'>
<text class='forgotPassword_fd1_1_c0'>账号</text>
<view class='flex flex-wrap align-center justify-between'>
<input type="number" placeholder="请输入手机号" confirm-type="done" :maxlength="11"
placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="mobile" />
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch forgotPassword_fd1_2'>
<text class='forgotPassword_fd1_2_c0'>验证码</text>
<view class='flex flex-wrap align-center justify-between'>
<input type="number" class="flex-sub" placeholder="请输入验证码" confirm-type="done" :maxlength="4"
placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="code" />
<benben-send-verification-code class='flex forgotPassword_fd1_2_c1_c1' after-text='后重新获取' before-text='获取验证码'
type='2' :phone="mobile"></benben-send-verification-code>
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch forgotPassword_fd1_3'>
<text class='forgotPassword_fd1_3_c0'>密码</text>
<view class='flex flex-wrap align-center justify-between'>
<benben-flex-password-diy v-model="password" class-name="flex flex align-center forgotPassword_fd1_3_c1_c0"
:placeholder="'请输入密码(6~12位字母+数字)'" :maxlength="12" :default-type='true'
placeholder-style="color:#999;font-size:32rpx">
<template #show>
<text class='fu-iconfont2 forgotPassword_fd1_3_c1_c0_icon1' data-type="show">&#xE837;</text>
</template>
<template #hide>
<text class='fu-iconfont2 forgotPassword_fd1_3_c1_c0_icon2' data-type="hide">&#xEBCC;</text>
</template>
</benben-flex-password-diy>
</view>
</view>
<view class='flex flex-wrap align-center forgotPassword_fd1_4'>
<button class='flex-sub forgotPassword_fd1_4_c0' @tap.stop="logetLoginFunc()">确定</button>
</view>
</view>
<!---flex布局flex布局结束-->
</view>
</template>
<script>
import {
validate
} from '@/common/utils/validate.js'
export default {
components: {},
data() {
return {
"mobile": "",
"code": "",
"password": ""
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {
},
onUnload() {
},
onReady() {
},
onShow() {
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
},
onReachBottom(e) {
},
onPageScroll(e) {
},
methods: {
//忘记密码
logetLoginFunc() {
if (!validate(this.mobile, 'require')) {
this.$message.info('手机号不能为空');
return false;
}
if (!validate(this.mobile, 'phone')) {
this.$message.info('请输入正确的手机号');
return false;
}
if (!validate(this.code, 'require')) {
this.$message.info('验证码不能为空');
return false;
}
if (!validate(this.code, 'captcha')) {
this.$message.info('请输入正确的验证码');
return false;
}
if (!validate(this.password, 'require')) {
this.$message.info('密码不能为空');
return false;
}
if (!validate(this.password, 'password')) {
this.$message.info('请输入6~12位字母+数字的密码');
return false;
}
this.$api.post(global.apiUrls.postForgotPass, {
account: this.mobile,
password: this.password,
code:this.code,
type: 2
})
.then(res => {
console.log(res.data.data.userinfo);
this.$message.info(res.data.msg)
if(res.data.code == 1){
// this.$store.commit("updateUserInfo", res.data.data.userinfo);
// global.token=res.data.data.userinfo.user_token
// global.userInfo=res.data.data.userinfo
// uni.setStorageSync('USER_INFO', res.data.data.userinfo)
// uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
// uni.reLaunch({
// url:'/pages/tabBar/guide/index'
// })
}
});
this.$urouter.switchTab(`/pages/tabBar/passwordLogin/passwordLogin`);
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/117.png) no-repeat, rgba(255, 255, 255, 1);
background-size: 100% auto !important;
}
.forgotPassword_flex_0 {
background: transparent;
width: 750rpx;
height: 88rpx;
overflow: hidden;
z-index: 10;
top: 0rpx;
background-size: 100% auto !important;
}
.forgotPassword_fd0_0_c2 {
width: 32rpx;
height: 32rpx;
}
.forgotPassword_fd0_0_c1_c0 {
color: #333333;
font-size: 36rpx;
font-weight: 500;
line-height: 36rpx;
}
.forgotPassword_fd0_0_c0_c0 {
font-size: 32rpx;
font-weight: 500;
color: #333;
line-height: 88rpx;
}
.forgotPassword_fd0_0 {
margin: 0rpx 32rpx 0rpx 32rpx;
}
.forgotPassword_flex_1 {
padding: 88rpx 75rpx 0rpx 75rpx;
}
.forgotPassword_fd1_4_c0 {
background: rgba(255, 147, 0, 1);
border-radius: 44rpx 44rpx 44rpx 44rpx;
font-size: 32rpx;
color: #fff;
height: 80rpx;
line-height: 80rpx;
}
.forgotPassword_fd1_4 {
padding: 88rpx 0rpx 0rpx 0rpx;
}
.forgotPassword_fd1_3_c1_c0_icon2 {
width: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 40rpx;
}
.forgotPassword_fd1_3_c1_c0_icon1 {
width: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 40rpx;
}
::v-deep .forgotPassword_fd1_3_c1_c0 {
width: 600rpx;
font-size: 32rpx;
height: 50rpx;
}
.forgotPassword_fd1_3_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.forgotPassword_fd1_3 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.forgotPassword_fd1_2_c1_c1 {
min-width: 120rpx;
line-height: 32rpx;
text-align: center;
font-size: 24rpx;
color: #FF7F1E;
font-weight: 400;
}
.forgotPassword_fd1_2_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.forgotPassword_fd1_2 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.forgotPassword_fd1_1_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.forgotPassword_fd1_1 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.forgotPassword_fd1_0_c0 {
color: #333333;
font-size: 50rpx;
font-weight: 600;
line-height: 50rpx;
}
.forgotPassword_fd1_0 {
margin: 0rpx 0rpx 24rpx 0rpx;
}
</style>

View File

@ -0,0 +1,133 @@
<template>
<view class="page" :style="themeColor">
<!---flex布局flex布局开始-->
<view class="flex flex-direction align-stretch benben-flex-layout quickLogin_flex_0" >
<text class='quickLogin_fd0_0' >您的微信头像昵称地区和性别信息</text>
<text class='quickLogin_fd0_1' >您可选择使用不同的个人信息登录</text>
<view class='flex align-center quickLogin_fd0_2' >
<!-- <image class='quickLogin_fd0_2_c0' mode="aspectFit" :src='STATIC_URL+"118.png"'></image> -->
<view class='flex flex-direction align-stretch flex-sub' >
<text class='quickLogin_fd0_2_c1_c0' >冰凉小手</text>
<text class='quickLogin_fd0_2_c1_c1' >微信个人信息</text>
</view>
<image class='quickLogin_fd0_2_c2' mode="aspectFit" :src='STATIC_URL+"119.png"'></image>
</view>
<view class='flex align-center quickLogin_fd0_3' >
<image class='quickLogin_fd0_3_c0' mode="aspectFit" :src='STATIC_URL+"120.png"'></image>
<view class='flex flex-direction align-stretch flex-sub' >
<text class='quickLogin_fd0_3_c1_c0' >新建头像昵称</text>
</view>
<image class='quickLogin_fd0_3_c2' mode="aspectFit" :src='STATIC_URL+"121.png"'></image>
</view>
<view class='flex flex-direction align-center quickLogin_fd0_4' >
<button class='quickLogin_fd0_4_c0' @tap.stop="handleJumpDiy" data-type="redirectTo" :data-url="`/pages/dl/bindPhone/bindPhone`" >同意</button>
<button class='quickLogin_fd0_4_c1' @tap.stop="handleJumpDiy" data-type="back" data-url="1" >拒绝</button>
</view>
</view>
<!---flex布局flex布局结束-->
</view>
</template>
<script>
export default {
components:{},
data(){
return {};
},
computed:{
themeColor() {
return this.$store.getters.themeColor
},
},
watch:{},
onLoad(options){
},
onUnload() {
},
onReady(){
},
onShow(){
},
onHide(){
},
onResize(){
},
onPullDownRefresh(){
},
onReachBottom(e){
},
onPageScroll(e){
},
methods:{
}
};
</script>
<style lang="scss" scoped>
.page{
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background:#fff;background-size: 100% auto !important;
}
.quickLogin_flex_0{
padding:80rpx 32rpx 0rpx 32rpx;
}
.quickLogin_fd0_4_c1{
background:rgba(246, 247, 249, 1);border-radius:16rpx 16rpx 16rpx 16rpx;font-size:32rpx;color:rgba(24, 190, 62, 1);width:344rpx;height:94rpx;line-height:94rpx;font-weight:400;margin:40rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_4_c0{
background:rgba(24, 190, 62, 1);border-radius:25rpx 25rpx 25rpx 25rpx;font-size:32rpx;color:#fff;width:344rpx;height:94rpx;line-height:94rpx;font-weight:400;
}
.quickLogin_fd0_4{
margin:140rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_3_c2{
width:10rpx;height:20rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_3_c1_c0{
line-height:45rpx;font-size:32rpx;font-weight:700;color:#333333;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
}
.quickLogin_fd0_3_c0{
width:88rpx;height:88rpx;border-radius:8rpx 8rpx 8rpx 8rpx;margin:0rpx 30rpx 0rpx 0rpx;
}
.quickLogin_fd0_3{
border-bottom:1px solid #eee;padding:0rpx 0rpx 32rpx 0rpx;margin:32rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_2_c2{
width:26rpx;height:22rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_2_c1_c1{
line-height:33rpx;font-size:24rpx;font-weight:400;color:#333333;margin:10rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_2_c1_c0{
line-height:45rpx;font-size:32rpx;font-weight:700;color:#333333;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
}
.quickLogin_fd0_2_c0{
width:88rpx;height:88rpx;border-radius:8rpx 8rpx 8rpx 8rpx;margin:0rpx 30rpx 0rpx 0rpx;
}
.quickLogin_fd0_2{
border-bottom:1px solid #eee;padding:0rpx 0rpx 32rpx 0rpx;margin:32rpx 0rpx 0rpx 0rpx;
}
.quickLogin_fd0_1{
border-bottom:1px solid #eee;line-height:42rpx;font-size:30rpx;font-weight:400;color:#333333;padding:0rpx 0rpx 32rpx 0rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
}
.quickLogin_fd0_0{
line-height:50rpx;font-size:36rpx;font-weight:700;color:#333333;margin:44rpx 0rpx 66rpx 0rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
}
</style>

View File

@ -0,0 +1,407 @@
<template>
<view class="page" :style="themeColor">
<view class="flex benben-position-layout flex flex-wrap align-center registerLogin_flex_0"
:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub registerLogin_fd0_0'>
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
<text class='fu-iconfont2 registerLogin_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
data-url="1">&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub'>
</view>
<view class='flex flex-wrap align-center registerLogin_fd0_0_c2'>
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout registerLogin_flex_1">
<view class='flex flex-wrap align-center registerLogin_fd1_0'>
<text class='registerLogin_fd1_0_c0'>欢迎来到萬家商超</text>
</view>
<view class='flex flex-direction flex-wrap align-stretch registerLogin_fd1_1'>
<text class='registerLogin_fd1_1_c0'>账号</text>
<view class='flex flex-wrap align-center justify-between'>
<input type="number" placeholder="请输入手机号" confirm-type="done" :maxlength="11"
placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="mobile" />
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch registerLogin_fd1_2'>
<text class='registerLogin_fd1_2_c0'>验证码</text>
<view class='flex flex-wrap align-center justify-between'>
<input type="number" class="flex-sub" placeholder="请输入验证码" confirm-type="done" :maxlength="4"
placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="code" />
<benben-send-verification-code class='flex registerLogin_fd1_2_c1_c1' after-text='后重新获取'
before-text='获取验证码' type='1' :phone="mobile"></benben-send-verification-code>
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch registerLogin_fd1_3'>
<text class='registerLogin_fd1_3_c0'>密码</text>
<view class='flex flex-wrap align-center justify-between'>
<benben-flex-password-diy v-model="password"
class-name="flex flex align-center registerLogin_fd1_3_c1_c0" :placeholder="'请输入密码(6~12位字母+数字)'"
:maxlength="12" :default-type='true' placeholder-style="color:#999;font-size:32rpx">
<template #show>
<text class='fu-iconfont2 registerLogin_fd1_3_c1_c0_icon1' data-type="show">&#xE837;</text>
</template>
<template #hide>
<text class='fu-iconfont2 registerLogin_fd1_3_c1_c0_icon2' data-type="hide">&#xEBCC;</text>
</template>
</benben-flex-password-diy>
</view>
</view>
<view class='flex flex-wrap align-center registerLogin_fd1_4'>
<button class='flex-sub registerLogin_fd1_4_c0' @tap.stop="registeAccountFunc()">注册</button>
</view>
<view class='flex flex-wrap align-center justify-center registerLogin_fd1_5'>
<benben-flex-switch-new class-name='flex flex registerLogin_fd1_5_c0' v-model="is_tick"
:disabled='false' :auto='true'>
<template v-slot:checked>
<view class='flex flex position-relative align-center'>
<image class='registerLogin_checkfd1_5_c0_c0_c0' mode="aspectFit"
:src='STATIC_URL+"122.png"'></image>
</view>
</template>
<template v-slot:unchecked>
<view class='flex flex position-relative justify-end align-center'>
<image class='registerLogin_noCheckfd1_5_c0_c1_c0' mode="aspectFit"
:src='STATIC_URL+"123.png"'></image>
</view>
</template>
</benben-flex-switch-new>
<text class='registerLogin_fd1_5_c1'>已阅读并同意</text>
<text class='registerLogin_fd1_5_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/dl/agreementPolicy/agreementPolicy?type=8`">用户注册协议</text>
<text class='registerLogin_fd1_5_c3'></text>
<text class='registerLogin_fd1_5_c4' @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/dl/agreementPolicy/agreementPolicy?type=16`">隐私政策</text>
</view>
</view>
<!---flex布局flex布局结束-->
</view>
</template>
<script>
import {
validate
} from '@/common/utils/validate.js'
export default {
components: {},
data() {
return {
"mobile": "",
"code": "",
"password": "",
"is_tick": false
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {},
onUnload() {
},
onReady() {
},
onShow() {
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
},
onReachBottom(e) {
},
onPageScroll(e) {
},
methods: {
Get5d8b062aefc08(userinfo) {
let clientId = '565656565656';
let appSystem = 'appSystem';
// #ifdef APP-PLUS
clientId = plus.push.getClientInfo().clientid || '';
console.log('getClientInfo', plus.push.getClientInfo());
appSystem = uni.getSystemInfoSync().platform == 'ios' ? 1 : 2;
// #endif
this.$api.post(global.apiUrls.Get5d8b062aefc08, {
client_id: clientId
}).then(res => {
if (res.data.code == 1) {
this.$store.commit("updateUserInfo", userinfo);
global.token = userinfo.user_token
global.userInfo = userinfo
uni.setStorageSync('USER_INFO', userinfo)
uni.setStorageSync('USER_TOKEN', userinfo.user_token)
uni.$emit('loginSuccess')
setTimeout(() => {
uni.navigateBack({
delta: 2
})
}, 1000)
}
})
},
//注册账号
registeAccountFunc() {
if (this.is_tick === false) {
this.$message.info('请先阅读并同意《用户注册协议》与《隐私政策》');
return false;
}
if (!validate(this.mobile, 'require')) {
this.$message.info('手机号不能为空');
return false;
}
if (!validate(this.mobile, 'phone')) {
this.$message.info('请输入正确的手机号');
return false;
}
if (!validate(this.code, 'require')) {
this.$message.info('验证码不能为空');
return false;
}
if (!validate(this.code, 'captcha')) {
this.$message.info('请输入正确的验证码');
return false;
}
if (!validate(this.password, 'require')) {
this.$message.info('密码不能为空');
return false;
}
if (!validate(this.password, 'password')) {
this.$message.info('请输入6~12位字母+数字的密码');
return false;
}
this.$api.post(global.apiUrls.postRegister, {
mobile: this.mobile,
password: this.password,
code: this.code,
type: 1
})
.then(res => {
console.log('res', res);
console.log(res.data.data.userinfo);
this.$message.info(res.data.msg)
if (res.data.code == 1) {
global.user_token = res.data.data.userinfo.user_token
this.Get5d8b062aefc08(res.data.data.userinfo)
return
this.$store.commit("updateUserInfo", res.data.data.userinfo);
global.token = res.data.data.userinfo.user_token
global.userInfo = res.data.data.userinfo
uni.setStorageSync('USER_INFO', res.data.data.userinfo)
uni.setStorageSync('USER_TOKEN', res.data.data.userinfo.user_token)
setTimeout(() => {
uni.navigateBack({
delta: 2
})
}, 1000)
// uni.reLaunch({
// url:'/pages/tabBar/guide/index'
// })
}
});
// this.$urouter.navigateTo(`/pages/tabBar/passwordLogin/passwordLogin`);
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/117.png) no-repeat, rgba(255, 255, 255, 1);
background-size: 100% auto !important;
}
.registerLogin_flex_0 {
width: 750rpx;
height: 88rpx;
overflow: hidden;
z-index: 10;
top: 0rpx;
}
.registerLogin_fd0_0_c2 {
width: 32rpx;
height: 32rpx;
}
.registerLogin_fd0_0_c0_c0 {
font-size: 32rpx;
font-weight: 500;
color: #333;
line-height: 88rpx;
}
.registerLogin_fd0_0 {
margin: 0rpx 32rpx 0rpx 32rpx;
}
.registerLogin_flex_1 {
padding: 88rpx 75rpx 0rpx 75rpx;
}
.registerLogin_fd1_5_c4 {
color: #59A6F4;
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
}
.registerLogin_fd1_5_c3 {
color: rgba(102, 102, 102, 1);
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
}
.registerLogin_fd1_5_c2 {
color: #59A6F4;
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
}
.registerLogin_fd1_5_c1 {
color: rgba(102, 102, 102, 1);
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
}
.registerLogin_noCheckfd1_5_c0_c1_c0 {
border-radius: 24rpx 24rpx 24rpx 24rpx;
width: 24rpx;
height: 24rpx;
}
.registerLogin_checkfd1_5_c0_c0_c0 {
width: 24rpx;
height: 24rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
::v-deep .registerLogin_fd1_5_c0 {
margin: 0rpx 8rpx 0rpx 0rpx;
}
.registerLogin_fd1_5 {
padding: 32rpx 0rpx 0rpx 0rpx;
}
.registerLogin_fd1_4_c0 {
background: rgba(255, 147, 0, 1);
border-radius: 44rpx 44rpx 44rpx 44rpx;
font-size: 32rpx;
color: #fff;
height: 80rpx;
line-height: 80rpx;
}
.registerLogin_fd1_4 {
padding: 88rpx 0rpx 0rpx 0rpx;
}
.registerLogin_fd1_3_c1_c0_icon2 {
width: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 40rpx;
}
.registerLogin_fd1_3_c1_c0_icon1 {
width: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 40rpx;
}
::v-deep .registerLogin_fd1_3_c1_c0 {
width: 600rpx;
font-size: 32rpx;
height: 50rpx;
}
.registerLogin_fd1_3_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.registerLogin_fd1_3 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.registerLogin_fd1_2_c1_c1 {
min-width: 120rpx;
line-height: 32rpx;
text-align: center;
font-size: 24rpx;
color: #FF7F1E;
font-weight: 400;
}
.registerLogin_fd1_2_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.registerLogin_fd1_2 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.registerLogin_fd1_1_c0 {
margin: 0rpx 0rpx 24rpx 0rpx;
color: #333333;
font-size: 30rpx;
font-weight: 600;
line-height: 32rpx;
}
.registerLogin_fd1_1 {
border-bottom: 1px solid #eee;
padding: 40rpx 0rpx 20rpx 0rpx;
}
.registerLogin_fd1_0_c0 {
color: #333333;
font-size: 50rpx;
font-weight: 600;
line-height: 50rpx;
}
.registerLogin_fd1_0 {
margin: 0rpx 0rpx 24rpx 0rpx;
}
</style>