Browse Source

更新样式

master
luyisha 2 years ago
parent
commit
06210018a8
  1. 4
      App.vue
  2. 3
      common/js/api.js
  3. 11
      pages.json
  4. 15
      pages/about/bonusSet/bonusList.vue
  5. 2
      pages/about/bonusSet/bonusSet.vue
  6. 6
      pages/goodslist/goodslist.vue
  7. 12
      pages/home/home.vue
  8. 258
      pages/login/login.vue
  9. 13
      pages/scratchCard/scratch.js
  10. 84
      pages/scratchCard/scratchCard.vue
  11. 128
      pages/ucenter/ucenter.vue
  12. BIN
      static/home/circle.png
  13. 3
      uni_modules/uni-id-pages/common/login-page.scss
  14. 122
      uni_modules/uni-id-pages/pages/login/login-withpwd.vue
  15. 117
      uni_modules/uni-id-pages/pages/register/register.vue
  16. 9
      uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue

4
App.vue

@ -2,7 +2,7 @@
import initApp from '@/common/appInit.js'; import initApp from '@/common/appInit.js';
import openApp from '@/common/openApp.js'; import openApp from '@/common/openApp.js';
// #ifdef H5 // #ifdef H5
openApp() //h5app // openApp() //h5app
// #endif // #endif
import checkIsAgree from '@/pages/uni-agree/utils/uni-agree.js'; import checkIsAgree from '@/pages/uni-agree/utils/uni-agree.js';
import uniIdPageInit from '@/uni_modules/uni-id-pages/init.js'; import uniIdPageInit from '@/uni_modules/uni-id-pages/init.js';
@ -20,7 +20,7 @@
this.globalData.$i18n = this.$i18n this.globalData.$i18n = this.$i18n
this.globalData.$t = str => this.$t(str) this.globalData.$t = str => this.$t(str)
initApp(); initApp();
uniIdPageInit() // uniIdPageInit()
// #ifdef APP-PLUS // #ifdef APP-PLUS
//checkIsAgree(); APPvue //checkIsAgree(); APPvue

3
common/js/api.js

@ -107,7 +107,8 @@ let API = {
uni.removeStorageSync('user_token'); uni.removeStorageSync('user_token');
setTimeout(()=>{ setTimeout(()=>{
uni.reLaunch({ uni.reLaunch({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd' url: '/pages/login/login'
// url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
}) })
}, 1000) }, 1000)
} }

11
pages.json

