Bladeren bron

Merge remote-tracking branch 'origin/bobo/feat/coupon-card'

xing.li 3 jaren geleden
bovenliggende
commit
0ed39130ed
35 gewijzigde bestanden met toevoegingen van 1274 en 242 verwijderingen
  1. 36 0
      .idea/inspectionProfiles/Project_Default.xml
  2. 10 0
      .idea/runConfigurations.xml
  3. 14 0
      api/activity.js
  4. 65 58
      app.json
  5. 123 0
      components/couponWrap/index.js
  6. 6 0
      components/couponWrap/index.json
  7. 139 0
      components/couponWrap/index.wxml
  8. 174 0
      components/couponWrap/index.wxss
  9. BIN
      images/welfareMall/down-ico.png
  10. BIN
      images/welfareMall/store_call_ico.png
  11. BIN
      images/welfareMall/store_cr_ico.png
  12. BIN
      images/welfareMall/store_map_ico.png
  13. BIN
      images/welfareMall/store_time_ico.png
  14. BIN
      images/welfareMall/up-ico.png
  15. 13 1
      pages/welfareMall/activityInfo/activityInfo.js
  16. 1 1
      pages/welfareMall/activityInfo/activityInfo.json
  17. 5 6
      pages/welfareMall/activityInfo/activityInfo.wxml
  18. 5 1
      pages/welfareMall/activityInfo/activityInfo.wxss
  19. 5 3
      pages/welfareMall/coupon/coupon.js
  20. 2 1
      pages/welfareMall/coupon/coupon.json
  21. 12 26
      pages/welfareMall/coupon/coupon.wxml
  22. 12 128
      pages/welfareMall/coupon/coupon.wxss
  23. 99 0
      pages/welfareMall/couponFitFood/index.js
  24. 4 0
      pages/welfareMall/couponFitFood/index.json
  25. 15 0
      pages/welfareMall/couponFitFood/index.wxml
  26. 22 0
      pages/welfareMall/couponFitFood/index.wxss
  27. 227 0
      pages/welfareMall/couponFitStore/index.js
  28. 6 0
      pages/welfareMall/couponFitStore/index.json
  29. 40 0
      pages/welfareMall/couponFitStore/index.wxml
  30. 109 0
      pages/welfareMall/couponFitStore/index.wxss
  31. 23 2
      pages/welfareMall/order/orderCompletion.js
  32. 3 1
      pages/welfareMall/order/orderCompletion.json
  33. 22 6
      pages/welfareMall/order/orderCompletion.wxml
  34. 40 8
      pages/welfareMall/order/orderCompletion.wxss
  35. 42 0
      project.private.config.json

+ 36 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,36 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="TOP_LEVEL_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="INNER_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="METHOD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
+        </value>
+      </option>
+      <option name="FIELD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="IGNORE_DEPRECATED" value="false" />
+      <option name="IGNORE_JAVADOC_PERIOD" value="true" />
+      <option name="IGNORE_DUPLICATED_THROWS" value="false" />
+      <option name="IGNORE_POINT_TO_ITSELF" value="false" />
+      <option name="myAdditionalJavadocTags" value="date" />
+    </inspection_tool>
+  </profile>
+</component>

+ 10 - 0
.idea/runConfigurations.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 14 - 0
api/activity.js

@@ -199,6 +199,20 @@ class activity extends request {
     return wx.getStorageSync('loginInfo').openId;
   }
 
+  /**
+  * 卡券详情数据
+  */
+  static getCouponDetailData(params) {
+    return this.postRequest(`${this.BASE_URL}open/coupon/get-coupon-data`, params);
+  }
+
+  static getFoodListByCoupon(params) {
+    return this.postRequest(`${this.BASE_URL}open/coupon/get-food-list-by-coupon`, params);
+  }
+
+  static getStoreListByCoupon(params) {
+    return this.postRequest(`${this.BASE_URL}open/coupon/get-store-list-by-coupon`, params);
+  }
 }
 
 export default activity

+ 65 - 58
app.json

@@ -1,60 +1,67 @@
 {
-  "pages": [
-    "pages/welfareMall/index/index",
-    "pages/activityList/activityList",
-    "pages/activityInfo/activityInfo",
-    "pages/myCoupons/myCoupons",
-    "pages/index/index",
-    "pages/receiveCoupon/receiveCoupon",
-    "pages/logs/logs",
-    "pages/signIn/activity/activity",
-    "pages/signIn/record/record",
-    "pages/welfareMall/personal/personal",
-    "pages/welfareMall/historical/historical",
-    "pages/welfareMall/order/orderCompletion",
-    "pages/welfareMall/refund/refund",
-    "pages/welfareMall/feedback/feedback",
-    "pages/welfareMall/activityList/activityList",
-    "pages/welfareMall/activityInfo/activityInfo",
-    "pages/luckDraw/detail",
-    "pages/luckDraw/index",
-    "pages/luckDraw/profile",
-    "pages/luckDraw/recordPrize",
-    "pages/welfareMall/coupon/coupon",
-    "pages/welfareMall/writeOff/writeOff",
-    "pages/welfareMall/staff/isStaff",
-    "pages/welfareMall/staff/distinguish",
-    "pages/welfareMall/staff/noStaff",
-    "pages/welfareMall/staffManage/staffManage"
-  ],
-  "window": {
-    "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "Weixin",
-    "navigationBarTextStyle": "black"
-  },
-  "usingComponents": {
-    "page-wrap": "components/pageWrap/index"
-  },
-  "style": "v2",
-  "sitemapLocation": "sitemap.json",
-  "tabBar": {
-    "color": "#1b1b1b",
-    "selectedColor": "#1b1b1b",
-    "backgroundColor": "#ffffff",
-    "list": [
-      {
-        "text": "首页",
-        "pagePath": "pages/welfareMall/index/index",
-        "selectedIconPath": "images/welfareMall/home.png",
-        "iconPath": "images/welfareMall/home.png"
-      },
-      {
-        "text": "我的",
-        "pagePath": "pages/welfareMall/personal/personal",
-        "selectedIconPath": "images/welfareMall/user.png",
-        "iconPath": "images/welfareMall/user.png"
-      }
-    ]
-  }
+    "pages": [
+        "pages/welfareMall/index/index",
+        "pages/activityList/activityList",
+        "pages/activityInfo/activityInfo",
+        "pages/myCoupons/myCoupons",
+        "pages/index/index",
+        "pages/receiveCoupon/receiveCoupon",
+        "pages/logs/logs",
+        "pages/signIn/activity/activity",
+        "pages/signIn/record/record",
+        "pages/welfareMall/personal/personal",
+        "pages/welfareMall/historical/historical",
+        "pages/welfareMall/order/orderCompletion",
+        "pages/welfareMall/refund/refund",
+        "pages/welfareMall/feedback/feedback",
+        "pages/welfareMall/activityList/activityList",
+        "pages/welfareMall/activityInfo/activityInfo",
+        "pages/luckDraw/detail",
+        "pages/luckDraw/index",
+        "pages/luckDraw/profile",
+        "pages/luckDraw/recordPrize",
+        "pages/welfareMall/coupon/coupon",
+        "pages/welfareMall/writeOff/writeOff",
+        "pages/welfareMall/staff/isStaff",
+        "pages/welfareMall/staff/distinguish",
+        "pages/welfareMall/staff/noStaff",
+        "pages/welfareMall/staffManage/staffManage",
+        "pages/welfareMall/couponFitStore/index",
+        "pages/welfareMall/couponFitFood/index"
+    ],
+    "window": {
+        "backgroundTextStyle": "light",
+        "navigationBarBackgroundColor": "#fff",
+        "navigationBarTitleText": "Weixin",
+        "navigationBarTextStyle": "black"
+    },
+    "usingComponents": {
+        "page-wrap": "components/pageWrap/index"
+    },
+    "style": "v2",
+    "sitemapLocation": "sitemap.json",
+    "tabBar": {
+        "color": "#1b1b1b",
+        "selectedColor": "#1b1b1b",
+        "backgroundColor": "#ffffff",
+        "list": [
+            {
+                "text": "首页",
+                "pagePath": "pages/welfareMall/index/index",
+                "selectedIconPath": "images/welfareMall/home.png",
+                "iconPath": "images/welfareMall/home.png"
+            },
+            {
+                "text": "我的",
+                "pagePath": "pages/welfareMall/personal/personal",
+                "selectedIconPath": "images/welfareMall/user.png",
+                "iconPath": "images/welfareMall/user.png"
+            }
+        ]
+    },
+    "permission": {
+        "scope.userLocation": {
+            "desc": "本次获取位置,为了查看附加可用卡券的门店"
+        }
+    }
 }

