Browse Source

福利购字体颜色统一

kk.shi 3 years ago
parent
commit
64ede07236

+ 6 - 1
components/couponWrap/index.js

@@ -1,6 +1,7 @@
 // components/couponWrap/index.js
 import { parseTime } from '../../utils/util';
 import activity from '../../api/activity'
+import {getColor} from '../../utils/user'
 
 Component({
     externalClasses: ['class', 'coupon-circule-ex-class', 'coupon-item-ex-class'],
@@ -37,7 +38,7 @@ Component({
      * 组件的方法列表
      */
     methods: {
-        prepareData() {
+      async prepareData() {
             if (!this.data.couponList || this.data.couponList.length == 0) {
                 this.data.list = [];
                 this.data.flodMap = {};
@@ -82,6 +83,10 @@ Component({
             this.setData({
                 list: this.data.couponList
             })
+            let info =  await getColor();
+            this.setData({
+              config:info
+            })
         },
         exFoldPanel(e) {
             const index = e.currentTarget.dataset.index

+ 8 - 8
components/couponWrap/index.wxml

@@ -5,7 +5,7 @@
            <!-- 礼包 -->
            <view class="coupon-card">
                 <view class="coupon-card-left">
-                      <view class="coupon-prices {{nums.priceClass(item)}}">
+                      <view class="coupon-prices {{nums.priceClass(item)}}" style="color: {{config.secColor?config.secColor:'#B01717'}};">
                         <block wx:if="{{item.type.value == 'C'}}">
                             <text>{{nums.formatReduceCost(item)}}</text>
                             <text class="_unit">元</text>
@@ -21,25 +21,25 @@
                           </block>
                         </block>
                       </view>
-                      <view class="coupon-condition">{{nums.formatLeastCost(item)}}</view>
+                      <view class="coupon-condition" style="color: {{config.secColor?config.secColor:'#B01717'}};">{{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">
+                    <view wx:if="{{item.couponState == 0}}" class="coupon-card-btn" style="background: {{config.mainColor?config.mainColor:'#B01717'}};">
                       <jumpmallapp>立即使用</jumpmallapp>
                     </view>
                     <view class="coupon-card-btn gray" wx:else>
                         {{item.stateStr}}
                     </view>
                 </block>
-                <view class="coupon-card-num" wx:else>
+                <view class="coupon-card-num" wx:else style="background: {{config.mainColor?config.mainColor:'#B01717'}};">
                     {{item.num}}张
                 </view>
            </view>
-           <view class="coupon-split">
+           <view class="coupon-split" style="color: {{config.mainColor?config.mainColor:'#B01717'}};">
                  <view class="coupon-circule _left coupon-circule-ex-class" ></view>
                  <view class="coupon-circule _right coupon-circule-ex-class"></view>
            </view>
@@ -57,7 +57,7 @@
                         </block>
                         <block wx:elif="{{item.bindShopType == 2 || item.bindShopType == 4}}">
                            <text>适用部分门店</text>
-                           <text class="look_more_txt" data-index="{{index}}" catchtap="toFixStorePage">点击查看>></text>
+                           <text class="look_more_txt" data-index="{{index}}" catchtap="toFixStorePage" style="color: {{config.secColor?config.secColor:'#B01717'}};">点击查看>></text>
                         </block>
                         <block wx:elif="{{item.bindShopType == 3 }}">
                            <text>随领取门店可用</text>
@@ -70,11 +70,11 @@
                         </block>
                         <block wx:elif="{{item.bindGoodsType == 2 || item.bindGoodsType == 4}}">
                            <text>适用部分商品</text>
-                           <text class="look_more_txt" data-index="{{index}}" catchtap="toFixFoodPage">点击查看>></text>
+                           <text class="look_more_txt" data-index="{{index}}" catchtap="toFixFoodPage" style="color: {{config.secColor?config.secColor:'#B01717'}};">点击查看>></text>
                         </block>
                         <block wx:if="{{item.bindGoodsType == 3}}">
                           <text>不适用商品</text>
-                          <text class="look_more_txt" data-index="{{index}}" catchtap="toFixFoodPageNo">点击查看>></text>
+                          <text class="look_more_txt" data-index="{{index}}" catchtap="toFixFoodPageNo" style="color: {{config.secColor?config.secColor:'#B01717'}};">点击查看>></text>
                         </block>
                    </view>
                    <view class="coupon-detail-line">

+ 5 - 5
components/couponWrap/index.wxss

@@ -38,14 +38,14 @@
 
 .coupon-condition {
     font-size: 20rpx;
-    color: #b0d342;
+    /* color: #b0d342; */
     display: inline-block;
     vertical-align: middle;
 }
 
 .coupon-prices {
     font-size: 70rpx;
-    color: #b0d342;
+    /* color: #b0d342; */
     font-weight: 600;
     height: 88rpx;
     vertical-align: baseline;
@@ -106,7 +106,7 @@
     display: inline-block;
     right: 32rpx;
     top: 38rpx;
-    background: #b0d342;
+    /* background: #b0d342; */
     border-radius: 32rpx;
     color: #fff;
     font-size: 26rpx;
@@ -117,7 +117,7 @@
 }
 
 .coupon-split {
-    border-top: 2rpx dashed  #b0d342;
+    border-top: 2rpx dashed;
     position: relative;
 }
 .coupon-circule {
@@ -168,7 +168,7 @@
 
 .look_more_txt {
     padding-left: 20rpx;
-    color: #b0d342;
+    /* color: #b0d342; */
     font-size: 22rpx;
 }
 

+ 3 - 3
pages/welfareMall/activityInfo/activityInfo.js

@@ -4,7 +4,7 @@ import Activity from '../../../api/activity';
 import Statistics from '../../../components/statistics/index'
 const util = require('../../../utils/util.js');
 const app = getApp();
-import {getMobileCache, getPhoneNumberNew as getPhoneNumberSync} from '../../../utils/user'
+import {getMobileCache, getPhoneNumberNew as getPhoneNumberSync, getColor} from '../../../utils/user'
 Page({
 
   /**
@@ -29,9 +29,9 @@ Page({
    */
   onLoad: async function (options) {
     console.log(options)
-    let res =  await WelfareMall.getIndexList();
+    let info =  await getColor();
     this.setData({
-      config:res.data.config
+      config:info
     })
     let  userMobile = await Activity.getMobileCache();
     if (userMobile.length !== 0) {

+ 9 - 3
pages/welfareMall/historical/historical.js

@@ -1,7 +1,7 @@
 // pages/welfareMall/historical/historical.js
 import WelfareMall from '../../../api/welfareMall'
 import { parseTime } from '../../../utils/util'
-import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync, getColor} from '../../../utils/user'
 Page({
 
   /**
@@ -14,14 +14,20 @@ Page({
     noResult: false,
     noMore: false,
     mobileTop: 'TONY WU',
-    orderList: []
+    orderList: [],
+    config: {},
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  onLoad: async function (options) {
     this.getOrderList();
+    let info =  await getColor();
+    this.setData({
+      config:info
+    })
+    console.log(info)
   },
 
   // 订单数据

+ 2 - 2
pages/welfareMall/historical/historical.wxml

@@ -23,8 +23,8 @@
       <view class="content-line"></view>
       <view class="content-lower">
         <view class="lower-total">共{{item.goodsList.length}}件商品 合计¥{{item.payPriceFormatter}}</view>
-        <view class="lower-order-style flex-row">
-          <view class="lower-order-text">订单详情</view>
+        <view class="lower-order-style flex-row" style="color: {{config.secColor?config.secColor:'#B01717'}};">
+          <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">订单详情</view>
         </view>
       </view>
     </view>

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

@@ -138,14 +138,14 @@ page{
   height: 46rpx;
   box-sizing: border-box;
   background: #FFFFFF;
-  border: 1px solid #B01717;
+  border: 1px solid;
   border-radius: 10rpx;
 }
 
 .lower-order-text{
   font-size: 22rpx;
   font-weight: 500;
-  color: #B01717;
+  /* color: #B01717; */
 }
 
 .no_result {

+ 6 - 1
pages/welfareMall/index/index.js

@@ -3,6 +3,7 @@
 
 import WelfareMall from '../../../api/welfareMall';
 const util = require('../../../utils/util.js');
+import {getColor} from '../../../utils/user'
 const app = getApp();
 Page({
 
@@ -138,7 +139,11 @@ Page({
       navigationList:res.data.navigationList,
       adList:res.data.adList,
       grayTheme:res.data.config.grayTheme,
-      config:res.data.config
+      // config:res.data.config
+    })
+    let info =  await getColor();
+    this.setData({
+      config:info
     })
 
     this.setThrem(res.data.config.grayTheme)

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

@@ -1,6 +1,6 @@
 // pages/welfareMall/order/orderCompletion.js
 import WelfareMall from '../../../api/welfareMall'
-import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync, getColor} from '../../../utils/user'
 Page({
 
   /**
@@ -18,12 +18,13 @@ Page({
     reason: '',
     inputValue: '',
     repeat: false,
+    config: {},
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  onLoad: async function (options) {
     // var that = this;
     // that.orderSn = options.ordersn
     if(!options.ordersn){
@@ -34,6 +35,10 @@ Page({
     })
       this.getOrder(options.ordersn);
       // this.data.orderSn = options.ordersn;
+      let info =  await getColor();
+      this.setData({
+        config:info
+      })
   },
 
   

+ 7 - 7
pages/welfareMall/order/orderCompletion.wxml

@@ -25,7 +25,7 @@
             <view>
               <view class="round" wx:if="{{orderDetail.goodsList[0].round}}">轮次:{{orderDetail.goodsList[0].round}}</view>
               <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
-              <view class="look-coupon-detail" catchtap="extendCouponWrap"><text class="word_text">查看券包详情</text>
+              <view class="look-coupon-detail" catchtap="extendCouponWrap"><text class="word_text" style="color: {{config.secColor?config.secColor:'#B01717'}};">查看券包详情</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>
@@ -67,14 +67,14 @@
       </view>
     </view>
     <view class="order-rt flex-row">
-      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="toCancelOrder">
-        <view class="lower-order-text">取消订单</view>
+      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="toCancelOrder" style="color: {{config.secColor?config.secColor:'#B01717'}};">
+        <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">取消订单</view>
       </view>
-      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="goPay">
-        <view class="lower-order-text">去支付</view>
+      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="goPay" style="color: {{config.secColor?config.secColor:'#B01717'}};">
+        <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">去支付</view>
       </view>
-      <view class="order-refund flex-row" wx:if="{{(orderDetail.status.value == 2 || orderDetail.status.value == 5) && orderDetail.goodsList[0].activity.isPay == 1}}" catchtap="getMode">
-        <view class="lower-order-text">申请退款</view>
+      <view class="order-refund flex-row" wx:if="{{(orderDetail.status.value == 2 || orderDetail.status.value == 5) && orderDetail.goodsList[0].activity.isPay == 1}}" catchtap="getMode" style="color: {{config.secColor?config.secColor:'#B01717'}};">
+        <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">申请退款</view>
       </view>
     </view>
     <!-- <modal hidden="{{hidden}}" title="退款原因" confirm-text="提交" cancel-text="取消" bindcancel="cancel" bindconfirm="confirm">

+ 3 - 3
pages/welfareMall/order/orderCompletion.wxss

@@ -179,7 +179,7 @@ page{
   width: 150rpx;
   height: 51rpx;
   background: #FFFFFF;
-  border: 1px solid #B01717;
+  border: 1px solid;
   border-radius: 10rpx;
   margin-left: 10rpx;
 }
@@ -187,7 +187,7 @@ page{
 .lower-order-text{
   font-size: 22rpx;
   font-weight: 500;
-  color: #B01717;
+  /* color: #B01717; */
 }
 
 .bg-zindex{
@@ -275,7 +275,7 @@ page{
 }
 .look-coupon-detail .word_text {
   font-size: 24rpx;
-  color: #F06255;
+  /* color: #F06255; */
   text-decoration: underline;
 }
 .look-coupon-detail .fold-btn {

+ 17 - 1
utils/user.js

@@ -1,3 +1,4 @@
+import WelfareMall from '../api/welfareMall'
 function getUserInfo() {
     return wx.getStorageSync('userInfo') || null;
 }
@@ -38,10 +39,25 @@ function getPhoneNumberNew(e, func) {
   
 }
 
+/**
+ * 获取统一颜色
+ */
+async function getColor(){
+  let config = wx.getStorageSync('config') || null 
+  if(config != null){
+    return config;
+  }
+  let res = await WelfareMall.getIndexList();
+    //颜色存到缓存中
+  wx.setStorageSync('config',res.data.config);
+  return res.data.config;
+}
+
 module.exports = {
     getUserInfo,
     getMobileCache,
     getPhoneNumber,
-    getPhoneNumberNew
+    getPhoneNumberNew,
+    getColor
 }