当前位置:网站首页>The latest version of blind box mall thinkphp+uniapp
The latest version of blind box mall thinkphp+uniapp
2022-07-03 12:36:00 【Programmer - Nan】
Recently, he came out of the popular blind box mall
Backstage use thinkphp+mysql
The front end uses uniapp Development
Perfect connection with wechat official account
Fit to learn 、 Second opening
The function point :
With the function of promoting QR code 、 Including recharge 3 Level distribution function 、 The blind box is recycled into surplus / Forehead function 、 Slide Show 、 Connect with wechat Alipay 、 SMS is very versatile
All open source to everyone
If you don't say much, look at the renderings :
backstage :
<template>
<view class="register">
<view class="register_head">
<text>{
{
isPassword ? ' Password to login ' : ' Mobile quick login ' }}</text>
<text>{
{
isPassword ? ' If you forget your password, you can log in with your registered mobile phone ' : ' Unregistered mobile numbers will automatically create accounts ' }}</text>
</view>
<view class="register_ul">
<view class="register_li flex">
<view class="register_ipt">
<input type="number" maxlength="11" v-model="from.mobile" placeholder=" Please enter your mobile number "
placeholder-style="color:#999999" />
</view>
</view>
<view class="register_li flex">
<view class="register_ipt">
<input type="password" maxlength="12" v-model="from.password" placeholder=" Please input a password " v-if="isPassword"
placeholder-style="color:#999999" />
<input type="number" maxlength="6" v-model="from.captcha" placeholder=" Please enter the verification code " v-else
placeholder-style="color:#999999" />
</view>
<view class="code center" v-if="!isPassword" @click="getCode">{
{
codeTxt }}</view>
</view>
</view>
<view class="register_code" @click="isPassword = !isPassword" v-if="isPassword"> Verification code login </view>
<button class="register_btn" hover-class="hover-view" @click="submit"> Sign in </button>
<view class="register_footer center">
<text @click="goPassword">{
{
isPassword ? ' Forget the password ' : ' Password to login ' }}</text>
<text></text>
<text @click="goRegister"> Registered account </text>
</view>
<view class="register_fast center" @click="wxLogin">
<text> Quick login </text>
<image src="/static/image/publice/[email protected]" mode=""></image>
</view>
<view class="register_consent center">
<image
:src="isConsent ? '/static/image/publice/[email protected]' : '/static/image/publice/[email protected]'"
mode="" @click="isConsent = !isConsent"></image>
<text> By logging in, you agree </text>
<text class="blue" @click="goUser">《 User agreement 》</text>
<text> and </text>
<text class="blue" @click="goPrivacy">《 Privacy policy 》</text>
</view>
</view>
</template>
<script>
import $DB from '../../http/debounce.js'
export default {
data() {
return {
isPassword: false, // Whether to login with password
isConsent: false, // Do you agree with
flag: true,
codeTxt: ' Get verification code ',
sending: true,
second: 60,
disabled: false,
from: {
mobile: '', //
captcha: '', //
sharecode: '',
is_channel: ""
}
};
},
methods: {
// Wechat login
wxLogin() {
this.$api.getWechatLoginUrl({
redirect: '/h5/#/pages/login/login?sharecode=' + uni.getStorageSync('sharecode') +
'&is_channel=' + uni.getStorageSync('is_channel')
}).then(res => {
if (res.code === 1) {
location.href = res.data.url
}
})
},
// De privacy agreement
goPrivacy() {
uni.navigateTo({
url: '/pagesA/pages/privacy'
})
},
// Go to user agreement
goUser() {
uni.navigateTo({
url: '/pagesA/pages/user'
})
},
// Sign in
submit: $DB(function() {
if (!this.from.mobile.match(/^(0|86|17951)?1[3456789]\d{
9}$/)) {
uni.showToast({
title: ' Please input the correct mobile number ',
icon: 'none'
});
return
}
if (!this.isPassword) {
if (!this.from.captcha) return uni.showToast({
title: ' Please enter the verification code ',
icon: 'none'
})
}
if (!this.isConsent) return uni.showToast({
title: ' Please read and agree to the user and privacy agreement ',
icon: 'none'
})
if (!this.flag) return
this.flag = false
this.from.is_channel = uni.getStorageSync('is_channel');
if (!this.isPassword) {
this.$api.mobilelogin({
...this.from,
msg: ' Logon '
}).then(res => {
if (res.code === 1) {
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('is_notice', res.data.is_notice)
uni.removeStorageSync('is_channel')
uni.switchTab({
url: '/pages/tabbar/index'
})
} else {
this.flag = true
}
}).then(res => {
console.log(res);
})
} else {
this.$api.login({
...this.from,
msg: ' Logon '
}).then(res => {
if (res.code === 1) {
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('is_notice', res.data.is_notice)
uni.removeStorageSync('is_channel')
uni.switchTab({
url: '/pages/tabbar/index'
})
} else {
this.flag = true
}
}).then(res => {
console.log(res);
})
}
}),
// Verification code login
codeLogin() {
uni.navigateTo({
url: '/pages/login/phoneLogin'
})
},
// Registered account
goRegister() {
uni.navigateTo({
url: '/pages/login/register'
})
},
// Forget the password
goPassword() {
if (this.isPassword) {
uni.navigateTo({
url: '/pages/login/forgetPassword'
})
} else {
this.isPassword = true
}
},
// Get verification code
getCode: $DB(function() {
if (!this.sending) return
if (!this.from.mobile.match(/^(0|86|17951)?1[3456789]\d{
9}$/)) {
uni.showToast({
title: ' Please input the correct mobile number ',
icon: 'none'
});
return
}
this.$api.send({
mobile: this.from.mobile,
msg: ' In sending ',
event: 'login'
}).then(res => {
this.sending = false;
this.disabled = true;
if (res.code === 1) {
this.timeDown();
}
uni.showToast({
title: res.msg,
icon: 'none'
});
});
}),
timeDown() {
let result = setInterval(() => {
--this.second;
this.codeTxt = this.second + 'S'
if (this.second < 0) {
clearInterval(result);
this.sending = true;
this.disabled = false;
this.second = 60;
this.codeTxt = ' Get verification code '
}
}, 1000);
},
},
onLoad() {
if (uni.getStorageSync('sharecode')) {
this.from.sharecode = uni.getStorageSync('sharecode')
}
}
}
</script>
<style>
page {
background: #FFFFFF;
}
</style>
<style lang="scss">
.register {
min-height: 100vh;
padding: 0 42rpx;
position: relative;
.register_head {
display: flex;
flex-direction: column;
padding: 30rpx 0 40rpx 0;
text {
&:first-child {
font-size: 40rpx;
font-weight: bold;
}
&:last-child {
color: #999999;
font-size: 26rpx;
margin-top: 20rpx;
}
}
}
.register_li {
padding: 40rpx 0;
border-bottom: 2rpx solid #DDDDDD;
.register_ipt {
flex: 1;
input {
width: 100%;
font-size: 30rpx;
}
}
.code {
width: 150rpx;
color: #4EABFC;
font-size: 28rpx;
}
}
}
.register_btn {
height: 80rpx;
margin-top: 50rpx;
background: #F6AF32;
border-radius: 40rpx;
}
.register_code {
color: #4EABFC;
font-size: 28rpx;
text-align: right;
margin: 30rpx 0 0rpx 0;
}
.register_footer {
margin: 50rpx 0 125rpx 0;
text {
color: #4EABFC;
font-size: 26rpx;
&:nth-child(2) {
width: 1px;
height: 25rpx;
margin: 0 35rpx;
background: #4EABFC;
}
}
}
.register_fast {
margin-top: 125rpx;
flex-direction: column;
text {
color: #999999;
margin-bottom: 40rpx;
}
image {
width: 72rpx;
height: 72rpx;
}
}
.register_consent {
margin-top: 50px;
/* width: 100%; position: absolute; left: 50%; bottom: 70rpx; transform: translateX(-50%); */
image {
width: 30rpx;
height: 30rpx;
flex-shrink: 0;
margin-right: 10rpx;
}
.blue {
color: #4EABFC;
}
}
</style>
If you need the source code, leave your contact information ~
Thank you for reading , Let's pay attention to our little friends ~
边栏推荐
- 1-2 project technology selection and structure
- [combinatorics] permutation and combination (example of permutation and combination)
- RedHat5 安装Socket5代理服务器
- How to deploy web pages to Alibaba cloud
- 剑指Offer04. 二维数组中的查找【中等】
- 【ManageEngine】IP地址扫描的作用
- [embedded] - Introduction to four memory areas
- Swift return type is a function of function
- 242. Effective letter heteronyms
- 257. All paths of binary tree
猜你喜欢
Togaf certification self-study classic v2.0
Prompt unread messages and quantity before opening chat group
社交社区论坛APP超高颜值UI界面
(construction notes) ADT and OOP
ES6 standard
剑指Offer05. 替换空格
Sword finger offer10- I. Fibonacci sequence
Flutter 退出登录二次确认怎么做才更优雅?
Shutter widget: centerslice attribute
Sword finger offer06 Print linked list from end to end
随机推荐
The solution to change the USB flash disk into a space of only 2m
Apache Mina开发手册
Tensorflow binary installation & Failure
Self made pop-up input box, input text, and click to complete the event.
2020-10_ Development experience set
启用MemCached的SASL认证
Sword finger offer04 Search in two-dimensional array [medium]
Shell: basic learning
temp
Eureka self protection
New features of ES6
【嵌入式】---- 内存四区介绍
2020-09_ Shell Programming Notes
Swift5.7 扩展 some 到泛型参数
01_ Using the concurrent tool class library, is thread safety safe
剑指Offer03. 数组中重复的数字【简单】
The future of cloud computing cloud native
lambda与匿名内部类的区别
Adult adult adult
Pytext training times error: typeerror:__ init__ () got an unexpected keyword argument 'serialized_ options'