+ 123 - 0
components/couponWrap/index.js

@@ -0,0 +1,123 @@
+// components/couponWrap/index.js
+import { parseTime } from '../../utils/util';
+import activity from '../../api/activity'
+
+Component({
+    externalClasses: ['class', 'coupon-circule-ex-class', 'coupon-item-ex-class'],
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        couponList: {
+            type: Array,
+            default: []
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        flodMap: {
+        }
+    },
+
+    lifetimes: {
+        attached: function() {
+            // this.prepareData()
+        }
+    },
+    observers: {
+        'couponList'(dataA) { 
+           this.prepareData()
+        },
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        prepareData() {
+            this.data.couponList.forEach(v => {
+                v.validTimesStr = this.validTimes(v)
+                if (typeof (v.type || v.couponType) == "string") {
+                    v.type = { value: (v.type || v.couponType) }
+                } else {
+                    v.type = v.type || v.couponType
+                }
+                v.title = v.title || v.couponName || v.couponTitle
+            })
+            this.setData({
+                list: this.data.couponList
+            })
+        },
+        exFoldPanel(e) {
+            const index = e.currentTarget.dataset.index
+            if (this.data.flodMap[index]) {
+                this.data.flodMap[index] = false
+                this.setData({
+                    flodMap: this.data.flodMap
+                })
+            } else {
+                this.loadCouponData(index)
+            }
+
+        },
+        loadCouponData(index) {
+            if (this.data.list[index].isLoadCouponDetail) {
+                this.data.flodMap[index] = true
+                this.setData({
+                    flodMap: this.data.flodMap
+                })
+                return
+            }
+            activity.getCouponDetailData({ couponId: this.data.list[index].couponId }).then( res => {
+                if (res.code == 200) {
+                    const data = res.data || {}
+                    Object.assign(this.data.list[index], {
+                        description: data.description || '',
+                        bindShopType: data.bindShopType || 1,
+                        bindGoodsType: data.bindGoodsType || 1,
+                        isLoadCouponDetail: true
+                    })
+                    this.data.flodMap[index] = true
+                    this.setData({
+                        flodMap: this.data.flodMap,
+                        list: this.data.list
+                    })
+                }
+            }).catch( _ => { console.log(_)})
+        },
+        validTimes(item) {
+            if (item.isSn) {
+                if (item.couponStartTime && item.couponEndTime) {
+                    return parseTime(item.couponStartTime, "{y}.{m}.{d}") + " - " + parseTime(item.couponEndTime, "{y}.{m}.{d}")
+                } else {
+                    return ""
+                }
+            }
+            const timeCondition = item.timeCondition || {}
+            if (timeCondition.type == "DATE_TYPE_FIXED_TERM") {
+                return "领券当日起" + timeCondition.fixedTerm + "天内有效"
+            }
+            if (timeCondition.type == "DATE_TYPE_FIXED_TIME_RANGE") {
+                return parseTime(timeCondition.beginTimestamp, "{y}.{m}.{d}") + " - " + parseTime(timeCondition.endTimestamp, "{y}.{m}.{d}")
+            }
+            return ""
+        },
+        toFixStorePage(e) {
+            const couponId = this.data.list[e.currentTarget.dataset.index].couponId;
+            wx.navigateTo({
+              url: '/pages/welfareMall/couponFitStore/index?couponId=' + couponId,
+            })
+
+        },
+        toFixFoodPage(e) {
+            const couponId = this.data.list[e.currentTarget.dataset.index].couponId;
+            const title = this.data.list[e.currentTarget.dataset.index].title;
+            wx.navigateTo({
+                url: '/pages/welfareMall/couponFitFood/index?couponId=' + couponId + "&couponName=" + title,
+            })
+        }
+    }
+})

+ 6 - 0
components/couponWrap/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "jumpmallapp": "../jumpmallapp"
+    }
+}

+ 139 - 0
components/couponWrap/index.wxml

