初始化仓库

This commit is contained in:
tao
2025-12-18 14:11:48 +08:00
parent e96f277a68
commit 54ec472bd4
1107 changed files with 158756 additions and 0 deletions

View File

@@ -0,0 +1,125 @@
<template>
<uni-easyinput v-model="inputNumber" placeholder="请输入数量" @change="change" :disabled="disabled" type="number"/>
</template>
<script>
import {
listUnit,
getUnit,
delUnit,
addUnit,
updateUnit,
listUnitConvertible,
convertBySecondUnitOrNum,
} from "@/api/basic/unit";
export default {
name: "secondNumberChangeToConvertNew",
props: {
materialCode: String,
number: Number,
unitId: Number,
secondNumber: Number,
secondUnitId: Number,
disabled: Boolean,
},
watch: {
// materialCode: {
// handler(newVal) {
// this.secondNumberChange();
// },
// },
secondNumber: {
handler(newVal, oldVal) {
console.log('新的secondNumber',Number(newVal));
// console.log('this.inputNumber',this.inputNumber);
// 去重,防止重复请求
if (Number(newVal) != this.inputNumber) {
this.inputNumber = Number(newVal);
if (this.inputNumber == null || this.inputNumber == "") {
this.inputNumber = this.number;
this.$emit("update:secondNumber", Number(this.inputNumber));
}
this.secondNumberChange();
}
},
immediate: true,
},
},
data() {
return {
unitOptions: [],
inputNumber: null,
};
},
methods: {
change(data) {
console.log("change",data);
this.onIuputChange();
// this.$emit('change', data);
},
onIuputChange() {
// setTimeout(() => {
// 需要延迟执行的代码
// console.log("111",this.number);
this.$emit("update:secondNumber", Number(this.inputNumber));
this.secondNumber = this.inputNumber;
this.$nextTick(()=>{
this.$emit("change", Number(this.inputNumber));
})
this.secondNumberChange();
// }, 200); // 0.2秒延迟
},
/**第二数量(数量改变)
* 要求基本单位和数量不为空
* */
secondNumberChange() {
//设置父组件的第一数量
// console.log(
// "convertParams",
// this.materialCode,
// this.inputNumber,
// this.unitId,
// this.secondUnitId
// );
console.log("this.secondNumber",this.secondNumber);
console.log("this.inputNumber",this.inputNumber)
// console.log("this.inputNumber",this.$parent)
// this.inputNumber=this.secondNumber
if (this.inputNumber == null || this.inputNumber == "") {
this.$emit("update:number", 0);
}
if (this.unitId == null || this.unitId == "") {
this.$emit("update:number", this.inputNumber);
} else if (
this.inputNumber &&
this.materialCode &&
this.materialCode != "" &&
this.unitId &&
this.secondUnitId
) {
// console.log(this.inputNumber)
let params = {
materialCode: this.materialCode,
number: null,
unitId: this.unitId,
secondUnitId: this.secondUnitId,
secondNumber: this.inputNumber,
};
// console.log(params)
convertBySecondUnitOrNum(params).then((response) => {
// console.log(response.data.number)
this.$emit("update:number", response.data.number);
});
} else { //其它所有异常情况,都将第二数量同步传给第一数量
this.$emit("update:number", this.inputNumber);
}
},
},
};
</script>
<style>
</style>

View File

