| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view :class="className">
- <!-- style -->
- <!--<view v-html="css"></view>-->
- <template v-if="datas.list && datas.list.choose_style ==1">
- <view class="fixed-box" v-for="(item, index) in datas.list.list" :key="index"
- :style="{top : `${(datas.over_top + 30)*2}rpx`}">
- <!--悬浮按钮静态-->
- <view class="btn" :style="button_style">
- <u--image radius="25px" :style="{'width': datas.button_size+'px', 'height': datas.button_size+'px'}" :showLoading="true" :src="item.image || emptyImage" width="50px"
- height="50px"></u--image>
- </view>
- </view>
- </template>
- <template v-if="datas.list && datas.list.choose_style ==2">
- <view class="fixed-box2" :style="{top : `${(datas.over_top-15)*2}rpx`}" v-if="datas.list.show_style ==1">
- <u--image radius="25px" :style="button_style" :showLoading="true" :src="datas.list.unfold_button || openImage" width="50px"
- height="50px"></u--image>
- <view class="btn" v-for="(item, index) in datas.list.list" :key="index"
- :style="{top : `${-70*(index+1)}px`,left: `${datas.position_location =='left'?((datas.button_size-50)/2)+10: 315-((datas.button_size-50)/2)}px`}">
- <u--image radius="25px" :showLoading="true" :src="item.image || emptyImage" width="50px"
- height="50px"></u--image>
- </view>
- </view>
- <view class="fixed-box2" :style="{top : `${(datas.over_top-15 )*2}rpx`}" v-if="datas.list.show_style ==2">
- <u--image radius="25px" :style="button_style" :showLoading="true" :src="datas.list.unfold_button || openImage" width="50px"
- height="50px"></u--image>
- <view class="btn" style="top:-70px;" :style="btn_1_style" v-if="datas.list.list[0]">
- <u--image radius="25px" :showLoading="true" :src="datas.list.list[0].image" width="50px"
- height="50px"></u--image>
- </view>
- <view class="btn" :style="btn_3_style" v-if="datas.list.list[1]">
- <u--image radius="25px" :showLoading="true" :src="datas.list.list[1].image" width="50px"
- height="50px"></u--image>
- </view>
- <view class="btn" :style="btn_4_style" v-if="datas.list.list[2]">
- <u--image radius="25px" :showLoading="true" :src="datas.list.list[2].image" width="50px"
- height="50px"></u--image>
- </view>
- <view class="btn" style="top: 70px;" :style="btn_2_style" v-if="datas.list.list[3]">
- <u--image radius="25px" :showLoading="true" :src="datas.list.list[3].image" width="50px"
- height="50px"></u--image>
- </view>
- </view>
- </template>
- </view>
- </template>
- <script>
- export default {
- props: ['datas', 'styles'],
- data() {
- let siteinfo = getApp().globalData.siteinfo;
- let data = {
- settingFile: siteinfo,
- emptyImage: siteinfo.root_img + '/static/app/image.png',
- openImage: siteinfo.root_img + '/static/app/open.png',
- }
- return data;
- },
- computed: {
- button_style() {
- const {
- button_size,
- position_location,
- } = this.datas;
- return `
- width: ${button_size}px;
- height: ${button_size}px;
- margin-left: ${position_location =='left'?25:630}rpx;
- `;
- },
- btn_1_style() {
- const {
- position_location,
- } = this.datas;
- return `
- left: ${position_location =='left'?'10':315}px;
- `;
- },
- btn_2_style() {
- const {
- button_size,
- position_location,
- } = this.datas;
- return `
- top: ${20+button_size}px;
- left: ${position_location =='left'?'10':315}px;
- `;
- },
- btn_3_style() {
- const {
- button_size,
- position_location,
- } = this.datas;
- return `
- top: ${15-button_size}px;
- left: ${position_location =='left' ? 20+button_size:310-button_size}px;
- `;
- },
- btn_4_style() {
- const {
- button_size,
- position_location,
- } = this.datas;
- return `
- top: ${button_size-15}px;
- left: ${position_location =='left' ? 20+button_size:310-button_size}px;
- `;
- },
- className() {
- const name = ['component-wrapper', `component-${this.id}`];
- return name;
- },
- },
- methods: {},
- };
- </script>
- <style lang="less" scoped>
- // 默认
- .component-wrapper {
- width: 750rpx;
- }
- .fixed-box {
- width: 750rpx;
- position: fixed;
- top: 114px;
- z-index: 2;
- .btn {
- width: 50px;
- height: 50px;
- border-radius: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- position: absolute;
- flex-direction: column;
- font-size: 13px;
- img {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- }
- }
- .fixed-box2 {
- width: 750rpx;
- top: 114px;
- z-index: 2;
- position: fixed;
- .imgs {
- width: 60px;
- height: 60px;
- border-radius: 50%;
- z-index: 2;
- position: relative;
- }
- .btn {
- width: 50px;
- height: 50px;
- border-radius: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- position: absolute;
- flex-direction: column;
- font-size: 13px;
- img {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- }
- }
- </style>
|