浏览代码

抽奖详情页

bobo 3 年之前
父节点
当前提交
5d10481d5c
共有 4 个文件被更改,包括 16 次插入11 次删除
  1. 9 1
      pages/luckDraw/detail.js
  2. 4 4
      pages/luckDraw/detail.wxml
  3. 0 4
      pages/luckDraw/detail.wxss
  4. 3 2
      pages/luckDraw/index.js

+ 9 - 1
pages/luckDraw/detail.js

@@ -32,6 +32,10 @@ Page({
         noHitResult: null,
         hitRecordList: [],
         showCustomPreview: false,
+        themePic: '', // 来个默认值
+        popBgPic: '',
+        boxBgPic: '',
+        bgColor: '',
     },
 
     /**
@@ -139,7 +143,11 @@ Page({
             forbidTurn: activity.status != 2,
             opptyInitialVal: activity.opptyInitialVal || 0,
             opptyMaxVal: activity.opptyMaxVal || 0,
-            status: activity.status
+            status: activity.status,
+            themePic: activity.themePic || 'https://dy.shpr.top/welfareGo/head-bg-draw.png', // 来个默认值
+            popBgPic: activity.popBgPic || 'https://ks3-cn-shanghai.ksyun.com/pb001/web/hsay/publicPath/25c1b7b4-a155-4f7d-b36f-de665ffa3e5a.png',
+            boxBgPic: activity.boxBgPic || 'https://dy.shpr.top/welfareGo/gift-box.png',
+            bgColor: activity.bgColor || '#BF2637',
         })
 
         if (activity.status == 1 || activity.status ==4 || activity.status == 5) {

+ 4 - 4
pages/luckDraw/detail.wxml

@@ -1,7 +1,7 @@
 <!--pages/luckDraw/detail.wxml-->
-<view class="page" wx:if="{{showPage}}">
+<view class="page" wx:if="{{showPage}}" style="background-color: {{bgColor}};">
     <view class="head-bg">
-       <image src="https://dy.shpr.top/welfareGo/head-bg-draw.png" mode="widthFix"/>
+       <image src="{{themePic}}" mode="widthFix"/>
     </view>
     <!-- 抽奖视图 -->
     <view class="luck-draw-box">
@@ -49,7 +49,7 @@
 
         <!-- 背景 -->
         <view class="luck-draw-bg">
-            <image src="https://dy.shpr.top/welfareGo/gift-box.png" />
+            <image src="{{boxBgPic}}" />
         </view>
 
     </view>
@@ -96,7 +96,7 @@
                 <jumpmallapp wx:if="{{hitResult.goodsType == 1}}" class="_btn _exchange">去使用</jumpmallapp>
                 <view wx:if="{{hitResult.goodsType == 3}}" catchtap="toLookHitPhoto" class="_btn _exchange">去使用</view>
             </view>
-            <image class="_bg" src="/images/luck-draw/hitdlgbg.png" />
+            <image class="_bg" src="{{popBgPic}}" />
         </view>
         <view class="_layer" catchtap="closeDlg" />
     </view>

+ 0 - 4
pages/luckDraw/detail.wxss

@@ -1,7 +1,4 @@
 /* pages/luckDraw/detail.wxss */
-page {
-    background: #BF2637;
-}
 .head-bg {
     width: 750rpx;
     height: 576rpx;
@@ -263,7 +260,6 @@ page {
     width: 600rpx;
     margin: auto;
     min-height: 300rpx;
-    max-height: 1000rpx;
 }
 .hit-record-list ._item {
     display: flex;

+ 3 - 2
pages/luckDraw/index.js

@@ -33,6 +33,7 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
+        this.data.activityList = [];
         this.getActivityList();
         this.startCountdownTimer()
     },
@@ -132,8 +133,8 @@ Page({
 
     toDetail(e) {
         const url = "detail?id=" + e.currentTarget.dataset.id
-        wx.redirectTo({
-            url
+        wx.navigateTo({
+          url,
         })
     },