kk.shi 3 lat temu
rodzic
commit
44d4079f8a

+ 0 - 1
app.json

@@ -22,7 +22,6 @@
     "pages/luckDraw/recordPrize",
     "pages/welfareMall/coupon/coupon",
     "pages/welfareMall/writeOff/writeOff",
-    "pages/welfareMall/staff/staff",
     "pages/welfareMall/staff/isStaff",
     "pages/welfareMall/staff/distinguish",
     "pages/welfareMall/staff/noStaff",

+ 0 - 66
pages/welfareMall/staff/staff.js

@@ -1,66 +0,0 @@
-// pages/welfareMall/staff/staff.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
-})

+ 0 - 3
pages/welfareMall/staff/staff.json

@@ -1,3 +0,0 @@
-{
-  "usingComponents": {}
-}

+ 0 - 2
pages/welfareMall/staff/staff.wxml

@@ -1,2 +0,0 @@
-<!--pages/welfareMall/staff/staff.wxml-->
-<text>pages/welfareMall/staff/staff.wxml</text>

+ 0 - 1
pages/welfareMall/staff/staff.wxss

@@ -1 +0,0 @@
-/* pages/welfareMall/staff/staff.wxss */

+ 56 - 9
pages/welfareMall/writeOff/writeOff.js

@@ -14,14 +14,16 @@ Page({
     noResult: false,
     noMore: false,
     mobileTop: 'TONY WU',
-    hexiaoList: []
+    hexiaoList: [],
+    storeList: [],
+    index: 0,
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.getHexiaoList();
+    
   },
 
   /**
@@ -35,7 +37,8 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    this.getHexiaoList();
+    this.getStoreListByStaff();
   },
 
   /**
@@ -90,7 +93,7 @@ Page({
     })
 },
 
-userHexiaoListView: function(data) {
+  userHexiaoListView: function(data) {
     if (!Array.isArray(data) || data.length == 0) {
         console.log("核销列表数据为空");
         if (this.data.page == 1) {
@@ -106,15 +109,59 @@ userHexiaoListView: function(data) {
         }
         return
     }
-    // data.forEach(v => {
-    //     let payeTime = v.payedAt
-    //     v.payedAt = parseTime(payeTime, "{y}.{m}.{d} {h}:{i}:{s}")
-    // })
 
-    this.data.hexiaoList = this.data.hexiaoList.concat(...data)
+    this.data.hexiaoList = data
     this.setData({
         mobileTop:getMobileCache(),
         hexiaoList: this.data.hexiaoList
     })
   }, 
+
+// 根据职员获取门店列表
+getStoreListByStaff: function() {
+  WelfareMall.getStoreListByStaff({
+    mobile: getMobileCache(),
+  }).then(res => {
+      if (res.code == 200) {
+          this.userstoreListView(res.data)
+      }
+      this.data.lock = false
+  }).catch(_ => {
+      console.log(_)
+      this.data.lock = false
+  })
+},
+
+userstoreListView: function(data) {
+  if (!Array.isArray(data) || data.length == 0) {
+      console.log("门店列表数据为空");
+      if (this.data.page == 1) {
+          this.setData({
+              mobileTop:getMobileCache(),
+              noResult: true
+          })
+      } else {
+          this.setData({
+              mobileTop:getMobileCache(),
+              noMore: true
+          })
+      }
+      return
+  }
+  const storeNameList = []
+  data.forEach(v => {
+        storeNameList.push(v.storeName)
+    })
+  this.setData({
+      mobileTop:getMobileCache(),
+      storeList: storeNameList
+  })
+  },  
+
+  bindPickerChange: function (e) {
+    console.log(e)
+    this.setData({
+        index: e.detail.value
+    })
+  },
 })

+ 4 - 4
pages/welfareMall/writeOff/writeOff.wxml

@@ -1,8 +1,8 @@
 <!--pages/welfareMall/writeOff/writeOff.wxml-->
-<view class="store-bar flex-row">
-  <view class="store-text">选择门店</view>
-  <image class="store-img" src="../../../images/welfareMall/open.png" />
-</view>
+<picker class="store-bar flex-row" bindchange="bindPickerChange" value="{{index}}" range="{{storeList}}">
+  <view class="store-text">{{storeList[index]}}</view>
+  <!-- <image class="store-img" src="../../../images/welfareMall/open.png" /> -->
+</picker>
 <view class="writeOff-search flex-column">
   <view class="search-bar flex-row">
     <image class="search-img" src="../../../images/welfareMall/search.png" />

+ 0 - 1
pages/welfareMall/writeOff/writeOff.wxss

@@ -58,7 +58,6 @@ page{
 }
 
 .store-text{
-  width: 150rpx;
   margin-left: 50rpx;
   font-size: 28rpx;
   font-weight: 500;