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');
} }
......
<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%)"
> >
<wd-icon
name="thin-arrow-left"
class="icon"
@tap="back"
:style="{ color: '#FFFAE8' }"
></wd-icon>
<slot></slot>
<view class="searchBox"> <view class="searchBox">
<wd-icon name="search" size="22rpx"></wd-icon> <wd-icon name="search" size="22rpx"></wd-icon>
<input <input
...@@ -22,9 +14,8 @@ ...@@ -22,9 +14,8 @@
confirm-type="搜索" confirm-type="搜索"
/> />
</view> </view>
</view> </Search>
</view> <!-- <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) => {
if (item.imgs) {
const imgs = item.imgs.split(','); const imgs = item.imgs.split(',');
item.imgUrl = baseImgurl + imgs[0]; item.imgUrl = baseImgurl + imgs[0];
}
}); });
commoditys.value = res.data.data; commoditys.value = res.data.data;
}); });
...@@ -134,24 +138,7 @@ function toDetail(item) { ...@@ -134,24 +138,7 @@ function toDetail(item) {
page { page {
background: #f6f6f6; background: #f6f6f6;
} }
.search-page { .searchBox {
.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 {
opacity: 1; opacity: 1;
width: 350rpx; width: 350rpx;
height: 56rpx; height: 56rpx;
...@@ -160,7 +147,7 @@ page { ...@@ -160,7 +147,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 20rpx; padding-left: 20rpx;
margin-left: 20rpx; margin-left: 50rpx;
.magnifyingGlass { .magnifyingGlass {
width: 26rpx; width: 26rpx;
height: 26rpx; height: 26rpx;
...@@ -169,7 +156,49 @@ page { ...@@ -169,7 +156,49 @@ page {
margin-left: 10rpx; margin-left: 10rpx;
font-size: 24rpx; 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 { ...@@ -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