adminthw 4 年之前
父節點
當前提交
b19ddeca78
共有 2 個文件被更改,包括 96 次插入52 次删除
  1. 69 51
      components/footer-share/footer-share.vue
  2. 27 1
      pages/policy/policy_deatil.vue

+ 69 - 51
components/footer-share/footer-share.vue

@@ -1,59 +1,77 @@
 <template>
-	<view class="footer-share-box display-around">
-		<button class="display-flex-start items-center share-font" :style="{'border-right': isCollection ? '1px solid #d8d8d8' : 'none'}" open-type="share" @click="sharePage()">
-			<view style="margin-right:15rpx;font-size: 26rpx;">分享</view>
-			<image src="../../static/share_icon.png" mode="aspectFill" style="width: 30rpx;height: 30rpx;"></image>
-		</button> 
-		<view class="display-flex-start items-center share-font" v-if='isCollection' @click="collectionPage()">
-			<view style="margin-right:15rpx;font-size: 26rpx;">收藏</view>
-			<image src="../../static/collection.png" mode="aspectFill" style="width: 40rpx;height: 40rpx;"></image>
-		</view>
-	</view>
+  <view class="footer-share-box display-around">
+    <button
+      class="display-flex-start items-center share-font"
+      :style="{ 'border-right': isCollection ? '1px solid #d8d8d8' : 'none' }"
+      open-type="share"
+      @click="sharePage()"
+    >
+      <view style="margin-right: 15rpx; font-size: 26rpx">分享</view>
+      <image
+        src="../../static/share_icon.png"
+        mode="aspectFill"
+        style="width: 30rpx; height: 30rpx"
+      ></image>
+    </button>
+    <view
+      class="display-flex-start items-center share-font"
+      v-if="isCollection"
+      @click="collectionPage()"
+    >
+      <view style="margin-right: 15rpx; font-size: 26rpx">收藏</view>
+      <image
+        src="../../static/collection.png"
+        mode="aspectFill"
+        style="width: 40rpx; height: 40rpx"
+      ></image>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		name:"footer-share",
-		props:{
-			isCollection: {
-			  type: Boolean,
-			  default:false
-			}
-		},
-		data() {
-			return {
-				
-			};
-		},
-		methods:{
-			sharePage() {
-			    this.$emit('sharePages')
-			},
-			collectionPage() {
-			    this.$emit('collectionPages')
-			},
-		}
-	}
+export default {
+  name: "footer-share",
+  props: {
+    isCollection: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {};
+  },
+  methods: {
+    sharePage() {
+      this.$emit("sharePages");
+    },
+    collectionPage() {
+      this.$emit("collectionPages");
+    },
+  },
+};
 </script>
 
 <style>
-   .footer-share-box {
-	   height: 50rpx;
-	   position: fixed;
-	   bottom: 0;
-	   width: 100%;
-	   border-radius: 10rpx;
-	   box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
-	   padding: 20rpx;
-	   background: #fff;
-   }
-   .share-font {
-	   width: 45%;
-	   justify-content: center;
-   }
-   .footer-share-box button {
-	   background-color: #fff;
-	   border-radius:0;
-   }
-  .footer-share-box button::after{ border: none;} 
+.footer-share-box {
+  height: 50rpx;
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  border-radius: 10rpx;
+  box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
+  padding: 20rpx;
+  background: #fff;
+  margin-left: -20rpx;
+}
+.share-font {
+  width: 45%;
+  justify-content: center;
+}
+.footer-share-box button {
+  background-color: #fff;
+  border-radius: 0;
+}
+.footer-share-box button::after {
+  border: none;
+}
 </style>

+ 27 - 1
pages/policy/policy_deatil.vue

@@ -46,7 +46,7 @@
         :isMar="idx == model.length - 1"
       ></policy-deatil-card>
     </div>
-    <div class="share-collection">
+    <!-- <div class="share-collection">
       <div class="share">
         <span>分享</span>
         <image src="/static/policy/u2091.png" />
@@ -55,6 +55,14 @@
         <span>收藏</span>
         <image src="/static/policy/u2096.png" />
       </div>
+    </div> -->
+    <div style="width: 100%">
+      <footer-share
+        style="width: 100%"
+        :isCollection="true"
+        @collectionPages="collectionPage"
+        @sharePages="sharePage"
+      ></footer-share>
     </div>
   </div>
 </template>
@@ -113,6 +121,21 @@ export default {
   onLoad(option) {
     let id = option.id;
   },
+  methods: {
+    collectionPage() {
+      console.log("已收藏");
+    },
+    sharePage() {
+      console.log("分享");
+      uni.showShareMenu({
+        title: "园区XXX",
+        path: "pages/park/park_detail",
+        success(res) {
+          console.log(res);
+        },
+      });
+    },
+  },
 };
 </script>
 
@@ -120,6 +143,9 @@ export default {
 * {
   box-sizing: border-box;
 }
+.footer-share-box{
+  margin-left: -20rpx;
+}
 .content {
   margin-top: 20rpx;
   display: flex;