11.22前端

This commit is contained in:
@QQNZX 2023-11-25 15:31:09 +08:00
parent 41198cef57
commit 2dee747f0c
11 changed files with 195 additions and 76 deletions

View File

@ -17,6 +17,25 @@ export function login(username, password, captchaCode, uuid) {
data: data data: data
}) })
} }
// 获取手机验证码
export function gettelcode(data) {
return request({
url: 'backendApi/login/sendMsg',
method: 'post',
data:data
})
}
export function gettellogin(mobile,code) {
const data ={
mobile,
code
}
return request({
url: 'backendApi/login/loginByPhone',
method: 'post',
data:data
})
}
// 获取用户详细信息 // 获取用户详细信息
export function getInfo() { export function getInfo() {

View File

@ -18,7 +18,7 @@ $base-menu-light-color:#ffffff;
$base-menu-light-background:#ffffff; $base-menu-light-background:#ffffff;
$base-logo-light-title-color: #1a5982; $base-logo-light-title-color: #1a5982;
$base-sub-menu-background:#18547a;//展开的背景色 $base-sub-menu-background: #4e77cc;//展开的背景色
$base-sub-menu-hover:#001528; $base-sub-menu-hover:#001528;
$base-sidebar-width: 200px; $base-sidebar-width: 200px;

View File

@ -68,11 +68,12 @@ export default {
return ''; return '';
}, },
role() { role() {
console.log()
if (this.$store.getters.storeName && this.$store.getters.storeId) { if (this.$store.getters.storeName && this.$store.getters.storeId) {
return '店铺管理员';
} return this.$store.getters.storeName;
if (this.$store.getters.merchantName && this.$store.getters.merchantId) { }else {
return '商户管理员'; return "";
} }
} }
} }

View File

