Compare commits

...

4 Commits

Author SHA1 Message Date
754963fe17 【类 型】:feat
【原  因】:主页点击 ”商品购买按钮“ 跳转页面时候跳转到 指定的'shop'标签的导航的高度位置
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2025-05-12 03:02:58 +08:00
1cd4d15bac 【类 型】:factor
【原  因】:1.首页有用户手机显示用户手机没有显示登录链接2.站长推荐模块3.从服务器获取banner列表 计算属性
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2025-05-12 02:18:55 +08:00
f69f6e7c62 【类 型】:feat
【原  因】:从接口拿banner列表数据 参数配置文件里面加banner的路径参数
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2025-05-12 02:16:53 +08:00
0b85c6c77d 【类 型】:factor
【原  因】:删除banner本地文件(从接口拿数据 和服务器去banner的图片)
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2025-05-12 02:14:20 +08:00
6 changed files with 133 additions and 8 deletions

View File

@ -11,6 +11,8 @@
this.$store.dispatch('fetchSiteList')
//
this.$store.dispatch('fetchMenuList')
//banner
this.$store.dispatch('fetchBannerList')
// Promise
const promises = []
//spu
@ -372,6 +374,10 @@
.h100 {
height: 100%;
}
.h80{
height: 80%;
}
.vw100 {
width: 100vw;
@ -380,6 +386,9 @@
.w100 {
width: 100%;
}
.w80{
width: 80%;
}
.w-80rpx {
width: 80rpx;

View File

@ -8,8 +8,11 @@
<u-avatar size="80rpx" :src="avatarSrc"></u-avatar>
</view>
<view class="flex1 m-l-24 flex mac h100">
<navigator open-type="redirect" url="/pages/main/login">
<view class="fb fz32">{{userInfo.tel}}</view>
<!-- 已登录只显示手机号 -->
<view v-if="userInfo.tel" class="fb fz32">{{ userInfo.tel }}</view>
<!-- 未登录显示请登录并跳转 -->
<navigator v-else open-type="redirect" url="/pages/main/login">
<view class="fb fz32">请登录</view>
</navigator>
<u-icon name="arrow-right"></u-icon>
</view>
@ -28,12 +31,39 @@
</view> -->
<!-- 主按钮 -->
<view class="flex mse" style="margin-top: 30rpx;">
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
<mainBut url="/pages/shop/list" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐"
butSt="Order Now" />
<mainBut url="/pages/shop/list?tag=shop" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品"
butSt="Buy Goods" />
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
</view>
<!-- 站长推荐 -->
<view class="flex mc">
<view class="flex recommendBox column mc">
<!-- 站长推荐标题 -->
<view class="flex recommendTit column">
<view class="flex recommendTitBut rad16 column mac">
<view class="flex w80 mse">
<view class="recommendTitButTiao" v-for="i in 11" :key="i"></view>
</view>
<view class="flex mc mac h100">
<view class="fz32 fb" style="color: #fff">站长推荐</view>
</view>
</view>
<view class="flex mse" style="height: 18rpx;width: 252rpx; ">
<view style="width:6rpx;background-color: #383838;" v-for="i in 2" :key="i"></view>
</view>
</view>
<!-- 站长推荐内容 -->
<swiper class="recommendSwiper" circular autoplay interval="6000">
<swiper-item v-for="(item, index) in recommendList" :key="index">
<!-- <view class="recommendSwiper-item rad8 h100 boxshadow m-l-12 m-r-12" ></view> -->
<listItem :spu="item">
</listItem>
</swiper-item>
</swiper>
</view>
</view>
<!-- tabbar -->
<view>
<tabbar></tabbar>
@ -50,9 +80,6 @@
data() {
return {
avatarSrc: "", //
bannerList: [{ //banner
url: '/static/banner1.png'
}],
}
},
computed: {
@ -62,8 +89,21 @@
//
orderList() {
return this.$store.state.orderList.filter(item => item.main_status === '已付款')
},
//spu
recommendList() {
return this.$store.state.spuList.filter(item => item.recommend === '1')
},
//banner
bannerList() {
return this.$store.state.bannerList
.filter(item => item.type === 'index')
.map(item => ({
url: item.photo
}))
}
},
watch: {},
created() {
//token
this.checkUserInfo()
@ -87,4 +127,36 @@
transform: translateX(-50%);
top: 494rpx;
}
.recommendBox {
width: 702rpx;
margin-top: 48rpx;
}
.recommendTit {
height: 90rpx;
}
.recommendTitBut {
width: 252rpx;
height: 72rpx;
background-color: $uni-color-error;
}
.recommendTitButTiao {
width: 8rpx;
height: 4rpx;
background-color: $uni-text-color-inverse;
}
.recommendSwiper {
width: 702rpx;
height: 224rpx;
}
.recommendSwiper-item {
background-color: $uni-bg-color;
width: 680rpx;
height: 184rpx;
}
</style>

View File

@ -97,8 +97,22 @@
scrollingTiemout: null, //timeout
}
},
onLoad(options) {
//getshop
if (options.tag === 'shop') {
this.$nextTick(() => {
setTimeout(() => {
const index = this.menuList.findIndex(item => item.tag === 'shop')
if (index !== -1) {
this.swichMenu(index)
}
}, 300) // 300msmenuList
})
}
},
onReady() {
this.getMenuItemTop()
//this.swichMenu(this.menuList.length - 1) //
},
onShow() {
// tabber

View File

@ -1,6 +1,7 @@
const host = 'https://szdot.top'
const baseURL = host + '/flycube.php'
const listPath = host + '/Data/UploadFiles/category/'
const bannerPath = host + '/Data/UploadFiles/banner/'
const spuPath = host + '/Data/UploadFiles/spu/'
const skuPath = host + '/Data/UploadFiles/sku/'
const sitePath = host + '/Data/UploadFiles/site/'
@ -11,6 +12,7 @@ export default {
* host 主站
* api接口地址
* 分类列表路径
* banner图片路径
* spu产品图片路径
* sku产品图片路径
* 站点图片路径
@ -19,6 +21,7 @@ export default {
"host": host,
"baseURL": baseURL,
"listPath": listPath,
"bannerPath": bannerPath,
"spuPath": spuPath,
"skuPath": skuPath,
"sitePath": sitePath,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

View File

@ -10,6 +10,7 @@ const {
host,
baseURL,
listPath,
bannerPath,
spuPath,
skuPath,
sitePath,
@ -35,6 +36,7 @@ const store = new Vuex.Store({
menuList: [], //分类列表
spuList: [], //spu列表
skuList: [], //sku列表
bannerList: [], //banner列表
shopCon: {}, //商铺信息
cartList: [], //购物车列表 结构:[{"spu_id":"id","skuG":[sku_id,sku_id],"conutG":[数量,数量],"priceG":[单价,单价]},{.....}]
@ -102,6 +104,10 @@ const store = new Vuex.Store({
setSkuList(state, list) {
state.skuList = list
},
//设置banner列表
setBannerList(state, list) {
state.bannerList = list
},
//设置商铺信息
setShopCon(state, obj) {
state.shopCon = obj
@ -270,6 +276,27 @@ const store = new Vuex.Store({
}
})
},
//获取banner列表
async fetchBannerList({
state,
commit
}) {
await uni.$u.http.get('/Api/Normal/getBannerList', {
params: {
shop_id: state.shop_id
}
}).then(res => {
if (res.data.status === 1) {
res.data.bannerList.forEach(banner => {
banner.photo = bannerPath + banner.photo
})
//更新数据
commit('setBannerList', res.data.bannerList)
} else {
commit('setBannerList', [])
}
})
},
// 获取spu列表
fetchSpuList({
state,