|
|
|
@ -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"> |
|
|
|
|
<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,9 +25,15 @@ |
|
|
|
|
<!-- <view class="badge"></view> --> |
|
|
|
|
</view> |
|
|
|
|
<view class="chat" v-else> |
|
|
|
|
<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> |
|
|
|
|
<view v-show="current==0"> |
|
|
|
@ -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> |
|
|
|
@ -633,7 +647,8 @@ |
|
|
|
|
navBgColor: '', |
|
|
|
|
recommendPage: 1, |
|
|
|
|
recommendFinish: false, |
|
|
|
|
recommendLoadTitle: '' |
|
|
|
|
recommendLoadTitle: '', |
|
|
|
|
setting: {}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -658,6 +673,35 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
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,8 +727,7 @@ |
|
|
|
|
} |
|
|
|
|
this.list = [...arr]; |
|
|
|
|
if (data.select_mechant && uni.getStorageSync('storeVersion') == 1) { |
|
|
|
|
this.gridList.splice(5, 1, |
|
|
|
|
{ |
|
|
|
|
this.gridList.splice(5, 1, { |
|
|
|
|
image: `${this.$picUrl}/static/index/shop-active.png`, |
|
|
|
|
text: "精选商户", |
|
|
|
|
path: '/pages/shopList/index', |
|
|
|
@ -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) { |
|
|
|
@ -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; |
|
|
|
@ -2174,6 +2226,7 @@ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|
// justify-content: ; |
|
|
|
|
.tagsItem { |
|
|
|
|
margin-bottom: 16rpx; |
|
|
|
|