dever 4 年之前
父节点
当前提交
fe649a0af2

+ 4 - 1
lib/dever/components/drawerWindow.vue

@@ -3,7 +3,7 @@
 		<view :class="['DrawerClose_' + direction, show ? 'show' : '']" @tap="hideModal">
 			<text :class="'cuIcon-pull'+direction"></text>
 		</view>
-		<scroll-view scroll-y :class="['DrawerWindow_' + direction, show ? 'show' : '']" :style="{width:width,padding:padding, zIndex:zIndex+1, background:slotBg}" @tap.stop="stopFun" @touchstart="Dever.slide" @touchend="end" @scrolltolower="bottomCall">
+		<scroll-view scroll-y :class="['DrawerWindow_' + direction, show ? 'show' : '']" :style="{width:width,padding:padding, zIndex:zIndex+1, background:slotBg}" @tap.stop="stopFun" @touchstart="start" @touchend="end" @scrolltolower="bottomCall">
 			<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg" v-if="show">
 				<slot name="links"></slot>
 			</view>
@@ -74,6 +74,9 @@ export default {
 		closeDrawer : function(){
 			this.$emit('closeDrawer');
 		},
+		start : function(e) {
+			return this.Dever.slide(e);
+		},
 		end : function(e) {
 			if (this.type == 'share') {
 				return;

+ 3 - 3
lib/dever/components/seat.vue

@@ -47,12 +47,12 @@
 			</view>
 		</view>
 		<view v-if="show">
-			<publish :title="title" :is_upload="false" @hideModal="hideTips" @getRefresh="getRefresh" :type="seat_table" :type_id="seat_table_id" :api="api" :playtime="playtime"></publish>
+			<dever-publish :title="title" :is_upload="false" @hideModal="hideTips" @getRefresh="getRefresh" :type="seat_table" :type_id="seat_table_id" :api="api" :playtime="playtime"></dever-publish>
 		</view>
 	</view>
 </template>
 <script>
-	import publish from '@/lib/dever/components/publish.vue';
+	import deverPublish from '@/lib/dever/components/publish.vue';
 	let cycle;
 	export default {
 		props: {
@@ -71,7 +71,7 @@
 			index : 0
 		},
 		components:{
-			publish
+			deverPublish
 		},
 		data() {
 			return {

+ 5 - 0
lib/dever/components/share.vue

@@ -45,6 +45,7 @@
 		props: {
 			id : 0,
 			data : {},
+			code : '',
 		},
 		created : function() {
 			this.mr = 'margin-right:60rpx';
@@ -63,6 +64,10 @@
 				type: 'copy'
 			});
 			
+			if (this.code) {
+				this.data.link = this.data.link + '?code=' + this.code;
+			}
+			
 			this.init();
 		},
 		methods: {

+ 2 - 2
lib/dever/components/video.nvue

@@ -62,7 +62,7 @@
 </template>
 
 <script>
-import position from "@/lib/dever/components/position.vue";
+import deverPosition from "@/lib/dever/components/position.vue";
 export default {
 	props: {
 		src : {
@@ -186,7 +186,7 @@ export default {
 		}
 	},
 	components:{
-		position
+		deverPosition
 	}
 }
 </script>

+ 23 - 10
lib/dever/index.js

@@ -568,7 +568,7 @@ var share =
         content : '',
         link : '',
     },
-	wx : false,
+	wx : {},
     init : function(wx, project, host, param)
     {
         var self = this;
@@ -716,7 +716,7 @@ var dever = {
 	btnText : '确定提交',
 	switchTab : [],
 	switchTabCall : {},
-	slideData : {},
+	slideValue : {},
 	
 	//获取当前时间戳
 	curTime : function() {
@@ -1538,24 +1538,37 @@ var dever = {
 	
 	//滑动
 	slide : function(e) {
-		this.slideData.clientX = e.changedTouches[0].clientX;
-		this.slideData.clientY = e.changedTouches[0].clientY;
+		this.slideValue = {};
+		if (e.changedTouches[0].clientX) {
+			this.slideValue.clientX = e.changedTouches[0].clientX;
+			this.slideValue.clientY = e.changedTouches[0].clientY;
+		} else {
+			this.slideValue.clientX = e.changedTouches[0].screenX;
+			this.slideValue.clientY = e.changedTouches[0].screenY; 
+		}
+		
 	},
 	
 	//滑动结束
 	slideEnd : function(e) {
-		var subX = e.changedTouches[0].clientX - this.slideData.clientX;
-		var subY = e.changedTouches[0].clientY - this.slideData.clientY;
-		if (subY > 50) {
+		if (e.changedTouches[0].clientX) {
+			var subX = e.changedTouches[0].clientX - this.slideValue.clientX;
+			var subY = e.changedTouches[0].clientY - this.slideValue.clientY;
+		} else {
+			var subX = e.changedTouches[0].screenX - this.slideValue.clientX;
+			var subY = e.changedTouches[0].screenY - this.slideValue.clientY;
+		}
+		
+		if (subY > 20) {
 			//上滑
 		    return 1;
-		} else if (subY < -50) {
+		} else if (subY < -20) {
 			//下滑
 			return 2;
-		} else if (subX > 50) {
+		} else if (subX > 20) {
 			//左滑
 		    return 3;
-		} else if(subX < -50) {
+		} else if(subX < -20) {
 			//右滑
 			return 4;
 		}

+ 4 - 1
pages/dream/buy.vue

@@ -63,7 +63,7 @@
 				</view>
 			</view>
 			<view class="btn-wrapper">
-			  <view class="button" @click="hideShare" :style="bgcolor">分享</view>
+			  <view class="button" @click="onShare" :style="bgcolor">分享</view>
 			</view>
 		  </view>
 		</view>
@@ -148,6 +148,9 @@ export default {
 		hideShare : function() {
 			this.share = false;
 		},
+		onShare : function() {
+			this.$emit('share');
+		},
 		hideBuy : function() {
 			this.show = false;
 			this.$emit('hideBuy');

+ 2 - 2
pages/dream/func/community.vue

@@ -22,7 +22,7 @@
 </template>
 
 <script>
-import publish from '@/lib/dever/components/publish.vue';
+import deverPublish from '@/lib/dever/components/publish.vue';
 export default {
 	name: "community",
 	props: {
@@ -105,7 +105,7 @@ export default {
 		},
 	},
 	components:{
-		publish
+		deverPublish
 	}
 }
 </script>

+ 8 - 6
pages/dream/index.vue

@@ -32,7 +32,7 @@
 				</view>
 			</view>
 			<view v-if="buyState">
-				<buy :id="id" :bgcolor="fetch.button.bgcolor" :color="fetch.button.color" :code="fetch.code" :name="fetch.info.name" @hideBuy="hideBuy" @view="view"></buy>
+				<buy :id="id" :bgcolor="fetch.button.bgcolor" :color="fetch.button.color" :code="fetch.code" :name="fetch.info.name" @hideBuy="hideBuy" @share="share" @view="view"></buy>
 			</view>
 			
 			<view v-if="rankingState">
@@ -43,7 +43,7 @@
 				<info :id="id" :bgcolor="fetch.button.bgcolor" :color="fetch.button.color" @hideInfo="hideInfo"></info>
 			</view>
 			
-			<dever-share ref="share" :id="id" :data="fetch.share"></dever-share>
+			<dever-share ref="share" :id="id" :code="fetch.code" :data="fetch.share" v-if="fetch.share"></dever-share>
 			
 			<view class="mask buy-layer" v-if="inviteState && fetch.info.user">
 			  <view class="buytip-layer layer " catchtap="handleStop">
@@ -84,7 +84,8 @@ export default{
 				is_buy : false,
 				info : {},
 				button : {},
-				code : '',
+				code : '',
+				share : {},
 			},
 			buyState : false,
 			rankingState : false,
@@ -133,8 +134,6 @@ export default{
 			this.inviteState = false;
 		},
 		showBuy : function() {
-			this.$refs.share.open();
-			return;
 			this.buyState = true;
 		},
 		hideBuy : function() {
@@ -151,7 +150,10 @@ export default{
 		},
 		hideInfo : function() {
 			this.infoState = false;
-		},
+		},
+		share : function() {
+			this.$refs.share.open();
+		}
 	},
 	components:{
 		buy,ranking,info,deverShare

+ 3 - 3
pages/dream/view.vue

@@ -63,8 +63,8 @@ import shop from "@/pages/dream/func/shop.vue";
 import my from "@/pages/dream/func/my.vue";
 import share from "@/pages/dream/func/share.vue";
 import dream from "@/pages/dream/view/dream.vue";
-import drawerPage from "@/lib/dever/components/drawerPage.vue";
-import drawerWindow from "@/lib/dever/components/drawerWindow.vue";
+import deverDrawerPage from "@/lib/dever/components/drawerPage.vue";
+import deverDrawerWindow from "@/lib/dever/components/drawerWindow.vue";
 export default{
 	data() {
 		return {
@@ -283,7 +283,7 @@ export default{
 		}
 	},
 	components:{
-		dream,cate,community,times,shop,my,share,drawerPage,drawerWindow
+		dream,cate,community,times,shop,my,share,deverDrawerPage,deverDrawerWindow
 	}
 }
 </script>

+ 3 - 3
pages/dream/view/audioComment.vue

@@ -23,8 +23,8 @@
 
 <script>
 import deverAudio from '@/lib/dever/components/audio.nvue';
-import comment from "@/lib/dever/components/comment.vue";
-import seat from '@/lib/dever/components/seat.vue';
+import deverComment from "@/lib/dever/components/comment.vue";
+import deverSeat from '@/lib/dever/components/seat.vue';
 export default {
 	name: "audioComment",
 	props: {
@@ -69,7 +69,7 @@ export default {
 		},
 	},
 	components:{
-		deverAudio,comment,seat
+		deverAudio,deverComment,deverSeat
 	}
 }
 </script>

+ 3 - 3
pages/dream/view/liveComment.vue

@@ -23,8 +23,8 @@
 
 <script>
 import deverVideo from '@/lib/dever/components/video.nvue';
-import comment from "@/lib/dever/components/comment.vue";
-import seat from '@/lib/dever/components/seat.vue';
+import deverComment from "@/lib/dever/components/comment.vue";
+import deverSeat from '@/lib/dever/components/seat.vue';
 export default {
 	name: "liveComment",
 	props: {
@@ -55,7 +55,7 @@ export default {
 		},
 	},
 	components:{
-		deverVideo,comment,seat
+		deverVideo,deverComment,deverSeat
 	}
 }
 </script>

+ 2 - 2
pages/dream/view/pic.vue

@@ -6,7 +6,7 @@
 </template>
 
 <script>
-import position from "@/lib/dever/components/position.vue";
+import deverPosition from "@/lib/dever/components/position.vue";
 export default {
 	name: "pic",
 	props: {
@@ -23,7 +23,7 @@ export default {
 		
 	},
 	components:{
-		position
+		deverPosition
 	}
 }
 </script>

+ 2 - 2
pages/dream/view/product.vue

@@ -105,7 +105,7 @@
 
 <script>
 import deverContent from '@/lib/dever/components/content.vue';
-import publish from '@/lib/dever/components/publish.vue';
+import deverPublish from '@/lib/dever/components/publish.vue';
 import copyText from "@/lib/clipboard.thorui.js"; 
 export default {
 	name: "product",
@@ -266,7 +266,7 @@ export default {
 			this.hideModal();
 		}
 	},
-	components:{deverContent, publish, copyText}
+	components:{deverContent, deverPublish, copyText}
 }
 </script>
 

+ 3 - 3
pages/dream/view/vodComment.vue

@@ -24,8 +24,8 @@
 
 <script>
 import deverVideo from '@/lib/dever/components/video.nvue';
-import comment from "@/lib/dever/components/comment.vue";
-import seat from '@/lib/dever/components/seat.vue';
+import deverComment from "@/lib/dever/components/comment.vue";
+import deverSeat from '@/lib/dever/components/seat.vue';
 export default {
 	name: "vodComment",
 	props: {
@@ -70,7 +70,7 @@ export default {
 		},
 	},
 	components:{
-		deverVideo,comment,seat
+		deverVideo,deverComment,deverSeat
 	}
 }
 </script>