fix: 样式调整,域名修改;

main
wx-jincw 2 weeks ago
parent f1803e2f8f
commit 94d77e18ee

@ -10,7 +10,8 @@ VITE_APP_ENV = 'development'
VITE_APP_MP_APPID = 'wx42bbe857570c5b40' VITE_APP_MP_APPID = 'wx42bbe857570c5b40'
# 统一接口域名 # 统一接口域名
VITE_APP_BASE_API = 'https://wy6.test.jiutianda.cn' # VITE_APP_BASE_API = 'https://wy6.test.jiutianda.cn'
VITE_APP_BASE_API = 'http://124.71.134.146:18086'
# 图片域名 # 图片域名
VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/'

@ -10,7 +10,7 @@ VITE_APP_ENV = 'production'
VITE_APP_MP_APPID = 'wx42bbe857570c5b40' VITE_APP_MP_APPID = 'wx42bbe857570c5b40'
# 统一接口域名 # 统一接口域名
VITE_APP_BASE_API = 'http://127.0.0.1:8086' VITE_APP_BASE_API = 'http://124.71.134.146:18086'
# 图片域名 # 图片域名
VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/'

@ -1,9 +1,9 @@
<script setup> <script setup>
http.getCartCount() http.getCartCount();
</script> </script>
<style lang="scss" scoped> <style lang="scss">
@import "./app.css"; @import './app.css';
/* 隐藏头部 */ /* 隐藏头部 */
uni-page-head { uni-page-head {
display: none; display: none;

@ -1,109 +1,117 @@
/**app.wxss**/ /**app.wxss**/
.container { .container {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
color: #333; color: #333;
font-family: helvetica,'Heiti SC',PingFangSC-Light; font-family: helvetica, 'Heiti SC', PingFangSC-Light;
} }
.price{
font-family: Arial; .price {
display: inline-block; font-family: Arial;
color: #eb2444; display: inline-block;
padding-bottom:10rpx; color: #eb2444;
padding-left:10rpx; padding-bottom: 10rpx;
} padding-left: 10rpx;
}
/* 价格数字显示不同大小 */
.symbol { /* 价格数字显示不同大小 */
font-size: 24rpx; .symbol {
} font-size: 34rpx;
}
.big-num {
font-size: 32rpx; .big-num {
} font-size: 32rpx;
}
.small-num {
font-size: 24rpx; .small-num {
} font-size: 24rpx;
}
/*
*checkbox /*
* *checkbox
*/ *
/* reg */ */
uni-checkbox-group { /* reg */
width: 100% !important; uni-checkbox-group {
} width: 100% !important;
uni-checkbox-group uni-label{ }
width: 33% !important;
display: inline-flex; uni-checkbox-group uni-label {
margin-bottom: 20rpx; width: 33% !important;
} display: inline-flex;
/*checkbox 选项框大小 */ margin-bottom: 20rpx;
uni-checkbox .uni-checkbox-input{ }
width: 38rpx !important;
height: 38rpx !important; /*checkbox 选项框大小 */
border-radius: 50%!important; uni-checkbox .uni-checkbox-input {
} width: 38rpx !important;
/*checkbox选中后样式 */ height: 38rpx !important;
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked{ border-radius: 50% !important;
background: #e43130; }
border: 1px solid transparent !important;
} /*checkbox选中后样式 */
/*checkbox选中后图标样式 */ uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{ background: #e43130;
display: inline-block; border: 1px solid transparent !important;
width: 20rpx; }
height: 20rpx;
line-height: 20rpx; /*checkbox选中后图标样式 */
text-align: center; uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
font-size: 18rpx; display: inline-block;
color: #fff; width: 20rpx;
background: transparent; height: 20rpx;
transform: translate(-60%, -50%) scale(1); line-height: 20rpx;
-webkit-transform: translate(-60%, -50%) scale(1); text-align: center;
} font-size: 18rpx;
color: #fff;
/* background: transparent;
*radio transform: translate(-60%, -50%) scale(1);
* -webkit-transform: translate(-60%, -50%) scale(1);
*/ }
/* 未选中的 背景样式 */
uni-radio .uni-radio-input{ /*
height: 36rpx; *radio
width: 36rpx; *
border-radius: 50%; */
background: transparent; /* 未选中的 背景样式 */
box-sizing: border-box; uni-radio .uni-radio-input {
} height: 36rpx;
/* 选中后的 背景样式 */ width: 36rpx;
uni-radio .uni-radio-input.uni-radio-input-checked{ border-radius: 50%;
border: none !important; background: transparent;
background: #e43130 !important; box-sizing: border-box;
} }
/* 选中后的 对勾样式 */
uni-radio .uni-radio-input.uni-radio-input-checked::before{ /* 选中后的 背景样式 */
border-radius: 50%; uni-radio .uni-radio-input.uni-radio-input-checked {
width: 32rpx; border: none !important;
height: 32rpx; background: #e43130 !important;
line-height: 32rpx; }
text-align: center;
font-size: 20rpx; /* 选中后的 对勾样式 */
color:#fff; uni-radio .uni-radio-input.uni-radio-input-checked::before {
background: #e43130; border-radius: 50%;
border-radius: 50%; width: 32rpx;
transform: translate(-50%, -50%) scale(1); height: 32rpx;
-webkit-transform: translate(-50%, -50%) scale(1); line-height: 32rpx;
} text-align: center;
font-size: 20rpx;
/* 底部按钮兼容 iPhone X以上 */ color: #fff;
@media screen and (width: 375px) and (height: 812px){ background: #e43130;
.container { border-radius: 50%;
padding-bottom: 70px; transform: translate(-50%, -50%) scale(1);
} -webkit-transform: translate(-50%, -50%) scale(1);
} }
@media screen and (width: 414px) and (height: 736px){
.container { /* 底部按钮兼容 iPhone X以上 */
padding-bottom: 70px; @media screen and (width: 375px) and (height: 812px) {
} .container {
padding-bottom: 70px;
}
}
@media screen and (width: 414px) and (height: 736px) {
.container {
padding-bottom: 70px;
}
} }

