This commit is contained in:
2026-04-14 17:38:46 +08:00
commit b71e6d6bae
2848 changed files with 237896 additions and 0 deletions

View File

@ -0,0 +1 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods_search/goods_search"],{3604:function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("3712");o(n("3240"));var i=o(n("76d9"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"4c52":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var o={uSearch:function(){return n.e("components/uview-ui/components/u-search/u-search").then(n.bind(null,"79b4"))},sortNav:function(){return n.e("components/sort-nav/sort-nav").then(n.bind(null,"c8b5"))},mescrollUni:function(){return Promise.all([n.e("common/vendor"),n.e("components/mescroll-uni/mescroll-uni")]).then(n.bind(null,"8293"))},goodsList:function(){return n.e("components/goods-list/goods-list").then(n.bind(null,"877a"))}},i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.hotList.length),o=t.historyList.length;t._isMounted||(t.e0=function(e){t.showHistory=!0}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:o}})},r=[]},"6e5e":function(t,e,n){},"76d9":function(t,e,n){"use strict";n.r(e);var o=n("4c52"),i=n("9cd4");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("e885");var s=n("828b"),c=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=c.exports},"9cd4":function(t,e,n){"use strict";n.r(e);var o=n("e13d"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},e13d:function(t,e,n){"use strict";(function(t){var o=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n("7ca3")),r=n("c2cb"),s=n("8f59"),c=n("f4fb"),a=n("0aec"),u=o(n("8462"));function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}var f={mixins:[u.default],data:function(){return{upOption:{auto:!1,empty:{icon:"/static/images/goods_null.png",tip:"暂无商品"}},keyword:"",status:c.loadingType.LOADING,page:1,sortConfig:{goodsType:"double",priceSort:"",saleSort:""},goodsList:[],showHistory:!1,hotList:[],historyList:[]}},watch:{keyword:function(t,e){t||this.id||(this.showHistory=!0)},showHistory:function(t){t&&this.getSearchpageFun()},"sortConfig.saleSort":function(){this.onSearch()},"sortConfig.priceSort":function(){this.onSearch()}},onLoad:function(t){this.onSearch=(0,a.trottle)(this.onSearch,500,this),this.init(t)},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){(0,i.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,s.mapGetters)(["sysInfo"])),methods:{downCallback:function(){this.onRefresh()},upCallback:function(t){var e=this,n=t.num,o=t.size,i=(this.goodsList,this.keyword),s=this.sortConfig,c=s.priceSort,a=s.saleSort,u={page_size:o,page_no:n,platform_cate_id:1==this.type?this.id:"",brand_id:0==this.type?this.id:"",keyword:i,sort_by_price:c,sort_by_sales:a};(0,r.getGoodsList)(u).then((function(n){var o=n.data;1==t.num&&(e.goodsList=[]);var i=o.lists,r=i.length,s=!!o.more;e.goodsList=e.goodsList.concat(i),e.mescroll.endSuccess(r,s)})).catch((function(){e.mescroll.endErr()}))},onChange:function(t){this.keyword=t.value},clearSearchFun:function(){var t=this;(0,r.clearSearch)().then((function(e){1==e.code&&t.getSearchpageFun()}))},init:function(e){var n=this,o=this.$Route.query,i=o.id,r=o.name,s=o.type;this.type=s,i?(t.setNavigationBarTitle({title:r}),this.id=i,this.$nextTick((function(){n.onRefresh()}))):(t.setNavigationBarTitle({title:"商品搜索"}),this.showHistory=!0)},getSearchpageFun:function(){var t=this;(0,r.getSearchpage)().then((function(e){if(1==e.code){var n=e.data,o=n.history_lists,i=n.hot_lists;t.hotList=i,t.historyList=o}}))},onClear:function(){this.id&&this.onRefresh()},onSearch:function(){var t=this;this.showHistory=!1,this.$nextTick((function(){t.onRefresh()}))},onRefresh:function(){this.goodsList=[],this.mescroll.resetUpScroll()},onChangeKeyword:function(t){this.keyword=t,this.showHistory=!1,this.onRefresh()}}};e.default=f}).call(this,n("df3c")["default"])},e885:function(t,e,n){"use strict";var o=n("6e5e"),i=n.n(o);i.a}},[["3604","common/runtime","common/vendor"]]]);

