NULL1222 před 5 dny
rodič
revize
12bf7e5c13

+ 3 - 1
app.json

@@ -21,7 +21,9 @@
         "pages/tabbar/mine/address/update",
         "pages/trace/insert",
         "pages/trace/detail",
-        "pages/login/developerTools"
+        "pages/login/developerTools",
+        "pages/tabbar/mine/integral/index",
+        "pages/tabbar/mine/integral/detail"
     ],
     "subpackages": [
         {

+ 10 - 0
pages/tabbar/mine/index.scss

@@ -224,6 +224,16 @@
         display: flex;
         align-items: center;
         line-height: 20rpx;
+        .integral{
+          padding-right: 20rpx;
+            font-family: PingFang SC, PingFang SC;
+            font-weight: 400;
+            font-size: 28rpx;
+            color: #333333;
+            text-align: right;
+            font-style: normal;
+            text-transform: none;
+        }
 
         .user-img {
             width: 58rpx;

+ 12 - 0
pages/tabbar/mine/index.wxml

@@ -33,6 +33,18 @@
     </view>
 </block>
 <view class='operating' hover>
+    <navigator class="item" url="/pages/tabbar/mine/integral/index">
+        <view class="con">
+            <view class="label">
+                <text class="iconfont icon-a-wodemendianxinxidizhi" style="color: #085CDF;" />
+                {{language['积分账户']||'积分账户'}}
+            </view>
+            <view class="item-right">
+                <view class="integral">共200分</view>
+                <van-icon size='30rpx' name="arrow" />
+            </view>
+        </view>
+    </navigator>
     <navigator class="item" url="/pages/tabbar/mine/address/index?id={{userMsg.enterprise.sys_enterpriseid}}">
         <view class="con">
             <view class="label">

+ 80 - 0
pages/tabbar/mine/integral/detail.js

@@ -0,0 +1,80 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    condition: "",
+    sc_points_balanceid: '',
+    userid: '',
+    id: 2026052510110906,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 20,
+      total: null,
+      sc_points_balanceid: "",
+      userid: '',
+      where: {
+        condition: "",
+
+      }
+    },
+    list: []
+  },
+
+  onChange({
+    detail
+  }) {
+    this.setData({
+      condition: detail
+    });
+  },
+
+  onSearch({
+    detail
+  }) {
+    this.setData({
+      condition: detail
+    });
+    this.data.content.where.condition = detail;
+    this.getList(true);
+  },
+
+  getList(init = false) {
+    if (init) this.selectComponent('#ListBox').goTop();
+    _Http.init(this.data.content, init).then(content => {
+      _Http.basic({
+        id: this.data.id,
+        content
+      }).then(res => {
+        this.selectComponent('#ListBox').RefreshToComplete();
+        if (res.code != '1') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        });
+        this.setData({
+          content: _Http.paging(content, res),
+          list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+        });
+      });
+    });
+  },
+
+  onLoad(options) {
+    getApp().globalData.Language.getLanguagePackage(this, '积分账户');
+    if (options.id) {
+      this.setData({
+        sc_points_balanceid: options.id,
+        userid: options.userid,
+        'content.sc_points_balanceid': options.id,
+        'content.userid': options.userid
+      });
+      this.getList();
+    }
+  },
+
+  // callPhone(e) {
+  //   wx.makePhoneCall({
+  //     phoneNumber: e.currentTarget.dataset.number
+  //   })
+  // },
+});

+ 4 - 0
pages/tabbar/mine/integral/detail.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "积分账户"
+}

+ 29 - 0
pages/tabbar/mine/integral/detail.scss

