kk.shi пре 3 година
родитељ
комит
4bbcb04606
4 измењених фајлова са 117 додато и 316 уклоњено
  1. 8 6
      pages/luckDraw/profile.js
  2. 1 3
      pages/luckDraw/profile.json
  3. 46 83
      pages/luckDraw/profile.wxml
  4. 62 224
      pages/luckDraw/profile.wxss

+ 8 - 6
pages/luckDraw/profile.js

@@ -126,14 +126,16 @@ Page({
         data.goodsItemList.forEach(v => {
             let beginTime = v.couponBeginTimestamp
             let endTime = v.couponEndTimestamp
+            let createTime = v.createTime
             v.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
             v.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
-            if(v.couponType == 'D' && v.discount >0){
-                v.discount /= 10
-            }
-            if(v.couponType == 'C' && v.discount >0){
-                v.reduceCost /= 100
-            }
+            v.createTime = parseTime(createTime, "{y}.{m}.{d} {h}:{i}")
+            // if(v.couponType == 'D' && v.discount >0){
+            //     v.discount /= 10
+            // }
+            // if(v.couponType == 'C' && v.discount >0){
+            //     v.reduceCost /= 100
+            // }
         })
 
         if (this.data.page == 1) {

+ 1 - 3
pages/luckDraw/profile.json

@@ -2,9 +2,7 @@
   "navigationBarTitleText": "",
   "usingComponents": {
     "tab-bar": "./components/tabbar",
-    "topbar": "../../components/topbar",
     "custom-preview-image": "../../components/customPreviewImage/customPreviewImage",
     "custom-page": "../../components/customPage/customPage"
-  },
-  "navigationStyle":"custom"
+  }
 }

+ 46 - 83
pages/luckDraw/profile.wxml

@@ -1,96 +1,59 @@
 <!--pages/luckDraw/profile.wxml-->
-<!-- 首部信息 -->
-<custom-page head-bg-image="https://dy.shpr.top/luckDraw/per_head.png" bind:reachbottom="scrollToBottom">
-  <topbar slot="head" title="抽奖记录" topbar-title-class="profile-topbar"/>
-  <view slot="body">
-    <view class="head flex-column">
-      <image wx:if="{{!isLogin}}" class="head_portrait" src="/images/welfareMall/head-portrait.png" />
-      <!-- 获取用户头像 -->
-      <open-data wx:if="{{isLogin}}" class="head_portrait" type="userAvatarUrl"></open-data>
-      <view class="head_text" wx:if="{{isLogin}}">{{phone.toHide(mobileTop)}}</view>
-      <button class="sigin-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">登录</button>
-    </view>
-    <!-- 中部说明 -->
-    <view class="explain flex-row">
-      <view class="explain-left flex-column" catchtap="{{isLogin?'getProfile':''}}">
-        <view class="explain-text">{{couponNum}}</view>
-        <view class="explain-discount">优惠券</view>
-        <view class="{{noCoupon?'explain-column':'explain-columnNo'}}"></view>
+<!-- 头部说明 -->
+<view class="explain flex-row">
+  <view class="explain-left flex-column" catchtap="{{isLogin?'getProfile':''}}">
+    <view class="explain-discount">优惠券({{couponNum}})</view>
+    <view class="{{noCoupon?'explain-column':'explain-columnNo'}}"></view>
+  </view>
+  <view class="explain-right flex-column" catchtap="{{isLogin?'getPrize':''}}">
+    <view class="explain-utility">奖品({{thirdPrizeNum}})</view>
+    <view class="{{noPrize?'explain-column':'explain-columnNo'}}"></view>
+  </view>
+</view>
+<!-- 主要内容 -->
+<view class="check-in-content flex-column">
+  <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">请登录</button>
+  <!-- 优惠券内容 -->
+  <view hidden="{{hidden1}}">
+    <view wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}" class="coupon flex-row">
+      <view class="coupon-content">
+        <view class="coupon-title over-ellipsis">{{item.goodsName?item.goodsName:'未设置名称'}}</view>
+        <view class="coupon-data flex-row">
+          <view class="coupon-data-time">{{item.createTime}}</view>
+          <navigator class="coupon-refund flex-row" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" extra-data="{foo: 'bar'}" open-type='navigate'>
+            <view class="lower-coupon-text">立即使用</view>
+          </navigator>
+        </view>
       </view>
-      <view class="explain-right flex-column" catchtap="{{isLogin?'getPrize':''}}">
-        <view class="explain-text">{{thirdPrizeNum}}</view>
-        <view class="explain-utility">奖品</view>
-        <view class="{{noPrize?'explain-column':'explain-columnNo'}}"></view>
+      <view class="coupon-img flex-column">
+        <image class="coupon-img-url" src="{{item.fullGoodsSmallImage}}"></image>
       </view>
     </view>
