Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui into dev-gl

master
paulGao 2022-06-22 10:20:06 +08:00
commit f4b7068cd6
7 changed files with 254 additions and 139 deletions

View File

@ -11,6 +11,16 @@
<FormItem label="身份证号" prop="idNumber"> <FormItem label="身份证号" prop="idNumber">
<Input v-model="applyForm.idNumber"></Input> <Input v-model="applyForm.idNumber"></Input>
</FormItem> </FormItem>
<FormItem label="银行开户行" prop="settlementBankBranchName">
<Input v-model="applyForm.settlementBankBranchName"></Input>
</FormItem>
<FormItem label="银行开户名" prop="settlementBankAccountName">
<Input v-model="applyForm.settlementBankAccountName"></Input>
</FormItem>
<FormItem label="银行账号" prop="settlementBankAccountNum">
<Input v-model="applyForm.settlementBankAccountNum"></Input>
</FormItem>
<FormItem> <FormItem>
<Button type="primary" :loading="applyLoading" @click="apply"></Button> <Button type="primary" :loading="applyLoading" @click="apply"></Button>
</FormItem> </FormItem>
@ -161,6 +171,7 @@
<script> <script>
import {distribution, applyDistribution, distCash, distCashHistory, getDistGoodsList, selectDistGoods} from '@/api/member.js' import {distribution, applyDistribution, distCash, distCashHistory, getDistGoodsList, selectDistGoods} from '@/api/member.js'
import { IDCard } from '@/plugins/RegExp.js'; import { IDCard } from '@/plugins/RegExp.js';
import {checkBankno} from '@/plugins/Foundation'
import vueQr from 'vue-qr'; import vueQr from 'vue-qr';
export default { export default {
name: 'Distribution', name: 'Distribution',
@ -174,7 +185,41 @@ export default {
idNumber: [ idNumber: [
{required: true, message: '请输入身份证号'}, {required: true, message: '请输入身份证号'},
{pattern: IDCard, message: '请输入正确的身份证号'} {pattern: IDCard, message: '请输入正确的身份证号'}
] ],
settlementBankBranchName: [
{
required: true,
message: "请输入银行开户行",
//
trigger: "blur",
},
],
settlementBankAccountName: [
{
required: true,
message: "请输入银行开户名",
//
trigger: "blur",
},
],
//
settlementBankAccountNum: [
{
required: true,
message: "银行账号不正确",
//
trigger: "blur",
},
{
validator: (rule, value, callback) => {
// truefalse
// this.$u.test.mobile()truefalse
return checkBankno(value);
},
message: "银行账号不正确",
},
],
}, },
tabName: 'goodsChecked', // tab tabName: 'goodsChecked', // tab
result: {}, // result: {}, //

View File

@ -1,132 +1,200 @@
/** /**
* 一些常用的基础方法 * 一些常用的基础方法
* unixToDate 将unix时间戳转换为指定格式 * unixToDate 将unix时间戳转换为指定格式
* dateToUnix 将时间转unix时间戳 * dateToUnix 将时间转unix时间戳
* deepClone 对一个对象进行深拷贝 * deepClone 对一个对象进行深拷贝
* formatPrice 货币格式化 * formatPrice 货币格式化
* secrecyMobile 手机号隐私保护 * secrecyMobile 手机号隐私保护
* randomString 随机生成指定长度的字符串 * randomString 随机生成指定长度的字符串
*/ */
/**
* 将unix时间戳转换为指定格式
* @param unix 时间戳 /**
* @param format 转换格式 * 验证银行卡号
* @returns {*|string} */
*/ export function checkBankno(bankno) {
function unixToDate (unix, format) { var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位与luhm进行比较
if (!unix) return unix var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
let _format = format || 'yyyy-MM-dd hh:mm:ss' var newArr = [];
const d = new Date(unix)
const o = { for (var i = first15Num.length - 1; i > -1; i--) {
'M+': d.getMonth() + 1, //前15或18位倒序存进数组
'd+': d.getDate(), newArr.push(first15Num.substr(i, 1));
'h+': d.getHours(), }
'm+': d.getMinutes(),
's+': d.getSeconds(), var arrJiShu = []; //奇数位*2的积 <9
'q+': Math.floor((d.getMonth() + 3) / 3), var arrJiShu2 = []; //奇数位*2的积 >9
S: d.getMilliseconds() var arrOuShu = []; //偶数位数组
} for (var j = 0; j < newArr.length; j++) {
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length)) if ((j + 1) % 2 == 1) {
for (const k in o) //奇数位
if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : if (parseInt(newArr[j]) * 2 < 9) arrJiShu.push(parseInt(newArr[j]) * 2);
(('00' + o[k]).substr(('' + o[k]).length))) else arrJiShu2.push(parseInt(newArr[j]) * 2);
return _format } //偶数位
} else arrOuShu.push(newArr[j]);
}
/**
* 将时间转unix时间戳 var jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
* @param date var jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
* @returns {number} for (var h = 0; h < arrJiShu2.length; h++) {
*/ jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
function dateToUnix (date) { jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
let newStr = date.replace(/:/g, '-') }
newStr = newStr.replace(/ /g, '-')
const arr = newStr.split('-') var sumJiShu = 0; //奇数位*2 < 9 的数组之和
const datum = new Date(Date.UTC( var sumOuShu = 0; //偶数位数组之和
arr[0], var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
arr[1] - 1, var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
arr[2], var sumTotal = 0;
arr[3] - 8 || -8, for (var m = 0; m < arrJiShu.length; m++) {
arr[4] || 0, sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
arr[5] || 0 }
)) for (var n = 0; n < arrOuShu.length; n++) {
return parseInt(datum.getTime() / 1000) sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
} }
for (var p = 0; p < jishu_child1.length; p++) {
/** sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
* 货币格式化 sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
* @param price }
* @returns {string} //计算总和
*/ sumTotal =
function formatPrice (price) { parseInt(sumJiShu) +
if (typeof price !== 'number') return price parseInt(sumOuShu) +
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',') parseInt(sumJiShuChild1) +
} parseInt(sumJiShuChild2);
//计算Luhm值
/** var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
* 手机号隐私保护 var luhm = 10 - k;
* 隐藏中间四位数字 if (lastNum == luhm) {
* @param mobile return true;
* @returns {*} } else {
*/ return false;
function secrecyMobile (mobile) { }
mobile = String(mobile) }
if (!/\d{11}/.test(mobile)) {
return mobile
}
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
} /**
* 将unix时间戳转换为指定格式
/** * @param unix 时间戳
* 随机生成指定长度的字符串 * @param format 转换格式
* @param length * @returns {*|string}
* @returns {string} */
*/ function unixToDate (unix, format) {
function randomString (length = 32) { if (!unix) return unix
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' let _format = format || 'yyyy-MM-dd hh:mm:ss'
const maxPos = chars.length const d = new Date(unix)
let _string = '' const o = {
for (let i = 0; i < length; i++) { 'M+': d.getMonth() + 1,
_string += chars.charAt(Math.floor(Math.random() * maxPos)) 'd+': d.getDate(),
} 'h+': d.getHours(),
return _string 'm+': d.getMinutes(),
} 's+': d.getSeconds(),
'q+': Math.floor((d.getMonth() + 3) / 3),
/** S: d.getMilliseconds()
* 计算传秒数的倒计时 }
* @param seconds if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
* @returns {{day : *, hours : *, minutes : *, seconds : *}} for (const k in o)
*/ if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) :
(('00' + o[k]).substr(('' + o[k]).length)))
function countTimeDown (seconds) { return _format
const leftTime = (time) => { }
if (time < 10) time = '0' + time
return time + '' /**
} * 将时间转unix时间戳
return { * @param date
day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)), * @returns {number}
hours: leftTime(parseInt(seconds / 60 / 60 % 24, 10)), */
minutes: leftTime(parseInt(seconds / 60 % 60, 10)), function dateToUnix (date) {
seconds: leftTime(parseInt(seconds % 60, 10)) let newStr = date.replace(/:/g, '-')
} newStr = newStr.replace(/ /g, '-')
} const arr = newStr.split('-')
const datum = new Date(Date.UTC(
/** arr[0],
* 计算当前时间到第二天0点的倒计时[] arr[1] - 1,
* @returns {number} arr[2],
*/ arr[3] - 8 || -8,
function theNextDayTime () { arr[4] || 0,
const nowDate = new Date() arr[5] || 0
const time = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate() + 1, 0, 0, 0).getTime() - nowDate.getTime() ))
return parseInt(time / 1000) return parseInt(datum.getTime() / 1000)
} }
export {
unixToDate, /**
dateToUnix, * 货币格式化
formatPrice, * @param price
secrecyMobile, * @returns {string}
randomString, */
countTimeDown, function formatPrice (price) {
theNextDayTime if (typeof price !== 'number') return price
} return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
}
/**
* 手机号隐私保护
* 隐藏中间四位数字
* @param mobile
* @returns {*}
*/
function secrecyMobile (mobile) {
mobile = String(mobile)
if (!/\d{11}/.test(mobile)) {
return mobile
}
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
}
/**
* 随机生成指定长度的字符串
* @param length
* @returns {string}
*/
function randomString (length = 32) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
const maxPos = chars.length
let _string = ''
for (let i = 0; i < length; i++) {
_string += chars.charAt(Math.floor(Math.random() * maxPos))
}
return _string
}
/**
* 计算传秒数的倒计时
* @param seconds
* @returns {{day : *, hours : *, minutes : *, seconds : *}}
*/
function countTimeDown (seconds) {
const leftTime = (time) => {
if (time < 10) time = '0' + time
return time + ''
}
return {
day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)),
hours: leftTime(parseInt(seconds / 60 / 60 % 24, 10)),
minutes: leftTime(parseInt(seconds / 60 % 60, 10)),
seconds: leftTime(parseInt(seconds % 60, 10))
}
}
/**
* 计算当前时间到第二天0点的倒计时[]
* @returns {number}
*/
function theNextDayTime () {
const nowDate = new Date()
const time = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate() + 1, 0, 0, 0).getTime() - nowDate.getTime()
return parseInt(time / 1000)
}
export {
unixToDate,
dateToUnix,
formatPrice,
secrecyMobile,
randomString,
countTimeDown,
theNextDayTime
}