@@ -0,0 +1,29 @@
+.item {
+  width: 750rpx;
+  background: #FFFFFF;
+  box-shadow: inset 0rpx -1rpx 0rpx 2rpx #DDDDDD;
+  padding: 20rpx 20rpx;
+  box-sizing: border-box;
+
+  .name {
+    padding-bottom: 12rpx;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    font-weight: 500;
+    font-size: 28rpx;
+    color: #000000;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+
+  .row {
+    padding-top: 8rpx;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    font-weight: 400;
+    font-size: 24rpx;
+    color: #999999;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+}

+ 15 - 0
pages/tabbar/mine/integral/detail.wxml

@@ -0,0 +1,15 @@
+<van-search class="search" focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索" background='#fff'></van-search>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+  <view class="item" wx:for="{{list}}" wx:key="sc_customers_terminalid">
+    <view class="name">{{item.createdate}}</view>
+    <view class="row">
+      {{language['来源类型']||'来源类型'}}:{{item.source}}
+    </view>
+    <view class="row">{{language['来源单号']||'来源单号'}}:{{item.source_billno }}</view>
+    <view class="row">{{language['收支类型']||'收支类型'}}:{{item.type }}</view>
+    <view class="row">{{language['积分']||'积分'}}:{{item.points }}</view>
+    <view class="row">{{language['经销商']||'经销商'}}:{{item.dealername }}</view>
+    <view class="row">{{language['备注']||'备注'}}:{{item.remarks }}</view>
+  </view>
+  <My_Empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>

+ 59 - 0
pages/tabbar/mine/integral/index.js

@@ -0,0 +1,59 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    condition: "",
+    id: 2026052510110806,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 20,
+      total:null,
+      where: {
+        condition: "",
+      }
+    },
+    list: []
+  },
+
+  onChange({ detail }) {
+    this.setData({ condition: detail });
+  },
+
+  onSearch({ detail }) {
+    this.setData({ condition: detail });
+    this.data.content.where.condition = detail;
+    this.getList(true);
+  },
+
+  getList(init = false) {
+    if (init) this.selectComponent('#ListBox').goTop();
+    _Http.init(this.data.content, init).then(content => {
+      _Http.basic({
+        id: this.data.id,
+        content
+      }).then(res => {
+        this.selectComponent('#ListBox').RefreshToComplete();
+        if (res.code != '1') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        });
+        this.setData({
+          content: _Http.paging(content, res),
+          list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+        });
+      });
+    });
+  },
+
+  onLoad(options) {
+    getApp().globalData.Language.getLanguagePackage(this);
+    this.getList();
+  },
+
+  // callPhone(e) {
+  //   wx.makePhoneCall({
+  //     phoneNumber: e.currentTarget.dataset.number
+  //   })
+  // },
+});

+ 4 - 0
pages/tabbar/mine/integral/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "积分账户"
+}

+ 80 - 0
pages/tabbar/mine/integral/index.scss

@@ -0,0 +1,80 @@
+.count {
+  padding: 20rpx 18rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: 400;
+  font-size: 24rpx;
+  color: #333333;
+  text-align: left;
+  font-style: normal;
+  text-transform: none;
+}
+
+.item {
+  width: 750rpx;
+  background: #FFFFFF;
+  box-shadow: inset 0rpx -1rpx 0rpx 2rpx #DDDDDD;
+  padding: 20rpx 20rpx;
+  box-sizing: border-box;
+
+  .name {
+    padding-bottom: 12rpx;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    font-weight: 500;
+    font-size: 28rpx;
+    color: #000000;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+
+  .row {
+    padding-top: 8rpx;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    font-weight: 400;
+    font-size: 24rpx;
+    color: #999999;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+
+  .card {
+    margin-top: 20rpx;
+    width: 100%;
+    background: #F5F5F5;
+    border-radius: 8rpx;
+    display: flex;
+    justify-content: space-between;
+    padding: 30rpx 30rpx;
+    box-sizing: border-box;
+
+    .part {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+    }
+
+    .label {
+      padding-bottom: 10rpx;
+      font-family: Source Han Sans SC, Source Han Sans SC;
+      font-weight: 400;
+      font-size: 24rpx;
+      color: #333333;
+      text-align: left;
+      font-style: normal;
+      text-transform: none;
+    }
+
+    .num {
+      font-family: Source Han Sans SC, Source Han Sans SC;
+      font-weight: 800;
+      font-size: 32rpx;
+      color: #3874F6;
+      text-align: left;
+      font-style: normal;
+      text-transform: none;
+    }
+  }
+
+}

+ 32 - 0
pages/tabbar/mine/integral/index.wxml

@@ -0,0 +1,32 @@
+<van-search class="search" focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索" background='#fff'></van-search>
+<view class="count">
+  {{language['总共']||'总共'}} {{content.total}}
+</view>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+  <navigator class="item" url="/pages/tabbar/mine/integral/detail?id={{item.sc_points_balanceid}}&userid={{item.userid}}" wx:for="{{list}}" wx:key="sc_customers_terminalid">
+    <view class="name">{{item.personname}}</view>
+    <view class="row">
+      {{language['联系电话']||'联系电话'}}:{{item.phonenumber}}
+    </view>
+    <view class="row">{{language['经销商']||'经销商'}}:{{item.dealername }}</view>
+    <view class="card">
+      <view class="part">
+        <view class="label">{{language['累计']||'累计'}}A{{language['积分']||'积分'}}</view>
+        <view class="num">{{item.a_points}}</view>
+      </view>
+      <view class="part">
+        <view class="label">{{language['累计']||'累计'}}C{{language['积分']||'积分'}}</view>
+        <view class="num">{{item.c_points}}</view>
+      </view>
+      <view class="part">
+        <view class="label">{{language['累计兑换']||'累计兑换'}}</view>
+        <view class="num">{{item.pay_points}}</view>
+      </view>
+      <view class="part">
+        <view class="label">{{language['积分余额']||'积分余额'}}</view>
+        <view class="num">{{item.balance}}</view>
+      </view>
+    </view>
+  </navigator>
+  <My_Empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>