1

parent e29f1366
<template> <template>
<view class="container"> <view class="container">
<Search :showTitle="true" :title="newAddressFlag ? '新增收货地址' : '编辑收货地址'" backgroundBox="white"></Search> <Search
:showTitle="true"
:title="newAddressFlag ? '新增收货地址' : '编辑收货地址'"
backgroundBox="white"
></Search>
<view class="content"> <view class="content">
<wd-form ref="reForm" :model="forMData" id="form"> <wd-form ref="reForm" :model="forMData" id="form">
<wd-cell-group> <wd-cell-group>
...@@ -117,7 +121,6 @@ const hdSubmit = async () => { ...@@ -117,7 +121,6 @@ const hdSubmit = async () => {
uni.navigateBack(); uni.navigateBack();
}, },
}); });
} catch (error) { } catch (error) {
console.log(error, 'error'); console.log(error, 'error');
} }
...@@ -176,7 +179,7 @@ page { ...@@ -176,7 +179,7 @@ page {
font-feature-settings: 'kern' on; font-feature-settings: 'kern' on;
.content { .content {
// padding-top: 88rpx; // padding-top: 88rpx;
#form { #form {
width: 710rpx; width: 710rpx;
......
<template> <template>
<view class="search-page"> <Search
<view backIcon="white"
class="search" backgroundBox="linear-gradient(180deg, #71c456 0%, rgba(243, 243, 243, 0) 100%)"
style="background: linear-gradient(180deg, #71c456 0%, rgba(243, 243, 243, 0) 100%)" >
> <view class="searchBox">
<wd-icon <wd-icon name="search" size="22rpx"></wd-icon>
name="thin-arrow-left" <input
class="icon" type="text"
@tap="back" :value="test"
:style="{ color: '#FFFAE8' }" class="text"
></wd-icon> @confirm="toSearch"
<slot></slot> placeholder="请输入搜索内容"
<view class="searchBox"> confirm-type="搜索"
<wd-icon name="search" size="22rpx"></wd-icon> />
<input
type="text"
:value="test"
class="text"
@confirm="toSearch"
placeholder="请输入搜索内容"
confirm-type="搜索"
/>
</view>
</view> </view>
</view> </Search>
<wd-tabs custom-class="tabss" v-model="tab"> <!-- <wd-tabs custom-class="tabss" v-model="tab">
<block v-for="(item, index) in tabs" :key="index"> <block v-for="(item, index) in tabs" :key="index">
<wd-tab :title="item"> <wd-tab :title="item">
<view class="content1" v-show="tab === 0"> <view class="content1" v-show="tab === 0">
...@@ -62,7 +53,16 @@ ...@@ -62,7 +53,16 @@
</view> </view>
</wd-tab> </wd-tab>
</block> </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> </template>
<script setup> <script setup>
...@@ -74,6 +74,7 @@ const value = ref(5); ...@@ -74,6 +74,7 @@ const value = ref(5);
const commoditys = ref([]); const commoditys = ref([]);
const shops = ref([]); const shops = ref([]);
const baseImgurl = import.meta.env.VITE_APP_IMG_URL; const baseImgurl = import.meta.env.VITE_APP_IMG_URL;
const active = ref(false);
function changeValue({ value }) { function changeValue({ value }) {
console.log(value); console.log(value);
} }
...@@ -99,9 +100,12 @@ const toSearch = (data) => { ...@@ -99,9 +100,12 @@ const toSearch = (data) => {
// 商品搜索 // 商品搜索
params.prodName = keyword; params.prodName = keyword;
searchCommodity(params).then((res) => { searchCommodity(params).then((res) => {
active.value = true;
res.data.data.forEach((item) => { res.data.data.forEach((item) => {
const imgs = item.imgs.split(','); if (item.imgs) {
item.imgUrl = baseImgurl + imgs[0]; const imgs = item.imgs.split(',');
item.imgUrl = baseImgurl + imgs[0];
}
}); });
commoditys.value = res.data.data; commoditys.value = res.data.data;
}); });
...@@ -134,43 +138,68 @@ function toDetail(item) { ...@@ -134,43 +138,68 @@ function toDetail(item) {
page { page {
background: #f6f6f6; background: #f6f6f6;
} }
.search-page { .searchBox {
.search { opacity: 1;
width: 100%; width: 350rpx;
height: 124rpx; height: 56rpx;
opacity: 0.8; background: #ffffff;
margin: 0 auto; border-radius: 28rpx 28rpx 28rpx 28rpx;
display: flex;
align-items: center;
padding-left: 20rpx;
margin-left: 50rpx;
.magnifyingGlass {
width: 26rpx;
height: 26rpx;
}
.text {
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; display: flex;
align-items: center; flex-direction: column;
padding-left: 20rpx; justify-content: space-around;
box-sizing: border-box; .text {
.arrow { font-weight: bold;
width: 15rpx; font-size: 26rpx;
height: 24rpx;
} }
.icon { .text2 {
font-size: 28rpx; font-weight: bold;
font-size: 22rpx;
color: red;
} }
.searchBox { .collection {
opacity: 1; font-size: 22rpx;
width: 350rpx; color: rgb(147, 145, 145);
height: 56rpx;
background: #ffffff;
border-radius: 28rpx 28rpx 28rpx 28rpx;
display: flex;
align-items: center;
padding-left: 20rpx;
margin-left: 20rpx;
.magnifyingGlass {
width: 26rpx;
height: 26rpx;
}
.text {
margin-left: 10rpx;
font-size: 24rpx;
}
} }
} }
.btn {
text-align: center;
border-radius: 50rpx;
background: #2fb641;
font-size: 22rpx;
padding: 8rpx 15rpx;
color: white;
box-sizing: border-box;
}
} }
:deep(.wd-tabs__line) { :deep(.wd-tabs__line) {
......
...@@ -807,7 +807,7 @@ page { ...@@ -807,7 +807,7 @@ page {
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08); box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
margin: 0 auto; margin: 0 auto;
margin-top: 10rpx; margin-top: 10rpx;
// position: sticky; position: relative;
// top: 0; // top: 0;
z-index: 99; z-index: 99;
uni-scroll-view .uni-scroll-view::-webkit-scrollbar { 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