@@ -0,0 +1,121 @@
<template>
<uni-easyinput v-model="inputNumber" placeholder="请输入数量" @change="change" :disabled="disabled" type="number" @input="input"/>
</template>
<script>
import {
listUnit,
getUnit,
delUnit,
addUnit,
updateUnit,
listUnitConvertible,
convertBySecondUnitOrNum,
} from "@/api/basic/unit";
export default {
name: "secondNumberChangeToConvert",
props: {
materialCode: String,
number: Number,
unitId: Number,
secondNumber: Number,
secondUnitId: Number,
disabled: Boolean,
},
watch: {
// materialCode: {
// handler(newVal) {
// this.secondNumberChange();
// },
// },
secondNumber: {
handler(newVal) {
console.log('new',newVal);
// 去重,防止重复请求
if (Number(newVal) != this.inputNumber) {
this.inputNumber = Number(newVal);
if (this.inputNumber == null || this.inputNumber == "") {
this.inputNumber = this.number;
this.$emit("update:secondNumber", Number(this.inputNumber));
}
this.secondNumberChange();
}
},
immediate: true,
},
},
data() {
return {
unitOptions: [],
inputNumber: null,
};
},
methods: {
input(data){
console.log(data)
this.$emit('input', data);
},
change(data) {
console.log(data)
this.$emit('change', data);
this.onIuputChange()
},
onIuputChange() {
// setTimeout(() => {
// 需要延迟执行的代码
this.$emit("update:secondNumber", Number(this.inputNumber));
this.$emit("change", Number(this.inputNumber));
this.secondNumberChange();
// }, 200); // 0.2秒延迟
},
/**第二数量(数量改变)
* 要求基本单位和数量不为空
* */
secondNumberChange() {
//设置父组件的第一数量
// console.log(
// "convertParams",
// this.materialCode,
// this.inputNumber,
// this.unitId,
// this.secondUnitId
// );
console.log(this.inputNumber)
// console.log('this.inputNumber',this.inputNumber)
if (this.inputNumber == null || this.inputNumber == "") {
this.$emit("update:number", 0);
}
if (this.unitId == null || this.unitId == "") {
this.$emit("update:number", this.inputNumber);
} else if (
this.inputNumber &&
this.materialCode &&
this.materialCode != "" &&
this.unitId &&
this.secondUnitId
) {
console.log(this.inputNumber)
let params = {
materialCode: this.materialCode,
number: null,
unitId: this.unitId,
secondUnitId: this.secondUnitId,
secondNumber: this.inputNumber,
};
console.log(params)
convertBySecondUnitOrNum(params).then((response) => {
console.log(response.data.number)
this.$emit("update:number", response.data.number);
});
} else { //其它所有异常情况,都将第二数量同步传给第一数量
this.$emit("update:number", this.inputNumber);
}
},
},
};
</script>
<style>
</style>

View File