@@ -0,0 +1,139 @@
+<!--components/couponWrap/index.wxml-->
+<block wx:if= "{{list.length>0}}">
+    <view class="coupon-list">
+        <view wx:for="{{list}}" wx:key="coupon" class="coupon-item coupon-item-ex-class">
+           <!-- 礼包 -->
+           <view class="coupon-card">
+                <view class="coupon-card-left">
+                      <view class="coupon-prices {{nums.priceClass(item)}}">
+                        <block wx:if="{{item.type.value == 'C'}}">
+                            <text>{{nums.formatReduceCost(item)}}</text>
+                            <text class="_unit">元</text>
+                        </block>
+                        <block wx:elif="{{item.type.value == 'D'}}">
+                            <text>{{nums.formatDiscount(item)}}</text>
+                            <text class="_unit">折</text>
+                        </block>
+                      </view>
+                      <view class="coupon-condition">{{nums.formatLeastCost(item)}}</view>
+                </view>
+                <view class="coupon-card-right">
+                    <view class="_title">{{item.title}}</view>
+                    <view class="_time_des">{{item.validTimesStr}}</view>
+                </view>
+                <block wx:if="{{item.isSn}}">
+                    <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>
+                        已作废
+                    </view>
+                </block>
+                <view class="coupon-card-num" wx:else>
+                    {{item.num}}张
+                </view>
+           </view>
+           <view class="coupon-split">
+                 <view class="coupon-circule _left coupon-circule-ex-class" ></view>
+                 <view class="coupon-circule _right coupon-circule-ex-class"></view>
+           </view>
+
+           <view class="coupon-detail">
+                <view class="fold-title" data-index= "{{index}}" catchtap="exFoldPanel">使用规则 
+                    <image wx:if="{{!flodMap[index]}}" class="fold-btn" src="../../images/welfareMall/down-ico.png" />
+                    <image wx:else class="fold-btn" src="../../images/welfareMall/up-ico.png" />
+                </view>
+                <block wx:if="{{flodMap[index]}}">
+                   <view class="coupon-detail-line" style="margin-top: 22rpx;">
+                        <text class="_key">适用门店:</text>
+                        <block wx:if="{{item.bindShopType == 1}}">
+                          <text>全国所有门店</text>
+                        </block>
+                        <block wx:elif="{{item.bindShopType == 2 || item.bindShopType == 4}}">
+                           <text>适用部分门店</text>
+                           <text class="look_more_txt" data-index="{{index}}" catchtap="toFixStorePage">点击查看>></text>
+                        </block>
+                        <block wx:elif="{{item.bindShopType == 3 }}">
+                           <text>随领取门店可用</text>
+                        </block>
+                   </view>
+                   <view class="coupon-detail-line">
+                        <text class="_key">适用商品:</text>
+                        <block wx:if="{{item.bindGoodsType == 1}}">
+                          <text>特价商品除外</text>
+                        </block>
+                        <block wx:elif="{{item.bindGoodsType == 2 || item.bindGoodsType == 4}}">
+                           <text>适用部分商品</text>
+                           <text class="look_more_txt" data-index="{{index}}" catchtap="toFixFoodPage">点击查看>></text>
+                        </block>
+                   </view>
+                   <view class="coupon-detail-line">
+                        <text class="_key">适用场景:</text>
+                        <text>门店</text>
+                   </view>
+
+                   <view class="coupon-detail-line">
+                        <text class="_key">使用规则:</text>
+                   </view>
+
+                   <view class="coupon-detail-des">
+                       {{item.description}}
+                   </view>
+
+                </block>
+
+           </view>
+
+        </view>
+    </view>
+
+    <!-- 弹窗 -->
+
+</block>
+
+
+<wxs module="nums">
+        module.exports.formatReduceCost = function (item) {
+            if (item.formatReduceCost) {
+                return item.formatReduceCost;
+            } else if (item.reduceCost) {
+                return parseFloat(parseInt(item.reduceCost * 100) / 10000)
+            }
+            return 0
+        }
+        module.exports.formatLeastCost = function (item) {
+            if (!item.formatLeastCost) {
+                item.formatLeastCost = parseFloat(parseInt((item.leastCost || 0) * 100) / 10000)
+            }
+            if (item.formatLeastCost == 0) {
+                return "无限制"
+            }
+            return "满" + item.formatLeastCost + "元"
+        }
+        module.exports.formatDiscount = function(item) {
+            if (item.formatDiscount) {
+                return item.formatDiscount
+            } else if (item.discount) {
+                return parseFloat(parseInt((item.discount || 0) * 10) / 100)
+            }
+            return 0
+        }
+        module.exports.priceClass = function(item) {
+            if (item.type.value == "C") {
+                if (item.reduceCost >= 100) {
+                    return "_small"
+                }
+                return 100
+            }
+            if (item.type.value == "D" ) {
+                if (item.discount >= 10) {
+                    return "_small"
+                }
+                return ""
+            }
+            return ""
+        }
+</wxs>

+ 174 - 0
components/couponWrap/index.wxss