-    <!-- 主要内容 -->
-    <view class="check-in-content flex-column">
-      <!-- 优惠券内容 -->
-      <view hidden="{{hidden1}}">
-        <view wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}" class="{{item.couponType == 'C'?'coupon flex-row':'coupon2 flex-row'}}">
-          <view class="coupon-left flex-row">
-            <!-- 代金券 -->
-            <view class="coupon-left-symbol" wx:if="{{item.couponType == 'C'}}">¥</view>
-            <view class="{{item.formatReduceCost.length > 3 ?'coupon-left-numSmall':'coupon-left-num'}}" wx:if="{{item.couponType == 'C'}}">{{item.formatReduceCost ?item.formatReduceCost:0}}</view>
-            <!-- 折扣券 -->
-            <view class="{{item.formatDiscount.length > 3 ?'coupon-left-numSmall':'coupon-left-num'}}" wx:if="{{item.couponType == 'D'}}">{{item.formatDiscount ?item.formatDiscount:0}}</view>
-            <view class="coupon-left-symbol" wx:if="{{item.couponType == 'D'}}" style="font-size: 16px;">折</view>
-          </view>
-          <view class="coupon-center flex-column">
-            <view class="coupon-center-upper over-ellipsis">{{item.couponTitle}}</view>
-            <view class="coupon-center-bm flex-row">
-              <view class="coupon-center-block1"></view>
-              <view class="coupon-center-middle" wx:if="{{item.formatLeastCost == '0'}}">无门槛</view>
-              <view class="coupon-center-middle" wx:if="{{item.formatLeastCost != '0'}}">满{{item.formatLeastCost}}使用</view>
-              <view class="coupon-center-block2"></view>
-            </view>
-            <view class="coupon-center-lower">{{item.couponBeginTimestamp}}-{{item.couponEndTimestamp}}</view>
-          </view>
-          <view class="coupon-right">
-            <view class="{{item.couponType == 'C'?'coupon-right-usenow flex-row':'coupon-right-usenow2 flex-row'}}">
-              <navigator class="btn_exchange" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" open-type='navigate'>
-              </navigator>
-            </view>
-          </view>
-        </view>
-        <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无可用优惠券 ————</view>
-        <view class="no_result" wx:if="{{noMore}}">———— 更多优惠券 | 敬请期待 ————</view>
-      </view>
+    <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无可用优惠券 ————</view>
+    <view class="no_result" wx:if="{{noMore}}">———— 更多优惠券 | 敬请期待 ————</view>
+  </view>
 
-      <!-- 奖品 -->
-      <view hidden="{{hidden2}}">
-        <view class="prize-content flex-row" wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}">
-          <view class="prize-img flex-column">
-            <image class="prize-img-small" src="{{item.fullGoodsSmallImage}}" />
-          </view>
-          <view class="prize-text">
-            <view class="prize-text-top over-ellipsis">{{item.goodsName}}</view>
-            <view class="prize-text-buttom over-ellipsis-two">{{item.hitDesc}}</view>
-          </view>
-          <view class="prize-jump flex-row">
-            <view class="btn_exchange" data-src="{{item.fullGoodsBigImage}}" catchtap="toLookHitPhoto">
-            </view>
+  <!-- 奖品 -->
+  <view hidden="{{hidden2}}">
+    <view class="prize-content flex-row" wx:for="{{goodsItemList}}" wx:key="index" data-id="{{item.id}}">
+      <view class="coupon-content">
+        <view class="coupon-title over-ellipsis">{{item.goodsName?item.goodsName:'未设置名称'}}</view>
+        <view class="coupon-data flex-row">
+          <view class="coupon-data-time">{{item.createTime}}</view>
+          <view class="coupon-refund flex-row" data-src="{{item.fullGoodsBigImage}}" catchtap="toLookHitPhoto">
+            <view class="lower-coupon-text">立即使用</view>
           </view>
         </view>
-        <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无可领取奖品 ————</view>
-        <view class="no_result" wx:if="{{noMore}}">———— 更多奖品 | 敬请期待 ————</view>
+      </view>
+      <view class="coupon-img flex-column">
+        <image class="coupon-img-url" src="{{item.fullGoodsSmallImage}}" ></image>
       </view>
     </view>
-
+    <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无可领取奖品 ————</view>
+    <view class="no_result" wx:if="{{noMore}}">———— 更多奖品 | 敬请期待 ————</view>
   </view>
