123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <view class="app-associated-link dir-left-nowrap main-left cross-center" :style="{backgroundColor: background}">
- <app-jump-button style="width: 100%" form :open_type="link.open_type" :url="link.value" :params="link.params">
- <view class="dir-left-nowrap" :class="[`${className}`]" :style="{backgroundColor: background}">
- <view v-if="styleNum == '1'" class="app-link-title box-grow-1" :style="{textAlign: position}">
- <image class="app-title-icon" v-if="picSwitch" :src="picUrl">
- </image>
- <text :style="{color: color}">{{title}}</text>
- </view>
- <view v-else-if="styleNum == '2'" class="app-link-title box-grow-1 main-center cross-center">
- <image :style="{backgroundColor: styleColor}" class="app-title-line" :src="styleImg.line"></image>
- <view :style="{color: color}">{{title}}</view>
- <image :style="{backgroundColor: styleColor}" class="app-title-line" :src="styleImg.line"></image>
- </view>
- <view v-else-if="styleNum == '3'" class="app-link-title box-grow-1 main-center cross-center">
- <view class="app-title-line star">
- <view :style="{backgroundColor: styleColor}" class="top-icon"></view>
- <view :style="{backgroundColor: styleColor}" class="bottom-icon"></view>
- </view>
- <view :style="{color: color}">{{title}}</view>
- <view class="app-title-line star">
- <view :style="{backgroundColor: styleColor}" class="top-icon"></view>
- <view :style="{backgroundColor: styleColor}" class="bottom-icon"></view>
- </view>
- </view>
- <view v-else-if="styleNum == '4'" class="app-link-title box-grow-1 dir-left-nowrap cross-center">
- <image :style="{backgroundColor: styleColor}" class="app-title-line div" :src="styleImg.div"></image>
- <view :style="{color: color}">{{title}}</view>
- </view>
- <view v-else-if="styleNum == '5'" class="app-link-title box-grow-1 dir-left-nowrap cross-center">
- <view :style="[{'border-color':`${styleColor}`,'background-color':`${background}`}]" class="app-title-line radius"></view>
- <view :style="{color: color}">{{title}}</view>
- </view>
- <view v-if="arrowsSwitch" class="app-more-text">更多</view>
- <icon class="app-icon" v-if="arrowsSwitch"></icon>
- </view>
- </app-jump-button>
- </view>
- </template>
- <script>
- import {mapState, mapGetters} from 'vuex';
- export default {
- name: "app-associated-link",
- data() {
- return {
- className: '',
- }
- },
- computed: {
- ...mapState({
- styleImg: state => state.mallConfig.__wxapp_img.diy,
- }),
- },
- props: {
- arrowsSwitch: {
- type: Boolean,
- default: function() {
- return false;
- }
- },
- background: {
- type: String,
- default: function() {
- return '#E11B1B';
- }
- },
- color: {
- type: String,
- default: function() {
- return '#F4EBEB';
- }
- },
- link: {
- type: Object,
- default: function() {
- return {
- open_type: "tel",
- params: [
- {
- value: "111",
- }
- ],
- }
- }
- },
- styleColor: {
- type: String,
- default: function() {
- return '#353535';
- }
- },
- picSwitch: {
- type:Boolean,
- default: function() {
- return false;
- }
- },
- picUrl: {
- type: String,
- default: function() {
- return '';
- }
- },
- position: {
- type: String,
- default: function() {
- return 'left';
- }
- },
- title: {
- type: String,
- default: function() {
- return '';
- }
- },
- styleNum: {
- type: String,
- default: function() {
- return '1';
- }
- },
- fontSize: {
- type: String,
- default: function() {
- return '36';
- }
- }
- },
- created() {
- let that = this;
- if(this.fontSize == '36') {
- this.className = 'big-style'
- }else if(this.fontSize == '28') {
- this.className = 'medium-style'
- }else {
- this.className = 'small-style'
- }
- },
- }
- </script>
- <style scoped lang="scss">
- .app-associated-link {
- width: #{750rpx};
- height: #{72rpx};
- position: relative;
- .app-more-text {
- font-size: #{24rpx};
- color: #999;
- white-space: nowrap;
- }
- .app-icon {
- background-image: url("../../../static/image/icon/arrow-right.png");
- width: #{12rpx};
- height: #{22rpx};
- background-repeat: no-repeat;
- background-size: cover;
- position: absolute;
- right: #{24rpx};
- top: 50%;
- transform: translateY(-50%);
- }
- .app-link-title {
- flex-grow: 1;
- width: 100%;
- padding: 0 24rpx;
- .app-title-line {
- width: 82rpx;
- height: 5rpx;
- margin: 0 20rpx;
- }
- .app-title-line.star {
- width: 28rpx;
- height: 20rpx;
- .top-icon {
- width: 28rpx;
- height: 4rpx;
- margin-bottom: 12rpx;
- }
- .bottom-icon {
- width: 28rpx;
- height: 4rpx;
- }
- }
- .app-title-line.div {
- width: 8rpx;
- height: 28rpx;
- margin: 0 10rpx 0 0;
- }
- .app-title-line.radius {
- width: 28rpx;
- margin: 0 10rpx 0 0;
- border-radius: 14rpx;
- border: 2rpx solid #353535;
- height: 28rpx;
- }
- }
- .big-style {
- height: 50rpx;
- line-height: 50rpx;
- font-size: 36rpx;
- width: 100%;
- // padding-right: 48rpx;
- .app-title-icon {
- width: 50rpx;
- height: 50rpx;
- margin-right: 16rpx;
- vertical-align: top;
- }
- }
- .medium-style {
- height: 36rpx;
- line-height: 36rpx;
- font-size: 28rpx;
- width: 100%;
- padding-right: 48rpx;
- .app-title-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 16rpx;
- vertical-align: top;
- }
- }
- .small-style {
- height: 28rpx;
- line-height: 28rpx;
- font-size: 24rpx;
- width: 100%;
- padding-right: 48rpx;
- .app-title-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 16rpx;
- vertical-align: top;
- }
- }
- }
- </style>
|