@@ -0,0 +1,174 @@
+/* components/couponWrap/index.wxss */
+
+.coupon-list {
+    display: block;
+    padding-top: 10rpx;
+}
+
+.coupon-item {
+    display: inline-block;
+    margin-bottom: 20rpx;
+    background: #FFF6F5;
+    font-size: 24rpx;
+    border-radius: 12rpx;
+    width: 690rpx;
+    overflow-x: hidden;
+}
+.coupon-list .coupon-item:last-child {
+    margin-bottom: 0;
+}
+
+.coupon-card {
+    height: 156rpx;
+    width: 100%;
+    position: relative;
+    display: flex;
+    flex-direction: row;
+}
+
+.coupon-card-left {
+    width: 220rpx;
+    text-align: center;
+}
+
+.coupon-prices {
+    width: 100%;
+    white-space: nowrap;
+}
+
+.coupon-condition {
+    font-size: 20rpx;
+    color: #F06255;
+    display: inline-block;
+    vertical-align: middle;
+}
+
+.coupon-prices {
+    font-size: 70rpx;
+    color: #F06255;
+    font-weight: 600;
+    height: 88rpx;
+    vertical-align: baseline;
+    box-sizing: border-box;
+    padding-top: 6rpx;
+}
+.coupon-prices._small {
+    padding-top: 20rpx;
+    font-size: 60rpx;
+}
+
+.coupon-prices ._unit {
+    font-size: 30rpx;
+}
+.coupon-condition:before, .coupon-condition:after {
+    width: 6px;
+    height: 6px;
+    background: #F06255;
+    transform:rotate(45deg);
+    margin: 0 6rpx;
+    display: inline-block;
+    content: "";
+    vertical-align: middle;
+    position: relative;
+    top: -3rpx;
+}
+
+.coupon-card-right {
+    padding-left: 4rpx;
+}
+.coupon-card-right ._title {
+    color: #444;
+    font-weight: 600;
+    font-size: 34rpx;
+    padding-top: 32rpx;
+    white-space: nowrap;
+}
+.coupon-card-right ._time_des {
+    font-size: 24rpx;
+    color: #A0A0A0;
+    margin-top: 14rpx;
+}
+
+.coupon-card-num {
+    position: absolute;
+    display: inline-block;
+    right: 32rpx;
+    top: 38rpx;
+    background: #F06255;
+    border-radius: 20rpx;
+    color: #fff;
+    font-size: 26rpx;
+    padding: 1rpx 12rpx 2px;
+}
+.coupon-card-btn {
+    position: absolute;
+    display: inline-block;
+    right: 32rpx;
+    top: 38rpx;
+    background: #F06255;
+    border-radius: 32rpx;
+    color: #fff;
+    font-size: 26rpx;
+    padding: 8rpx 16rpx 10rpx;
+}
+.coupon-card-btn.gray {
+    background:#a0a0a0;
+}
+
+.coupon-split {
+    border-top: 2rpx dashed  #F06255;
+    position: relative;
+}
+.coupon-circule {
+    height: 20rpx;
+    width: 20rpx;
+    background: #fff;
+    border-radius: 50%;
+    position: absolute;
+    top: -12rpx;
+}
+.coupon-circule._left {
+    left: -10rpx;
+}
+.coupon-circule._right {
+    right: -10rpx;
+}
+
+.coupon-detail {
+    padding: 20rpx 50rpx;
+}
+.fold-title {
+    font-size: 24rpx;
+    color: #444;
+}
+.fold-btn {
+    width: 26rpx;
+    height: 26rpx;
+    position: relative;
+    display: inline-block;
+    left: 18rpx;
+    top: 4rpx;
+}
+
+.coupon-detail-line {
+    margin-top: 12rpx;
+    font-size: 24rpx;
+    color: #444;
+}
+.coupon-detail-line ._key{
+    color: #A0A0A0;
+}
+
+.coupon-detail-des {
+    margin-top: 10rpx;
+    font-size: 24rpx;
+    color: #444;
+}
+
+.look_more_txt {
+    padding-left: 20rpx;
+    color: #F06255;
+    font-size: 22rpx;
+}
+
+

BIN
images/welfareMall/down-ico.png


BIN
images/welfareMall/store_call_ico.png


BIN
images/welfareMall/store_cr_ico.png


BIN
images/welfareMall/store_map_ico.png


BIN
images/welfareMall/store_time_ico.png


BIN
images/welfareMall/up-ico.png


+ 13 - 1
pages/welfareMall/activityInfo/activityInfo.js