@ -1,399 +1,386 @@
<template> <template>
<view class="container"> <view class="container">
<view class="bg-sear"> <view class="bg-sear">
<view class="scrolltop"> <view class="scrolltop">
<view class="section" @tap="toSearchPage"> <view class="section" @tap="toSearchPage">
<image src="@/static/images/icon/search.png" class="search-img" /> <image src="@/static/images/icon/search.png" class="search-img" />
<text class="placeholder"> <text class="placeholder">搜索</text>
搜索 </view>
</text> </view>
</view> </view>
</view>
</view> <view class="content">
<!-- swiper -->
<view class="content"> <swiper
<!-- swiper --> :autoplay="autoplay"
<swiper :autoplay="autoplay" :indicator-color="indicatorColor" :interval="interval" :duration="duration" :indicator-color="indicatorColor"
:indicator-active-color="indicatorActiveColor + ' '" :circular="true" class="pic-swiper" indicator-dots :interval="interval"
previous-margin="20rpx" next-margin="20rpx"> :duration="duration"
<block v-for="(item, index) in indexImgs" :key="index"> :indicator-active-color="indicatorActiveColor + ' '"
<swiper-item class="banner-item"> :circular="true"
<view class="img-box"> class="pic-swiper"
<image :src="item.imgUrl" :data-prodid="item.relation" class="banner" @tap="toProdPage" /> indicator-dots
</view> previous-margin="20rpx"
</swiper-item> next-margin="20rpx"
</block> >
</swiper> <block v-for="(item, index) in indexImgs" :key="index">
<!-- end swiper --> <swiper-item class="banner-item">
<view class="img-box">
<view class="cat-item"> <image :src="item.imgUrl" :data-prodid="item.relation" class="banner" @tap="toProdPage" />
<view class="item" data-sts="1" @tap="toClassifyPage"> </view>
<image src="@/static/images/icon/newProd.png" /> </swiper-item>
<text>新品推荐</text> </block>
</view> </swiper>
<view class="item" data-sts="1" @tap="toClassifyPage"> <!-- end swiper -->
<image src="@/static/images/icon/timePrice.png" />
<text>限时特惠</text> <view class="cat-item">
</view> <view class="item" data-sts="1" @tap="toClassifyPage">
<view class="item" data-sts="3" @tap="toClassifyPage"> <image src="@/static/images/icon/newProd.png" />
<image src="@/static/images/icon/neweveryday.png" /> <text>新品推荐</text>
<text>每日疯抢</text> </view>
</view> <view class="item" data-sts="1" @tap="toClassifyPage">
<view class="item" @tap="toCouponCenter"> <image src="@/static/images/icon/timePrice.png" />
<image src="@/static/images/icon/newprods.png" /> <text>限时特惠</text>
<text>领优惠券</text> </view>
</view> <view class="item" data-sts="3" @tap="toClassifyPage">
</view> <image src="@/static/images/icon/neweveryday.png" />
<text>每日疯抢</text>
<!-- 消息播放 --> </view>
<view v-if="news && news.length" class="message-play" @tap="onNewsPage"> <view class="item" @tap="toCouponCenter">
<image src="@/static/images/icon/horn.png" class="hornpng" /> <image src="@/static/images/icon/newprods.png" />
<swiper :vertical="true" :autoplay="true" :circular="true" duration="1000" class="swiper-cont"> <text>领优惠券</text>
<block v-for="(item, index) in news" :key="index"> </view>
<swiper-item class="items"> </view>
{{ item.title }}
</swiper-item> <!-- 消息播放 -->
</block> <view v-if="news && news.length" class="message-play" @tap="onNewsPage">
</swiper> <image src="@/static/images/icon/horn.png" class="hornpng" />
<text class="arrow" /> <swiper :vertical="true" :autoplay="true" :circular="true" duration="1000" class="swiper-cont">
</view> <block v-for="(item, index) in news" :key="index">
</view> <swiper-item class="items">
{{ item.title }}
<view v-if="updata" class="updata"> </swiper-item>
<block v-for="(item, index) in taglist" :key="index"> </block>
<!-- 每日上新 --> </swiper>
<view v-if="item.style==='2' && item.prods && item.prods.length" class="up-to-date"> <text class="arrow" />
<view class="title"> </view>
<text>{{ item.title }}</text> </view>
<view class="more-prod-cont" data-sts="0" :data-id="item.id" :data-title="item.title" @tap="toClassifyPage">
<text class="more"> <view v-if="updata" class="updata">
查看更多 <block v-for="(item, index) in taglist" :key="index">
</text> <!-- 每日上新 -->
</view> <view v-if="item.style === '2' && item.prods && item.prods.length" class="up-to-date">
</view> <view class="title">
<view class="item-cont"> <text>{{ item.title }}</text>
<block v-for="(prod, index2) in item.prods" :key="index2"> <view class="more-prod-cont" data-sts="0" :data-id="item.id" :data-title="item.title" @tap="toClassifyPage">
<view class="prod-item" :data-prodid="prod.prodId" @tap="toProdPage"> <text class="more">查看更多</text>
<view> </view>
<view class="imagecont"> </view>
<img-show :src="prod.pic" :class-list="['prodimg']" /> <view class="item-cont">
</view> <block v-for="(prod, index2) in item.prods" :key="index2">
<view class="prod-text"> <view class="prod-item" :data-prodid="prod.prodId" @tap="toProdPage">
{{ prod.prodName }} <view>
</view> <view class="imagecont">
<view class="price"> <img-show :src="prod.pic" :class-list="['prodimg']" />
<text class="symbol"> </view>
<view class="prod-text">
</text> {{ prod.prodName }}
<text class="big-num"> </view>
{{ wxs.parsePrice(prod.price)[0] }} <view class="price">
</text> <text class="symbol"></text>
<text class="small-num"> <text class="big-num">
.{{ wxs.parsePrice(prod.price)[1] }} {{ wxs.parsePrice(prod.price)[0] }}
</text> </text>
</view> <text class="small-num">.{{ wxs.parsePrice(prod.price)[1] }}</text>
</view> </view>
</view> </view>
</block> </view>
</view> </block>
</view> </view>
</view>
<!-- 商城热卖 -->
<view v-if="item.style==='1' && item.prods && item.prods.length" class="hot-sale"> <!-- 商城热卖 -->
<view class="title"> <view v-if="item.style === '1' && item.prods && item.prods.length" class="hot-sale">
<text>{{ item.title }}</text> <view class="title">
<view class="more-prod-cont" data-sts="0" :data-id="item.id" :data-title="item.title" @tap="toClassifyPage"> <text>{{ item.title }}</text>
<text class="more"> <view class="more-prod-cont" data-sts="0" :data-id="item.id" :data-title="item.title" @tap="toClassifyPage">
更多 <text class="more">更多</text>
</text> <text class="arrow" />
<text class="arrow" /> </view>
</view> </view>
</view> <view class="hotsale-item-cont">
<view class="hotsale-item-cont"> <block v-for="(prod, index2) in item.prods" :key="index2">
<block v-for="(prod, index2) in item.prods" :key="index2"> <view class="prod-items" :data-prodid="prod.prodId" @tap="toProdPage">
<view class="prod-items" :data-prodid="prod.prodId" @tap="toProdPage"> <view class="hot-imagecont">
<view class="hot-imagecont"> <img-show :src="prod.pic" :class-list="['hotsaleimg']" />
<img-show :src="prod.pic" :class-list="['hotsaleimg']" /> </view>
</view> <view class="hot-text">
<view class="hot-text"> <view class="hotprod-text">
<view class="hotprod-text"> {{ prod.prodName }}
{{ prod.prodName }} </view>
</view> <view class="prod-info">
<view class="prod-info"> {{ prod.brief }}
{{ prod.brief }} </view>
</view> <view class="prod-text-info">
<view class="prod-text-info"> <view class="price">
<view class="price"> <text class="symbol"></text>
<text class="symbol"> <text class="big-num">
{{ wxs.parsePrice(prod.price)[0] }}
</text> </text>
<text class="big-num"> <text class="small-num">.{{ wxs.parsePrice(prod.price)[1] }}</text>
{{ wxs.parsePrice(prod.price)[0] }} </view>
</text> <image src="@/static/images/tabbar/basket-sel.png" class="basket-img" />
<text class="small-num"> </view>
.{{ wxs.parsePrice(prod.price)[1] }} </view>
</text> </view>
</view> </block>
<image src="@/static/images/tabbar/basket-sel.png" class="basket-img" /> </view>
</view> </view>
</view>
</view> <!-- 更多宝贝 -->
</block> <view v-if="item.style === '0' && item.prods && item.prods.length" class="more-prod">
</view> <view class="title">
</view> {{ item.title }}
</view>
<!-- 更多宝贝 --> <view class="prod-show">
<view v-if="item.style==='0' && item.prods && item.prods.length" class="more-prod"> <block v-for="(prod, index2) in item.prods" :key="index2">
<view class="title"> <view class="show-item" :data-prodid="prod.prodId" @tap="toProdPage">
{{ item.title }} <view class="more-prod-pic">
</view> <img-show :src="prod.pic" :class-list="['more-pic']" />
<view class="prod-show"> </view>
<block v-for="(prod, index2) in item.prods" :key="index2"> <view class="prod-text-right">
<view class="show-item" :data-prodid="prod.prodId" @tap="toProdPage"> <view class="prod-text more">
<view class="more-prod-pic"> {{ prod.prodName }}
<img-show :src="prod.pic" :class-list="['more-pic']" /> </view>
</view> <view class="prod-info">
<view class="prod-text-right"> {{ prod.brief }}
<view class="prod-text more"> </view>
{{ prod.prodName }} <view class="b-cart">
</view> <view class="price">
<view class="prod-info"> <text class="symbol"></text>
{{ prod.brief }} <text class="big-num">
</view> {{ wxs.parsePrice(prod.price)[0] }}
<view class="b-cart"> </text>
<view class="price"> <text class="small-num">.{{ wxs.parsePrice(prod.price)[1] }}</text>
<text class="symbol"> </view>
<image src="@/static/images/tabbar/basket-sel.png" class="basket-img" @tap.stop="addToCart(prod)" />
</text> </view>
<text class="big-num"> </view>
{{ wxs.parsePrice(prod.price)[0] }} </view>
</text> </block>
<text class="small-num"> </view>
.{{ wxs.parsePrice(prod.price)[1] }} </view>
</text> </block>
</view> </view>
<image src="@/static/images/tabbar/basket-sel.png" class="basket-img" @tap.stop="addToCart(prod)" /> </view>
</view> </template>
</view>
</view> <script setup>
</block> const wxs = number();
</view> const indicatorColor = ref('#d1e5fb');
</view> const indicatorActiveColor = ref('#1b7dec');
</block> const autoplay = ref(true);
</view> const interval = ref(2000);
</view> const duration = ref(1000);
</template> const indexImgs = ref([]);
const seq = ref(0);
<script setup> const news = ref([]);
const wxs = number() const taglist = ref([]);
const indicatorColor = ref('#d1e5fb') const updata = ref(true);
const indicatorActiveColor = ref('#1b7dec')
const autoplay = ref(true) onLoad(() => {
const interval = ref(2000) getAllData();
const duration = ref(1000) });
const indexImgs = ref([]) onShow(() => {
const seq = ref(0) // #ifdef MP-WEIXIN
const news = ref([]) uni.getSetting({
const taglist = ref([]) success(res) {
const updata = ref(true) if (!res.authSetting['scope.userInfo']) {
uni.navigateTo({
onLoad(() => { url: '/pages/login/login'
getAllData() });
}) }
onShow(() => { }
// #ifdef MP-WEIXIN });
uni.getSetting({ // #endif
success(res) { http.getCartCount(); //
if (!res.authSetting['scope.userInfo']) { });
uni.navigateTo({
url: '/pages/login/login' onPullDownRefresh(() => {
}) //
} setTimeout(() => {
} getAllData();
}) uni.stopPullDownRefresh(); //
// #endif }, 100);
http.getCartCount() // });
})
const getAllData = () => {
onPullDownRefresh(() => { http.getCartCount(); //
// getIndexImgs();
setTimeout(() => { getNoticeList();
getAllData() getTag();
uni.stopPullDownRefresh() // };
}, 100)
}) const toProdPage = (e) => {
const prodid = e.currentTarget.dataset.prodid;
const getAllData = () => {
http.getCartCount() // if (prodid) {
getIndexImgs() uni.navigateTo({
getNoticeList() url: '/pages/prod/prod?prodid=' + prodid
getTag() });
} }
};
const toProdPage = (e) => { /**
const prodid = e.currentTarget.dataset.prodid * 加入购物车
* @param item
if (prodid) { */
uni.navigateTo({ const addToCart = (item) => {
url: '/pages/prod/prod?prodid=' + prodid uni.showLoading({
}) mask: true
} });
} http
/** .request({
* 加入购物车 url: '/prod/prodInfo',
* @param item method: 'GET',
*/ data: {
const addToCart = (item) => { prodId: item.prodId
uni.showLoading({ }
mask: true })
}) .then(({ data }) => {
http.request({ http
url: '/prod/prodInfo', .request({
method: 'GET', url: '/p/shopCart/changeItem',
data: { method: 'POST',
prodId: item.prodId data: {
} basketId: 0,
}) count: 1,
.then(({ prodId: data.prodId,
data shopId: data.shopId,
}) => { skuId: data.skuList[0].skuId
http.request({ }
url: '/p/shopCart/changeItem', })
method: 'POST', .then(() => {
data: { uni.hideLoading();
basketId: 0, http.getCartCount(); //
count: 1, uni.showToast({
prodId: data.prodId, title: '加入购物车成功',
shopId: data.shopId, icon: 'none'
skuId: data.skuList[0].skuId });
} });
}) });
.then(() => { };
uni.hideLoading()
http.getCartCount() // const toCouponCenter = () => {
uni.showToast({ uni.showToast({
title: '加入购物车成功', icon: 'none',
icon: 'none' title: '功能开发中'
}) });
}) };
})
} /**
* 跳转搜索页
const toCouponCenter = () => { */
uni.showToast({ const toSearchPage = () => {
icon: 'none', uni.navigateTo({
title: '功能开发中' url: '/pages/search-page/search-page'
}) });
} };
/** /**
* 跳转搜索页 * 跳转商品活动页面
*/ * @param e
const toSearchPage = () => { */
uni.navigateTo({ const toClassifyPage = (e) => {
url: '/pages/search-page/search-page' let url = '/pages/prod-classify/prod-classify?sts=' + e.currentTarget.dataset.sts;
}) const id = e.currentTarget.dataset.id;
} const title = e.currentTarget.dataset.title;
/** if (id) {
* 跳转商品活动页面 url += '&tagid=' + id + '&title=' + title;
* @param e }
*/
const toClassifyPage = (e) => { uni.navigateTo({
let url = '/pages/prod-classify/prod-classify?sts=' + e.currentTarget.dataset.sts url
const id = e.currentTarget.dataset.id });
const title = e.currentTarget.dataset.title };
/**
if (id) { * 跳转公告列表页面
url += '&tagid=' + id + '&title=' + title */
} const onNewsPage = () => {
uni.navigateTo({
uni.navigateTo({ url: '/pages/recent-news/recent-news'
url });
}) };
}
/** /**
* 跳转公告列表页面 * 加载轮播图
*/ */
const onNewsPage = () => { const getIndexImgs = () => {
uni.navigateTo({ http
url: '/pages/recent-news/recent-news' .request({
}) url: '/indexImgs',
} method: 'GET',
data: {}
/** })
* 加载轮播图 .then(({ data }) => {
*/ indexImgs.value = data;
const getIndexImgs = () => { seq.value = data;
http.request({ });
url: '/indexImgs', };
method: 'GET',
data: {} const getNoticeList = () => {
}) //
.then(({ http
data .request({
}) => { url: '/shop/notice/topNoticeList',
indexImgs.value = data method: 'GET',
seq.value = data data: {}
}) })
} .then(({ data }) => {
news.value = data;
const getNoticeList = () => { });
// };
http.request({
url: '/shop/notice/topNoticeList', /**
method: 'GET', * 加载商品标题分组列表
data: {} */
}) const getTag = () => {
.then(({ http
data .request({
}) => { url: '/prod/tag/prodTagList',
news.value = data method: 'GET',
}) data: {}
} })
.then(({ data }) => {
/** taglist.value = data;
* 加载商品标题分组列表 for (let i = 0; i < data.length; i++) {
*/ updata.value = false;
const getTag = () => { updata.value = true;
http.request({ getTagProd(data[i].id, i);
url: '/prod/tag/prodTagList', }
method: 'GET', });
data: {} };
})
.then(({ const getTagProd = (id, index) => {
data http
}) => { .request({
taglist.value = data url: '/prod/prodListByTagId',
for (let i = 0; i < data.length; i++) { method: 'GET',
updata.value = false data: {
updata.value = true tagId: id,
getTagProd(data[i].id, i) size: 6
} }
}) })
} .then(({ data }) => {
updata.value = false;
const getTagProd = (id, index) => { updata.value = true;
http.request({ const taglistParam = taglist.value;
url: '/prod/prodListByTagId', taglistParam[index].prods = data.records;
method: 'GET', taglist.value = taglistParam;
data: { });
tagId: id, };
size: 6 </script>
}
}) <style scoped lang="scss">
.then(({ @use './index.scss';
data
}) => {
updata.value = false
updata.value = true
const taglistParam = taglist.value
taglistParam[index].prods = data.records
taglist.value = taglistParam
})
}
</script>
<style scoped lang="scss">
@use './index.scss';
</style> </style>

Loading…
Cancel
Save