Ver Fonte

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

王英杰 há 1 ano atrás
pai
commit
82c8981f24

+ 2 - 1
app.json

@@ -364,7 +364,8 @@
         "dk-goos-list": "components/dkbase/dk-goos-list/dk-goos-list",
         "dk-stepper": "components/dkbase/dk-stepper/dk-stepper",
         "dk-navbar": "components/dkbase/dk-navbar/dk-navbar",
-        "dk-swiper": "components/dkbase/dk-swiper/dk-swiper"
+        "dk-swiper": "components/dkbase/dk-swiper/dk-swiper",
+        "dk-select-field": "components/dkbase/dk-select-field/dk-select-field"
     },
     "tabBar": {
         "color": "#95A8CB",

+ 0 - 1
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -1843,7 +1843,6 @@ Component({
         }
         instance.close();
       }
-      console.log('bbbb',this.data.cardList,this.data.form,this.data.contentObj);
       let form = this.data.form
       // 如果删除的是外部的
       if(item.show == undefined || item.show){

+ 54 - 5
components/dkbase/dk-form-more-items/dk-form-more-items.js

@@ -171,7 +171,8 @@ Component({
     itemName: 'itemList',
     deleteName: 'deleteList',
     itemsContent: [{ code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' }, { code: 'collectAmount', type: 'number', title: '收款金额', required: true }],
-    form: {}
+    form: {},
+    imageUrl: config.image_url + '/static/img/',
   },
   lifetimes: {
     attached: function () {
@@ -564,7 +565,7 @@ Component({
           index: item.index,
           card: item.card
         })
-      } else if (item.item.type == 'choose') {
+      } else if (item.item.type == 'choose' || item.item.type == 'selectIcon') {
         // 跳转链接
         if (item.item.urlKey) {
           this.setData({
@@ -654,9 +655,18 @@ Component({
               // 如果必须输入,就要进行判断
               if (item.required && form[this.data.itemName] && form[this.data.itemName].length > 0) {
                 form[this.data.itemName].forEach(t => {
-                  if (!t[item.code]) {
-                    t[item.code + '_errMsg'] = title + '不为空'
-                    flag = false;
+                  if(!item.validNameFlag){
+                    // 默认校验编码
+                    if (!t[item.code]) {
+                      t[item.code + '_errMsg'] = title + '不为空'
+                      flag = false;
+                    }
+                  }else{
+                    // 校验名称
+                    if (!t[item.name]) {
+                      t[item.code + '_errMsg'] = title + '不为空'
+                      flag = false;
+                    }
                   }
                 })
               }
@@ -1128,6 +1138,27 @@ Component({
       })
     },
     /**
+     * @desc   : SelectField组件输入回调
+     * @author : 刘尧
+     * @date   : 2024/7/2 09:59
+     */
+    inputSelectField(e){
+        const form = this.data.form
+        let item = form[this.data.itemName]
+        const index = e.currentTarget.dataset.index
+        const dataItem = e.currentTarget.dataset.item
+        const itemName = e.currentTarget.dataset.item.name
+        const data = item[index]
+        data[itemName] = e.detail
+        const contentObj = this.data.contentObj
+        // 避免校验code 导致无法添加信息
+        contentObj.items[contentObj.items.findIndex((item) => item.code == dataItem.code)].validNameFlag = true
+        this.setData({
+          form: form,
+          contentObj: contentObj
+        })
+    },
+    /**
      * @desc : 设置明细列展示内容
      * @author : 周兴
      * @date : 2024/1/19
@@ -1136,6 +1167,24 @@ Component({
       moreItemsType
     },
     /**
+     * @desc   : SelectField组件选择回调
+     * @author : 刘尧
+     * @date   : 2024/7/2 14:13
+     */
+    selectCellValue(e){
+      const form = this.data.form
+      let item = form[this.data.itemName]
+      const index = e.currentTarget.dataset.index
+      const itemName = e.currentTarget.dataset.item.name
+      const dataSetItem = e.currentTarget.dataset.item
+      const data = item[index]
+      data[itemName] = e.detail.supName
+      data[dataSetItem.code] = e.detail[dataSetItem.code]
+      this.setData({
+        form: form
+      })
+    },
+    /**
      * @desc : 获取语言的方法
      * @author : 周兴
      * @date : 2024/1/19

+ 6 - 0
components/dkbase/dk-form-more-items/dk-form-more-items.wxml

@@ -71,6 +71,12 @@
             <van-field wx:if="{{item.type=='choose' }}" required="{{item.required?true:false }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{indext}}" data-card="{{card.name}}" value="{{ itemt[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" label-class="{{(!!readonly || !!item.readonly)?'readonly-label':'nomal-label'}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{itemt[item.code + '_errMsg']}}">
               <van-icon wx:if="{{!readonly &&  itemt[item.name]}}" slot="icon" name="clear" color="#c8c9cc;" data-item="{{item}}" data-name="{{item.name}}" data-card="{{card.name}}" data-key="{{item.code}}" catchtap="clearChoose"></van-icon>
             </van-field>
+            <!-- 新选单 -->
+            <!-- <van-field wx:if="{{item.type=='selectIcon'}}" required="{{item.required?true:false }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{indext}}" data-card="{{card.name}}" value="{{itemt[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!readonly || !!item.readonly}}" label-class="{{(!!readonly || !!item.readonly)?'readonly-label':'nomal-label'}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{itemt[item.code + '_errMsg']}}">
+              <van-icon slot="right-icon" name="{{imageUrl+'/select_cus.png'}}" color="#c8c9cc;" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{indext}}" data-card="{{card.name}}" size="20px" catchtap="open" data-type='{{item.dropType}}'></van-icon>
+            </van-field> -->
+            <dk-select-field wx:if="{{item.type=='selectIcon'}}" fieldValue="{{itemt[item.name]}}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{indext}}" data-card="{{card.name}}" required="{{item.required?true:false }}" labelClass="{{(!!readonly || !!item.readonly)?'readonly-label':'nomal-label'}}" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" border="{{ false }}" inputClass="dk-cell-value-class" readonly="{{!!readonly || !!item.readonly}}" errorMessage="{{itemt[item.code + '_errMsg']}}" iconUrl="{{imageUrl+'/select_cus.png'}}" bind:iconClick="open" valueList="{{item.data}}" bind:inputValue="inputSelectField" bind:selectCellValue="selectCellValue">
+            </dk-select-field>
             <!--选择框-->
             <van-field wx:if="{{item.type=='checkbox'}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="{{(!!readonly || !!item.readonly)?'readonly-label':'nomal-label'}}" input-align="left" value="{{ itemt[item.code] ? '  需要' : '  不需要' }}" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{itemt[item.code + '_errMsg']}}">
               <view slot="inputbefor" style="text-align: left;padding-left: 10rpx;" data-item="{{item}}" data-index="{{indext}}" data-card="{{card.name}}" data-value="{{itemt[item.code]}}" data-key="{{item.code}}" catchtap="onItemChange">

+ 4 - 3
components/dkbase/dk-number-input/dk-number-input.js

@@ -299,10 +299,11 @@ Component({
       if (flag) {
         let value = 0;
         let detailValue = e.detail
+        //影响输入小数点 有问题!!!
         // 直接变为负
-        if (this.data.negative) {
-          detailValue = -1 * Math.abs(detailValue)
-        }
+        // if (this.data.negative) {
+        //   detailValue = -1 * Math.abs(detailValue)
+        // }
         // 判断是否超过最大值
         if (this.data.maxFlag) {
           if (detailValue > this.data.max) {

+ 2 - 13
components/dkbase/dk-popup/dk-popup.js

@@ -9,18 +9,7 @@
  *******************************************************************************/
 const util = require('@/utils/util.js')
 const app = getApp();
-// 防抖函数 - 2024/6/28 于继渤
-function debounce(func, wait) {
-  let timeout;
-  return function() {
-    const context = this;
-    const args = arguments;
-    clearTimeout(timeout);
-    timeout = setTimeout(() => {
-      func.apply(context, args);
-    }, wait);
-  };
-}
+
 Component({
   /**
    * 组件的属性列表
@@ -664,7 +653,7 @@ Component({
   lifetimes: {
     attached: function () {
       // 防抖
-      this.commit = debounce(this.commit, 400); 
+      this.commit = util.debounce(this.commit, this); 
     },
     detached: function () {
       // 在组件实例被从页面节点树移除时执行

+ 13 - 7
components/dkbase/dk-save-button/dk-save-button.js

@@ -6,7 +6,7 @@
  *		作者				日期					版本				修改内容
  *		周兴		  	2024-3-12			1.00		 底部工具栏-保存
  *******************************************************************************/
-
+const util = require('@/utils/util.js')
 Component({
   /**
    * 组件的属性列表
@@ -28,9 +28,9 @@ Component({
     btnAutoWidthFlag: {
       type: Boolean,
     },
-    checkFlag:{
+    checkFlag: {
       type: Boolean,
-      value:false,
+      value: false,
     },
     // 按钮是居右
     btnRightFlag: {
@@ -40,14 +40,18 @@ Component({
       type: String,
       value: 'default'
     },
-    countName: {  
+    countName: {
       type: String,
       value: '数量'
     },
-    countEnd: {  
+    countEnd: {
       type: String,
       value: '件'
     },
+    // loading:{
+    //   type:Boolean,
+    //   value:false
+    // },
     // 结果集
     value: {
       type: String,
@@ -69,7 +73,7 @@ Component({
    * 组件的初始数据
    */
   data: {
-    form: {}
+    form: {},
   },
 
   /**
@@ -77,6 +81,8 @@ Component({
     */
   lifetimes: {
     attached: function () {
+      // 防抖
+      this.submit = util.debounce(this.submit, this); 
     },
     detached: function () {
       // 在组件实例被从页面节点树移除时执行
@@ -93,7 +99,7 @@ Component({
      * @date   : 2024/2/2 11:46
      */
     change(e) {
-      if(this.data.checkFlag){
+      if (this.data.checkFlag) {
         return
       }
       let code = e.currentTarget.dataset.code

+ 112 - 0
components/dkbase/dk-select-field/dk-select-field.js

@@ -0,0 +1,112 @@
+// components/dkbase/dk-select-field/dk-select-field.js
+Component({
+
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+      label:{
+        type: String,
+      },
+      placeholder:{
+        type: String
+      },
+      inputClass:{
+        type:String
+      },
+      readonly:{
+        type: Boolean,
+        value: false
+      },
+      errorMessage:{
+        type: String
+      },
+      border:{
+        type: Boolean,
+        value: false
+      },
+      required: {
+        type: Boolean,
+        value: false
+      },
+      labelClass: {
+        type: String
+      },
+      iconUrl: {
+        type: String
+      },
+      fieldValue: {
+        type: String
+      },
+      valueList: {
+        type: Array
+      }
+    },
+    /**
+     * 组件的初始数据
+     */
+    data: {
+      selectListShow: false,
+      selectList: [],
+      fieldAddress:{}
+    },
+    lifetimes:{
+      attached(){
+        const that = this
+        const query = this.createSelectorQuery();
+        query.select("#vanField").boundingClientRect();
+        query.exec((res) => {
+          that.setData({
+            fieldAddress: res[0]
+          })
+        });
+      }
+    },
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+    /**
+     * @desc   : icon点击事件
+     * @author : 刘尧
+     * @date   : 2024/7/2 11:34
+     */
+      open(e){
+        this.triggerEvent('iconClick')
+      },
+      /**
+       * @desc   : 输入框失去焦点隐藏列表
+       * @author : 刘尧
+       * @date   : 2024/7/2 11:34
+       */
+      blurField(){
+        this.setData({
+          selectListShow: false
+        })
+      },
+      /**
+       * @desc   : 输入监听事件
+       * @author : 刘尧
+       * @date   : 2024/7/2 11:34
+       */
+      inputField(e){
+        const valueList = this.data.valueList
+        if(e.detail && e.detail !== ""){
+          const selectList = valueList.filter((item) => item.supName.includes(e.detail))
+          this.setData({
+            selectListShow: true,
+            selectList: selectList
+          })
+        }else {
+          this.setData({
+            selectListShow: false,
+            selectList: []
+          })
+        }
+        this.triggerEvent('inputValue', e.detail)
+      },
+      clickCell(e){
+        this.triggerEvent('selectCellValue', e.currentTarget.dataset.item)
+      }
+    }
+})

+ 4 - 0
components/dkbase/dk-select-field/dk-select-field.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 29 - 0
components/dkbase/dk-select-field/dk-select-field.wxml

@@ -0,0 +1,29 @@
+<view>
+  <van-field required="{{required}}" autosize border="{{ border }}" readonly="{{ false }}" id="vanField"
+    label="{{label}}" placeholder="{{placeholder}}" input-class="{{inputClass}}" readonly="{{readonly}}" errorMessage="{{errorMessage}}" label-class="{{labelClass}}" value="{{fieldValue}}" extra-event-params="{{true}}" bind:input="inputField" bind:blur="blurField">
+    <view slot="right-icon" catchtap="open">
+      <van-icon slot="right-icon" name="{{iconUrl}}" color="#c8c9cc;" size="20px"></van-icon>
+    </view>
+  </van-field>
+
+  <van-transition
+    show="{{ selectListShow && selectList.length !== 0}}"
+    name="fade-down"
+    duration="{{ { enter: 300, leave: 1000 } }}"
+    enter-class="van-enter-class"
+    enter-active-class="van-enter-active-class"
+    leave-active-class="van-leave-active-class"
+    leave-to-class="van-leave-to-class"
+  >
+  <view style="position: relative;width: 100%;height: auto;top: 5px;">
+    <view class="select-list">
+      <view class="select-list-item">
+        <van-cell-group style="max-height: 400rpx;">
+          <van-cell size="large" wx:for="{{selectList}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{indext}}" title="{{item.supName}}" bind:tap="clickCell"/>
+        </van-cell-group>
+      </view>
+    </view>
+  </view>
+  </van-transition>
+
+</view>

+ 152 - 0
components/dkbase/dk-select-field/dk-select-field.wxss

@@ -0,0 +1,152 @@
+/* components/dkbase/dk-select-field/dk-select-field.wxss */
+.select-list{
+  width: 67%;
+  padding: 15rpx;
+  background-color: #f8f8f8;
+  border-radius: 10rpx;
+  min-height: 100rpx;
+  position: absolute;
+  top: 0;
+  right: 15rpx;
+  z-index: 500;
+}
+
+.select-list-item{
+  min-height: 0rpx;
+}
+
+.readonly-label{
+  color: #95A8CB !important;
+}
+
+.nomal-label{
+  color: #002340 !important 
+}
+
+/**cell值颜色**/
+.dk-cell-value-class {
+  text-align: left !important;
+  font-size: 13px !important;
+  color: #002340 !important;
+  font-weight: normal;
+}
+
+/**cell值颜色**/
+.dk-cell-nomal-class {
+  text-align: left !important;
+  font-size: 13px !important;
+  color: #95A8CB !important;
+  font-weight: normal;
+}
+
+.cancel-class {
+  text-align: left;
+  padding-left: 10rpx;
+  padding-right: 10rpx;
+  display: flex;
+}
+
+/**cell值颜色**/
+.dk-cell-value-right-class {
+  text-align: right !important;
+  font-size: 13px !important;
+  color: #1B365D !important;
+  font-weight: normal;
+}
+
+/**cell空值颜色**/
+.dk-cell-value-empty-class {
+  text-align: left !important;
+  font-size: 13px !important;
+  color: #95A8CB !important;
+}
+
+.background-amount{
+  background: #FDF2E7;
+  padding: 10rpx 0rpx;
+  margin: 20rpx;
+  border-radius: 10rpx;
+}
+
+.corner-view {
+  position: absolute;
+  /* 扇形弧度 */
+  /* border-radius: 0 0 0 100rpx; */
+  /* 左上弧度 */
+  /* border-top-left-radius: 10rpx; */
+  /* 位置 */
+ 
+  top: 0;
+  right: 15px; 
+  width: 127rpx;
+  height: 90rpx; 
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.corner-view-text { 
+  /* 字体颜色 */
+  color: #95A8CB; 
+  /* font-size: 24rpx; */
+  /* font-weight: 600; */
+  font-size: 24rpx; 
+}
+
+.sign-class {
+  padding-left: 10rpx;
+  padding-right: 5rpx;
+  padding-bottom: 5rpx;
+  font-size: 12px;
+  display: flex;
+  align-items: flex-end;
+}
+
+.amount-class {
+  font-size: 18px;
+}
+
+.item-class {
+  display: flex;
+  font-size: 14px;
+  padding: 20rpx;
+}
+
+.item-title-class {
+  font-size: 16px;
+  color: #1B365D;
+  font-weight: 600;
+  width: 26%;
+}
+
+.item-count-class {
+  color: #95A8CB;
+  font-size: 12px;
+  display: flex;
+  align-items: flex-end;
+  width: 59%;
+}
+
+.grid-item-class {
+  padding: 0 !important;
+}
+
+
+.item-add-btn-class {
+  margin: 20rpx;
+  border: solid 3rpx #606EB2;
+  height: 40rpx;
+  border-radius: 40rpx;
+  background-color: #F8F9FD;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 40rpx;
+}
+
+.item-btn-title-class {
+  display: flex;
+  align-items: center;
+  font-size: 14px !important;
+  color: #1B365D !important;
+}

+ 3 - 0
components/dkbase/dk-stepper/dk-stepper.js

@@ -23,6 +23,9 @@ Component({
     min: {
       type: Number
     },
+    decimalLength:{
+      type: Number
+    },
     step: {
       type: Number,
       value: 1

+ 1 - 1
components/dkbase/dk-stepper/dk-stepper.wxml

@@ -5,7 +5,7 @@
       <!-- <input disabled class="number-content" style="width: {{inputWidth ? inputWidth: ''}};" bindtap="inputOnFocus" wx:if="{{ !checkFocus && shieldShow }}" value="{{ inputValue }}"></input> -->
       <image src="{{dataValue>min?'/static/image/btn-minus.png':'/static/image/btn-minus-d.png'}}" style="width: 36rpx;height:36rpx;" catchtap="handleMinus"></image>
       <view style="width: 200rpx;">
-        <dk-number-input digits="{{digits}}" fontSize="14" left="30rpx" formatThousandth="{{false}}" sign=""  min="{{min}}" negative="{{true}}" center="center" readonly="{{!!readonly }}" contentRight="{{false}}" inputColor="#FF7B1A" requiredLeft="15rpx" inputValue="{{dataValue}}" bind:triggerBindBlur="changeStep"></dk-number-input>
+        <dk-number-input digits="{{decimalLength}}"  fontSize="14" left="30rpx" formatThousandth="{{false}}" sign=""  min="{{min}}" negative="{{false}}" center="center" readonly="{{!!readonly }}" contentRight="{{false}}" inputColor="#FF7B1A" requiredLeft="15rpx" inputValue="{{dataValue}}" bind:triggerBindBlur="changeStep"></dk-number-input>
       </view>
       <image src="{{dataValue<max?'/static/image/btn-plus.png':'/static/image/btn-plus-d.png'}}" style="width: 36rpx;height:36rpx;" catchtap="handlePlus"></image>
     </view>

+ 44 - 6
package-base-select/pages/select-choose-coordination/select-choose-coordination.js

@@ -22,7 +22,8 @@ Page({
           code: 'supId',
           name: 'supName',
           title: mixins.$t("supplier"), //'供应商',
-          type: 'choose',
+          type: 'selectIcon',
+          readonly: false,
           required: true,
           urlKey: 'chooseOutSupplier'
         },
@@ -98,7 +99,6 @@ Page({
    */
   saveButton(e) {
     this.save({})
-   
   },
   /**
    * @desc : 保存数据服务
@@ -129,9 +129,40 @@ Page({
       delta: 1
     })
   },
-
-
-
+  /**
+   * @desc : 获取供应商信息
+   * @date : 2024/7/2 11:02
+   * @author : 刘尧
+   */
+  getSupData(){
+    let params = {}
+    params = this.setSearchParams(params)
+    const supplierService = app.globalData['supplierService']
+    return this.excute(supplierService, supplierService.selectByCond, params);
+  },
+  /**
+   * @desc : 获取数据回调
+   * @date : 2024/7/2 11:02
+   * @author : 刘尧
+   */
+  handleData(data){
+    const contentObj = this.data.contentObj
+    const items = contentObj.items
+    items[items.findIndex((item) => item.code === 'supId')].data = data
+    this.setData({
+      contentObj: contentObj
+    })
+  },
+  /**
+   * @desc : 设置查询参数
+   * @date : 2024/7/2 11:05
+   * @author : 刘尧
+   */
+  setSearchParams(params){
+    params.supType = ""
+    params.flgValid = true
+    return params
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -145,7 +176,14 @@ Page({
     // this.setData({
     //   formData: JSON.stringify(this.data.formData)
     // })
-
+  },
+  /**
+   * 生命周期函数--页面显示
+   */
+  onShow() {
+    this.getSupData().then(res => {
+      this.handleData(res.data.data.list)
+    })
   },
 
 

+ 0 - 1
package-base-select/pages/select-data/select-data.wxml

@@ -14,7 +14,6 @@
     <dk-tabs wx:if="{{tagList && tagList.length > 0}}" active="{{active}}" list="{{tagList}}" bind:onChange="onChangeTabs"> </dk-tabs>
   </view>
 </van-sticky>
-
 <!--简单列表-->
 <!-- <view wx:if="{{simpleFlag}}" style="margin-top:30rpx;">
   <view wx:for="{{tableData}}" data-item="{{item}}" wx:key="index" class="main-class main-item-class" style="{{item.checked? 'border: 1px solid #1B365D;':''}}" data-index="{{index}}" catchtap="choose">

+ 1 - 1
package-base-select/pages/select-data/select-data.wxss

@@ -76,4 +76,4 @@
 	background: linear-gradient(95.33deg, #ADC6FF -2.27%, #F0F5FF 60.66%),
     linear-gradient(0deg, #F4F8FF, #F4F8FF),
     radial-gradient(58.28% 235.72% at 10.78% 50%, rgba(191, 213, 255, 0.6) 0%, rgba(216, 229, 255, 0) 56.69%); 
-}
+}

+ 15 - 5
package-inventory/pages/ivt-sum-report/detail/detail.js

@@ -127,14 +127,24 @@ Page({
    * 跳转对应单据
    */
   toItem(param){
-    const code = this.data.tagList[this.data.active].code;
+    const code = this.data.tagList[this.data.active].code
     const data = param.currentTarget.dataset.value
     const e = {
+      type: "toDetail",
+      touches: undefined,
+      target: {
+        dataset: {},
+        id: ""
+      },
+      mark: {},
+      changedTouches: undefined,
+      mut: false,
       currentTarget:{
-        dataset:{
-          name: code,
-          item: data
-        }
+        dataset:{}
+      },
+      detail: {
+        name: code,
+        item: data
       }
     }
     // 跳转问题待解决

+ 146 - 104
pages/home-page/home-page.js

@@ -60,92 +60,11 @@ Page({
     functionItems: [
     ],
     //  模块名称
-    functionRegionItems: [
-      {
-        diamondflg: false,
-        titlesrc: 'home-add-order.png',
-        cardname: '采购管理',
-        background: 'linear-gradient(200.98deg, #FFFFFF -13.39%, #A1CDFF 100%)',
-        arrowBackground: '#A9CCFF',
-        color: '#3785E5',
-        image: 'pur-icon',
-        items: [
-          { code: 'pur-order', url: '/package-purchase/pages/purchase-order/purchase-order', title: '采购订单', color: '#7AADDF' },
-          { code: 'pur-enter', url: '/package-purchase/pages/purchase-receipt/purchase-receipt', title: '采购入库', color: '#7AADDF' }
-        ],
-      },
-      {
-        diamondflg: true,
-        titlesrc: 'home-customer-data.png',
-        cardname: '销售管理',
-        background: 'linear-gradient(224.58deg, #FFFFFF -11.05%, #FFC9C2 100%)',
-        arrowBackground: '#FDD4C7',
-        color: '#CC5E64',
-        image: 'sale-icon',
-        items: [
-          { code: 'order', url: '/package-sales/pages/order-billing/order-billing', title: '订单开单', color: '#E6725F' },
-          { code: 'order-out', url: '/package-sales/pages/sales-outbound/sales-outbound', title: '销售出库', color: '#E6725F' }
-        ],
-      },
-      {
-        diamondflg: false,
-        titlesrc: 'home-receive-customer.png',
-        background: 'linear-gradient(225.36deg, #FFFFFF -10.7%, #F2D1AC 100%)',
-        arrowBackground: '#EABB92',
-        color: '#D27E52',
-        cardname: '存货管理',
-        image: 'ivt-icon',
-        items: [
-          { code: 'entry-handle', url: '/package-inventory/pages/warehousing-processing/warehousing-processing', title: '入库办理', color: '#EEA05B' },
-          { code: 'out-handle', url: '/package-inventory/pages/outbound-processing/outbound-processing', title: '出库办理', color: '#EEA05B' }
-        ],
-      },
-      {
-        diamondflg: false,
-        titlesrc: 'home-customer-payment.png',
-        cardname: '客户管理',
-        background: 'linear-gradient(200.98deg, #FFFFFF -13.39%, #D7DFFF 100%)',
-        arrowBackground: '#C3D0FF',
-        color: '#606EB2',
-        image: 'customer-icon',
-        items: [
-          { code: 'customer', url: '/package-basic-data/pages/customer-list/customer-list', title: '客户档案', color: '#606EB2' },
-          { code: 'cus-follow', url: '/package-basic-data/pages/customer-reception/customer-reception', title: '客户跟进', color: '#606EB2' }
-        ],
-      },
-      {
-        diamondflg: true,
-        titlesrc: 'home-customer-payment.png',
-        cardname: '资金管理',
-        background: 'linear-gradient(223.67deg, #FFFFFF -15.06%, #FFF5E2 100%)',
-        arrowBackground: '#ECD1A7',
-        color: '#A5814A',
-        image: 'fin-icon',
-        items: [
-          { code: 'receipt', url: '/package-accounts-manage/pages/receipt/receipt', title: '收款单', color: '#A5814A' },
-          { code: 'payment', url: '/package-accounts-manage/pages/payment-order/payment-order', title: '付款单', color: '#A5814A' }
-        ],
-      },
-      {
-        diamondflg: false,
-        titlesrc: 'home-customer-payment.png',
-        cardname: '系统管理',
-        background: 'linear-gradient(225.36deg, #FFFFFF -10.7%, #C2DFFF 100%)',
-        arrowBackground: '#B7D6FF',
-        color: '#89B9FF',
-        image: 'analysis-icon',
-        items: [
-          { code: 'goods-attr', url: '/package-basic-data/pages/product-attribute/product-attribute', title: '商品属性', color: '#89B9FF' },
-          { code: 'goods', url: '/package-basic-data/pages/product-file/product-file', title: '商品档案', color: '#89B9FF' }
-        ],
-      },
-    ],
+    functionRegionItems: [],
     // 功能模块组件高度和宽度
     funcViewHeight: 0,
     funcViewWidth: 0,
     freeVersionFlag: true,
-    // 是否标准版专业版标识
-    flgStd: true,
   },
   /**
   * @desc : 切换公司
@@ -449,15 +368,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onShow: function name(params) {
-    if (app.globalData.company.gradeCode == Constants.gradeCode.STD) {
-      this.setData({
-        flgStd: true
-      })
-    } else {
-      this.setData({
-        flgStd: false
-      })
-    }
+
     // 获取常用菜单
     this.getComMenu();
     // 查询应收和收款额(本周) 本周数据点击首页就能刷新
@@ -473,6 +384,136 @@ Page({
     this.setData({
       freeVersionFlag: gradeCode === 'STD'
     })
+    // 标准版
+    if (gradeCode == Constants.gradeCode.STD) {
+      this.setData({
+        functionRegionItems: [
+          {
+            diamondflg: false,
+            titlesrc: 'home-add-order.png',
+            cardname: '精准管理',
+            background: 'linear-gradient(200.98deg, #FFFFFF -13.39%, #A1CDFF 100%)',
+            arrowBackground: '#A9CCFF',
+            color: '#3785E5',
+            image: 'pur-icon',
+            subTitle: '助力企业腾飞,共创企业辉煌',
+            items: [
+              { code: 'pur-order', url: '/package-purchase/pages/purchase-order/purchase-order', title: '立即升级', color: '#7AADDF' },
+            ],
+          },
+          {
+            diamondflg: false,
+            titlesrc: 'home-customer-data.png',
+            cardname: '分享不停歇',
+            background: 'linear-gradient(224.58deg, #FFFFFF -11.05%, #FFC9C2 100%)',
+            arrowBackground: '#FDD4C7',
+            color: '#CC5E64',
+            image: 'sale-icon',
+            subTitle: '云币数量涨不停',
+            items: [
+              { code: 'order', url: '/package-sales/pages/order-billing/order-billing', title: '立即分享', color: '#E6725F' },
+            ],
+          },
+          {
+            diamondflg: false,
+            titlesrc: 'home-receive-customer.png',
+            background: 'linear-gradient(225.36deg, #FFFFFF -10.7%, #F2D1AC 100%)',
+            arrowBackground: '#EABB92',
+            color: '#D27E52',
+            cardname: '签到有奖',
+            image: 'ivt-icon',
+            subTitle: '云币不断,快快行动',
+            items: [
+              { code: 'entry-handle', url: '/package-inventory/pages/warehousing-processing/warehousing-processing', title: '立即分享', color: '#EEA05B' },
+            ],
+          },
+
+        ],
+      })
+    } else {
+      this.setData({
+        functionRegionItems: [
+          {
+            diamondflg: false,
+            titlesrc: 'home-add-order.png',
+            cardname: '采购管理',
+            background: 'linear-gradient(200.98deg, #FFFFFF -13.39%, #A1CDFF 100%)',
+            arrowBackground: '#A9CCFF',
+            color: '#3785E5',
+            image: 'pur-icon',
+            items: [
+              { code: 'pur-order', url: '/package-purchase/pages/purchase-order/purchase-order', title: '采购订单', color: '#7AADDF' },
+              { code: 'pur-enter', url: '/package-purchase/pages/purchase-receipt/purchase-receipt', title: '采购入库', color: '#7AADDF' }
+            ],
+          },
+          {
+            diamondflg: true,
+            titlesrc: 'home-customer-data.png',
+            cardname: '销售管理',
+            background: 'linear-gradient(224.58deg, #FFFFFF -11.05%, #FFC9C2 100%)',
+            arrowBackground: '#FDD4C7',
+            color: '#CC5E64',
+            image: 'sale-icon',
+            items: [
+              { code: 'order', url: '/package-sales/pages/order-billing/order-billing', title: '订单开单', color: '#E6725F' },
+              { code: 'order-out', url: '/package-sales/pages/sales-outbound/sales-outbound', title: '销售出库', color: '#E6725F' }
+            ],
+          },
+          {
+            diamondflg: false,
+            titlesrc: 'home-receive-customer.png',
+            background: 'linear-gradient(225.36deg, #FFFFFF -10.7%, #F2D1AC 100%)',
+            arrowBackground: '#EABB92',
+            color: '#D27E52',
+            cardname: '存货管理',
+            image: 'ivt-icon',
+            items: [
+              { code: 'entry-handle', url: '/package-inventory/pages/warehousing-processing/warehousing-processing', title: '入库办理', color: '#EEA05B' },
+              { code: 'out-handle', url: '/package-inventory/pages/outbound-processing/outbound-processing', title: '出库办理', color: '#EEA05B' }
+            ],
+          },
+          {
+            diamondflg: false,
+            titlesrc: 'home-customer-payment.png',
+            cardname: '客户管理',
+            background: 'linear-gradient(200.98deg, #FFFFFF -13.39%, #D7DFFF 100%)',
+            arrowBackground: '#C3D0FF',
+            color: '#606EB2',
+            image: 'customer-icon',
+            items: [
+              { code: 'customer', url: '/package-basic-data/pages/customer-list/customer-list', title: '客户档案', color: '#606EB2' },
+              { code: 'cus-follow', url: '/package-basic-data/pages/customer-reception/customer-reception', title: '客户跟进', color: '#606EB2' }
+            ],
+          },
+          {
+            diamondflg: true,
+            titlesrc: 'home-customer-payment.png',
+            cardname: '资金管理',
+            background: 'linear-gradient(223.67deg, #FFFFFF -15.06%, #FFF5E2 100%)',
+            arrowBackground: '#ECD1A7',
+            color: '#A5814A',
+            image: 'fin-icon',
+            items: [
+              { code: 'receipt', url: '/package-accounts-manage/pages/receipt/receipt', title: '收款单', color: '#A5814A' },
+              { code: 'payment', url: '/package-accounts-manage/pages/payment-order/payment-order', title: '付款单', color: '#A5814A' }
+            ],
+          },
+          {
+            diamondflg: false,
+            titlesrc: 'home-customer-payment.png',
+            cardname: '系统管理',
+            background: 'linear-gradient(225.36deg, #FFFFFF -10.7%, #C2DFFF 100%)',
+            arrowBackground: '#B7D6FF',
+            color: '#89B9FF',
+            image: 'analysis-icon',
+            items: [
+              { code: 'goods-attr', url: '/package-basic-data/pages/product-attribute/product-attribute', title: '商品属性', color: '#89B9FF' },
+              { code: 'goods', url: '/package-basic-data/pages/product-file/product-file', title: '商品档案', color: '#89B9FF' }
+            ],
+          },
+        ],
+      })
+    }
     // 如果企业还有15天到期给出提示信息
     let company = app.globalData.company;
     if (company && company.endDate) {
@@ -484,7 +525,7 @@ Page({
       }
     }
     // // 判断当前用户是否到期 标准版
-    if (app.globalData.company.gradeCode == Constants.gradeCode.STD
+    if (gradeCode == Constants.gradeCode.STD
       && !app.globalData.user.flgInit
       && company
       && company.userEndDate) {
@@ -495,6 +536,7 @@ Page({
         util.showToast('企业即将到期,到期日期为【' + company.userEndDate + '】', 5000);
       }
     }
+
     let res = wx.getSystemInfoSync();
     let statusHeight = res.statusBarHeight
     this.setData({
@@ -544,18 +586,18 @@ Page({
       })
     }
 
-    // 获取功能卡片模块高度 以便设置水印蒙版高度
-    const that = this;
-    let query = wx.createSelectorQuery();
-    query.select('.func').boundingClientRect(rect => {
-      let height = rect.height;
-      let width = rect.width;
-      that.setData({
-        funcViewWidth: width,
-        funcViewHeight: height
-      })
-      that.drawWatermark('watermarkCanvas', '专业版功能', width * 2, height * 2)
-    }).exec();
+    // // 获取功能卡片模块高度 以便设置水印蒙版高度
+    // const that = this;
+    // let query = wx.createSelectorQuery();
+    // query.select('.func').boundingClientRect(rect => {
+    //   let height = rect.height;
+    //   let width = rect.width;
+    //   that.setData({
+    //     funcViewWidth: width,
+    //     funcViewHeight: height
+    //   })
+    //   that.drawWatermark('watermarkCanvas', '专业版功能', width * 2, height * 2)
+    // }).exec();
 
     //小程序推送消息传过来的值 pages/login/login?loginType=1&otherParam=值
     // loginType 

+ 65 - 7
pages/home-page/home-page.wxml

@@ -21,12 +21,12 @@
   <!--本周数据-->
   <view class="swiper-box" catch:touchmove="tauchMove" bind:touchstart="tauchStart" bind:touchend="tauchEnd">
     <view class="item-box {{item.zIndex==1?'none':''}}" wx:for-item="item" wx:for="{{swiperList}}" wx:key="index" style="--index: {{item.zIndex}}; --left: {{item.mLeft}}; ">
-      <view class="swiper-item" style="background: {{item.background}};" >
+      <view class="swiper-item" style="background: {{item.background}};">
         <view class="content-data-title">{{item.title}}</view>
-        <view class="content-data-items" >
+        <view class="content-data-items">
           <!--成交额-->
           <view class="content-data-item" id="done" bindtap="tauchStart1">
-            <view class="content-data-item-title" >
+            <view class="content-data-item-title">
               <image src="{{imageUrl + 'right.png'}}" style="width: 28rpx;height:28rpx;margin-right: 10rpx;"></image>
               {{$t['transactionAmount']}}
             </view>
@@ -76,11 +76,69 @@
 
   <!-- 功能卡片 -->
   <view wx:if="{{advertisementList && advertisementList.length == 0}}" style="margin-top: 10rpx;"></view>
-  <view class="func" hidden="{{flgStd}}" >
-    <!-- 水印模块 -->
-    <view class="permissions-masks-fa" wx:if="{{freeVersionFlag}}" catchtap="masksClick" style="height: {{ funcViewHeight }}px;">
-      <canvas canvas-id="watermarkCanvas" id="watermarkCanvas" style="width: {{funcViewWidth}}px; height: {{ funcViewHeight }}px;"></canvas>
+  <!-- 标准版 -->
+  <view class="func" wx:if="{{freeVersionFlag}}" style="height: 410rpx;">
+    <view style="display:flex; ">
+      <view style=" width: 50%;height: 370rpx;border-radius: 19rpx;background: linear-gradient(200.98deg, #FFFFFF -13.39%, #A1CDFF 100%);  ">
+        <view class="card-title-std" style="position: relative;">
+          <view style="margin-left:15rpx;margin-top:35rpx;color:#3785E5;font-size: 18px;font-weight: 600;justify-content: flex-start; width: 100%;">精准管理</view>
+          <view style="position: absolute; top: 190rpx;left: 220rpx;    ">
+            <image src="{{imageUrl  + 'pur-icon.png'}} " class="card-bottom-image" />
+          </view>
+        </view>
+        <view style="margin-left:15rpx;margin-top:35px;color:#3785E5;font-size: 11px; ">助力企业腾飞,共创企业辉煌</view>
+        <view style="width: 100%;height: 80rpx;"></view>
+        <!-- 卡片底部 -->
+        <view class="card-bottom-std">
+          <view class="card-bottom-button-std" style="background: #1989fa;" bindtap="toApp">
+            <view style="margin-left: 15rpx; color:#fefeff;font-size: 13px;">立即升级</view>
+            <van-icon style="padding-left: 14rpx;" name="arrow" size="2.2vw" color="{{'#fefeff'}}" />
+          </view>
+        </view>
+      </view>
+      <!-- 分享 -->
+      <view style="margin-left: 15rpx;width: 50%;  margin-top: -10rpx;  ">
+        <view style="height: 170rpx;border-radius: 19rpx;width: 100;background: linear-gradient(223.67deg, #FFFFFF -15.06%, #FFF5E2 100%);">
+          <view class="card-title-std" style="position: relative;">
+            <view style="margin-left:15rpx;padding-top:15rpx;color:#A5814A;font-size: 16px;font-weight: 600;justify-content: flex-start; width: 100%;">分享不停歇</view>
+            <view style="position: absolute; top: 40rpx;left: 220rpx;    ">
+              <image src="{{imageUrl  + 'fin-icon.png'}} " class="card-bottom-image" />
+            </view>
+          </view>
+          <view style="margin-left:15rpx; color:#A5814A;font-size: 11px; ">云币数量涨不停</view>
+
+          <!-- 卡片底部 -->
+          <view class="card-bottom-std">
+            <view class="card-bottom-button-std" style="background: #A5814A;width: 55%;height: 55rpx;" bindtap="toApp">
+              <view style="margin-left: 15rpx; color:#fefeff;font-size: 12px;">立即分享</view>
+              <van-icon style="padding-left: 14rpx;" name="arrow" size="2.2vw" color="{{'#fefeff'}}" />
+            </view>
+          </view>
+        </view>
+        <view style="height: 170rpx;border-radius: 19rpx;width: 100;background:linear-gradient(225.36deg, #FFFFFF -10.7%, #F2D1AC 100%);margin-top: -10rpx;">
+          <view class="card-title-std" style="position: relative;">
+            <view style="margin-left:15rpx;padding-top:15rpx;color:#CC5E64;font-size: 16px;font-weight: 600;justify-content: flex-start; width: 100%;">分享不停歇</view>
+            <view style="position: absolute; top: 30rpx;left: 220rpx;    ">
+              <image src="{{imageUrl  + 'ivt-icon.png'}} " class="card-bottom-image" />
+            </view>
+          </view>
+          <view style="margin-left:15rpx; color:#CC5E64;font-size: 11px; ">云币数量涨不停</view>
+
+          <!-- 卡片底部 -->
+          <view class="card-bottom-std">
+            <view class="card-bottom-button-std" style="background: #CC5E64;height: 55rpx;" bindtap="toApp">
+              <view style="margin-left: 15rpx; color:#fefeff;font-size: 12px;">立即分享</view>
+              <van-icon style="padding-left: 14rpx;" name="arrow" size="2.2vw" color="{{'#fefeff'}}" />
+            </view>
+          </view>
+        </view>
+      </view>
+
     </view>
+  </view>
+
+  <!-- 专业版 -->
+  <view class="func" wx:else>
     <view style="display:flex;flex-wrap: wrap;justify-content: center;">
       <view class="func-card-blue" wx:for="{{functionRegionItems}}" wx:for-item="item" wx:key="index" style="background: {{item.background}};">
         <!-- 卡片头部 -->

+ 30 - 3
pages/home-page/home-page.wxss

@@ -110,7 +110,7 @@ page {
   box-shadow: 0px 4px 30px 0px #0000001A;
 }
 
-.split-class{
+.split-class {
   border: 1rpx solid #FFFFFF66;
   margin: 20rpx 0 10rpx 0;
 }
@@ -179,15 +179,33 @@ page {
   margin-left: 12rpx;
 }
 
+.card-bottom-std {
+  display: flex;
+  margin-left: 20rpx;
+  margin-top: 10rpx;
+  align-items: center;
+  justify-content: flex-start;
+}
+
 .card-bottom {
   display: flex;
   margin-left: 20rpx;
   margin-top: 10rpx;
+  
 }
 
+.card-bottom-button-std {
+  width: 60%;
+  /* background: #1989fa; */
+  height: 60rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 30rpx;
+}
 .card-bottom-button {
   /* width: 100%; */
-  /* background: #B7DBFF; */
+  /* background: #1f5992; */
   height: 54rpx;
   display: flex;
   align-items: center;
@@ -234,6 +252,15 @@ page {
   border-radius: 19rpx;
 }
 
+.card-title-std {
+  margin-top: 24rpx;
+  display: flex;
+  height: 54rpx;
+  align-items: flex-start;
+  width: 100%; 
+  justify-content: flex-start;
+}
+
 .card-title {
   margin-top: 24rpx;
   display: flex;
@@ -373,7 +400,7 @@ image {
   align-items: center;
 }
 
-.vip-icon-view{
+.vip-icon-view {
   width: 100%;
   position: relative;
   z-index: 1000;

+ 21 - 0
utils/util.js

@@ -786,6 +786,26 @@ function handleQty(qty,decimalPlace = 2){
   return   Math.round((Number(qty) * 100)  ) / 100
 }
 
+/**
+ * @desc   : 防抖函数
+ * @author : 于继渤
+ * @date   : 2024/6/28
+ */
+function debounce(func, that, wait) {
+  let timeout;
+  if(!wait){
+    wait = 400
+  }
+  return function() {
+    const context = that;
+    const args = arguments;
+    clearTimeout(timeout);
+    timeout = setTimeout(() => {
+      func.apply(context, args);
+    }, wait);
+  };
+}
+
 
 /**
  * @desc   : 设置查询提示值
@@ -810,6 +830,7 @@ function setSearchPlaceholder(lang, cols) {
 
 
 module.exports = {
+  debounce:debounce,
   handleQty:handleQty,
   setSearchPlaceholder:setSearchPlaceholder,
   showToast:showToast,