Selaa lähdekoodia

上传文件至 '微信小程序/douban/components/onecomment'

13395952019 6 vuotta sitten
vanhempi
commit
77a700123f

+ 26 - 0
微信小程序/douban/components/onecomment/onecomment.js

@@ -0,0 +1,26 @@
+// components/onecomment/onecomment.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    item:{
+      type:Object,
+      value:null
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 6 - 0
微信小程序/douban/components/onecomment/onecomment.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "stars": "/components/stars/stars"
+  }
+}

+ 15 - 0
微信小程序/douban/components/onecomment/onecomment.wxml

@@ -0,0 +1,15 @@
+<view class='comment-group'>
+    <view class='left-comment'>
+      <image class='avatar' src='{{item.user.avatar}}'></image>
+    </view>
+    <view class='right-comment'>
+      <view class='username-rate'>
+        <text class='username'>{{item.user.name}}</text>
+        <stars rate="{{item.rating.value*2}}" starsize="30" istext='{{false}}'></stars>
+      </view>
+      <view class='release-time'>{{item.create_time}}</view>
+      <view class='content'>
+        {{item.comment}}
+      </view>
+    </view>
+  </view>

+ 36 - 0
微信小程序/douban/components/onecomment/onecomment.wxss

@@ -0,0 +1,36 @@
+.comment-group{
+  display: flex;
+  justify-content: flex-start;
+  padding-top: 40rpx;
+}
+.comment-group .left-comment{
+  width: 70rpx;
+  margin-right: 20rpx;
+}
+.left-comment .avatar{
+  width: 70rpx;
+  height: 70rpx;
+  border-radius: 50%;
+}
+.comment-group .right-comment{
+  flex: 1;
+}
+.right-comment .username-rate{
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+.username-rate .username{
+  font-size: 36rpx;
+  margin-right: 20rpx;
+}
+.release-time{
+  color: #b3b3b3;
+  font-size: 32rpx;
+  margin-top: 10rpx;
+}
+.content{
+  font-size: 32rpx;
+  color: #353535;
+  margin-top: 10rpx;
+}