Home >WeChat Applet >Mini Program Development >WeChat Mini Program Example: Introduction to the method of building a static page for details page

WeChat Mini Program Example: Introduction to the method of building a static page for details page

不言
不言Original
2018-09-04 16:41:335960browse

This article brings you an example of a WeChat mini program: an introduction to the method of building a static page for details. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. Create a new directory

detail

under the pages directory, and create a new page detail:
WeChat Mini Program Example: Introduction to the method of building a static page for details page
in detail .json First change the text content of the navigation bar title:

{
  "navigationBarTitleText": "DETAIL页面"
}

detail.wxml

<!--pages/detail/detail.wxml--><view class=&#39;detailContainer&#39;>
  <image class=&#39;headImg&#39; src=&#39;/images/detail/carousel/1.jpg&#39;></image>
  <view class=&#39;avatar_date&#39;>
    <image src=&#39;/images/avatar/0.png&#39;></image>
    <text>美国队长</text>
    <text>发布于</text>
    <text>2018 06 12</text>
  </view>
  <text class=&#39;company&#39;>火影村</text>
  <view class=&#39;collection_share_container&#39;>
    <view class=&#39;collection_share&#39;>
      <image src=&#39;/images/icon/collection-anti.png&#39;></image>
      <image src=&#39;/images/icon/share-anti.png&#39;></image>
    </view>
    <view class=&#39;line&#39;></view>
  </view>
  <button>转发此文章</button>
  <text class=&#39;content&#39;>火咖啡馆就是了疯狂关键时刻来得及公司领导看过就发上来的考试管理的风格就是的离开几个老师</text></view>

detail.wxss

/* pages/detail/detail.wxss */
.detailContainer {
  display: flex;  
  flex-direction: column;
  }
.headImg{
  width:100%;  
  height:460rpx;
  }
.avatar_date{
  padding: 10rpx;
  }
.avatar_date image{
  width: 64rpx;  
  height: 64rpx;  
  vertical-align: middle;
  }
.avatar_date text{
  font-size: 32rpx;  
  margin-left: 10rpx;
  }
.company{
  font-size: 38rpx;  
  font-weight: bold;  
  margin-left: 10rpx;
  }
.collection_share_container{
  position: relative;
  }
.collection_share{
  float: right;  
  margin-right: 50rpx;
  }
.collection_share image{
  width: 90rpx;  
  height: 90rpx;  
  margin-right: 20rpx;
  }
.line{
  width: 90%;  
  height: 2rpx;  
  background: rgb(226, 19, 19);  
  top: 45rpx;  
  left: 5%;  
  position: absolute;  
  z-index: -1;
  }
button{
  width: 280rpx;  
  height: 80rpx;
  }
.content{
  font-size: 32rpx;  
  text-indent: 64rpx;  
  margin: 50rpx 0;
  }

The renderings are as follows:
WeChat Mini Program Example: Introduction to the method of building a static page for details page

Related recommendations:

Detailed explanation of WeChat mini program case: Page construction

WeChat Mini Program Development-Creating a Welcome Page

The above is the detailed content of WeChat Mini Program Example: Introduction to the method of building a static page for details page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn