gcz 2 лет назад
Родитель
Сommit
80a8274261

+ 1 - 1
center/dealList.vue

@@ -16,7 +16,7 @@
 			@click="tabsClick"></u-tabs>
 		</view>
 		<view class="totalAmount">
-			{{totalAmount}}
+			合计:{{totalAmount}}
 		</view>
 		<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
 			<view class="page-wrap" v-show="dataList.length>0" >

+ 7 - 0
pages.json

@@ -13,6 +13,13 @@
 				"navigationBarTitleText": "登录",
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/news/newsdetails",
+			"style": {
+				"navigationBarTitleText": "详情",
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"subPackages": [

+ 4 - 4
pages/index/index.vue

@@ -13,7 +13,7 @@
 				height="130"
 				keyName="sliderImg"
 				indicatorMode="dot"
-				@click="bannerClick()"
+				@click="bannerClick"
 			></u-swiper>
 			
 			<view class="icon-nav u-flex u-row-around">
@@ -62,7 +62,7 @@
 									</view>
 								</view>
 								<view class="down">
-									<text class="original-price gray line-through">¥ {{item.salePrice}}</text>
+									<!-- <text class="original-price gray line-through">¥ {{item.salePrice}}</text> -->
 								</view>
 							</view>
 							<view class="btn">去看看</view>
@@ -131,10 +131,10 @@
 				})
 			},
 			bannerClick(e){
-				// console.log('e',e);
+				console.log('e',e);
 				// console.log('bannerClick',this.bannerList[e]);
 				let item = this.bannerList[e];
-				uni.$u.route('/xushuo/dynamicdetails', {
+				uni.$u.route('/pages/news/newsdetails', {
 					type: 'swiperDetail',
 					id: item.id
 				});

+ 1 - 1
pages/login/login.vue

@@ -99,7 +99,7 @@
 					if(res.data){
 						that.backUrl = '/'+res.data;
 					}else{
-						that.backUrl = '/index/index';
+						that.backUrl = '/pages/index/index';
 					}
 					console.log('backUrl',that.backUrl);
 				}

+ 134 - 0
pages/news/newsdetails.vue

@@ -0,0 +1,134 @@
+<template>
+	<view class="">
+		<u-navbar
+			title="详情"
+			:placeholder="true"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<view class="page-wrap">
+			<view class="base-info" v-if="type=='swiperDetail'">
+				<view class="title">{{swiperDetails.name}}</view>
+				<view class="info u-flex u-row-between">
+					<view class="time">{{swiperDetails.publicTime}}</view>
+					<!-- <view class="view-count">{{swiperDetails.viewCount}}</view> -->
+				</view>
+			</view>
+			<view v-else class="base-info">
+				<view class="title">{{pageData.title}}</view>
+				<view class="info u-flex u-row-between">
+					<view class="time">{{pageData.publicTime}}</view>
+					<view class="view-count">浏览量:{{pageData.viewCount}}</view>
+				</view>
+			</view>
+			
+			<view class="" v-if="type=='swiperDetail'">
+				<u--image :src="swiperDetails.sliderImg" :showLoading="true" width="100%" mode="aspectFit"></u--image>
+				<!-- <view class="" v-html="swiperDetails.detail"></view> -->
+				<u-parse :content="swiperDetails.detail"></u-parse>
+			</view>
+			<view v-else class="content-wrap">
+				<u--image :src="pageData.mainImg" :showLoading="true" width="100%" mode="aspectFit"></u--image>
+				<view class="content">
+					<u-parse :content="pageData.content"></u-parse>
+					<!-- {{pageData.content}} -->
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default{
+	data(){
+		return{
+			id:null,
+			type:'',
+			pageData:{
+				title:'',
+				content:''
+			},
+			swiperDetails:{},
+		}
+	},
+	onLoad(page) {
+		this.id = page.id;
+		this.type = page.type;
+		if(this.type=='swiperDetail'){
+			console.log('this.id',this.id);
+			this.getSwiperDetails(this.id);
+		}else{
+			this.getDetails(this.id);
+			this.addViewCount(this.id);
+		}
+		
+	},
+	methods:{
+		getDetails(id){
+			this.$u.api.shopNews({id:id}).then(res=>{
+				this.pageData = res.data;
+				// console.log('res',res);
+				}).catch(err=>{
+				console.log('shopNews',err.data);
+			})
+		},
+		getSwiperDetails(id){
+			this.$u.api.swiperDetails({id:id}).then(res=>{
+				this.swiperDetails = res.data;
+				// console.log('res',res);
+				}).catch(err=>{
+				console.log('getSwiperDetails',err.data);
+			})
+		},
+		addViewCount(id){
+			this.$u.api.addViewCount({id:id}).then(res=>{
+				// console.log('res',res);
+				}).catch(err=>{
+				console.log('addViewCount',err.data);
+			})
+		}
+	}
+}
+</script>
+<style>
+page{background-color: #F5F5F5;}
+</style>
+<style lang="scss" scoped>
+.title{
+	font-size: 36rpx;
+	font-weight: 600;
+	color: #333333;
+	line-height: 50rpx;
+	margin-bottom: 20rpx;
+}
+.info{
+	margin-bottom: 50rpx;
+	font-size: 24rpx;
+	font-weight: 400;
+	color: #999999;
+	line-height: 33rpx;
+}
+.page-wrap{
+	font-size: 26rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 44rpx;
+	p{
+		text-indent: 2em;
+	}
+	/deep/ .u-image{
+		margin-bottom: 20rpx;
+	}
+}
+.content{
+	font-size: 26rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 44rpx;
+	margin: 20rpx 0;
+}
+.u-image{
+	max-width: 100%;
+}
+</style>

+ 1 - 1
shopping/producTypetList.vue

@@ -72,7 +72,7 @@
 												</view>
 											</view>
 											<view class="down">
-												<text class="original-price gray line-through">¥ {{item.salePrice}}</text>
+												<!-- <text class="original-price gray line-through">¥ {{item.salePrice}}</text> -->
 											</view>
 										</view>
 										<u--image :showLoading="false" @click.native.stop="addCart(item.id)" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image>

+ 2 - 1
shopping/productdetails.vue

@@ -347,10 +347,11 @@
 	}
 	.right{
 		.btn{
-			padding: 19rpx 40rpx;
+			padding: 10rpx 40rpx;
 			border-radius: 40rpx;
 			color: #fff;
 			margin-right: 20rpx;
+			font-size: 30rpx;
 		}
 		.add-btn{
 			background-color: #FFB100;