1

parent e29f1366
<template>
<view class="container">
<Search :showTitle="true" :title="newAddressFlag ? '新增收货地址' : '编辑收货地址'" backgroundBox="white"></Search>
<Search
:showTitle="true"
:title="newAddressFlag ? '新增收货地址' : '编辑收货地址'"
backgroundBox="white"
></Search>
<view class="content">
<wd-form ref="reForm" :model="forMData" id="form">
<wd-cell-group>
......@@ -117,7 +121,6 @@ const hdSubmit = async () => {
uni.navigateBack();
},
});
} catch (error) {
console.log(error, 'error');
}
......
<template>
<view class="search-page">
<view
class="search"
style="background: linear-gradient(180deg, #71c456 0%, rgba(243, 243, 243, 0) 100%)"
<Search
backIcon="white"
backgroundBox="linear-gradient(180deg, #71c456 0%, rgba(243, 243, 243, 0) 100%)"
>
<wd-icon
name="thin-arrow-left"
class="icon"
@tap="back"
:style="{ color: '#FFFAE8' }"
></wd-icon>
<slot></slot>
<view class="searchBox">
<wd-icon name="search" size="22rpx"></wd-icon>
<input
......@@ -22,9 +14,8 @@
confirm-type="搜索"
/>
</view>
</view>
</view>
<wd-tabs custom-class="tabss" v-model="tab">
</Search>
<!-- <wd-tabs custom-class="tabss" v-model="tab">
<block v-for="(item, index) in tabs" :key="index">
<wd-tab :title="item">
<view class="content1" v-show="tab === 0">
......@@ -62,7 +53,16 @@
</view>
</wd-tab>
</block>
</wd-tabs>
</wd-tabs> -->
<view class="shopitem" v-for="(item, index) in commoditys" :key="index" @tap="toDetail(item)">
<image class="img" :src="item.imgUrl" mode="aspectFill" />
<view class="middle">
<text class="text">{{ item.prodName }}</text>
<text class="text2">{{ item.price }}</text>
<text class="collection">月销量{{ item.soldNum }}</text>
</view>
</view>
<wd-status-tip image="content" tip="暂无商品" v-if="commoditys.length === 0 && active" />
</template>
<script setup>
......@@ -74,6 +74,7 @@ const value = ref(5);
const commoditys = ref([]);
const shops = ref([]);
const baseImgurl = import.meta.env.VITE_APP_IMG_URL;
const active = ref(false);
function changeValue({ value }) {
console.log(value);
}
......@@ -99,9 +100,12 @@ const toSearch = (data) => {
// 商品搜索
params.prodName = keyword;
searchCommodity(params).then((res) => {
active.value = true;
res.data.data.forEach((item) => {
if (item.imgs) {
const imgs = item.imgs.split(',');
item.imgUrl = baseImgurl + imgs[0];
}
});
commoditys.value = res.data.data;
});
......@@ -134,24 +138,7 @@ function toDetail(item) {
page {
background: #f6f6f6;
}
.search-page {
.search {
width: 100%;
height: 124rpx;
opacity: 0.8;
margin: 0 auto;
display: flex;
align-items: center;
padding-left: 20rpx;
box-sizing: border-box;
.arrow {
width: 15rpx;
height: 24rpx;
}
.icon {
font-size: 28rpx;
}
.searchBox {
.searchBox {
opacity: 1;
width: 350rpx;
height: 56rpx;
......@@ -160,7 +147,7 @@ page {
display: flex;
align-items: center;
padding-left: 20rpx;
margin-left: 20rpx;
margin-left: 50rpx;
.magnifyingGlass {
width: 26rpx;
height: 26rpx;
......@@ -169,7 +156,49 @@ page {
margin-left: 10rpx;
font-size: 24rpx;
}
}
.shopitem {
padding: 0 20rpx;
display: flex;
height: 200rpx;
background-color: white;
align-items: center;
border-bottom: 1rpx solid rgb(225, 223, 223);
.img {
width: 200rpx;
height: 150rpx;
border-radius: 16rpx;
flex-shrink: 0;
}
.middle {
height: 150rpx;
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
.text {
font-weight: bold;
font-size: 26rpx;
}
.text2 {
font-weight: bold;
font-size: 22rpx;
color: red;
}
.collection {
font-size: 22rpx;
color: rgb(147, 145, 145);
}
}
.btn {
text-align: center;
border-radius: 50rpx;
background: #2fb641;
font-size: 22rpx;
padding: 8rpx 15rpx;
color: white;
box-sizing: border-box;
}
}
......
......@@ -807,7 +807,7 @@ page {
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
margin: 0 auto;
margin-top: 10rpx;
// position: sticky;
position: relative;
// top: 0;
z-index: 99;
uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment