lhl 3 年之前
父節點
當前提交
7d05c36c1b
共有 3 個文件被更改,包括 164 次插入3 次删除
  1. 51 0
      api/index.js
  2. 7 0
      pages.json
  3. 106 3
      pages/story/storyDetail.vue

+ 51 - 0
api/index.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 促销商品
+export function groom4(data) {
+	return request({
+		url: '/api/groom/list/4',
+		method: 'get',
+		data
+	});
+}
+// 精品推荐
+export function groom1(data) {
+	return request({
+		url: '/api/groom/list/1',
+		method: 'get',
+		data
+	});
+}
+// 新品首发
+export function groom3(data) {
+	return request({
+		url: '/api/groom/list/3',
+		method: 'get',
+		data
+	});
+}
+
+// 获取首页信息
+export function loadIndexs(data) {
+	return request({
+		url: '/api/index',
+		method: 'get',
+		data
+	});
+}
+//获取文章列表
+export function article(data,id) {
+	return request({
+		url: '/api/article/list/' + id,
+		method: 'get',
+		data
+	});
+}
+//获取文章详情
+export function details(data,id) {
+        return request({
+                url: '/api/article/details/'+id,
+                method: 'GET',
+                data
+        });
+}

+ 7 - 0
pages.json

@@ -109,6 +109,13 @@
 				
 			}
 		},
+		{
+			"path": "pages/story/storyDetail",
+			"style": {
+				// "navigationBarTitleText": "品牌故事",
+				"navigationStyle": "custom"
+			}
+		},
 		{
 			"path": "pages/order/order",
 			"style": {

+ 106 - 3
pages/story/storyDetail.vue

@@ -1,8 +1,111 @@
-<template>
+<template>
+	<view class="content">
+		<view class="top">
+			<image src="" mode=""></image>
+		</view>
+		<view class="detail">
+			<view class="detail-top">
+				<view class="tit">
+					正一健康竹胎酵素饮正一健康竹胎酵素饮正
+				</view>
+				<view class="time">
+					更新时间:2019-12-06
+				</view>
+			</view>
+			<view class="jg">
+				
+			</view>
+			<view class="detail-content" v-html="content">
+				
+			</view>
+		</view>
+	</view>
 </template>
 
-<script>
+<script>
+	import {article,details} from '@/api/index.js'
+	export default {
+		data() {
+			return {
+				content: '正一健康竹胎酵素饮正一健康竹胎酵素饮正正一健康竹胎酵素饮正一健康竹胎酵素饮正正一健康竹胎酵素饮正一健康竹胎酵素饮正正一健康竹胎酵素饮正一健康竹胎酵素饮正',
+				detail: {},
+			}
+			
+		},
+		onLoad(opt) {
+			if(opt.id) {
+				this.getDetail(opt.id)
+			}
+		},
+		methods: {
+			getDetail(id) {
+				let obj = this
+				details({},id).then( res => {
+					obj.content = res.data.content
+					obj.detail = res.data
+				})
+			}
+		}
+	}
 </script>
 
-<style>
+<style lang="scss" scoped>
+	page {
+		height: 100%;
+	}
+	.content {
+		background-color: #fff;
+		height: 100%;
+		.top {
+			width: 750rpx;
+			height: 668rpx;
+			image {
+				width: 100%;
+				height: 100%;
+				background-color: #999;
+			}
+		}
+		.detail {
+			position: relative;
+			top: -57rpx;
+			.jg {
+				width: 670rpx;
+				height: 2rpx;
+				background: #F5F5F5;
+				margin: auto;
+			}
+			.detail-top {
+				min-height: 190rpx;
+				padding: 57rpx 40rpx 40rpx;
+				background-color: #fff;
+				border-radius: 30rpx 30rpx 0 0;
+				.tit {
+					font-size: 48rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #333333;
+					line-height: 51rpx;
+				}
+				.time {
+					padding-top: 10rpx;
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999;
+					line-height: 51rpx;
+				}
+			}
+			.detail-content {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #333333;
+				line-height: 48rpx;
+				padding: 37rpx 40rpx;
+				* {
+					max-width: 100%;
+				}
+			}
+		}
+	}
 </style>