dever 4 gadi atpakaļ
vecāks
revīzija
e3e905c716

+ 1 - 1
App.vue

@@ -41,5 +41,5 @@ video {
 /* 重写showModal样式 */
 uni-modal .uni-modal__hd {padding:30rpx 0;}
 uni-modal .uni-modal__title {font-size: 28rpx;color: #666666;}
-uni-modal .uni-modal__bd{font-size: 30rpx;color: #222222;padding:0 0 30rpx 0}
+uni-modal .uni-modal__bd{font-size: 30rpx;color: #222222;paddings:0 0 30rpx 0}
 </style>

+ 5 - 2
lib/dever/components/drawerWindow.vue

@@ -3,7 +3,7 @@
 		<view class="DrawerClose" :class="show ? direction:default_direction" @tap="hideModal">
 			<text class="cuIcon-pullright"></text>
 		</view>
-		<scroll-view scroll-y class="DrawerWindow" :class="show ? direction:default_direction" :style="{width:width,padding:padding, zIndex:zIndex+1, background:slotBg}" @tap.stop="stopFun" @touchstart="Dever.slide" @touchend="end">
+		<scroll-view scroll-y class="DrawerWindow" :class="show ? direction:default_direction" :style="{width:width,padding:padding, zIndex:zIndex+1, background:slotBg}" @tap.stop="stopFun" @touchstart="Dever.slide" @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>
@@ -64,7 +64,10 @@ export default {
 	mounted() {
 		this.default_direction = 'default_' + this.direction;
 	},
-	methods:{
+	methods:{
+		bottomCall : function() {
+			this.$emit('bottomFunc');
+		},
 		closeDrawer : function(){
 			this.$emit('closeDrawer');
 		},

+ 1 - 1
lib/dever/config.js

@@ -8,7 +8,7 @@ const request = {
 	//	服务器接口地址
 
 	host: "http://192.168.2.70/dreamland/",
-	//host: "http://192.168.3.66/dreamland/",
+	host: "http://192.168.3.66/dreamland/",
 	
 	//	请求的参数	
 	data: {},

+ 10 - 0
pages.json

@@ -50,6 +50,16 @@
 		    		"navigationStyle": "custom"
 		    	}
 		    }
+		},
+		{
+		    "path" : "pages/dream/product",
+		    "style": {
+		    	"app-plus": {
+		    		"titleNView": false,
+		    		"bounce": "none",
+		    		"navigationStyle": "custom"
+		    	}
+		    }
 		}
     ],
 	"globalStyle": {

+ 8 - 5
pages/dream/func/cate.vue

@@ -3,13 +3,13 @@
 	<view class="category">
 		<view class="category-wrapper" v-if="fetch.cate.length>0">
 			<!-- 左边导航 -->
-			<scroll-view scroll-y="true" class="left-wrapper" scroll-with-animation="true">
+			<view scroll-y="true" class="left-wrapper" scroll-with-animation="true">
 				<view class="left-content">
 					<view class="title-content" :class="fetch.show[v.id] == 1?'onSelected':''" v-for="(v,k) in fetch.cate" :key="v.id" @click="choose(v.id)">{{v.name}}</view>
 				</view>
-			</scroll-view>
+			</view>
 			<!-- 右边内容 -->
-			<scroll-view scroll-y="true" class="right-wrapper" scroll-with-animation="true">
+			<view scroll-y="true" class="right-wrapper" scroll-with-animation="true">
 				<view class="right-content">
 					<!-- banner区域 -->
 					<view class="banner-wrapper" v-if="swiperList.length > 0">
@@ -36,7 +36,7 @@
 						</view>
 					</view>
 				</view>
-			</scroll-view>
+			</view>
 		</view>
 	</view>
 	</view>
@@ -77,6 +77,9 @@ export default {
 	methods:{
 		getData : function() {
 			this.$emit('getCate');
+		},
+		getInfo : function(t) {
+			//触底刷新
 		},
 		choose : function(id) {
 			if (this.fetch.show[id] == 1) {
@@ -119,7 +122,7 @@ export default {
 			.left-wrapper {
 				width: 200rpx;
 				flex: 0 0 200rpx;
-				background-color: #f6f6f6;
+				/*background-color: #f6f6f6;*/
 
 				.left-content {
 

+ 84 - 0
pages/dream/func/my.vue

@@ -0,0 +1,84 @@
+<template name="my">
+	<view>
+		<view class="grace-list">
+			<view class="grace-list-items">
+				<view class="grace-list-image ucenter-face grace-relative">
+					<image class="grace-list-image ucenter-face-image" :src="fetch.user.avatar" mode="widthFix"></image>
+				</view>
+				<view class="grace-list-body">
+					<view class="grace-list-title">
+						<text class="grace-list-title-text">{{fetch.user.username}}</text>
+					</view>
+					<view class="grace-list-body-desc">{{fetch.user.desc}}</view>
+				</view>
+				<text class="grace-list-arrow-right grace-icons icon-arrow-right"></text>
+			</view>
+		</view>
+		<view class="ucenter-line"></view>
+		<view>
+			<graceBoxBanner :items="fetch.num"></graceBoxBanner>
+		</view>
+		<view class="ucenter-line"></view>
+		<view class="grace-list grace-margin-top">
+			<shop ref="shop" :index="index" :content_id="content_id" :code="code" :width="width"></shop>
+		</view>
+	</view>
+</template>
+
+<script>
+import shop from "@/pages/dream/func/shop.vue";
+export default {
+	name: "cate",
+	props: {
+		content_id : {
+			type : String,
+			value : null
+		},
+		width : {
+			type : String,
+			default : '100%'
+		},
+		code : {
+			type : String,
+			default : ''
+		},
+		param : {},
+		index : 0
+	},
+    data() {
+    	return {
+			fetch : {
+				user : {},
+				num : [],
+			},
+			items: [
+				['¥199', '', '钱包'],
+				[80, '', '金币'],
+				[100, '', '好友'],
+				[50, '', '动态'],
+			]
+		}
+    },
+	mounted() {
+		this.getData();
+	},
+	methods:{
+		getData : function() {
+			var self = this;
+			this.Dever.get(this, 'app/collection/?l=api.getUser', {code:this.code, content_id:this.content_id,noloading:1});
+		},
+		getInfo : function(t) {
+			//触底刷新
+		},
+	},
+	components:{
+		shop
+	}
+}
+</script>
+
+<style>
+.ucenter-face{width:100rpx !important; height:100rpx !important;}
+.ucenter-face-image{width:100rpx !important; height:100rpx !important;}
+.ucenter-line{height:12rpx; background-color:#F4F5F6; margin:16rpx 0;}
+</style>

+ 12 - 7
pages/dream/func/shop.vue

@@ -2,11 +2,11 @@
 	<view>
 		<view class="grace-space-between">
 			<view class="grace-waterfall-item" v-for="(v, k) in productList" :key="k">
-				<view class="grace-img-card-item" v-for="(v1, k1) in v" :key="k1">
+				<view class="grace-img-card-item" v-for="(v1, k1) in v" :key="k1" @click="view(v1.id)">
 					<image :src="v1.pic_cover" mode="widthFix" class="grace-waterfall-img" style="height:auto"></image>
 					<text class="grace-img-card-title">{{v1.name}}</text>
 					<view class="grace-img-card-more">
-						<text class="grace-img-card-price">¥99.99</text>
+						<text class="grace-img-card-price">{{v1.price}}</text>
 						<text class="grace-img-card-btn">购买</text>
 					</view>
 				</view>
@@ -18,16 +18,12 @@
 
 <script>
 export default {
-	name: "cate",
+	name: "shop",
 	props: {
 		content_id : {
 			type : String,
 			value : null
 		},
-		page_id : {
-			type : String,
-			value : null
-		},
 		width : {
 			type : String,
 			default : '100%'
@@ -75,6 +71,12 @@ export default {
 				}
 			});
 		},
+		getInfo : function(t) {
+			//触底刷新
+		},
+		view : function(id) {
+			this.Dever.location('dream/product?id=' + id + '&table=collection/product&code=' + this.code);
+		}
 	},
 }
 </script>
@@ -82,4 +84,7 @@ export default {
 <style>
 .grace-waterfall-item{width:340rpx;}
 .grace-waterfall-img{width:340rpx;}
+.grace-img-card-item:last-child {
+	min-height:600rpx;
+}
 </style>

+ 3 - 0
pages/dream/func/times.vue

@@ -46,6 +46,9 @@ export default {
 	methods:{
 		getData : function() {
 			this.$emit('getTimes');
+		},
+		getInfo : function(t) {
+			//触底刷新
 		},
 		go : function(times) {
 			var self = this;

+ 48 - 0
pages/dream/product.vue

@@ -0,0 +1,48 @@
+<template>
+	<view>
+		<product ref="product" :index="index" :item="fetch.product" :control="control" :bottom="bottom" v-if="fetch.product.id"></product>
+	</view>
+</template>
+
+<script>
+import product from "@/pages/dream/view/product.vue";
+export default{
+	data() {
+		return {
+			id : '',
+			table : '',
+			code : '',
+			index : -1,
+			bottom : {},
+			control : {},
+			fetch : {
+				product: {},
+			}
+		}
+	},
+	onLoad(option) {
+		this.id = option.id;
+		this.table = option.table;
+		this.code = option.code;
+		this.getData();
+	},
+	// 重新加载
+	onPullDownRefresh: function() {
+		this.getData();
+	},
+	onReachBottom : function() {
+		this.$refs.product.getData(2);
+	},
+	methods:{
+		getData: function(id, table) {
+			this.Dever.get(this, 'app/collection/?l=api.getProductOne', {code:this.code, product_id:this.id, table:this.table});
+		},
+	},
+	components:{
+		product
+	}
+}
+</script>
+
+<style>
+</style>

+ 21 - 4
pages/dream/view.vue

@@ -2,7 +2,7 @@
 	<gracePage :customHeader="false">
 		<view class="container" slot="gBody">
 			<drawerPage :show="drawer.show ? 'left' : ''">
-				<view class="container_main" slot="links">
+				<view class="container_main" slot="links" @click="closeDrawer()">
 					<block v-if="login">
 						<swiper class="swiper" @change="change" :circular="swiper.circular" :current="fetch.index">
 							<swiper-item v-for="(v, k) in fetch.items"  v-if="v.data" :key="k" >
@@ -19,7 +19,7 @@
 			</drawerPage>
 			
 			
-			<drawerWindow v-for="(v, k) in drawer.item" :key="k" :show="v.show" :zIndex="v.index" padding="v.padding" :top="v.top" :direction="v.direction" :width="v.width" v-on:closeDrawer="closeDrawer(k)">
+			<drawerWindow v-for="(v, k) in drawer.item" :key="k" :show="v.show" :zIndex="v.index" padding="v.padding" :top="v.top" :direction="v.direction" :width="v.width" v-on:closeDrawer="closeDrawer(k)" v-on:bottomFunc="bottomFunc">
 				<view slot="links">
 					<block v-if="k == 'cate'">
 						<cate ref="cate" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param" :page_id="fetch.page_id"  @getCate="getCate"></cate>
@@ -36,6 +36,10 @@
 					<block v-if="k == 'shop'">
 						<shop ref="shop" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param"></shop>
 					</block>
+					
+					<block v-if="k == 'my'">
+						<my ref="my" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param"></my>
+					</block>
 				</view>
 			</drawerWindow>
 			
@@ -49,6 +53,7 @@ import cate from "@/pages/dream/func/cate.vue";
 import community from "@/pages/dream/func/community.vue";
 import times from "@/pages/dream/func/times.vue";
 import shop from "@/pages/dream/func/shop.vue";
+import my from "@/pages/dream/func/my.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";
@@ -136,6 +141,11 @@ export default{
 			if (this.bottom && this.bottom[this.swiper.index]) {
 				this.bottom[this.swiper.index].getData(2);
 			}
+		},
+		bottomFunc : function() {
+			if (this.drawer.show && this.drawer.item[this.drawer.show].show == true) {
+				this.$refs[this.drawer.show][0].getInfo(2);
+			}
 		},
 		record : function() {
 			var content_id = this.fetch.items[this.swiper.index].id;
@@ -223,6 +233,12 @@ export default{
 			}
 		},
 		closeDrawer : function(key) {
+			if (!key && this.drawer.show) {
+				key = this.drawer.show;
+			}
+			if (!key) {
+				return;
+			}
 			this.drawer.item[key].show = false;
 			this.drawer.show = '';
 		},
@@ -237,7 +253,7 @@ export default{
 		}
 	},
 	components:{
-		dream,cate,community,times,shop,drawerPage,drawerWindow
+		dream,cate,community,times,shop,my,drawerPage,drawerWindow
 	}
 }
 </script>
@@ -248,7 +264,8 @@ export default{
   width: 100%;
   left: 0;
   top: 0;
-  -webkit-overflow-scrolling: touch; 
+  -webkit-overflow-scrolling: touch;
+  overflow: hidden;
 }
 .container_main {
 	width: 750rpx;

+ 28 - 3
pages/dream/view/product.vue

@@ -19,7 +19,7 @@
 					<text class="grace-product-price">¥{{item.goods.price.min.price}}</text>
 					<text class="grace-text grace-gray grace-line-through" style="margin-left:30rpx;">¥{{item.goods.price.min.s_price}}</text>
 				</view>
-				<view class="grace-space-between grace-flex-vcenter">
+				<view class="grace-space-between grace-flex-vcenter" v-if="item.goods.type == 1">
 					<text class="grace-text-small grace-gray" v-if="item.goods.freight">运费 ¥{{item.goods.freight.price}}</text>
 					<text class="grace-text-small grace-gray">已售 {{item.goods.sell_num}} 件</text>
 				</view>
@@ -90,7 +90,10 @@
 				</form>
 			</graceBottomDialog>
 			<y-Fab :bottom="20" :right="140" v-if="!attrIsShow" @click="buyNow" bgColor="#e55d52" text="购买"></y-Fab>
-			<y-Fab :bottom="20" :right="260" v-if="!attrIsShow" @click="showModal" bgColor="#0fa5e5" text="评价"></y-Fab>
+			<y-Fab :bottom="20" :right="260" v-if="!attrIsShow" @click="showModal" bgColor="#0fa5e5" text="评价"></y-Fab>
+			<block v-if="index == -1">
+				<y-Fab :bottom="20" :right="20" v-if="!attrIsShow" @click="back" text="返回"></y-Fab>
+			</block>
 			<view v-if="showComment">
 				<publish :title="title" :is_upload="true" @hideModal="hideModal" @getRefresh="getRefresh" :type="key" :type_id="item.id" :api="api"></publish>
 			</view>
@@ -169,7 +172,29 @@ export default {
 		},
 		//打开属性视图
 		buyNow : function() {
-			this.attrIsShow = true;
+			if (this.item.goods.type == 1) {
+				this.attrIsShow = true;
+			} else {
+				//this.Dever.alert('加入到口袋里');
+				uni.showModal({
+					content: '这是一个购物平台商品,是否立刻去购买?',
+					cancelText: '取消',
+					confirmText: '确定',
+					success: res => {
+						if (res.confirm) {
+							if (this.item.goods.type == 2 || this.item.goods.type == 4) {
+								//this.Dever.location(this.item.goods.code);
+								this.Dever.alert('已复制,请打开淘宝app');
+							} else {
+								this.Dever.location(this.item.goods.link);
+							}
+						}
+					}
+				});
+			}
+		},
+		back : function() {
+			uni.navigateBack();
 		},
 		// 关闭属性
 		closeAttr : function() {