Bladeren bron

Merge remote-tracking branch 'origin/jeffrey/feat/coupon-center' into jeffrey/feat/coupon-center

kk.shi 3 jaren geleden
bovenliggende
commit
67bb481ed3

+ 0 - 1
components/customPreviewImage/customPreviewImage.js

@@ -26,7 +26,6 @@ Component({
      */
     methods: {
         handleClose() {
-            console.log(this.endTime, this.startTime, this.endTime - this.startTime)
             if (this.endTime - this.startTime < 350) {
                 this.triggerEvent("closeCallback")
             }

+ 23 - 8
components/topbar.js

@@ -1,3 +1,5 @@
+const { isEmpty } = require("../utils/util")
+
 // components/topbar.js
 Component({
     externalClasses: ['topbar-class', 'topbar-title-class', 'back-color-class'],
@@ -8,6 +10,14 @@ Component({
         title: {
             type: String,
             value: ''
+        },
+        backColor: {
+            type: String,
+            value: ''
+        },
+        titleColor: {
+            type: String,
+            value: ''
         }
     },
     /**
@@ -18,19 +28,25 @@ Component({
     },
 
     attached: function() {
-        var url =getCurrentPages()[getCurrentPages().length-1].route
-
         let dwObj = wx.getMenuButtonBoundingClientRect()
         let navHeight_ = (dwObj.top + dwObj.height)
         let capsuleTop_ = dwObj.top
         let windowHeight = wx.getSystemInfoSync().windowHeight
-
-        this.setData({
+        const data = {
             navHeight: navHeight_,
             capsuleTop:capsuleTop_, 
             capHeight: dwObj.height,
             bodyHeight: windowHeight - navHeight_,
-        });
+        }
+        
+        if (!isEmpty(this.data.backColor)) {
+            data.backStyle = "color:" + this.data.backColor + ";";
+        }
+        if (!isEmpty(this.data.titleColor)) {
+            data.titleStyle = "color:" + this.data.titleColor + ";"
+        }
+        
+        this.setData(data);
     },
 
     /**
@@ -45,9 +61,8 @@ Component({
                 })
                 return
             }
-            const url =getCurrentPages()[getCurrentPages().length-2].route
-            wx.switchTab({
-              url: "/" + url,
+            wx.navigateBack({
+                delta: -1
             })
         }
     }

+ 2 - 2
components/topbar.wxml

@@ -1,9 +1,9 @@
 <!--components/topbar.wxml-->
 <view class="topbar topbar-class" style="top:{{capsuleTop + 3}}px; left: 28rpx;">
    <view class="back" catchtap="handleBack">
-      <text class="back-iconfont back-color-class" />
+      <text class="back-iconfont back-color-class" style="{{backStyle}}" />
    </view>
 
-   <view class="title topbar-title-class">{{title}}</view>
+   <view class="title topbar-title-class" style="{{titleStyle}}">{{title}}</view>
 
 </view>

+ 2 - 2
components/topbar.wxss

@@ -8,8 +8,8 @@
 }
 
 .topbar .back {
-    width: 36rpx;
-    height: 36rpx;
+    width: 40rpx;
+    height: 40rpx;
     position: absolute;
     left: 0;
     top: 0;

BIN
images/signIn/cash_coupon.png


BIN
images/signIn/coupon1.png


BIN
images/signIn/finishsign.png


BIN
images/signIn/losesign.png


+ 17 - 23
pages/signIn/activity/activity.js

@@ -21,16 +21,22 @@ Page({
         lastSignInNode: { pos: 7, text: '星期天' },
         todayIsSigned: false,
         isLogin: getMobileCache() != "",
-        notUseNum: 0
+        notUseNum: 0,
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+        
+    },
+
+        /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
         this.data.dayOfWeek = this.getDayOfWeek()
         this.startLoadActivityData()
-        this.setPageStyle()
     },
 
     startLoadActivityData() {
@@ -63,20 +69,6 @@ Page({
         
     },
 
-    setPageStyle() {
-        let dwObj = wx.getMenuButtonBoundingClientRect()
-        let navHeight_ = (dwObj.top + dwObj.height)
-        let capsuleTop_ = dwObj.top
-        let windowHeight = wx.getSystemInfoSync().windowHeight
-
-        this.setData({
-            navHeight: navHeight_,
-            capsuleTop:capsuleTop_, 
-            capHeight: dwObj.height,
-            bodyHeight: windowHeight - navHeight_,
-        });
-    },
-
     mapToView(data) {
         this.setColors(data.color)
         if (data.dayAwardList && data.dayAwardList.length > 0) {
@@ -142,11 +134,20 @@ Page({
         this.setData({
             mainColor: color,
             secColor: newColor,
+            thirdColor: "rgb(" + this.toRGB(color) + ", 0.3)",
             backGroundStyle:  "background: linear-gradient(" +color+", "+ newColor+ ", "+color+");",
             grayBackGroudStyle: "background: #c6c6c6"
         })
     },
 
+    toRGB(hex) {
+        const list = [hex.substr(1,2), hex.substr(3,2), hex.substr(5,2)]
+        list[0] = parseInt(list[0] , 16)
+        list[1] = parseInt(list[1] , 16)
+        list[2] = parseInt(list[2] , 16)
+        return list.join(',')
+    },
+
     popMessage(message) {
         app.showToast(message, "none")
     },
@@ -242,13 +243,6 @@ Page({
     },
 
     /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
      * 生命周期函数--监听页面隐藏
      */
     onHide: function () {

+ 36 - 33
pages/signIn/activity/activity.wxml

@@ -2,29 +2,28 @@
 <view wx:if="{{showPage}}">
 
 <custom-page head-bg-image="{{activity.themePic}}" bind:sizes="handlePageSizes">
-    <topbar slot="head" title="签到中心" topbar-title-class="title-color" back-color-class="title-color" />
+    <topbar slot="head" title="签到中心" back-color="{{mainColor}}" title-color="{{mainColor}}" />
     <!-- 页面主体 -->
     <view slot="body" class="sign-scroll-body">
-        <view class="sign-info-extra">
+        <view class="sign-info-extra" style="color: {{mainColor}};">
             <view class="coupon_num_box">
-            <view class="my_coupon_title">签到优惠券</view>
-            <view class="_num_arear">
-                <text class="_num">{{notUseNum}}</text>
-                <text class="_unit">张</text>
-                <view class="_btn" wx:if="{{notUseNum > 0}}">
-                <jumpmallapp>去使用</jumpmallapp>
+                <view class="my_coupon_title">签到优惠券</view>
+                <view class="_num_arear">
+                    <text class="_num">{{notUseNum}}</text>
+                    <text class="_unit">张</text>
+                    <view class="_btn" style="border-color: {{mainColor}};" wx:if="{{notUseNum > 0}}">
+                    <jumpmallapp>去使用</jumpmallapp>
+                    </view>
                 </view>
-            </view>
-            </view>
-            <view class="_look_btn" catchtap="toRecordDetailPage">明细 | 查看</view>
+                <view class="_look_btn" catchtap="toRecordDetailPage">明细 | 查看</view>
+            </view> 
         </view>
         <!-- 签到卡片 -->
-        <view class="sign-card-box">
+        <view class="sign-card-box" style="border-color: {{thirdColor}};">
             <view class="sign-item-box">
                 <view class="_left">
                     <view class="_item" wx:for="{{signInNodes}}" wx:key="index" >
                         <image class="_figure" src="{{item.figure}}" mode="aspectFill" />
-                        <view class="_no" style="{{item.textBgGround}}">{{item.text}}</view>
                         <image wx:if="{{item.isSignIn == -1}}" class="_lose_sign_in" src="/images/signIn/losesign.png" />
                         <image wx:if="{{item.isSignIn == 1}}" class="_finish_sign_in" src="/images/signIn/finishsign.png" />
                     </view>
@@ -32,15 +31,14 @@
                 <view class="_right">
                     <view class="_item">
                         <image class="_figure" src="{{lastSignInNode.figure}}" mode="aspectFill" />
-                        <view class="_no" style="{{lastSignInNode.textBgGround}}">{{lastSignInNode.text}}</view>
                         <image wx:if="{{lastSignInNode.isSignIn == -1}}" class="_lose_sign_in" src="/images/signIn/losesign.png" />
-                        <image wx:if="{{lastSignInNode.isSignIn == 1}}" class="_finish_sign_in" src="/images/signIn/finishsign.png" />
+                        <image wx:if="{{lastSignInNode.isSignIn != 1}}" class="_finish_sign_in" src="/images/signIn/finishsign.png" />
                     </view>
                 </view>
             </view>
             
             <block wx:if="{{todayIsSigned}}">
-                <view class="_sign_in_btn">今日已签到</view>
+                <view class="_sign_in_btn" style="background-color:{{thirdColor}};">今日已签到</view>
             </block>
             <block wx:else>
                 <view class="_sign_in_btn" style="{{backGroundStyle}}" catchtap="tapSignIn">
@@ -82,7 +80,7 @@
         <view class="activity-des">
             <view class="_title">活动说明</view>
             <view class="_des">
-                <text>{{activity.activityDesc}}</text>
+                <text user-select>{{activity.activityDesc}}</text>
             </view>
         </view>
     </view>
@@ -93,23 +91,28 @@
     <view class="sign-pop-body">
         <view class="_body">
            <view class="gift_wrap">
-                <view class="coupon_node">
-                    <view wx:if="{{hitResult.couponType=='D'}}" class="_node_left _zk {{hitResult._classSmallStyle}}">
-                        <view class="_num">{{hitResult.formatDiscount}}</view>
-                        <view class="_zhe">折</view>
+                <jumpmallapp>
+                    <view class="coupon_node">
+                        <view class="_node_left">
+                            <view class="_coupont_title">{{hitResult.couponTitle}}</view>
+                            <view class="_coupon_sub_title">{{hitResult.formatLeastCostStr}}</view>
+                            <view class="_coupon_times"></view>
+                        </view>
+                        <view class="flex-column">
+                            <view wx:if="{{hitResult.couponType=='D'}}" class="_node_right _zk {{hitResult._classSmallStyle}}">
+                                <view class="_num">{{hitResult.formatDiscount}}</view>
+                                <view class="_zhe">折</view>
+                            </view>
+                            <view wx:if="{{hitResult.couponType=='C'}}" class="_node_right _cash {{hitResult._classSmallStyle}}">
+                                <view class="_unit">¥</view>
+                                <view class="_num">{{hitResult.formatReduceCost}}</view>
+                            </view>
+                            <view class="_coupon_use_text">立即使用</view>
+                        </view>
+                        <image wx:if="{{hitResult.couponType=='D'}}" class="_bg" src="https://dy.shpr.top/welfareGo/discount.png" />
+                        <image wx:if="{{hitResult.couponType=='C'}}" class="_bg" src="https://dy.shpr.top/welfareGo/cash.png" />
                     </view>
-                    <view wx:if="{{hitResult.couponType=='C'}}" class="_node_left _cash {{hitResult._classSmallStyle}}">
-                        <view class="_unit">¥</view>
-                        <view class="_num">{{hitResult.formatReduceCost}}</view>
-                    </view>
-                    <view class="_node_right">
-                        <view class="_coupont_title">{{hitResult.couponTitle}}</view>
-                        <view class="_coupon_sub_title">{{hitResult.formatLeastCostStr}}</view>
-                        <view class="_coupon_times"></view>
-                    </view>
-                    <image wx:if="{{hitResult.couponType=='D'}}" class="_bg" src="/images/signIn/coupon1.png" />
-                    <image wx:if="{{hitResult.couponType=='C'}}" class="_bg" src="/images/signIn/cash_coupon.png" />
-                </view>
+                </jumpmallapp>
            </view>
            <view class="award_des" style="color:{{secColor}};">恭喜您签到成功 获得9折扣折扣券</view>
 

+ 89 - 80
pages/signIn/activity/activity.wxss

@@ -44,30 +44,26 @@ page {
     box-sizing: border-box;
     padding: 20rpx 0 20rpx 80rpx;
 }
-
-.coupon_num_box {
-    color: #EA443A;
-}
 .my_coupon_title {
     font-size: 24rpx;
     font-weight: 400;
 }
 .coupon_num_box ._num_arear {
-    padding: 18rpx 0  0 20rpx;
+    padding: 10rpx 0  0 0rpx;
     box-sizing: border-box;
-    height: 162rpx;
+    height: 150rpx;
     width: 480rpx;
     white-space: nowrap;
 }
 ._num_arear ._num {
-    font-size: 128rpx;
+    font-size: 104rpx;
     vertical-align: baseline;
-    height: 144rpx;
+    height: 140rpx;
     display: inline-block;
 }
 ._num_arear ._unit {
     padding-left: 10rpx;
-    font-size: 52rpx;
+    font-size: 48rpx;
     font-weight: 400;
     vertical-align: baseline;
     display: inline-block;
@@ -87,9 +83,7 @@ page {
 .sign-info-extra ._look_btn {
     width: 180rpx;
     box-sizing: border-box;
-    padding: 140rpx 60rpx 0 0;
     font-size: 24rpx;
-    color: #fff;
     font-weight: 400;
 }
 
@@ -102,6 +96,8 @@ page {
     border-radius: 8px;
     box-sizing: border-box;
     padding: 56rpx 40rpx 40rpx 40rpx;
+    border-width: 2rpx;
+    border-style: solid;
 }
 
 .sign-item-box {
@@ -139,20 +135,21 @@ page {
 }
 .sign-item-box ._left ._item ._lose_sign_in {
     width: 110rpx;
-    height: 82rpx;
+    height: 66rpx;
     position: absolute;
     left: 2rpx;
     display: block;
-    top: 36rpx;
+    top: 48rpx;
     z-index: 3;
 }
 .sign-item-box ._left ._item ._finish_sign_in {
-    width: 36rpx;
-    height: 22rpx;
+    width: 110rpx;
+    height: 66rpx;
     position: absolute;
+    left: 2rpx;
+    display: block;
+    top: 48rpx;
     z-index: 3;
-    left: 38rpx;
-    top: 66rpx;
 }
 
 .sign-item-box ._left ._item ._no {
@@ -192,22 +189,23 @@ page {
 }
 
 .sign-item-box ._right ._item ._lose_sign_in {
-    width: 186rpx;
-    height: 140rpx;
+    width: 190rpx;
+    height: 110rpx;
     display: block;
     position: absolute;
     left: 8rpx;
-    top: 122rpx;
+    top: 136rpx;
     z-index: 3;
 }
 
 .sign-item-box ._right ._item ._finish_sign_in {
-    width: 82rpx;
-    height: 50rpx;
+    width: 190rpx;
+    height: 110rpx;
+    display: block;
     position: absolute;
+    left: 8rpx;
+    top: 136rpx;
     z-index: 3;
-    left: 60rpx;
-    top: 145rpx;
 }
 
 .sign-item-box ._right ._item ._no {
@@ -317,7 +315,7 @@ page {
     margin: auto;
     margin-top: 40rpx;
     font-size: 28rpx;
-    color: #979797;
+    color: #101010;
     padding-bottom: 100rpx;
 }
 
@@ -357,26 +355,27 @@ page {
     height: 484rpx;
     position: absolute;
     left: 26rpx;
-    top: 412rpx;
+    top: 372rpx;
     z-index: 2;
 }
 .gift_wrap {
     width: 100%;
     height: 232rpx;
     box-sizing: border-box;
+    padding-top: 28rpx;
 }
 
 .coupon_node {
-    width: 522rpx;
-    height: 176rpx;
+    width: 508rpx;
+    height: 148rpx;
     margin: auto;
     display: flex;
     flex-direction: row;
     position: relative;
 }
 .coupon_node ._bg {
-    width: 522rpx;
-    height: 176rpx;
+    width: 508rpx;
+    height: 148rpx;
     position: absolute;
     left: 0;
     top: 0;
@@ -384,7 +383,41 @@ page {
 }
 
 .coupon_node ._node_left {
-    width: 160rpx;
+    position: relative;
+    z-index: 1;
+    white-space: nowrap;
+    box-sizing: border-box;
+    padding: 20rpx 20rpx 20rpx 40rpx;
+    flex: 1;
+    width: 404rpx;
+    overflow: hidden;
+}
+._node_left ._coupont_title {
+    font-size: 32rpx;
+    font-weight: 600;
+}
+._node_left ._coupon_sub_title {
+    font-size: 28rpx;
+    padding: 14rpx 0;
+}
+._node_left ._coupon_sub_title:before, ._node_left ._coupon_sub_title:after {
+    width: 5px;
+    height: 5px;
+    background: #444;
+    transform:rotate(45deg);
+    margin: 0 10rpx;
+    display: inline-block;
+    content: "";
+    vertical-align: middle;
+}
+
+._node_left ._coupon_times {
+    font-size: 24rpx;
+}
+
+.coupon_node ._node_right {
+    width: 144rpx;
+    height: 100rpx;
     display: flex;
     flex-direction: row;
     flex-wrap: nowrap;
@@ -392,76 +425,52 @@ page {
     position: relative;
     justify-content: center;
     align-items: baseline;
-    color: #443E5B;
+    color: #fff;
+    box-sizing: border-box;
+    padding-top: 10rpx;
 }
 
-._node_left._zk ._num {
-    padding-top: 48rpx;
-    height: 176rpx;
-    font-size: 100rpx;
+._node_right._zk ._num {
+    font-size: 76rpx;
     font-weight: 600;
     box-sizing:border-box;
 }
 
-._node_left._zk._small ._num {
-    font-size: 56rpx;
-    padding-top: 72rpx;
+._node_right._zk._small ._num {
+    font-size: 50rpx;
+    padding-top: 18rpx;
 }
 
-._node_left._zk ._zhe {
-    font-size: 32rpx;
+._node_right._zk ._zhe {
+    font-size: 28rpx;
 }
 
 
-._node_left._cash ._num {
-    padding-top: 48rpx;
-    height: 176rpx;
-    font-size: 100rpx;
+._node_right._cash ._num {
+    font-size: 76rpx;
     font-weight: 600;
     box-sizing:border-box;
 }
 
-._node_left._cash._small ._num {
-    font-size: 56rpx;
-    padding-top: 72rpx;
-}
-
-._node_left._cash ._unit {
-    font-size: 32rpx;
-    position: relative;
-    top: -2rpx;
-    padding-right: 2rpx;
-}
-
-.coupon_node ._node_right {
+._coupon_use_text {
+    color: #fff;
     position: relative;
     z-index: 1;
+    width: 100%;
     text-align: center;
-    white-space: nowrap;
-    box-sizing: border-box;
-    padding: 20rpx;
-}
-._node_right ._coupont_title {
-    font-size: 32rpx;
-    font-weight: 600;
-}
-._node_right ._coupon_sub_title {
-    font-size: 28rpx;
-    padding: 14rpx 0;
+    font-size: 24rpx;
 }
-._node_right ._coupon_sub_title:before, ._node_right ._coupon_sub_title:after {
-    width: 5px;
-    height: 5px;
-    background: #443E5B;
-    transform:rotate(45deg);
-    margin: 0 10rpx;
-    display: inline-block;
-    content: "";
-    vertical-align: middle;
+
+._node_right._cash._small ._num {
+    font-size: 50rpx;
+    padding-top: 18rpx;
 }
 
-._node_right ._coupon_times {
-    font-size: 24rpx;
+._node_right._cash ._unit {
+    font-size: 28rpx;
+    position: relative;
+    top: -2rpx;
+    padding-right: 2rpx;
 }
 
 .sign-pop-body .award_des {