Commit 0001f32a by 李伟康

修复BUG&删除无用

1 parent 28e9f55f
@import "assets/style/common.wxss"; @import "assets/style/common.wxss";
page { page {
background-color: #F7F7F7; background-color: #F9F7F7;
color: #282829; color: #282829;
font-size: 28rpx; font-size: 28rpx;
--themeColor: #8A303A; --themeColor: #8A303A;
......
// components/SearchBox/SearchBox.js
import {componentsMixin } from '../../mixins/index';
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
placeholder: {
type: String,
value: "请输入搜索内容",
},
value: {
type: String,
value: "",
observer(n) {
this.setData({
inputValue: n,
});
},
},
searchType: {
type: Number,
value: 1,
},
couponDetails: Boolean,
},
/**
* 组件的初始数据
*/
data: {
inputValue: "",
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail;
this.setData({
inputValue: value,
});
},
blur(e) {
let { inputValue } = this.data;
this.setData({
inputValue,
});
},
clear() {
this.setData({
inputValue: "",
});
},
confirm(e) {
let { value } = e.detail;
this.triggerEvent("search", value);
},
search(e) {
let { value } = e.currentTarget.dataset;
this.triggerEvent("search", value);
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="search-box box-center">
<view class="search type-{{searchType}}">
<view class="input-box" style="{{couponDetails?'width: 528rpx;':''}}">
<view class="icon box-center">
<icon type="search" size="20"></icon>
</view>
<input type="text" bindinput="input" bindblur="blur" value="{{inputValue}}" placeholder-class="input-placeholder" placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" />
<block wx:if="{{inputValue}}">
<view class="clear-box" bindtap="clear">
<icon type="clear" size="20" class="icon"></icon>
</view>
</block>
</view>
<view class="button box-center" bindtap="search" data-value="{{inputValue}}">搜索</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/SearchBox/SearchBox.wxss */
@import '/sprite.wxss';
.search-box {
height: 104rpx;
box-sizing: border-box;
padding: 0 var(--margin);
background-color: #fff;
}
.box-center {
display: flex;
align-items: center;
justify-content: center;
}
.search {
width: 100%;
height: 72rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.type-1 {
padding: 0 6rpx;
border-radius: 38px;
border: 3rpx solid var(--btnColor);
}
.type-1 .button {
width: 104rpx;
height: 60rpx;
border-radius: 38rpx;
background-color: var(--btnColor);
color: #fff;
font-size: var(--margin);
}
.type-1 .input-box {
width: calc(100% - 110rpx);
display: flex;
align-items: center;
}
.input-box .icon {
width: 58rpx;
}
.type-1 .input-box .input,
.type-2 .input-box .input {
width: calc(100% - 130rpx);
font-size: 28rpx;
}
.input-box .clear-box{
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.input-box .clear-box .icon-clear{
opacity: .7;
}
.type-2 .input-box {
display: flex;
align-items: center;
width: 592rpx;
height: 100%;
background: #F8F8F8;
border-radius: 38rpx;
}
.type-2 .button {
color: #656566;
font-size: var(--margin);
}
.input-placeholder {
color: #CFCFCF;
font-size: 28rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -17,11 +17,12 @@ Component({ ...@@ -17,11 +17,12 @@ Component({
observer: async function (url, o) { observer: async function (url, o) {
if (url) { if (url) {
let isWebp = url.includes('webp') let isWebp = url.includes('webp')
let checkList = ['https://', 'http://', 'data:image'] let checkList = ['https://', 'http://']
let isFullAdd = checkList.map(item => url.includes(item)).some(item => item) let isFullAdd = checkList.map(item => url.includes(item)).some(item => item)
let isBASE64 = url.includes('data:image')
this.setData({ this.setData({
isWebp, isWebp,
imagePath: `${isFullAdd ? '' : IMG_URL}${url}` + (isFullAdd ? '' : `?v=${await systemApi.getImageVersion()}`) imagePath: `${isFullAdd || isBASE64 ? '' : IMG_URL}${url}` + (isBASE64 ? '' : `?v=${await systemApi.getImageVersion()}`)
}) })
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* pages/tab/equity/equity.wxss */ /* pages/tab/equity/equity.wxss */
page { page {
background: white; background: #F9F7F7;
} }
.equity-container { .equity-container {
......
...@@ -10,12 +10,7 @@ Component({ ...@@ -10,12 +10,7 @@ Component({
}, },
value: { value: {
type: String, type: String,
value: '', value: ''
observer(n) {
this.setData({
inputValue: n
})
}
}, },
searchType: { searchType: {
type: Number, type: Number,
...@@ -27,7 +22,6 @@ Component({ ...@@ -27,7 +22,6 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
inputValue: ''
}, },
/** /**
...@@ -39,18 +33,18 @@ Component({ ...@@ -39,18 +33,18 @@ Component({
value value
} = e.detail } = e.detail
this.setData({ this.setData({
inputValue:value value
}) })
}, },
blur(e){ blur(e){
let {inputValue} = this.data let {value} = this.data
this.setData({ this.setData({
inputValue value
}) })
}, },
clear() { clear() {
this.setData({ this.setData({
inputValue: '' value: ''
}) })
}, },
confirm(e) { confirm(e) {
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<view class="icon box-center"> <view class="icon box-center">
<icon type="search" size="20"></icon> <icon type="search" size="20"></icon>
</view> </view>
<input type="text" bindinput="input" bindblur="blur" value="{{inputValue}}" placeholder-class="input-placeholder" <input type="text" bindinput="input" bindblur="blur" value="{{value}}" placeholder-class="input-placeholder"
placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" /> placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" />
<block wx:if="{{inputValue}}"> <block wx:if="{{value}}">
<view class="clear-box" bindtap="clear"> <view class="clear-box" bindtap="clear">
<icon type="clear" size="20" class="icon"></icon> <icon type="clear" size="20" class="icon"></icon>
</view> </view>
</block> </block>
</view> </view>
<view class="button box-center" bindtap="search" data-value="{{inputValue}}">搜索</view> <view class="button box-center" bindtap="search" data-value="{{value}}">搜索</view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
width: 78.67%; width: 78.67%;
height: 100%; height: 100%;
position: relative; position: relative;
background: #fff; background: #F9F7F7;
} }
.tab-item { .tab-item {
......
...@@ -25,7 +25,11 @@ Page({ ...@@ -25,7 +25,11 @@ Page({
} = this.data } = this.data
wx.p.router.go('/packageMall/pages/search/search', { wx.p.router.go('/packageMall/pages/search/search', {
value, value,
goodsList goodsList,
notIntercept: true
})
this.setData({
searchVal:''
}) })
}, },
/** /**
...@@ -186,16 +190,6 @@ Page({ ...@@ -186,16 +190,6 @@ Page({
}) })
this.changeData(index) this.changeData(index)
}, },
search(e) {
let value = e.detail
let {
goodsList
} = this.data
wx.p.router.go('/packageMall/pages/search/search', {
value,
goodsList
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
.tab-view-box { .tab-view-box {
padding: 16rpx var(--margin); padding: 16rpx var(--margin);
} }
.tab-view-box .box{
animation: show-box-opacity .25s forwards;
}
.tab-view-box .banner { .tab-view-box .banner {
height: 220rpx; height: 220rpx;
border-radius: 8rpx; border-radius: 8rpx;
......
<navigation-bar bindnavbarReady="navbarReady">商城</navigation-bar> <navigation-bar bindnavbarReady="navbarReady">商城</navigation-bar>
<view class="mall-layout" style="margin-top: {{navHeight}}px;"> <view class="mall-layout" style="margin-top: {{navHeight}}px;">
<search-box search-type="2" bindsearch="search"></search-box> <search-box search-type="2" bindsearch="search" model:value="{{searchVal}}"></search-box>
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<block wx:if="{{tabList.length}}"> <block wx:if="{{tabList.length}}">
<tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{52 + navHeight}}" bindclick="tabclick"> <tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{52 + navHeight}}" bindclick="tabclick">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!