瀏覽代碼

Merge branch 'bobo/feat/luck-draw' of http://git.ahamu.cn:9202/xing.li/share_activity into bobo/feat/luck-draw

bobo 3 年之前
父節點
當前提交
6095ccb7f8
共有 4 個文件被更改,包括 35 次插入10 次删除
  1. 8 3
      pages/luckDraw/prize.js
  2. 9 2
      pages/luckDraw/prize.wxml
  3. 8 2
      pages/luckDraw/profile.js
  4. 10 3
      pages/luckDraw/profile.wxml

+ 8 - 3
pages/luckDraw/prize.js

@@ -97,6 +97,8 @@ Page({
               if (this.data.page == 1) {
                 this.setData({
                     mobileTop:getMobileCache(),
+                    couponNum: data.couponNum,
+                    productNum: data.productNum,
                     noResult: true
                 })
             } else {
@@ -113,12 +115,15 @@ Page({
           v.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
           v.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
       })
-
+      if (this.data.page == 1) {
+        this.setData({
+            couponNum: data.couponNum,
+            productNum: data.productNum
+        })
+      }
       this.data.goodsItemList = this.data.goodsItemList.concat(...data.goodsItemList)
       this.setData({
           mobileTop:getMobileCache(),
-          couponNum: data.couponNum,
-          productNum: data.productNum,
           goodsItemList: this.data.goodsItemList
       })
   },

+ 9 - 2
pages/luckDraw/prize.wxml

@@ -5,7 +5,7 @@
        <image class="image_bg" src="/images/luck-draw/per_head.png" />
        <image class="image_portrait" src="/images/luck-draw/portrait.png" />
        <button class="luck-draw-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >登录</button>
-       <view class="luck-draw-pro-nickname" wx:if="{{isLogin}}">{{mobileTop}}</view>
+       <view class="luck-draw-pro-nickname" wx:if="{{isLogin}}">{{phone.toHide(mobileTop)}}</view>
     </view>
     <view class="luck-draw-pro-cp">
       <!-- 优惠券 -->
@@ -46,6 +46,13 @@
     </view>
 </view>
 
-
+<!-- 使用wxs 手机号码中间四位显示为*号 -->
+<wxs module="phone">
+var toHide = function(array) {
+  var mphone = array.substring(0, 3) + '****' + array.substring(7);
+  return mphone;
+}
+module.exports.toHide = toHide;
+</wxs>
 <!-- 底部导航 -->
 <tab-bar />

+ 8 - 2
pages/luckDraw/profile.js

@@ -97,6 +97,8 @@ Page({
             if (this.data.page == 1) {
                 this.setData({
                     mobileTop:getMobileCache(),
+                    couponNum: data.couponNum,
+                    productNum: data.productNum,
                     noResult: true
                 })
             } else {
@@ -114,11 +116,15 @@ Page({
             v.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
         })
 
+        if (this.data.page == 1) {
+            this.setData({
+                couponNum: data.couponNum,
+                productNum: data.productNum
+            })
+          }
         this.data.goodsItemList = this.data.goodsItemList.concat(...data.goodsItemList)
         this.setData({
             mobileTop:getMobileCache(),
-            couponNum: data.couponNum,
-            productNum: data.productNum,
             goodsItemList: this.data.goodsItemList
         })
     },

+ 10 - 3
pages/luckDraw/profile.wxml

@@ -5,7 +5,7 @@
        <image class="image_bg" src="/images/luck-draw/per_head.png" />
        <image class="image_portrait" src="/images/luck-draw/portrait.png" />
        <button class="luck-draw-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >登录</button>
-       <view class="luck-draw-pro-nickname" wx:if="{{isLogin}}">{{mobileTop}}</view>
+       <view class="luck-draw-pro-nickname" wx:if="{{isLogin}}">{{phone.toHide(mobileTop)}}</view>
     </view>
     <view class="luck-draw-pro-cp">
       <!-- 优惠券 -->
@@ -48,7 +48,7 @@
             </navigator>
       </view>
       <!-- 代金券 -->
-      <view class="luck-draw-content" wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}" catchtap="toDetail" wx:if="{{item.couponType == 'C'}}">
+      <view class="luck-draw-content" wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}" wx:if="{{item.couponType == 'C'}}">
         <image class="image_zk" src="/images/luck-draw/cash_coupon.png" />
         <image class="image_zk_un" src="/images/luck-draw/cc_use_now.png" />
             <navigator class="_btn _exchange" 
@@ -79,6 +79,13 @@
     </view>
 </view>
 
-
+<!-- 使用wxs 手机号码中间四位显示为*号 -->
+<wxs module="phone">
+var toHide = function(array) {
+  var mphone = array.substring(0, 3) + '****' + array.substring(7);
+  return mphone;
+}
+module.exports.toHide = toHide;
+</wxs>
 <!-- 底部导航 -->
 <tab-bar />