@ -1,5 +1,11 @@
{ {
"pages": [ "pages": [
{
"path": "pages/login/login",
"style": {
"navigationStyle": "custom"
}
},
{ {
"path": "uni_modules/uni-id-pages/pages/login/login-withpwd", "path": "uni_modules/uni-id-pages/pages/login/login-withpwd",
"style": { "style": {
@ -336,6 +342,7 @@
} }
} }
], ],
"subPackages": [{ "subPackages": [{
"root": "uni_modules/uni-feedback", "root": "uni_modules/uni-feedback",
@ -455,8 +462,8 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
// "maxWidth":375, // "maxWidth":375,
"rpxCalcMaxDeviceWidth": 960, "rpxCalcMaxDeviceWidth": 960,
"rpxCalcBaseDeviceWidth": 375 "rpxCalcBaseDeviceWidth": 375,
// "rpxCalcIncludeWidth":0 "rpxCalcIncludeWidth": 750
}, },
"condition": { "condition": {
"list": [ "list": [

15
pages/about/bonusSet/bonusList.vue

@ -35,12 +35,13 @@
}, },
filters: { filters: {
formatAmount(item){ formatAmount(item){
if(item>999999 && item==1000000){ // if(item>999999 && item==1000000){
return '一百万元' // return ''
} // }
if(item.split('.')[1].length>2){ // if(item.split('.')[1].length>2){
return (+item).toFixed(2); // return (+item).toFixed(2);
} // }
return item;
} }
}, },
methods: { methods: {
@ -51,7 +52,7 @@
}, },
getList(){ getList(){
API.request('/adminZoneManage/zoneGoodsList', {zone_id: this.id}, res=>{ API.request('/adminZoneManage/zoneGoodsList', {zone_id: this.id}, res=>{
if(res.data.length<10){ if(res.data && res.data.length<10){
this.noMore = true; this.noMore = true;
} }
if(this.page>1){ if(this.page>1){

2
pages/about/bonusSet/bonusSet.vue

@ -3,7 +3,7 @@
<view class="nav_area"></view> <view class="nav_area"></view>
<view class="setPage"> <view class="setPage">
<view v-for="(item,index) in setList" :key="index" class="set_item"> <view v-for="(item,index) in setList" :key="index" class="set_item">
<view class="icon_new"><image :src="item.image" mode=""></image></view> <view class="icon_new"><image :src="item.image" mode="aspectFill"></image></view>
<view style="flex:1;" class="flex-col"> <view style="flex:1;" class="flex-col">
<view class=""><text>中奖金额</text>{{item.amount_str}}</view> <view class=""><text>中奖金额</text>{{item.amount_str}}</view>
<view class=""><text>中奖率</text>{{item.probability}}%</view> <view class=""><text>中奖率</text>{{item.probability}}%</view>

6
pages/goodslist/goodslist.vue

@ -2,12 +2,12 @@
<view style="padding-top: 10px;"> <view style="padding-top: 10px;">
<view v-for="(item,index) in goodsList" :key="index" class="dis-flex-between-center goods-item"> <view v-for="(item,index) in goodsList" :key="index" class="dis-flex-between-center goods-item">
<view class=""> <view class="">
<image :src="item.cover_image" mode=""></image> <image :src="item.cover_image" mode="aspectFill"></image>
</view> </view>
<view class="goods-info"> <view class="goods-info">
<view class="" style="color: #333;font-size: 16px;">{{item.title}}</view> <view class="" style="color: #333;font-size: 16px;">{{item.title}}</view>
<view class="">面值:{{item.price}}</view> <view class="">面值{{item.price}}</view>
<view class="">{{item.important}}</view> <view class="">最高中奖金额{{item.max_awards_amount}}</view>
</view> </view>
<view class="btn" @click="toUrl(item)">立即刮奖</view> <view class="btn" @click="toUrl(item)">立即刮奖</view>
</view> </view>

12
pages/home/home.vue

@ -265,7 +265,8 @@
toUrl(item){ toUrl(item){
if(item=='login'){ if(item=='login'){
uni.navigateTo({ uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd' url: '/pages/login/login'
// url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
}) })
}else if(item=='notice'){ }else if(item=='notice'){
uni.navigateTo({ uni.navigateTo({
@ -471,8 +472,8 @@
} }
// this.userType='background'; // this.userType='background';
if(this.userType=='background'){ if(this.userType=='background'){
console.log(this.$refs, 'this.$refs----'); // console.log(this.$refs, 'this.$refs----');
console.log(this.$refs.piechart, 'this.$refs.piechart----'); // console.log(this.$refs.piechart, 'this.$refs.piechart----');
} }
}, },
@ -624,7 +625,7 @@
} }
} }
.notice{ .notice{
color: #101010; color: #f00;
font-size: 14px;line-height: 14px;margin-bottom: 30rpx; font-size: 14px;line-height: 14px;margin-bottom: 30rpx;
display: -webkit-box;// display: -webkit-box;//
-webkit-box-orient: vertical;// -webkit-box-orient: vertical;//
@ -632,7 +633,8 @@
overflow: hidden; overflow: hidden;
.notice_t{ .notice_t{
color: #b0b0b0; // color: #b0b0b0;
color: #f00;
} }
} }
.goods_area{ .goods_area{

258
pages/login/login.vue

@ -0,0 +1,258 @@
<!-- 账号密码登录页 -->
<template>
<view class="" style="">
<view class="nav_area"></view>
<view class="logo_area">
<image src="../../static/home/logo.png" mode=""></image>
<!-- <view class="close" @click="backPrev()"></view> -->
<view class="selece_box" v-if="0">
<uni-data-select :clear="false"
v-model="value"
:localdata="range"
@change="changeType"
></uni-data-select>
</view>
</view>
<text class="title-box">欢迎登陆顶呱刮</text>
<view class="content-A">
<uni-forms>
<uni-forms-item name="username">
<uni-easyinput :focus="focusUsername" @blur="focusUsername = false" class="input-box"
:inputBorder="false" v-model="username" placeholder="请输入手机号/账号" />
</uni-forms-item>
<uni-forms-item name="password">
<uni-easyinput :focus="focusPassword" @blur="focusPassword = false" class="input-box" clearable
type="password" :inputBorder="false" v-model="password" placeholder="请输入密码" />
</uni-forms-item>
</uni-forms>
<uni-captcha v-if="needCaptcha" focus ref="captcha" scene="login-by-pwd" v-model="captcha" />
<!-- 带选择框的隐私政策协议组件 -->
<!-- <uni-id-pages-agreements scope="login" ref="agreements"></uni-id-pages-agreements> -->
<button class="uni-btn login-btn" type="primary" @click="pwdLogin">登录</button>
<!-- 忘记密码 -->
<view class="link-box" v-if="this.userType=='user'">
<view v-if="!config.isAdmin">
<!-- <text class="forget" @click="toRetrievePwd">忘记密码</text> -->
<!-- <text class="link">找回密码</text> -->
</view>
<text class="link" @click="toRegister">{{config.isAdmin ? '注册管理员账号': '新注册'}}</text>
<!-- <text class="link" @click="toRegister" v-if="!config.isAdmin">注册账号</text> -->
</view>
</view>
<view v-if="this.userType=='user'"
style="width: 100vw;text-align: center;color: #dcdcdc;font-size: 14px;
line-height: 28px;position: fixed;top: calc(100vh - 100px);left:0px;">
温馨提示<br/>
忘记密码请联系平台
</view>
</view>
</template>
<script>
import mixin from '@/uni_modules/uni-id-pages/common/login-page.mixin.js';
import API from '@/common/js/api.js'
import updateTabBar from '@/common/js/updateTabBar.js'
export default {
mixins: [mixin],
data() {
return {
"password": "",
"username": uni.getStorageSync('accounts')[0] || '',
"captcha": "",
"needCaptcha": false,
"focusUsername": false,
"focusPassword": false,
"logo": "/static/logo.png",
userType: 'user',//user|agent|background
value: 0,
range: [
{ value: 0, text: "用户登录" },
{ value: 1, text: "代理登录" },
{ value: 2, text: "后台登录" },
],
}
},
onLoad(e) {
if(e.phone){
this.username = e.phone;
}
//
// token
if(uni.getStorageSync('user_token')){
let newUrl = '';
switch (uni.getStorageSync('userType')){
case 'user':
newUrl = '/pages/home/home';
break;
case 'agent':
newUrl = '/pages/list/team';
break;
case 'background':
newUrl = '/pages/home/home';
break;
}
uni.switchTab({
url:newUrl
})
}
},
onShow() {
// #ifdef H5
document.onkeydown = event => {
var e = event || window.event;
if (e && e.keyCode == 13) { //13
this.pwdLogin()
}
};
// #endif
},
methods: {
/**
* 密码登录
*/
pwdLogin() {
if (!this.username.length) {
this.focusUsername = true
return uni.showToast({
title: '请输入手机号/账号',
icon: 'none',
duration: 3000
});
}
if (!this.password.length) {
this.focusPassword = true
return uni.showToast({
title: '请输入密码',
icon: 'none',
duration: 3000
});
}
let url = '/passport/mixedLogin', newUrl = '';
let data = {account_number: this.username, password: this.password, captcha: ''};
API.request(url, data, res=>{
uni.showToast({
title: res.msg
})
let accounts = uni.getStorageSync('accounts') || [];
accounts.push(this.username);
accounts = Array.from(new Set(accounts));
uni.setStorageSync('accounts', accounts);
uni.setStorageSync('user_token', res.data.token);
switch (res.data.type){
case 3:
newUrl = '/pages/home/home';
this.userType = 'user';
break;
case 2:
newUrl = '/pages/list/team';
this.userType = 'agent';
break;
case 1:
newUrl = '/pages/home/home';
this.userType = 'background';
break;
}
uni.setStorageSync('userType', this.userType);
setTimeout(()=>{
uni.switchTab({
url:newUrl
})
}, 1500)
}, fail=>{}, false)
},
/* 前往注册 */
toRegister() {
uni.navigateTo({
url: this.config.isAdmin ? '/uni_modules/uni-id-pages/pages/register/register-admin' :
'/uni_modules/uni-id-pages/pages/register/register',
fail(e) {
console.error(e);
}
})
},
}
}
</script>
<style lang="scss" scoped>
.nav_area{
background-color: #fff;
width: 750rpx;
/* #ifdef H5 */
height: 88rpx;
/* #endif */
/* #ifdef APP-PLUS */
height: 108rpx;
/* #endif */
padding-top: var(--status-bar-height);
}
.logo_area{
width: 270px;
height: 50px;
margin: 4px auto;
position: relative;
image{
width: 50px;
height: 47px;
}
}
.title-box{
font-size: 26px;
color: #444;
margin: 0px auto 20px;
display: flex;
width: 270px;
padding: 18px 0;
font-weight: 800;
flex-direction: column;
}
.content-A{
width: 270px;
margin: 0px auto;
}
/deep/ .uni-easyinput__content{
background-color: #fff !important;
border-bottom: 1px solid #ebebeb;
font-size: 16px !important;
}
.uni-easyinput__placeholder-class{
font-size: 16px;
color: #cecece;
}
/deep/ .uni-easyinput__content-input{
padding-left: 0px !important;
// flex: 0.45;
}
/deep/ .content-clear-icon{
// flex: 1;
}
.login-btn{
border-radius: 10px;
}
.forget {
font-size: 14px;
color: #999;
}
.link-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: space-between;
margin-top: 20px;
}
.link {
font-size: 14px;
color: #444;
}
</style>

13
pages/scratchCard/scratch.js

@ -4,8 +4,9 @@ class Scratch {
opts = opts || {} opts = opts || {}
this.page = page this.page = page
this.canvasId = opts.canvasId || 'canvas' this.canvasId = opts.canvasId || 'canvas'
this.width = opts.width || 340 this.width = opts.width || 330
this.height = opts.height || 150 this.height = opts.height || 300
this.screenWidth = opts.screenWidth || 375
// this.maskColor = opts.maskColor || '#D2D2D2' // this.maskColor = opts.maskColor || '#D2D2D2'
// this.maskColor = '#dddddd' // this.maskColor = '#dddddd'
this.maskColor = 'transparent'; this.maskColor = 'transparent';
@ -28,8 +29,12 @@ class Scratch {
} }
drawMask () { drawMask () {
// this.ctx.drawImage(this.bgImg, 65, 865, 951, 720, 0, 0, 330, 250) // 底图是像素1080的宽
this.ctx.drawImage(this.bgImg, 64.8, 864, 950.4, 720, 0, 0, 330, 250) // this.ctx.drawImage(this.bgImg, 64.8, 864, 950.4, 720, 0, 0, 330, 250)
// this.ctx.drawImage(this.bgImg, 64.8, 720, 950.4, 864, 0, 0, 330, 300)
// console.log(this.width, this.height, this.screenWidth, 'drawMask');
console.log(this.bgImg, (this.screenWidth-this.width)/2*1080/this.screenWidth, (this.screenWidth/1.5)*1080/this.screenWidth, this.width*1080/this.screenWidth, this.height*1080/this.screenWidth, 0, 0, this.width, this.height);
this.ctx.drawImage(this.bgImg, (this.screenWidth-this.width)/2*1080/this.screenWidth, (this.screenWidth/1.5)*1080/this.screenWidth, this.width*1080/this.screenWidth, this.height*1080/this.screenWidth, 0, 0, this.width, this.height);
this.ctx.setFillStyle(this.maskColor) this.ctx.setFillStyle(this.maskColor)
this.ctx.fillRect(0, 0, this.width, this.height) this.ctx.fillRect(0, 0, this.width, this.height)
this.ctx.draw() this.ctx.draw()

84
pages/scratchCard/scratchCard.vue

@ -5,10 +5,19 @@
<view class="box"> <view class="box">
<!-- 刮奖结果图片 --> <!-- 刮奖结果图片 -->
<view :class="toDraw?'zIndex1':''" style="" class="result_img"> <view :class="toDraw?'zIndex1':''" style="" class="result_img">
<view style="font-size: 12px;text-align: center;margin-top: 8px;">中奖号码</view>
<view class="img_row" style="border-bottom: 1px solid #333;width: 90%;margin: 5px auto;">
<view v-for="(prizeItem,prizeIndex) in prizeList" :key="prizeIndex" class="data_item">
<image :src="prizeItem" mode="aspectFill"></image>
</view>
</view>
<view v-for="(item,index) in dataList" :key="index" class="img_row"> <view v-for="(item,index) in dataList" :key="index" class="img_row">
<view v-for="(lineItem, lineIndex) in item" :key="lineIndex" class="data_item"> <view v-for="(lineItem, lineIndex) in item" :key="lineIndex" class="data_item"
style="border-bottom: 1px dashed #333;">
<image :src="lineItem.image" mode="aspectFill"></image> <image :src="lineItem.image" mode="aspectFill"></image>
<view class="">{{lineItem.amount}}</view> <view class="">{{lineItem.amount}}</view>
<view style="font-size: 12px;font-weight: normal;transform: scale(0.8);">{{lineItem.pinyin}}</view>
<view class="circle" :class="lineItem.is_awards?'show':''"></view>
</view> </view>
</view> </view>
</view> </view>
@ -67,6 +76,7 @@ export default {
如果在全中区出现标志即中图刮开区内所示的20个金额之和` 如果在全中区出现标志即中图刮开区内所示的20个金额之和`
}, },
awards_amount: '20', awards_amount: '20',
prizeList: ['','',''],
dataList: [ dataList: [
[ [
{image: '',amount:'100.00'}, {image: '',amount:'100.00'},
@ -89,8 +99,8 @@ export default {
toDraw: false, // toDraw: false, //
showResult: false, // showResult: false, //
isWin: false, // isWin: false, //
scratchWidth: 330, // scratchWidth: 330, // -375330
scratchHeight: 250, // scratchHeight: 300, // -375300
scratchSize: 10, // scratchSize: 10, //
scratchScale: 0.6, // scratchScale: 0.6, //
prize_img: '', // prize_img: '', //
@ -100,6 +110,8 @@ export default {
isShow: false, isShow: false,
c_r_id: '', c_r_id: '',
gai: true, gai: true,
screenWidth: 375,
} }
}, },
updated() { updated() {
@ -115,6 +127,17 @@ export default {
} }
} }
}, },
created() {
let _this = this;
uni.getSystemInfo({
success(res) {
// console.log(res, '');
_this.screenWidth = res.screenWidth;
_this.scratchWidth = 0.88 * _this.screenWidth || 330;
_this.scratchHeight = 0.8 * _this.screenWidth || 300;
}
})
},
onLoad(e) { onLoad(e) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: e.type, title: e.type,
@ -122,7 +145,6 @@ export default {
}) })
this.id = e.id; this.id = e.id;
this.initInfo(); this.initInfo();
}, },
methods: { methods: {
initInfo(){ initInfo(){
@ -145,7 +167,8 @@ export default {
height: this.scratchHeight, height: this.scratchHeight,
size: this.scratchSize, size: this.scratchSize,
scale: this.scratchScale, scale: this.scratchScale,
bgImg: this.ticketInfo.bg_image bgImg: this.ticketInfo.bg_image,
screenWidth: this.screenWidth
}) })
}, },
@ -177,6 +200,8 @@ export default {
this.isThank = true; this.isThank = true;
this.guaCanvas = null; this.guaCanvas = null;
} }
this.dataList = res.data.list;
this.prizeList = res.data.prizes_data;
}, fail=>{ }, fail=>{
// this.isScratching = false // this.isScratching = false
@ -185,20 +210,28 @@ export default {
}, },
// //
scratchStart () { scratchStart () {
this.beginLottery() this.beginLottery()
}, },
// //
again(){ again(){
this.isWin = false; this.isWin = false;
this.isThank = false; this.isThank = false;
this.toDraw = false;
this.showResult = false; this.showResult = false;
this.gai = true; this.gai = true;
this.isScratching = false; this.isScratching = false;
this.isShow = false; this.isShow = false;
// this.guaCanvas.show = false;
this.initInfo(); API.request('/zone/beginInitInfo', {zone_goods_id: this.id}, res=>{
this.ticketInfo = res.data.data;
this.beginLottery();
})
let timer = setInterval(()=>{
if(this.guaCanvas && this.guaCanvas.show){
this.isShow = true;
clearInterval(timer);
}
}, 500)
}, },
close(type){ close(type){
if(type===1){ if(type===1){
@ -213,7 +246,7 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.prizePage{ .prizePage{
width: 750rpx; width: 750rpx;
min-height: calc(100vh - 88rpx - var(--status-bar-height)); min-height: calc(100vh - 88rpx - var(--status-bar-height));
@ -250,30 +283,51 @@ export default {
.img_row{ .img_row{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-content: space-around; justify-content: space-around;
} }
&.zIndex1{ &.zIndex1{
z-index: 1; z-index: 1;
} }
.data_item{ .data_item{
width: 25%; width: 22%;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
position: relative;
image{ image{
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
// background-color: #000; // background-color: #000;
} }
.circle{
position: absolute;
top: 0%;
left: 6%;
z-index: 999;
display: none;
width: 88%;
height: 80%;
border-radius: 50%;
background-color: transparent;
box-sizing: border-box;
// border: 3px solid #f00 !important;// border-color
background-image: url("../../static/home/circle.png");
background-size: 100% 100%;
&.show{
display: block;
}
}
} }
} }
.scratch { .scratch {
position: relative; position: relative;
padding-top: 600rpx; padding-top: 500rpx;
// padding-top: 280px; // padding-top: 280px;
width: 660rpx; width: 660rpx;
height: 500rpx; height: 600rpx;
margin: 0px auto; margin: 0px auto;
.box { .box {
width: 100%; width: 100%;

128
pages/ucenter/ucenter.vue

@ -98,6 +98,19 @@
</uni-list-item> </uni-list-item>
</template> </template>
</uni-list> </uni-list>
<view class="showClear" v-if="showClear">
<view class="showClear_box">
<view class="grey">温馨提示</view>
<view>确定后<br />将清除所有缓存数据</view>
<view class="">
<input type="text" placeholder="请输入密码" v-model="password">
</view>
<view class="btn_box">
<view class="grey" @click="cancelClear">取消</view>
<view class="" @click="confirmClear">确定</view>
</view>
</view>
</view>
</view> </view>
</template> </template>
@ -311,6 +324,8 @@
} }
}, },
userInfo: {}, userInfo: {},
showClear: false,
password: '',
} }
}, },
onLoad() { onLoad() {
@ -395,7 +410,8 @@
}, },
toUserInfo() { toUserInfo() {
uni.navigateTo({ uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd' url: '/pages/login/login'
// url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
}) })
// uni.navigateTo({ // uni.navigateTo({
// url: '/uni_modules/uni-id-pages/pages/userinfo/userinfo' // url: '/uni_modules/uni-id-pages/pages/userinfo/userinfo'
@ -417,7 +433,8 @@
uni.removeStorageSync('user_token'); uni.removeStorageSync('user_token');
setTimeout(()=>{ setTimeout(()=>{
uni.reLaunch({ uni.reLaunch({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd' url: '/pages/login/login'
// url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
}) })
}, 1000) }, 1000)
}) })
@ -570,19 +587,48 @@
}) })
}, },
clearCache(){ clearCache(){
uni.showModal({ this.showClear = true;
title:'温馨提示',
content:"确定后,将清除所有缓存数据",
success(res) { // uni.showModal({
if(res.confirm){ // title:'',
API.request('/adminUser/clean', {}, res=>{ // content:"",
uni.showToast({ // editable: true,
title: res.msg // placeholderText: '',
}) // success(res) {
}, fail=>{}) // if(res.confirm){
} //
} // }
}) // }
// })
},
confirmClear(){
if(!this.password){
uni.showToast({
title: '请输入密码',
icon: 'none'
})
return;
}
API.request('/adminUser/clean', {password: this.password}, res=>{
uni.showToast({
title: res.msg
})
this.showClear = false;
this.password = '';
uni.removeStorageSync('user_token');
setTimeout(()=>{
uni.reLaunch({
url: '/pages/login/login'
// url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
})
}, 1000)
}, fail=>{})
},
cancelClear(){
this.showClear = false;
this.password = '';
}, },
getUserInfo(){ getUserInfo(){
API.request('/user/userInfo', {}, res=>{ API.request('/user/userInfo', {}, res=>{
@ -808,4 +854,56 @@
/* #endif */ /* #endif */
background-color: #DD524D; background-color: #DD524D;
} }
.showClear{
width: 100vw;
height: 100vh;
position: fixed;
top: 0px;
left: 0px;
z-index: 999;
background-color: rgba(0, 0, 0, 0.5);
color: #444;
.showClear_box{
width: 520rpx;
// height: 340rpx;
border-radius: 10px;
background-color: #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
padding-top: 40rpx;
line-height: 54rpx;
}
input{
background-color: #f5f5f5;
padding: 8px;
margin: 16rpx 50rpx 0px;
border-radius: 10px;
}
.btn_box{
line-height: 90rpx;
display: flex;
flex-direction: row;
border-top: 1px solid #f1f1f1;
margin-top: 40rpx;
font-size: 14px;
view{
flex: 1;
}
.grey{
border-right: 1px solid #f1f1f1;
}
}
.grey{
color: #999;
font-size: 14px;
}
}
</style> </style>

BIN
static/home/circle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

3
uni_modules/uni-id-pages/common/login-page.scss

@ -23,7 +23,8 @@
.uni-content { .uni-content {
/* #ifndef H5 */ /* #ifndef H5 */
padding: 0; padding: 0;
max-width: 300px; /* max-width: 300px;
临时注释 */
margin-left: calc(50% - 200px); margin-left: calc(50% - 200px);
/* #endif */ /* #endif */
/* #ifdef H5 */ /* #ifdef H5 */

122
uni_modules/uni-id-pages/pages/login/login-withpwd.vue

@ -1,11 +1,11 @@
<!-- 账号密码登录页 --> <!-- 账号密码登录页 -->
<template> <template>
<view class="uni-content" style="padding: 0px 53px;margin: 0px auto;"> <view class="uni-content" style="">
<view class="nav_area"></view> <view class="nav_area"></view>
<view class="logo_area"> <view class="logo_area">
<image src="../../../../static/home/logo.png" mode=""></image> <image src="../../../../static/home/logo.png" mode=""></image>
<!-- <view class="close" @click="backPrev()"></view> --> <!-- <view class="close" @click="backPrev()"></view> -->
<view class="selece_box"> <view class="selece_box" v-if="0">
<uni-data-select :clear="false" <uni-data-select :clear="false"
v-model="value" v-model="value"
:localdata="range" :localdata="range"
@ -14,28 +14,30 @@
</view> </view>
</view> </view>
<text class="title title-box">欢迎登陆顶呱刮</text> <text class="title title-box">欢迎登陆顶呱刮</text>
<uni-forms> <view class="" style="width: 270px;margin: 0px auto;">
<uni-forms-item name="username"> <uni-forms>
<uni-easyinput :focus="focusUsername" @blur="focusUsername = false" class="input-box" <uni-forms-item name="username">
:inputBorder="false" v-model="username" placeholder="请输入手机号/账号" /> <uni-easyinput :focus="focusUsername" @blur="focusUsername = false" class="input-box"
</uni-forms-item> :inputBorder="false" v-model="username" placeholder="请输入手机号/账号" />
<uni-forms-item name="password"> </uni-forms-item>
<uni-easyinput :focus="focusPassword" @blur="focusPassword = false" class="input-box" clearable <uni-forms-item name="password">
type="password" :inputBorder="false" v-model="password" placeholder="请输入密码" /> <uni-easyinput :focus="focusPassword" @blur="focusPassword = false" class="input-box" clearable
</uni-forms-item> type="password" :inputBorder="false" v-model="password" placeholder="请输入密码" />
</uni-forms> </uni-forms-item>
<uni-captcha v-if="needCaptcha" focus ref="captcha" scene="login-by-pwd" v-model="captcha" /> </uni-forms>
<!-- 带选择框的隐私政策协议组件 --> <uni-captcha v-if="needCaptcha" focus ref="captcha" scene="login-by-pwd" v-model="captcha" />
<!-- <uni-id-pages-agreements scope="login" ref="agreements"></uni-id-pages-agreements> --> <!-- 带选择框的隐私政策协议组件 -->
<button class="uni-btn login-btn" type="primary" @click="pwdLogin">登录</button> <!-- <uni-id-pages-agreements scope="login" ref="agreements"></uni-id-pages-agreements> -->
<!-- 忘记密码 --> <button class="uni-btn login-btn" type="primary" @click="pwdLogin">登录</button>
<view class="link-box" v-if="this.userType=='user'"> <!-- 忘记密码 -->
<view v-if="!config.isAdmin"> <view class="link-box" v-if="this.userType=='user'">
<!-- <text class="forget" @click="toRetrievePwd">忘记密码</text> --> <view v-if="!config.isAdmin">
<!-- <text class="link">找回密码</text> --> <!-- <text class="forget" @click="toRetrievePwd">忘记密码</text> -->
<!-- <text class="link">找回密码</text> -->
</view>
<text class="link" @click="toRegister">{{config.isAdmin ? '注册管理员账号': '新注册'}}</text>
<!-- <text class="link" @click="toRegister" v-if="!config.isAdmin">注册账号</text> -->
</view> </view>
<text class="link" @click="toRegister">{{config.isAdmin ? '注册管理员账号': '新注册'}}</text>
<!-- <text class="link" @click="toRegister" v-if="!config.isAdmin">注册账号</text> -->
</view> </view>
<view v-if="this.userType=='user'" <view v-if="this.userType=='user'"
style="width: 100vw;text-align: center;color: #dcdcdc;font-size: 14px; style="width: 100vw;text-align: center;color: #dcdcdc;font-size: 14px;
@ -171,26 +173,27 @@
// } else { // } else {
// data.username = this.username // data.username = this.username
// } // }
let url = '', newUrl = '';
let data = {}; let url = '/passport/mixedLogin', newUrl = '';
switch (this.userType){ let data = {account_number: this.username, password: this.password, captcha: ''};
case 'user': // switch (this.userType){
url = '/passport/login'; // case 'user':
data = {phone: this.username, password: this.password}; // url = '/passport/login';
newUrl = '/pages/home/home'; // data = {phone: this.username, password: this.password};
break; // newUrl = '/pages/home/home';
case 'agent': // break;
url = '/passport/agentLogin'; // case 'agent':
data = {phone: this.username, password: this.password}; // url = '/passport/agentLogin';
newUrl = '/pages/list/team'; // data = {phone: this.username, password: this.password};
break; // newUrl = '/pages/list/team';
case 'background': // break;
url = '/passport/adminLogin'; // case 'background':
data = {account_number: this.username, password: this.password}; // url = '/passport/adminLogin';
newUrl = '/pages/home/home'; // data = {account_number: this.username, password: this.password};
// newUrl = '/pages/home/home';
break; // break;
} // }
API.request(url, data, res=>{ API.request(url, data, res=>{
uni.showToast({ uni.showToast({
@ -203,6 +206,20 @@
uni.setStorageSync('accounts', accounts); uni.setStorageSync('accounts', accounts);
uni.setStorageSync('user_token', res.data.token); uni.setStorageSync('user_token', res.data.token);
switch (res.data.type){
case 3:
newUrl = '/pages/home/home';
this.userType = 'user';
break;
case 2:
newUrl = '/pages/list/team';
this.userType = 'agent';
break;
case 1:
newUrl = '/pages/home/home';
this.userType = 'background';
break;
}
uni.setStorageSync('userType', this.userType); uni.setStorageSync('userType', this.userType);
setTimeout(()=>{ setTimeout(()=>{
@ -212,18 +229,6 @@
}, 1500) }, 1500)
}, fail=>{}, false) }, fail=>{}, false)
// uniIdCo.login(data).then(e => {
// this.loginSuccess(e)
// }).catch(e => {
// if (e.errCode == 'uni-id-captcha-required') {
// this.needCaptcha = true
// } else if (this.needCaptcha) {
// //
// this.$refs.captcha.getImageCaptcha()
// }
// })
}, },
/* 前往注册 */ /* 前往注册 */
toRegister() { toRegister() {
@ -266,6 +271,10 @@
height: 600px; height: 600px;
} }
} }
.uni-content{
padding: 0px !important;
margin: 0px auto !important;
}
.nav_area{ .nav_area{
background-color: #fff; background-color: #fff;
@ -279,7 +288,7 @@
padding-top: var(--status-bar-height); padding-top: var(--status-bar-height);
} }
.logo_area{ .logo_area{
width: 269px; width: 270px;
height: 50px; height: 50px;
margin: 4px auto; margin: 4px auto;
position: relative; position: relative;
@ -314,7 +323,8 @@
.title-box{ .title-box{
font-size: 26px; font-size: 26px;
color: #444; color: #444;
margin-bottom: 20px; margin: 0px auto 20px;
width: 270px;
} }
.uni-content /deep/ .uni-easyinput__content{ .uni-content /deep/ .uni-easyinput__content{
background-color: #fff !important; background-color: #fff !important;

117
uni_modules/uni-id-pages/pages/register/register.vue

@ -1,6 +1,6 @@
<!-- 账号注册页 --> <!-- 账号注册页 -->
<template> <template>
<view class="uni-content" style="padding: 0px 53px;margin: 0px auto;"> <view class="uni-content">
<match-media :min-width="690"> <match-media :min-width="690">
<view class="login-logo"> <view class="login-logo">
<image :src="logo"></image> <image :src="logo"></image>
@ -14,55 +14,59 @@
<view class="close" @click="backPrev()"></view> <view class="close" @click="backPrev()"></view>
</view> </view>
<text class="title title-box">注册</text> <text class="title title-box">注册</text>
<uni-forms ref="form" :value="formData" :rules="rules" validate-trigger="submit" err-show-type="toast"> <view class="" style="width: 270px;margin: 0px auto;">
<!-- <uni-forms-item name="username" required> <uni-forms ref="form" :value="formData" :rules="rules" validate-trigger="submit" err-show-type="toast">
<uni-easyinput :inputBorder="false" :focus="focusUsername" @blur="focusUsername = false" <!-- <uni-forms-item name="username" required>
class="input-box" placeholder="请输入用户名" v-model="formData.username" trim="both" /> <uni-easyinput :inputBorder="false" :focus="focusUsername" @blur="focusUsername = false"
</uni-forms-item> class="input-box" placeholder="请输入用户名" v-model="formData.username" trim="both" />
<uni-forms-item name="nickname"> </uni-forms-item>
<uni-easyinput :inputBorder="false" :focus="focusNickname" @blur="focusNickname = false" <uni-forms-item name="nickname">
class="input-box" placeholder="请输入用户昵称" v-model="formData.nickname" trim="both" /> <uni-easyinput :inputBorder="false" :focus="focusNickname" @blur="focusNickname = false"
</uni-forms-item> --> class="input-box" placeholder="请输入用户昵称" v-model="formData.nickname" trim="both" />
<uni-forms-item name="phone"> </uni-forms-item> -->
<uni-easyinput :inputBorder="false" :focus="focusUsername" @blur="focusUsername = false" <uni-forms-item name="phone">
class="input-box" placeholder="手机号码" v-model="formData.phone" trim="both" /> <uni-easyinput :inputBorder="false" :focus="focusUsername" @blur="focusUsername = false"
<view class="getCaptchaCode" v-if="0"> class="input-box" placeholder="手机号码" v-model="formData.phone" trim="both" />
获取验证码 <view class="getCaptchaCode" v-if="0">
获取验证码
</view>
</uni-forms-item>
<uni-forms-item name="phoneCaptcha" v-if="0">
<uni-easyinput :inputBorder="false" :focus="focusCaptcha" @blur="focusCaptcha = false"
class="input-box" placeholder="手机验证码" v-model="formData.phoneCaptcha" trim="both" />
</uni-forms-item>
<uni-forms-item name="invitationCode">
<uni-easyinput :inputBorder="false" :focus="focusCode" @blur="focusCode = false"
class="input-box" placeholder="邀请码" v-model="formData.invitationCode" trim="both" />
</uni-forms-item>
<!-- :placeholder="'请输入' + (config.passwordStrength == 'weak'?'6':'8') + '-16位密码'" -->
<uni-forms-item name="password" v-model="formData.password" >
<uni-easyinput :inputBorder="false" :focus="focusPassword" @blur="focusPassword = false"
class="input-box" maxlength="20"
placeholder="密码" type="password"
v-model="formData.password" trim="both" />
</uni-forms-item>
<uni-forms-item name="repassword" v-model="formData.repassword" >
<uni-easyinput :inputBorder="false" :focus="focusPassword2" @blur="focusPassword2 =false"
class="input-box" placeholder="确认密码" maxlength="20" type="password" v-model="formData.repassword"
trim="both" />
</uni-forms-item>
<!-- <uni-forms-item>
<uni-captcha ref="captcha" scene="register" v-model="formData.captcha" />
</uni-forms-item> -->
<!-- <uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements> -->
<button class="uni-btn register-btn" type="primary" @click="submitForm">立即注册</button>
<!-- <button @click="navigateBack" class="register-back">返回</button> -->
<match-media :min-width="690">
<view class="link-box">
<text class="link" @click="registerByEmail">邮箱验证码注册</text>
<text class="link" @click="toLogin">已有账号点此登录</text>
</view> </view>
</uni-forms-item> </match-media>
<uni-forms-item name="phoneCaptcha" v-if="0"> </uni-forms>
<uni-easyinput :inputBorder="false" :focus="focusCaptcha" @blur="focusCaptcha = false" </view>
class="input-box" placeholder="手机验证码" v-model="formData.phoneCaptcha" trim="both" />
</uni-forms-item>
<uni-forms-item name="invitationCode">
<uni-easyinput :inputBorder="false" :focus="focusCode" @blur="focusCode = false"
class="input-box" placeholder="邀请码" v-model="formData.invitationCode" trim="both" />
</uni-forms-item>
<!-- :placeholder="'请输入' + (config.passwordStrength == 'weak'?'6':'8') + '-16位密码'" -->
<uni-forms-item name="password" v-model="formData.password" >
<uni-easyinput :inputBorder="false" :focus="focusPassword" @blur="focusPassword = false"
class="input-box" maxlength="20"
placeholder="密码" type="password"
v-model="formData.password" trim="both" />
</uni-forms-item>
<uni-forms-item name="repassword" v-model="formData.repassword" >
<uni-easyinput :inputBorder="false" :focus="focusPassword2" @blur="focusPassword2 =false"
class="input-box" placeholder="确认密码" maxlength="20" type="password" v-model="formData.repassword"
trim="both" />
</uni-forms-item>
<!-- <uni-forms-item>
<uni-captcha ref="captcha" scene="register" v-model="formData.captcha" />
</uni-forms-item> -->
<!-- <uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements> -->
<button class="uni-btn register-btn" type="primary" @click="submitForm">立即注册</button>
<!-- <button @click="navigateBack" class="register-back">返回</button> -->
<match-media :min-width="690">
<view class="link-box">
<text class="link" @click="registerByEmail">邮箱验证码注册</text>
<text class="link" @click="toLogin">已有账号点此登录</text>
</view>
</match-media>
</uni-forms>
</view> </view>
</template> </template>
@ -76,7 +80,7 @@
mutations mutations
} from '@/uni_modules/uni-id-pages/common/store.js' } from '@/uni_modules/uni-id-pages/common/store.js'
const uniIdCo = uniCloud.importObject("uni-id-co") // const uniIdCo = uniCloud.importObject("uni-id-co")
export default { export default {
mixins: [mixin], mixins: [mixin],
data() { data() {
@ -153,7 +157,8 @@
}) })
setTimeout(()=>{ setTimeout(()=>{
uni.redirectTo({ uni.redirectTo({
url:'/uni_modules/uni-id-pages/pages/login/login-withpwd?phone='+data.phone url: '/pages/login/login?phone='+data.phone
// url:'/uni_modules/uni-id-pages/pages/login/login-withpwd?phone='+data.phone
}) })
}, 1500) }, 1500)
}) })
@ -171,7 +176,8 @@
}, },
toLogin() { toLogin() {
uni.navigateTo({ uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd' url: '/pages/login/login'
// url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
}) })
}, },
registerByEmail() { registerByEmail() {
@ -219,6 +225,10 @@
} }
} }
.uni-content{
padding: 0px !important;
margin: 0px auto !important;
}
.uni-content ::v-deep .uni-forms-item__label { .uni-content ::v-deep .uni-forms-item__label {
position: absolute; position: absolute;
left: -15px; left: -15px;
@ -259,7 +269,8 @@
.title-box{ .title-box{
font-size: 26px; font-size: 26px;
color: #444; color: #444;
// margin-bottom: 20px; margin: 0px auto 0px;
width: 270px;
} }
.uni-content /deep/ .uni-easyinput__content{ .uni-content /deep/ .uni-easyinput__content{
background-color: #fff !important; background-color: #fff !important;

9
uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue

@ -34,9 +34,9 @@
import mixin from '@/uni_modules/uni-id-pages/common/login-page.mixin.js'; import mixin from '@/uni_modules/uni-id-pages/common/login-page.mixin.js';
import passwordMod from '@/uni_modules/uni-id-pages/common/password.js' import passwordMod from '@/uni_modules/uni-id-pages/common/password.js'
import API from '@/common/js/api.js' import API from '@/common/js/api.js'
const uniIdCo = uniCloud.importObject("uni-id-co", { // const uniIdCo = uniCloud.importObject("uni-id-co", {
customUI:true // customUI:true
}) // })
export default { export default {
mixins: [mixin], mixins: [mixin],
data() { data() {
@ -128,7 +128,8 @@
uni.removeStorageSync('uni_id_token'); uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0) uni.setStorageSync('uni_id_token_expired', 0)
uni.redirectTo({ uni.redirectTo({
url:'/uni_modules/uni-id-pages/pages/login/login-withpwd' url: '/pages/login/login'
// url:'/uni_modules/uni-id-pages/pages/login/login-withpwd'
}) })
}).catch(e => { }).catch(e => {
uni.showModal({ uni.showModal({

Loading…
Cancel
Save