Commit 8f83d62363c9c49af2fd5ffebe23abee85255ed1

Authored by yvan.ni
1 parent 1df16535

等级卡背景颜色的优化

packageE/pages/user/cardinfo/cardinfo.js
... ... @@ -65,11 +65,14 @@ Page({
65 65 //-----------等级卡说明-------------------
66 66 getApp().request.promiseGet("/api/weshop/storeconfig/get/" + os.stoid, {
67 67 }).then(res => {
68   - var is_cardrule = res.data.data.cardrules;
69   - w.wxParse("content", "html", ut.format_content(is_cardrule), ee, 6);
70   - ee.setData({
71   - is_card_rule: is_cardrule
72   - });
  68 + var is_cardrule = res.data.data.cardrules;
  69 + var switch_list = res.data.data.switch_list;
  70 + var swi_arr = JSON.parse(switch_list);
  71 + w.wxParse("content", "html", ut.format_content(is_cardrule), ee, 6);
  72 + ee.setData({
  73 + is_card_rule: is_cardrule,
  74 + plus_bg_color: swi_arr.plus_bg_color,
  75 + });
73 76 })
74 77  
75 78 //----------------------------获取最大的卡类-----------------------
... ...
packageE/pages/user/cardinfo/cardinfo.wxml
... ... @@ -4,9 +4,13 @@
4 4 <view>
5 5 <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image>
6 6 </view>
7   - <view class="Opening_bk">
8   - <image src="{{url}}/miniapp/images/plus/card_bk.png"></image>
9   - </view>
  7 +<view class="Opening_bk">
  8 +<!-- <image src="{{url}}/miniapp/images/plus/card_bk.png"></image>-->
  9 + <view class="rect">
  10 + <!-- 根据后台来定义一下背景颜色 -->
  11 + <view class="before" style="{{plus_bg_color?'background-color:'+plus_bg_color:''}}"></view>
  12 + </view>
  13 + </view>
10 14  
11 15 <view class="MemberPlus rel"style="background-image:url('{{user_card.CardImg}}');background-size: 100% 100%;background-repead:no-repead;">
12 16  
... ...
packageE/pages/user/cardinfo/cardinfo.wxss
... ... @@ -220,7 +220,7 @@ align-items:center;
220 220 .fs36{
221 221 font-size: 36rpx;
222 222 }
223   -.Opening_bk image {
  223 +.Opening_bk{
224 224 position: absolute;
225 225  
226 226 width: 100%;
... ... @@ -238,4 +238,24 @@ align-items:center;
238 238 border-top-left-radius: 55rpx; border-bottom-left-radius:55rpx; }
239 239 .content .card_list .list .card_name{ max-width: 230rpx}
240 240  
241   - .price_show .thr{color: #999; text-decoration:line-through }
242 241 \ No newline at end of file
  242 + .price_show .thr{color: #999; text-decoration:line-through }
  243 +
  244 +
  245 + /* 定义矩形 */
  246 + .rect {
  247 + width: 100%;
  248 + height: 300rpx;
  249 + position: relative; /* 要设置位置是因为要设置扇形遮罩的位置 */
  250 + overflow: hidden;
  251 + }
  252 +
  253 + /* 定义扇形遮罩 */
  254 + .rect .before {
  255 + width: 140%;
  256 + height: 300rpx;
  257 + background-color: #f0ba94;
  258 + position: absolute; /* 要用绝对定位 */
  259 + left: -20%;
  260 + top: -2rpx;
  261 + border-radius: 0 0 50% 50%; /* 只要顶部两个角是圆弧就好了 */
  262 + }
243 263 \ No newline at end of file
... ...
pages/user/plus/plus.js
... ... @@ -111,7 +111,8 @@ Page({
111 111 that.setData({
112 112 is_card_rule: is_cardrule,
113 113 isyaoqingma: parseInt(swi_arr.isyaoqingma),
114   - is_salesman: parseInt(swi_arr.is_staffno)
  114 + is_salesman: parseInt(swi_arr.is_staffno),
  115 + plus_bg_color: swi_arr.plus_bg_color,
115 116 });
116 117 }
117 118 });
... ...
pages/user/plus/plus.wxml
... ... @@ -10,7 +10,10 @@
10 10 <block wx:if="{{is_plusCard}}">
11 11 <view class="Opening_plus">
12 12 <view class="Opening_bk">
13   - <image src="{{url}}/miniapp/images/plus/card_bk.png"></image>
  13 +<!-- <image src="{{url}}/miniapp/images/plus/card_bk.png"></image>-->
  14 + <view class="rect">
  15 + <view class="before" style="{{plus_bg_color?'background-color:'+plus_bg_color:''}}"></view>
  16 + </view>
14 17 </view>
15 18 <view class="swiper">
16 19 <!-- 未开通会员swiper-item -->
... ...
pages/user/plus/plus.wxss
... ... @@ -58,7 +58,7 @@ page {
58 58 width: 50%;
59 59 text-align: center;
60 60 }
61   -.Opening_bk image {
  61 +.Opening_bk{
62 62 position: absolute;
63 63 z-index: 2;
64 64 width: 100%;
... ... @@ -404,4 +404,23 @@ margin-top: 10rpx;
404 404  
405 405 swiper-item{
406 406 overflow: visible;
  407 +}
  408 +
  409 +/* 定义矩形 */
  410 +.rect {
  411 + width: 100%;
  412 + height: 300rpx;
  413 + position: relative; /* 要设置位置是因为要设置扇形遮罩的位置 */
  414 + overflow: hidden;
  415 +}
  416 +
  417 +/* 定义扇形遮罩 */
  418 +.rect .before {
  419 + width: 140%;
  420 + height: 300rpx;
  421 + background-color: #f0ba94;
  422 + position: absolute; /* 要用绝对定位 */
  423 + left: -20%;
  424 + top: -2rpx;
  425 + border-radius: 0 0 50% 50%; /* 只要顶部两个角是圆弧就好了 */
407 426 }
408 427 \ No newline at end of file
... ...