|
|
|
@ -1,11 +1,13 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="index" :id="`index${styleIndex}`"> |
|
|
|
|
<view class="navbarContent"> |
|
|
|
|
<u-navbar :is-back="false" :background="styleIndex ? { background: navBgColor } : background" :border-bottom="false"> |
|
|
|
|
<image :src="logoImage" mode="heightFix" class="logo"></image> |
|
|
|
|
<u-navbar :is-back="false" :background="styleIndex ? { background: navBgColor } : background" |
|
|
|
|
:border-bottom="false"> |
|
|
|
|
<image :src="logoImage" mode="heightFix" class="logo"></image> |
|
|
|
|
<view class="slot-wrap"> |
|
|
|
|
<u-subsection :active-color="tabActiveColor || '#FB213D'" inactive-color="#000000" height="60" @change="changeHome" |
|
|
|
|
:bold="false" button-color="#fff" :list="list" :current="current"></u-subsection> |
|
|
|
|
<u-subsection :active-color="tabActiveColor || '#FB213D'" inactive-color="#000000" height="60" |
|
|
|
|
@change="changeHome" :bold="false" button-color="#fff" :list="list" :current="current"> |
|
|
|
|
</u-subsection> |
|
|
|
|
</view> |
|
|
|
|
</u-navbar> |
|
|
|
|
</view> |
|
|
|
@ -23,8 +25,14 @@ |
|
|
|
|
<!-- <view class="badge"></view> --> |
|
|
|
|
</view> |
|
|
|
|
<view class="chat" v-else> |
|
|
|
|
<u-icon name="chat" color="#000000" size="70"></u-icon> |
|
|
|
|
<button open-type="contact"></button> |
|
|
|
|
<view v-if="setting.provider=='wxqykf'" @click="handleContact"> |
|
|
|
|
<u-icon name="chat" color="#000000" size="70"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
<view v-else> |
|
|
|
|
<u-icon name="chat" color="#000000" size="70"></u-icon> |
|
|
|
|
<button open-type="contact"></button> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
@ -46,7 +54,8 @@ |
|
|
|
|
<u-swiper :list="bannerList" height="380" img-mode="aspectFill" @click="gotoDetail"></u-swiper> |
|
|
|
|
</view> |
|
|
|
|
<view class="grid"> |
|
|
|
|
<view class="gridRows" :style="{'height': isToggle == false?catagoryList.length >0?'340rpx':'auto':'auto'}"> |
|
|
|
|
<view class="gridRows" |
|
|
|
|
:style="{'height': isToggle == false?catagoryList.length >0?'340rpx':'auto':'auto'}"> |
|
|
|
|
<view class="gridItem" v-for="(item,index) in gridList" @click="goPage(item.path,item.type)" |
|
|
|
|
:key="index"> |
|
|
|
|
<view class="imageC"> |
|
|
|
@ -80,7 +89,8 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="firstContent" @click="goNewUser" v-if="wxAppSetting.new_first_gift"> |
|
|
|
|
<image :src="`${$picUrl}/static/index/new${styleIndex || ''}.png?t=${timestamp}`" class="firstBg" :class="{ 'firstBgStyle': styleIndex }"></image> |
|
|
|
|
<image :src="`${$picUrl}/static/index/new${styleIndex || ''}.png?t=${timestamp}`" class="firstBg" |
|
|
|
|
:class="{ 'firstBgStyle': styleIndex }"></image> |
|
|
|
|
<view class="firstInfo"> |
|
|
|
|
<view class="fTitle"> |
|
|
|
|
<image :src="$picUrl+'/static/index/xinren.png?t='+timestamp" class="firstTitle"></image> |
|
|
|
@ -117,7 +127,8 @@ |
|
|
|
|
<view class="dapaiTitle"> |
|
|
|
|
<image :src="$picUrl+'/static/index/dapai.png?t='+timestamp" mode="widthFix"></image> |
|
|
|
|
<view class="goods"> |
|
|
|
|
<image :src="$picUrl+'/static/index/diannei.png?t='+timestamp" mode="widthFix"></image> |
|
|
|
|
<image :src="$picUrl+'/static/index/diannei.png?t='+timestamp" mode="widthFix"> |
|
|
|
|
</image> |
|
|
|
|
<view>店内现货</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -192,14 +203,15 @@ |
|
|
|
|
<view class="activity"> |
|
|
|
|
<!-- @click="goNews" --> |
|
|
|
|
<view class="left" v-if="wxAppSetting.service"> |
|
|
|
|
<image :src="`${$picUrl}/static/index/activity${styleIndex || ''}.png?t=${timestamp}`" mode="widthFix"></image> |
|
|
|
|
<image :src="`${$picUrl}/static/index/activity${styleIndex || ''}.png?t=${timestamp}`" |
|
|
|
|
mode="widthFix"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="right"> |
|
|
|
|
<!-- <view class="rightContent"> --> |
|
|
|
|
<view class="rightItem1" v-if="wxAppSetting.new_product"> |
|
|
|
|
<view style=""> |
|
|
|
|
<image :src="$picUrl+'/static/index/xinpin.png?t='+timestamp" mode="widthFix" @click="goNewGoods" |
|
|
|
|
class="title"></image> |
|
|
|
|
<image :src="$picUrl+'/static/index/xinpin.png?t='+timestamp" mode="widthFix" |
|
|
|
|
@click="goNewGoods" class="title"></image> |
|
|
|
|
<view class="more" @click="goNewGoods">查看更多<u-icon name="arrow-right"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
<scroll-view scroll-x="true"> |
|
|
|
@ -209,7 +221,8 @@ |
|
|
|
|
@click="goJump('/pages/goods/detail?goodsId=' + item.goods_id)"> |
|
|
|
|
<image :src="item.goods_image"></image> |
|
|
|
|
<view class="priceBox"> |
|
|
|
|
<image :src="$picUrl+'/static/index/price.png?t='+timestamp" mode="heightFix"> |
|
|
|
|
<image :src="$picUrl+'/static/index/price.png?t='+timestamp" |
|
|
|
|
mode="heightFix"> |
|
|
|
|
</image> |
|
|
|
|
<view><text>¥</text>{{item.goods_price_min}}</view> |
|
|
|
|
</view> |
|
|
|
@ -221,8 +234,8 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="rightItem2" v-if="wxAppSetting.ranking_list"> |
|
|
|
|
<view style="margin-bottom: 10rpx;"> |
|
|
|
|
<image :src="$picUrl+'/static/index/paihangbang.png?t='+timestamp" mode="widthFix" @click="rankIng" |
|
|
|
|
class="title"></image> |
|
|
|
|
<image :src="$picUrl+'/static/index/paihangbang.png?t='+timestamp" mode="widthFix" |
|
|
|
|
@click="rankIng" class="title"></image> |
|
|
|
|
<view class="more" @click="rankIng">查看更多<u-icon name="arrow-right"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
<view class="right1Good"> |
|
|
|
@ -231,7 +244,8 @@ |
|
|
|
|
@click="goJump('/pages/goods/detail?goodsId=' + item.goods_id)"> |
|
|
|
|
<image :src="item.goods_image"></image> |
|
|
|
|
<view class="priceBox"> |
|
|
|
|
<image :src="$picUrl+'/static/index/price.png?t='+timestamp" mode="heightFix"> |
|
|
|
|
<image :src="$picUrl+'/static/index/price.png?t='+timestamp" |
|
|
|
|
mode="heightFix"> |
|
|
|
|
</image> |
|
|
|
|
<view><text>¥</text>{{item.goods_price_min}}</view> |
|
|
|
|
</view> |
|
|
|
@ -246,36 +260,36 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="goodsRecommend"> |
|
|
|
|
<!-- <u-waterfall v-model="goodsRecommend" ref="uWaterfall1"> --> |
|
|
|
|
<!-- <template v-slot:left="{leftList}"> --> |
|
|
|
|
<view class="goodsItem" v-for="(item,index) in goodsRecommend" @click="goDetails(item)" |
|
|
|
|
:key="index"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image :src="item.goods_image" mode="aspectFill"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="goodsInfo"> |
|
|
|
|
<view class="title"> |
|
|
|
|
<!-- <text v-if="item.selling_point" class="ziying">{{item.selling_point}}</text> --> |
|
|
|
|
<text class="name">{{item.goods_name}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 商品价格 --> |
|
|
|
|
<view class="shenBox"> |
|
|
|
|
<view class="detail-price oneline-hide"> |
|
|
|
|
<text class="goods-price f-30 col-m"><text |
|
|
|
|
style="font-size: 26rpx;">¥</text>{{ item.goods_price_min>0?Number(item.goods_price_min):0.00}} |
|
|
|
|
<text class="delPrice"></text></text> |
|
|
|
|
<text v-if="item.line_price_min > 0" |
|
|
|
|
class="line-price col-9 f-24">¥{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text> |
|
|
|
|
</view> |
|
|
|
|
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode=""> |
|
|
|
|
</image> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="goodsInfo1" v-if="item.cmmdty_model"> |
|
|
|
|
<!-- <template v-slot:left="{leftList}"> --> |
|
|
|
|
<view class="goodsItem" v-for="(item,index) in goodsRecommend" @click="goDetails(item)" |
|
|
|
|
:key="index"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image :src="item.goods_image" mode="aspectFill"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="goodsInfo"> |
|
|
|
|
<view class="title"> |
|
|
|
|
<!-- <text v-if="item.selling_point" class="ziying">{{item.selling_point}}</text> --> |
|
|
|
|
<text class="name">{{item.goods_name}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 商品价格 --> |
|
|
|
|
<view class="shenBox"> |
|
|
|
|
<view class="detail-price oneline-hide"> |
|
|
|
|
<text class="goods-price f-30 col-m"><text |
|
|
|
|
style="font-size: 26rpx;">¥</text>{{ item.goods_price_min>0?Number(item.goods_price_min):0.00}} |
|
|
|
|
<text class="delPrice"></text></text> |
|
|
|
|
<text v-if="item.line_price_min > 0" |
|
|
|
|
class="line-price col-9 f-24">¥{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text> |
|
|
|
|
</view> |
|
|
|
|
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode=""> |
|
|
|
|
</image> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="goodsInfo1" v-if="item.cmmdty_model"> |
|
|
|
|
<view class="oneTip"> |
|
|
|
|
{{item.cmmdty_model}} |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- <view class="goodsSend"> |
|
|
|
|
<!-- <view class="goodsSend"> |
|
|
|
|
<view class="sendLeft"> |
|
|
|
|
<view class="left_1"> |
|
|
|
|
{{item.goods_source}} |
|
|
|
@ -294,9 +308,9 @@ |
|
|
|
|
<text v-if="item.delivery_time==6">45天内发货</text> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
<!-- </template> --> |
|
|
|
|
<!-- <template v-slot:right="{rightList}"> |
|
|
|
|
</view> |
|
|
|
|
<!-- </template> --> |
|
|
|
|
<!-- <template v-slot:right="{rightList}"> |
|
|
|
|
<view class="goodsItem" style="margin-right: 0;" v-for="(item,index) in rightList" |
|
|
|
|
@click="goDetails(item)" :key="index"> |
|
|
|
|
<view class="pic"> |
|
|
|
@ -375,7 +389,7 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="zixun"> |
|
|
|
|
<view class="zixunItem" @click="openWx()"> |
|
|
|
|
<image :src="$picUrl+'/static/user/weChat.png'" mode="widthFix" class="weChat"></image> |
|
|
|
|
<image :src="$picUrl+'/static/user/weChat.png'" mode="widthFix" class="weChat"></image> |
|
|
|
|
<view class="askText"> |
|
|
|
|
咨询 |
|
|
|
|
</view> |
|
|
|
@ -633,7 +647,8 @@ |
|
|
|
|
navBgColor: '', |
|
|
|
|
recommendPage: 1, |
|
|
|
|
recommendFinish: false, |
|
|
|
|
recommendLoadTitle: '' |
|
|
|
|
recommendLoadTitle: '', |
|
|
|
|
setting: {}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -653,11 +668,40 @@ |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
onReachBottom() { |
|
|
|
|
if (!this.recommendFinish) { |
|
|
|
|
if (!this.recommendFinish) { |
|
|
|
|
this.getSuggest() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 在线客服 |
|
|
|
|
handleContact() { |
|
|
|
|
// 商城客服设置 |
|
|
|
|
const setting = this.setting |
|
|
|
|
// 企业微信客服 |
|
|
|
|
if (setting.provider == 'wxqykf') { |
|
|
|
|
if (!setting.config.wxqykf.url || !setting.config.wxqykf.corpId) { |
|
|
|
|
this.$toast('客服链接和企业ID不能为空') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// #ifdef H5 |
|
|
|
|
window.open(setting.config.wxqykf.url) |
|
|
|
|
// #endif |
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
|
wx.openCustomerServiceChat({ |
|
|
|
|
extInfo: { |
|
|
|
|
url: setting.config.wxqykf.url |
|
|
|
|
}, |
|
|
|
|
corpId: setting.config.wxqykf.corpId, |
|
|
|
|
success(res) {}, |
|
|
|
|
fail(res) { |
|
|
|
|
console.log(res, '企业微信') |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// #endif |
|
|
|
|
}else{ |
|
|
|
|
this.$toast('暂不支持企业微信客服') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 获取小程序配置 |
|
|
|
|
*/ |
|
|
|
@ -668,7 +712,9 @@ |
|
|
|
|
} = await GoodsApi.wxAppSetting({}); |
|
|
|
|
if (status == 200) { |
|
|
|
|
this.wxAppSetting = data; |
|
|
|
|
const arr = [{ name: '首页' }]; |
|
|
|
|
const arr = [{ |
|
|
|
|
name: '首页' |
|
|
|
|
}]; |
|
|
|
|
// if (data.same_city) { |
|
|
|
|
// arr.push({ |
|
|
|
|
// name: '同城送' |
|
|
|
@ -681,13 +727,12 @@ |
|
|
|
|
} |
|
|
|
|
this.list = [...arr]; |
|
|
|
|
if (data.select_mechant && uni.getStorageSync('storeVersion') == 1) { |
|
|
|
|
this.gridList.splice(5, 1, |
|
|
|
|
{ |
|
|
|
|
image: `${this.$picUrl}/static/index/shop-active.png`, |
|
|
|
|
text: "精选商户", |
|
|
|
|
path: '/pages/shopList/index', |
|
|
|
|
type: 2 |
|
|
|
|
}); |
|
|
|
|
this.gridList.splice(5, 1, { |
|
|
|
|
image: `${this.$picUrl}/static/index/shop-active.png`, |
|
|
|
|
text: "精选商户", |
|
|
|
|
path: '/pages/shopList/index', |
|
|
|
|
type: 2 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -710,7 +755,8 @@ |
|
|
|
|
// 跳转到秒杀新的商品详情 |
|
|
|
|
handleTargetGoods(item) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/goods/seckillDetail?sharpGoodsId=' + item.sharp_goods_id +'&activeTimeId='+this.tabbar[this.curTabIndex].active_time_id+ "&isSeckill=" + true + '&isBuy=' + this |
|
|
|
|
url: '/pages/goods/seckillDetail?sharpGoodsId=' + item.sharp_goods_id + '&activeTimeId=' + this |
|
|
|
|
.tabbar[this.curTabIndex].active_time_id + "&isSeckill=" + true + '&isBuy=' + this |
|
|
|
|
.seckillCutDownTime + '&seckillText=' + (this.tabbar[this.curTabIndex].status == 10 ? |
|
|
|
|
'结束' : '开始') |
|
|
|
|
}) |
|
|
|
@ -937,7 +983,9 @@ |
|
|
|
|
}, |
|
|
|
|
getSuggest() { |
|
|
|
|
// 获取推荐商品 |
|
|
|
|
Api.recommendedNew({ page: this.recommendPage++ }).then(res => { |
|
|
|
|
Api.recommendedNew({ |
|
|
|
|
page: this.recommendPage++ |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log(res); |
|
|
|
|
let arr = res.data.goodsList.data |
|
|
|
|
if (arr && arr.length > 0) { |
|
|
|
@ -951,7 +999,7 @@ |
|
|
|
|
if (arr.length < res.data.goodsList.per_page) { |
|
|
|
|
this.recommendFinish = true; |
|
|
|
|
} |
|
|
|
|
this.recommendLoadTitle = this.recommendFinish ? "已全部加载完" : "上拉加载更多"; |
|
|
|
|
this.recommendLoadTitle = this.recommendFinish ? "已全部加载完" : "上拉加载更多"; |
|
|
|
|
this.goodsRecommend = [...this.goodsRecommend, ...arr] |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -1195,6 +1243,7 @@ |
|
|
|
|
this.recommendLoadTitle = ''; |
|
|
|
|
this.goodsRecommend = []; |
|
|
|
|
this.getSuggest() |
|
|
|
|
this.setting = uni.getStorageSync('Setting').customer |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
if (this.list[this.current].name === '广场') { |
|
|
|
@ -1233,6 +1282,7 @@ |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
@import './style.scss'; |
|
|
|
|
|
|
|
|
|
.index { |
|
|
|
|
min-height: calc(100vh - 100rpx); |
|
|
|
|
background: url('https://www.royaum.com.cn/static/index/index-bg.png'); |
|
|
|
@ -1518,6 +1568,7 @@ |
|
|
|
|
width: 698rpx; |
|
|
|
|
height: 230rpx; |
|
|
|
|
margin-bottom: 20rpx; |
|
|
|
|
|
|
|
|
|
&.firstBgStyle { |
|
|
|
|
width: 686rpx; |
|
|
|
|
height: 230rpx; |
|
|
|
@ -1898,7 +1949,7 @@ |
|
|
|
|
.rightItem1, |
|
|
|
|
.rightItem2 { |
|
|
|
|
background: url('https://www.royaum.com.cn/static/index/newFirst.png'); |
|
|
|
|
background-size: cover!important; |
|
|
|
|
background-size: cover !important; |
|
|
|
|
padding: 14rpx; |
|
|
|
|
position: relative; |
|
|
|
|
box-sizing: border-box; |
|
|
|
@ -2086,6 +2137,7 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.finished { |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
line-height: 100rpx; |
|
|
|
@ -2173,7 +2225,8 @@ |
|
|
|
|
width: 500rpx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|
// justify-content: ; |
|
|
|
|
.tagsItem { |
|
|
|
|
margin-bottom: 16rpx; |
|
|
|
|