View File

@ -496,7 +496,7 @@ export default {
lastNum.push({ lastNum.push({
date: item.date.substring(5), date: item.date.substring(5),
title: "上周记录", title: "上一周期",
lastNum: item.lastNum || 0, lastNum: item.lastNum || 0,
res: item.lastNum || 0, res: item.lastNum || 0,
}); });

View File

@ -23,6 +23,7 @@
<div class="wap-content-desc"> <div class="wap-content-desc">
<div class="wap-content-desc-title">{{ item.goodsName }}</div> <div class="wap-content-desc-title">{{ item.goodsName }}</div>
<div class="wap-sku">{{ item.goodsUnit }}</div> <div class="wap-sku">{{ item.goodsUnit }}</div>
<div class="wap-sku"><Tag :color="item.salesModel === 'RETAIL' ? 'default' : 'geekblue'">{{item.salesModel === "RETAIL" ? "零售型" : "批发型"}}</Tag></div>
<div class="wap-content-desc-bottom"> <div class="wap-content-desc-bottom">
<div>{{ item.price | unitPrice }}</div> <div>{{ item.price | unitPrice }}</div>
</div> </div>
@ -54,6 +55,7 @@ export default {
categoryPath: "", categoryPath: "",
marketEnable: "UPPER", marketEnable: "UPPER",
authFlag: "PASS", authFlag: "PASS",
sort:"createTime"
}, },
category: [], // category: [], //
goodsData: [], // goodsData: [], //
@ -62,7 +64,7 @@ export default {
}; };
}, },
props: { props: {
selectedWay: { selectedWay: {
type: Array, type: Array,
default: function(){ default: function(){
return new Array() return new Array()

View File

@ -71,7 +71,7 @@
cursor: pointer; cursor: pointer;
display: flex; display: flex;
height: 80px; height: 100px;
padding: 2px; padding: 2px;
overflow: hidden; overflow: hidden;
align-items: center; align-items: center;

View File

@ -24,6 +24,7 @@
<div class="wap-content-desc"> <div class="wap-content-desc">
<div class="wap-content-desc-title">{{ item.goodsName }}</div> <div class="wap-content-desc-title">{{ item.goodsName }}</div>
<div class="wap-sku">{{ item.goodsUnit }}</div> <div class="wap-sku">{{ item.goodsUnit }}</div>
<div class="wap-sku"><Tag :color="item.salesModel === 'RETAIL' ? 'default' : 'geekblue'">{{item.salesModel === "RETAIL" ? "零售型" : "批发型"}}</Tag></div>
<div class="wap-content-desc-bottom"> <div class="wap-content-desc-bottom">
<div>{{ item.price | unitPrice }}</div> <div>{{ item.price | unitPrice }}</div>
</div> </div>
@ -65,6 +66,7 @@ export default {
categoryPath: "", categoryPath: "",
marketEnable: "UPPER", marketEnable: "UPPER",
authFlag: "PASS", authFlag: "PASS",
sort:"createTime"
}, },
category: [], // category: [], //
goodsData: [], // goodsData: [], //
@ -244,9 +246,7 @@ export default {
margin: 10px 7px; margin: 10px 7px;
padding: 6px 0; padding: 6px 0;
} }
// .wap-content-item{
// }
.active { .active {
background: url("../../assets/selected.png") no-repeat; background: url("../../assets/selected.png") no-repeat;
background-position: right; background-position: right;

View File

@ -65,7 +65,7 @@
cursor: pointer; cursor: pointer;
display: flex; display: flex;
height: 80px; height: 100px;
padding: 2px; padding: 2px;
overflow: hidden; overflow: hidden;
align-items: center; align-items: center;