feat: bug修改
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.shop-view{
|
.shop-view{
|
||||||
width:100%;
|
width: 700rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -4,15 +4,12 @@
|
|||||||
<view class="search-view">
|
<view class="search-view">
|
||||||
<view class="head-view">
|
<view class="head-view">
|
||||||
<u-icon size="30rpx" name="arrow-left" @click="onBack" color="#333"></u-icon>
|
<u-icon size="30rpx" name="arrow-left" @click="onBack" color="#333"></u-icon>
|
||||||
<view class="search-box">
|
<view class="search-box" :style="{ maxWidth: searchBoxMaxWidth + 'rpx' }">
|
||||||
<input class="input-view wx-width" v-model="searchInput"></input>
|
<input class="input-view" v-model="searchInput" placeholder="请输入搜索关键词"></input>
|
||||||
<!-- <u-input class="input-view wx-width"
|
|
||||||
v-model="searchInput"></u-input> -->
|
|
||||||
<view class="search-btn flex-c" @click="onSearch">
|
<view class="search-btn flex-c" @click="onSearch">
|
||||||
<text class="text-32 text-white">搜索</text>
|
<text class="text-32 text-white">搜索</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="top-view mt-24">
|
<view class="top-view mt-24">
|
||||||
<view class="flex-r-lr">
|
<view class="flex-r-lr">
|
||||||
@@ -65,16 +62,18 @@ export default {
|
|||||||
historyList:[],
|
historyList:[],
|
||||||
isDel:false,
|
isDel:false,
|
||||||
dataList:[],
|
dataList:[],
|
||||||
|
searchBoxMaxWidth: 0 // 搜索框最大宽度
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
// 获取胶囊按钮位置信息,计算搜索框最大宽度
|
||||||
|
this.calculateSearchBoxMaxWidth();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(){
|
init(){
|
||||||
// this.isSignContract()
|
|
||||||
// this.getSignContract()
|
|
||||||
|
|
||||||
let arr = uni.getStorageSync('history') || '';
|
let arr = uni.getStorageSync('history') || '';
|
||||||
if(arr){
|
if(arr){
|
||||||
this.historyList = arr.split(',');
|
this.historyList = arr.split(',');
|
||||||
@@ -82,6 +81,24 @@ export default {
|
|||||||
this.historyList = [];
|
this.historyList = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 计算搜索框最大宽度,确保不与胶囊按钮重叠
|
||||||
|
calculateSearchBoxMaxWidth() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||||
|
if (menuButtonInfo) {
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
// 计算屏幕宽度减去左侧内边距和胶囊按钮左侧距离
|
||||||
|
// 左侧内边距32rpx转换为px
|
||||||
|
const leftPadding = 32 * (systemInfo.windowWidth / 750);
|
||||||
|
// 箭头图标宽度和间距约为30rpx + 24rpx = 54rpx
|
||||||
|
const arrowWidth = 54 * (systemInfo.windowWidth / 750);
|
||||||
|
// 计算搜索框最大宽度(px)
|
||||||
|
const maxWidthPx = menuButtonInfo.left - leftPadding - arrowWidth - 20; // 20px额外间距
|
||||||
|
// 转换为rpx
|
||||||
|
this.searchBoxMaxWidth = Math.ceil(maxWidthPx * (750 / systemInfo.windowWidth));
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
onJump(item){
|
onJump(item){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/other_package/productInfo/productInfo?id='+item.id,
|
url: '/pages/other_package/productInfo/productInfo?id='+item.id,
|
||||||
@@ -108,7 +125,6 @@ export default {
|
|||||||
this.onSave()
|
this.onSave()
|
||||||
},
|
},
|
||||||
onAdd(){
|
onAdd(){
|
||||||
|
|
||||||
if(this.searchInput){
|
if(this.searchInput){
|
||||||
let bool = false;
|
let bool = false;
|
||||||
this.historyList.forEach(item=>{
|
this.historyList.forEach(item=>{
|
||||||
@@ -123,7 +139,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onSave();
|
this.onSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onText(item){
|
onText(item){
|
||||||
@@ -218,7 +233,7 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
.search-box{
|
.search-box{
|
||||||
width:100%;
|
/* 移除flex:1,使用固定最大宽度 */
|
||||||
height:84rpx;
|
height:84rpx;
|
||||||
min-height:16rpx;
|
min-height:16rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -238,19 +253,11 @@ export default {
|
|||||||
.input-view{
|
.input-view{
|
||||||
height:72rpx;
|
height:72rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 30rpx !important;
|
padding: 0 7rpx !important;
|
||||||
border-radius: 36rpx;
|
border-radius: 36rpx;
|
||||||
margin-left:12rpx;
|
margin-left:12rpx;
|
||||||
flex:1;
|
flex:1; /* 输入框在搜索框内自适应 */
|
||||||
}
|
}
|
||||||
/* #ifdef MP-WEIXIN */
|
|
||||||
.wx-width{
|
|
||||||
width:350rpx !important;
|
|
||||||
flex:none;
|
|
||||||
}
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,170 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<TopSafe></TopSafe>
|
|
||||||
<Header title="兑换券专区" >
|
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
|
||||||
<template v-slot:right>
|
|
||||||
<u-icon name="share-fill" @click="onShare" color="#333" size="24"></u-icon>
|
|
||||||
</template>
|
|
||||||
<!-- #endif -->
|
|
||||||
</Header>
|
|
||||||
<view class="swiper-view">
|
|
||||||
<up-swiper
|
|
||||||
:list="swiperList"
|
|
||||||
style="width:100%"
|
|
||||||
circular
|
|
||||||
></up-swiper>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="mid-panel">
|
|
||||||
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
|
|
||||||
<view style="margin:0 12rpx">信任桥兑换</view>
|
|
||||||
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
|
|
||||||
</view>
|
|
||||||
<view class="setting-view">
|
|
||||||
<FenItem @ok="onJumpShop" style="margin-top:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></FenItem>
|
|
||||||
</view>
|
|
||||||
<up-toast ref="uToastRef"></up-toast>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Header from '@/components/common/header.vue';
|
|
||||||
import TopSafe from '@/components/common/top-safe.nvue'
|
|
||||||
import MyBtn from '@/components/common/my-btn.vue'
|
|
||||||
import FenItem from '@/components/shop/fen-item.vue'
|
|
||||||
import { searchList } from '@/api/product.js';
|
|
||||||
import { getCarouselImage } from '@/api/common.js';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { Header, TopSafe,MyBtn,FenItem },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dataList:[],
|
|
||||||
swiperList: ['https://cdn.uviewui.com/uview/swiper/swiper1.png'],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
this.getSearchList();
|
|
||||||
this.getCarouselImage();
|
|
||||||
},
|
|
||||||
async getCarouselImage(){
|
|
||||||
const params={
|
|
||||||
pageUi:6,
|
|
||||||
}
|
|
||||||
const resp = await getCarouselImage(params);
|
|
||||||
if(resp && resp.bizcode === 100){
|
|
||||||
const data = resp.data || [];
|
|
||||||
this.swiperList = data.length !== 0 ? data.map(obj=>obj.carouselImage) : [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async getSearchList(){
|
|
||||||
const params = {
|
|
||||||
type:3,
|
|
||||||
page:1,
|
|
||||||
pageSize:99,
|
|
||||||
}
|
|
||||||
const resp = await searchList(params);
|
|
||||||
if(resp && resp.bizcode === 100){
|
|
||||||
this.dataList = resp.data || [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onJumpShop(id){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/other_package/productInfo/productInfo?id='+id,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onShare(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/other_package/invite_friends/invite_friends',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.bottom-btn{
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom:92rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
}
|
|
||||||
.mid-panel{
|
|
||||||
width:100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height:120rpx;
|
|
||||||
min-height:120rpx;
|
|
||||||
}
|
|
||||||
.swiper-view{
|
|
||||||
width:100%;
|
|
||||||
height:268rpx;
|
|
||||||
min-height:268rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.setting-view {
|
|
||||||
width: 100%;
|
|
||||||
height: calc(100% - 88rpx - 268rpx - 156rpx - var(--status-bar-height));
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 0 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
position: relative;
|
|
||||||
.name-box{
|
|
||||||
width:100%;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 64rpx 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top:24rpx;
|
|
||||||
.mid-view{
|
|
||||||
width:100%;
|
|
||||||
padding: 40rpx 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
border:2rpx solid #eaeaea;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
margin-top:48rpx;
|
|
||||||
}
|
|
||||||
.top-view{
|
|
||||||
width:100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.input-view{
|
|
||||||
border-radius: 20rpx;
|
|
||||||
margin-top:52rpx;
|
|
||||||
width:100%;
|
|
||||||
padding: 0 32rpx;
|
|
||||||
min-height:104rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -205,6 +205,11 @@ export default {
|
|||||||
height: auto;
|
height: auto;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
::v-deep(.u-swiper__wrapper) {
|
||||||
|
.u-swiper__wrapper__item__wrapper {
|
||||||
|
background: linear-gradient(270deg, #af39c4 0%, #7732ff 100%)!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
.top-box {
|
.top-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-bottom: 24rpx;
|
padding-bottom: 24rpx;
|
||||||
@@ -214,7 +219,7 @@ export default {
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
.swiper-card {
|
.swiper-card {
|
||||||
padding: 12rpx 32rpx 0;
|
padding: 12rpx 32rpx 0;
|
||||||
height:200rpx;
|
height:200rpx;
|
||||||
}
|
}
|
||||||
.swiper-title {
|
.swiper-title {
|
||||||
padding: 3rpx 16rpx;
|
padding: 3rpx 16rpx;
|
||||||
@@ -230,7 +235,7 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
background-color: #f0e7fe;
|
background-color: #fee7ef;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
}
|
}
|
||||||
.swiper-center {
|
.swiper-center {
|
||||||
@@ -328,7 +333,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.setting-view {
|
.setting-view {
|
||||||
width: 100%;
|
width: 700rpx;
|
||||||
// height: calc(100% - var(--status-bar-height));
|
// height: calc(100% - var(--status-bar-height));
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -375,5 +380,6 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onJump(index){
|
onJump(index){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pages/rwa_package//zhao/zhaopian?type=${index}`
|
url:`/pages/rwa_package/zhao/zhao?type=${index}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user