当前位置:网站首页>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 ~
边栏推荐
- Apprendre à concevoir des entités logicielles réutilisables à partir de la classe, de l'API et du cadre
- T430 toss and install OS majave 10.14
- 225. Implement stack with queue
- (construction notes) learning experience of MIT reading
- Introduction to concurrent programming (II)
- [download attached] password acquisition tool lazagne installation and use
- 2.7 overview of livedata knowledge points
- wpa_ cli
- 强大的头像制作神器微信小程序
- 257. All paths of binary tree
猜你喜欢

Idea packages the web project into a war package and deploys it to the server to run

LeetCode 0556.下一个更大元素 III - 4步讲完

2021 autumn Information Security Experiment 1 (password and hiding technology)

Fluent: Engine Architecture

云计算未来 — 云原生

idea将web项目打包成war包并部署到服务器上运行

Shutter: overview of shutter architecture (excerpt)

强大的头像制作神器微信小程序

Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!

Sword finger offer05 Replace spaces
随机推荐
How to deploy web pages to Alibaba cloud
RedHat5 安装Socket5代理服务器
Jsup crawls Baidu Encyclopedia
ImportError: No module named examples. tutorials. mnist
232. Implement queue with stack
elastic_ L02_ install
Swift return type is a function of function
网上炒股开户安不安全?谁给回答一下
Is it safe to open an account for online stock speculation? Who can answer
MySQL time zone solution
剑指Offer10- I. 斐波那契数列
111. Minimum depth of binary tree
最新版盲盒商城thinkphp+uniapp
Adult adult adult
What is more elegant for flutter to log out and confirm again?
Summary of development issues
启用MemCached的SASL认证
Idea packages the web project into a war package and deploys it to the server to run
(construction notes) grasp learning experience
Shutter: overview of shutter architecture (excerpt)