@ -1,4 +1,4 @@
import { login, logout, getInfo } from '@/api/login' import { login, logout, getInfo,gettellogin } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from '@/utils/auth'
const user = { const user = {
@ -61,6 +61,21 @@ const user = {
}) })
}) })
}, },
// 验证码登录
codeLogin({ commit }, userInfo) {
const mobile = userInfo.mobile
const code = userInfo.code
return new Promise((resolve, reject) => {
gettellogin(mobile, code).then(res => {
setToken(res.data.token)
commit('SET_TOKEN', res.data.token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// 获取用户信息 // 获取用户信息
GetInfo({ commit, state }) { GetInfo({ commit, state }) {

View File

@ -137,12 +137,10 @@
@confirm="handleDelete(scope.row)" @confirm="handleDelete(scope.row)"
v-if="scope.row.isonline == '0'" title="这是一段内容确定下线吗?"> v-if="scope.row.isonline == '0'" title="这是一段内容确定下线吗?">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
slot="reference" slot="reference"
>下线</el-button> >下线</el-button>
</el-popconfirm> </el-popconfirm>
@ -159,49 +157,71 @@
/> />
</el-card> </el-card>
<el-drawer <el-drawer
title="添加-汽油卡" title="添加-储值卡"
:visible.sync="dialog" :visible.sync="dialog"
size="50%" size="50%"
ref="drawer" ref="drawer"
> >
<div class="demo-drawer__content"> <div class="demo-drawer__content">
<el-form :model="form" :rules="rules" :inline="true" > <el-form :model="form" :rules="rules" :inline="true" >
<el-form-item label="面向群体" :label-width="formLabelWidth"> <el-form-item label="面向群体" :label-width="formLabelWidth" >
<el-radio-group v-model="form.groupOriented"> <el-radio-group v-model="form.groupOriented">
<el-radio label="1">不限群体</el-radio> <el-radio label="1">不限群体</el-radio>
<el-radio label="2">会员等级</el-radio> <el-radio label="2">会员等级</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="会员等级" prop="region" v-if="form.groupOriented == '2' " > <el-row :gutter="20">
<el-select v-model="form.membershipLevel" multiple placeholder="会员等级" > <el-col :span="12"> <el-form-item label="会员等级" prop="region" :label-width="formLabelWidth" v-if="form.groupOriented == '2' " >
<el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.name"></el-option> <el-select v-model="form.membershipLevel" multiple placeholder="会员等级" >
</el-select> <el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.id.toString()"></el-option>
</el-form-item> </el-select>
<el-form-item label="充值金额" :label-width="formLabelWidth" prop="rechargeBalance"> </el-form-item></el-col>
<el-input v-model="form.rechargeBalance" autocomplete="off">
<template slot="append"></template>
</el-input> </el-row>
</el-form-item> <el-row :gutter="20">
<el-form-item label="赠送金额" :label-width="formLabelWidth" prop="giftBalance"> <el-col :span="14">
<el-input v-model="form.giftBalance" autocomplete="off"> <el-form-item label="充值金额" :label-width="formLabelWidth" prop="rechargeBalance">
<template slot="append"></template> <el-input type="number" v-model="form.rechargeBalance" autocomplete="off">
</el-input> <template slot="append"></template>
</el-form-item> </el-input>
<el-form-item label="赠送积分" :label-width="formLabelWidth" prop="points"> </el-form-item>
<el-input v-model="form.points" autocomplete="off"> </el-col>
<template slot="append"></template> <el-col :span="14">
</el-input> <el-form-item label="赠送金额" :label-width="formLabelWidth" prop="giftBalance">
</el-form-item> <el-input type="number" v-model="form.giftBalance" autocomplete="off">
<el-form-item label="赠送成长值" :label-width="formLabelWidth" prop="growthValue"> <template slot="append"></template>
<el-input v-model="form.growthValue" autocomplete="off"> </el-input>
<template slot="append">成长值</template> </el-form-item>
</el-input> </el-col>
</el-form-item> <el-col :span="14">
<el-form-item label="赠送加油金" :label-width="formLabelWidth" prop="refuelMoney"> <el-form-item label="赠送积分" :label-width="formLabelWidth" prop="points">
<el-input v-model="form.refuelMoney" autocomplete="off"> <el-input type="number" v-model="form.points" autocomplete="off">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="赠送成长值" :label-width="formLabelWidth" prop="growthValue">
<el-input type="number" v-model="form.growthValue" autocomplete="off">
<template slot="append">成长值</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="赠送加油金" :label-width="formLabelWidth" prop="refuelMoney">
<el-input type="number" v-model="form.refuelMoney" autocomplete="off">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="赠送特权" :label-width="formLabelWidth" prop="resource"> <el-form-item label="赠送特权" :label-width="formLabelWidth" prop="resource">
<el-radio-group v-model="form.resource"> <el-radio-group v-model="form.resource">
@ -804,6 +824,13 @@
}) })
}, },
handleUpdate(row) { handleUpdate(row) {
let data = {
pageNo:1,
pageSize:30,
}
listUserGrade(data).then(res=>{
this.vipname = res.data.records
})
this.chongzhi(); this.chongzhi();
const id = row.id || this.ids const id = row.id || this.ids
mmc(id).then(response => { mmc(id).then(response => {
@ -815,11 +842,7 @@
}); });
}, },
// handleUpdate(data){
// console.log(data)
// this.form = data
// this.dialog = true
// },
chongzhi(){ chongzhi(){
this.form = { this.form = {
sort:1, sort:1,
@ -870,9 +893,15 @@
}) })
}, },
handleDelete(data){ handleDelete(data){
let resData = JSON.parse(JSON.stringify(data)) let resData = JSON.parse(JSON.stringify(data))
resData.isonline = "1"
eitList(resData).then(res=>{ let ddata = {
isonline : "1",
id:resData.id
}
eitList(ddata).then(res=>{
if (res.code === 200){ if (res.code === 200){
this.$message({ this.$message({
message: '下线成功', message: '下线成功',

View File

@ -32,11 +32,9 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<el-card style="margin-bottom: 20px"> <el-card style="margin-bottom: 20px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
@ -46,7 +44,6 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>新增 >新增
</el-button> </el-button>
</el-col> </el-col>
@ -65,10 +62,6 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
<!-- <el-table-column label="主键id" align="center" prop="id" />-->
<!-- <el-table-column label="所属连锁店id" align="center" prop="chainStorId" />-->
<!-- <el-table-column label="所属店铺id" align="center" prop="storeId" />-->
<el-table-column label="是否在线" align="center" prop="isonline"> <el-table-column label="是否在线" align="center" prop="isonline">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.isonline == 0">在线</span> <span v-if="scope.row.isonline == 0">在线</span>
@ -338,7 +331,7 @@ export default {
isonline: null, isonline: null,
status: null, status: null,
name: null, name: null,
type: null, type: "0",
giftName: null, giftName: null,
validity: null, validity: null,
useInstructions: null, useInstructions: null,

View File

@ -42,7 +42,7 @@
<div class="tj-num">{{tjdata.remaining_amount || 0}}</div> <div class="tj-num">{{tjdata.remaining_amount || 0}}</div>
<div class="tj-siez">剩余额度</div> <div class="tj-siez">剩余额度</div>
</el-card> </el-card>
<el-card class="kar" style="cursor: pointer" > <el-card class="kar" style="cursor: pointer;height: 106px " >
<div class="tj-num"> <el-tag v-if="tjdata.exchangeStatus == 0" @click="putStatus(1)">启用</el-tag> <el-tag type="info" v-if="tjdata.exchangeStatus == 1 " @click="putStatus(0)">禁用</el-tag> </div> <div class="tj-num"> <el-tag v-if="tjdata.exchangeStatus == 0" @click="putStatus(1)">启用</el-tag> <el-tag type="info" v-if="tjdata.exchangeStatus == 1 " @click="putStatus(0)">禁用</el-tag> </div>
<div class="tj-siez">兑换功能状态</div> <div class="tj-siez">兑换功能状态</div>

View File

@ -11,7 +11,7 @@
</el-radio-group> </el-radio-group>
<div class="top-sousuo"> <div class="top-sousuo">
<el-select v-model="queryParams.oilType" placeholder="请选择"> <el-select v-model="queryParams.oilType" clearable placeholder="请选择">
<el-option <el-option
v-for="dict in oilList" v-for="dict in oilList"
:key="dict.oilName" :key="dict.oilName"
@ -197,7 +197,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="所得升数" prop="incomeLitres"> <el-form-item label="所得升数" prop="incomeLitres">
<el-input v-model="ruleForm.incomeLitres"> <el-input v-model="ruleForm.incomeLitres.toFixed(2)">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -324,12 +324,14 @@
}, },
mounted() { mounted() {
this.getlist() this.getlist()
this.radiovalue()
}, },
watch:{ watch:{
'ruleForm.rechargeBalance':{ 'ruleForm.rechargeBalance':{
handler: function() { handler: function() {
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){ if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
}else { }else {
this.ruleForm.incomeLitres = 0 this.ruleForm.incomeLitres = 0
} }
@ -341,6 +343,7 @@
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){ if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
}else { }else {
this.ruleForm.incomeLitres = 0 this.ruleForm.incomeLitres = 0
} }

View File

@ -83,11 +83,11 @@
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.tel"
type="text" type="number"
auto-complete="off" auto-complete="off"
clearable clearable
placeholder="号" placeholder="手机号"
> >
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input> </el-input>
@ -98,7 +98,7 @@
<div> <div>
<el-input <el-input
v-model="loginForm.captchaCode" v-model="loginForm.telcode"
auto-complete="off" auto-complete="off"
placeholder="请输入验证码" placeholder="请输入验证码"
style="width: 90%" style="width: 90%"
@ -122,7 +122,7 @@
size="medium" size="medium"
type="primary" type="primary"
style="width:100%;line-height: 24px;font-size: 16px;" style="width:100%;line-height: 24px;font-size: 16px;"
@click.native.prevent="" @click.native.prevent="posttelcode()"
> >
<span v-if="!loading">立即登录</span> <span v-if="!loading">立即登录</span>
<span v-else> 中...</span> <span v-else> 中...</span>
@ -152,10 +152,11 @@
</template> </template>
<script> <script>
import { getCodeImg } from "@/api/login"; import {getCodeImg, gettelcode, gettellogin,} from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from '@/utils/jsencrypt'
import BalanceRecharge from "@/views/member/balanceRecharge.vue"; import BalanceRecharge from "@/views/member/balanceRecharge.vue";
import {setToken} from "@/utils/auth";
export default { export default {
name: "Login", name: "Login",
@ -173,7 +174,9 @@ export default {
codeUrl: "", codeUrl: "",
systemName : process.env.VUE_APP_TITLE, systemName : process.env.VUE_APP_TITLE,
loginForm: { loginForm: {
username: "fuint", tel:null,
telcode:null,
username: "oil_admin",
password: "123456", password: "123456",
rememberMe: false, rememberMe: false,
captchaCode: "", captchaCode: "",
@ -209,7 +212,14 @@ export default {
this.getCookie(); this.getCookie();
}, },
methods: { methods: {
getCode() { getCode() {
if(!this.loginForm.tel){
this.$message.error("手机号不能为空")
return
}
const TIME_COUNT = 60; const TIME_COUNT = 60;
if (!this.timer) { if (!this.timer) {
this.count = TIME_COUNT; this.count = TIME_COUNT;
@ -224,7 +234,16 @@ export default {
} }
}, 1000) }, 1000)
} }
let data = {
mobile:this.loginForm.tel
}
gettelcode(data).then(res =>{
if(res.code == 200){
this.$message.success("操作成功")
}else{
this.$message.error("操作失败请稍后再试")
}
})
}, },
getCodeimg() { getCodeimg() {
const app = this const app = this
@ -244,6 +263,20 @@ export default {
uuid: this.loginForm.uuid uuid: this.loginForm.uuid
}; };
}, },
posttelcode(){
const data = {
mobile:this.loginForm.tel,
code:this.loginForm.telcode
}
this.$store.dispatch("codeLogin", data).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
});
},
handleLogin() { handleLogin() {
const app = this; const app = this;
if (app.loading) { if (app.loading) {

View File

@ -79,14 +79,10 @@
</el-form> </el-form>
<!-- 验证码--> <!-- 验证码-->
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" v-if="actindex == 1" > <el-form ref="loginForm" :model="loginForm" :rules="loginRules" v-if="actindex == 1" >
<!-- <div class="title">-->
<!-- <img class="logo" src="@/assets/logo/logo.png"/>-->
<!-- <span class="name">{{ systemName }}</span>-->
<!-- </div>-->
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.tel"
type="text" type="text"
auto-complete="off" auto-complete="off"
clearable clearable
@ -101,7 +97,7 @@
<div> <div>
<el-input <el-input
v-model="loginForm.captchaCode" v-model="loginForm.telcode"
auto-complete="off" auto-complete="off"
placeholder="请输入验证码" placeholder="请输入验证码"
style="width: 90%" style="width: 90%"
@ -112,7 +108,7 @@
</el-input> </el-input>
</div> </div>
<div> <div>
<span style="cursor: pointer;color: #00aaff " class="anniulan" v-show="show" @click="getCode" >获取验证码</span> <span class="anniulan" v-show="show" @click="getCode" >获取验证码</span>
<span style="cursor: pointer;color: #00aaff " v-show="!show" class="count">{{count}}s后重新获取</span> <span style="cursor: pointer;color: #00aaff " v-show="!show" class="count">{{count}}s后重新获取</span>
</div> </div>
@ -125,7 +121,7 @@
size="medium" size="medium"
type="primary" type="primary"
style="width:100%;line-height: 24px;font-size: 16px;" style="width:100%;line-height: 24px;font-size: 16px;"
@click.native.prevent="" @click.native.prevent="posttelcode()"
> >
<span v-if="!loading">立即登录</span> <span v-if="!loading">立即登录</span>
<span v-else> 中...</span> <span v-else> 中...</span>
@ -160,6 +156,8 @@ export default {
pwdType: 'password', pwdType: 'password',
systemName : process.env.VUE_APP_TITLE, systemName : process.env.VUE_APP_TITLE,
loginForm: { loginForm: {
tel:null,
telcode:null,
username: "fuint", username: "fuint",
password: "123456", password: "123456",
rememberMe: false, rememberMe: false,
@ -197,6 +195,12 @@ export default {
}, },
methods: { methods: {
getCode() { getCode() {
if(!this.loginForm.tel){
this.$message.error("手机号不能为空")
return
}
const TIME_COUNT = 60; const TIME_COUNT = 60;
if (!this.timer) { if (!this.timer) {
this.count = TIME_COUNT; this.count = TIME_COUNT;
@ -211,6 +215,29 @@ export default {
} }
}, 1000) }, 1000)
} }
let data = {
mobile:this.loginForm.tel
}
gettelcode(data).then(res =>{
if(res.code == 200){
this.$message.success("操作成功")
}else{
this.$message.error("操作失败请稍后再试")
}
})
},
posttelcode(){
const data = {
mobile:this.loginForm.tel,
code:this.loginForm.telcode
}
this.$store.dispatch("codeLogin", data).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
});
}, },
getCodeimg() { getCodeimg() {
const app = this const app = this

@ -1 +0,0 @@
Subproject commit 735e4aff6a57f9505915e85313d8f3c1659d6be7