kk.shi 3 rokov pred
rodič
commit
9a5d48a8cf

+ 1 - 1
pages/luckDraw/detail.js

@@ -447,7 +447,7 @@ Page({
 
     toLuckDrawPage: function() {
         wx.navigateTo({
-          url: '/pages/luckDraw/index',
+          url: '/pages/luckDraw/recordPrize',
         })
     },
 

+ 10 - 3
pages/luckDraw/prize.js

@@ -14,6 +14,7 @@ Page({
         noResult: false,
         noMore: false,
         isLogin: false,
+        mobileTop: 'TONY WU',
         couponNum: 0,
         productNum: 0,
         goodsItemList: []
@@ -27,7 +28,10 @@ Page({
     this.setData({
         isLogin: getMobileCache() != ''
     })
-    this.getUserPrizeList();
+    if(this.data.isLogin){
+        this.getUserPrizeList();
+    }
+    
   },
 
   /**
@@ -89,9 +93,11 @@ Page({
 
   uaerPrizeListView: function(data) {
       if (!Array.isArray(data.goodsItemList) || data.goodsItemList.length == 0) {
-          console.log("没有获取到数据");
+          console.log("奖品数据");
               this.setData({
-                  noResult: true
+                  noResult: true,
+                  mobileTop:getMobileCache(),
+                  goodsItemList: []
               })
           return
       }
@@ -104,6 +110,7 @@ Page({
 
       this.data.goodsItemList = this.data.goodsItemList.concat(...data.goodsItemList)
       this.setData({
+          mobileTop:getMobileCache(),
           couponNum: data.couponNum,
           productNum: data.productNum,
           goodsItemList: this.data.goodsItemList

+ 4 - 4
pages/luckDraw/prize.wxml

@@ -1,10 +1,11 @@
 <!--pages/luckDraw/prize.wxml-->
 <view class="personal">
 <!-- 个人中心视图 -->
-    <view class="head-bg">
+    <view class="head-bg" catchtap="turnPrize">
        <image class="image_bg" src="/images/luck-draw/per_head.png" />
        <image class="image_portrait" src="/images/luck-draw/portrait.png" />
-       <view class="luck-draw-pro-nickname"  catchtap="toRecordPrize">TONY WU</view>
+       <button class="luck-draw-pro-nickname" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >请登录</button>
+       <view class="luck-draw-pro-nickname" wx:if="{{isLogin}}">{{mobileTop}}</view>
     </view>
     <view class="luck-draw-pro-cp">
       <!-- 优惠券 -->
@@ -19,8 +20,7 @@
         <view class="luck-draw-cjh"><view class="luck-draw-cj"></view></view>
       </view>
     </view>
-    <view class="luck-draw-theme" catchtap="turnPrize">
-      <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >请进行用户授权</button>
+    <view class="luck-draw-theme">
       <!-- 奖品 -->
       <view class="luck-draw-content" wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}">
         <view class="luck-draw-words">

+ 9 - 3
pages/luckDraw/profile.js

@@ -14,6 +14,7 @@ Page({
         noResult: false,
         noMore: false,
         isLogin: false,
+        mobileTop: 'TONY WU',
         couponNum: 0,
         productNum: 0,
         goodsItemList: []
@@ -27,7 +28,9 @@ Page({
         this.setData({
             isLogin: getMobileCache() != ''
         })
-        this.getUserPrizeList();
+        if(this.data.isLogin){
+            this.getUserPrizeList();
+        }
     },
 
     /**
@@ -90,9 +93,11 @@ Page({
 
     uaerPrizeListView: function(data) {
         if (!Array.isArray(data.goodsItemList) || data.goodsItemList.length == 0) {
-            console.log("没有获取到数据");
+            console.log("优惠券数据为空");
                 this.setData({
-                    noResult: true
+                    noResult: true,
+                    mobileTop:getMobileCache(),
+                    goodsItemList:[]
                 })
             return
         }
@@ -105,6 +110,7 @@ Page({
 
         this.data.goodsItemList = this.data.goodsItemList.concat(...data.goodsItemList)
         this.setData({
+            mobileTop:getMobileCache(),
             couponNum: data.couponNum,
             productNum: data.productNum,
             goodsItemList: this.data.goodsItemList

+ 5 - 5
pages/luckDraw/profile.wxml

@@ -1,14 +1,15 @@
 <!--pages/luckDraw/profile.wxml-->
 <view class="personal">
 <!-- 个人中心视图 -->
-    <view class="head-bg">
+    <view class="head-bg" catchtap="turnPrize">
        <image class="image_bg" src="/images/luck-draw/per_head.png" />
        <image class="image_portrait" src="/images/luck-draw/portrait.png" />
-       <view class="luck-draw-pro-nickname" catchtap="toRecordPrize">TONY WU</view>
+       <button class="luck-draw-pro-nickname" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >请登录</button>
+       <view class="luck-draw-pro-nickname" wx:if="{{isLogin}}">{{mobileTop}}</view>
     </view>
     <view class="luck-draw-pro-cp">
       <!-- 优惠券 -->
-      <view class="luck-draw-coupon" catchtap="turnPrize">
+      <view class="luck-draw-coupon">
         <view class="luck-draw-cn">{{couponNum}}</view>
         <view class="luck-draw-cz">优惠券</view>
         <view class="luck-draw-cjh"><view class="luck-draw-cj"></view></view>
@@ -19,8 +20,7 @@
         <view class="luck-draw-pz">奖品</view>
       </view>
     </view>
-    <view class="luck-draw-theme" catchtap="turnPrize">
-      <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >请进行用户授权</button>
+    <view class="luck-draw-theme">
       <!-- 折扣券 -->
       <view class="luck-draw-content" wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}" catchtap="toDetail" wx:if="{{item.couponType == 'D'}}">
         <view class="luck-draw-words">

+ 3 - 2
pages/luckDraw/recordPrize.js

@@ -88,9 +88,10 @@ Page({
 
     uaerPrizeListView: function(data) {
         if (!Array.isArray(data) || data.length == 0) {
-            console.log("没有获取到数据");
+            console.log("抽奖记录数据为空");
                 this.setData({
-                    noResult: true
+                    noResult: true,
+                    userDrawItemList:[]
                 })
             return
         }

+ 1 - 1
pages/luckDraw/recordPrize.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "奖记录",
+  "navigationBarTitleText": "奖记录",
   "usingComponents": {
     "tab-bar": "./components/tabbar"
   }

+ 1 - 1
pages/luckDraw/recordPrize.wxml

@@ -2,7 +2,7 @@
 <view class="personal">
 <!-- 中奖记录 -->
     <view class="luck-draw-theme" catchtap="turnPrize">
-      <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >请进行用户授权</button>
+      <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >请登录</button>
       <!-- 奖品 -->
       <view class="luck-draw-content" wx:for="{{userDrawItemList}}" wx:key="index" data-id="{{item.id}}">
         <view class="luck-draw-words">