姜永辉 1 год назад
Родитель
Сommit
63aec4c238

+ 65 - 76
package-basic-data/pages/sign-share-detail/integral-detail.js

@@ -1,26 +1,36 @@
-// package-basic-data/pages/sign-share-detail/integral-detail.js
-const Constants = require('@/utils/Constants.js'); 
-const mixins = require('@/mixins/index.js'); 
+/*******************************************************************************
+* Copyright(c) 2022 dongke All rights reserved. / Confidential
+* 类的信息:
+*		1.程序名称:
+*		2.功能描述:云币明细
+* 编辑履历:
+*		作者				日期					版本				修改内容
+*		姜永辉		  	2022-11-22			1.00		   	新建
+*******************************************************************************/
+const Constants = require('@/utils/Constants.js');
+const mixins = require('@/mixins/index.js');
 const app = getApp()
 Page({
-    mixins: [mixins],
-    data: {
-      routeObjName: 'share',
-      staffName: app.globalData.user.staffName,
-      staffPhone: app.globalData.user.staffPhone,
-      companyName: app.globalData.company.cpName,
-      versionName: '',
-      active: 0,
-      tagList: [{ title: '收入', code: '收入' },{ title: '使用', code: '使用' }],
-      saleStatus: '',
-      itemList: [{
-        type: '签到',
-        date: '2024-07-05',
-        user: '李小双',
-        value: '1'
-      }],
-      gradeCode: null
-    },
+  mixins: [mixins],
+  data: {
+    routeObjName: 'share',
+    staffName: app.globalData.user.staffName,
+    staffPhone: app.globalData.user.staffPhone,
+    companyName: app.globalData.company.cpName,
+    versionName: '',
+    active: 0,
+    tagList: [{ title: '收入', code: '收入' }, { title: '使用', code: '使用' }],
+    saleStatus: '',
+    itemList: [{
+      type: '签到',
+      date: '2024-07-05',
+      user: '李小双',
+      value: '1'
+    }],
+    gradeCode: null,
+    // 路由
+    routeObjName: 'integralItem',
+  },
 
   /**
    * @desc : 切换
@@ -28,66 +38,45 @@ Page({
    * @author : 刘尧
    */
   onChangeTabs(e) {
+    console.log(e);
     let code = e.detail.detail.code
     this.setData({
       saleStatus: code,
+      active: e.detail.detail.index
     })
+    this.getSignData()
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.setData({
+      versionName: this.data.freeVersionFlag ? mixins.$t('standardVersion') : mixins.$t('professionalVersion')
+    })
+    this.getSignData()
   },
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-      this.setData({
-        versionName: this.data.freeVersionFlag ? mixins.$t('standardVersion') : mixins.$t('professionalVersion')
-      })
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
 
+  /** 
+  * @desc : 查询签到,分享,邀请,使用 
+  * @date : 2024年3月8日
+  * @author : jyh 
+  */
+  getSignData() {
+    let _this = this
+    let params = {
+      integralTypes: this.data.active == 1 ?
+        [Constants.integralType.use] :
+        [Constants.integralType.register, Constants.integralType.sign, Constants.integralType.invite, Constants.integralType.share],
+      flgValid: true,
     }
+    let service = app.globalData['integralItemService']
+    return this.excute(service, service.selectByCond, params).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        this.setData({
+          itemList: res.data.data.list
+        })
+      }
+    })
+  },
+
 })

+ 7 - 9
package-basic-data/pages/sign-share-detail/integral-detail.wxml

@@ -38,20 +38,18 @@
     </view>
   </view>
   <dk-tabs active="{{active}}" list="{{tagList}}" bind:onChange="onChangeTabs"> </dk-tabs>
-  <view class="item-content" >
+  <view class="item-content">
     <view class="item-card">
       <view class="list-item" wx:for="{{itemList}}" wx:for-index="index" wx:for-item="item">
         <view>
-          <view class="item-type">{{item.type}}</view>
-          <view class="item-info" wx:if="{{saleStatus === '' || saleStatus === '收入'}}">{{item.date}}/{{item.user}}</view>
-          <view class="item-info" wx:if="{{saleStatus === '使用'}}">{{item.date}}</view>
+          <view class="item-type">{{item.integralTypeName=='使用'?item.remarks:item.integralTypeName}}</view>
+          <view class="item-info" wx:if="{{saleStatus === '' || saleStatus === '收入'}}">{{item.accDate}}/{{item.user}}</view>
+          <view class="item-info" wx:if="{{saleStatus === '使用'}}">{{item.accDate}}</view>
         </view>
-        <view class="integral-value" wx:if="{{saleStatus === '' || saleStatus === '收入'}}">
-          +{{item.value}}
-        </view>
-        <view class="integral-value" wx:if="{{saleStatus === '使用'}}" >
-          -{{item.value}}
+        <view class="integral-value">
+          {{item.integral > 0 ?'+' + item.integral:item.integral}}
         </view>
+
       </view>
     </view>
   </view>