Compare commits

..

No commits in common. "754963fe17064bd072fc071739559a3acb68b5ba" and "d8179ff2fa9ed190b5ec0e1c333641d13b85206a" have entirely different histories.

6 changed files with 8 additions and 133 deletions

View File

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

View File

@ -8,11 +8,8 @@
<u-avatar size="80rpx" :src="avatarSrc"></u-avatar> <u-avatar size="80rpx" :src="avatarSrc"></u-avatar>
</view> </view>
<view class="flex1 m-l-24 flex mac h100"> <view class="flex1 m-l-24 flex mac h100">
<!-- 已登录只显示手机号 --> <navigator open-type="redirect" url="/pages/main/login">
<view v-if="userInfo.tel" class="fb fz32">{{ userInfo.tel }}</view> <view class="fb fz32">{{userInfo.tel}}</view>
<!-- 未登录显示请登录并跳转 -->
<navigator v-else open-type="redirect" url="/pages/main/login">
<view class="fb fz32">请登录</view>
</navigator> </navigator>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
@ -31,39 +28,12 @@
</view> --> </view> -->
<!-- 主按钮 --> <!-- 主按钮 -->
<view class="flex mse" style="margin-top: 30rpx;"> <view class="flex mse" style="margin-top: 30rpx;">
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" <mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
butSt="Order Now" /> <mainBut url="/pages/shop/list" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
<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" /> --> <!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
</view> </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 --> <!-- tabbar -->
<view> <view>
<tabbar></tabbar> <tabbar></tabbar>
@ -80,6 +50,9 @@
data() { data() {
return { return {
avatarSrc: "", // avatarSrc: "", //
bannerList: [{ //banner
url: '/static/banner1.png'
}],
} }
}, },
computed: { computed: {
@ -89,21 +62,8 @@
// //
orderList() { orderList() {
return this.$store.state.orderList.filter(item => item.main_status === '已付款') 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() { created() {
//token //token
this.checkUserInfo() this.checkUserInfo()
@ -127,36 +87,4 @@
transform: translateX(-50%); transform: translateX(-50%);
top: 494rpx; 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> </style>

View File

@ -97,22 +97,8 @@
scrollingTiemout: null, //timeout 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() { onReady() {
this.getMenuItemTop() this.getMenuItemTop()
//this.swichMenu(this.menuList.length - 1) //
}, },
onShow() { onShow() {
// tabber // tabber

View File

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

BIN
static/banner1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -10,7 +10,6 @@ const {
host, host,
baseURL, baseURL,
listPath, listPath,
bannerPath,
spuPath, spuPath,
skuPath, skuPath,
sitePath, sitePath,
@ -36,7 +35,6 @@ const store = new Vuex.Store({
menuList: [], //分类列表 menuList: [], //分类列表
spuList: [], //spu列表 spuList: [], //spu列表
skuList: [], //sku列表 skuList: [], //sku列表
bannerList: [], //banner列表
shopCon: {}, //商铺信息 shopCon: {}, //商铺信息
cartList: [], //购物车列表 结构:[{"spu_id":"id","skuG":[sku_id,sku_id],"conutG":[数量,数量],"priceG":[单价,单价]},{.....}] cartList: [], //购物车列表 结构:[{"spu_id":"id","skuG":[sku_id,sku_id],"conutG":[数量,数量],"priceG":[单价,单价]},{.....}]
@ -104,10 +102,6 @@ const store = new Vuex.Store({
setSkuList(state, list) { setSkuList(state, list) {
state.skuList = list state.skuList = list
}, },
//设置banner列表
setBannerList(state, list) {
state.bannerList = list
},
//设置商铺信息 //设置商铺信息
setShopCon(state, obj) { setShopCon(state, obj) {
state.shopCon = obj state.shopCon = obj
@ -276,27 +270,6 @@ 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列表 // 获取spu列表
fetchSpuList({ fetchSpuList({
state, state,