Jelajahi Sumber

Merge branch 'master' of http://git.cc-lotus.info/pointToNetwork/point-app

zs 2 tahun lalu
induk
melakukan
ff207abdc4
3 mengubah file dengan 77 tambahan dan 8 penghapusan
  1. 11 0
      pages.json
  2. 11 8
      pages/home/index.vue
  3. 55 0
      pagesRest/article/index.vue

+ 11 - 0
pages.json

@@ -279,6 +279,17 @@
 				}
 
 			]
+		},
+		{
+			"root": "pagesRest",
+			"pages": [
+				{
+					"path": "article/index",
+					"style": {
+						"navigationBarTitleText": "详细信息"
+					}
+				}
+			]
 		}
 	],
 	"globalStyle": {

+ 11 - 8
pages/home/index.vue

@@ -1,17 +1,14 @@
 <template>
 	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
-		<scroll-view scroll-y="true" class="scroll-view" scroll-with-animation :scroll-top="scrollTop" @scroll="scroll"
-			@scrolltolower="toPage">
+		<scroll-view scroll-y="true" class="scroll-view" scroll-with-animation :scroll-top="scrollTop" @scroll="scroll" @scrolltolower="toPage">
 			<view class="list-scroll-view">
 				<view class="main">
 					<view class="zero one">
-						<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')"
-							placeholder-class="placss">
+						<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
 					</view>
 					<view class="zero two">
-						<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
-							indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
-							<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
+						<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
+							<swiper-item class="list" v-for="(item,index) in bannerList" :key="index" @tap="toBanner(item)">
 								<image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode="">
 								</image>
 							</swiper-item>
@@ -137,6 +134,12 @@
 					url: `/${e}`
 				})
 			},
+			// 轮播图跳转
+			toBanner(e) {
+				uni.navigateTo({
+					url: `/${e.to}?id=${e._id}`
+				})
+			},
 			// 首页模块菜单跳转
 			toIndexModel(data) {
 				if (data && data.status == '1') {
@@ -187,7 +190,7 @@
 					uni.hideLoading();
 				} else uni.showToast({
 					title: '没有更多数据了',
-					icon:'none'
+					icon: 'none'
 				});
 			},
 			// 计算高度

+ 55 - 0
pagesRest/article/index.vue

@@ -0,0 +1,55 @@
+<template>
+	<mobile-frame>
+		<view class="main">
+			<view class="one">
+				<rich-text :nodes="info.content"></rich-text>
+			</view>
+		</view>
+	</mobile-frame>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id: '',
+				info: {}
+			};
+		},
+		onLoad: function(e) {
+			const that = this;
+			that.$set(that, `id`, e.id || '')
+		},
+		onShow: function() {
+			const that = this;
+			that.search();
+		},
+		methods: {
+			async search() {
+				const that = this;
+				const res = await that.$api(`/banner/${that.id}`, 'GET');
+				if (res.errcode == '0') {
+					that.$set(that, `info`, res.data)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'none'
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+		}
+	}
+</style>