123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <template>
- <view class="content">
- <view class="varHeight"></view>
- <view class="banner position-relative">
- <image class="bgImg" src="../../static/img/img10.png" mode="scaleToFill"></image>
- <view class="flex shpingInfo position-relative">
- <view class="logoBox flex">
- <image class="logo" :src="info.logo" mode="scaleToFill"></image>
- <view class="shopingTitle">{{info.title}}</view>
- </view>
- <icon class="shopingExit" type="clear" color="#FFFFFF" @click="backUrl"></icon>
- </view>
- <view class="serachBox flex position-relative">
- <view class="serachInput flex">
- <icon :size="iconSize" type="search" color="#FFFFFF"></icon>
- <input class="search" placeholder="搜索" @blur='confirm' placeholder-style="color:#ffffff" type="text" :value="search" @confirm="confirm" />
- </view>
- </view>
- </view>
- <view class="list position-relative">
- <list ref='dataList'></list>
- </view>
- </view>
- </template>
- <script>
- import list from '@/pages/product/list';
- import {getShoping} from '@/api/shoping.js';
- export default {
- components: { list },
- data() {
- return {
- // 当前选中的滑块
- current: 0,
- // 门店信息
- info: {
- logo:'',
- title:'',
- },
- ratio: '', //页面比例信息
- search: '' ,//店铺搜索商品
- //商店详情
- };
- },
- onLoad(pt) {
- // 保存商户id
- this.info.id = pt.merid;
- this.getShoping();
- },
- onReachBottom(e) {
- // 底部加载数据
- this.$refs.dataList.loadData();
- },
- onReady() {
- // 保存商家id
- this.$refs.dataList.mer_id = this.info.id;
- // 加载数据
- this.$refs.dataList.loadData();
- // 加载分类
- this.$refs.dataList.loadCateList();
- let obj = this;
- let query = uni.createSelectorQuery();
- // 获取页面比例
- query
- .select('.content')
- .fields(
- {
- size: true
- },
- e => {
- // 保存比例
- this.ratio = e.width / 750;
- }
- )
- .exec();
- },
- computed: {
- // 计算图标大小
- iconSize() {
- return 28 * this.ratio;
- }
- },
- methods: {
- //获取商店信息
- getShoping(){
- let obj = this;
- getShoping({
- mer_id:this.info.id
- }).then(function({ data }) {
- obj.info = data
- }).catch((e) => {
- console.log(e)
- });
- },
- // 滑块切换时触发方法
- changeIndex(e) {
- this.current = e.current;
- },
- // 搜索确认事件
- confirm(e){
- this.$refs.dataList.keyword=e.detail.value;
- this.$refs.dataList.page=1
- this.$refs.dataList.loadData('refresh');
- },
- // 回退功能
- backUrl(){
- uni.navigateBack()
- }
-
- }
- };
- </script>
- <style lang="scss">
- page,
- .content {
- height: 100%;
- }
- .varHeight {
- height: var(--status-bar-height);
- }
- .banner {
- .shpingInfo {
- padding: 30rpx $page-row-spacing;
- .logoBox {
- .logo {
- height: 90rpx;
- width: 90rpx;
- border-radius: 10rpx;
- }
- .shopingTitle {
- padding-left: 20rpx;
- color: #ffffff;
- font-size: $font-lg;
- }
- }
- .shopingExit {
- }
- }
- .serachBox,
- .shpingInfo {
- z-index: 999;
- }
- .bgImg {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- .serachBox {
- padding: 0 $page-row-spacing;
- padding-bottom: 20rpx;
- width: 100%;
- .serachInput {
- background-color: rgba($color: #f1f1f1, $alpha: 0.5);
- border-radius: 100rpx;
- padding: 10rpx 25rpx;
- width: 100%;
- .search {
- padding-left: 20rpx;
- width: 100%;
- color: #ffffff;
- font-size: 28rpx;
- }
- }
- }
- }
- </style>
|