Commit 89982d83f8c9583871f2186b469a3d9aeb8ca9f8

Authored by 前端开发-罗建龙
2 parents f7991690 1fbcb057

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

packageA/pages/jfbuy/jfbuy.js
... ... @@ -35,6 +35,7 @@ Page({
35 35 key_str:'',
36 36 pattern:0, //分成的方式
37 37 pageSize:10,
  38 + curr:10,
38 39 currentPage:1, //当前的页码
39 40  
40 41 // canvasHidden: 1, //-- 隐藏画布 --
... ... @@ -57,8 +58,12 @@ Page({
57 58  
58 59 triggered: false,
59 60 isPullDownRefresh: false,
60   -
61   -
  61 +
  62 + //-- 和搜索框相关的 --
  63 + search_ing:0,
  64 + hiddenClear:1,
  65 + focus:false,
  66 + keyword:''
62 67 },
63 68  
64 69 /**
... ... @@ -353,9 +358,44 @@ Page({
353 358  
354 359 this.request_list(data);
355 360 },
356   -
357 361  
358   -
  362 + sear_list(){
  363 + var th=this;
  364 + var psize=th.data.curr;
  365 +
  366 + this.setData({
  367 + is_no_data2:0,
  368 + is_no_more2:0,
  369 + list2:[],
  370 + is_load2: 0,
  371 + currentPage2:1,
  372 + pageSize:psize
  373 + });
  374 +
  375 + var data = {
  376 + store_id:oo.stoid,
  377 + stype: this.data.requestData.stype,
  378 + stypeup:1,
  379 + page:1,
  380 + pageSize:psize
  381 + };
  382 +
  383 + if(this.data.isUp) {
  384 + data.stypeup = 0;
  385 + } else {
  386 + data.stypeup = 1;
  387 + };
  388 +
  389 + data.keyword=this.data.keyword
  390 +
  391 + // this.data.requestData = data;
  392 + this.setData({
  393 + requestData: data
  394 + })
  395 +
  396 + this.request_list(data);
  397 + },
  398 +
359 399  
360 400 request_list: function(data, callback){
361 401 // console.log('触发上拉刷新');
... ... @@ -421,9 +461,6 @@ Page({
421 461 this.request_list(data);
422 462  
423 463 },
424   -
425   -
426   -
427 464  
428 465 //---图片失败,默认图片---
429 466 bind_bnerr2: function (e) {
... ... @@ -491,6 +528,51 @@ Page({
491 528 var viewHeight = this.data.clientWidth / ratio;
492 529 var con_heihgt=this.data.clientHeight-viewHeight;
493 530 this.setData({con_heihgt:con_heihgt,isshow:1})
494   -
  531 + },
  532 +
  533 +
  534 + /*-- 和搜索相关 --*/
  535 + show_search(){
  536 + this.setData({
  537 + search_ing:1,
  538 + hiddenClear:1,
  539 + keyword:'',
  540 + focus:true
  541 + })
  542 + },
  543 +
  544 + getInput(e) {
  545 + let val = e.detail.value;
  546 + if (val) {
  547 + this.setData({
  548 + keyword: e.detail.value,
  549 + hiddenClear: false,
  550 + });
  551 + } else {
  552 + this.setData({
  553 + hiddenClear: true,
  554 + });
  555 + }
  556 + },
  557 +
  558 + clearInput() {
  559 + this.setData({
  560 + keyword: '',
  561 + hiddenClear: true,
  562 + });
  563 + },
  564 +
  565 + close_layer:function (){
  566 + this.setData({
  567 + search_ing:0,
  568 + hiddenClear:1,
  569 + })
  570 + },
  571 +
  572 + //开始搜索
  573 + submitSearch(){
  574 + this.sear_list();
  575 + this.close_layer();
495 576 }
  577 +
496 578 })
497 579 \ No newline at end of file
... ...
packageA/pages/jfbuy/jfbuy.wxml
... ... @@ -23,6 +23,11 @@
23 23 <block wx:for="{{tab}}">
24 24 <view class="title-item {{currentIndex == (index+1) ? 'active' + (isUp?' active1':''):''}}" data-index="{{index+1}}" bindtap="clickTab">{{item}}</view>
25 25 </block>
  26 +
  27 + <view catchtap="show_search" class="flex ai-center" style="height:80rpx; width:80rpx">
  28 + <text class="iconfont icon-search_fd" style="font-size:30rpx; " ></text>
  29 + </view>
  30 +
26 31 </view>
27 32  
28 33 <!-- <view> -->
... ... @@ -69,3 +74,19 @@
69 74  
70 75 </view>
71 76 </view>
  77 +
  78 +<!-- 和搜索相关 -->
  79 +<view wx:if="{{search_ing}}">
  80 + <view class="cover-layer"></view>
  81 + <view class="s_box">
  82 + <view class="s_p_box">
  83 + <view class="input-box">
  84 + <text class="before iconfont icon-search_fd" catchtap="submitSearch"></text>
  85 + <input class="input-search" name="word" placeholder="请输入商品关键字" focus="focus"
  86 + bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}" />
  87 + <text class="iconfont icon-guan" hidden="{{hiddenClear}}" catchtap="clearInput"></text>
  88 + </view>
  89 + <button catchtap="close_layer" style="margin-left:26rpx">取消</button>
  90 + </view>
  91 + </view>
  92 +</view>
72 93 \ No newline at end of file
... ...
packageA/pages/jfbuy/jfbuy.wxss
... ... @@ -63,6 +63,7 @@ page {
63 63 width: 100%;
64 64 top: 0;
65 65 z-index: 3;
  66 + align-items: center;
66 67 }
67 68 .title .iconfont {
68 69 color: #ccc;
... ... @@ -429,4 +430,37 @@ radio .wx-radio-input.wx-radio-input-checked::before{
429 430 margin-left:25rpx;
430 431 margin-right:25rpx;
431 432 margin-top: 30rpx;
432   -}
433 433 \ No newline at end of file
  434 +}
  435 +
  436 +
  437 +/*-- 搜索相关 --*/
  438 +.s_box{ position: fixed;top:0;left: 0;background-color: #fff; width: 100%; z-index: 111111}
  439 +.s_p_box{
  440 + padding:30rpx 40rpx;display: flex; align-items: center;
  441 +}
  442 +.input-box {
  443 + position: relative;
  444 + flex: 1;
  445 + padding-left: 30rpx;
  446 + padding-right: 70rpx;
  447 + background-color: #f0f0f0;
  448 + display: flex;
  449 + align-items: center;
  450 +}
  451 +
  452 +.input-search {
  453 + position: relative;
  454 + padding: 10rpx;
  455 + ont-size: 28rpx;
  456 + width: 100%;
  457 +}
  458 +
  459 +.icon-guan {
  460 + font-size: 20rpx;
  461 + padding: 10rpx;
  462 + position: absolute;
  463 + right: 20rpx;
  464 + top: 50%;
  465 + transform: translateY(-50%);
  466 +}
  467 +
... ...
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
... ...