@@ -0,0 +1,125 @@
<template>
<view>
<view v-if="copyContent.length > 0" class="ranking">
<view class="ranking-item" v-for="(content,index) in copyContent" :key="index" :style="{padding:progressPadding+'rpx'}">
<view class="name">{{content.name}}</view>
<view class="progress" >
<text :style="{background:content.background,width:content.width + '%',height:progressWidth+'rpx'}"></text>
</view>
<view class="num">{{content.num}}</view>
</view>
</view>
</view>
</template>
<script>
export default{
name:'ranking-list',
props:{
content:{
type: Array,
default() {
return []
}
},
isPC:{
type:Boolean,
default:false
},
isRank:{
type:Boolean,
default:false
}
},
data(){
return{
progressWidth:24,
progressPadding:10,
maxNumber:0,
culCount:0,
copyContent:[]
}
},
watch:{
content(newV){
this.init()
}
},
methods:{
init(){
this.copyContent = this.deepClone(this.content)
if(this.copyContent && this.copyContent.length >0){
if(this.isRank){
this.copyContent = this.copyContent.sort((a,b) => b.num - a.num);
this.maxNumber = this.copyContent[0].num;
}else{
this.maxNumber = Math.max.apply(Math,this.copyContent.map(item => { return item.num }));
}
this.copyContent.map((item,index) =>{
item.width = this.computeWidth(this.maxNumber,item.num);
});
}
},
computeWidth(max,current){
let num = (current / max) * 100;
return num.toFixed(2);
},
deepClone(obj) {
var cloneObj = new obj.constructor()
if(obj === null) return obj
if(obj instanceof Date) return new Date(obj)
if(obj instanceof RegExp) return new RegExp(obj)
if (typeof obj !== 'object') return obj
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
cloneObj[i] = this.deepClone(obj[i])
}
}
return cloneObj
}
},
mounted() {
if(this.isPC){
this.progressWidth = 40;
this.progressPadding = 30;
}
this.init();
}
}
</script>
<style scoped lang="scss">
.ranking-item{
display: flex;
margin-bottom: 13rpx;
align-content: center;
height: 28rpx;
.name{
padding-right: 10rpx;
color: #868688;
font-size: 20rpx;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.progress{
flex:5;
text-align: left;
padding-right: 10rpx;
text{
display: inline-block;
border-radius: 30rpx;
vertical-align:top;
}
}
.num{
font-size: 26rpx;
color: #3EB2F5;
flex: 1;
}
}
</style>

View File

@@ -0,0 +1,433 @@
<template>
<view class="uni-select-lay" :style="{'z-index':zindex}">
<input type="text" :name="name" v-model="value" class="uni-select-input">
<view class="uni-select-lay-select" :class="{'active':active}">
<!-- 禁用mask -->
<view class="uni-disabled" v-if="disabled"></view>
<!-- 禁用mask -->
<!-- 清空 -->
<view class="uni-select-lay-input-close" v-if="changevalue!=''&&this.active">
<text @click.stop="removevalue"></text>
</view>
<!-- 清空 -->
<input type="text" class="uni-select-lay-input" :class="{active:changevalue!=''&&changevalue!=placeholder}"
v-model="changevalue" :disabled="disabled" :placeholder="placeholder" @focus="unifocus"
@input="intchange" @blur="uniblur">
<view class="uni-select-lay-icon" :class="{disabled:disabled}" @click.stop="select"><text></text></view>
</view>
<scroll-view class="uni-select-lay-options" :scroll-y="true" v-show="active" @scroll="selectmove"
@touchstart="movetouch">
<template v-if="!changes">
<view class="uni-select-lay-item" v-if="showplaceholder" :class="{active:value==''}"
@click.stop="selectitem(-1,null)">
{{placeholder}}
</view>
<view class="uni-select-lay-item" :class="{active:value==item[svalue]}" v-for="(item,index) in options"
:key="index" @click.stop="selectitem(index,item)">{{item[slabel]}}</view>
</template>
<!-- 搜索 -->
<template v-else>
<template v-if="vlist.length>0">
<view class="uni-select-lay-item" :class="{active:value==item[svalue]}"
v-for="(item,index) in vlist" :key="index" @click.stop="selectitem(index,item)">{{item[slabel]}}
</view>
</template>
<template v-else>
<view class="nosearch">{{changesValue}}</view>
</template>
</template>
</scroll-view>
</view>
</template>
<script>
export default {
name: "select-lay",
props: {
disabled: {
type: Boolean,
default: false
},
zindex: {
type: Number,
default: 999
},
options: {
type: Array,
default () {
return []
}
},
name: {
type: String,
default: ''
},
value: {
type: String | Number,
default: ''
},
placeholder: {
type: String,
default: '请选择'
},
showplaceholder: {
type: Boolean,
default: true
},
slabel: {
type: String,
default: 'label'
},
svalue: {
type: String,
default: 'value'
}
},
data() {
return {
active: false, //组件是否激活,
isfocus: false, //是否有焦点
isremove: false, //是否是因为点击清空才导致的失去焦点
ismove: false, //是否是因为移动才失去焦点
changevalue: "", //搜索框同步
oldvalue: "", //数据回滚
changes: false, //正在搜索
changesValue: "",
vlist: [], //搜索框查询的列表
settimer: null //value改变定时器
};
},
mounted() {
this.itemcheck();
},
watch: {
//value改变
value() {
this.itemcheck();
},
//初始化数组
options() {
// 此处判断是否有初始value,存在则判断显示文字
this.itemcheck();
}
},
methods: {
//判断数组跟当前active值
itemcheck() {
// 此处判断是否有初始value,存在则判断显示文字
if (this.value != "") {
// 展示plachhoder
//判断数组
if (this.options.length > 0) {
this.options.forEach(item => {
if (this.value == item[this.svalue]) {
this.oldvalue = this.changevalue = item[this.slabel];
return;
}
})
}
} else {
this.oldvalue = this.changevalue = "";
}
},
//点击组件
select() {
if (this.disabled) return;
this.active = !this.active;
if (this.active) {
this.changes = false;
} else {
this.changevalue = this.oldvalue;
}
},
// 获得焦点
unifocus() {
if (this.disabled) return;
this.active = true;
this.changes = false;
this.isfocus = true;
},
// 失去焦点
uniblur() {
this.isfocus = false;
// bug 点击组件列会先触发失去焦点,此时组件列事件不执行
setTimeout(() => {
if (this.isremove || this.ismove) {
this.isremove = false;
this.ismove = false;
} else {
this.changevalue = this.oldvalue;
this.isremove = false;
this.active = false;
}
}, 153)
},
movetouch() {
setTimeout(()=>{
if(this.isfocus){
this.ismove=false;
return;
}
if (!this.ismove) this.ismove = true;
},100)
// this.changes = false;
},
selectmove() {
setTimeout(()=>{
if(this.isfocus){
this.ismove=false;
return;
}
if (!this.ismove) this.ismove = true;
},100)
// this.changes = false;
},
//移除数据
removevalue() {
this.isremove = true;
this.changes = false;
this.changevalue = "";
},
//value 改变
intchange() {
if (this.changevalue == '') {
this.changes = false;
return;
};
if (this.oldvalue == this.changevalue) {
return;
}
this.vlist = [];
this.changes = true;
this.changesValue = "正在搜索...";
if (this.settimer) {
clearTimeout(this.settimer)
}
this.settimer = setTimeout(() => {
this.vlist = this.options.filter(item => {
return item[this.slabel].includes(this.changevalue)
});
if (this.vlist.length === 0) {
this.changesValue = "暂无匹配内容!";
}
}, 600)
},
//点击组件列
selectitem(index, item) {
this.changevalue = this.oldvalue;
this.active = false;
this.$emit("selectitem", index, item)
}
}
}
</script>
<style lang="scss" scoped>
.uni-select-lay {
background-color: white;
position: relative;
z-index: 999;
.uni-select-input {
opacity: 0;
position: absolute;
z-index: -111;
}
// select部分
.uni-select-lay-select {
user-select: none;
position: relative;
z-index: 3;
height: 36px;
padding: 0 30px 0 10px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid rgb(229, 229, 229);
display: flex;
align-items: center;
font-size: 14px;
color: #999;
.uni-disabled {
position: absolute;
left: 0;
width: 100%;
height: 100%;
z-index: 19;
cursor: no-drop;
background: rgba(255, 255, 255, .5);
}
// input 框的清除按钮
.uni-select-lay-input-close {
position: absolute;
right: 35px;
top: 0;
height: 100%;
width: 15px;
display: flex;
align-items: center;
justify-content: center;
z-index: 3;
cursor: pointer;
text {
position: relative;
background: #fff;
width: 13px;
height: 13px;
border-radius: 50%;
border: 1px solid #bbb;
&::before,
&::after {
content: "";
position: absolute;
left: 20%;
top: 50%;
height: 1px;
width: 60%;
transform: rotate(45deg);
background-color: #bbb;
}
&::after {
transform: rotate(-45deg);
}
}
}
.uni-select-lay-input {
font-size: 14px;
color: #999;
display: block;
width: 98%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 30px;
box-sizing: border-box;
&.active {
color: #333
}
}
.uni-select-lay-icon {
cursor: pointer;
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 30px;
display: flex;
align-items: center;
justify-content: center;
&::before {
content: "";
width: 1px;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: #e5e5e5;
}
text {
display: block;
width: 0;
height: 0;
border-width: 12rpx 12rpx 0;
border-style: solid;
border-color: #bbb transparent transparent;
transition: .3s;
}
&.disabled {
cursor: no-drop;
text {
width: 20rpx;
height: 20rpx;
border: 2px solid #ff0000;
border-radius: 50%;
transition: .3s;
position: relative;
z-index: 999;
&::after {
content: "";
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 2px;
margin-top: -1px;
background-color: #ff0000;
transform: rotate(45deg);
}
}
}
}
&.active .uni-select-lay-icon {
text {
transform: rotate(180deg);
}
}
}
// options部分
.uni-select-lay-options {
user-select: none;
position: absolute;
top: calc(100% + 5px);
left: 0;
width: 100%;
height: 500rpx;
// overflow-y: auto;
border-radius: 4px;
border: 1px solid rgb(229, 229, 229);
background: #fff;
padding: 5px 0;
box-sizing: border-box;
z-index: 9;
.uni-select-lay-item {
padding: 0 10px;
box-sizing: border-box;
cursor: pointer;
line-height: 2.5;
transition: .3s;
font-size: 14px;
&.active {
background: #007AFF;
color: #fff;
&:hover {
background: #007AFF;
color: #fff;
}
}
&:hover {
background-color: #f5f5f5;
}
}
.nosearch {
font-size: 16px;
line-height: 3;
text-align: center;
color: #666;
}
}
}
</style>

View File

@@ -0,0 +1,122 @@
<template>
<uni-data-select v-model="secondUnitId" :localdata="unitOptions" @change="secondUnitChange" style="z-index: 100;">
</uni-data-select>
</template>
<script>
import {
listUnitConvertible,
convertBySecondUnitOrNum,
} from "@/api/basic/unit";
export default {
name: "selectUnitConvertible",
props: {
materialCode: {
type: String,
default: "",
},
// secondUnitId
value: {
type: Number,
default: null,
},
secondNumber: {
type: Number,
default: null,
},
number: {
type: Number,
default: null,
},
unitId: {
type: Number,
default: null,
},
disabled: Boolean,
},
watch: {
materialCode: {
handler(newVal, oldVal) {
console.log(newVal)
this.selectConvertibleUnitList();
},
immediate: true,
},
value: {
handler(newVal) {
console.log(newVal)
this.secondUnitId = newVal;
this.selectConvertibleUnitList();
},
immediate: true,
},
},
created() {
this.selectConvertibleUnitList();
},
data() {
return {
secondUnitId: null,
unitOptions: [],
};
},
methods: {
//单位下拉框点击事件
selectConvertibleUnitList() {
let query = {
materialCode: this.materialCode,
id: this.value,
};
listUnitConvertible(query).then((response) => {
this.unitOptions = response.rows.map(item => {
let obj = {
text: item.unitCode + ":" + item.unitName,
value: item.id
}
return obj
});
});
},
/**第二单位(显示单位改变)
* 要求基本单位和数量不为空
* */
secondUnitChange(e) {
console.log(e, this.secondUnitId)
// 给单位赋值
this.$emit("input", e);
// console.log(
// "unitParams",
// this.materialCode,
// this.number,
// this.unitId,
// this.secondNumber,
// this.secondUnitId
// );
if (
this.number &&
this.unitId &&
this.materialCode &&
this.materialCode != "" &&
e
) {
let params = {
materialCode: this.materialCode,
number: this.number,
unitId: this.unitId,
secondUnitId: e,
secondNumber: null,
};
// 修改第二数量
convertBySecondUnitOrNum(params).then((response) => {
this.$emit("update:secondNumber", response.data.secondNumber);
});
}
},
},
};
</script>
<style>
</style>

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -0,0 +1,75 @@
<template>
<uni-card class="empInfo" margin="0" padding="12px" :border="false">
<uni-row class="name-row">
<span class="empName">{{ empName }}</span>
<!-- <uni-tag :circle="true" v-if="eqpName !== '/' || stationTitle !== '/'" text="工作中" type="success" class="status-tag" /> -->
</uni-row>
<uni-row>
<span class="deptName">{{ deptName }}</span>
</uni-row>
<uni-icons class="emp-icon" type="person" size="100" />
</uni-card>
</template>
<script>
export default {
name:"t-emp",
data() {
return {
empName: this.$store.state.employee.empName,
empCode: this.$store.state.employee.empCode,
deptName: this.$store.state.employee.deptName
};
},
}
</script>
<style lang="scss" scoped>
.empInfo {
width: 100%;
flex: 0 0 auto;
background: linear-gradient(135deg, #1e5799 0%, #207cca 100%);
border-radius: 10px !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
.name-row {
display: flex;
align-items: center;
margin-bottom: 8px;
}
.empName {
color: #fff;
font-size: 28px !important;
font-weight: 600;
line-height: 1.4;
margin-right: 12px;
}
.deptName {
color: rgba(255, 255, 255, 0.9);
font-size: 20px;
line-height: 1.4;
}
.status-tag {
padding: 2px 10px;
background-color: #e1f3d8;
color: #78c54a;
border-radius: 20px !important;
border: none;
font-size: 16px;
font-weight: 600;
height: 28px;
line-height: 28px;
vertical-align: middle;
}
.emp-icon {
position: absolute;
right: -20px;
bottom: 20px;
color: #233979 !important;
}
}
</style>

View File

@@ -0,0 +1,60 @@
<template>
<view class="t-gap" :class="customClass" :style="rootStyle"></view>
</template>
<script>
export default {
name: 't-gap',
options: {
addGlobalClass: true,
virtualHost: true,
styleIsolation: 'shared'
},
props: {
/**
* 自定义根节点样式
*/
customStyle: {
type: String,
default: ''
},
/**
* 自定义根节点样式类
*/
customClass: {
type: String,
default: ''
},
/**
* 背景颜色
*/
bgColor: {
type: String,
default: 'transparent'
},
/**
* 高度
*/
height: {
type: [Number, String],
default: 15
}
},
computed: {
rootStyle() {
const rootStyle = [];
if (this.bgColor) {
rootStyle.push(`background-color: ${this.bgColor};`);
}
if (this.height) {
const height = typeof this.height === 'number' ? `${this.height}px` : this.height;
rootStyle.push(`height: ${height};`);
}
return rootStyle.join(' ');
}
}
}
</script>

View File

@@ -0,0 +1,112 @@
<template>
<uni-card class="saleInfo" margin="0" padding="12px" :title="saleInfo.saleOutTaskCode || ' '">
<view class="card-list">
<view class="card-item">
<span class="card-item__label">客户编码</span>
<span class="card-item__value">{{ saleInfo.customerName || '-' }}</span>
</view>
<view class="card-item">
<span class="card-item__label">下级客户</span>
<span class="card-item__value">{{ saleInfo.dynamicField1.nextLevelCus || '-' }}</span>
</view>
</view>
<view class="card-data">
<view class="card-data-item">
<span class="card-data-item__label">扫描数量</span>
<span class="card-data-item__value finish">
{{ saleInfo.scanNumber || '-' }}
</span>
</view>
<view class="card-data-item">
<span class="card-data-item__label">总数量</span>
<span class="card-data-item__value">
{{ saleInfo.allNumber || '-' }}
</span>
</view>
</view>
</uni-card>
</template>
<script>
export default {
name: "t-sale-info",
props: {
saleInfo: {
type: Object,
default: {}
},
},
data() {
return {
};
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.saleInfo {
margin: 0 0 10px !important;
padding: 0 !important;
box-shadow: none !important;
border-radius: 11px;
.card-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 4px;
.card-item {
display: flex;
flex-direction: column;
align-items: center;
.card-item__label {
font-size: 13px;
}
.card-item__value {
font-weight: bold;
font-size: 15px;
color: #333;
}
}
}
.card-data {
display: flex;
margin-top: 4px;
background-color: #f1f1f1;
border-radius: 4px;
padding: 6px 0;
.card-data-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.card-data-item__label {
font-size: 13px;
}
.card-data-item__value {
font-weight: bold;
font-size: 15px;
color: #333;
&.finish {
color: #059669;
}
}
}
}
.actions {
padding: 0 10px;
}
}
</style>

View File

@@ -0,0 +1,231 @@
<template>
<view class="text_block">
<template v-for="(item,index) in content">
<view v-if="item.kind == 1" :key="index"
:style="{backgroundImage:'linear-gradient(to top right,'+item.background[0]+','+item.background[1]+')'}"
:class="[(index+1)%3==0 ? '':'marginRight','kind','kind_one','breathe-blue']">
<view class="view_100" :style="{fontSize:item.content[0].size,color:item.content[0].colorvalue}">
{{item.content[0].value}}
</view>
<view class="view_100" :style="{fontSize:item.content[1].size,color:item.content[1].colortext}">
{{item.content[1].text}}
</view>
</view>
<view v-else-if="item.kind == 2" :key="index"
:class="[(index+1)%3==0 ? '':'marginRight','kind','kind_two','breathe-blue']"
:style="{backgroundImage:'linear-gradient(to top right,'+item.background[0]+','+item.background+')' ,marginRight:(index+1)%3==0?'0rpx':'40rpx'}">
<view v-for="(content,i) in item.content" :key="i" class="two_1">
<text :style="{fontSize:content.size,color:content.colortext}">{{content.text}}:</text>
<text :style="{fontSize:content.size,color:content.colorvalue}">{{content.value}}</text>
</view>
</view>
<view v-else-if="item.kind == 3" :key="index" class="kind kind_three breathe-blue"
:style="{backgroundImage:'linear-gradient(to top right,'+item.background[0]+','+item.background+')'}">
<view class="view_100" :style="{fontSize:item.content[0].size,color:item.content[0].colorvalue}">
{{item.content[0].value}}
</view>
<view class="view_100" :style="{fontSize:item.content[1].size,color:item.content[1].colortext}">
{{item.content[1].text}}
</view>
<view class="three_3 view_100">
<view v-for="(j,i) in 2" :key="i">
<text
:style="{fontSize:item.content[i+2].size,color:item.content[i+2].colortext}">{{item.content[i+2].text}}:</text>
<text
:style="{fontSize:item.content[i+2].size,color:item.content[i+2].colorvalue}">{{item.content[i+2].value}}</text>
</view>
</view>
</view>
<view v-else-if="item.kind == 4" :key="index"
:class="[(index+1)%4==0 ? '':'marginRight','kind','kind_four','breathe-blue']"
:style="{backgroundImage:'linear-gradient(to top right,'+item.background[0]+','+item.background[1]+')',marginRight:(index+1)%4==0?'0rpx':'40px'}">
<view class="view_100" :style="{fontSize:item.content[0].size,color:item.content[0].colortext}">
{{item.content[0].text}}
</view>
<view class="view_100" :style="{fontSize:item.content[1].size,color:item.content[1].colorvalue}">
{{item.content[1].value}}
</view>
<!-- <view class="four_3" :style="{fontSize:item.content[2].size,color:item.content[2].colorvalue}">
<text :style="{fontSize:item.content[3].size,color:item.content[3].colorvalue}">{{item.content[2].text}}</text>
<li v-if="item.content[3].text == 'up'" class="iconfont icon-up icon" :style="{color:item.content[3].colortext}"></li>
<li v-else class="iconfont icon-down icon" :style="{color:item.content[3].colortext}"></li>
<text :style="{fontSize:item.content[3].size,color:item.content[3].colorvalue}">{{item.content[3].value}}</text>
</view> -->
</view>
<view v-else-if="item.kind == 5" :key="index"
:class="[(index+1)%3==0 ? '':'marginRight','kind','kind_five','breathe-red']"
:style="{backgroundImage:'linear-gradient(to top right,'+item.background[0]+','+item.background[1]+')',marginRight:(index+1)%3==0?'0rpx':'40rpx'}">
<view class="view_100" :style="{fontSize:item.content[0].size,color:item.content[0].colortext}">
{{item.content[0].text}}
</view>
<view class="view_100" :style="{fontSize:item.content[1].size,color:item.content[1].colorvalue}">
{{item.content[1].value}}
</view>
<view class="five_3 view_100">
<view v-for="(j,i) in 2" :key="i">
<text
:style="{fontSize:item.content[j+2].size,color:item.content[j+2].colortext}">{{item.content[j+2].text}}</text>
<text
:style="{fontSize:item.content[j+2].size,color:item.content[j+2].colorvalue}">{{item.content[j+2].value}}</text>
</view>
</view>
<view class="five_4">
<text
:style="{fontSize:item.content[4].size,color:item.content[4].colortext}">{{item.content[4].text}}</text>
<text
:style="{fontSize:item.content[4].size,color:item.content[4].colorvalue}">{{item.content[4].value}}</text>
</view>
</view>
</template>
</view>
</template>
<script>
export default {
props: {
content: {
type: Array,
default: []
},
},
data() {
return {}
},
methods: {
},
mounted() {
uni.onWindowResize((res) => {
console.log('变化后的窗口宽度=' + res.size.windowWidth)
console.log('变化后的窗口高度=' + res.size.windowHeight)
})
}
}
</script>
<style lang="scss">
.text_block {
display: flex;
width: 100%;
flex-wrap: wrap;
.marginRight {
margin-right: 36rpx !important;
}
.view_100 {
width: 100%;
}
.CPT_DYBG {
overflow: hidden;
position: relative;
}
.kind {
width: 40%;
padding: 10rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: center;
flex-wrap: wrap;
border-radius: 16rpx;
margin-left: 4.5%;
box-shadow: -4px 4px 4px #ccc;
position: relative;
}
.kind_one {
border-radius: 10rpx;
}
.kind_two {
border-radius: 10rpx;
}
.kind_three {
border-radius: 16rpx;
width: 300rpx;
margin: 0 auto;
.three_3 {
display: flex;
justify-content: space-around;
}
}
.kind_four {
border-radius: 10rpx;
.four_3 {
display: flex;
li {
list-style-type: none;
}
.icon {
margin-top: -8rpx;
transform: scale(0.8);
}
}
}
.kind_five {
border-radius: 20rpx;
.five_3 {
view {
width: 100%;
}
}
}
}
// .breathe-blue {
// position:relative;
// color:#fff;
// text-align:center;
// cursor:pointer;
// box-shadow:0 1px 2px rgba(0,0,0,.3);
// overflow:hidden;
// -webkit-animation-timing-function:ease-in-out;
// -webkit-animation-name:breatheblue;
// -webkit-animation-duration:2000ms;
// -webkit-animation-iteration-count:infinite;
// -webkit-animation-direction:alternate;
// }
// @keyframes breatheblue {
// 0% {
// opacity:.8;
// box-shadow:0 1px 2px rgba(62,178,245,0.5);
// }
// 100% {
// opacity:1;
// box-shadow:0 1px 30px rgba(147,116,247,0.6);
// }
// }
// .breathe-red {
// position:relative;
// color:#fff;
// text-align:center;
// cursor:pointer;
// box-shadow:0 1px 2px rgba(0,0,0,.3);
// overflow:hidden;
// -webkit-animation-timing-function:ease-in-out;
// -webkit-animation-name:breathered;
// -webkit-animation-duration:2000ms;
// -webkit-animation-iteration-count:infinite;
// -webkit-animation-direction:alternate;
// }
// @keyframes breathered {
// 0% {
// opacity:.8;
// box-shadow:0 1px 2px rgba(247,126,137,0.5);
// }
// 100% {
// opacity:1;
// box-shadow:0 1px 30px rgba(247,149,59,0.9);
// }
// }
</style>