View File

@ -0,0 +1,10 @@
{
"navigationBarTitleText": "商品搜索",
"disableScroll": true,
"usingComponents": {
"u-search": "/components/uview-ui/components/u-search/u-search",
"sort-nav": "/components/sort-nav/sort-nav",
"mescroll-uni": "/components/mescroll-uni/mescroll-uni",
"goods-list": "/components/goods-list/goods-list"
}
}

View File

@ -0,0 +1 @@
<view class="goods-search flex-col"><view class="header-wrap"><view class="search"><u-search vue-id="1e7533c0-1" focus="{{showHistory}}" bg-color="#F4F4F4" value="{{keyword}}" data-event-opts="{{[['^focus',[['e0']]],['^search',[['onSearch']]],['^input',[['__set_model',['','keyword','$event',[]]]]]]}}" bind:focus="__e" bind:search="__e" bind:input="__e" bind:__l="__l"></u-search></view><sort-nav bind:input="__e" data-custom-hidden="{{!(!showHistory)}}" vue-id="1e7533c0-2" value="{{sortConfig}}" data-event-opts="{{[['^input',[['__set_model',['','sortConfig','$event',[]]]]]]}}" bind:__l="__l"></sort-nav></view><view hidden="{{!(showHistory)}}" class="search-content bg-white"><scroll-view style="height:100%;" scroll-y="{{true}}"><block wx:if="{{$root.g0}}"><view class="search-words"><view class="title">热门搜索</view><view class="words flex flex-wrap"><block wx:for="{{hotList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['onChangeKeyword',['$0'],[[['hotList','',index]]]]]]]}}" class="item br60 m-r-20 m-b-20 lighter sm line-1" bindtap="__e">{{item}}</view></block></view></view></block><block wx:if="{{$root.g1}}"><view class="search-words"><view class="title flex row-between"><view>历史搜索</view><view data-event-opts="{{[['tap',[['clearSearchFun',['$event']]]]]}}" class="xs muted m-r-20" style="padding:10rpx 20rpx;" bindtap="__e">清空</view></view><view class="words flex flex-wrap"><block wx:for="{{historyList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['onChangeKeyword',['$0'],[[['historyList','',index]]]]]]]}}" class="item br60 m-r-20 m-b-20 lighter sm line-1" bindtap="__e">{{item}}</view></block></view></view></block></scroll-view></view><view class="content"><mescroll-uni class="vue-ref" vue-id="1e7533c0-3" up="{{upOption}}" down="{{({auto:false})}}" fixed="{{false}}" data-ref="mescrollRef" data-event-opts="{{[['^init',[['mescrollInit']]],['^down',[['downCallback']]],['^up',[['upCallback']]]]}}" bind:init="__e" bind:down="__e" bind:up="__e" bind:__l="__l" vue-slots="{{['default']}}"><view class="goods-list"><view hidden="{{!(sortConfig.goodsType=='double')}}" class="double"><goods-list vue-id="{{('1e7533c0-4')+','+('1e7533c0-3')}}" type="double" list="{{goodsList}}" bind:__l="__l"></goods-list></view><view hidden="{{!(sortConfig.goodsType=='one')}}" class="one"><goods-list vue-id="{{('1e7533c0-5')+','+('1e7533c0-3')}}" list="{{goodsList}}" type="one" bind:__l="__l"></goods-list></view></view></mescroll-uni></view></view>

View File

@ -0,0 +1 @@
page{height:100%;padding:0}.goods-search{height:100%;position:relative}.goods-search .header-wrap{position:relative;z-index:999}.goods-search .header-wrap .search{box-shadow:0 3px 6px rgba(0,0,0,.03);position:relative;z-index:1}.goods-search .search-content{position:absolute;width:100%;height:100%;padding-top:100rpx;z-index:100}.goods-search .search-content .search-words{padding-left:24rpx;padding-bottom:20rpx}.goods-search .search-content .search-words .title{padding:26rpx 0}.goods-search .search-content .search-words .words .item{line-height:52rpx;height:52rpx;padding:0 24rpx;background-color:#f5f5f5}.goods-search .content{flex:1;min-height:0}.goods-search .content .goods-list{overflow:hidden}