|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="arrow-bar">
|
|
<view class="arrow-bar">
|
|
|
|
|
+ <text class="icon iconfont" :class="icon" :style="{color: textColor}"></text>
|
|
|
<text class="title">{{ title }}</text>
|
|
<text class="title">{{ title }}</text>
|
|
|
<uni-icons class="arrow" type="right" size="16"></uni-icons>
|
|
<uni-icons class="arrow" type="right" size="16"></uni-icons>
|
|
|
</view>
|
|
</view>
|
|
@@ -12,8 +13,27 @@ export default {
|
|
|
title: {
|
|
title: {
|
|
|
type: String,
|
|
type: String,
|
|
|
required: true
|
|
required: true
|
|
|
|
|
+ },
|
|
|
|
|
+ icon: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ colors: ["#5daa31", "#c7515a", "#e03697", "#85029b",
|
|
|
|
|
+ "#c9b455", "#326eb6"]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed:{
|
|
|
|
|
+ textColor() {
|
|
|
|
|
+ let hash = 0;
|
|
|
|
|
+ for (var i = 0; i < this.title.length; i++) {
|
|
|
|
|
+ hash += this.title.charCodeAt(i);
|
|
|
|
|
+ }
|
|
|
|
|
+ return this.colors[hash % this.colors.length];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -21,16 +41,20 @@ export default {
|
|
|
.arrow-bar {
|
|
.arrow-bar {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 90rpx;
|
|
height: 90rpx;
|
|
|
- font-size: 30rpx;
|
|
|
|
|
- color: black;
|
|
|
|
|
|
|
+ font-size: $im-font-size;
|
|
|
|
|
+ color: $im-text-color;
|
|
|
margin-top: 5rpx;
|
|
margin-top: 5rpx;
|
|
|
background-color: white;
|
|
background-color: white;
|
|
|
line-height: 90rpx;
|
|
line-height: 90rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .icon {
|
|
|
|
|
+ margin-left: 40rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.title {
|
|
.title {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
- margin-left: 40rpx;
|
|
|
|
|
|
|
+ margin-left: 10rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrow {
|
|
.arrow {
|