first commit
This commit is contained in:
1
金壶/appV1/pages/home/.pydio
Normal file
1
金壶/appV1/pages/home/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
a7f637e7-db4f-4ce8-939b-868e505ea49a
|
||||
66
金壶/appV1/pages/home/MessageDetails.vue
Normal file
66
金壶/appV1/pages/home/MessageDetails.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<HeaderTop :page_title='MessageInfo.description'></HeaderTop>
|
||||
<view class="padding-30 message">
|
||||
<h2 class="message__details-title">{{MessageInfo.description}}</h2>
|
||||
<div class="message__details-time">2019-10-07 08:00 浏览量238.0万</div>
|
||||
<div class="message__details-info">
|
||||
<p>
|
||||
梦寐以求的小长假就那么过去了
|
||||
上班的心情总是那么沉重
|
||||
上班第一天
|
||||
刚放完假的你
|
||||
是不是这样的
|
||||
|
||||
不过,值得开心的是
|
||||
晴好天气依旧持续
|
||||
阳光明媚
|
||||
气温也似乎变得放飞自我了
|
||||
预计今天的最高气温会攀升到31℃左右
|
||||
</p>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
MessageInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.MessageInfo = JSON.parse(option.mess_id);
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.message {
|
||||
&__details-title {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 7rpx;
|
||||
}
|
||||
&__details-time {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
&__details-info {
|
||||
font-size: 32rpx;
|
||||
line-height: 50rpx;
|
||||
letter-spacing: 0.8rpx;
|
||||
color: #000000;
|
||||
.p {
|
||||
|
||||
}
|
||||
img {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
502
金壶/appV1/pages/home/home.vue
Normal file
502
金壶/appV1/pages/home/home.vue
Normal file
@@ -0,0 +1,502 @@
|
||||
<template>
|
||||
<!-- 首页 -->
|
||||
<view class="content bg_F2F2F2 w-100 h-100 home">
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
|
||||
<view class="is_top_search x-bg-white h-100 flex-1 margin-zy20">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img"></image>
|
||||
<input type="text" value="" placeholder="请输入药名/厂家" class="search_input h-100" @input="changeInput($event)" v-model="keyword"
|
||||
@click="search" />
|
||||
<!-- <input type="text" value="" placeholder="搜索" class="search_input h-100" @input="changeInput($event)" v-model="keyword" @focus="to_search()" /> -->
|
||||
</view>
|
||||
<image src="../../static/my/message.png" mode="" class="message" @click="to_mes()"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<view class="is_top_search x-bg-white h-100 flex-1" @click="search()">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img"></image>
|
||||
<input type="text" value="" placeholder="搜索" class="search_input h-100" />
|
||||
</view>
|
||||
<image src="../../static/my/message.png" mode="" class="message" @click="toMes()"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="is_content padding-zy30">
|
||||
<view class="banner margin-shu20">
|
||||
|
||||
<swiper :speed='5000' :autoplay="true" :indicator-dots="true" indicator-color="rgba(255, 255, 255, 0.8)"
|
||||
indicator-active-color="#fff" class="h-100 ">
|
||||
<swiper-item v-for="(item,index) in banner" :key="index">
|
||||
<image class="h-100" :src="'https://'+item.app_pic_url" @click="dump(item.app_controller_name)" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="info x_margin0auto">
|
||||
<!-- 专题 -->
|
||||
<view class="x-bg-white is_box d-flex j-around a-center padding-sx30 border_radius20">
|
||||
<view class="" v-for="(item,index) of activity_icons" :key='index' @tap='productList(item)'>
|
||||
<view class="text-center">
|
||||
<image :src="'../../static/home/b'+ index +'.png'" mode="" class='menu_img'></image>
|
||||
</view>
|
||||
<view>{{item.activity_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 广告 文字滚动 -->
|
||||
<view class="margin-shu20 x-bg-white d-flex a-center padding-zy30 border_radius20">
|
||||
<!-- <img class="mr-2" src="../../static/home/laba.png" alt="" style='height:24upx; width:27upx;'> -->
|
||||
<image class="mr-2" src="../../static/home/laba.png" alt="" style='height:24upx; width:27upx;'></image>
|
||||
<!-- v-for="(item,index) of activity" :key='index' -->
|
||||
<swiper autoplay circular :interval="3000" class="tui-swiper">
|
||||
<swiper-item v-for="(item,index) of activity" :key='index' class="tui-swiper-item">
|
||||
<view class="tui-news-item" @tap='detail(item)'>{{item.description}}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="bannerNew margin-shu20">
|
||||
<!-- <image src="../../static/home/bannernew.png" mode="" class="banner_img h-100 w-100"></image> -->
|
||||
<image src="../../static/home/renzheng.jpg" mode="" class="banner_img h-100 w-100" @tap='to_renzheng()'></image>
|
||||
</view>
|
||||
<!-- 新人优惠 -->
|
||||
<view class=" margin-shu20" v-for="(item,index) of activity_self_true" :key="index" v-if='activity_self_true'>
|
||||
<view class="newren margin-shu20 d-flex a-center">
|
||||
<image src="../../static/home/shu.png" mode="" style="height:30upx; width:6upx;"></image>
|
||||
<view class="" style="color: #FB6246; margin:0 15upx 0 15upx;">{{item.activity_name}}</view>
|
||||
</view>
|
||||
<view class=" new_goods">
|
||||
<view class="new_goods_info x-bg-white border_radius20 a-center text-center j-center" v-for="(item2,index2) in item.goods_list.data"
|
||||
:key="index2" @click="openDetail(item2)">
|
||||
<!-- <view class="text-center w-100 margin-shu20" style="height:94upx;">
|
||||
<image :src="'https://'+item2.pc_thumb" class="newren_img h-100 w-100"></image>
|
||||
</view> -->
|
||||
<view class="text-center w-100 margin-shu20" style="height:174upx; background-repeat: no-repeat;" :style="{backgroundImage: 'url(' + 'https://'+item2.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
|
||||
</view>
|
||||
<view class=" text-center some_txt font-weight d-flex a-center textOVerFlow w-100">
|
||||
<image src="../../static/shoppingCart/zheng.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item2.retail_flag==1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item2.retail_flag==0'></image>
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;" v-if='item2.is_limit==1'></image>
|
||||
<view class="textOVerFlow" style="max-width: 72%;">{{item2.goods_name}}</view>
|
||||
</view>
|
||||
<view class="text-center some_txt textOVerFlow">{{item2.manufacturer_name}}</view>
|
||||
<view class="x_text_hui text-center font-20 d-flex j-sb">
|
||||
{{item2.spec_desc}}
|
||||
|
||||
</view>
|
||||
<view class="x-text-159 text-center font-weight font_28 d-flex j-sb">
|
||||
¥{{item2.price}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="d-flex j-sb threetip">
|
||||
<image src="../../static/shoppingCart/fenlan1.jpg" mode="" class='threetip_img'></image>
|
||||
<img src="../../static/shoppingCart/fenlan2.jpg" alt="" class='threetip_img'>
|
||||
<img src="../../static/shoppingCart/fenlan3.jpg" alt="" class='threetip_img'>
|
||||
</view> -->
|
||||
|
||||
<view class="x_list">
|
||||
<view class="list_menu d-flex j-around margin-shu20">
|
||||
<view class="newren" v-for="(item,index) of activity_self_false" :key='index' @click="to_chooseThree(index)" :class='{three_active:index==three_index}'>{{item.activity_name}}</view>
|
||||
</view>
|
||||
<view class="list_box">
|
||||
<view class="d-flex j-sb the_lastGoods">
|
||||
<view class="the_lastGoods_item padding-30 x-bg-white" style="margin-bottom: 15upx;" v-for="(item,index) of goods_list"
|
||||
:key="index" @click="openDetail(item)">
|
||||
<!-- <view class="last_img">
|
||||
<img :src="'https://'+item.pc_thumb" alt="" class='h-100 w-100'>
|
||||
</view> -->
|
||||
<view class="last_img" :style="{backgroundImage: 'url(' + 'https://'+item.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
|
||||
</view>
|
||||
|
||||
<view class="font-weight font_26 dian d-flex a-center">
|
||||
<image src="../../static/shoppingCart/zheng.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item.retail_flag==1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item.retail_flag==0'></image>
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;margin-right:15upx;" v-if='item.is_limit==1'></image>
|
||||
{{item.goods_name}}
|
||||
</view>
|
||||
<view class="x_text_hui zhuyi_title dian">{{item.manufacturer_name}}</view>
|
||||
<view class="x_text_hui text-center font-20 d-flex j-sb">
|
||||
{{item.spec_desc}}
|
||||
|
||||
</view>
|
||||
<view class="x-text-159 text-center font-weight font_28 d-flex j-sb">
|
||||
¥{{item.price}}
|
||||
|
||||
</view>
|
||||
<!-- <view class="dian">{{item.spec_desc}}</view>
|
||||
<view class="d-flex j-sb x_price">
|
||||
<view class="x-text-159 font-weight font_28">{{item.price}}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<uni-popup ref="showimage" type="center" :mask-click="true">
|
||||
<view class="uni-image advertisement">
|
||||
<image class="advertisement__image" src="https://img14.360buyimg.com/mcoss/jfs/t1/116140/21/8057/91328/5ec77230E4e8381be/60b7c090733c5ebb.gif" mode="scaleToFill" />
|
||||
<view class="uni-image-close" @click="cancelAdvertisement()">
|
||||
<uni-icons type="clear" color="#fff" size="30" />
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
<!-- <TabBar page_title=''></TabBar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_index from '../../utils/models/index.js';
|
||||
import uniNoticeBar from '../../components/components/uni-notice-bar/uni-notice-bar.vue'
|
||||
import TabBar from '../../common/tabBar/tabBar.vue'
|
||||
import uniPopup from '../../components/uni-popup/uni-popup.vue'
|
||||
// import {Config} from '@/utils/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
the_show: true,
|
||||
banner: [], //轮播图
|
||||
activity: [], //消息
|
||||
activity_icons: [],
|
||||
activity_self_true: [],
|
||||
activity_goods_list: '',
|
||||
activity_self_false: [],
|
||||
activity_self_false_index: 0,
|
||||
three_index: 0,
|
||||
goods_list: [], //商品列表
|
||||
the_Authentication: '', // 缓存里面的token 有值代表是登录状态,没值代表用户没有登陆
|
||||
limit: 6,
|
||||
page: 1,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
uniNoticeBar,
|
||||
TabBar,
|
||||
uniPopup
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
this.loading = false
|
||||
this.getData()
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.showimage.open()
|
||||
},
|
||||
methods: {
|
||||
// 关闭开屏弹窗
|
||||
cancelAdvertisement() {
|
||||
this.$refs.showimage.close()
|
||||
},
|
||||
// 去认证
|
||||
to_renzheng(){
|
||||
uni.navigateTo({
|
||||
url: '../auth/is_Authentication'
|
||||
})
|
||||
},
|
||||
//to_search
|
||||
to_search() {
|
||||
|
||||
uni.navigateTo({
|
||||
url: './search'
|
||||
})
|
||||
},
|
||||
// 进入消息页面
|
||||
dump(url) {
|
||||
if (url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
},
|
||||
// 进入消息页面
|
||||
|
||||
to_mes() {
|
||||
uni.navigateTo({
|
||||
url: '../my/is_message'
|
||||
})
|
||||
},
|
||||
// tab转换商品
|
||||
async to_chooseThree(index) {
|
||||
|
||||
this.activity_self_false_index = index
|
||||
this.the_show = false
|
||||
this.three_index = index;
|
||||
let res = await X_index.x_activity(this.activity_self_false[this.three_index].id, this.limit, this.page, this.loading);
|
||||
this.loading = true
|
||||
this.handleError(res, res => {
|
||||
this.goods_list = res.data.goods_list.data
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转搜索页
|
||||
search() {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search'
|
||||
})
|
||||
},
|
||||
// 跳转详情页
|
||||
openDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '../shoppingCart/goodsDetail?sku_id=' + item.sku_id +'&the_index='+this.three_index
|
||||
})
|
||||
},
|
||||
// 跳转详情页
|
||||
lastOpenDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '../shoppingCart/goodsDetail?sku_id=' + item.gba_id
|
||||
})
|
||||
},
|
||||
// 滚动消息
|
||||
detail(e) {
|
||||
uni.navigateTo({
|
||||
url: `MessageDetails?mess_id=${JSON.stringify(e)}`
|
||||
})
|
||||
},
|
||||
// 商品列表
|
||||
productList(item) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search-list?activity_id=' + item.id
|
||||
})
|
||||
},
|
||||
async getData() {
|
||||
uni.getStorage({
|
||||
key: 'isAuthentication',
|
||||
success: function(res) {
|
||||
if (res.data == '') {
|
||||
|
||||
} else {
|
||||
|
||||
this.the_Authentication = res.data
|
||||
}
|
||||
}
|
||||
});
|
||||
let res = await X_index.x_index();
|
||||
this.handleError(res, res => {
|
||||
if (res.data.banner) {
|
||||
this.banner = res.data.banner
|
||||
}
|
||||
this.activity_icons = res.data.activity_icons
|
||||
if (res.data.activity_self_true) {
|
||||
this.activity_self_true = res.data.activity_self_true
|
||||
}
|
||||
if (res.data.article) {
|
||||
this.activity = res.data.article
|
||||
}
|
||||
if (res.data.activity_self_false) {
|
||||
this.activity_self_false = res.data.activity_self_false
|
||||
}
|
||||
|
||||
if (this.activity_self_false.length > 0) {
|
||||
this.to_chooseThree(0)
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
overflow-y: auto;
|
||||
|
||||
|
||||
.tui-swiper {
|
||||
font-size: 28upx;
|
||||
height: 50upx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tui-swiper-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tui-news-item {
|
||||
line-height: 28upx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #018EEA;
|
||||
}
|
||||
|
||||
.img_list {
|
||||
width: 263upx;
|
||||
height: 150upx;
|
||||
}
|
||||
|
||||
.tab_goods {
|
||||
width: 340upx;
|
||||
height: 420upx;
|
||||
margin: 4upx;
|
||||
border-radius: 20upx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
.is_top {
|
||||
height: 200.4upx;
|
||||
padding-top: 90upx;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
.top_info {
|
||||
height: 56upx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.is_top_search {
|
||||
overflow: hidden;
|
||||
border-radius: 50upx;
|
||||
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 60upx;
|
||||
top: 16upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
margin-left: 55upx;
|
||||
width: 70%;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-left: 20upx;
|
||||
height: 43upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.banner {
|
||||
height: 387upx;
|
||||
// width: 696upx;
|
||||
margin: 10upx auto 30upx;
|
||||
|
||||
.banner_img {
|
||||
height: 337upx;
|
||||
width: 696upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.info {
|
||||
// width: 696upx;
|
||||
|
||||
.is_box {
|
||||
.menu_img {
|
||||
height: 89upx;
|
||||
width: 88upx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.dong_txt {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bannerNew {
|
||||
height: 235upx;
|
||||
|
||||
|
||||
margin: 30upx auto;
|
||||
}
|
||||
|
||||
.newren {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.new_goods {
|
||||
overflow-x: auto;
|
||||
display: flex;
|
||||
|
||||
|
||||
.new_goods_info {
|
||||
flex: 0 0 280upx;
|
||||
border-right: solid 1px #e5e5e5;
|
||||
color: #5d2a05;
|
||||
margin-right: 15upx;
|
||||
padding: 20upx;
|
||||
|
||||
.some_txt {
|
||||
width: 280upx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.newren_img {
|
||||
// height: 94upx;
|
||||
// width: 175upx;
|
||||
// max-height: 112upx;
|
||||
// max-width: 190upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.threetip_img {
|
||||
height: 158upx;
|
||||
width: 224upx;
|
||||
}
|
||||
|
||||
.three_active {
|
||||
color: #018EEA;
|
||||
border-bottom: 4upx solid #018EEA;
|
||||
}
|
||||
|
||||
.the_lastGoods {
|
||||
|
||||
flex-wrap: wrap;
|
||||
|
||||
.the_lastGoods_item {
|
||||
position: relative;
|
||||
|
||||
border-radius: 20upx;
|
||||
width: 49%;
|
||||
|
||||
.last_img {
|
||||
// width: 263upx;
|
||||
width: 100%;
|
||||
height: 250upx;
|
||||
margin-bottom: 20upx;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
}
|
||||
|
||||
.x_price {
|
||||
position: absolute;
|
||||
bottom: 25upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.is_content {
|
||||
height: calc(100% - 200.4upx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
432
金壶/appV1/pages/home/home1.vue
Normal file
432
金壶/appV1/pages/home/home1.vue
Normal file
@@ -0,0 +1,432 @@
|
||||
<template>
|
||||
<!-- 首页 -->
|
||||
<view class="content bg_F2F2F2 w-100 h-100">
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<view class="is_top_search x-bg-white h-100 flex-1" @click="search()">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img"></image>
|
||||
<input type="text" value="" placeholder="搜索" class="search_input h-100" />
|
||||
</view>
|
||||
<image src="../../static/my/message.png" mode="" class="message"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="banner margin-shu20">
|
||||
<swiper :indicator-dots="true" :autoplay="true" :interval="1000" :duration="100" :circular="true" indicator-color="rgba(255, 255, 255, 0.8)"
|
||||
indicator-active-color="#fff" class="h-100">
|
||||
<swiper-item v-for="(item,index) in banner" :key="index">
|
||||
<!-- <image src="../../static/home/homebanner.png" mode="" class="h-100"></image> -->
|
||||
<image class="h-100" :src="'https://'+item.app_pic_url" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="info x_margin0auto padding-sx30">
|
||||
<!-- 专题 -->
|
||||
<view class="x-bg-white is_box d-flex j-around a-center padding-sx30 margin-shu20 border_radius20">
|
||||
<view class="" v-for="(item,index) of activity_icons" :key='index' @tap='productList(item)'>
|
||||
<view class="text-center">
|
||||
<image :src="'../../static/home/b'+ index +'.png'" mode="" class='menu_img'></image>
|
||||
</view>
|
||||
<view>{{item.activity_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 广告 文字滚动 -->
|
||||
<view class="adv margin-shu20 x-bg-white d-flex a-center padding-zy30 border_radius20">
|
||||
<img class="mr-2" src="../../static/home/laba.png" alt="" style='height:24upx; width:27upx;'>
|
||||
<!-- v-for="(item,index) of activity" :key='index' -->
|
||||
<swiper autoplay circular :interval="3000" class="tui-swiper">
|
||||
<swiper-item v-for="(item,index) of activity" :key='index' class="tui-swiper-item">
|
||||
<view class="tui-news-item text-danger" @tap='detail(item.id)'>{{item.description}}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="bannerNew margin-shu20">
|
||||
<image src="../../static/home/bannernew.png" mode="" class="banner_img h-100 w-100"></image>
|
||||
</view>
|
||||
<!-- <view v-for="(item,index) of activity_self_true" :key="index">
|
||||
<view class="newren margin-shu20">{{item.activity_name}}</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 测试 -->
|
||||
<!-- <view v-for="(item,index) of activity_self_true">
|
||||
|
||||
<view style="border: 1rpx solid red;" v-for="(item2,index2) in item.goods_list.data" :key="index2">
|
||||
<view>{{item2.name}}</view>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
|
||||
<!-- end -->
|
||||
|
||||
<view class=" margin-shu20" v-for="(item,index) of activity_self_true" :key="index">
|
||||
<view class="newren margin-shu20">{{item.activity_name}}</view>
|
||||
<view class="d-flex new_goods">
|
||||
<view class="new_goods_info x-bg-white border_radius20" v-for="(item2,index2) in activity_goods_list" :key="index2"
|
||||
@click="openDetail(item2)">
|
||||
<view class="text-center">
|
||||
<image :src="'https://'+item2.pc_thumb" class="newren_img"></image>
|
||||
</view>
|
||||
<view class="font-weight text-center">{{item2.name}}</view>
|
||||
<view class="x_text_hui text-center font-20">{{item2.spec_desc}}</view>
|
||||
<view class="x-text-159 text-center">¥ {{item2.cost_price}}</view>
|
||||
<view class="x_text_hui text-center" style="text-decoration: line-through;">¥ {{item2.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb threetip">
|
||||
<image src="../../static/shoppingCart/fenlan1.jpg" mode="" class='threetip_img'></image>
|
||||
<img src="../../static/shoppingCart/fenlan2.jpg" alt="" class='threetip_img'>
|
||||
<img src="../../static/shoppingCart/fenlan3.jpg" alt="" class='threetip_img'>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 热卖 -->
|
||||
<view class="last_goods" style="border:1px solid red;">
|
||||
<!-- <view v-for='(item,index) of activity_self_false' :key='index'>
|
||||
<view class="d-flex j-sb " style="border:1px solid red;">
|
||||
<view>{{item.activity_name}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb margin-shu20 the_lastGoods">
|
||||
<view class="the_lastGoods_item padding-30 margin-shu20 x-bg-white" v-for="(item,index) of 3" :key="index">
|
||||
<img :src="'https://'+item.pc_thumb" alt="" class="last_img">
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>登陆后看价格</view>
|
||||
<image src="../../static/font/cart_icon.png" mode="" style="height:40upx; width:40upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="d-flex j-sb">
|
||||
<view class=" text-center d-flex j-around margin-shu20" style="border:1px solid green;" v-for="(item,index) of activity_self_false" :key='index'>
|
||||
<view class="d-flex font-weight" :class='{three_active:index==three_index}' @click="to_chooseThree(index)">{{item.activity_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="d-flex j-sb margin-shu20 the_lastGoods">
|
||||
<view class="the_lastGoods_item padding-30 margin-shu20 x-bg-white" v-for="(item,index) of activity_self_false[this.three_index]" :key="index">
|
||||
<!-- <img :src="'https://'+item.pc_thumb" alt="" class="last_img"> -->
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>登陆后看价格</view>
|
||||
<image src="../../static/font/cart_icon.png" mode="" style="height:40upx; width:40upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- <view class="w-100 d-flex goods_same" style="border:1px solid red;">
|
||||
<view class="mr-2 tab_goods" v-for="(item,index) of goods_list" :key="index">
|
||||
<image
|
||||
style="width: 263upx;height: 150upx;"
|
||||
class="img_list ml-3 mt-2 " :src="'https://'+item.pc_thumb" mode="widthFix"></image>
|
||||
<view class="p-2 pt-1">
|
||||
<view class="font-md">{{item.name}}</view>
|
||||
<text class="d-block font text-light-muted">{{item.manufacturer_name}}</text>
|
||||
<text class="d-block font text-light-muted">¥ {{item.spec_desc}}</text>
|
||||
<view class="d-flex my-1">
|
||||
<view class="x-text-159 text-center">¥ {{item.cost_price}}</view>
|
||||
<view class="x_text_hui text-center" style="text-decoration: line-through;">{{item.price}}</view>
|
||||
<image class="ml-auto" src="../../static/font/cart_icon.png" style="width: 40upx;height: 40upx;" @tap="addCart()"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_index from '../../utils/models/index.js';
|
||||
import uniNoticeBar from '../../components/components/uni-notice-bar/uni-notice-bar.vue'
|
||||
|
||||
|
||||
|
||||
|
||||
// import {Config} from '@/utils/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
banner: [], //轮播图
|
||||
activity: [], //消息
|
||||
activity_icons: [],
|
||||
activity_self_true: [],
|
||||
activity_goods_list: '',
|
||||
activity_self_false: [],
|
||||
activity_self_false_index: 0,
|
||||
three_index: 0,
|
||||
goods_list: [], //商品列表
|
||||
|
||||
limit: 6,
|
||||
page: 1,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
uniNoticeBar,
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.getData();
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// tab转换商品
|
||||
async to_chooseThree(index) {
|
||||
|
||||
this.three_index = index
|
||||
let res = await X_index.x_activity(this.activity_self_false[this.three_index].id, this.limit, this.page);
|
||||
this.handleError(res, res => {
|
||||
this.goods_list = res.data.goods_list.data
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 跳转搜索页
|
||||
search() {
|
||||
uni.navigateTo({
|
||||
url: 'search'
|
||||
})
|
||||
},
|
||||
// 跳转详情页
|
||||
openDetail(item) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '../shoppingCart/goodsDetail?sku_id=' + item.gba_id
|
||||
})
|
||||
},
|
||||
// 滚动消息
|
||||
detail(e) {
|
||||
|
||||
|
||||
},
|
||||
// 商品列表
|
||||
productList(e) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search-list?activity_id=' + e.id
|
||||
})
|
||||
},
|
||||
// 加入购物车
|
||||
addCart() {
|
||||
|
||||
},
|
||||
async getData() {
|
||||
let res = await X_index.x_index();
|
||||
this.handleError(res, res => {
|
||||
|
||||
|
||||
|
||||
var banner = res.data.banner
|
||||
this.banner = banner
|
||||
var activity = res.data.activity_icons
|
||||
this.activity_icons = activity
|
||||
var activity_self = res.data.activity_self_true
|
||||
this.activity_self_true = activity_self
|
||||
this.activity_goods_list = activity_self[0].goods_list.data
|
||||
var articleInfo = res.data.article
|
||||
this.activity = articleInfo
|
||||
var activity_self_false = res.data.activity_self_false
|
||||
this.activity_self_false = activity_self_false
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
overflow-y: auto;
|
||||
|
||||
.the_lastGoods {
|
||||
// border: 1px solid red;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.the_lastGoods_item {
|
||||
border-radius: 20upx;
|
||||
overflow: hidden;
|
||||
width: 49%;
|
||||
// border: 1px solid green;
|
||||
|
||||
.last_img {
|
||||
height: 150upx;
|
||||
width: 262upx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.tui-swiper {
|
||||
font-size: 28upx;
|
||||
height: 50upx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tui-swiper-item {
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.tui-news-item {
|
||||
line-height: 28upx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.img_list {
|
||||
width: 263upx;
|
||||
height: 150upx;
|
||||
}
|
||||
|
||||
.tab_goods {
|
||||
width: 340upx;
|
||||
height: 420upx;
|
||||
margin: 4upx;
|
||||
border-radius: 20upx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
.is_top {
|
||||
height: 299.4upx;
|
||||
padding-top: 66upx;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
.top_info {
|
||||
|
||||
height: 56upx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
|
||||
|
||||
.is_top_search {
|
||||
overflow: hidden;
|
||||
border-radius: 20upx;
|
||||
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 40upx;
|
||||
top: 16upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
margin-left: 70upx;
|
||||
width: 70%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-left: 20upx;
|
||||
height: 43upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.banner {
|
||||
height: 387upx;
|
||||
width: 696upx;
|
||||
margin: -140upx auto 0;
|
||||
|
||||
.banner_img {
|
||||
height: 337upx;
|
||||
width: 696upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.info {
|
||||
width: 696upx;
|
||||
|
||||
.is_box {
|
||||
.menu_img {
|
||||
height: 89upx;
|
||||
width: 88upx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.dong_txt {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bannerNew {
|
||||
height: 235upx;
|
||||
width: 696upx;
|
||||
}
|
||||
|
||||
.newren {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.new_goods {
|
||||
|
||||
overflow-x: auto;
|
||||
|
||||
.new_goods_info {
|
||||
padding: 40upx;
|
||||
width: 234upx;
|
||||
margin-right: 30upx;
|
||||
|
||||
.newren_img {
|
||||
height: 94upx;
|
||||
width: 175upx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.last_goodsItem {
|
||||
padding: 40upx;
|
||||
width: 350upx;
|
||||
margin-right: 30upx;
|
||||
|
||||
.newren_img {
|
||||
height: 94upx;
|
||||
width: 175upx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.threetip_img {
|
||||
height: 158upx;
|
||||
width: 224upx;
|
||||
}
|
||||
|
||||
.three_active {
|
||||
color: #018EEA;
|
||||
border-bottom: 4upx solid #018EEA;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
913
金壶/appV1/pages/home/search-list.vue
Normal file
913
金壶/appV1/pages/home/search-list.vue
Normal file
@@ -0,0 +1,913 @@
|
||||
<template>
|
||||
<view class="contant">
|
||||
<!-- 排序|筛选 -->
|
||||
<view class="topfind">
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<image src="../../static/my/left.png" mode="" style="height:30upx; width:19upx; padding-right:30upx;" @click="boback()"></image>
|
||||
<view class="is_top_search x-bg-white h-100 flex-1">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img" @click="search"></image>
|
||||
<input type="text" v-model="keyword" confirm-type="search" @confirm="search" placeholder="请输入药名/厂家" ref="myInput"
|
||||
class="search_input h-100" @input="changeInput($event)" />
|
||||
<image class="closeicon" v-if="keyword!=''" @click="removewored()" src="../../static/shoppingCart/cancel.png" mode=""></image>
|
||||
<view class="search_liandong bg_F2F2F2 shadow" v-if='flag==true'>
|
||||
<view class="border-bottom x-bg-white search_items" v-for='(item,index) in search_liandong' :key='index' @tap='to_choose(item)'>{{item.name}}({{item.manufacturer_name}})</view>
|
||||
</view>
|
||||
<!-- <input type="text" value="" placeholder="搜索" class="search_input h-100" @input="changeInput($event)" v-model="keyword" /> -->
|
||||
</view>
|
||||
<!-- <image src="../../static/my/message.png" mode="" class="message" @click="to_mes()"></image> -->
|
||||
<!-- <img src="../../static/my/carw.png" class="message" alt="" @tap="to_car()"> -->
|
||||
<image src="../../static/my/carw.png" class="message" alt="" @tap="to_car()"></image>
|
||||
|
||||
<view class="car_GoodsNum" v-if='car_GoodsNum>0'>{{car_GoodsNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list_menu d-flex j-around padding-zy30">
|
||||
<view @click="chooseMenu(0)" :class="{active_menu:menu_index==0}">综合</view>
|
||||
<view @click="chooseMenu(1)" :class="{active_menu:menu_index==1}" class="d-flex a-center">
|
||||
<view>销量</view>
|
||||
<image src="../../static/shoppingCart/shangxia_hui.png" mode="" class="paixu" v-if="is_saleClickMenu==false"></image>
|
||||
<image src="../../static/shoppingCart/up_paixu.png" mode="" class="paixu" v-if='sale_menu_flag==true && is_saleClickMenu==true'></image>
|
||||
<image src="../../static/shoppingCart/down_paixu.png" mode="" class="paixu" v-if='sale_menu_flag==false && is_saleClickMenu==true'></image>
|
||||
</view>
|
||||
<view @click="chooseMenu(2)" :class="{active_menu:menu_index==2}" class="d-flex a-center">
|
||||
<view>价格</view>
|
||||
<image src="../../static/shoppingCart/shangxia_hui.png" mode="" class="paixu" v-if="is_priceClickMenu==false"></image>
|
||||
<image src="../../static/shoppingCart/up_paixu.png" mode="" class="paixu" v-if='price_menu_flag==true && is_priceClickMenu==true'></image>
|
||||
<image src="../../static/shoppingCart/down_paixu.png" mode="" class="paixu" v-if='price_menu_flag==false && is_priceClickMenu==true'></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="list_menu d-flex j-around padding-zy30">
|
||||
<view v-for='(item,index) of list_menu' :key='index' :class="{active_menu:index==menu_index}" @click="chooseMenu(index)">{{item.name}}</view>
|
||||
</view> -->
|
||||
<view class="no_img" v-if='list.length<=0'>
|
||||
<image src="../../static/shoppingCart/nopic.png" mode="" class="no_img"></image>
|
||||
<view class="text-center x_text_hui">{{data_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<view class="list padding-30 bg_F2F2F2" v-if='list.length>0'>
|
||||
<view class="list_items x-bg-white margin-bottom22" v-for="(item,index) in list" :key="index">
|
||||
<view class="d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<!-- <view class="box_img" @click="goodsDetail(item)">
|
||||
<an-image :src="'https://'+item.pc_thumb" alt="https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg"></an-image>
|
||||
</view> -->
|
||||
<view class="box_img" @click="goodsDetail(item)" :style="{backgroundImage: 'url(' + 'https://'+item.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
</view>
|
||||
<view class="goods_txt" style="width:65%;" @click="goodsDetail(item)">
|
||||
<view class="d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;margin-right:30upx;"
|
||||
v-if='item.is_limit==1'></image>
|
||||
<image src="../../static/shoppingCart/re.png" mode="" style="height:30upx; width:30upx;margin-right:30upx;" v-if='item.supplier_id<=10000'></image>
|
||||
<view class="font_28 some_txt font-weight flex-1 ">{{item.goods_name}}</view>
|
||||
</view>
|
||||
<view class="x-text-159" v-if='item.is_limit==1'>{{item.limit_info}}</view>
|
||||
<view class="textOVerFlow">{{item.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
{{item.spec_desc}}
|
||||
<image src="../../static/shoppingCart/zheng.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='item.retail_flag == 1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='item.retail_flag == 0'></image>
|
||||
{{item.retail_flag==0?item.retail_num:item.entirety_num}}{{item.unit}}/件
|
||||
</view>
|
||||
<view class="x-text-159 font-weight font_28">¥ {{item.price}}</view>
|
||||
<image src="../../static/font/cart_icon.png" mode="" class='x_car' alt="" @click.stop='toAdd_car(item)'></image>
|
||||
</view>
|
||||
<!-- <view class="goods_txt flex-1" @click="goodsDetail(item)">
|
||||
<view class="font-weight font_28">{{item.goods_name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="">{{item.factory_name}}</view>
|
||||
<view class="d-flex">{{item.spec_desc}} {{item.retail_flag == 0 ? "零":"整"}} {{item.retail_flag==0?item.retail_num:item.entirety_num}}{{item.unit}}/件</view>
|
||||
<view class="font_28 font-weight x-text-159">{{item.price}}</view>
|
||||
<img src="../../static/font/cart_icon.png" class='x_car' alt="" @click.stop='toAdd_car(item)'>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loading-world" v-if="isScroll">
|
||||
<image class="loading-img" src="../../static/my/loading.gif" alt=""></image>
|
||||
加载中......
|
||||
</view>
|
||||
|
||||
<view class="loading-world" v-if="!isScroll">—————— 已经到底了 ——————</view>
|
||||
</view>
|
||||
<!-- 购物车遮挡层 -->
|
||||
<view class="car_pop h-100 w-100" v-if="is_pop_show==true" @tap='cancel_popCar()'>
|
||||
<view class="pop_box bg-white w-100" style="background-color: #FFFFFF;" @tap.stop='stop_click()'>
|
||||
<view class="pop_goods_info d-flex a-center padding-zy64">
|
||||
|
||||
<!-- <image src="../../static/shoppingCart/cancel.png" mode="" @click="cancel_popCar()" class="cancel_pop"></image> -->
|
||||
<view class="pop_box_img d-flex">
|
||||
<image v-if='is_pop_car' :src="'https://'+is_pop_car.pc_thumb" mode="" class="pop_img"></image>
|
||||
<view>
|
||||
<view class="d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;" v-if='is_pop_car.is_limit==1'></image>
|
||||
<view class="font_28 some_txt font-weight" style="margin-left:30upx;">{{is_pop_car.goods_name}}</view>
|
||||
</view>
|
||||
<view class="x-text-159" v-if='is_pop_car.is_limit==1'>{{is_pop_car.limit_info}}</view>
|
||||
<view class="">{{is_pop_car.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
{{is_pop_car.spec_desc}}
|
||||
<image src="../../static/shoppingCart/zheng.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='is_pop_car.retail_flag == 1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='is_pop_car.retail_flag == 0'></image>
|
||||
{{is_pop_car.retail_flag==0?is_pop_car.retail_num:is_pop_car.entirety_num}}{{is_pop_car.unit}}/件
|
||||
</view>
|
||||
<view class="x-text-159 font-weight font_28">¥ {{is_pop_car.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address">
|
||||
<view class="x_text_hei2828">选择购买数量</view>
|
||||
<view class="d-flex j-sb a-center">
|
||||
<view class="x-text-159 x-text-font24">小提示:该物品购买数量必须为包装的倍数</view>
|
||||
<view class="goods_count d-flex">
|
||||
<view class="bianji_cars_num bianji_cars_numJian" @click="reduse_goodsNum()">-</view>
|
||||
<input type="number" value="" class="bianji_cars_num bianji_cars_numAdd uni-input" cursor-spacing="0" v-model="goods_num" />
|
||||
<view class="bianji_cars_num bianji_cars_numAdd" @click="add_goodsNum()">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="x-bg-159 x_public_box pop_sure x-text-white w-90" @click="sure_btn()">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import {
|
||||
Config
|
||||
} from '../../utils/config.js'
|
||||
import tuiIcon from "@/components/icon/icon"
|
||||
import uniDrawer from "@/components/uni-ui/uni-drawer/uni-drawer.vue"
|
||||
import card from "@/components/common/card.vue"
|
||||
import zcmRadioGroup from "@/components/common/radio-group.vue"
|
||||
import zcmRadioGroupNew from "@/components/common/radio-group__.vue"
|
||||
import radioGroupSell from "@/components/common/radio-group-sell.vue"
|
||||
import anImage from '@/components/an-image/an-image'
|
||||
import searchList from "@/components/search-list/search-list.vue"
|
||||
export default {
|
||||
components: {
|
||||
tuiIcon,
|
||||
uniDrawer,
|
||||
card,
|
||||
zcmRadioGroup,
|
||||
zcmRadioGroupNew,
|
||||
searchList,
|
||||
radioGroupSell,
|
||||
anImage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
isScroll: true,
|
||||
data_text: '数据加载中...',
|
||||
car_GoodsNum: 0, //购物车的商品数量
|
||||
is_pop_show: false,
|
||||
goods_num: 0, // 商品的当前数量
|
||||
is_pop_car: '', // 购物车弹框里面的数据
|
||||
manufacturer_name: '',
|
||||
menu_index: 0,
|
||||
list_menu: [{
|
||||
name: '综合'
|
||||
}, {
|
||||
name: '销量'
|
||||
}, {
|
||||
name: '价格'
|
||||
}],
|
||||
// 收索分页
|
||||
current_page: 1,
|
||||
|
||||
keyword: "", //关键词
|
||||
cate_id: '', //分类id
|
||||
activity_id: '', //活动id
|
||||
retail_flag: '', // 零整标志:0-零售,1-整件售 允许值: 0, 1
|
||||
sort_field: '', //排序字段"default", "sale", "price", "term_validity"
|
||||
sort_order: '', //排序规则 :0-升序,1-降序
|
||||
price_start: '', //价格区间起点
|
||||
price_end: '', //价格区间只能终点
|
||||
term_validity: '', // 效期:0 半年以上,1 一年以上,2 所有,3 近效期(90天内) 默认值: 2 允许值: 0, 1, 2, 3
|
||||
drug_form: '', // 剂型
|
||||
manufacturer: '', // // 生产厂家
|
||||
list: [],
|
||||
showRigth: false,
|
||||
is_key: '',
|
||||
search_liandong: '',
|
||||
flag: '',
|
||||
sale_menu_flag : false,
|
||||
price_menu_flag : false,
|
||||
is_saleClickMenu:false, // 判断销量是否点击了菜单
|
||||
is_priceClickMenu:false, // 判断价格是否点击了菜单
|
||||
screen: {
|
||||
currentIndex: 0,
|
||||
list: [
|
||||
// status选中状态
|
||||
{
|
||||
name: "综合",
|
||||
status: 2,
|
||||
key: "default"
|
||||
},
|
||||
{
|
||||
name: "销量",
|
||||
status: 0,
|
||||
key: "sale"
|
||||
},
|
||||
{
|
||||
name: "价格",
|
||||
status: 0,
|
||||
key: "price"
|
||||
}
|
||||
]
|
||||
},
|
||||
// 生产厂家
|
||||
label2: {
|
||||
selected: 0,
|
||||
list: []
|
||||
},
|
||||
//剂型
|
||||
label3: {
|
||||
selected: 0,
|
||||
list: []
|
||||
},
|
||||
// 售卖
|
||||
label4: {
|
||||
selected: 0,
|
||||
list: []
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.keyword) {
|
||||
this.keyword = option.keyword
|
||||
this.menu_index = 99
|
||||
}
|
||||
if (option.activity_id) {
|
||||
this.activity_id = option.activity_id
|
||||
this.menu_index = 99
|
||||
}
|
||||
if (option.manufacturer) {
|
||||
this.manufacturer = option.manufacturer
|
||||
this.menu_index = ''
|
||||
}
|
||||
if (option.cate_id) {
|
||||
this.cate_id = option.cate_id
|
||||
this.menu_index = ''
|
||||
}
|
||||
if (this.menu_index = 0) {
|
||||
this.keyword = ''
|
||||
}
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
},
|
||||
onShow() {
|
||||
this.car_GoodsNum = Config.shooppingCar_num
|
||||
},
|
||||
computed: {
|
||||
// 排序相关
|
||||
options() {
|
||||
let obj = this.screen.list[this.screen.currentIndex]
|
||||
let value = obj.status === 1 ? 1 : 0
|
||||
return {
|
||||
[obj.key]: value
|
||||
}
|
||||
},
|
||||
},
|
||||
// 搜索关键字
|
||||
onNavigationBarSearchInputChanged(e) {
|
||||
this.keyword = e.text
|
||||
},
|
||||
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance"
|
||||
onReachBottom() {
|
||||
if (this.isScroll) {
|
||||
uni.showNavigationBarLoading();
|
||||
this.getData();
|
||||
}
|
||||
|
||||
// setTimeout(() => {
|
||||
// uni.showNavigationBarLoading();
|
||||
// }, 500);
|
||||
|
||||
// this.getData();
|
||||
},
|
||||
//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
|
||||
// onPullDownRefresh() {
|
||||
// setTimeout(()=>{
|
||||
// uni.stopPullDownRefresh();
|
||||
// }, 1000);
|
||||
// },
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 选择菜单
|
||||
chooseMenu(index) {
|
||||
|
||||
|
||||
this.menu_index = index
|
||||
if(this.menu_index==0){
|
||||
this.sort_field = "default"
|
||||
}
|
||||
if(this.menu_index==1){
|
||||
this.is_saleClickMenu = true;
|
||||
this.is_priceClickMenu = false;
|
||||
this.sort_field = "sale"
|
||||
this.sale_menu_flag = !this.sale_menu_flag
|
||||
// 排序规则:0-升序,1-降序
|
||||
if(this.sale_menu_flag==true){
|
||||
this.sort_order = 0
|
||||
}else{
|
||||
this.sort_order = 1
|
||||
}
|
||||
}
|
||||
if(this.menu_index==2){
|
||||
this.is_priceClickMenu = true;
|
||||
this.is_saleClickMenu = false;
|
||||
this.sort_field = "price"
|
||||
this.price_menu_flag = !this.price_menu_flag
|
||||
// 排序规则:0-升序,1-降序
|
||||
if(this.price_menu_flag==true){
|
||||
this.sort_order = 0
|
||||
}else{
|
||||
this.sort_order = 1
|
||||
}
|
||||
}
|
||||
this.list = []
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
// this.activity_id = ''
|
||||
// this.keyword = ''
|
||||
|
||||
|
||||
},
|
||||
// 阻止时间冒泡 不要删除
|
||||
stop_click() {
|
||||
|
||||
},
|
||||
// removewored 清空输入框
|
||||
removewored() {
|
||||
this.keyword = ""
|
||||
this.flag = false;
|
||||
},
|
||||
|
||||
// 添加购物车
|
||||
async sure_btn() {
|
||||
if (this.goods_num <= 0) {
|
||||
uni.showToast({
|
||||
title: '请添加商品数量',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
if (this.is_pop_car.retail_flag == 0) { //零售
|
||||
if (this.goods_num % this.is_pop_car.retail_num !== 0) {
|
||||
uni.showToast({
|
||||
title: '该物品购买数量必须为包装的倍数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
this.car_GoodsNum += 1 // 需要修改
|
||||
let res = await X_goods.X_addCar(this.is_pop_car.sku_id, this.is_pop_car.batch_id, this.goods_num, '')
|
||||
if (res.code == 200 && res.data.errcode == 200) {
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
// this.uc_id = res;
|
||||
|
||||
if (res.code == 40000) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
} else { // 整售
|
||||
if (this.goods_num % this.is_pop_car.entirety_num !== 0) {
|
||||
|
||||
|
||||
uni.showToast({
|
||||
title: '该物品购买数量必须为包装的倍数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
this.car_GoodsNum += 1 // 需要修改
|
||||
let res = await X_goods.X_addCar(this.is_pop_car.sku_id, this.is_pop_car.batch_id, this.goods_num, '')
|
||||
if (res.code == 200 && res.data.errcode == 200) {
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
// this.uc_id = res;
|
||||
|
||||
if (res.message == 40000) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
to_car() {
|
||||
uni.switchTab({
|
||||
url: '/pages/shoppingCart/shoppingCart'
|
||||
});
|
||||
},
|
||||
imgError(e) {
|
||||
|
||||
},
|
||||
to_mes() {
|
||||
uni.navigateTo({
|
||||
url: '../my/is_message'
|
||||
})
|
||||
},
|
||||
// 返回键
|
||||
boback() {
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
// 关闭按钮
|
||||
cancel_popCar() {
|
||||
this.is_pop_show = false;
|
||||
},
|
||||
//减 商品的数量
|
||||
reduse_goodsNum() {
|
||||
if (this.is_pop_car.retail_flag == 0) { //零售
|
||||
this.goods_num = this.goods_num - this.is_pop_car.retail_num
|
||||
} else { // 整售
|
||||
this.goods_num = this.goods_num - this.is_pop_car.entirety_num
|
||||
}
|
||||
|
||||
|
||||
if (this.goods_num <= 0) {
|
||||
this.goods_num = 0
|
||||
uni.showToast({
|
||||
title: '商品数量不得为负',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
// 增加 商品的数量
|
||||
async add_goodsNum() {
|
||||
if (this.goods_num == this.is_pop_car.stock_num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
if (this.is_pop_car.retail_flag == 0) { //零售
|
||||
this.goods_num = Number(this.goods_num) + Number(this.is_pop_car.retail_num)
|
||||
} else { // 整售
|
||||
this.goods_num = Number(this.goods_num) + Number(this.is_pop_car.entirety_num)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 加入购物车
|
||||
async toAdd_car(item) {
|
||||
this.is_pop_car = item
|
||||
console.log(this.is_pop_car)
|
||||
this.is_pop_show = true;
|
||||
|
||||
if (item.retail_flag == 0) { //零售
|
||||
this.goods_num = item.retail_num
|
||||
} else { // 整售
|
||||
this.goods_num = item.entirety_num
|
||||
}
|
||||
|
||||
},
|
||||
// 进入详情页
|
||||
goodsDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/shoppingCart/goodsDetail?sku_id=' + item.sku_id
|
||||
});
|
||||
},
|
||||
// 加载数据
|
||||
async getData() {
|
||||
this.data_text = '数据加载中...'
|
||||
let res = await X_goods.search(
|
||||
this.keyword, // 关键字
|
||||
this.cate_id, //分类id
|
||||
this.activity_id, // 活动id
|
||||
this.retail_flag, //零整标志:0-零售,1-整件售 允许值: 0, 1
|
||||
this.sort_field, //排序字段"default", "sale", "price", "term_validity"
|
||||
this.sort_order, // //排序规则 :0-升序,1-降序
|
||||
this.term_validity, //
|
||||
this.drug_form,
|
||||
this.manufacturer, // 生产厂家
|
||||
this.price_start, //开始价格
|
||||
this.price_end, // 结束价格
|
||||
this.current_page // 分页 页
|
||||
)
|
||||
if (res.data.data.current_page == res.data.data.last_page) {
|
||||
this.isScroll = false
|
||||
uni.hideNavigationBarLoading();
|
||||
// uni.showToast({
|
||||
// title: '到底了',
|
||||
// duration: 1000,
|
||||
// icon: 'none'
|
||||
// });
|
||||
// this.loadingText="到底了";
|
||||
}
|
||||
if (res.data.data.data.length <= 0) {
|
||||
this.data_text = '暂无数据'
|
||||
}
|
||||
for (let i = 0; i < res.data.data.data.length; i++) {
|
||||
this.list.push(res.data.data.data[i])
|
||||
}
|
||||
this.current_page++
|
||||
uni.hideNavigationBarLoading();
|
||||
this.handleError(res, res => {
|
||||
|
||||
// this.label2.list = res.data.to_select.manufacturer //生产厂家
|
||||
// this.label3.list = res.data.to_select.drug_form //剂型
|
||||
// this.label4.list = res.data.to_select.retail_flag //售卖
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 初始化搜索
|
||||
initSearch() {
|
||||
this.label.selected = 0
|
||||
this.condition = {}
|
||||
this.current_page = 1
|
||||
this.list = []
|
||||
},
|
||||
// 搜索联动
|
||||
async the_searchList() {
|
||||
let res = await X_goods.x_searchList(this.keyword)
|
||||
this.search_liandong = res.data
|
||||
this.handleError(res, res => {})
|
||||
},
|
||||
// 搜索
|
||||
to_choose(item) {
|
||||
this.list = []
|
||||
this.keyword = item.name
|
||||
// this.manufacturer = item.manufacturer_name
|
||||
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
this.flag = false
|
||||
},
|
||||
// 搜索 监听input框的值
|
||||
changeInput(event) {
|
||||
this.keyword = event.detail.value
|
||||
this.manufacturer = ''
|
||||
if (event.detail.value == '') {
|
||||
this.flag = false
|
||||
this.list = []
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
} else {
|
||||
this.flag = true
|
||||
this.the_searchList();
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.isScroll = true;
|
||||
this.manufacturer = ''
|
||||
this.flag = false;
|
||||
uni.hideKeyboard();
|
||||
if (this.keyword === '') {
|
||||
uni.showToast({
|
||||
title: '关键词不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.list = []
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
uni.hideKeyboard()
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place {
|
||||
background-color: #ffffff;
|
||||
height: 258upx;
|
||||
}
|
||||
|
||||
.uni-app {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
,
|
||||
.uni-page-wrapper {
|
||||
display: block;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uni-page {}
|
||||
|
||||
.some_txt {
|
||||
width: 300upx;
|
||||
overflow: hidden;
|
||||
/*隐藏溢出*/
|
||||
text-overflow: ellipsis;
|
||||
/*当文本溢出包含元素时显示省略符号来代表被修剪的文本*/
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
uni-page-body {
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
.contant {
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.topfind {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.is_top {
|
||||
height: 168upx;
|
||||
padding-top: 90upx;
|
||||
|
||||
.top_info {
|
||||
|
||||
height: 60upx;
|
||||
|
||||
position: relative;
|
||||
|
||||
|
||||
|
||||
.is_top_search {
|
||||
|
||||
border-radius: 50upx;
|
||||
position: relative;
|
||||
|
||||
.search_liandong {
|
||||
max-height: 750upx;
|
||||
overflow-y: auto;
|
||||
font-size: 20upx;
|
||||
color: #989898;
|
||||
width: 100%;
|
||||
margin-top: 2upx;
|
||||
|
||||
line-height: 80upx;
|
||||
z-index: 101;
|
||||
position: fixed;
|
||||
right: 0upx;
|
||||
|
||||
.search_items {
|
||||
margin-top: 2upx;
|
||||
padding: 0 30upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
}
|
||||
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 40upx;
|
||||
top: 20upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
|
||||
}
|
||||
|
||||
.closeicon {
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
position: absolute;
|
||||
top: 10upx;
|
||||
right: 10upx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
margin-left: 50upx;
|
||||
color: #989898;
|
||||
line-height: 60upx;
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
height: 60upx;
|
||||
width: 70upx;
|
||||
}
|
||||
|
||||
.car_GoodsNum {
|
||||
background-color: #EB5159;
|
||||
color: #FFFFFF;
|
||||
position: absolute;
|
||||
top: -6upx;
|
||||
right: -18upx;
|
||||
height: 40upx;
|
||||
width: 40upx;
|
||||
line-height: 40upx;
|
||||
font-size: 20upx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list_menu {
|
||||
height: 90upx;
|
||||
width: 100%;
|
||||
line-height: 90upx;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
background-color: #FFFFFF;
|
||||
.paixu{
|
||||
height:29upx;
|
||||
margin-left:8upx;
|
||||
width:14upx;
|
||||
}
|
||||
.active_menu {
|
||||
color: #6E67FF;
|
||||
border-bottom: 4upx solid #6E67FF;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.no_img {
|
||||
height: 198upx;
|
||||
width: 294px;
|
||||
margin: 90upx auto;
|
||||
}
|
||||
|
||||
.list {
|
||||
height: calc(100% - 258upx);
|
||||
overflow-y: auto;
|
||||
z-index: 99;
|
||||
|
||||
.loading-world {
|
||||
text-align: center;
|
||||
color:#515151;
|
||||
font-size: 24upx;
|
||||
.loading-img{
|
||||
width:28upx;
|
||||
height:28upx;
|
||||
}
|
||||
}
|
||||
|
||||
.list_items {
|
||||
padding: 30upx 0;
|
||||
border-radius: 20upx;
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
// width: 270upx;
|
||||
width:35%;
|
||||
padding: 10upx;
|
||||
margin: 0 10upx;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
position: relative;
|
||||
|
||||
.goods_count {
|
||||
position: absolute;
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
|
||||
.x_car {
|
||||
position: absolute;
|
||||
right: 50upx;
|
||||
bottom: 0upx;
|
||||
height: 50upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.car_pop {
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
.pop_box {
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
bottom: 0%;
|
||||
// height:707upx;
|
||||
border-radius: 10upx 10upx 0 0;
|
||||
|
||||
.cancel_pop {
|
||||
height: 38upx;
|
||||
width: 38upx;
|
||||
position: absolute;
|
||||
right: 30upx;
|
||||
top: 30upx;
|
||||
}
|
||||
|
||||
.pop_goods_info {
|
||||
height: 267upx;
|
||||
border-bottom: 5upx dashed #989898;
|
||||
|
||||
.pop_box_img {
|
||||
.pop_img {
|
||||
margin-right: 60upx;
|
||||
vertical-align: middle;
|
||||
height: 142upx;
|
||||
width: 200upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.address {
|
||||
padding: 20upx 30upx;
|
||||
border-bottom: 4upx solid #F2F2F2;
|
||||
|
||||
.dizhi_img {
|
||||
margin-right: 30upx;
|
||||
height: 27upx;
|
||||
width: 20upx;
|
||||
}
|
||||
|
||||
.pop_right {
|
||||
height: 22upx;
|
||||
width: 13upx;
|
||||
|
||||
}
|
||||
|
||||
.goods_count {
|
||||
// position: absolute;
|
||||
// bottom: -14upx;
|
||||
// right: 8upx;
|
||||
}
|
||||
}
|
||||
|
||||
.pop_sure {
|
||||
line-height: 82upx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.radio-active {
|
||||
background: #FCE0D5 !important;
|
||||
color: #EB7320 !important;
|
||||
border-color: #EB7320 !important;
|
||||
;
|
||||
}
|
||||
|
||||
.tui-drawer-content {
|
||||
padding: 16rpx 30rpx 30rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tui-input {
|
||||
border: 0;
|
||||
height: 64rpx;
|
||||
border-radius: 32rpx;
|
||||
width: 45%;
|
||||
background: #f7f7f7;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
278
金壶/appV1/pages/home/search.vue
Normal file
278
金壶/appV1/pages/home/search.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<image src="../../static/my/left.png" mode="" style="height:30upx; width:19upx;" @click="goback()"></image>
|
||||
<view class="is_top_search x-bg-white h-100 flex-1 margin-zy20">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img" @click="search()" ></image>
|
||||
<!-- <input type="text" value="" placeholder="搜索" class="search_input h-100" v-model="keyword" /> -->
|
||||
<input type="text" v-model="keyword" @input="changeInput($event)" confirm-type="search" focus="" @confirm="search" placeholder="请输入药名/厂家" class="search_input h-100"/>
|
||||
<image class="closeicon" v-if="keyword!=''" @click="removewored()" src="../../static/shoppingCart/cancel.png" mode=""></image>
|
||||
<view class="search_liandong bg_F2F2F2 shadow" v-if='flag==true'>
|
||||
<view class="border-bottom x-bg-white search_items" v-for='(item,index) in search_liandong' :key='index' @tap='chooseSearch(item)'>{{item.name}}({{item.manufacturer_name}})</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<image src="../../static/my/message.png" mode="" class="message" @click="to_mes()"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-weight font_28 margin-zy20" style="line-height: 90upx;">热门搜索</view>
|
||||
<view class="list d-flex flex-wrap" >
|
||||
<view class="padding-zy30 list_item" v-for="(item,index) in hot" :key="index" @click="choose(item)">{{item.name}}</view>
|
||||
</view>
|
||||
|
||||
<!-- <card headTitle="搜索记录">
|
||||
<view slot="right" class="font text-danger"
|
||||
@click="clearHistory">清除</view>
|
||||
<uni-list-item v-for="(item,index) in historyList" :key="index"
|
||||
:title="item" :showArrow="false" @click="quickSearch(item)"></uni-list-item>
|
||||
</card> -->
|
||||
<!-- <view class="font text-primary ml-2" @click="clearHistory">清除搜索记录</view> -->
|
||||
<!-- 分割线 -->
|
||||
|
||||
<!-- <card headTitle="热门搜索">
|
||||
|
||||
<view class="px-1 mb-2">
|
||||
<color-tag v-for="(item,index) in hot" :key="index" :item="item" @click.native="hotSearch(item.name)"></color-tag>
|
||||
</view>
|
||||
</card> -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import tuiIcon from "@/components/icon/icon"
|
||||
import card from "@/components/common/card.vue"
|
||||
import colorTag from "@/components/search/color-tag.vue"
|
||||
import uniListItem from "@/components/uni-ui/uni-list-item/uni-list-item.vue"
|
||||
export default {
|
||||
components:{
|
||||
card,
|
||||
colorTag,
|
||||
uniListItem,
|
||||
tuiIcon,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
review:true,
|
||||
historyList:[],
|
||||
keyword:"",
|
||||
hot:[],
|
||||
cate:[],
|
||||
search_liandong:'',// // 搜索联动
|
||||
is_key:'',
|
||||
flag:false,
|
||||
manufacturer_name:'' //厂家
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
if (e.index === 0) {
|
||||
uni.navigateTo({
|
||||
url: 'search-list',
|
||||
});
|
||||
}
|
||||
},
|
||||
// onNavigationBarSearchInputChanged(e) {
|
||||
// this.keyword = e.text
|
||||
// },
|
||||
// onNavigationBarSearchInputConfirmed() {
|
||||
// this.search()
|
||||
// },
|
||||
// onNavigationBarButtonTap() {
|
||||
// this.search()
|
||||
// },
|
||||
watch: {
|
||||
'$route'(to, from) {
|
||||
if(to.path == '/pages/home/search' && from.path != '/pages/home/search-list'){
|
||||
this.hotSearch()
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.hotSearch()
|
||||
},
|
||||
methods: {
|
||||
// removewored 清空输入框
|
||||
removewored(){
|
||||
this.keyword = ""
|
||||
this.flag = false
|
||||
},
|
||||
// x_searchList
|
||||
// 搜索联动列表
|
||||
async the_searchList(){
|
||||
let res = await X_goods.x_searchList(this.is_key)
|
||||
this.search_liandong = res.data
|
||||
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 监听搜索框的值
|
||||
changeInput(event){
|
||||
if(event.detail.value==''){
|
||||
this.flag = false
|
||||
}else{
|
||||
this.flag = true
|
||||
this.is_key = event.detail.value
|
||||
|
||||
this.the_searchList();
|
||||
}
|
||||
},
|
||||
// 返回键
|
||||
goback(){
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
//
|
||||
chooseSearch(item){
|
||||
this.flag = false
|
||||
uni.navigateTo({
|
||||
url:'./search-list?keyword='+item.name +'&manufacturer='+item.manufacturer_name
|
||||
})
|
||||
},
|
||||
//choose
|
||||
choose(item){
|
||||
uni.navigateTo({
|
||||
url:'./search-list?keyword='+item.name
|
||||
})
|
||||
},
|
||||
to_mes(){
|
||||
uni.navigateTo({
|
||||
url:'../my/is_message'
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
search() {
|
||||
if (this.keyword === '') {
|
||||
uni.showToast({
|
||||
title: '关键词不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
}else{
|
||||
|
||||
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search-list?keyword='+this.keyword
|
||||
});
|
||||
uni.hideKeyboard()
|
||||
return
|
||||
|
||||
// indexOf -1 没匹配到; 1 匹配到
|
||||
// console.log(this.keyword.indexOf(" ") != -1 );
|
||||
return
|
||||
if (this.keyword.indexOf(" ") == -1) {
|
||||
// console.log("没有空格")
|
||||
} else {
|
||||
// console.log("空格")
|
||||
// let str = ‘被测对象(人)>被测对象属性(心跳)>三轴振动传感器’
|
||||
let index = this.keyword .lastIndexOf(" ")
|
||||
this.keyword =this.keyword .substring(0,index);
|
||||
// console.log(this.keyword,'截取前') //被测对象(人)>被测对象属性(心跳)
|
||||
// console.log(this.keyword.length,'截取前length') //被测对象(人)>被测对象属性(心跳)
|
||||
|
||||
let index1 = this.keyword .lastIndexOf(" ")
|
||||
this.manufacturer_name =this.keyword .substring(index1+1,this.keyword.length);
|
||||
// console.log(this.manufacturer_name) //三轴振动传感器
|
||||
if(this.keyword.length<=0){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// this.the_searchList(); // 大佬
|
||||
// 超
|
||||
uni.navigateTo({
|
||||
url: 'search-list?keyword='+this.keyword
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
async hotSearch(e){
|
||||
let res = await X_goods.goodsRanking()
|
||||
this.handleError(res, res => {
|
||||
this.hot = res.data
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.uni-input-placeholder{
|
||||
|
||||
line-height: 168upx;
|
||||
}
|
||||
.is_top {
|
||||
height: 168upx;
|
||||
padding-top: 90upx;
|
||||
|
||||
.top_info {
|
||||
height: 60upx;
|
||||
|
||||
position: relative;
|
||||
.is_top_search {
|
||||
|
||||
line-height: 27upx;
|
||||
border-radius: 50upx;
|
||||
position: relative;
|
||||
.search_liandong{
|
||||
max-height: 750upx;
|
||||
overflow-y: auto;
|
||||
font-size: 20upx;
|
||||
color:#989898;
|
||||
width:100%;
|
||||
margin-top:20upx;
|
||||
line-height: 80upx;
|
||||
position: fixed;
|
||||
left:0;
|
||||
right:0upx;
|
||||
.search_items{
|
||||
margin-top: 2upx;
|
||||
padding:0 30upx;
|
||||
overflow:hidden;
|
||||
|
||||
text-overflow:ellipsis;
|
||||
|
||||
white-space:nowrap;
|
||||
}
|
||||
}
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 60upx;
|
||||
top: 20upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
}
|
||||
.closeicon{
|
||||
width:40upx;
|
||||
height: 40upx;
|
||||
position: absolute;
|
||||
top:10upx;
|
||||
right: 10upx;
|
||||
}
|
||||
.search_input {
|
||||
margin-left: 70upx;
|
||||
width: 70%;
|
||||
font-size: 25upx;
|
||||
color: #989898;
|
||||
line-height: 27upx;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-left: 20upx;
|
||||
height: 43upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.list_item{
|
||||
margin:10upx;
|
||||
color:#989898;
|
||||
}
|
||||
</style>
|
||||
50
金壶/appV1/pages/home/shop_management.vue
Normal file
50
金壶/appV1/pages/home/shop_management.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<view class="shop_management">
|
||||
很好
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {Config} from "@/utils/config.js"
|
||||
//import shop from "@/utils/models/shop.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopInfo: [],
|
||||
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
//this.get_shopInfo()
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 退出登录
|
||||
login_out(){
|
||||
// 清除config的token
|
||||
Config.Authorization = ''
|
||||
// 清除缓存
|
||||
uni.clearStorage()
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/index/x_login'
|
||||
// })
|
||||
},
|
||||
//获取店铺详情
|
||||
// async get_shopInfo() {
|
||||
// let res = await shop.getIndexShopInfo()
|
||||
// this.handleError(res, res => {
|
||||
// this.shopInfo = res.data
|
||||
// Config.shop_currency = res.data.currency
|
||||
// })
|
||||
// },
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user