Browse Source

feature: 加入多张图片展示

Damon 1 năm trước cách đây
mục cha
commit
0ec76df1fe

+ 13 - 0
pages/piano/wallpaper/wallpaper.js

@@ -10,6 +10,19 @@ Page({
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
       title: '壁纸', //导航栏 中间的标题
       title: '壁纸', //导航栏 中间的标题
     },
     },
+    topList: [{
+      name: "图片4",
+      image: "./../../../img/min.png",
+    }, {
+      name: "图片1",
+      image: "./../../../img/min.png",
+    }, {
+      name: "图片2",
+      image: "./../../../img/min.png",
+    }, {
+      name: "图片3",
+      image: "./../../../img/min.png",
+    }, ],
   },
   },
 
 
   /**
   /**

+ 9 - 0
pages/piano/wallpaper/wallpaper.wxml

@@ -4,6 +4,15 @@
 
 
   <view class="public">
   <view class="public">
     <image class="image_top" src="./../../../img/min.png"></image>
     <image class="image_top" src="./../../../img/min.png"></image>
+
+    <view class="top_item_public_add">
+      <view class="top_item_public" wx:for="{{topList}}" wx:key="key" wx:for-item="item" wx:for-index="index">
+        <view bind:tap="clickTopItem" data-index="{{index}}">
+          <image class="top_image" mode="heightFix" src="{{item.image}}"></image>
+          <view>{{item.name}}</view>
+        </view>
+      </view>
+    </view>
   </view>
   </view>
 
 
 
 

+ 26 - 2
pages/piano/wallpaper/wallpaper.wxss

@@ -6,6 +6,30 @@
 
 
 .image_top {
 .image_top {
   margin-top: 40rpx;
   margin-top: 40rpx;
-  height: 60vw;
-  width: 80vw;
+  height: 40vw;
+  width: 60vw;
+}
+
+.top_item_public_add {
+  display: -webkit-flex;
+  display: flex;
+  margin-top: 40rpx;
+  align-items: center;
+  justify-content: flex-start;
+  flex-wrap: wrap;
+  width: 100%;
+}
+
+.top_item_public {
+  justify-content: center;
+  flex: 0 0 auto;
+  width: 50%;
+  text-align: center;
+  color: #797979;
+  padding: 40rpx 0;
+  font-size: 30rpx;
+}
+
+.top_image {
+  height: 20vw;
 }
 }

+ 7 - 0
project.private.config.json

@@ -9,6 +9,13 @@
     "miniprogram": {
     "miniprogram": {
       "list": [
       "list": [
         {
         {
+          "name": "壁纸",
+          "pathName": "pages/piano/wallpaper/wallpaper",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
           "name": "登录",
           "name": "登录",
           "pathName": "pages/login/login",
           "pathName": "pages/login/login",
           "query": "",
           "query": "",