-</custom-page>
-
-
-
-<!-- 使用wxs 手机号码中间四位显示为*号 -->
-<wxs module="phone">
-  var toHide = function (array) {
-    var mphone = array.substring(0, 3) + '****' + array.substring(7);
-    return mphone;
-  }
-  module.exports.toHide = toHide;
-</wxs>
+</view>
 <!-- 底部导航 -->
 <!-- <tab-bar /> -->
 
-<custom-preview-image wx:if="{{showCustomPreview}}"  src="{{previewImgSrc}}" bind:closeCallback="closePreviewImage"/>
+<custom-preview-image wx:if="{{showCustomPreview}}" src="{{previewImgSrc}}" bind:closeCallback="closePreviewImage" />

+ 62 - 224
pages/luckDraw/profile.wxss

@@ -1,5 +1,12 @@
 /* pages/luckDraw/profile.wxss */
-
+page{
+  background: #F7F7F7;
+  display:flex;
+  flex-flow: column nowrap;
+  justify-content: left;
+  align-items: center;
+  box-sizing: border-box;
+}
 /* 垂直方向布局,水平居中 **/
 .flex-column{
   display: flex;
@@ -16,41 +23,14 @@
   justify-content: center;
 }
 
-.head{
-  width: 750rpx;
-  height: 320rpx;
-}
-
-.head_portrait{
-  width: 140rpx;
-  height: 144rpx;
-  border-radius: 50%;
-  overflow :  hidden ;
-  margin-top: 10rpx;
-}
-
-.body-content {
-  position: relative;
-}
-
-.head_text{
-  font-size: 40rpx;
-  font-family: Source Han Sans CN;
-  font-weight: 400;
-  color: #FEFEFE;
-  margin-top: 30rpx;
-}
-
-.sigin-isLogin{
-  color: #FEFEFE;
-  font-weight: 400;
-  background-color: transparent;
-  border-style: none;
+.check-in-content{
+  margin: 22rpx;
 }
 
 .explain{
   width: 750rpx;
-  height: 160rpx;
+  height: 98rpx;
+  background: #FFFFFF;
   justify-content: space-between !important;
 }
 
@@ -66,160 +46,84 @@
 }
 
 .explain-discount,.explain-utility{
-  font-size: 32rpx;
-  font-weight: 400;
-  color: #303030;
+  font-size: 28rpx;
+  font-weight: 500;
+  color: #000000;
 }
 
 
 .explain-column{
-  width: 39px;
-  height: 3px;
-  background: #BF2637;
-  border-radius: 2px;
-  margin-top: 8px;
+  width: 90rpx;
+  height: 4rpx;
+  background: #EA443A;
+  border-radius: 2rpx;
+  margin-top: 8rpx;
 }
 
 .explain-columnNo{
-  width: 39px;
-  height: 3px;
-  border-radius: 2px;
-  margin-top: 8px;
+  width: 90rpx;
+  height: 4rpx;
+  border-radius: 2rpx;
+  margin-top: 8rpx;
 }
 
