Quellcode durchsuchen

1、修改列表组件

zhoux vor 2 Jahren
Ursprung
Commit
3de6f6de7b

+ 21 - 0
components/dkbase/dk-list/dk-list.js

@@ -70,6 +70,10 @@ Component({
     footerAmount: {
       type: Object
     },
+    // 底部tag的名称
+    footerTag:{
+      type:String,
+    },
     // 按钮信息
     buttonList: {
       type: Array
@@ -103,6 +107,23 @@ Component({
    * 组件的方法列表
    */
   methods: {
+     /**
+     * @desc   : 打电话
+     * @author : 周兴
+     * @date   : 2024/2/19 11:46
+     */
+    openTelPhone(e) {
+      if(!e.currentTarget.dataset.phone){
+        return;
+      }
+      let tel = e.currentTarget.dataset.value
+      if(!tel){
+        return;
+      }
+      wx.makePhoneCall({
+        phoneNumber: tel,
+      })
+    },
     /**
      * @desc   : 跳转明细页面
      * @author : 周兴

+ 18 - 8
components/dkbase/dk-list/dk-list.wxml

@@ -57,24 +57,34 @@
           <view class="table-content-row-font">
             <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="{{col.title}}" copyValue="{{wxmlUtil.setItemValue(item,col.name)}}"></dk-text>
           </view>
-          <view class="table-content-class">
+          <view class="table-content-class" catchtap="openTelPhone" data-phone="{{col.phone}}" data-value="{{item[col.name]}}">
             {{wxmlUtil.setItemValue(item,col.name)}}
           </view>
         </view>
       </view>
 
+      <!--内容标签-->
+      <view style="display: flex;margin: 12rpx 32rpx;" wx:if="{{item.tags && item.tags.length > 0}}">
+        <view style="font-size: 13px;" wx:for="{{item.tags}}" wx:key="indext" wx:for-index="indext" wx:for-item="itemt">
+          <dk-tag border="1rpx solid #606EB2" height="32rpx" color="transparent" textColor="#606EB2" radius="5rpx" roundFlag="{{true}}" marginRight="12rpx" value="{{item.tags[indext]}}"></dk-tag>
+        </view>
+      </view>
+
       <!-- 分割线 -->
       <view style="padding-left:32rpx;padding-right:32rpx;" wx:if="{{footerInfo && footerInfo.length > 0}}">
         <view style="border: 1rpx solid #E9F0FE;height: 0px;"></view>
       </view>
 
       <!-- 底部 -->
-      <view class="table-content-row" style="padding-top: 0rpx;"  wx:if="{{footerInfo && footerInfo.length > 0}}">
+      <view class="table-content-row" style="padding-top: 0rpx;" wx:if="{{footerInfo && footerInfo.length > 0}}">
         <view style="display: flex; justify-content: space-between;">
           <view class="category-class">
             {{wxmlUtil.setFooterItemValue(item,footerInfo)}}
           </view>
-          <view class="totalamount-class">
+          <view class="footer-tag-class" wx:if="{{footerTag && item[footerTag]}}">
+            <dk-tag  border="1rpx solid #606EB2" height="32rpx" color="transparent" textColor="#606EB2" radius="5rpx" roundFlag="{{true}}" value="{{item[footerTag]}}"></dk-tag>
+          </view>
+          <view class="totalamount-class" wx:else>
             <dk-cell left="0rpx" center="{{(footerInfo && footerInfo.length > 0)?'space-around':'space-between'}}" contentRight="{{true}}" fontSize="15" contentFontSize="17" contentColor="#CAA977" titleColor="#1B365D;" contentFontWeight="bold" title="{{footerAmount.title}}" content="{{item[footerAmount.name]}}"></dk-cell>
           </view>
         </view>
@@ -82,12 +92,12 @@
 
       <!-- 收款状态和收款 -->
       <view wx:if="{{!!item.collectStatus}}" class="bottom-bar">
-      <view class="bottom-title-class">
-        <view >
-          {{$t[item.collectStatus]}}
+        <view class="bottom-title-class">
+          <view>
+            {{$t[item.collectStatus]}}
+          </view>
+          <dk-cell wx:if="{{item.collectStatusAmount}}" contentFontSize="14" height="44rpx" fontWeight="600" left="0rpx" contentColor="#1B365D" title="" content="{{ item.collectStatusAmount}}"></dk-cell>
         </view>
-        <dk-cell wx:if="{{item.collectStatusAmount}}" contentFontSize="14" height="44rpx" fontWeight="600" left="0rpx" contentColor="#1B365D" title="" content="{{ item.collectStatusAmount}}"></dk-cell>
-      </view>
 
         <view class="collect-class">
           <view>{{item.collectName?item.collectName:collectName}}</view>

+ 6 - 0
components/dkbase/dk-list/dk-list.wxss

@@ -102,6 +102,12 @@
   text-align: right !important;
 }
 
+.footer-tag-class{
+  width: 100%;
+  margin-top: 20rpx;
+  text-align: right !important;
+}
+
 /**副标题*/
 .sub-title-class {
   display: flex;

+ 2 - 2
package-basic-data/pages/test/test.js

@@ -23,7 +23,7 @@ Page({
     pullMenuList: [{ code: 'outStatus', pullType: 'mSelect', typeName: 'outStatus' }, { code: 'receiveStatus', pullType: 'mSelect', typeName: 'receiveStatus' }, { code: 'followCount', dataType: 'number' }, { code: 'nextFollowTime', dataType: 'date' }],
 
     // 假数据
-    dataList: [{ salesChannelName: '零售', customerId: 11, customerName: '张三', displayStatus: '成交',backgroundColor:'red', orderNo: 'SA-LWYD-ZOO-202401300SBG', customerPhone: '15659741980', addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1', orgName: '零售部',collectName:'付款', staffName: '薛玉', tsumAmount: 3000, categoryQuantity: 1, tsumQuantity: 1, makeTime: '2023-1-3' ,collectStatus:'noCollect',collectAmount:1000,collectStatusAmount:200}, { salesChannelName: '分销', customerName: '李四', displayStatus: '未成交', orderNo: 'SA-LWYD-ZOO-202401300SBD', customerPhone: '15659741980', addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)2', orgName: '零售部', staffName: '薛玉', tsumAmount: 4000, categoryQuantity: 2, tsumQuantity: 2, makeTime: '2023-12-3',collectStatus:'noCollect',collectAmount:1000 }],
+    dataList: [{ salesChannelName: '零售', customerId: 11, customerName: '张三', displayStatus: '成交',backgroundColor:'red', orderNo: 'SA-LWYD-ZOO-202401300SBG', customerPhone: '15659741980', addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1', orgName: '零售部',collectName:'付款', staffName: '薛玉', tsumAmount: 3000, categoryQuantity: 1, tsumQuantity: 1, makeTime: '2023-1-3' ,collectStatus:'noCollect',collectAmount:1000,collectStatusAmount:200,customerForm:'自然进店',tags:['ff','ddd']}, { salesChannelName: '分销', customerName: '李四', displayStatus: '未成交', orderNo: 'SA-LWYD-ZOO-202401300SBD', customerPhone: '15659741980', addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)2', orgName: '零售部', staffName: '薛玉', tsumAmount: 4000, categoryQuantity: 2, tsumQuantity: 2, makeTime: '2023-12-3',collectStatus:'noCollect',collectAmount:1000 }],
 
     // 列表区(脚部金额)
     footerAmount: { name: 'tsumAmount', title: '合计金额' },
@@ -33,7 +33,7 @@ Page({
     contentList: [{ name: 'orderNo', title: '订单单号' }, { name: 'customerPhone', title: '客户电话' }, { name: 'addressFull', title: '客户地址' }, { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '客户地址' }],
 
     contentObj: {
-      '成交': [{ name: 'orderNo', title: '订单单号' }, { name: 'customerPhone', title: '客户电话' }, { name: 'addressFull', title: '客户地址' }, { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '客户地址' }],
+      '成交': [{ name: 'orderNo', title: '订单单号' }, { name: 'customerPhone', title: '客户电话',phone:true }, { name: 'addressFull', title: '客户地址' }, { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '客户地址' }],
       '未成交': [{ name: 'orderNo', title: '订单单号' }, { name: 'customerPhone', title: '客户电话' }, { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '客户地址' }]
     },
 

+ 1 - 1
package-basic-data/pages/test/test.wxml

@@ -11,7 +11,7 @@
 <van-empty wx:if="{{dataList.length<=0}}" description="暂无数据" />
 
 <!-- 列表区 -->
-<dk-list list="{{dataList}}" titleCorner="salesChannelName" title="customerName" status="displayStatus" collectCol="collectAmount" collectName="收款" subTitle="makeTime" content="{{contentList}}" contentObj="{{contentObj}}" contentCol="displayStatus" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+<dk-list list="{{dataList}}" titleCorner="salesChannelName" title="customerName" status="displayStatus" footerTag="customerForm" collectCol="collectAmount" collectName="收款" subTitle="makeTime" content="{{contentList}}" contentObj="{{contentObj}}" contentCol="displayStatus" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
 
 <van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">到底了~</van-divider>
 <view style="height: 135rpx;"></view>