开始
分为上中下,中间是不止四个 是可以滚动的。 
最上面的是蒙版,下面分为三行。中间用的是scroll-view
<!-- 分享 --><view class="more-share-model"></view><view class="more-share"><view class="more-share-title">分享到</view><scroll-view scroll-x class="more-share-body"><view></view><view></view><view></view><view></view></scroll-view><view class="more-share-bottom">取消</view></view>

<!-- 分享 --><view class="more-share-model"></view><view class="more-share"><view class="more-share-title">分享到</view><scroll-view scroll-x class="more-share-body"><view class="more-share-item"><view class="icon iconfont icon-weixin"></view><view>微信</view></view><view class="more-share-item"><view class="icon iconfont icon-weixin"></view><view>微信</view></view><view class="more-share-item"><view class="icon iconfont icon-weixin"></view><view>微信</view></view><view class="more-share-item"><view class="icon iconfont icon-weixin"></view><view>微信</view></view></scroll-view><view class="more-share-bottom">取消</view></view>
样式
fixed布局 ,置于底部。
.more-share{position: fixed;bottom: 0;left: 0;right: 0;background: #FFFFFF;}
第一行和第三行都是水平垂直方向居中。


第一行和最后一行的 
.more-share-title,.more-share-bottom{font-size: 32upx;padding: 25upx;}
中间。flex布局,不希望换行。
.more-share-body{display: flex;white-space: nowrap;}
宽度100% ,加个固定的高度。
.more-share-body{display: flex;white-space: nowrap;width: 100%;height: 200upx;}
加个边框
.more-share-body{display: flex;white-space: nowrap;width: 100%;height: 200upx;border: 1upx solid;}
里面的内容 每一个占25%
水平和垂直居中。
.more-share-item{width: 25%;display: inline-flex;justify-content: center;align-items: center;}


.more-share-item>view:first-child{width: 100upx;height: 100upx;border-radius: 100%;border: 1upx solid;}.more-share-item>view:last-child{color: #7A7A7A;}
图标没有水平垂直方向居中,字体也太小了。然后让他们竖直方向的布局。

里面每一个元素都垂直水平方向居中。
改成竖向布局
.more-share-item{width: 25%;display: inline-flex;justify-content: center;align-items: center;flex-direction: column;}
图标加上大小
.more-share-item>view:first-child{width: 100upx;height: 100upx;border-radius: 100%;border: 1upx solid;font-size: 55upx;}

这里加的布局好像没有起作用。
在css里面单独写。
.more-share-body{display: flex;white-space: nowrap;width: 100%;height: 200upx;border: 1upx solid;display: flex;align-items: center;justify-content: center;}

display: flex!important;align-items: center!important;justify-content: center!important;
只保留这俩。竖直方向居中就可以了。
display: flex!important;align-items: center!important;
还是不行。中间的图标没有垂直的居中。
行高和高度保持一致。这样可以垂直居中
垂直居中了
保留下边框
border: 1upx solid #EEEEEE;
点击事件

.more-share-hover{background: #EEEEEE;}
加hover-class
<view class="more-share-item" hover-class="more-share-hover">
每一项都加上
取消这里也加一个

<view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-xinlangweibo u-f-ajc"></view><view>新浪微博</view></view>
朋友圈的图标自己找一下


每一个图标是单独的样式

<scroll-view scroll-x class="more-share-body"><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-weixin u-f-ajc more-share-weixin"></view><view>微信</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-weixin u-f-ajc more-share-pyq"></view><view>朋友圈</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-xinlangweibo u-f-ajc more-share-wb"></view><view>新浪微博</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-QQ u-f-ajc more-share-qq"></view><view>QQ好友</view></view></scroll-view>
吸取几个图标的颜色

4个不同颜色
.more-share-weixin{background: #2AD19B;}.more-share-pyq{background: #514D4C;}.more-share-wb{background: #EE5E5E;}.more-share-qq{background: #4A73BA;}
去掉黑色边框,让里面的图标是白色的
白色
.more-share-item>view:first-child{width: 100upx;height: 100upx;border-radius: 100%;/* border: 1upx solid; */font-size: 55upx;color: #FFFFFF;}

高度占100%

这样选中的样式就占 100%了。
加一个其他
蒙版样式

.more-share-model{background: #333333;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 100;}

.more-share{position: fixed;z-index: 100;bottom: 0;left: 0;right: 0;background: #FFFFFF;}

变成透明的颜色
我们来复制这个样式到chrome浏览器
随便找个节点,复制到这里
然后点击这个颜色
拖到一半
换成RGBA的写法,然后直接复制

.more-share-model{background: rgba(51, 51, 51, 0.49);position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 100;}

打开分享组件的事件
是否显示的属性
shareshow:true,
默认是隐藏的。
v-if="shareshow"
点击的时候取反操作
togle(){this.shareshow=!this.shareshow;},

togle(){this.shareshow=!this.shareshow;},
蒙版也调用toggle事件
<view class="more-share-model" v-if="shareshow" @tap="togle"></view>
取消也调用toggle
<view class="more-share-bottom u-f-ajc" hover-class="more-share-hover" @tap="togle">取消</view>
封装组件


最外层嵌套一个组件
<view><view class="more-share-model" v-if="shareshow" @tap="togle"></view><view class="more-share" v-if="shareshow"><view class="more-share-title u-f-ajc">分享到</view><scroll-view scroll-x class="more-share-body"><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-weixin u-f-ajc more-share-weixin"></view><view>微信</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-weixin u-f-ajc more-share-pyq"></view><view>朋友圈</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-xinlangweibo u-f-ajc more-share-wb"></view><view>新浪微博</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-QQ u-f-ajc more-share-qq"></view><view>QQ好友</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-QQ u-f-ajc more-share-qq"></view><view>其他</view></view></scroll-view><view class="more-share-bottom u-f-ajc" hover-class="more-share-hover" @tap="togle">取消</view></view></view>
最外层加动画
<view class="animated fadeIn fast">
是否显示放在最外层的view上,不放在里面 两个元素上了。
<view class="animated fadeIn fast" v-if="shareshow">
参数改成show

export default{props:{show: Boolean},methods:{togle() {this.$emit('togle');}}}
引入组件

import moreShare from '@/components/common/more-share.vue';


<more-share :show="shareshow" @togle="togle()"></more-share>

css也要复制进来



本节代码
display:inline-flex布局
https://www.jianshu.com/p/4d596708f61b
https://blog.csdn.net/jiang12138/article/details/100178726
more-share.vue组件
<template><view class="animated fadeIn fast" v-if="show"><view class="more-share-model" @tap="togle"></view><view class="more-share"><view class="more-share-title u-f-ajc">分享到</view><scroll-view scroll-x class="more-share-body"><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-weixin u-f-ajc more-share-weixin"></view><view>微信</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-weixin u-f-ajc more-share-pyq"></view><view>朋友圈</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-xinlangweibo u-f-ajc more-share-wb"></view><view>新浪微博</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-QQ u-f-ajc more-share-qq"></view><view>QQ好友</view></view><view class="more-share-item" hover-class="more-share-hover"><view class="icon iconfont icon-QQ u-f-ajc more-share-qq"></view><view>其他</view></view></scroll-view><view class="more-share-bottom u-f-ajc" hover-class="more-share-hover" @tap="togle">取消</view></view></view></template><script>export default{props:{show: Boolean},methods:{togle() {this.$emit('togle');}}}</script><style scoped>.more-share-model{background: rgba(51, 51, 51, 0.49);position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 100;}.more-share{position: fixed;z-index: 100;bottom: 0;left: 0;right: 0;background: #FFFFFF;}.more-share-title,.more-share-bottom{font-size: 32upx;padding: 25upx;}.more-share-body{white-space: nowrap;width: 100%;height: 200upx;border: 1upx solid #EEEEEE;display: flex!important;/* align-items: center!important; */line-height: 200upx!important;}.more-share-item{width: 25%;display: inline-flex;justify-content: center;align-items: center;flex-direction: column;height: 100%;}.more-share-item>view:first-child{width: 100upx;height: 100upx;border-radius: 100%;/* border: 1upx solid; */font-size: 55upx;color: #FFFFFF;}.more-share-item>view:last-child{color: #7A7A7A;}.more-share-hover{background: #EEEEEE;}.more-share-weixin{background: #2AD19B;}.more-share-pyq{background: #514D4C;}.more-share-wb{background: #EE5E5E;}.more-share-qq{background: #4A73BA;}</style>
detail.vue页面
<template><view><detail-info :item="detail"></detail-info><view class="u-comment-title">最新评论 {{comment.count}}</view><!-- 评论区 start --><view class="uni-comment u-comment"><block v-for="(item,index) in comment.list" :key="index"><comment-list :item="item" :index="index"></comment-list></block></view><view style="height: 120upx;"></view><user-chat-bottom @submit="submit"></user-chat-bottom><!-- 分享 --><more-share :show="shareshow" @togle="togle()"></more-share></view></template><script>import detailInfo from '@/components/detail/detail-info.vue';import time from '../../common/time.js';import commentList from '@/components/detail/comment-list.vue';import userChatBottom from '@/components/user-chat/user-chat-bottom.vue';import moreShare from '@/components/common/more-share.vue';export default {components: {detailInfo,commentList,userChatBottom,moreShare},data() {return {shareshow:false,detail: {userpic: "../../static/demo/userpic/12.jpg",username: "哈哈",sex: 0, //0 男 1 女age: 25,isguanzhu: false,title: "我是标题",titlepic: "../../static/demo/datapic/13.jpg",morepic: ["../../static/demo/datapic/13.jpg", "../../static/demo/datapic/12.jpg"],video: false,share: false,path: "深圳 龙岗",sharenum: 20,commentnum: 30,goodnum: 20},comment: {count: 20,list: []}}},onLoad(e) {// console.log(e.detailDate);this.initdata(JSON.parse(e.detailDate));this.getcomment();},// 监听导航右边按钮onNavigationBarButtonTap(e) {// console.log(e);if (e.index == 0) {console.log("分享");this.togle();}},methods: {togle(){this.shareshow=!this.shareshow;},// 获取评论getcomment() {let arr = [// 一级评论{id: 1,fid: 0,userpic: "../../static/demo/userpic/12.jpg",username: "小猫咪",time: "1555400035",data: "支持国产,支持DCloud!",},// 子级评论{id: 2,fid: 1,userpic: "../../static/demo/userpic/12.jpg",username: "小猫咪",time: "1555400035",data: "支持国产,支持DCloud!",},{id: 3,fid: 1,userpic: "../../static/demo/userpic/12.jpg",username: "小猫咪",time: "1555400035",data: "支持国产,支持DCloud!",},{id: 4,fid: 0,userpic: "../../static/demo/userpic/12.jpg",username: "小猫咪",time: "1555400035",data: "支持国产,支持DCloud!",},];for (let i = 0; i < arr.length; i++) {arr[i].time = time.gettime.gettime(arr[i].time);}this.comment.list = arr;},// 初始化数据initdata(obj) {console.log('拿到标题:', obj);uni.setNavigationBarTitle({title: obj.title})},submit(data) {console.log(data);let obj = {id: 1,fid: 0,userpic: "../../static/demo/userpic/12.jpg",username: "小猫咪",time: time.gettime.gettime(new Date().getTime()),data: data,};this.comment.list.push(obj);}}}</script><style>.u-comment-title {padding: 20upx;font-size: 30upx;font-weight: bold;}.u-comment {padding: 0 20upx;}</style>
