3 Achegas 8a0bd94d9a ... 9538d17137

Autor SHA1 Mensaxe Data
  bobo 9538d17137 Merge branch 'pre' of http://git.ahamu.cn:9202/xing.li/share_activity into pre %!s(int64=3) %!d(string=hai) anos
  bobo debb490ba9 Merge branch 'bobo/feat/coupon-card' into pre %!s(int64=3) %!d(string=hai) anos
  bobo 44c6774871 优化样式 %!s(int64=3) %!d(string=hai) anos

+ 19 - 0
components/couponWrap/index.js

@@ -46,6 +46,25 @@ Component({
                     v.type = v.type || v.couponType
                 }
                 v.title = v.title || v.couponName || v.couponTitle
+                if (typeof v.couponState == "undefined") {
+                    if (v.payStatus == 4) {
+                        v.stateStr = "已取消"
+                    } else {
+                        v.stateStr = "未支付"
+                    }
+                } else if (v.couponState == 1) {
+                    v.stateStr = "已使用"
+                } else if (v.couponState == 2) {
+                    v.stateStr = "已过期"
+                } else if (v.couponState == 3) {
+                    v.stateStr = "已取消"
+                } else if (v.couponState == 4) {
+                    v.stateStr = "已停用"
+                } else if (v.couponState == 5) {
+                    v.stateStr = "转增中"
+                } else {
+                    v.stateStr = "不可用"
+                }
             })
             this.setData({
                 list: this.data.couponList

+ 1 - 4
components/couponWrap/index.wxml

@@ -25,11 +25,8 @@
                     <view wx:if="{{item.couponState == 0}}" class="coupon-card-btn">
                       <jumpmallapp>立即使用</jumpmallapp>
                     </view>
-                    <view wx:elif="{{item.couponState == 1}}" class="coupon-card-btn gray">
-                        已使用
-                    </view>
                     <view class="coupon-card-btn gray" wx:else>
-                        已作废
+                        {{item.stateStr}}
                     </view>
                 </block>
                 <view class="coupon-card-num" wx:else>

+ 5 - 10
pages/luckDraw/profile.js

@@ -124,18 +124,13 @@ Page({
             return
         }
         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}")
+            v.couponStartTime = v.couponBeginTimestamp
+            v.couponEndTime =  v.couponEndTimestamp
+            v.isSn = true
+            v.couponBeginTimestamp = parseTime(v.couponBeginTimestamp, "{y}.{m}.{d}")
+            v.couponEndTimestamp = parseTime(v.couponEndTimestamp, "{y}.{m}.{d}")
             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) {

+ 2 - 1
pages/luckDraw/profile.json

@@ -3,6 +3,7 @@
   "usingComponents": {
     "tab-bar": "./components/tabbar",
     "custom-preview-image": "../../components/customPreviewImage/customPreviewImage",
-    "custom-page": "../../components/customPage/customPage"
+    "custom-page": "../../components/customPage/customPage",
+    "coupon-wrap": "../../components/couponWrap/index"
   }
 }

+ 8 - 15
pages/luckDraw/profile.wxml

@@ -15,22 +15,15 @@
   <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}}">
-      <navigator class="coupon flex-row" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" extra-data="{foo: 'bar'}" open-type='navigate'>
-        <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" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" extra-data="{foo: 'bar'}" open-type='navigate'>
-              <view class="lower-coupon-text">立即使用</view>
-            </view>
-          </view>
-        </view>
-        <view class="coupon-img flex-column">
-          <image class="coupon-img-url" src="{{item.fullGoodsBigImage}}"></image>
-        </view>
-      </navigator>
+    <view class="coupon-wrap-list">
+        <coupon-wrap wx:if="{{goodsItemList.length>0}}" 
+        coupon-list="{{goodsItemList}}"
+        class="coupon_wrap"
+        coupon-item-ex-class="coupon-item-style"
+        coupon-circule-ex-class="coupon-circule-style"
+        />
     </view>
+    
     <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无可用优惠券 ————</view>
     <view class="no_result" wx:if="{{noMore}}">—— 人家也是有底线的 ——</view>
   </view>

+ 17 - 0
pages/luckDraw/profile.wxss

@@ -133,3 +133,20 @@ page{
   font-weight: 1000;
   text-align: center;
 }
+
+
+.coupon-wrap-list {
+  width: 100vw;
+  padding: 0 30rpx 20rpx 30rpx;
+  box-sizing: border-box;
+}
+
+.coupon_wrap {
+  width: 690rpx;
+}
+.coupon-item-style {
+  background: #fff !important;
+}
+.coupon-circule-style {
+  background: #FFF6F5 !important;
+}

+ 7 - 5
pages/signIn/record/record.js

@@ -101,14 +101,16 @@ Page({
             }
             return
         }
+
+        const couponListT = []
         data.forEach(v => {
-            let beginTime = v.coupon.couponBeginTimestamp
-            let endTime = v.coupon.couponEndTimestamp
-            v.coupon.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
-            v.coupon.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
+            v.coupon.isSn = true
+            v.coupon.couponStartTime = v.coupon.couponBeginTimestamp
+            v.coupon.couponEndTime = v.coupon.couponEndTimestamp
+            couponListT.push(v.coupon)
         })
 
