初始化万家商超用户端仓库

This commit is contained in:
wangxiaowei
2025-04-30 14:04:34 +08:00
commit 022c640d89
425 changed files with 160005 additions and 0 deletions

View File

@ -0,0 +1,376 @@
<template>
<view class="page" :style="themeColor">
<view class="flex flex-direction align-stretch justify-between benben-position-layout flex searchPage_flex_0"
:style="{height:CustomBarRpx+'rpx',paddingTop:StatusBarRpx+'rpx', paddingRight :capsuleWidth + 'px'}">
<view class='flex flex-wrap align-center justify-between searchPage_fd0_0'>
<text class='fu-iconfont2 searchPage_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
data-url="1">&#xE794;</text>
<view class='flex flex-wrap align-center flex-sub searchPage_fd0_0_c1'>
<image class='searchPage_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"53.png"'></image>
<input class='flex-sub searchPage_fd0_0_c1_c1' type="text" focus="true" placeholder="请输入关键字" confirm-type="done"
:maxlength="-1" placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" v-model="keyword" />
</view>
<text class='searchPage_fd0_0_c2' @tap.stop="handleSearch" data-type="navigateTo"
:data-url="`/pages/dpxq/searchResult/searchResult`">搜索</text>
</view>
</view>
<view :style="{height: CustomBarRpx+'rpx'}"></view>
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searchPage_flex_1">
<view class='flex flex-wrap align-center justify-between searchPage_fd1_0'>
<view class='flex flex-wrap align-center'>
<image class='searchPage_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"57.png"'></image>
<text class='searchPage_fd1_0_c0_c1'>搜索历史</text>
</view>
<image class='searchPage_fd1_0_c1' :src='STATIC_URL+"58.png"' @tap.stop="handleDelete"></image>
</view>
<view class="flex align-center padding-lr" v-if="!historyList.length">暂无历史搜索</view>
<view class='flex flex-wrap align-center'>
<view class='flex flex-wrap align-center searchPage_fd1_1_c0' v-for="(item, index) in historyList" :key="index" @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/dpxq/searchResult/searchResult?keyword=${item.title}&id=${sid}`">
<text class='searchPage_fd1_1_c0_c0'>{{item.title}}</text>
<!-- <image class='searchPage_fd1_1_c0_c1' :src='STATIC_URL+"60.png"' @tap.stop="deleteSearchFunc()"></image> -->
</view>
</view>
<view class='flex flex-wrap align-center justify-between searchPage_fd1_2'>
<view class='flex flex-wrap align-center'>
<image class='searchPage_fd1_2_c0_c0' mode="aspectFit" :src='STATIC_URL+"59.png"'></image>
<text class='searchPage_fd1_2_c0_c1'>热门搜索</text>
</view>
</view>
<view class="flex align-center padding-lr" v-if="!hotList.length">暂无热门搜索</view>
<view class='flex flex-wrap align-center searchPage_fd1_3'>
<view class='flex flex-wrap align-center searchPage_fd1_3_c0' v-for="(item, index) in hotList" :key="index" @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/dpxq/searchResult/searchResult?keyword=${item.title}&id=${sid}`">
<text class='searchPage_fd1_3_c0_c0'>{{item.title}}</text>
<!-- <image class='searchPage_fd1_3_c0_c1' :src='STATIC_URL+"60.png"' @tap.stop="deleteSearchFunc()"></image> -->
</view>
</view>
</view>
<!---flex布局flex布局结束-->
<benben-popup v-model="popupShow1681282077687" :mask="true" mode='center'>
<!---删除历史记录flex布局开始-->
<view class="flex flex-direction flex-wrap align-center searchPage_flex_2">
<text class='searchPage_fd2_0'>确定删除历史记录</text>
<view class='flex flex-wrap align-center searchPage_fd2_1'>
<button class='searchPage_fd2_1_c0' @tap.stop="popupShow1681282077687=false">取消</button>
<button class='searchPage_fd2_1_c1' @tap.stop="clearSearchFunc()">确定</button>
</view>
</view>
<!---删除历史记录flex布局结束-->
</benben-popup>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
"popupShow1681282077687": false,
"keyword": "",
"length": "1",
historyList: [],
hotList: [],
sid: ''
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
appSearchHistory() { // 搜索历史
return this.$store.state.appSearchHistory
}
},
watch: {},
onLoad(options) {
this.sid = options.id || '';
},
onUnload() {
},
onReady() {
},
onShow() {
this.getSearchHistory();
this.getHotSearch();
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
},
onReachBottom(e) {
},
onPageScroll(e) {
},
methods: {
handleSearch() {
if (this.keyword.trim() == '') return this.$message.info('请输入搜索内容');
uni.navigateTo({
url: `/pages/dpxq/searchResult/searchResult?keyword=${this.keyword}&id=${this.sid}`
})
},
handleDelete() {
if (!this.historyList.length) return this.$message.info('暂无历史搜索记录');
this.$util.showModal({
title:'提示',
content: '确定删除历史记录?',
success: res => {
if (res.confirm) {
this.$api.post(global.apiUrls.postDelSearch).then(res => {
let data = res.data;
this.$message.info(data.msg);
if (data.code == 1) {
this.getSearchHistory();
}
})
.catch(err => {
console.log('err: ' + JSON.stringify(err));
});
}
}
});
},
getHotSearch() {
this.$api.post(global.apiUrls.getHotSearch).then(res => {
if (res.data.code == 1) {
this.hotList = res.data.data;
}
})
.catch(err => {
console.log(err);
});
},
getSearchHistory() {
this.$api.post(global.apiUrls.getSearchHistory).then(res => {
if (res.data.code == 1) {
this.historyList = res.data.data;
}
})
.catch(err => {
console.log(err);
});
},
//删除搜索记录
deleteSearchFunc(name) {
this.$store.commit('appSearchHistoryDel', {
"name": name
})
},
//清空搜索记录
clearSearchFunc() {
this.$store.commit('appSearchHistoryClean', '')
this.popupShow1681282077687 = false;
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: rgba(255, 255, 255, 1);
background-size: 100% auto !important;
}
.searchPage_flex_0 {
background: #fff;
width: 750rpx;
height: 88rpx;
overflow: hidden;
z-index: 10;
top: 0rpx;
background-size: #eee;
}
.searchPage_fd0_0_c2 {
font-size: 32rpx;
font-weight: 400;
color: #333333;
margin: 0rpx 0rpx 0rpx 32rpx;
line-height: 32rpx;
}
.searchPage_fd0_0_c1_c1 {
font-size: 24rpx;
font-weight: 400;
color: #333;
}
.searchPage_fd0_0_c1_c0 {
width: 28rpx;
height: 28rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 16rpx 0rpx 0rpx;
}
.searchPage_fd0_0_c1 {
background: rgba(246, 247, 249, 1);
height: 64rpx;
background-size: 100% auto !important;
border-radius: 34rpx 34rpx 34rpx 34rpx;
padding: 12rpx 24rpx 12rpx 24rpx;
font-size: 28rpx;
font-weight: 400;
color: #333;
}
.searchPage_fd0_0_c0 {
font-size: 36rpx;
font-weight: 500;
color: #333;
margin: 0rpx 16rpx 0rpx 0rpx;
}
.searchPage_fd0_0 {
padding: 0rpx 24rpx 0rpx 24rpx;
line-height: 88rpx;
}
.searchPage_flex_1 {
padding: 32rpx 32rpx 32rpx 32rpx;
}
.searchPage_fd1_3_c0_c1 {
width: 16rpx;
height: 16rpx;
margin: 0rpx 0rpx 0rpx 16rpx;
}
.searchPage_fd1_3_c0_c0 {
line-height: 34rpx;
font-size: 24rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.searchPage_fd1_3_c0 {
background: rgba(246, 247, 249, 1);
height: 56rpx;
border-radius: 32rpx 32rpx 32rpx 32rpx;
padding: 0rpx 32rpx 0rpx 32rpx;
margin: 12rpx 12rpx 12rpx 12rpx;
}
.searchPage_fd1_3 {
margin: 0rpx 0rpx rpx 0rpx;
}
.searchPage_fd1_2_c0_c1 {
color: #333333;
font-size: 32rpx;
font-weight: 600;
line-height: 40rpx;
}
.searchPage_fd1_2_c0_c0 {
width: 28rpx;
height: 28rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 16rpx 0rpx 0rpx;
}
.searchPage_fd1_2 {
margin: 64rpx 0rpx 23rpx 0rpx;
}
.searchPage_fd1_1_c0_c1 {
width: 16rpx;
height: 16rpx;
margin: 0rpx 0rpx 0rpx 16rpx;
}
.searchPage_fd1_1_c0_c0 {
line-height: 34rpx;
font-size: 24rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.searchPage_fd1_1_c0 {
background: rgba(246, 247, 249, 1);
height: 56rpx;
border-radius: 32rpx 32rpx 32rpx 32rpx;
padding: 0rpx 32rpx 0rpx 32rpx;
margin: 12rpx 12rpx 12rpx 12rpx;
}
.searchPage_fd1_0_c1 {
width: 32rpx;
height: 32rpx;
}
.searchPage_fd1_0_c0_c1 {
color: #333333;
font-size: 32rpx;
font-weight: 600;
line-height: 40rpx;
}
.searchPage_fd1_0_c0_c0 {
width: 28rpx;
height: 28rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 16rpx 0rpx 0rpx;
}
.searchPage_fd1_0 {
margin: 0rpx 0rpx 23rpx 0rpx;
}
.searchPage_flex_2 {
background: #fff;
margin: 0rpx 105rpx 0rpx 105rpx;
background-size: #eee;
border-radius: 25rpx 25rpx 25rpx 25rpx;
}
.searchPage_fd2_1_c1 {
background: transparent;
line-height: 45rpx;
border-radius: 0rpx 0rpx 16rpx 0rpx;
font-size: 32rpx;
color: rgba(255, 147, 0, 1);
padding: 24rpx 103rpx 24rpx 99rpx;
}
.searchPage_fd2_1_c0 {
border-right: 1px solid #EEEEEE;
background: transparent;
line-height: 45rpx;
border-radius: 0rpx 0rpx 0rpx 16rpx;
font-size: 32rpx;
color: rgba(153, 153, 153, 1);
padding: 24rpx 103rpx 24rpx 103rpx;
}
.searchPage_fd2_1 {
border-top: 1px solid #eee;
}
.searchPage_fd2_0 {
font-size: 32rpx;
font-weight: 400;
line-height: 52rpx;
color: #333333;
margin: 56rpx 0rpx 64rpx 0rpx;
}
</style>

View File

@ -0,0 +1,237 @@
<template>
<view class="page" :style="themeColor">
<view class="flex flex-direction align-stretch justify-between benben-position-layout flex searchWithin_flex_0" :style="{height:(110+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between searchWithin_fd0_0' >
<text class='fu-iconfont2 searchWithin_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1" >&#xE794;</text>
<view class='flex flex-wrap align-center flex-sub searchWithin_fd0_0_c1' >
<image class='searchWithin_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"53.png"'></image>
<input class='flex-sub searchWithin_fd0_0_c1_c1' type="text" placeholder="请输入关键字" confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" @confirm="searchForFunc()" v-model="keywords" />
</view>
<text class='searchWithin_fd0_0_c2' @tap.stop="searchForFunc()" >搜索</text>
</view>
</view>
<view :style="{height: (110+StatusBarRpx)+'rpx'}" ></view>
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searchWithin_flex_1" >
<view class='flex flex-wrap align-center justify-between searchWithin_fd1_0' >
<view class='flex flex-wrap align-center' >
<image class='searchWithin_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"57.png"'></image>
<text class='searchWithin_fd1_0_c0_c1' >搜索历史</text>
</view>
<image class='searchWithin_fd1_0_c1' :src='STATIC_URL+"58.png"' @tap.stop="popupShow1681282077687=true" ></image>
</view>
<view class='flex flex-wrap align-center searchWithin_fd1_1' v-if= "appSearchHistory.length=='0'" >
<text class='searchWithin_fd1_1_c0' >暂无历史搜索</text>
</view>
<view class='flex flex-wrap align-center' v-if= "length.split(',')>'0'" >
<template v-for = '(item,key0) in appSearchHistory'>
<view class='flex flex-wrap align-center searchWithin_fd1_2_c0' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dpxq/searchResult/searchResult?input=${item.name}`" :key='key0'>
<text class='searchWithin_fd1_2_c0_c0' >{{item.name}}</text>
<image class='searchWithin_fd1_2_c0_c1' :src='STATIC_URL+"60.png"' @tap.stop="deleteSearchFunc(item.name)" ></image>
</view>
</template>
</view>
<view class='flex flex-wrap align-center justify-between searchWithin_fd1_3' >
<view class='flex flex-wrap align-center' >
<image class='searchWithin_fd1_3_c0_c0' mode="aspectFit" :src='STATIC_URL+"59.png"'></image>
<text class='searchWithin_fd1_3_c0_c1' >热门搜索</text>
</view>
</view>
<view class='flex flex-wrap align-center searchWithin_fd1_4' v-if= "length.split(',')>'0'" >
<view class='flex flex-wrap align-center searchWithin_fd1_4_c0' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dpxq/searchResult/searchResult`" >
<text class='searchWithin_fd1_4_c0_c0' >蓝牙耳机</text>
<image class='searchWithin_fd1_4_c0_c1' :src='STATIC_URL+"60.png"' @tap.stop="deleteSearchFunc()" ></image>
</view>
</view>
</view>
<!---flex布局flex布局结束-->
<benben-popup v-model="popupShow1681282077687" :mask="true" mode='center'>
<!---删除历史记录flex布局开始-->
<view class="flex flex-direction flex-wrap align-center searchWithin_flex_2" >
<text class='searchWithin_fd2_0' >确定删除历史记录?</text>
<view class='flex flex-wrap align-center searchWithin_fd2_1' >
<button class='searchWithin_fd2_1_c0' @tap.stop="popupShow1681282077687=false" >取消</button>
<button class='searchWithin_fd2_1_c1' @tap.stop="clearSearchFunc()" >确定</button>
</view>
</view>
<!---删除历史记录flex布局结束-->
</benben-popup>
</view>
</template>
<script>
export default {
components:{},
data(){
return {"popupShow1681282077687":false,"keywords":"","length":"1","hository_length":["小笼包","煎饼果子","黄焖鸡米饭","汉堡"],"input_content":""};
},
computed:{
themeColor() {
return this.$store.getters.themeColor
},
appSearchHistory() {// 搜索历史
return this.$store.state.appSearchHistory
}
},
watch:{},
onLoad(options){
},
onUnload() {
},
onReady(){
},
onShow(){
},
onHide(){
},
onResize(){
},
onPullDownRefresh(){
},
onReachBottom(e){
},
onPageScroll(e){
},
methods:{
//删除搜索记录
deleteSearchFunc(name){
this.$store.commit('appSearchHistoryDel',{"name":name})
},
//清空搜索记录
clearSearchFunc(){
this.$store.commit('appSearchHistoryClean','')
this.popupShow1681282077687 = false;
},
//跳转
jumpResultFunc(){
this.$store.commit('appSearchHistoryAdd',{"name":this.keywords})
},
//添加搜索记录
addSearchRecordFunc(){
this.$store.commit('appSearchHistoryAdd',{"name":this.keywords})
},
//搜索
searchForFunc(){
if( this.keywords==''){
this.$message.info('请输入要搜索的商品');
}
else if( this.keywords!=''){
this.$urouter.navigateTo(`/pages/dpxq/searchResult/searchResult?input=${this.input_content}`);
}
}
}
};
</script>
<style lang="scss" scoped>
.page{
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background:rgba(255, 255, 255, 1);background-size: 100% auto !important;
}
.searchWithin_flex_0{
background:#fff;width:750rpx;height:110rpx;overflow:hidden;z-index:10;top:0rpx;background-size:#eee;
}
.searchWithin_fd0_0_c2{
font-size:32rpx;font-weight:400;color:#333333;margin:0rpx 0rpx 0rpx 32rpx;line-height:32rpx;
}
.searchWithin_fd0_0_c1_c1{
font-size:24rpx;font-weight:400;color:#333;
}
.searchWithin_fd0_0_c1_c0{
width:28rpx;height:28rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 16rpx 0rpx 0rpx;
}
.searchWithin_fd0_0_c1{
background:rgba(246, 247, 249, 1);height:64rpx;background-size:100% auto !important;border-radius:34rpx 34rpx 34rpx 34rpx;padding:12rpx 24rpx 12rpx 24rpx;font-size:28rpx;font-weight:400;color:#333;
}
.searchWithin_fd0_0_c0{
font-size:36rpx;font-weight:500;color:#333;margin:0rpx 16rpx 0rpx 0rpx;
}
.searchWithin_fd0_0{
padding:0rpx 32rpx 0rpx 32rpx;line-height:110rpx;
}
.searchWithin_flex_1{
padding:32rpx 32rpx 32rpx 32rpx;
}
.searchWithin_fd1_4_c0_c1{
width:16rpx;height:16rpx;margin:0rpx 0rpx 0rpx 16rpx;
}
.searchWithin_fd1_4_c0_c0{
line-height:34rpx;font-size:24rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.searchWithin_fd1_4_c0{
background:rgba(246, 247, 249, 1);height:56rpx;border-radius:32rpx 32rpx 32rpx 32rpx;padding:0rpx 32rpx 0rpx 32rpx;margin:12rpx 12rpx 12rpx 12rpx;
}
.searchWithin_fd1_4{
margin:0rpx 0rpx rpx 0rpx;
}
.searchWithin_fd1_3_c0_c1{
color:#333333;font-size:32rpx;font-weight:600;line-height:40rpx;
}
.searchWithin_fd1_3_c0_c0{
width:28rpx;height:28rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 16rpx 0rpx 0rpx;
}
.searchWithin_fd1_3{
margin:64rpx 0rpx 23rpx 0rpx;
}
.searchWithin_fd1_2_c0_c1{
width:16rpx;height:16rpx;margin:0rpx 0rpx 0rpx 16rpx;
}
.searchWithin_fd1_2_c0_c0{
line-height:34rpx;font-size:24rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.searchWithin_fd1_2_c0{
background:rgba(246, 247, 249, 1);height:56rpx;border-radius:32rpx 32rpx 32rpx 32rpx;padding:0rpx 32rpx 0rpx 32rpx;margin:12rpx 12rpx 12rpx 12rpx;
}
.searchWithin_fd1_1_c0{
color:#BFBFBF;font-size:28rpx;font-weight:400;line-height:30rpx;
}
.searchWithin_fd1_1{
margin:0rpx 0rpx 23rpx 0rpx;
}
.searchWithin_fd1_0_c1{
width:32rpx;height:32rpx;
}
.searchWithin_fd1_0_c0_c1{
color:#333333;font-size:32rpx;font-weight:600;line-height:40rpx;
}
.searchWithin_fd1_0_c0_c0{
width:28rpx;height:28rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 16rpx 0rpx 0rpx;
}
.searchWithin_fd1_0{
margin:0rpx 0rpx 23rpx 0rpx;
}
.searchWithin_flex_2{
background:#fff;margin:0rpx 105rpx 0rpx 105rpx;background-size:#eee;border-radius:25rpx 25rpx 25rpx 25rpx;
}
.searchWithin_fd2_1_c1{
background:transparent;line-height:45rpx;border-radius:0rpx 0rpx 16rpx 0rpx;font-size:32rpx;color:rgba(255, 147, 0, 1);padding:24rpx 103rpx 24rpx 99rpx;
}
.searchWithin_fd2_1_c0{
border-right:1px solid #EEEEEE;background:transparent;line-height:45rpx;border-radius:0rpx 0rpx 0rpx 16rpx;font-size:32rpx;color:rgba(153, 153, 153, 1);padding:24rpx 103rpx 24rpx 103rpx;
}
.searchWithin_fd2_1{
border-top:1px solid #eee;
}
.searchWithin_fd2_0{
font-size:32rpx;font-weight:400;line-height:52rpx;color:#333333;margin:56rpx 0rpx 64rpx 0rpx;
}
</style>