Commit aa72fe22 by 李长胜

Merge branch 'master' of http://192.168.3.233:8090/h5/account

2 parents 8d628282 f855a56e
...@@ -23,17 +23,18 @@ ...@@ -23,17 +23,18 @@
<div class="bread-crumb"></div> <div class="bread-crumb"></div>
</div> </div>
<script> <script>
layui.use(['element', 'request','helper'], function () { layui.use(['element', 'request', 'helper'], function () {
var element = layui.element var element = layui.element
var helper = layui.helper
element.init() element.init()
highlight() highlight()
bindEvents() bindEvents()
// console.log(isAppend()) var href = location.href.split('/')
// var href = location.href.split('/') var isDxternal = isAppend()
// console.log(href) if (isDxternal && href[href.length - 1] != 'login.html') {
// if () { var user = helper.store.get('user')
// var user = helper.store.get('user') $('#curMerchantName').text(user.merchantName)
// } }
}) })
function highlight() { function highlight() {
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">商户类型:</label> <label class="layui-form-label">商户类型:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="merchantType"></div> <div class="layui-form-mid layui-word-aux" id="merchantTypeName"></div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
'accountLevelName', 'accountLevelName',
'merchantName', 'merchantName',
'merchantAbbreviation', 'merchantAbbreviation',
'merchantType', 'merchantTypeName',
'merchantOrgcode', 'merchantOrgcode',
'merchantAddress', 'merchantAddress',
'merchantLegalPerson', 'merchantLegalPerson',
...@@ -323,9 +323,13 @@ ...@@ -323,9 +323,13 @@
} }
request(params, function (res) { request(params, function (res) {
console.log(res, '账户信息') console.log(res, '账户信息')
// businessScopeCustomize
if (res.code == '0') { if (res.code == '0') {
roleData = helper.clone(true, res.data) roleData = helper.clone(true, res.data)
for (var i in basicArr) { for (var i in basicArr) {
if(basicArr[i] == 'businessScopName' && roleData.businessScopeCustomize) {
roleData.businessScopName = roleData.businessScopName ? (roleData.businessScopName + ',' + roleData.businessScopeCustomize) : roleData.businessScopeCustomize
}
$('#' + [basicArr[i]]).text(roleData[basicArr[i]] ? roleData[basicArr[i]] : '') $('#' + [basicArr[i]]).text(roleData[basicArr[i]] ? roleData[basicArr[i]] : '')
} }
callback(roleData.accountTypes) callback(roleData.accountTypes)
......
...@@ -19,18 +19,6 @@ ...@@ -19,18 +19,6 @@
margin: 0 ; margin: 0 ;
} }
/* .merchant .layui-table-cell {
height: auto;
overflow: visible;
text-overflow: inherit;
white-space: normal;
height: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} */
.merchant #searchForm .layui-inline { .merchant #searchForm .layui-inline {
margin-bottom: 5px; margin-bottom: 5px;
} }
...@@ -49,7 +37,6 @@ ...@@ -49,7 +37,6 @@
<body> <body>
<div class="merchant" id="app"> <div class="merchant" id="app">
<main class="bg-white"> <main class="bg-white">
<!-- <div id="tree"></div> -->
<div class="context-block"> <div class="context-block">
<div class="search-block"> <div class="search-block">
<form class="layui-form layui-form-pane" lay-filter="searchFilter" id="searchForm"> <form class="layui-form layui-form-pane" lay-filter="searchFilter" id="searchForm">
...@@ -88,7 +75,7 @@ ...@@ -88,7 +75,7 @@
<option value="1">手机号</option> <option value="1">手机号</option>
</select> </select>
</div> </div>
<div class="layui-input-inline" style="width: 300px;"> <div class="layui-input-inline" style="width: 300px;margin-left: -5px;">
<input class="layui-input" placeholder="请输入" name="merchantLoginAccount"> <input class="layui-input" placeholder="请输入" name="merchantLoginAccount">
</div> </div>
</div> </div>
...@@ -126,20 +113,19 @@ ...@@ -126,20 +113,19 @@
{{# var accountTypes=d.accountTypeNames.split(",")}} {{# var accountTypes=d.accountTypeNames.split(",")}}
{{# }} {{# }}
{{# if((d.accountTypeNames)){ }} {{# if((d.accountTypeNames)){ }}
{{# layui.each(accountTypes,function(index,item){ }} {{# layui.each(accountTypes,function(index,item){ }}
<li><span>{{item}}</span></li> <li><span>{{item}}</span></li>
<!-- <a class="layui-text" >{{d.accountTypeNames}}</a> --> <!-- <a class="layui-text" >{{d.accountTypeNames}}</a> -->
{{# }); }else{ }} {{# }); }else{ }}
<a class="layui-text" >-</a> <a class="layui-text">-</a>
{{# } }} {{# } }}
</ul> </ul>
</script> </script>
<script type="text/html" id="merchantBtns"> <script type="text/html" id="merchantBtns">
<div> <div>
<a class="layui-btn-xs" lay-event="handleDetail">查看</a> <a class="layui-btn-xs" lay-event="handleDetail">查看</a>
{{# if((d.btn.edit)){ }} {{# if((d.btn.edit)){ }}
<a class="layui-btn-xs" lay-event="handleEdit">修改基本信息</a> <a class="layui-btn-xs" lay-event="handleEdit">修改基本信息</a>
{{# } }} {{# } }}
</div> </div>
...@@ -147,7 +133,7 @@ ...@@ -147,7 +133,7 @@
{{# if((d.btn.edit)){ }} {{# if((d.btn.edit)){ }}
<a class="layui-btn-xs" lay-event="handleAuthority">修改权限</a> <a class="layui-btn-xs" lay-event="handleAuthority">修改权限</a>
{{# } }} {{# } }}
{{# if((d.btn.editPeriod)){ }} {{# if((d.btn.editPeriod)){ }}
<a class="layui-btn-xs" lay-event="handleVaildPeriod">修改账户有效期</a> <a class="layui-btn-xs" lay-event="handleVaildPeriod">修改账户有效期</a>
{{# } }} {{# } }}
</div> </div>
...@@ -155,7 +141,7 @@ ...@@ -155,7 +141,7 @@
{{# if((d.btn.createStaff)){ }} {{# if((d.btn.createStaff)){ }}
<a class="layui-btn-xs" lay-event="handleAddStaff">创建员工</a> <a class="layui-btn-xs" lay-event="handleAddStaff">创建员工</a>
{{# } }} {{# } }}
{{# if((d.btn.createSubMerchant)){ }} {{# if((d.btn.createSubMerchant)){ }}
<a class="layui-btn-xs" lay-event="handleAddMerchant">创建子商户/门店</a> <a class="layui-btn-xs" lay-event="handleAddMerchant">创建子商户/门店</a>
{{# } }} {{# } }}
</div> </div>
...@@ -189,11 +175,10 @@ ...@@ -189,11 +175,10 @@
layout: ['count', 'page', 'skip'], layout: ['count', 'page', 'skip'],
jump: function (obj, first) { jump: function (obj, first) {
//obj包含了当前分页的所有参数,比如: //obj包含了当前分页的所有参数,比如:
console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。 // console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
console.log(obj.limit); //得到每页显示的条数 // console.log(obj.limit); //得到每页显示的条数
page.pageNum = obj.curr page.pageNum = obj.curr
page.pageSize = obj.limit page.pageSize = obj.limit
// getTabelList()
//首次不执行 //首次不执行
if (!first) { if (!first) {
//do something //do something
...@@ -205,10 +190,7 @@ ...@@ -205,10 +190,7 @@
var merchantTable = table.render({ var merchantTable = table.render({
elem: '#merchantTable', elem: '#merchantTable',
page: false, page: false,
skin:'line', skin: 'line',
// done: function (res, curr, count) {
// console.log(res)
// },
cols: [ cols: [
[{ [{
field: 'index', field: 'index',
...@@ -277,7 +259,7 @@ ...@@ -277,7 +259,7 @@
// console.log(obj) // console.log(obj)
var eventName = obj.event var eventName = obj.event
var row = obj.data var row = obj.data
console.log(row) // console.log(row)
switch (eventName) { switch (eventName) {
// 查看 // 查看
case 'handleDetail': case 'handleDetail':
...@@ -423,7 +405,7 @@ ...@@ -423,7 +405,7 @@
item.btn.createSubMerchant = true item.btn.createSubMerchant = true
} }
} else { // 下级商户 } else { // 下级商户
console.log(item) // console.log(item)
item.btn.edit = true item.btn.edit = true
item.btn.editPeriod = true item.btn.editPeriod = true
// 直属门店 // 直属门店
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-07-15 15:46:53 * @Date: 2021-07-15 15:46:53
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-08-09 22:15:08 * @LastEditTime: 2021-08-11 11:46:34
* @FilePath: \account\js\load.js * @FilePath: \account\js\load.js
*/ */
;(function load() { ;(function load() {
...@@ -81,6 +81,7 @@ function loadConfig() { ...@@ -81,6 +81,7 @@ function loadConfig() {
}) })
} }
function goLogin() { function goLogin() {
if(!isAppend()) return
layui.use(['store'], function () { layui.use(['store'], function () {
layui.store.remove('external') layui.store.remove('external')
layui.store.remove('token') layui.store.remove('token')
......
layui.define(['store'], function (exports) {
var validator = {
/* 手机号码格式校验正则 */
PHONEREG: /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/,
/* 同时包含字母和数字 */
ISNUMANDLETTERS: /^[a-zA-Z0-9]+$/,
/* 特殊字符正则 */
SPECIALLETTER: new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"),
/* 邮箱地址格式正则 */
// EMAILREG:/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/,
EMAILREG: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
/* 判断是否为中文 */
ISCHINESE: /^[\u0391-\uFFE5]+$/,
/* 判断是否为英文字母 */
ISENGLISH: /^[a-zA-Z]+$/,
/* 是否包含空格 */
ISHAVENULL: /^[^\s]*$/,
/* 保留两位小数 */
TWODECIMAL: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
/* 判断是否为正整数 */
ISDECIMAL: /^[0-9]*$/,
/**
* 账号管理-手机号码校验
*/
checkPhoneNumber: function (str) {
return validator.PHONEREG.test(str)
},
// 判断是否含有数字或字母
checkNumOrLetters: function (str) {
return validator.ISNUMANDLETTERS.test(str)
},
// 身份证验证
// checkIdCard: function (code) {
// var city = {
// 11: '北京',
// 12: '天津',
// 13: '河北',
// 14: '山西',
// 15: '内蒙古',
// 21: '辽宁',
// 22: '吉林',
// 23: '黑龙江',
// 31: '上海',
// 32: '江苏',
// 33: '浙江',
// 34: '安徽',
// 35: '福建',
// 36: '江西',
// 37: '山东',
// 41: '河南',
// 42: '湖北',
// 43: '湖南',
// 44: '广东',
// 45: '广西',
// 46: '海南',
// 50: '重庆',
// 51: '四川',
// 52: '贵州',
// 53: '云南',
// 54: '西藏',
// 61: '陕西',
// 62: '甘肃',
// 63: '青海',
// 64: '宁夏',
// 65: '新疆',
// 71: '台湾',
// 81: '香港',
// 82: '澳门',
// 91: '国外 '
// }
// // var tip = ''
// var pass = true
// // 身份证位数为15或18位
// // if (![15, 18].includes(code.length)) {
// if ((code.length != 15) || (code.length != 18)) {
// pass = false
// } else if (!code || (code.length === 18 && !/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code))) {
// // tip = '身份证号格式错误'
// pass = false
// } else if (code.length === 15 && !/^\d{6}\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}$/i.test(code)) {
// pass = false
// } else if (!city[code.substr(0, 2)]) {
// // tip = '地址编码错误'
// pass = false
// } else {
// // 18位身份证需要验证最后一位校验位
// if (code.length === 18) {
// code = code.split('')
// // ∑(ai×Wi)(mod 11)
// // 加权因子
// var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
// // 校验位
// var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
// var sum = 0
// var ai = 0
// var wi = 0
// for (var i = 0; i < 17; i++) {
// ai = code[i]
// wi = factor[i]
// sum += ai * wi
// }
// // var last = parity[sum % 11]
// if (parity[sum % 11] != code[17]) {
// // tip = '校验位错误'
// pass = false
// }
// }
// }
// // if (!pass) alert(tip)
// return pass
// }
}
exports('validator', validator)
})
\ No newline at end of file \ No newline at end of file
...@@ -65,22 +65,15 @@ ...@@ -65,22 +65,15 @@
var helper = layui.helper var helper = layui.helper
//监听提交 //监听提交
form.on('submit(formLogin)', function (data) { form.on('submit(formLogin)', function (data) {
var params = helper.clone(false, { method: 'org.ore.api.example.login' }, data.field) var params = helper.clone(false, {
method: 'org.ore.api.example.login'
}, data.field)
request(params, function (result) { request(params, function (result) {
if (result.code == '0') { if (result.code == '0') {
var sessionId = result.data.sessionId var sessionId = result.data.sessionId
helper.store.set('token', sessionId) helper.store.set('token', sessionId)
helper.store.set('user', result.data) helper.store.set('user', result.data)
go('merchant', 'index') go('merchant', 'index')
// function() {
console.log(isAppend())
if (isAppend()) {
console.log('_------')
var user = helper.store.get('user')
console.log(user)
document.getElementById('curMerchantName').innerHTML = user.merchantName || "";
}
// }
} }
}) })
return false return false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!