-.coupon{
-  width: 708rpx;
-  height: 220rpx;
-  background-image: url(https://dy.shpr.top/luckDraw/cash_coupon.png);
+.coupon,.prize-content{
+  width: 707rpx;
+  height: 203rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/luck-draw.png);
   background-size: 100% 100%;
-  margin-bottom: 30rpx;
-  justify-content: left !important;
-}
-
-.coupon2{
-  width: 708rpx;
-  height: 220rpx;
-  background-image: url(https://dy.shpr.top/luckDraw/coupon.png);
-  background-size: 100% 100%;
-  margin-bottom: 30rpx;
-  justify-content: left !important;
-}
-
-.coupon-left{
-  width: 220rpx;
-  height: 100%;
-  text-align: center;
-  align-items: flex-end;
-}
-
-.coupon-center{
-  width: 350rpx;
-  height: 100%;
-  align-items: flex-start !important;
   justify-content: space-between;
+  margin-bottom: 19rpx;
 }
 
-.coupon-right{
-  width: 180rpx;
-  height: 100%;
-}
-
-.coupon-left-symbol{
-  font-size: 20px;
-  font-family: Microsoft YaHei;
-  font-weight: 400;
-  color: #443E5B;
-  line-height: 40px;
-}
-
-.coupon-left-num{
-  font-size: 59px;
-  font-family: Impact;
-  font-weight: 400;
-  color: #443E5B;
-  line-height: 71px;
-}
-
-.coupon-left-numSmall{
-  font-size: 36px;
-  font-family: Impact;
-  font-weight: 400;
-  color: #443E5B;
-  line-height: 71px;
+.coupon-title,.coupon-data{
+  padding-left: 49rpx;
 }
 
-.coupon-left-symbol{
-  margin-bottom: 10rpx;
-} 
-
-.coupon-center-upper,.coupon-center-bm,.coupon-center-lower{
-  margin-left: 18px;
-}
-.coupon-center-upper{
-  width: 140px;
-  height: 20px;
-  font-size: 20px;
-  font-weight: 500;
-  color: #443E5B;
-  line-height: 19px;
-  margin-top: 24px;
-  overflow: hidden;
-	white-space: nowrap;
-	text-overflow: ellipsis;
+.coupon-data{
+  width: 400rpx;
+  justify-content: space-between;
+  margin-top: 45rpx;
 }
 
-.coupon-center-middle{
-  height: 15px;
-  font-size: 13px;
-  font-weight: 400;
-  color: #443E5B;
-  line-height: 16px;
+.coupon-title{
+  width: 400rpx;
+  height: 40rpx;
+  font-size: 34rpx;
+  font-weight: bold;
+  color: #000000;
+  line-height: 30rpx;
 }
 
-.coupon-center-lower{
-  width: 146px;
-  height: 15px;
-  font-size: 13px;
+.coupon-data-time{
+  font-size: 26rpx;
   font-weight: 400;
-  color: #443E5B;
-  line-height: 16px;
-  margin-bottom: 11px;
+  color: #000000;
+  line-height: 30rpx;
 }
 
-.coupon-right-usenow{
-  width: 162rpx;
-  height: 56rpx;
-  background-image: url(https://dy.shpr.top/luckDraw/cash_use_now.png);
-  background-size: 100% 100%;
-  margin-top: 94rpx;
-  margin-left: -10rpx;
-}
-
-.coupon-right-usenow2{
-  width: 162rpx;
-  height: 56rpx;
-  background-image: url(https://dy.shpr.top/luckDraw/coupon_use_now.png);
-  background-size: 100% 100%;
-  margin-top: 94rpx;
-  margin-left: -10rpx;
+.coupon-img{
+  width: 202rpx;
+  height: 203rpx;
+  justify-content: center;
 }
 
-.coupon-center-bm{
-  height: 15px;
-  justify-content: flex-start;
+.coupon-img-url{
+  width: 178rpx;
+  height: 166rpx;
 }
 
-.coupon-center-block1,.coupon-center-block2{
-  width: 5px;
-  height: 5px;
-  background: #443E5B;
-  transform:rotate(45deg);
-  margin: 0 10rpx;
+.coupon-refund{
+  width: 139rpx;
+  height: 40rpx;
+  border: 1px solid #B01717;
+  border-radius: 50rpx;
 }
 
-.btn_exchange{
-  width: 100%;
-  height: 100%;
+.lower-coupon-text{
+  font-size: 22rpx;
+  font-weight: 500;
+  color: #B01717;
 }
 
 .no_result {
@@ -229,69 +133,3 @@
   font-weight: 1000;
   text-align: center;
 }
-
-.prize-content{
-  width: 708rpx;
-  height: 220rpx;
-  background: #FFFFFF;
-  border: 1px solid #FF7A03;
-  box-shadow: 0px 0px 50px 8px rgba(127, 127, 127, 0.09);
-  border-radius: 20rpx;
-  margin-bottom: 30rpx;
-  justify-content: space-between;
-}
-
-.prize-img{
-  width: 214rpx;
-  height: 220rpx;
-  background: #FFE9B0;
-  border: 0 solid #FF7A03;
-  border-radius: 20rpx 0 0 20rpx;
-}
-
-.prize-img-small{
-  width: 268rpx;
-  height: 212rpx;
-}
-
-.prize-text{
-  width: 300rpx;
-}
-
-.prize-text-top,.prize-text-buttom{
-  padding-left: 42rpx;
-}
-
-.prize-text-top{
-  width: 280rpx;
-  height: 38rpx;
-  font-size: 36rpx;
-  font-weight: 600;
-  color: #443E5B;
-  line-height: 36rpx;
-}
-
-.prize-text-buttom{
-  font-size: 28rpx;
-  font-family: Microsoft YaHei;
-  font-weight: 400;
-  color: #443E5B;
-  line-height: 32rpx;
-  margin-top: 26rpx;
-}
-
-.prize-jump{
-  width: 162rpx;
-  height: 56rpx;
-  background-image: url(https://dy.shpr.top/luckDraw/coupon_use_now.png);
-  background-size: 100% 100%;
-  margin-right: 10rpx;
-  margin-top: 20rpx;
-}
-
-.profile-topbar{
-  font-size: 56rpx;
-  font-weight: 500;
-  color: #ffffff;
-}
-