11.22前端
This commit is contained in:
parent
41198cef57
commit
2dee747f0c
@ -17,6 +17,25 @@ export function login(username, password, captchaCode, uuid) {
|
||||
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() {
|
||||
|
@ -18,7 +18,7 @@ $base-menu-light-color:#ffffff;
|
||||
$base-menu-light-background:#ffffff;
|
||||
$base-logo-light-title-color: #1a5982;
|
||||
|
||||
$base-sub-menu-background:#18547a;//展开的背景色
|
||||
$base-sub-menu-background: #4e77cc;//展开的背景色
|
||||
$base-sub-menu-hover:#001528;
|
||||
|
||||
$base-sidebar-width: 200px;
|
||||
|
@ -68,11 +68,12 @@ export default {
|
||||
return '';
|
||||
},
|
||||
role() {
|
||||
console.log()
|
||||
if (this.$store.getters.storeName && this.$store.getters.storeId) {
|
||||
return '店铺管理员';
|
||||
}
|
||||
if (this.$store.getters.merchantName && this.$store.getters.merchantId) {
|
||||
return '商户管理员';
|
||||
|
||||
return this.$store.getters.storeName;
|
||||
}else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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'
|
||||
|
||||
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 }) {
|
||||
|
@ -137,12 +137,10 @@
|
||||
@confirm="handleDelete(scope.row)"
|
||||
v-if="scope.row.isonline == '0'" title="这是一段内容确定下线吗?">
|
||||
<el-button
|
||||
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
slot="reference"
|
||||
|
||||
>下线</el-button>
|
||||
</el-popconfirm>
|
||||
|
||||
@ -159,7 +157,7 @@
|
||||
/>
|
||||
</el-card>
|
||||
<el-drawer
|
||||
title="添加-汽油卡"
|
||||
title="添加-储值卡"
|
||||
:visible.sync="dialog"
|
||||
size="50%"
|
||||
ref="drawer"
|
||||
@ -172,36 +170,58 @@
|
||||
<el-radio label="2">会员等级</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员等级" prop="region" v-if="form.groupOriented == '2' " >
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12"> <el-form-item label="会员等级" prop="region" :label-width="formLabelWidth" v-if="form.groupOriented == '2' " >
|
||||
<el-select v-model="form.membershipLevel" multiple placeholder="会员等级" >
|
||||
<el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.name"></el-option>
|
||||
<el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.id.toString()"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item></el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="14">
|
||||
<el-form-item label="充值金额" :label-width="formLabelWidth" prop="rechargeBalance">
|
||||
<el-input v-model="form.rechargeBalance" autocomplete="off">
|
||||
<el-input type="number" v-model="form.rechargeBalance" 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="giftBalance">
|
||||
<el-input v-model="form.giftBalance" autocomplete="off">
|
||||
<el-input type="number" v-model="form.giftBalance" 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="points">
|
||||
<el-input v-model="form.points" autocomplete="off">
|
||||
<el-input type="number" v-model="form.points" 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="growthValue">
|
||||
<el-input v-model="form.growthValue" autocomplete="off">
|
||||
<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 v-model="form.refuelMoney" autocomplete="off">
|
||||
<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-radio-group v-model="form.resource">
|
||||
@ -804,6 +824,13 @@
|
||||
})
|
||||
},
|
||||
handleUpdate(row) {
|
||||
let data = {
|
||||
pageNo:1,
|
||||
pageSize:30,
|
||||
}
|
||||
listUserGrade(data).then(res=>{
|
||||
this.vipname = res.data.records
|
||||
})
|
||||
this.chongzhi();
|
||||
const id = row.id || this.ids
|
||||
mmc(id).then(response => {
|
||||
@ -815,11 +842,7 @@
|
||||
|
||||
});
|
||||
},
|
||||
// handleUpdate(data){
|
||||
// console.log(data)
|
||||
// this.form = data
|
||||
// this.dialog = true
|
||||
// },
|
||||
|
||||
chongzhi(){
|
||||
this.form = {
|
||||
sort:1,
|
||||
@ -870,9 +893,15 @@
|
||||
})
|
||||
},
|
||||
handleDelete(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){
|
||||
this.$message({
|
||||
message: '下线成功',
|
||||
|
@ -32,11 +32,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
@ -46,7 +44,6 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -65,10 +62,6 @@
|
||||
</el-row>
|
||||
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isonline == 0">在线</span>
|
||||
@ -338,7 +331,7 @@ export default {
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
type: "0",
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
|
@ -42,7 +42,7 @@
|
||||
<div class="tj-num">{{tjdata.remaining_amount || 0}}</div>
|
||||
<div class="tj-siez">剩余额度</div>
|
||||
</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-siez">兑换功能状态</div>
|
||||
|
@ -11,7 +11,7 @@
|
||||
</el-radio-group>
|
||||
|
||||
<div class="top-sousuo">
|
||||
<el-select v-model="queryParams.oilType" placeholder="请选择">
|
||||
<el-select v-model="queryParams.oilType" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in oilList"
|
||||
:key="dict.oilName"
|
||||
@ -197,7 +197,7 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所得升数" prop="incomeLitres">
|
||||
<el-input v-model="ruleForm.incomeLitres">
|
||||
<el-input v-model="ruleForm.incomeLitres.toFixed(2)">
|
||||
<template slot="append">升</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -324,12 +324,14 @@
|
||||
},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
this.radiovalue()
|
||||
},
|
||||
watch:{
|
||||
'ruleForm.rechargeBalance':{
|
||||
handler: function() {
|
||||
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
|
||||
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
|
||||
|
||||
}else {
|
||||
this.ruleForm.incomeLitres = 0
|
||||
}
|
||||
@ -341,6 +343,7 @@
|
||||
|
||||
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
|
||||
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
|
||||
|
||||
}else {
|
||||
this.ruleForm.incomeLitres = 0
|
||||
}
|
||||
|
@ -83,11 +83,11 @@
|
||||
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
type="text"
|
||||
v-model="loginForm.tel"
|
||||
type="number"
|
||||
auto-complete="off"
|
||||
clearable
|
||||
placeholder="账号"
|
||||
placeholder="手机号"
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
<div>
|
||||
<el-input
|
||||
v-model="loginForm.captchaCode"
|
||||
v-model="loginForm.telcode"
|
||||
auto-complete="off"
|
||||
placeholder="请输入验证码"
|
||||
style="width: 90%"
|
||||
@ -122,7 +122,7 @@
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width:100%;line-height: 24px;font-size: 16px;"
|
||||
@click.native.prevent=""
|
||||
@click.native.prevent="posttelcode()"
|
||||
>
|
||||
<span v-if="!loading">立即登录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
@ -152,10 +152,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCodeImg } from "@/api/login";
|
||||
import {getCodeImg, gettelcode, gettellogin,} from "@/api/login";
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||
import BalanceRecharge from "@/views/member/balanceRecharge.vue";
|
||||
import {setToken} from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
@ -173,7 +174,9 @@ export default {
|
||||
codeUrl: "",
|
||||
systemName : process.env.VUE_APP_TITLE,
|
||||
loginForm: {
|
||||
username: "fuint",
|
||||
tel:null,
|
||||
telcode:null,
|
||||
username: "oil_admin",
|
||||
password: "123456",
|
||||
rememberMe: false,
|
||||
captchaCode: "",
|
||||
@ -209,7 +212,14 @@ export default {
|
||||
this.getCookie();
|
||||
},
|
||||
methods: {
|
||||
|
||||
getCode() {
|
||||
|
||||
if(!this.loginForm.tel){
|
||||
this.$message.error("手机号不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
const TIME_COUNT = 60;
|
||||
if (!this.timer) {
|
||||
this.count = TIME_COUNT;
|
||||
@ -224,7 +234,16 @@ export default {
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
let data = {
|
||||
mobile:this.loginForm.tel
|
||||
}
|
||||
gettelcode(data).then(res =>{
|
||||
if(res.code == 200){
|
||||
this.$message.success("操作成功")
|
||||
}else{
|
||||
this.$message.error("操作失败请稍后再试")
|
||||
}
|
||||
})
|
||||
},
|
||||
getCodeimg() {
|
||||
const app = this
|
||||
@ -244,6 +263,20 @@ export default {
|
||||
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() {
|
||||
const app = this;
|
||||
if (app.loading) {
|
||||
|
@ -79,14 +79,10 @@
|
||||
</el-form>
|
||||
<!-- 验证码-->
|
||||
<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-input
|
||||
v-model="loginForm.username"
|
||||
v-model="loginForm.tel"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
clearable
|
||||
@ -101,7 +97,7 @@
|
||||
|
||||
<div>
|
||||
<el-input
|
||||
v-model="loginForm.captchaCode"
|
||||
v-model="loginForm.telcode"
|
||||
auto-complete="off"
|
||||
placeholder="请输入验证码"
|
||||
style="width: 90%"
|
||||
@ -112,7 +108,7 @@
|
||||
</el-input>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
@ -125,7 +121,7 @@
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width:100%;line-height: 24px;font-size: 16px;"
|
||||
@click.native.prevent=""
|
||||
@click.native.prevent="posttelcode()"
|
||||
>
|
||||
<span v-if="!loading">立即登录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
@ -160,6 +156,8 @@ export default {
|
||||
pwdType: 'password',
|
||||
systemName : process.env.VUE_APP_TITLE,
|
||||
loginForm: {
|
||||
tel:null,
|
||||
telcode:null,
|
||||
username: "fuint",
|
||||
password: "123456",
|
||||
rememberMe: false,
|
||||
@ -197,6 +195,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
|
||||
if(!this.loginForm.tel){
|
||||
this.$message.error("手机号不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
const TIME_COUNT = 60;
|
||||
if (!this.timer) {
|
||||
this.count = TIME_COUNT;
|
||||
@ -211,6 +215,29 @@ export default {
|
||||
}
|
||||
}, 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() {
|
||||
const app = this
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 735e4aff6a57f9505915e85313d8f3c1659d6be7
|
Loading…
Reference in New Issue
Block a user