-        this.data.couponList = this.data.couponList.concat(...data)
+        this.data.couponList = this.data.couponList.concat(...couponListT)
         this.setData({
             mobileTop:getMobileCache(),
             couponList: this.data.couponList

+ 2 - 1
pages/signIn/record/record.json

@@ -1,6 +1,7 @@
 {
   "navigationBarTitleText": "签到记录",
   "usingComponents": {
-    "custom-page": "../../../components/customPage/customPage"
+    "custom-page": "../../../components/customPage/customPage",
+    "coupon-wrap": "../../../components/couponWrap/index"
   }
 }

+ 9 - 25
pages/signIn/record/record.wxml

@@ -19,32 +19,16 @@
   <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">请登录</button>
   <!-- 优惠券内容 -->
   <view hidden="{{hiddenCoupon}}">
-    <view wx:for="{{couponList}}" wx:key="index" data-id="{{item.id}}">
-      <navigator class="{{item.coupon.couponType == 'C'?'coupon-list2 flex-row':'coupon-list flex-row'}}" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" extra-data="{foo: 'bar'}" open-type='navigate'>
-        <view class="coupon-info flex-column">
-          <viwe class="coupon-info-tittle">{{item.coupon.couponTitle}}</viwe>
-          <view class="coupon-center-bm flex-row">
-            <view class="coupon-center-block1"></view>
-            <view class="coupon-center-middle" wx:if="{{item.coupon.formatLeastCost == '0'}}">无门槛</view>
-            <view class="coupon-center-middle" wx:if="{{item.coupon.formatLeastCost != '0'}}">满{{item.coupon.formatLeastCost}}元使用</view>
-            <view class="coupon-center-block2"></view>
-          </view>
-          <viwe class="coupon-info-date">{{item.coupon.couponBeginTimestamp}}-{{item.coupon.couponEndTimestamp}}</viwe>
-        </view>
-        <view class="coupon-numText flex-column">
-          <view class="coupon-num flex-row">
-            <!-- 折扣券 -->
-            <view class="{{item.coupon.formatDiscount.length > 3 ?'coupon-num-numSmall':'coupon-num-num'}}" wx:if="{{item.coupon.couponType == 'D'}}">{{item.coupon.formatDiscount ?item.coupon.formatDiscount:0}}</view>
-            <view class="{{item.coupon.formatDiscount.length > 3 ?'coupon-num-hanSmall':'coupon-num-han'}}" wx:if="{{item.coupon.couponType == 'D'}}">折</view>
-            <!-- 代金券 -->
-            <view class="{{item.coupon.formatReduceCost.length > 3 ?'coupon-num-hanSmall':'coupon-num-han'}}" wx:if="{{item.coupon.couponType == 'C'}}">¥</view>
-            <view class="{{item.coupon.formatReduceCost.length > 3 ?'coupon-num-numSmall':'coupon-num-num'}}" wx:if="{{item.coupon.couponType == 'C'}}">{{item.coupon.formatReduceCost ?item.coupon.formatReduceCost:0}}</view>
-          </view>
-          <!-- <jumpmallapp>去使用</jumpmallapp> -->
-          <view class="coupon-num-text">立即使用</view>
-        </view>
-      </navigator>
+  
+    <view class="coupon-wrap-list">
+        <coupon-wrap wx:if="{{couponList.length>0}}" 
+        coupon-list="{{couponList}}" 
+        class="coupon_wrap"
+        coupon-item-ex-class="coupon-item-style"
+        coupon-circule-ex-class="coupon-circule-style"
+        />
     </view>
+
   </view>
 
   <!-- 获取明细 -->

+ 16 - 0
pages/signIn/record/record.wxss

@@ -269,3 +269,19 @@ page{
   font-weight: 1000;
   text-align: center;
 }
+
+.coupon-wrap-list {
+  width: 100vw;
+  padding: 0 30rpx 20rpx 30rpx;
+  box-sizing: border-box;
+}
+
+.coupon_wrap {
+  width: 690rpx;
+}
+.coupon-item-style {
+  background: #fff !important;
+}
+.coupon-circule-style {
+  background: #FFF6F5 !important;
+}

+ 2 - 2
pages/welfareMall/coupon/coupon.wxss

@@ -1,17 +1,17 @@
 /* pages/welfareMall/coupon/coupon.wxss */
 page{
-  background: #FFF6F5;
   display:flex;
   flex-flow: column nowrap;
   justify-content: left;
   align-items: center;
   box-sizing: border-box;
   padding-top: 13px;
+  background: #F7F7F7;
 }
 
 .coupon-wrap-list {
   width: 100vw;
-  padding: 20rpx 30rpx;
+  padding: 0 30rpx 20rpx 30rpx;
   box-sizing: border-box;
 }
 

+ 1 - 0
pages/welfareMall/order/orderCompletion.js

@@ -79,6 +79,7 @@ Page({
           if (coupons && coupons.length > 0) {
             coupons.forEach(coupon => {
                coupon.isSn = true
+               coupon.payStatus = data.status.value
                couponList.push(coupon)
             })
           }

+ 12 - 0
project.private.config.json

@@ -155,6 +155,18 @@
                     "pathName": "pages/welfareMall/couponFitFood/index",
                     "query": "couponId=1PmexHzevy-1300&couponName=9%E6%8A%98%E5%88%B8",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/signIn/record/record",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/luckDraw/profile",
+                    "query": "",
+                    "scene": null
                 }
             ]
         }