Quellcode durchsuchen

项目商机列表

zhaoxiaohai vor 2 Jahren
Ursprung
Commit
d93ecf346e

+ 11 - 0
packageA/project/modules/list/index.js

@@ -0,0 +1,11 @@
+Component({
+    properties: {
+        list:Array
+    },
+    data: {
+
+    },
+    methods: {
+
+    }
+})

+ 6 - 0
packageA/project/modules/list/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-circle": "@vant/weapp/circle/index"
+    }
+}

+ 79 - 0
packageA/project/modules/list/index.scss

@@ -0,0 +1,79 @@
+.project-item {
+    display: flex;
+    align-items: center;
+    width: 100vw;
+    background-color: #ffffff;
+    border-bottom: 1px solid#F4F4F4;
+    box-sizing: border-box;
+
+    .chart {
+        margin: 0 30rpx;
+        width: 100rpx;
+        flex-shrink: 0;
+
+        .odds,
+        .percentage {
+            width: 100%;
+            text-align: center;
+            font-size: 16rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            margin-top: 4rpx;
+        }
+
+        .odds {
+            margin-top: -6rpx;
+        }
+    }
+
+    .main {
+        flex: 1;
+        box-sizing: border-box;
+        padding: 20rpx 0;
+
+        .label {
+            display: flex;
+            height: 42rpx;
+
+            .title {
+                flex: 1;
+                width: 0;
+                font-size: 30rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #333333;
+                margin-right: 20rpx;
+            }
+
+            .state {
+                flex-shrink: 0;
+                width: 132rpx;
+                height: 40rpx;
+                line-height: 40rpx;
+                background: #52C41A;
+                border-radius: 20rpx 0px 0px 20rpx;
+                font-size: 24rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #FFFFFF;
+                text-align: center;
+            }
+
+        }
+
+        .replenish {
+            display: flex;
+            min-height: 34rpx;
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #333333;
+            margin-top: 8rpx;
+            word-break: break-all;
+            white-space: pre-wrap;
+        }
+    }
+}
+
+.line-1 {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}

+ 36 - 0
packageA/project/modules/list/index.wxml

@@ -0,0 +1,36 @@
+<navigator url="#" class="project-item" wx:for="{{list}}" wx:key="item.sa_projectid">
+    <view class="chart">
+        <van-circle value="{{ handle.num(item.winrate) }}" stroke-width="6" size="50">
+            <view class="odds">赢率</view>
+            <view class="percentage">{{item.winrate}}</view>
+        </van-circle>
+    </view>
+    <view class="main">
+        <view class="label">
+            <view class="title line-1">{{item.projectname}}</view>
+            <view class="state">进行中</view>
+        </view>
+        <view class="replenish">
+            <text style="color: #666;">项目编号:</text>
+            <text>{{item.projectnum}}</text>
+        </view>
+        <view class="replenish">
+            <text style="color: #666;">项目地址:</text>
+            <text>{{item.province+item.city+item.county+item.address}}</text>
+        </view>
+        <view class="replenish">
+            <text style="color: #666;">项目类型:</text>
+            <text>{{item.projecttype}}</text>
+        </view>
+        <view class="replenish">
+            <text style="color: #666;">负责人:</text>
+            <text>{{item.projecttype}}</text>
+        </view>
+    </view>
+</navigator>
+
+<wxs module="handle">
+    module.exports.num = function (str) {
+        return str.substring(0, str.length - 1)
+    }
+</wxs>