@@ -96,10 +96,22 @@ Page({
      }
      console.log(res.data.stock)
      let buttonText = res.data.isPay == 1 ? '立即抢购' : '立即领取';
+     // 构建券包传参参数
+     const couponList = []
+     if (res.data.activityCouponList && Array.isArray(res.data.activityCouponList)) {
+       res.data.activityCouponList.forEach(v => {
+          const coupon = v.coupon
+          if (coupon) {
+            coupon.num = v.num
+            couponList.push(coupon)
+          }
+       })
+     }
      this.setData({
        detail:res.data,
        statusShowText:statusShowText,
-       buttonText:buttonText
+       buttonText:buttonText,
+       couponList,
      })
   },
   /**

+ 1 - 1
pages/welfareMall/activityInfo/activityInfo.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {
-    
+    "coupon-wrap" : "../../../components/couponWrap/index"
   },
   "navigationBarBackgroundColor": "#FFFFFF",
   "navigationBarTextStyle": "black",

+ 5 - 6
pages/welfareMall/activityInfo/activityInfo.wxml

@@ -1,4 +1,4 @@
-<!-- <page-wrap id="#Page"> -->
+<page-wrap id="#Page">
   <image src="{{detail.fullCoverImg}}" mode="widthFix" class="top_img"></image>
   <view class="info_all flex-row">
     <view class="flex-row info">
@@ -40,10 +40,8 @@
     <image src="/images/welfareMall/bag_content.png" class="bottom_icon"></image>
     <view class="bottom_tilte_text">礼包内容</view>
     </view>
-    <view class="bottom_title_b" wx:if="{{detail.cashCouponNum > 0 && detail.discountCouponNum > 0}}">代金券 X {{detail.cashCouponNum}} ,折扣券 X {{detail.discountCouponNum}}</view>
-          <view class="bottom_title_b" wx:if="{{detail.cashCouponNum ==0 && detail.discountCouponNum > 0}}">折扣券 X {{detail.discountCouponNum}}</view>
-          <view class="bottom_title_b" wx:if="{{detail.cashCouponNum > 0 && detail.discountCouponNum == 0}}">代金券 X {{detail.cashCouponNum}}</view>
-          <view class="bottom_title_b" wx:if="{{detail.cashCouponNum ==0 && detail.discountCouponNum ==0}}"></view>
+
+    <coupon-wrap wx:if="{{couponList.length>0}}" coupon-list="{{couponList}}" class="coupon_wrap" />
 
     </view>
 
@@ -85,4 +83,5 @@
         </view>
       <image class="widow_del" src="/images/welfareMall/window_del.png"  bindtap="goToOrderList"></image>
     </view>
-<!-- </page-wrap>-->
+
+</page-wrap>

+ 5 - 1
pages/welfareMall/activityInfo/activityInfo.wxss

@@ -214,7 +214,11 @@ margin-top:30px;
    border-top-left-radius: 40rpx;
    border-top-right-radius: 40rpx;
    align-items: flex-end;
-   border-top:solid 1px #E8e8e8;
+   border-top:solid 1px #F08D8C;
    position: relative;
    z-index: 2
+}
+
+.coupon_wrap {
+  padding: 46rpx 0 0 0;
 }

+ 5 - 3
pages/welfareMall/coupon/coupon.js

@@ -1,6 +1,5 @@
 // pages/welfareMall/coupon/coupon.js
 import WelfareMall from '../../../api/welfareMall'
-import { parseTime } from '../../../utils/util'
 import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
@@ -115,11 +114,14 @@ Page({
     data.forEach(v => {
       let beginTime = v.couponBeginTimestamp
       let endTime = v.couponEndTimestamp
-      v.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
-      v.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
+      v.couponStartTime = beginTime * 1000
+      v.couponEndTime = endTime * 1000
+      v.title = v.couponTitle
+      v.isSn = true
     })
 
     this.data.couponList = this.data.couponList.concat(...data)
+    
     this.setData({
         mobileTop:getMobileCache(),
         couponList: this.data.couponList

+ 2 - 1
pages/welfareMall/coupon/coupon.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
-    "jumpmallapp": "../../../components/jumpmallapp"
+    "jumpmallapp": "../../../components/jumpmallapp",
+    "coupon-wrap": "../../../components/couponWrap/index"
   },
   "navigationBarTitleText": "我的券包"
 }

+ 12 - 26
pages/welfareMall/coupon/coupon.wxml

@@ -1,28 +1,14 @@
 <!--pages/welfareMall/coupon/coupon.wxml-->
     <!-- 内容 -->
-    <navigator  class="{{item.couponType == 'C'?'coupon-list2 flex-row':'coupon-list flex-row'}}" wx:for="{{couponList}}" wx:key="index" data-couponSn="{{item.couponSn}}" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" open-type='navigate'>
-        <view class="coupon-info flex-column">
-          <viwe class="coupon-info-tittle">{{item.couponTitle}}</viwe>
-          <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>
-          <viwe class="coupon-info-date">{{item.couponBeginTimestamp}}-{{item.couponEndTimestamp}}</viwe>
-        </view>
-        <view class="coupon-numText flex-column">
-          <view class="coupon-num flex-row">
-            <!-- 折扣券 -->
-            <view class="{{item.formatDiscount.length > 3 ?'coupon-num-numSmall':'coupon-num-num'}}" wx:if="{{item.couponType == 'D'}}">{{item.formatDiscount ?item.formatDiscount:0}}</view>
-            <view class="{{item.formatDiscount.length > 3 ?'coupon-num-hanSmall':'coupon-num-han'}}" wx:if="{{item.couponType == 'D'}}">折</view>
-            <!-- 代金券 -->
-            <view class="{{item.formatReduceCost.length > 3 ?'coupon-num-hanSmall':'coupon-num-han'}}" wx:if="{{item.couponType == 'C'}}">¥</view>
-            <view class="{{item.formatReduceCost.length > 3 ?'coupon-num-numSmall':'coupon-num-num'}}" wx:if="{{item.couponType == 'C'}}">{{item.formatReduceCost ?item.formatReduceCost:0}}</view>
-          </view>
-          <!-- <jumpmallapp>去使用</jumpmallapp> -->
-          <view class="coupon-num-text">立即使用</view>
-        </view>
-    </navigator>
-    <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂可用优惠券 ————</view>
-    <view class="no_result" wx:if="{{noMore}}">—— 人家也是有底线的 ——</view>
+    <page-wrap id="Page">
+      <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 class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂可用优惠券 ————</view>
+      <view class="no_result" wx:if="{{noMore}}">—— 人家也是有底线的 ——</view>
+    </page-wrap>

+ 12 - 128
pages/welfareMall/coupon/coupon.wxss

@@ -1,6 +1,6 @@
 /* pages/welfareMall/coupon/coupon.wxss */
 page{
-  background: #F7F7F7;
+  background: #FFF6F5;
   display:flex;
   flex-flow: column nowrap;
   justify-content: left;
@@ -9,137 +9,20 @@ page{
   padding-top: 13px;
 }
 
-/* 垂直方向布局,水平居中 **/
-.flex-column{
-  display: flex;
-  flex-flow: column nowrap;
-  align-items: center;
-  justify-content: left;
-}
-
-/* 水平方向布局,垂直居中 **/
-.flex-row{
-  display: flex;
-  flex-flow: row nowrap;
-  align-items: center;
-  justify-content: center;
-}
-.coupon-list{
-  width: 704rpx;
-  height: 202rpx;
-  background-image: url(https://dy.shpr.top/welfareGo/discount.png);
-  background-size: 100% 100%;
-  margin-bottom: 17px;
-  justify-content: space-between;
-}
-
-.coupon-list2{
-  width: 704rpx;
-  height: 202rpx;
-  background-image: url(https://dy.shpr.top/welfareGo/cash.png);
-  background-size: 100% 100%;
-  margin-bottom: 17px;
-  justify-content: space-between;
-}
-
-.coupon-info{
-  margin-left: 76rpx;
-  align-items: flex-start;
-}
-
-.coupon-info-tittle{
-  width: 400rpx;
-  height: 38rpx;
-  font-size: 17px;
-  font-weight: bold;
-  color: #000000;
-  line-height: 15px;
-  margin-top: 10px;
-  overflow: hidden;
-	white-space: nowrap;
-	text-overflow: ellipsis;
-}
-
-.coupon-center-bm{
-  height: 15px;
-  margin-top: 10px;
-  justify-content: flex-start;
-}
-
-.coupon-center-block1,.coupon-center-block2{
-  width: 5px;
-  height: 5px;
-  background: #443E5B;
-  transform:rotate(45deg);
-  margin: 0 10rpx;
-}
-
-.coupon-center-middle{
-  font-size: 10px;
-  font-weight: 400;
-  color: #444444;
-  line-height: 16px;
-}
-
-.coupon-info-num{
-  width: 90px;
-  height: 13px;
-  font-size: 10px;
-  font-weight: 400;
-  color: #444444;
-  line-height: 15px;
-  margin-top: 15px;
-}
-
-.coupon-info-date{
-  width: 400rpx;
-  height: 30rpx;
-  font-size: 13px;
-  font-weight: 400;
-  color: #444444;
-  line-height: 15px;
-  margin-top: 10px;
-}
-
-.coupon-numText{
-  width: 200rpx;
-}
-
-.coupon-num-num{
-  font-size: 46px;
-  font-weight: bold;
-  color: #FFFFFF;
-  line-height: 57px;
+.coupon-wrap-list {
+  width: 100vw;
+  padding: 20rpx 30rpx;
+  box-sizing: border-box;
 }
 
-.coupon-num-numSmall{
-  font-size: 32px;
-  font-weight: bold;
-  color: #FFFFFF;
-  line-height: 33px;
-  margin-bottom: 10px;
-}
-.coupon-num-han{
-  font-size: 16px;
-  font-weight: bold;
-  color: #FFFFFF;
-  line-height: 17px;
-  margin-top: 19px;
+.coupon_wrap {
+  width: 690rpx;
 }
-
-.coupon-num-hanSmall{
-  font-size: 16px;
-  font-weight: bold;
-  color: #FFFFFF;
-  line-height: 17px;
-  margin-top: 19px;
-  margin-bottom: 19px;
+.coupon-item-style {
+  background: #fff !important;
 }
-.coupon-num-text{
-  font-size: 15px;
-  font-weight: 400;
-  color: #FFF8F8;
-  line-height: 15px;
+.coupon-circule-style {
+  background: #FFF6F5 !important;
 }
 
 .no_result {
@@ -147,4 +30,5 @@ page{
   color: #B1B1B1;
   line-height: 100rpx;
   font-weight: 1000;
+  text-align: center;
 }

+ 99 - 0
pages/welfareMall/couponFitFood/index.js

@@ -0,0 +1,99 @@
+// pages/welfareMall/couponFitFood/index.js
+import activity from '../../../api/activity'
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        console.log(options)
+        if (!options.couponId) {
+            wx.reLaunch({
+              url: '/pages/welfareMall/index/index',
+            })
+        }
+        this.data.couponId = options.couponId
+        this.setData({
+            couponName: decodeURIComponent(options.couponName)
+        })
+        this.loadData()
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+    loadData() {
+        activity.getFoodListByCoupon({
+            couponId: this.data.couponId,
+            page: 1,
+            pageSize: 10000,
+        }).then(data => {
+            if (data.code == 200) {
+                this.dataMapToView(data.data)
+            }
+        }).catch(_ => {
+            console.log(_)
+        })
+    },
+    dataMapToView(data) {
+        const foodList = []
+        data.forEach(v => {
+            foodList.push(v.foodName)
+        })
+        this.setData({
+            foodListStr: foodList.join("、")
+        })
+    }
+})

+ 4 - 0
pages/welfareMall/couponFitFood/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "适用商品"
+}

+ 15 - 0
pages/welfareMall/couponFitFood/index.wxml

@@ -0,0 +1,15 @@
+<!--pages/welfareMall/couponFitFood/index.wxml-->
+<page-wrap id="Page">
+    
+    <view class="food_body">
+        
+        <view class="coupon_title">{{couponName}}</view>
+
+        <view class="_s_t">指定可用商品:</view>
+        <view class="_pro_list">
+         {{foodListStr}}
+        </view>
+
+    </view>
+
+</page-wrap>

+ 22 - 0
pages/welfareMall/couponFitFood/index.wxss

@@ -0,0 +1,22 @@
+/* pages/welfareMall/couponFitFood/index.wxss */
+
+.food_body {
+    border-top: 10rpx solid #f4f4f4;
+}
+
+.coupon_title {
+    font-size: 36rpx;
+    padding: 48rpx 0 30rpx 28rpx;
+    font-weight: bold;
+    color: #444;
+}
+._s_t {
+    font-size: 28rpx;
+    color: #a0a0a0;
+    padding-left: 28rpx;
+}
+._pro_list {
+    font-size: 26rpx;
+    color: #444;
+    padding: 10rpx 28rpx;
+}

+ 227 - 0
pages/welfareMall/couponFitStore/index.js

@@ -0,0 +1,227 @@
+// pages/welfareMall/couponFitStore/index.js
+import activity from '../../../api/activity'
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        couponId: '',
+        keyword: '',
+        page: 1,
+        pageSize: 10,
+        storeList: []
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        if (!options.couponId) {
+            wx.reLaunch({
+              url: '/pages/welfareMall/index/index',
+            })
+        }
+        this.data.couponId = options.couponId
+        const that = this
+        wx.getSetting({
+            success(res) {
+                // 1. scope.userLocation 为真, 代表用户已经授权
+                if (res.authSetting['scope.userLocation']) {
+                // 1.1 使用 getlocation 获取用户 经纬度位置
+                wx.getLocation({
+                    success(res){
+                        // 1.2 获取用户位置成功后,将会返回 latitude, longitude 两个字段,代表用户的经纬度位置
+                        console.log(res)
+                        const l = that.qqMapToBMap(res.longitude, res.latitude)
+                        that.setData({
+                            latitude: l[1],
+                            longitude: l[0],
+                        })
+                        that.loadStoreListData()
+                    },
+                    fail() {
+                        wx.navigateBack({
+                          delta: -1,
+                        })
+                    }
+                })
+                }else {
+                    // 2. 用户未授权的情况下, 打开授权界面, 引导用户授权.
+                    wx.openSetting({
+                        success(res) {
+                            // 2.1 如果二次授权允许了 userLocation 权限, 就再次执行获取位置的接口
+                            if (res.authSetting["scope.userLocation"]) {
+                                wx.getLocation({
+                                    success(res){
+                                        // 2.2 获取用户位置成功后,将会返回 latitude, longitude 两个字段,代表用户的经纬度位置
+                                        // 2.3 将获取到的 经纬度传值给 getAddress 解析出 具体的地址
+                                        that.setData({
+                                            latitude: res.latitude,
+                                            longitude: res.longitude,
+                                        })                
+                                        that.loadStoreListData()
+                                    },
+                                    fail() {
+                                        wx.navigateBack({
+                                          delta: -1,
+                                        })
+                                    }
+                                })
+                            }
+                        }
+                    })
+                }
+            }
+        })
+    },
+
+    qqMapToBMap(lng, lat) {
+        if (lng == null || lng == '' || lat == null || lat == '')
+            return [lng, lat];
+    
+        var x_pi = 3.14159265358979324;
+        var x = parseFloat(lng);
+        var y = parseFloat(lat);
+        var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
+        var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
+        var lng = (z * Math.cos(theta) + 0.0065).toFixed(5);
+        var lat = (z * Math.sin(theta) + 0.006).toFixed(5);
+        return [lng, lat];    
+    },
+
+    bMapToQQMap(lng, lat) {
+
+        if (lng == null || lng == '' || lat == null || lat == '')
+            return [lng, lat];
+    
+        var x_pi = 3.14159265358979324;
+        var x = parseFloat(lng) - 0.0065;
+        var y = parseFloat(lat) - 0.006;
+        var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
+        var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
+        var lng = (z * Math.cos(theta)).toFixed(7);
+        var lat = (z * Math.sin(theta)).toFixed(7);
+    
+        return [lng, lat];
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+    onConfirm(e) {
+        this.setData({
+            page: 1,
+            keyword:  e.detail.value,
+            noMore: false,
+            noResult: false,
+            storeList: []
+        })
+        this.loadStoreListData()
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    onReachBottom: function () {
+        if (this.data.lock || this.data.noMore) {
+          return
+        }
+        this.data.lock = true
+        this.data.page++
+        this.loadStoreListData();
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+
+    loadStoreListData: function() {
+        activity.getStoreListByCoupon({
+            couponId: this.data.couponId,
+            latitude: this.data.latitude,
+            longitude: this.data.longitude,
+            page: this.data.page,
+            keyword: this.data.keyword,
+            pageSize: 10,
+        }).then(data => {
+            if (data.code == 200) {
+                this.dataMapToView(data.data)
+            }
+            this.data.lock = false
+        }).catch(_ => {  
+            this.data.lock = false;
+            console.log(_)
+        })
+    },
+    dataMapToView(list) {
+        if (!Array.isArray(list) || list.length == 0) {
+            if (this.data.page == 1) {
+                this.setData({
+                    noResult: true
+                })
+            } else {
+                this.setData({
+                    noMore: true
+                })
+            }
+            return
+        }
+        list.forEach(v => {
+          v.distance = parseInt(v.distance * 100) / 100
+          if (v.distance > 1) {
+              v.distanceStr = "距离" + v.distance + "km"
+          } else {
+              v.distanceStr = "距离" + (v.distance * 100) + "m"
+          }  
+        })
+
+        this.data.storeList = this.data.storeList.concat(list)
+
+        this.setData({
+            storeList: list
+        })
+    },
+    callPhone(e) {
+        const phone = e.currentTarget.dataset.phone
+        if (phone) {
+            wx.makePhoneCall({
+                phoneNumber: phone,
+            })
+        }
+    }
+
+})

+ 6 - 0
pages/welfareMall/couponFitStore/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+
+  },
+  "navigationBarTitleText": "适用门店"
+}

+ 40 - 0
pages/welfareMall/couponFitStore/index.wxml

@@ -0,0 +1,40 @@
+<!--pages/welfareMall/couponFitStore/index.wxml-->
+<page-wrap id="Page">
+   
+   <!-- 门店列表 -->
+   <view class="search_bar">
+        <view class="flex-row search_box">
+          <icon type="search" size="24" color="#d3d3d3" class="serach_ico"/>
+          <input class="search_input" 	placeholder-class= "search-input-tip" type="text" confirm-type="search" bindconfirm="onConfirm" value="{{keyword}}"  placeholder="输入门店名称查询"/>
+        </view>
+   </view>
+
+   <view class="store_body">
+        
+        <view class="store_list">
+            <view wx:for="{{storeList}}" class="store_item flex-row" wx:key="index">
+                <view class="_left">
+                     <view class="_store_name">{{item.shopName}}</view>
+                     <view class="_store_address flex-row"><image src="../../../images/welfareMall/store_cr_ico.png" /> <text>{{item.shopAddress}}</text></view>
+                     <view class="_store_times flex-row"><image src="../../../images/welfareMall/store_time_ico.png" /> <text>{{item.shopOpenTime}}</text></view>
+                </view>
+                <view class="_right">
+                    <view class="_distance">{{item.distanceStr}}</view>
+                    <view class="_btns flex-row">
+                        <view class="map_btn">
+                           <image src="../../../images/welfareMall/store_map_ico.png" />
+                        </view>
+                        <view class="call_btn" data-phone="{{item.shopPhone}}" catchtap="callPhone">
+                            <image src="../../../images/welfareMall/store_call_ico.png" />
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </view>
+
+        <view class="no_result" wx:if="{{noResult}}">———— 抱歉,未查询到匹配的门店 ————</view>
+        <view class="no_result" wx:if="{{noMore}}">—— 人家也是有底线的 ——</view>
+
+   </view>
+
+</page-wrap>

+ 109 - 0
pages/welfareMall/couponFitStore/index.wxss

@@ -0,0 +1,109 @@
+/* pages/welfareMall/couponFitStore/index.wxss */
+page {
+    background: #f4f4f4;
+}
+.search_bar {
+    height: 106rpx;
+    width: 100vw;
+    position: fixed;
+    z-index: 1;
+    background: #fff;
+}
+.search_box {
+    width: 680rpx;
+    margin: 17rpx auto;
+    height: 72rpx;
+    background: #f3f3f3;
+    border-radius: 40px;
+}
+.serach_ico {
+    margin-left: 30rpx;
+}
+.search_input {
+    width: 580rpx;
+    padding-left: 8rpx;
+}
+
+.store_body {
+    padding-top: 106rpx;
+}
+.store_list {
+    width: 716rpx;
+    margin: auto;
+}
+.store_item {
+    width: 100%;
+    background: #fff;
+    margin-top: 20rpx;
+    border-radius: 10rpx;
+}
+.store_item ._left {
+    width: 560rpx;
+    box-sizing: border-box;
+    padding: 20rpx 0 20rpx 40rpx;
+}
+._store_name {
+    font-size: 36rpx;
+    font-weight: 600;
+    color: 444;
+}
+._store_address {
+    height: 40rpx;
+    margin-top: 30rpx;
+}
+._store_address image {
+    width: 40rpx;
+    height: 40rpx;
+}
+._store_address text {
+    font-size: 22rpx;
+    color: #a0a0a0;
+    padding-left: 10rpx;
+    width: 460rpx;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+._store_times {
+    height: 40rpx;
+    margin-top: 20rpx;
+}
+
+._store_times image {
+    width: 40rpx;
+    height: 40rpx;
+}
+._store_times text {
+    font-size: 22rpx;
+    color: #a0a0a0;
+    padding-left: 10rpx;
+}
+
+.store_item ._right {
+    width: 152rpx;
+}
+.store_item ._right ._distance {
+    margin-bottom: 28rpx;
+    color: #a0a0a0;
+    font-size: 24rpx;
+}
+.store_item ._right ._btns .map_btn{
+    margin-right: 30rpx;
+}
+.store_item ._right ._btns image {
+    width: 50rpx;
+    height: 50rpx;
+}
+.search-input-tip {
+    font-size: 32rpx;
+    color: #a0a0a0;
+}
+
+.no_result {
+    font-size: 24rpx;
+    color: #B1B1B1;
+    line-height: 100rpx;
+    font-weight: 1000;
+    text-align: center;
+  }

+ 23 - 2
pages/welfareMall/order/orderCompletion.js

@@ -1,6 +1,5 @@
 // pages/welfareMall/order/orderCompletion.js
 import WelfareMall from '../../../api/welfareMall'
-import { parseTime } from '../../../utils/util'
 import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
@@ -71,11 +70,26 @@ Page({
         console.log("订单详情数据为空");
         return
     }
+
+    // 构建券包传参参数
+    const couponList = []
+    if (data.goodsList && Array.isArray(data.goodsList)) {
+        data.goodsList.forEach(v => {
+          const coupons = v.couponList
+          if (coupons && coupons.length > 0) {
+            coupons.forEach(coupon => {
+               coupon.isSn = true
+               couponList.push(coupon)
+            })
+          }
+        })
+    }
     //对象转换
     this.data.orderDetail = data
     this.setData({
         mobileTop:getMobileCache(),
-        orderDetail: this.data.orderDetail
+        orderDetail: this.data.orderDetail,
+        couponList,
     })
   }, 
 
@@ -258,6 +272,13 @@ Page({
     return ;
   },
 
+  extendCouponWrap() {
+    this.data.isExtend = !this.data.isExtend
+    this.setData({
+      isExtend: this.data.isExtend
+    })
+  },
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 3 - 1
pages/welfareMall/order/orderCompletion.json

@@ -1,4 +1,6 @@
 {
-  "usingComponents": {},
+  "usingComponents": {
+    "coupon-wrap" : "../../../components/couponWrap/index"
+  },
   "navigationBarTitleText": "订单详情"
 }

+ 22 - 6
pages/welfareMall/order/orderCompletion.wxml

@@ -21,8 +21,14 @@
         </view>
         <view class="content-middle flex-row">
           <view class="middle-it flex-row">
-            <image class="middle-img" src="{{orderDetail.goodsList[0].fullCoverImg}}" />
-            <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
+            <image class="middle-img" src="{{orderDetail.goodsList[0].fullCoverImg}}" mode="aspectFill" />
+            <view>
+              <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
+              <view class="look-coupon-detail" catchtap="extendCouponWrap"><text class="word_text">查看券包详情</text>
+                <image wx:if="{{!isExtend}}" class="fold-btn" src="../../../images/welfareMall/down-ico.png" />
+                <image wx:else class="fold-btn" src="../../../images/welfareMall/up-ico.png" />
+              </view>
+            </view>
           </view>
           <view class="middle-num flex-column">
             <view class="middle-num-money">¥{{orderDetail.payPriceFormatter}}</view>
@@ -30,15 +36,21 @@
           </view>
         </view>
       </view>
-      <view class="content-payment flex-row">
-        <view class="content-payment-mode">支付方式</view>
-        <view class="content-payment-mode">微信支付</view>
-      </view>
       <view class="content-line"></view>
       <view class="content-lower flex-row" catchtap="getCompletion">
         <view class="lower-total">共{{orderDetail.goodsList.length}}件商品 合计¥{{orderDetail.payPriceFormatter}}</view>
       </view>
     </view>
+
+    <view wx:if="{{isExtend}}" 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 style="height: 20rpx;" wx:else></view>
     <view class="order-information flex-column">
       <view class="order-information-code flex-row">
         <view class="code-text">订单编号</view>
@@ -48,6 +60,10 @@
         <view class="date-text">交易时间</view>
         <view class="date-time">{{orderDetail.payedAt}}</view>
       </view>
+      <view class="order-information-date flex-row">
+        <view class="date-text">支付方式</view>
+        <view class="date-time">微信支付</view>
+      </view>
     </view>
     <view class="order-rt flex-row">
       <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="toCancelOrder">

+ 40 - 8
pages/welfareMall/order/orderCompletion.wxss

@@ -44,8 +44,7 @@ page{
 
 /* 订单详情 **/
 .order-details{
-  width: 716rpx;
-  height: 433rpx;
+  width: 100vw;
   background: #FFFFFF;
   border-radius: 10rpx;
   margin-top: 16rpx;
@@ -53,7 +52,6 @@ page{
 
 .content-hm{
   width: 680rpx;
-  height: 260rpx;
 }
 .content-head{
   width: 676rpx;
@@ -90,14 +88,13 @@ page{
 .middle-text{
   width: 240rpx;
   height: 36rpx;
-  font-size: 28rpx;
+  font-size: 30rpx;
   font-weight: 500;
   color: #444444;
   margin-left: 36rpx;
   overflow: hidden;
 	white-space: nowrap;
   text-overflow: ellipsis;
-  margin-bottom: 34rpx;
 }
 
 .middle-num{
@@ -126,7 +123,6 @@ page{
 .content-lower{
   width: 676rpx;
   height: 90rpx;
-  justify-content: space-between;
 }
 
 .lower-total{
@@ -134,6 +130,8 @@ page{
   font-family: Source Han Sans CN;
   font-weight: 500;
   color: #444444;
+  text-align: right;
+  width: 100%;
 }
 
 .content-payment{
@@ -151,11 +149,10 @@ page{
 }
 
 .order-information{
-  width: 716rpx;
+  width: 100vw;
   height: 176rpx;
   background: #FFFFFF;
   border-radius: 10rpx;
-  margin-top: 20rpx;
   justify-content: center;
 }
 
@@ -253,4 +250,39 @@ page{
 .w_go_order{
   width: 150px;
   text-align: center;
+}
+
+.coupon-wrap-list {
+  background: #FFF6F5;
+  width: 100vw;
+  padding: 20rpx 30rpx;
+  box-sizing: border-box;
+}
+.coupon_wrap {
+  width: 690rpx;
+}
+.coupon-item-style {
+  background: #fff !important;
+}
+.coupon-circule-style {
+  background: #FFF6F5 !important;
+}
+
+.look-coupon-detail {
+  height: 26rpx;
+  margin-left: 36rpx;
+  margin-top: 8rpx;
+}
+.look-coupon-detail .word_text {
+  font-size: 24rpx;
+  color: #F06255;
+  text-decoration: underline;
+}
+.look-coupon-detail .fold-btn {
+  width: 26rpx;
+  height: 26rpx;
+  position: relative;
+  display: inline-block;
+  left: 20rpx;
+  top: 6rpx;
 }

+ 42 - 0
project.private.config.json

@@ -113,6 +113,48 @@
                     "pathName": "pages/signIn/activity/activity",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/activityInfo/activityInfo",
+                    "query": "activityId=0zVqEyWqDn",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/order/orderCompletion",
+                    "query": "ordersn=640950757739862",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/order/orderCompletion",
+                    "query": "ordersn=640940250652495",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/order/orderCompletion",
+                    "query": "ordersn=640230958639293",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/coupon/coupon",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/couponFitStore/index",
+                    "query": "couponId=1PmexHzevy-1300",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/couponFitFood/index",
+                    "query": "couponId=1PmexHzevy-1300&couponName=9%E6%8A%98%E5%88%B8",
+                    "scene": null
                 }
             ]
         }