Browse Source

福利版本

347617796@qq.com 3 years ago
parent
commit
4a6a4903ab

+ 6 - 5
app.js

@@ -2,8 +2,8 @@ import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -13,8 +13,9 @@ for (var i = 2018; i <= year; i++) {
 App({
   //自定义全局变量
   globalData: {
-    webScoketUrl: "test-ding.g107.com",//webScoket测试
-    // webScoketUrl: "ding.insys.g107.com",//webScoket正式
+    baseUrl:baseUrl,
+    // webScoketUrl: "test-ding.g107.com",//webScoket测试
+    webScoketUrl: "ding.insys.g107.com",//webScoket正式
     showToast: showToast,//提示框
     arrRemoveObj: arrRemoveObj,//删除数组的某一项
     year: formatTime(new Date()).year,//当前年
@@ -255,7 +256,7 @@ App({
                 that.globalData.token = token;
                 that.globalData.userData = user;
                 var getIsStart = dd.getStorageSync({ key: 'isStart' });//判断是否需要打开引导页
-                console.log(JSON.stringify(user));
+                // console.log(JSON.stringify(user));
                 that.getUserList();//缓存人员列表
                 if (isStart && !getIsStart.data) {//判断是否需要打开引导
                   dd.reLaunch({

File diff suppressed because it is too large
+ 0 - 0
image/approval_process.svg


BIN
image/code.jpg


BIN
image/dh.png


BIN
image/mx.png


+ 1 - 1
pages/deploy/organization/organization.axml

@@ -25,7 +25,7 @@
       <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/>{{item.name}}
     </view>
   </view>
-  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 472rpx)':'height: calc(100vh - 408rpx)'}}">
+  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 480rpx)':'height: calc(100vh - 442rpx)'}}">
     <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}" catchTap="activeTree" data-item="{{item}}">
       <view class="img-left">
         <image mode="scaleToFill" src="../../../image/BM.png"></image></view>

+ 4 - 9
pages/exchange/commodityDetail/commodityDetail.acss

@@ -1,6 +1,6 @@
 
 .img{
-  /* width: 300rpx; */
+  width: 300rpx;
   height: 300rpx;
   border-radius: 10rpx;
 }
@@ -20,10 +20,9 @@
 }
 .btn{
   position: fixed;
-  bottom: 40rpx;
-  left: 5%;
-  right: 5%;
-
+  bottom: 22rpx;
+  left: 12rpx;
+  right: 12rpx;
 }
 .lBgn{
   background: #26A2FF;
@@ -47,10 +46,6 @@
   font-size: 24rpx;
 }
 
-.windows-btn {
-  /* border-top: 1px solid #f1f1f1; */
-}
-
 .windows-btn view:nth-child(1) {
   text-align: right;
   padding: 32rpx;

+ 18 - 13
pages/exchange/commodityDetail/commodityDetail.axml

@@ -1,25 +1,30 @@
 <view class="all">
   <view class="flex-box-ce" style="background:#fff;padding:24rpx">
-    <image mode="scaleToFill" src="../../../image/money.jpg" class="img" />
-    <view class="flex-box-v" style="height:300rpx;padding-left:20rpx">
+    <image mode="aspectFill" src="{{detail.image}}" class="img" data-url="{{detail.image}}"  catchTap="showImg"/>
+    <view class="flex-box-v flex-1" style="height:300rpx;padding-left:20rpx">
       <view class="content fontColorF flex-1">
-        因为这些问题也陪伴我度过了生命中那些夜不能寐的日子,
+       {{detail.name}}
+      </view>
+      <view style="margin-bottom:20rpx" class="flex-box-ce">
+        <view class="flex-1"> 功勋点: <text class="red">{{detail.price}}</text></view>
       </view>
-      <view style="margin-bottom:20rpx">功勋点:
-        <text class="red">49</text></view>
       <view class="flex-box-ce">
         <text>数量:</text>
         <view class="flex-box-ce">
           <view class="num" catchTap="active" data-id="1">-</view>
-          <input class="input" type="number" value="{{val}}" />
+          <input class="input" type="number" disabled  value="{{val}}" />
           <view class="num" data-id="2" catchTap="active">+</view>
         </view>
       </view>
     </view>
   </view>
-  <view class="fontColorF" style="padding:20rpx;background:#fff"> 商品描述: 因为这些问题也陪伴我度过了生命中那些夜不能寐的日子,</view>
-  <textarea onBlur="bindTextAreaBlur" placeholder="请输入兑换备注" maxlength="100" style="margin-top:24rpx;padding:24rpx;height:200rpx" />
-  <button type="primary" class="btn" catchTap="showText">立即兑换</button>
+  <view class="fontColorF" style="padding:20rpx;background:#fff;padding-bottom:0"> 库存:
+    <text a:if="{{detail.stock_type == 1}}">不限</text>
+    <text a:else>{{detail.stock}}</text>
+   </view>
+  <view class="fontColorF" style="padding:20rpx;background:#fff"> 奖品描述: {{detail.desc}}</view>
+  <textarea onBlur="bindTextAreaBlur" placeholder="请输入兑换备注" maxlength="100" style="margin-top:24rpx;padding:24rpx;height:200rpx;margin-bottom:200rpx" />
+  <button type="primary" class="btn" catchTap="showText" loading="{{disabled}}" disabled="{{disabled}}">立即兑换</button>
   <view a:if="{{isBh}}" class="windows" content="还没有积分事件">
     <view class="windows-box">
       <view class="windows-title">兑换</view>
@@ -27,14 +32,14 @@
         <text style="padding-right:20rpx;font-size:36rpx">确认兑换</text>
       </view>
       <view style="text-align:center;padding:20rpx 0;">
-        <image src="../../../image/money.jpg" style="width:260rpx;height:260rpx;border-radius: 10rpx" />
+        <image src="{{detail.image}}" mode="aspectFill" style="width:260rpx;height:260rpx;border-radius: 10rpx" />
       </view>
-      <view class="windows-content" style="text-align:center">您需要花<text class="red">49</text>功勋点兑换此商品</view>
+      <view class="windows-content" style="text-align:center">需要花<text class="red">{{num}}</text>功勋点兑换此奖品</view>
       <view style="text-align:center;font-size:24rpx;margin-bottom:20rpx" class="fontColorX">
-        (当前的功勋点为1354分
+        (当前的功勋点为{{gxd}}
       </view>
       <view class="btns flex-box flex-v-ce">
-        <view class="flex-1" catchTap="colseText">取消</view>
+        <view class="flex-1" catchTap="showText">取消</view>
         <view class="flex-1" catchTap="openText">确认</view>
       </view>
     </view>

+ 63 - 3
pages/exchange/commodityDetail/commodityDetail.js

@@ -1,9 +1,36 @@
+var app = getApp();
+var that;
 Page({
   data: {
     val: 1,
+    detail:{},
+    num:'',
+    remark:'',
+    disabled: false,
+    gxd:'',
   },
-  onLoad() {
-    dd.setNavigationBar({ title: "商品详情" });
+  onLoad(e) {
+    that = this;
+    dd.setNavigationBar({ title: "奖品详情" });
+    if(e.item){
+        let item=JSON.parse(e.item);
+        that.setData({gxd:item.gxd })
+        that.getData(item.id);
+    }
+  },
+  showImg(e) {
+    var url = e.target.dataset.url
+    dd.previewImage({
+      current: 0,
+      urls:[url]
+    });
+  },
+  getData(id) {
+    app.$get('api/shop/goods/detail', { id:id}).then((res) => {
+      this.setData({
+        detail:res.data.data,
+      })
+    })
   },
   active(e) {
     var id = e.target.dataset.id;
@@ -18,9 +45,42 @@ Page({
     this.setData({
       val: val
     })
+  },
+    //备注输入
+  bindTextAreaBlur: function (e) {
+    this.setData({
+      remark: e.detail.value,
+    });
+  },
+  openText(){
+    if(this.data.disabled){
+        return false
+    };
+    if(this.data.detail.gxd<this.data.num){
+      app.globalData.showToast("功勋点不足");
+      return false
+    }
+    let data={
+      goods_id:this.data.detail.id,
+      num:this.data.val,
+      remark:this.data.remark,
+    }
+    this.setData({ disabled: true });
+    app.$post("api/shop/exchange/create", data).then((res) => {
+      app.globalData.showToast("已兑换");
+      setTimeout(() => {
+        this.setData({ disabled: false });
+        dd.navigateBack({ delta: 1 })
+      }, 1000);
+    }).catch(err => {
+        this.setData({ disabled: false });
+    })
   },
   showText() {
-    this.setData({ isBh: !this.data.isBh })
+    this.setData({ 
+      isBh: !this.data.isBh,
+      num: this.data.val*this.data.detail.price,
+    })
   },
   handleCopy() {
     dd.setClipboard({

+ 14 - 8
pages/exchange/exchange/exchange.acss

@@ -41,8 +41,8 @@ page{
   color: #777;
 }
 .box image{
-  width: 32rpx;
-  height: 32rpx;
+  width: 42rpx;
+  height: 42rpx;
   margin-bottom: 10rpx;
 }
 .search {
@@ -55,6 +55,7 @@ page{
 }
 .form{
   padding: 0 3%;
+  margin-bottom: 0.12rem;
 }
 .search input {
   background-color: #f1f1f1;
@@ -66,15 +67,15 @@ page{
 }
 .item{
   width: 49%;
-  padding: 10rpx;
-  box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, 0.05);
-  border-radius: 5rpx;
+  /* padding: 10rpx; */
+  box-shadow: 0rpx 0rpx 10rpx #ccc;
+  border-radius: 16rpx;
   background-color: #fff;
   box-sizing: border-box;
   margin-bottom: 2%;
 }
 .itemBox{
-  padding: 24rpx 2%;
+  padding: 0 2%;
 }
 .css3{
   transform: rotate(90deg);
@@ -90,7 +91,12 @@ page{
 .content{
   display: -webkit-box;
   -webkit-box-orient: vertical;
-  -webkit-line-clamp: 2;
+  -webkit-line-clamp: 1;
   overflow: hidden;
-  margin: 20rpx 0;
+  margin-bottom: 20rpx;
+  /* height: 0.8rem; */
+}
+.scroll {
+  height: calc(100vh - 438rpx);
+  padding-top: 0.12rem;
 }

+ 27 - 23
pages/exchange/exchange/exchange.axml

@@ -1,20 +1,20 @@
 <view>
   <view class="lBgn flex-box">
-    <image mode="widthFix" src="" style="width:80rpx"/>
+    <image mode="widthFix" src="" style="width:80rpx" />
     <view class="flex-1 nums">
-      <view>1652</view>
-      <view>可用功勋点</view>
+      <view>{{gxd}}</view>
+      <view>我的功勋点</view>
     </view>
-    <image mode="widthFix" src="../../../image/jb.png"/>
+    <image mode="widthFix" src="../../../image/jb.png" />
   </view>
   <view class="box">
     <view class="flex-box-ce" style="height:140rpx">
-      <view class="flex-box-v flex-1 flex-center-center">
-        <image src="../../../image/lb.png" />
-        <text>功勋点明</text>
+      <view class="flex-box-v flex-1 flex-center-center" data-index="1" catchTap="openUrl">
+        <image src="../../../image/mx.png" />
+        <text>功勋点明</text>
       </view>
-      <view class="flex-1 flex-box-v flex-center-center">
-        <image src="../../../image/lb.png" />
+      <view class="flex-1 flex-box-v flex-center-center" data-index="2" catchTap="openUrl">
+        <image src="../../../image/dh.png" />
         <text>兑换记录</text>
       </view>
     </view>
@@ -23,27 +23,31 @@
   <form onReset="onReset" class="flex-box-ce form">
     <view class="search flex-1 flex-box flex-v-ce">
       <image mode="widthFix" src="../../../image/ss.png" />
-      <input placeholder="品搜索" onInput="bindKeyInput" onConfirm="bindKeyInput" class="flex-1" />
+      <input placeholder="品搜索" onInput="bindKeyInput" onConfirm="bindKeyInput" class="flex-1" />
       <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
     </view>
     <view class="flex-box-ce">
       <picker onChange="activeItem" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
-          <text style="font-size:28rpx;color:#777">{{minuteArray[minuteIndex].name}}</text>
+        <text style="font-size:28rpx;color:#777;max-width:240rpx;" class="font-flex-word">{{minuteArray[minuteIndex].name}}</text>
       </picker>
-      <image mode="widthFix" src="../../../image/right.png" style="width:30rpx" class="css3"/>
+      <image mode="widthFix" src="../../../image/right.png" style="width:30rpx;position:relative;top:-4rpx" class="css3" />
     </view>
   </form>
-  <view class="flex-box flex-d-wrap itemBox">
-    <view class="item" a:for="{{list}}">
-        <image mode="widthFix" src="../../../image/money.jpg"/>
-        <view class="content fontColorF">
-          因为这些问题也陪伴我度过了生命中那些夜不能寐的日子,
-        </view>
-        <view class="flex-box-ce">
-          <text class="red flex-1">49功勋点</text>
-          <button size="mini" type="ghost">兑换</button>
+  <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <view class="itemBox flex-box flex-d-wrap">
+      <view class="item" a:for="{{list}}" data-item="{{item}}" catchTap="openDetail">
+        <image mode="aspectFill" src="{{item.image}}" style="height:3rem; border-radius: 16rpx 16rpx 0 0;" />
+        <view style="padding:0 0.1rem 0.1rem 0.1rem">
+          <view class="content">{{item.name}}</view>
+          <view class="flex-box-ce">
+            <text class="red flex-1" style="font-size:28rpx">{{item.price}}功勋点</text>
+            <!-- <button size="mini" type="ghost" style="font-size:28rpx">兑换</button> -->
+          </view>
         </view>
+      </view>
     </view>
-  </view>
-
+    <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+  </scroll-view>
+  <no-data a:if="{{list.length==0}}"></no-data>
+  
 </view>

+ 102 - 14
pages/exchange/exchange/exchange.js

@@ -4,25 +4,113 @@ Page({
   data: {
     src: '',
     list: [1, 2, 3],
+    gxd: 0,
     minuteIndex: 0,//条件选择
-    minuteArray: [
-      { id: 0, name: '全部分类' },
-      { id: 1, name: '待审批' },
-      { id: 2, name: '已审批' },
-    ],
+    minuteArray: [],
+    page: 1,
+    isVal: false,
+    keyword: '',
   },
   onLoad(e) {
-    dd.setNavigationBar({ title: "积分商城" });
+    that = this;
+    dd.setNavigationBar({ title: "福利兑换" });
+    this.getPrizeList();
   },
-  activeItem(e) {
-
+  onShow(){
+    this.getLsit();
+  },
+  onReset() {
+    this.setData({
+      keyword: '',
+      isVal: false,
+      page: 1,
+    })
+    this.getPrizeList();
+  },
+  //上啦加载
+  onScrollToLower() {
+    if (!that.data.isData) {
+      this.setData({ page: ++that.data.page })
+      this.getPrizeList(true);
+    }
   },
-  openUrl() {
-
+  bindKeyInput(e) {
+    this.setData({
+      page: 1,
+      isVal: e.detail.value ? true : false,
+      keyword: e.detail.value ? e.detail.value : '',
+    })
+    this.getPrizeList();
+  },
+  //获取统计数据
+  getLsit() {
+    var http1 = app.$get("api/shop/achievement/detail", { employee_id: app.globalData.userData.id, page: 1, page_size: 5000, export: 0 });
+    var http2 = app.$get("api/shop/goods/category/list", {});
+    Promise.all([http1, http2]).then(resArr => {
+      if (resArr[0].data.code == 1) {
+        that.setData({
+          gxd: resArr[0].data.data.all
+        });
+      }
+      if (resArr[1].data.code == 1) {
+        let arr = resArr[1].data.data.list;
+        arr.unshift({ id: -1, name: '全部分类' })
+        that.setData({
+          minuteArray: arr
+        });
+      }
+    })
   },
-  openUrl2() {
-    dd.switchTab({
-      url: '../../workbench/index/index'
+  getPrizeList(is) {
+    let data = {
+      page: this.data.page,
+      page_size: 20,
+      status: 1,
+      export: 0,
+      keyword: this.data.keyword,
+    }
+    if (this.data.minuteArray[this.data.minuteIndex] && this.data.minuteArray[this.data.minuteIndex].id != -1) {
+      data.category_id = this.data.minuteArray[this.data.minuteIndex].id;
+    }
+    app.$get("api/shop/goods", data).then((res) => {
+      var data = res.data.data.list;
+      if (that.data.page == 1) { this.setData({ list: [] }) }
+      var list = that.data.list;
+      if (is) {
+        if (data.length < 20) {
+          this.setData({ list: list.concat(data), isData: true })
+        } else {
+          this.setData({ list: list.concat(data) })
+        }
+      } else {
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
     })
-  }
+  },
+  activeItem(e) {
+    this.setData({ page: 1, minuteIndex: e.detail.value, })
+    this.getPrizeList();
+  },
+  openDetail(e) {
+    var item = e.target.dataset.item;
+    item.gxd=this.data.gxd
+    dd.navigateTo({
+      url: '../commodityDetail/commodityDetail?item=' +JSON.stringify(item) 
+    })
+  },
+  openUrl(e) {
+    var index = e.target.dataset.index;
+    if (index == 1) {
+      dd.navigateTo({
+        url: '../gxdDetail/gxdDetail'
+      })
+    } else {
+      dd.navigateTo({
+        url: '../exchangeRecord/exchangeRecord'
+      })
+    }
+  },
 });

+ 8 - 1
pages/exchange/exchange/exchange.json

@@ -1 +1,8 @@
-{}
+{
+  "usingComponents": {
+    "select-staff": "/Component/selectStaff/selectStaff",
+    "img-box": "/Component/img-box/index",
+    "select-zp": "/Component/selectSxZp/selectSxZp",
+    "no-data": "/Component/noData/noData"
+  }
+}

+ 3 - 5
pages/exchange/exchangeRecord/exchangeRecord.acss

@@ -10,17 +10,15 @@ page{
   top: 40%;
   margin-top: -25%;
 }
-
+.scroll{
+ height: calc(100vh - 40rpx);
+}
 .windows-title {
   padding: 32rpx;
   color: #999;
   font-size: 24rpx;
 }
 
-.windows-btn {
-  /* border-top: 1px solid #f1f1f1; */
-}
-
 .windows-btn view:nth-child(1) {
   text-align: right;
   padding: 32rpx;

+ 15 - 11
pages/exchange/exchangeRecord/exchangeRecord.axml

@@ -1,32 +1,36 @@
 <view>
   <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower" style="padding:20rpx">
-    <view a:for="{{list}}" style="padding:20rpx;box-shadow: 0rpx 0rpx 10rpx #ccc;margin-bottom:20rpx">
+    <view a:for="{{list}}" style="padding:20rpx;box-shadow: 0rpx 0rpx 10rpx #ccc;margin-bottom:20rpx" data-item="{{item}}" 
+      catchTap="openDetail">
       <view class="flex-box-ce" style="border-bottom:1px solid #f1f1f1;padding-bottom:20rpx">
-        <text class="flex-1 font-flex-word" style="padding-right:20rpx;">商品明细</text>
-        <text class="yellow" style="width:100rpx">待发放</text>
+        <text class="flex-1 font-flex-word" style="padding-right:20rpx;">{{item.goods_name}}</text>
+        <text class="yellow" style="width:100rpx" a:if="{{item.status==0}}">未发放</text>
+        <text class="green" style="width:100rpx" a:if="{{item.status==1}}">已发放</text>
+        <text class="red" style="width:100rpx" a:if="{{item.status==2}}">已取消</text>
       </view>
       <view class="flex-box-ce" style="padding:20rpx 0">
-        <image src="../../../image/money.jpg" style="width:200rpx;height:200rpx;border-radius: 10rpx;" />
+        <image src="{{item.goods_image}}" mode="aspectFill" style="width:200rpx;height:200rpx;border-radius: 10rpx;" />
         <view class="flex-box-v flex-1" style="height:200rpx;padding-top:20rpx;padding-left:20rpx;">
-          <view style="margin-bottom:30rpx"> 单价:20功勋点</view>
-          <view class="fontColorF" style="margin-bottom:30rpx"> 数量:1</view>
-          <view > 总价:20功勋点</view>
+          <view style="margin-bottom:30rpx"> 单价:{{item.price}}功勋点</view>
+          <view class="fontColorF" style="margin-bottom:30rpx"> 数量:{{item.num}}</view>
+          <view >总价:{{item.total_price}}功勋点</view>
         </view>
-        <image src="../../../image/money.jpg" style="width:70rpx;height:70rpx" catchTap="showText"/>
+        <image src="../../../image/code.jpg" data-item="{{item}}" style="width:70rpx;height:70rpx" catchTap="showText" />
       </view>
-      <view class="fontColorF" style="font-size:28rpx">发布于 2015-12-23 14:14</view>
+      <view class="fontColorF" style="font-size:28rpx">兑换时间 {{item.date}}</view>
     </view>
+    <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
   </scroll-view>
   <no-data a:if="{{list.length==0}}" />
   <view a:if="{{isBh}}" class="windows" content="还没有积分事件">
     <view class="windows-box">
       <view class="windows-title">兑换码</view>
       <view class="flex-box-ce flex-center-center" style="margin-bottom:20rpx;">
-        <text style="padding-right:20rpx;font-size:36rpx">285 5451 654</text>
+        <text style="padding-right:20rpx;font-size:36rpx">{{sn}}</text>
         <button size="mini" open-type="share" catchTap="handleCopy">复制</button>
       </view>
       <view style="text-align:center;padding:20rpx 0;">
-              <image src="../../../image/money.jpg" style="width:260rpx;height:260rpx;border-radius: 10rpx" />
+        <image src="{{image}}" style="width:260rpx;height:260rpx;border-radius: 10rpx" />
       </view>
       <view class="windows-content">提供兑换码或二维码给奖品兑换负责人即可</view>
       <view class="windows-btn flex-box flex-v-ce">

File diff suppressed because it is too large
+ 46 - 7
pages/exchange/exchangeRecord/exchangeRecord.js


+ 5 - 1
pages/exchange/exchangeRecord/exchangeRecord.json

@@ -1 +1,5 @@
-{}
+{
+    "usingComponents": {
+        "no-data":"/Component/noData/noData"
+    }
+}

+ 11 - 8
pages/exchange/gxdDetail/gxdDetail.acss

@@ -26,31 +26,34 @@ page{
 
 .head {
   position: absolute;
-  top: 80rpx;
+  top: 0rpx;
   left: 32rpx;
   right: 32rpx;
   border-radius: 20rpx;
   background-color: #fff;
   box-shadow: 0 0.04rem 0.12rem 0 rgba(0, 0, 0, .05);
-  height: 120rpx;
-  text-align: center;
+  height: 200rpx;
+  padding: 24rpx;
+  /* text-align: center; */
 }
 
 .head .flex-1 view:nth-child(1) {
-  color: #26A2FF;
+  /* color: #26A2FF; */
   font-weight: 600;
   margin-bottom: 10rpx;
-  font-size: 40rpx;
+  font-size: 36rpx;
 }
 
 .head .flex-1 view:nth-child(2) {
   color: #C0C4CC;
   margin-bottom: 5rpx;
-  font-size: 28rpx;
+  font-size: 24rpx;
 }
 
 .headed {
-  background-color: #fff;
+   background-color: #26A2FF;
+  height: 140rpx;
+   margin-bottom: 120rpx;
 }
 
 .headed-box {
@@ -141,5 +144,5 @@ page{
 
 
 .scroll {
-  height: calc(100vh - 2.2rem);
+  height: calc(100vh - 2.6rem);
 }

+ 53 - 20
pages/exchange/gxdDetail/gxdDetail.axml

@@ -1,35 +1,68 @@
 <view>
-  <view class="head flex-box flex-center-center">
-    <view class="flex-1">
-      <view>{{month_total}}</view>
-      <view>支出</view>
+  <view class="head">
+    <view class="flex-box-ce">
+      <view class="flex-1">
+        <view a:if="{{all>=0}}" class="blue">{{all}}</view>
+        <view a:else class="red">{{consume}}</view>
+        <view>现有功勋点</view>
+      </view>
+      <view class="flex-1">
+        <view a:if="{{grant>=0}}" class="blue">{{grant}}</view>
+        <view a:else class="red">{{grant}}</view>
+        <view>管理员发放</view>
+      </view>
+      <view class="flex-1">
+        <view a:if="{{exchange>=0}}" class="blue">{{exchange}}</view>
+        <view a:else class="red">{{exchange}}</view>
+        <view>B分转换</view>
+      </view>
     </view>
-    <view class="flex-1">
-      <view>{{total}}</view>
-      <view>收入</view>
+    <view class="flex-box-ce" style="margin-top:10rpx">
+      <view class="flex-1">
+        <view a:if="{{consume>=0}}" class="blue">{{consume}}</view>
+        <view a:else class="red">{{consume}}</view>
+        <view>兑换奖品</view>
+      </view>
+      <view class="flex-1">
+        <view a:if="{{take_back>=0}}" class="blue">{{take_back}}</view>
+        <view a:else class="red">{{take_back}}</view>
+        <view>被回收</view>
+      </view>
+      <view class="flex-1"></view>
     </view>
   </view>
   <view class="headed margin-bottom">
-    <view class="top">
-      <view class="dates" style="padding:10rpx 0" catchTap="openDate">
-        <image mode="scaleToFill" src="../../../image/date.png"/>
-        <text style="font-size:32rpx;position: relative;" class="{{showDate? 'activeView':''}}">{{date}}</text>
-      </view>
-    </view>
+    <!--<view class="top"><view class="dates" style="padding:10rpx 0" catchTap="openDate"><image mode="scaleToFill" src="../../../image/date.png"/><text style="font-size:32rpx;position: relative;" class="{{showDate? 'activeView':''}}">{{date}}</text></view></view> -->
   </view>
   <view class="main margin-bottom">
-    <!-- <view class="title" style="padding-bottom:0rpx">本月奖票</view> -->
     <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="flex-box-ce item" a:for="{{list}}">
-          <view class="flex-1">
-            <view>本月奖票</view>
-            <text style="font-size:28rpx" class="fontColorF">2015-12-23 14:14</text>
+        <view class="flex-1" style="padding-right:40rpx">
+          <view a:if="{{item.type==4}}">
+            <text>{{item.remark}}</text>
+          </view>
+          <view a:else>
+            管理员
+            <text a:if="{{item.type==1}}">发放</text>
+            <text a:if="{{item.type==2}}">回收</text>
+            <text a:if="{{item.type==3}}">转换</text>
+            <text a:if="{{item.remark}}">“{{item.remark}}”</text>
           </view>
-          <view class="red">
-            +100
+          <text style="font-size:28rpx" class="fontColorF">{{item.date}}</text>
+        </view>
+        <view>
+          <view class="red" a:if="{{item.achievement>0}}">{{item.achievement}}</view>
+          <view class="green" a:else>{{item.achievement}}</view>
+          <view class="fontColorF" style="font-size:24rpx;text-align:right">
+            <view a:if="{{item.type==1}}">发放</view>
+            <view a:if="{{item.type==2}}">回收</view>
+            <view a:if="{{item.type==3}}">转换</view>
+            <view a:if="{{item.type==4}}">兑换</view>
           </view>
+        </view>
       </view>
+      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
-     <no-data a:if="{{list.length==0}}"/>
+    <no-data a:if="{{list.length==0}}" />
   </view>
 </view>

+ 28 - 28
pages/exchange/gxdDetail/gxdDetail.js

@@ -4,50 +4,46 @@ var that;
 Page({
   data: {
     date: app.globalData.month,
-    list: [1,2,3,5],
+    list: [],
     page: 1,
-    month_total: 0,
-    total: 0
+    all: 0,
+    grant: 0,
+    exchange:0,
+    consume: 0,
+    take_back: 0,
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "功勋点明细" });
     this.getData();
   },
-  //选择时间
-  openDate(e) {
-    dd.datePicker({
-      format: 'yyyy-MM',
-      currentDate: that.data.date,
-      success: (res) => {
-        that.setData({
-          date: res.date
-        })
-        if (res.date) {
-          that.getData();
-        }
-      },
-    });
-  },
   //上啦加载
   onScrollToLower() {
     if (!that.data.isData) {
       this.setData({ page: ++that.data.page })
+      this.getData(true);
     }
+    
   },
   getData(is) {
     var data = {
       page: this.data.page,
       page_size: 20,
       employee_id: app.globalData.userData.id,
-      month: this.data.date
+      export: 0,
     }
-    app.$get('/api/integral/ticket', data).then((res) => {
-      var data = res.data.data.month_list;
+    app.$get('/api/shop/achievement/detail', data).then((res) => {
+      var data = res.data.data.list;
+      data.map(item => {
+        item.date = this.timestampToTime(item.create_time)
+      })
       var list = that.data.list;
       this.setData({
-        month_total: res.data.data.month_total,
-        total: res.data.data.total
+        all: res.data.data.all,
+        grant: res.data.data.grant,
+        exchange: res.data.data.exchange,
+        consume: res.data.data.consume,
+        take_back: res.data.data.take_back,
       })
       if (is) {
         if (data.length < 20) {
@@ -68,10 +64,14 @@ Page({
       }
     })
   },
-  //打开更多
-  openMore() {
-    dd.navigateTo({
-      url: '../../statistics/integralEvent/integralEvent?month=' + this.data.date + '&type=BF'
-    })
+  timestampToTime(timestamp) {
+    var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    var Y = date.getFullYear() + '-';
+    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+    var D = date.getDate() + ' ';
+    var h = date.getHours() + ':';
+    var m = date.getMinutes() + ':';
+    var s = date.getSeconds();
+    return Y + M + D + h + m + s;
   },
 });

+ 8 - 4
pages/exchange/prizeDetail/prizeDetail.acss

@@ -23,10 +23,6 @@ page{
   font-size: 24rpx;
 }
 
-.windows-btn {
-  /* border-top: 1px solid #f1f1f1; */
-}
-
 .windows-btn view:nth-child(1) {
   text-align: right;
   padding: 32rpx;
@@ -37,4 +33,12 @@ page{
   padding: 0 28rpx;
   font-size: 28rpx;
   color: #606266;
+}
+.footer{
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  padding: 12rpx;
+  border-top: 1px solid #f1f1f1;
 }

+ 27 - 16
pages/exchange/prizeDetail/prizeDetail.axml

@@ -1,14 +1,21 @@
 <view>
   <view class="lBgn flex-box-ce">
-    <image mode="scaleToFill" src="../../../image/zt.png" style="width:40rpx;height:40rpx;" />
-    <text class="flex-1" style="font-size:36rpx;color:#fff;padding-left:20rpx">待发放</text>
+    <!-- <image mode="scaleToFill" src="../../../image/zt.png" style="width:40rpx;height:40rpx;" /> -->
+    <text class="flex-1" style="font-size:36rpx;color:#fff;padding-left:20rpx" a:if="{{detail.status==0}}">待发放</text>
+    <text class="flex-1" style="font-size:36rpx;color:#fff;padding-left:20rpx" a:if="{{detail.status==1}}">已发放</text>
+    <text class="flex-1" style="font-size:36rpx;color:#fff;padding-left:20rpx" a:if="{{detail.status==2}}">已取消</text>
     <image mode="scaleToFill" src="../../../image/ju.png" style="width:100rpx;height:100rpx;" />
   </view>
   <view style="padding:20rpx;">
     <view style="padding:20rpx;box-shadow: 0px 0px 10px #ccc;border-radius: 4px;margin-bottom:20rpx">
-      <view class="fontColorF" style="font-size:28rpx;margin-bottom:10rpx">2015-12-23 14:14</view>
-      <view style="background:#F5F7FA;height:100rpx;border-radius: 4px;padding:20rpx;color: #606266;font-size:28rpx">
-        这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色
+      <view class="fontColorF" style="font-size:28rpx;margin-bottom:10rpx">兑换时间:{{detail.date}}</view>
+      <view style="background:#F5F7FA;min-height:100rpx;border-radius: 4px;padding:16rpx;color: #606266;font-size:28rpx" a:if="{{detail.remark}}">
+        {{detail.remark}}
+      </view>
+      <view class="fontColorF" style="font-size:28rpx;margin-bottom:10rpx" a:if="{{detail.status==2}}">取消时间:{{detail.date2}}</view>
+      <view class="fontColorF" style="font-size:28rpx;margin-bottom:10rpx" a:if="{{detail.status==1}}">发放时间:{{detail.date2}}</view>
+      <view style="background:#F5F7FA;min-height:100rpx;border-radius: 4px;padding:16rpx;color: #606266;font-size:28rpx" a:if="{{detail.cancel_remark}}">
+        {{detail.cancel_remark}}
       </view>
     </view>
     <view style="padding:20rpx;box-shadow: 0px 0px 10px #ccc;border-radius: 4px;margin-bottom:20rpx">
@@ -17,23 +24,27 @@
         <text class="flex-1" style="font-size:28rpx;padding-left:20rpx">兑换码</text>
       </view>
       <view class="flex-box-ce" style="height:70rpx;padding:20rpx;color: #606266;padding-bottom:0">
-        <text class="flex-1" style="padding-right:20rpx;font-size:36rpx">123 456 789</text>
-        <image src="../../../image/money.jpg" style="width:70rpx;height:70rpx" catchTap="showText" />
+        <text class="flex-1" style="padding-right:20rpx;font-size:36rpx">{{detail.sn}}</text>
+        <image src="../../../image/code.jpg" style="width:70rpx;height:70rpx" catchTap="showText"/>
       </view>
     </view>
     <view style="padding:20rpx;box-shadow: 0px 0px 10px #ccc;border-radius: 4px;margin-bottom:20rpx">
       <view style="color: #606266;font-size:28rpx;padding-bottom:20rpx;">
-        这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色这个颜色
+        {{detail.goods_name}}
       </view>
       <view class="flex-box-ce">
-        <image src="../../../image/money.jpg" style="width:200rpx;height:200rpx;border-radius: 10rpx;" />
+        <image src="{{detail.goods_image}}" mode="aspectFill" style="width:200rpx;height:200rpx;border-radius: 10rpx;" data-url="{{detail.goods_image}}"  catchTap="showImg"/>
         <view class="flex-box-v flex-1" style="height:200rpx;padding-top:20rpx;padding-left:20rpx;">
-          <view style="margin-bottom:30rpx"> 单价:20功勋点</view>
-          <view class="fontColorF" style="margin-bottom:30rpx"> 数量:1</view>
-          <view > 总价:20功勋点</view>
+          <view style="margin-bottom:30rpx"> 单价:{{detail.price}}功勋点</view>
+          <view class="fontColorF" style="margin-bottom:30rpx"> 数量:{{detail.num}}</view>
+          <view > 总价:{{detail.total_price}}功勋点</view>
         </view>
       </view>
     </view>
+
+  </view>
+  <view class="footer" a:if="{{is&&detail.status==0}}">
+      <button size="default" type="primary" loading="{{disabled}}" disabled="{{disabled}}" catchTap="openText">发放</button>
   </view>
   
   
@@ -41,15 +52,15 @@
     <view class="windows-box">
       <view class="windows-title">兑换码</view>
       <view class="flex-box-ce flex-center-center" style="margin-bottom:20rpx;">
-        <text style="padding-right:20rpx;font-size:36rpx">285 5451 654</text>
+        <text style="padding-right:20rpx;font-size:36rpx">{{detail.sn}}</text>
         <button size="mini" open-type="share" catchTap="handleCopy">复制</button>
       </view>
-      <view style="text-align:center;padding:20rpx 0;">
-        <image src="../../../image/money.jpg" style="width:260rpx;height:260rpx;border-radius: 10rpx" />
+      <view style="text-align:center;padding:20rpx 0;" a:if="{{image}}">
+        <image src="{{image}}" style="width:260rpx;height:260rpx;border-radius: 10rpx" />
       </view>
       <view class="windows-content">提供兑换码或二维码给奖品兑换负责人即可</view>
       <view class="windows-btn flex-box flex-v-ce">
-        <view class="flex-1" catchTap="showText">我知道了</view>
+        <view class="flex-1" catchTap="showText2">我知道了</view>
       </view>
     </view>
   </view>

+ 85 - 5
pages/exchange/prizeDetail/prizeDetail.js

@@ -1,15 +1,95 @@
+var app = getApp()
+var that;
 Page({
-  data: {},
-  onLoad() {
+  data: {
+    detail: {},
+    id: '',
+    is: true,//是否是发放员进来
+    disabled: false,
+    sn:'',
+    image:''
+  },
+  onLoad(e) {
+    that = this;
     dd.setNavigationBar({ title: "奖品兑换详情" });
+    if (e.id) {
+      this.setData({ id: e.id })
+    }
+    if (e.is) {
+      this.setData({ is: false })
+    }
+  },
+  showImg(e) {
+    var url = e.target.dataset.url
+    dd.previewImage({
+      current: 0,
+      urls:[url]
+    });
+  },
+  onShow() {
+    if (app.globalData.userData) {
+      that.getData();
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is) {
+          that.getData();
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      }, function () { })
+    }
+  },
+  openText() {
+    this.setData({ disabled: true });
+    app.$post("api/shop/exchange/deal", { id: this.data.id }).then((res) => {
+      app.globalData.showToast("已发放");
+      setTimeout(() => {
+        this.setData({ disabled: false });
+        this.getData()
+      }, 1000);
+    }).catch(err => {
+      this.setData({ disabled: false });
+    })
   },
   showText() {
-    this.setData({ isBh: !this.data.isBh })
+    app.$get('api/shop/exchange/qrcode', { id: this.data.id, employee_id: app.globalData.userData.id }).then((res) => {
+      this.setData({
+        image: app.globalData.baseUrl + res.data.data,
+      })
+    })
+    this.setData({
+      isBh: !this.data.isBh,
+    })
+  },
+  showText2() {
+    this.setData({
+      isBh: !this.data.isBh,
+    })
   },
   handleCopy() {
     dd.setClipboard({
-      text: this.data.text,
+      text: this.data.detail.sn,
     })
     app.globalData.showToast("已复制");
-  }
+  },
+  getData() {
+    app.$get('api/shop/exchange/detail', { id: this.data.id }).then((res) => {
+      let data = res.data.data;
+      data.date = this.timestampToTime(data.create_time)
+      data.date2 = this.timestampToTime(data.complete_time)
+      this.setData({ detail: res.data.data })
+    })
+  },
+  timestampToTime(timestamp) {
+    var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    var Y = date.getFullYear() + '-';
+    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+    var D = date.getDate() + ' ';
+    var h = date.getHours() + ':';
+    var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() ) + ':';
+    var s = date.getSeconds();
+    return Y + M + D + h + m + s;
+  },
 });

+ 1 - 1
pages/statistics/my_apply/my_apply.axml

@@ -21,7 +21,7 @@
           <view class="flex-box">
             <view class="name flex-1" style="margin-right: 10rpx;">{{item.remark.customize || item.remark.rule}}</view>
             <view class="red" a:if="{{item.review_point > 0}}">+{{item.review_point}} {{item.pt_name}}</view>
-            <view class="green" a:else>{{item.review_point}} {{item.pt_name}}</view>
+            <view class="green" a:else>{{item.point}} {{item.pt_name}}</view>
           </view>
           <view class="flex-box flex-v-ce">
             <view class="date flex-1">{{item.event_time}}</view>

+ 5 - 0
pages/statistics/offerAreward/offerAreward.js

@@ -232,6 +232,11 @@ Page({
         defaultSection: e,
         [`items.dept_ids`]: arr
       })
+    }else{
+      that.setData({
+        defaultSection: [],
+        [`items.dept_ids`]:[]
+      })
     }
   },
   //选择弹窗

+ 5 - 0
pages/statistics/offerAreward_set/offerAreward_set.js

@@ -252,6 +252,11 @@ Page({
         defaultSection: e,
         [`items.dept_ids`]: arr
       })
+    }else{
+      that.setData({
+        defaultSection: [],
+        [`items.dept_ids`]:[]
+      })
     }
   },
   //选择弹窗

+ 0 - 9
pages/statistics/repetitive_tasks_detail/repetitive_tasks_detail.js

@@ -17,15 +17,6 @@ Page({
       })
     }
   },
-  //显示图片
-  showImg(e) {
-    var index = e.target.dataset.index;
-    var item = e.target.dataset.item
-    dd.previewImage({
-      current: index,
-      urls: item
-    });
-  },
   formSubmit() {
     dd.confirm({
       title: '删除任务',

+ 22 - 2
pages/workbench/index/index.js

@@ -22,7 +22,6 @@ Page({
     total: '',
     menuList: [
       { name: '审批', imgUrl: '../../../image/sp.png', url: '../my_approve/my_approve', code: 'creator admin' },
-      // { name: '批量审批', imgUrl: '../../../image/sp.png', url: '../approval_batch/approval_batch', code: 'creator admin' },
       { name: '任务', imgUrl: '../../../image/a7.png', url: '../../statistics/my_task/my_task', code: 'admin employee' },
       { name: '奖扣B分', imgUrl: '../../../image/point_entry.png', url: '../jk_B/jk_B?type=B', code: 'creator admin' },
       { name: '指派任务', imgUrl: '../../../image/my_publish.png', url: '../../statistics/assaign/assaign', code: 'creator admin' },
@@ -375,7 +374,9 @@ Page({
     var task = app.$get('api/integral/statistics/task/pie', { month: app.globalData.month })// 管理者奖扣任务柱状图
     var work = app.$get('api/integral/work/list', { status: 'running', page: 1, pt_id: 0, source_type: 0 })// 管理者奖扣任务柱状图
     var headDayBs = app.$get2("api/integral/statistics", { employee_id: app.globalData.userData.id, day: app.globalData.day },'application/vnd.test.v2+json')//获取个人统计-当天B分 - V2
-    Promise.all([http1, http2, http3, ranking, task, work, headDayBs]).then(function (values) {
+    var config = app.$get('api/integral/site/config',{})// 系统配置
+
+    Promise.all([http1, http2, http3, ranking, task, work, headDayBs,config]).then(function (values) {
       if (values[0]) {
         let data = values[0].data.data;
         var task = data.task;
@@ -452,6 +453,25 @@ Page({
           headDayBs:data
         })
       }
+      if(values[7]){
+           let data = values[7].data.data;
+           let menuList=JSON.parse(JSON.stringify( that.data.menuList))
+           if(data.shop_status==1){
+             if(menuList[menuList.length-2].name!='福利兑换'){
+                menuList.splice(menuList.length-1,0, { name: '福利兑换', imgUrl: '../../../image/fl.png', url: '../../exchange/exchange/exchange', code: 'creator admin employee' })
+                that.setData({
+                  menuList:menuList
+                })
+             }
+           }else{
+              if(menuList[menuList.length-2].name=='福利兑换'){
+                menuList.splice(menuList.length-2,1)
+                that.setData({
+                  menuList:menuList
+                })
+             }
+           }
+      }
     })
   },
   //获取积分事件

Some files were not shown because too many files changed in this diff