lex-xin 4 meses atrás
pai
commit
9107ac9689

+ 1 - 1
miniprogram/config.ts

@@ -1,4 +1,4 @@
-const environmentVariable = "test";
+const environmentVariable = "online";
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",

+ 43 - 127
miniprogram/pages/index/index.less

@@ -331,6 +331,7 @@ page {
   position: fixed;
   bottom: 162rpx;
   left: 0;
+  z-index: 1;
   width: 100%;
   margin-top: 24rpx;
   font-size: 24rpx;
@@ -418,7 +419,16 @@ page {
   }
 }
 .liu-section {
-  padding: 0 48rpx 48rpx;
+  padding: 0 0 48rpx;
+  .liu-img2 {
+    padding: 24rpx 48rpx 0;
+  }
+  .liu-img1 {
+    padding: 0 40rpx;
+  }
+  .titleVideoSection {
+    padding: 0 48rpx
+  }
 }
 
 .title-section {
@@ -492,6 +502,7 @@ page {
   position: fixed;
   bottom: 0;
   left: 0;
+  z-index: 2;
   width: 100%;
   background-color: #FFFFFF;
   // box-shadow: inset 0rpx 2rpx 0rpx 0rpx #F0F0F0;
@@ -503,7 +514,7 @@ page {
   .orders {
     display: flex;
     flex-direction: column;
-    margin-right: 40rpx;
+    padding-right: 40rpx;
 
     image {
       width: 48rpx;
@@ -520,6 +531,7 @@ page {
 
   .btnSection {
     flex: 1 auto;
+    position: relative;
 
     button {
       width: 100%;
@@ -616,137 +628,19 @@ page {
       background: linear-gradient( 180deg, #FBEAD0 0%, #FFFFFF 100%);
       border-radius: 32rpx 32rpx 0rpx 0rpx;
     }
-
-  //   .goodsInfo {
-  //     padding-bottom: 28rpx;
-  //     min-height: 300rpx;
-  //     .goodsItem {
-  //       height: 102rpx;
-  //       margin-bottom: 22rpx;
-  //       // flex: 1;
-  //       width: 31.53%;
-  //       margin-right: 2%;
-  //       max-width: 31.53%;
-  //       &:nth-child(3n + 3) {
-  //         margin-right: 0;
-  //       }
-
-  //       &.selected .select-arrow {
-  //         display: none !important;
-  //       }
-  //       .nameorprice {
-  //         height: 82rpx;
-  //         display: flex;
-  //         flex-direction: column;
-  //         justify-content: space-between;
-  //       }
-  //     }
-
-  //     .goodsList {
-  //       max-height: 480rpx;
-  //       overflow-y: auto;
-  //       overflow-x: hidden;
-
-  //       &::-webkit-scrollbar {
-  //         display: none;
-  //       }
-
-  //       flex-wrap: wrap;
-  //       width: 100%;
-
-  //       .pic {
-  //         width: 82rpx;
-  //         height: 82rpx;
-  //       }
-  //     }
-  //   }
   }
 
   .iconClose {
     position: absolute;
-    right: 32rpx;
-    top: 32rpx;
+    // right: 32rpx;
+    // top: 32rpx;
+    top: 0;
+    right: 0;
+    padding: 32rpx;
     width: 30rpx;
     height: 30rpx;
+    box-sizing: content-box;
   }
-
-
-  // .product-section {
-  //   display: flex;
-  //   padding-bottom: 40rpx;
-
-  //   .product-img {
-  //     width: 160rpx;
-  //     height: 160rpx;
-  //     flex-shrink: 0;
-  //     margin-right: 32rpx;
-  //     border-radius: 12rpx;
-  //     overflow: hidden;
-
-  //     image {
-  //       width: 100%;
-  //       height: 100%;
-  //     }
-  //   }
-
-  //   .product-left {
-  //     display: flex;
-  //     align-items: flex-start;
-
-  //     .currentPrice {
-  //       font-weight: bold;
-  //       color: #FE2451;
-  //       font-family: DINAlternate, DINAlternate;
-
-  //       .stuff {
-  //         font-size: 32rpx;
-  //       }
-
-  //       .priceZ {
-  //         font-family: DINAlternate, DINAlternate;
-  //         font-size: 56rpx;
-  //       }
-
-  //       .priceF {
-  //         font-family: DINAlternate, DINAlternate;
-  //         font-size: 32rpx;
-  //       }
-  //     }
-
-  //     .originPrice {
-  //       padding-left: 16rpx;
-  //       font-size: 28rpx;
-  //       color: #AAAAAA;
-  //       line-height: 40rpx;
-  //       padding-top: 30rpx;
-  //     }
-  //   }
-
-  //   .selected-info {
-  //     padding-top: 24rpx;
-  //     font-size: 28rpx;
-  //     color: #131415;
-  //     line-height: 40rpx;
-
-  //     text {
-  //       color: #FF0047;
-  //     }
-  //   }
-  // }
-
-  // .goodsInfo {
-  //   flex-direction: column;
-  //   align-items: flex-start;
-  //   padding-bottom: 90rpx;
-
-  //   .desc {
-  //     font-size: 28rpx;
-  //     color: #131415;
-  //     line-height: 40rpx;
-  //     padding-bottom: 30rpx;
-  //   }
-  // }
-
   button {
     width: 100%;
     line-height: 88rpx;
@@ -757,6 +651,28 @@ page {
     color: #FBEAC9;
     padding-top: 0;
     padding-bottom: 0;
+    
+  }
+  .btnGroup {
+    position: relative;
+  }
+}
+.btnInnerFree {
+  position: absolute;
+  right: 0;
+  z-index: 2;
+  top: -28rpx;
+  background: linear-gradient( 180deg, #FF5181 0%, #FF0047 100%);
+  border-radius: 150rpx 200rpx 200rpx 0rpx;
+  border: 2rpx solid #FFFFFF;
+  padding: 0 8rpx;
+  font-size: 24rpx;
+  color: #FFFFFF;
+  padding-top: 2rpx;
+  line-height: 34rpx;
+  overflow: hidden;
+  font-weight: bold;
+  text {
+    font-weight: bold;
   }
-  
 }

+ 26 - 9
miniprogram/pages/index/index.ts

@@ -11,17 +11,21 @@ Page({
    */
   data: {
     imgList: [
-      'https://oss.dayaedu.com/ktyq/1732585725698.png',
-      'https://oss.dayaedu.com/ktyq/1732519468124.png',
-      'https://oss.dayaedu.com/ktyq/1732519479416.png',
-      'https://oss.dayaedu.com/ktyq/1733110029242.png',
-      'https://oss.dayaedu.com/ktyq/1732519500580.png'
+      // 'https://oss.dayaedu.com/ktyq/1732585725698.png',
+      // 'https://oss.dayaedu.com/ktyq/1732519468124.png',
+      // 'https://oss.dayaedu.com/ktyq/1732519479416.png',
+      // 'https://oss.dayaedu.com/ktyq/1733110029242.png',
+      // 'https://oss.dayaedu.com/ktyq/1732519500580.png'
+      'https://oss.dayaedu.com/ktyq/1733449062928.png',
+      'https://oss.dayaedu.com/ktyq/1733449075055.png',
+      'https://oss.dayaedu.com/ktyq/1733449085983.png',
+      'https://oss.dayaedu.com/ktyq/1733449097054.png'
     ],
     goodsImgList: [
       'https://oss.dayaedu.com/ktyq/1732175006625.png',
       'https://oss.dayaedu.com/ktyq/1732175021350.png',
       'https://oss.dayaedu.com/ktyq/1732175031878.png',
-      'https://oss.dayaedu.com/ktyq/1733406956046abd99e75.png',
+      'https://oss.dayaedu.com/ktyq/1733457722973.png',
       'https://oss.dayaedu.com/ktyq/173340695604938755d8b.png',
       'https://oss.dayaedu.com/ktyq/17333975985307c7f2bec.png'
     ],
@@ -51,7 +55,7 @@ Page({
     isOverSaled: false, // 是否所有商品都没有库存
     selected: {} as any,
     opacity: 0,
-    showSelectedProduct: false, // 是否显示选中商品值
+    // showSelectedProduct: false, // 是否显示选中商品值
     scrolIntoViewStr: '',
     scrolIntoView: '',
     scrollDiscount: false, // 是否扣减启
@@ -162,6 +166,8 @@ Page({
         const prices: any = this.formatPrice(item.salePrice)
         item.integerPart = prices.integerPart
         item.decimalPart = prices.decimalPart
+        // 格式化赠送内容
+        item.giftLongTime = item.giftFlag ? this.formatGiftPeriod(item.giftVipDay, item.giftPeriod) : '';
         if(item.stockNum > 0) {
           isOverSaled = false
           if( !selected.id) {
@@ -207,6 +213,17 @@ Page({
     }
     return num + template[type]
   },
+  formatGiftPeriod(num: number, type: string) {
+    if(!num || !type) {
+      return ''
+    }
+    const template: any = {
+      DAY: "天",
+      MONTH: "个月",
+      YEAR: "年"
+    }
+    return num + template[type]
+  },
   // 选择
   onSelectGoods(e: any) {
     const { dataset } = e.currentTarget
@@ -264,7 +281,7 @@ Page({
     }
     this.setData({
       popupShow: true,
-      showSelectedProduct: true,
+      // showSelectedProduct: true,
     })
   },
   onClose() {
@@ -292,7 +309,7 @@ Page({
           })
         }
       })
-    }, 500)()
+    }, 200)()
   },
   onPreivewBannerImg(e: { currentTarget: { dataset: any } }) {
     wx.previewImage({

+ 18 - 41
miniprogram/pages/index/index.wxml

@@ -7,14 +7,14 @@
       <swiper-item>
         <view class="swiper-item swiper-video">
         <block wx:if="{{bannerImageloaded}}">
-          <image class="bg" src="https://oss.dayaedu.com/ktyq/17333963532320adcf421.png"></image>
+          <image class="bg" src="https://oss.dayaedu.com/ktyq/1733452072181.png"></image>
           <video object-fit="fill" bindplay="onBannerPlay" picture-in-picture-mode="[]" id="bannerVideo" src="https://oss.dayaedu.com/ktyq/17334057618630fc77dba.mp4"></video>
           <!-- https://oss.dayaedu.com/ktyq/17334015356119a704b08.mp4 100M -->
           <!-- https://oss.dayaedu.com/ktyq/1733405365311b760c974.mp4 30M -->
           <!-- https://oss.dayaedu.com/ktyq/17334057618630fc77dba.mp4 60M -->
         </block>
           <block wx:if="{{ !bannerPlay }}">
-            <image bindload="onBannerVideoLoad" src="https://oss.dayaedu.com/ktyq/17333963532320adcf421.png"></image>
+            <image bindload="onBannerVideoLoad" src="https://oss.dayaedu.com/ktyq/1733452072181.png"></image>
             <image bind:tap="onBannerPlay" src="./images/icon-video.png" class="icon-video"></image>
           </block>
         </view>
@@ -30,12 +30,12 @@
       <navigation-bar back="{{false}}" title="商品详情"></navigation-bar>
       <view class="product-catagory">
         <view class="item {{ scrolIntoViewStr == 'type1' || !scrolIntoViewStr ? 'selected' : '' }}" bind:tap="onTapAnchor" data-type="type1">产品介绍</view>
-        <view class="item {{ scrolIntoViewStr == 'type3' ? 'selected' : '' }}" bind:tap="onTapAnchor" data-type="type3">激活流程</view>
+        <view class="item {{ scrolIntoViewStr == 'type3' ? 'selected' : '' }}" bind:tap="onTapAnchor" data-type="type3">购买流程</view>
         <view class="item {{ scrolIntoViewStr == 'type2' ? 'selected' : '' }}" bind:tap="onTapAnchor" data-type="type2">互通案例</view>
       </view>
     </view>
 
-    <view class="scroll-current-item" wx:if="{{!isOverSaled && selected.id && showSelectedProduct }}">
+    <view class="scroll-current-item" wx:if="{{!isOverSaled && selected.id }}">
       您已选中:<text>{{ selected.typeName }}</text> ,合计:<text>¥ {{ selected.showSalePrice }}</text>
       <block wx:if="{{ selected.originalPrice > selected.salePrice }}">,已优惠:<text>¥ {{ selected.discountPrice }}</text></block>
     </view>
@@ -53,12 +53,16 @@
           <image mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/1732175031878.png" data-src="https://oss.dayaedu.com/ktyq/1732175031878.png"></image>
           <!-- <image  mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/173339759143825859f65.png" data-src="https://oss.dayaedu.com/ktyq/173339759143825859f65.png"></image> -->
           <view id="type3" class="liu-section">
-            <image  mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/1733406956046abd99e75.png" data-src="https://oss.dayaedu.com/ktyq/1733406956046abd99e75.png"></image>
-            <view class="titleVideoSection">
+            <view class="liu-img1">
+              <image  mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/1733457722973.png" data-src="https://oss.dayaedu.com/ktyq/1733457722973.png"></image>
+            </view>
+            <!-- <view class="titleVideoSection">
               <video object-fit="fill" show-center-play-btn="{{false}}" picture-in-picture-mode="[]" controls="{{liuControls}}" bindplay="onLiuPlay" class="videoItem" id="liuVideo" src="https://oss.dayaedu.com/ktyq/1733395673461fc6123ca.mp4"></video>
               <image wx:if="{{!liuControls}}" bind:tap="onLiuVideoPlay" src="./images/icon-video.png" class="icon-video"></image>
+            </view> -->
+            <view class="liu-img2">
+              <image mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/173340695604938755d8b.png" data-src="https://oss.dayaedu.com/ktyq/173340695604938755d8b.png"></image>
             </view>
-            <image  mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/173340695604938755d8b.png" data-src="https://oss.dayaedu.com/ktyq/173340695604938755d8b.png"></image>
           </view>
           <!-- <image id="type2" class="type2s" mode="widthFix" bind:tap="onPreivewGoodsImg" src="https://oss.dayaedu.com/ktyq/1732617388991.png" data-src="https://oss.dayaedu.com/ktyq/1732617388991.png"></image> -->
           <view id="type2" class="type2s title-section">
@@ -98,6 +102,7 @@
       </view>
       <view class="btnSection">
         <button bind:tap="onBuyShop" type="primary" disabled="{{ isOverSaled }}">立即购买</button>
+        <view class="btnInnerFree" wx:if="{{ selected.giftFlag }}">当天激活<text>赠{{selected.giftLongTime}}</text></view>
       </view>
     </view>
 
@@ -105,39 +110,6 @@
       <view class="popup-mask" bind:tap="onClose"></view>
       <view class="popup-container">
         <image catch:tap="onClose" src="./images/icon-close.png" class="iconClose"></image>
-
-        <!-- <view class="product-section">
-          <view class="product-img">
-            <image bind:tap="onPreivewGoods" data-src="{{ selected.pic }}" src="{{ selected.pic }}"></image>
-          </view>
-          <view>
-            <view class="product-left">
-              <view class="currentPrice">
-                <text class="stuff">¥ </text>
-                <text class="priceZ">{{ selected.integerPart }}</text>
-                <text class="priceF">.{{ selected.decimalPart }}</text>
-              </view>
-              <view class="originPrice">原价 ¥{{ selected.originalPrice }}</view>
-            </view>
-            <view class="selected-info">
-              您已选中:<text>{{ selected.typeName }}</text> <block wx:if="{{ selected.originalPrice > selected.salePrice }}">,已优惠:<text>¥ {{ selected.discountPrice }}</text></block>
-            </view>
-          </view>
-        </view> -->
-
-        <!-- <view class="goodsInfo">
-          <view class="goodsList">
-            <view wx:for="{{ list }}" wx:key="index" class="goodsItem {{ item.id == selected.id ? 'selected' : '' }} {{ item.stockNum <= 0 ? 'nosale' : '' }}" catch:tap="onSelectGoods" data-id="{{ item.id }}">
-              <image class="select-arrow" src="./images/icon-down-arrow.png"></image>
-              <image class="imgSale" wx:if="{{ item.stockNum <= 0 }}" src="./images/nosale.png"></image>
-              <image class="pic" src="{{ item.pic }}"></image>
-              <view class="nameorprice">
-                <view class="name">{{ item.typeName }}</view>
-                <view class="price">¥{{ item.showSalePrice }}</view>
-              </view>
-            </view>
-          </view>
-        </view> -->
         <view class="shop-section">
           <view class="main-goods">
             <view class="showPrice">
@@ -193,7 +165,12 @@
 
         </view>
 
-        <button type="primary" catch:tap="onSubmit">立即购买</button>
+        <view class="btnGroup">
+          <button type="primary" catch:tap="onSubmit">
+            立即购买
+          </button>
+          <view class="btnInnerFree" wx:if="{{ selected.giftFlag }}">当天激活<text>赠{{selected.giftLongTime}}</text></view>
+        </view>
       </view>
     </view>
   </view>

+ 21 - 0
miniprogram/pages/orders/order-detail.less

@@ -210,4 +210,25 @@ page {
     color: #FBEAC9;
     line-height: 44rpx;
   }
+  .btnGroup {
+    position: relative;
+  }
+  .btnInnerFree {
+    position: absolute;
+    right: 0;
+    top: -28rpx;
+    background: linear-gradient( 180deg, #FF5181 0%, #FF0047 100%);
+    border-radius: 150rpx 200rpx 200rpx 0rpx;
+    border: 2rpx solid #FFFFFF;
+    padding: 0 8rpx;
+    font-size: 24rpx;
+    color: #FFFFFF;
+    line-height: 34rpx;
+    padding-top: 2rpx;
+    overflow: hidden;
+    font-weight: bold;
+    text {
+      font-weight: bold;
+    }
+  }
 }

+ 1 - 1
miniprogram/pages/orders/order-detail.ts

@@ -30,7 +30,7 @@ Page({
     this.queryPayType()
     if (options.orderInfo) {
       const goods = JSON.parse(decodeURIComponent(options.orderInfo));
-      console.log(goods, 'goods')
+      // console.log(goods, 'goods')
       this.setData({
         goodsInfo: goods,
         status: goods.status

+ 4 - 1
miniprogram/pages/orders/order-detail.wxml

@@ -53,7 +53,10 @@
           <text class="priceF">.{{ goodsInfo.decimalPart }}</text>
         </view>
       </view>
-      <button type="primary" bind:tap="onSubmit">{{ goodsInfo.orderNo ? '继续支付' : '立即支付' }}</button>
+      <view class="btnGroup">
+        <button type="primary" bind:tap="onSubmit">{{ goodsInfo.orderNo ? '继续支付' : '立即支付' }}</button>
+        <view class="btnInnerFree" wx:if="{{ goodsInfo.giftFlag }}">当天激活<text>赠{{goodsInfo.giftLongTime}}</text></view>
+      </view>
   </view>
 
   <service wx:if="{{serviceShow}}"></service>

+ 23 - 0
miniprogram/pages/orders/order-result.less

@@ -98,6 +98,22 @@ page {
     justify-content: space-between;
     align-items: center;
     padding-top: 12rpx;
+    .innerGroup {
+      display: flex;
+      position: relative;
+    }
+    .innerFree {
+      margin-left: 8rpx;
+      font-size: 24rpx;
+      color: #FF0047;
+      line-height: 34rpx;
+      border-radius: 4rpx;
+      border: 2rpx solid rgba(255,0,71,0.25);
+      padding: 2rpx 8rpx;
+      // text {
+      //   font-weight: bold;
+      // }
+    }
     .goods-card {
       background: #FDF2E2;
       border-radius: 6rpx;
@@ -194,6 +210,13 @@ page {
     color: #777;
     border-color: #E9E6E3;
   }
+
+  .free {
+    color: #FF0047;
+  }
+  .bold {
+    font-weight: bold;
+  }
 }
 .qrcode-section {
   margin-top: 20rpx;

+ 19 - 1
miniprogram/pages/orders/order-result.ts

@@ -90,7 +90,8 @@ Page({
             shortUrl: item.activationCodeInfo.shortUrl,
             code: item.activationCodeInfo.activationCode,
             originalPrice: this.formatPrice(item.paymentCashAmount, 'ALL'),
-            typeName: this.formatPeriod(item.activationCodeInfo?.times || 1, item.activationCodeInfo.type)
+            typeName: this.formatPeriod(item.activationCodeInfo?.times || 1, item.activationCodeInfo.type),
+            giftLongTime: item.giftFlag ? this.formatGiftPeriod(item.giftVipDay, item.giftPeriod) : ''
           })
         })
         let refundStyleStr = ''
@@ -106,6 +107,9 @@ Page({
           wechatStatus: result.wechatStatus,
           goods: tempGoods,
           code: firstGoods.code || '',
+          giftFlag: firstGoods.giftFlag || false,
+          giftStatus: firstGoods.giftStatus,
+          giftLongTime: firstGoods.giftLongTime,
           refundOrderId: result.refundOrderId,
           refundTime: result.refundTime,
           refundAmount: this.formatPrice(result.refundAmount || 0, 'ALL'),
@@ -146,6 +150,9 @@ Page({
   },
   // 格式化类型
   formatPeriod(num: number, type: string) {
+    if(!num || !type) {
+      return ''
+    }
     const template: any = {
       DAY: "天卡",
       MONTH: "月卡",
@@ -156,6 +163,17 @@ Page({
     }
     return num + template[type]
   },
+  formatGiftPeriod(num: number, type: string) {
+    if(!num || !type) {
+      return ''
+    }
+    const template: any = {
+      DAY: "天",
+      MONTH: "个月",
+      YEAR: "年"
+    }
+    return num + template[type]
+  },
   onSubmit() {
     wx.redirectTo({
       url: '../index/index'

+ 9 - 3
miniprogram/pages/orders/order-result.wxml

@@ -20,8 +20,11 @@
             <view class="goods-price">¥ <text>{{ item.originalPrice }}</text></view>
           </view>
           <view class="goods-type">
-            <view class="goods-card">{{ item.typeName }}</view>
-            <view class="goods-num">x{{ item.goodsNum }}</view>
+            <view class="innerGroup">
+              <view class="goods-card" wx:if="{{ item.typeName }}">{{item.typeName}}</view>
+              <view wx:if="{{ item.giftFlag && item.giftStatus === 'GIFTED' }}" class="innerFree">已<text>赠{{ item.giftLongTime }}</text></view>
+            </view>
+            <view class="goods-num">x{{item.goodsNum}}</view>
           </view>
         </view>
       </view>
@@ -42,7 +45,10 @@
     </view>
     <view class="order-content" wx:if="{{ (goodsInfo.wechatStatus == 'PAID' || goodsInfo.wechatStatus == 'WAIT_USE') && showCanvas }}">
       <!-- <view class="qrcode-title" >{{ goodsInfo.wechatStatus == 'WAIT_USE' ? '请扫码激活' : '激活码已使用' }}</view> -->
-      <view class="qrcode-text" wx:if="{{goodsInfo.wechatStatus == 'WAIT_USE'}}"><text>扫描二维码</text>或<text>点击激活按钮</text>使用</view>
+      <view class="qrcode-text" wx:if="{{goodsInfo.wechatStatus == 'WAIT_USE'}}"><text>扫描二维码</text>或<text>点击激活按钮</text>使用<block wx:if="{{ goodsInfo.giftFlag && goodsInfo.giftStatus === 'WAIT_GIFT' }}">
+        ,<text class="free">当天激活</text><text class="free blod">赠{{ goodsInfo.giftLongTime }}</text>
+      </block>
+      </view>
         <view class="qrcode-text used" wx:else>登录<text>「音乐数字课堂」</text>APP,开启AI学练之旅~</view>
       <view class="qrcode-line"></view>
       <view class="qrcode-section">

+ 16 - 0
miniprogram/pages/orders/orders.less

@@ -142,6 +142,22 @@ page {
       justify-content: space-between;
       align-items: center;
       padding-top: 12rpx;
+      .innerGroup {
+        display: flex;
+        position: relative;
+      }
+      .innerFree {
+        margin-left: 8rpx;
+        font-size: 24rpx;
+        color: #FF0047;
+        line-height: 34rpx;
+        border-radius: 4rpx;
+        border: 2rpx solid rgba(255,0,71,0.25);
+        padding: 2rpx 8rpx;
+        // text {
+        //   // font-weight: bold;
+        // }
+      }
       .goods-card {
         background: #FDF2E2;
         border-radius: 6rpx;

+ 23 - 8
miniprogram/pages/orders/orders.ts

@@ -82,11 +82,13 @@ Page({
       );
     }
   },
-  async getList() {
-    wx.showLoading({
-      mask: true,
-      title: "加载中...",
-    });
+  async getList(noLoading: boolean) {
+    if(!noLoading) {
+      wx.showLoading({
+        mask: true,
+        title: "加载中...",
+      });
+    }
     const currentPage = this.data.page,
       currentRow = this.data.rows,
       tabIdx = this.data.tabIdx;
@@ -107,6 +109,8 @@ Page({
           studentPaymentOrderDetails.forEach((student: any) => {
             student.originalPrice = this.formatPrice(student.paymentCashAmount, 'ALL');
             student.typeName = this.formatPeriod(student.activationCodeInfo?.times || 1, student.activationCodeInfo?.type);
+            // 格式化赠送内容
+            student.giftLongTime = student.giftFlag ? this.formatGiftPeriod(student.giftVipDay, student.giftPeriod) : '';
           })
           item.studentPaymentOrderDetails = studentPaymentOrderDetails
         });
@@ -167,6 +171,17 @@ Page({
     }
     return num + template[type]
   },
+  formatGiftPeriod(num: number, type: string) {
+    if(!num || !type) {
+      return ''
+    }
+    const template: any = {
+      DAY: "天",
+      MONTH: "个月",
+      YEAR: "年"
+    }
+    return num + template[type]
+  },
   /** 加载更多 */
   loadMore() {
     const currentPage = this.data.page;
@@ -364,16 +379,16 @@ Page({
     this.setData({
       refoundStatus: false
     })
-    setTimeout(() => {
+    // setTimeout(() => {
       that.setData({
         cancelRefoundStatus: false,
         page: 1,
         maxPage: 1,
         recordList: [],
       }, () => {
-        this.getList()
+        this.getList(true)
       })
-    }, 1500);
+    // }, 1500);
   },
   onShareAppMessage() {
     return {

+ 7 - 1
miniprogram/pages/orders/orders.wxml

@@ -24,7 +24,13 @@
                   <view class="goods-price">¥ {{(item.originalPrice)}}</view>
                 </view>
                 <view class="goods-type">
-                  <view class="goods-card" wx:if="{{ item.typeName }}">{{item.typeName}}</view>
+                  <view class="innerGroup">
+                    <view class="goods-card" wx:if="{{ item.typeName }}">{{item.typeName}}</view>
+                    <block wx:if="{{ item.giftFlag }}">
+                      <view class="innerFree" wx:if="{{ item.giftStatus === 'WAIT_GIFT' }}">当天激活<text>赠{{ item.giftLongTime }}</text></view>
+                      <view class="innerFree" wx:if="{{ item.giftStatus === 'GIFTED' }}">已<text>赠{{ item.giftLongTime }}</text></view>
+                    </block>
+                  </view>
                   <view class="goods-num">x{{item.goodsNum}}</view>
                 </view>
               </view>