Feat(时令尝鲜):接口对接

This commit is contained in:
lifizer
2023-09-23 18:13:26 +08:00
parent c9ceac9f37
commit 2d73c2fe46
35 changed files with 2834 additions and 1547 deletions
+35 -324
View File
@@ -3,17 +3,7 @@
<view class="header acea-row row-column row-left" style="position: absolute;left: 0;right: 0;"
:style="{top:statusBarHeight+'px'}">
<view class="acea-row row-middle row-between" style="position: relative;z-index: 1;">
<view class="avatar-box acea-row row-middle">
<!-- 2023/4/13 隐藏下方事件对应avatar-box-->
<!-- @click="avatarClick"-->
<!-- <image v-if="userInfo&&userInfo.avatar" class="avatar-img" :src="userInfo.avatar"></image>-->
<!-- <image v-else class="avatar-img" :src="webUrl+'/20230304135955831196.png'"></image>-->
<!-- <view class="acea-row row-middle"-->
<!-- style="background: #1E131B;border: 1px solid #FFFFFF;border-radius: 0 28rpx 28rpx 0;padding: 4rpx 10rpx 4rpx 20rpx;margin-left: -10rpx;height: 40rpx;box-sizing: content-box;">-->
<!-- <text style="" class="nickname-text">{{ userInfo.nickname || '' }}</text>-->
<!-- </view>-->
</view>
<view class="acea-row row-middle row-right" style="position: relative;z-index: 1;">
<view style="position: relative;color: #FFF;margin-left: 20rpx;margin-right: 20rpx;"
class="acea-row row-middle">
<image style="width: 36rpx;height: 36rpx;" :src="webUrl+'/20210616184302174394.png'" mode="">
@@ -21,12 +11,11 @@
<view style="margin-left: 10rpx;font-size: 28rpx;color: #fff;">客服</view>
<button class="cus-btn" open-type="contact"></button>
</view>
</view>
</view>
<!-- <view class="fixed-header-box"></view> -->
<view class="slider-banner" style="position: relative;">
<swiper style="height: 680rpx;" indicatorDots="true" indicator-color="rgba(255, 255, 255, .3)"
<swiper style="height: 510rpx;" indicatorDots="true" indicator-color="rgba(255, 255, 255, .3)"
indicator-active-color="#ffffff" v-if="banner.length > 0" autoplay circular>
<block v-for="(item, bannerIndex) in banner" :key="bannerIndex">
<swiper-item>
@@ -41,10 +30,6 @@
style="flex-wrap: nowrap;position: absolute;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.6);padding: 10rpx 32rpx;">
<view class="news acea-row row-between-wrapper"
style="box-shadow: none !important;flex-grow: 1;flex-wrap: nowrap;background:transparent !important;border: none !important;margin: 0 30rpx 0 0 !important;padding: 0 !important;height: auto !important;">
<!-- <view class="notice acea-row row-middle" style="color: #fff;font-size: 24rpx;margin-right: 10rpx !important;">
欢迎新加入会员:
</view> -->
<view class="swiper-no-swiping new-banner" style="height: 34rpx !important;text-align: right;">
<swiper class="swiper-wrapper" style="height: 34rpx !important;" v-if="userList.length > 0" :interval="3000"
:indicator-dots="false" autoplay circular vertical>
@@ -61,11 +46,6 @@
</swiper>
</view>
</view>
<!-- <view class="acea-row row-middle row-between" style="flex-shrink: 0;flex-wrap: nowrap;margin-right: 30rpx;">
<view class="" style="color: #fff;font-size: 24rpx;margin-right: 10rpx;">香道滇会员总数:</view>
<view class="" style="color: #fff;font-size: 24rpx;text-align: right;">{{userTotal}}</view>
</view> -->
</view>
</view>
@@ -85,31 +65,10 @@
</view>
</view>
<!-- 快捷跳转块v4end -->
<view style="padding-bottom:20rpx;background: #fff;">
<!-- 转盘-->
<!-- <image class="home-luck" :src="`${webUrl}/20220519145845818243.png`" mode="scaleToFill" @click="goLuck"></image>-->
<!-- 通知开始 -->
<view v-if="showNotice" class="news acea-row row-between-wrapper" style="margin-top: 20rpx;margin-bottom: 20rpx;">
<view class="notice acea-row row-middle">
<image style="width: 102rpx;height:64rpx" :src="webUrl+'/20210609100702342165.png'" mode=""></image>
</view>
<view class="swiper-no-swiping new-banner">
<swiper class="swiper-wrapper" v-if="roll.length > 0" :indicator-dots="false" autoplay circular vertical>
<block v-for="(item, rollIndex) in roll" :key="rollIndex">
<swiper-item class="swiper-slide">
<view @click="goRoll(item)" class="swiper-item acea-row row-between-wrapper">
<view class="text acea-row row-between-wrapper">
<view class="label" v-if="item.show === '是'">最新</view>
<view class="newsTitle line1">{{ item.info }}</view>
</view>
<!-- <view class="iconfont icon-xiangyou"></view> -->
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
<!-- 伴手礼精品 -->
@@ -246,9 +205,6 @@
v-if="item.productPrice">{{ item.productPrice }}
</text>
</view>
<!-- <view class="shop flex"><text>{{item.merName}}</text>
<image class="icon-fire" :src="webUrl+'/20221118092713277343.png'" mode="scaleToFill"></image>
</view> -->
</view>
</view>
</view>
@@ -310,7 +266,6 @@
<script>
import {mapActions, mapGetters} from 'vuex';
import {formatDateTime} from "@/utils";
import {handleUrlParam} from '@/utils/index';
import config from '@/utils/mapConfig';
import PromotionGood from '@/components/PromotionGood';
@@ -321,13 +276,12 @@ import imgBox from '@/components/imageTypeSet/imagebox.vue'
import LsSwiper from '@/components//ls-swiper/index.vue'
import {noticeDetail, noticeList} from "@/api/user";
import {getHomeData, getShareImage, getWxLiveList, wxLiveSynchro} from '@/api/public';
import {getHomeData, getShareImage} from '@/api/public';
import {getHomeHotelList} from "@/api/inn.js";
import {getProducts} from "@/api/store";
import {sharpBannar} from "@/api/goods";
import NP from "number-precision";
const HAS_COUPON_WINDOW = 'has_coupon_window';
var that;
export default {
name: 'Index',
@@ -350,7 +304,6 @@ export default {
duration: 60000,
unReadMessageInfo: null,
webUrl: this.$VUE_APP_RESOURCES_URL,
showNotice: true, //是否显示通知
isLiving: true, //是否正在直播
showCoupon: false,
viewHeight: (750 * 3 / 4.0),
@@ -502,14 +455,9 @@ export default {
customBar = e.statusBarHeight + 45
// #endif
// 这里你可以自己决定存放方式,建议放在store中,因为store是实时变化的
// this.$store.commit('SET_STATUS_BAR', statusBar)
// this.$store.commit('SET_CUSTOM_BAR', customBar)
// this.$store.commit('SET_SYSTEM_INFO', e)
that.statusBarHeight = customBar;
//两列商品宽度
that.hotGoodsColumnWidth = (e.screenWidth - uni.upx2px(90)) / 2 + 'px';
//that.bslGoodsHeight = (e.screenWidth - uni.upx2px(90))/2*3/4+'px';
//状态栏图片高度
that.bgImgHeight = statusBar + 'px';
@@ -529,21 +477,13 @@ export default {
this.getUnreadMsgList();
}
//先同步后获取直播间列表
//this.getLiveList();
wxLiveSynchro().then(res => {
// this.getLiveList();
}).catch(err => {
// this.getLiveList();
})
//定位
this.getCurAddress();
this.init();
//获取团购商品
this.getGroupGoods();
},
onShareAppMessage(res) {
onShareAppMessage() {
return {
title: '云南香道滇官方商城',
path: '/pages/home/index',
@@ -571,7 +511,6 @@ export default {
that.$set(that, 'roll', res.data.roll);
that.$set(that, 'userList', res.data.lotteryRecord); //滚动会员信息
that.$set(that, 'userTotal', res.data.userTotal); //会员总数信息
//that.$set(that, 'activityOne', activityOne);
that.$set(that, 'info', res.data.info);
that.$set(that, 'firstList', res.data.firstList.map((item) => {
item.price = that.$force2Decimal(item.price);
@@ -606,7 +545,6 @@ export default {
that.likeInfo.forEach((item) => {
imgs.push(item.image);
})
// that.bslImglist = imgs;
that.$set(that, 'bslImglist', imgs);
that.seriesWidth = 770 * imgs.length - 20;
@@ -667,10 +605,6 @@ export default {
swiperChange(e) {
this.currentIndex = e.detail.current;
},
goMoreNewGoods: function () {
//跳转到分类
this.$yrouter.switchTab('/pages/shop/GoodsClass/index');
},
msgConfirm: function () {
that.$refs.popup.close();
},
@@ -756,17 +690,10 @@ export default {
q.cityName = this.cityName;
}
getHomeHotelList(q).then(res => {
that.innArray = [];
//that.innArray = res.data;
that.innArray.push.apply(that.innArray, res.data);
}).catch((err) => {
}).finally(() => {
});
})
},
getShopList: function () {
let that = this;
@@ -784,14 +711,8 @@ export default {
getHomeHotelList(q).then(res => {
that.shopArray = [];
//that.innArray = res.data;
that.shopArray.push.apply(that.shopArray, res.data);
}).catch((err) => {
}).finally(() => {
});
})
},
getRestaurantList: function () {
let that = this;
@@ -809,14 +730,8 @@ export default {
getHomeHotelList(q).then(res => {
that.restaurantArray = [];
//that.innArray = res.data;
that.restaurantArray.push.apply(that.restaurantArray, res.data);
}).catch((err) => {
}).finally(() => {
});
})
},
goMoreBoutiqueGift: function () {
//跳转伴手礼分类
@@ -827,36 +742,6 @@ export default {
}
});
},
goMoreGroupBuy: function () {
//跳转伴手礼分类
this.$yrouter.reLaunch({
path: '/pages/shop/GoodsClass/index',
query: {
id: 19
}
});
},
goProducts: function () {
//跳转伴手礼分类
this.$yrouter.reLaunch({
path: '/pages/shop/GoodsClass/index'
});
},
goLiveList: function () {
this.$yrouter.push('/pages/LiveBroadcastList/LiveBroadcastList');
},
goShotVideo: function () {
this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackList');
},
goInnDetail: function (item) {
//跳转到客栈详情
this.$yrouter.push({
path: "/pagesInn/inn/innHome",
query: {
id: item.id
}
});
},
goPreSale: function () {
this.$yrouter.push("/v4/views/preSale/preSale")
},
@@ -866,88 +751,26 @@ export default {
setMsgReaded: function (mid) {
noticeDetail({
id: mid
}).then((res) => {
}).catch((err) => {
})
},
getLiveList: function () {
//直播间状态 101:直播中,102:未开始,103 已结束,104 禁播,105:暂停,106:异常,107:已过期
var params = {
limit: 1,
page: 0,
liveStatus: 101 //101-直播中
}
// mescroll.endByPage(0, 0);
// return;
let that = this;
getWxLiveList(params)
.then(res => {
if (res.data && res.data.content && res.data.content.length > 0) {
that.liveList = res.data.content;
that.isLiving = true;
} else {
that.isLiving = false;
}
})
.catch(err => {
})
},
getUnreadMsgList: function () {
var params = {
limit: 10,
page: 1
}
// mescroll.endByPage(0, 0);
// return;
let that = this;
noticeList(params)
.then(res => {
if (res.data && res.data.length > 0) {
var msg = res.data[0];
if (msg.readFlag == 'RF0') {
that.unReadMessageInfo = msg;
that.$refs.popup.open();
that.setMsgReaded(msg.id);
}
}
})
.catch(err => {
})
noticeList(params).then(res => {
if (res.data && res.data.length > 0) {
var msg = res.data[0];
if (msg.readFlag == 'RF0') {
that.unReadMessageInfo = msg;
that.$refs.popup.open();
that.setMsgReaded(msg.id);
}
}
})
},
noticeClose: function () {
this.showNotice = false;
},
//
livingButtonClick: function () {
// //是否在直播
// if(this.isLiving){
// //跳转到直播界面
// var live = this.liveList[0];
// var liveAppId = this.$WX_LIVE_APPID;
// wx.navigateTo({
// url: `plugin-private://${liveAppId}/pages/live-player-plugin?room_id=${live.roomId}`
// });
// }else{
// //跳转到视频回放界面
// this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackList')
// }
//跳转到视频回放界面
this.$yrouter.push('/pages/LiveAndShortVideo/LiveAndShortVideo')
},
avatarClick: function () {
this.$yrouter.switchTab('/pages/user/User/index');
},
call: function () {
if (this.companyTel != undefined && this.companyTel.length > 0) {
@@ -971,32 +794,10 @@ export default {
if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url)
}
// this.$yrouter.push("/pages/shop/GoodsCon/index?id="+item.id)
},
goGoodSearch() {
// this.$yrouter.push('/pages/shop/GoodsEvaluate/index');
this.$yrouter.push('/pages/shop/GoodSearch/index');
},
goWxappUrl(item) {
this.$yrouter.push(item.uniapp_url);
},
goHotNewGoods(type) {
this.$yrouter.push({
path: '/pages/shop/HotNewGoods/index',
query: {
type
}
});
},
goBSLGoods(index) {
var item = this.likeInfo[index];
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.id
}
});
},
goGoodsCon(item) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
@@ -1012,56 +813,6 @@ export default {
id: item.productId,
activityId: item.id,
from
}
});
},
goGoodsPromotion() {
this.$yrouter.push('/pages/shop/GoodsPromotion/index');
},
startQr: function () {
uni.scanCode({
success: (res) => {
let option = handleUrlParam(res.result)
// {productId: "19", spread: "21", codeType: "routine"}
// {productId: "19", spread: "21", pageType: "good", codeType: "routine"}
switch (option.pageType) {
case 'good':
// 跳转商品详情
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
q: res.result
}
});
break;
case 'group':
// 跳转团购
this.$yrouter.push({
path: '/pages/activity/GroupRule/index',
query: {
q: res.result
}
});
break;
case 'dargain':
// 跳转砍价
this.$yrouter.push({
path: '/pages/activity/DargainDetails/index',
query: {
q: res.result
}
});
break;
default:
// 跳转分销
this.$yrouter.push({
path: '/pages/Loading/index',
query: {}
});
break;
}
}
});
}
@@ -1107,7 +858,6 @@ export default {
.index .header {
height: auto !important;
background-color: transparent !important;
}
.swiper-item {
@@ -1130,7 +880,6 @@ export default {
.member-box {
// padding: 32rpx;
margin-bottom: 32rpx;
}
@@ -1165,7 +914,6 @@ export default {
box-sizing: border-box;
margin-right: 16rpx;
margin-left: -30rpx;
// background:linear-gradient(90deg,rgba(196,199,255,1) 0%,rgba(56,104,253,1) 100%);
background: rgba(138, 143, 203, 1);
border-radius: 0px 16*2rpx 16*2rpx 0px;
}
@@ -1174,7 +922,6 @@ export default {
width: 20*2rpx;
height: 20*2rpx;
margin-right: 5*2rpx;
}
.live-broadcast-box .living-box {
@@ -1197,10 +944,6 @@ export default {
.slider-banner {
-webkit-transform: rotate(0);
// margin-top: -187rpx;
// border-radius: 20rpx;
// margin-left: 30rpx;
// margin-right: 30rpx;
width: auto !important;
}
@@ -1208,15 +951,12 @@ export default {
.header {
background-repeat: no-repeat;
background-size: 100% 100%;
//height: 680rpx !important;
}
.header .paper-cuts-img {
position: absolute;
width: 159*2rpx;
height: 159*2rpx;
// left: calc((100% - 159*2rpx)/2);
// top: calc((100% - 159*2rpx)/2);
top: 0;
left: 0;
bottom: 0;
@@ -1235,16 +975,12 @@ export default {
padding: 0 28rpx;
font-size: 28rpx;
color: #acacac;
box-sizing: border-box;
// border: 1px solid #ffffff;
border-radius: 32rpx;
margin: 0 30rpx;
}
.notice {
margin-right: 24rpx;
// background:linear-gradient(145deg,rgba(252,85,179,1) 0%,rgba(255,45,105,1) 100%);
// border-radius:0px 4*2rpx 4*2rpx 8*2rpx;
color: #fff;
text-align: center;
font-size: 12*2rpx;
@@ -1268,7 +1004,7 @@ export default {
.company-hline {
width: 28*2rpx;
height: 0px;
height: 0;
border: 1px solid rgba(56, 104, 253, 1);
}
@@ -1279,7 +1015,7 @@ export default {
.h-line {
width: 28*2rpx;
height: 0px;
height: 0;
border: 1px solid rgba(255, 121, 0, 1);
}
@@ -1300,7 +1036,6 @@ export default {
.hotGoodsList {
position: relative;
margin: 35rpx 0;
// background-color: #fff;
flex-wrap: wrap;
}
@@ -1355,7 +1090,6 @@ export default {
.pro-info {
font-size: 14*2rpx;
}
.company-logo-box {
@@ -1365,19 +1099,14 @@ export default {
.company-info-box {
padding: 24rpx 24rpx 32rpx 24rpx;
background: rgba(255, 255, 255, 1);
//box-shadow:0px 6rpx 12rpx rgba(0,0,0,0.1);
//border-radius:12rpx;
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.1);
border-radius: 0px 12rpx 12rpx 12rpx;
box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.1);
border-radius: 0 12rpx 12rpx 12rpx;
flex-wrap: nowrap !important;
// margin-top: 35*2rpx;
}
.company-info {
flex: 1;
margin-left: 16rpx;
}
.company-tel-box {
@@ -1421,7 +1150,7 @@ export default {
}
.line {
height: 0px;
height: 0;
border: 1px solid rgba(235, 236, 240, 1);
margin-top: 10*2rpx;
margin-bottom: 10*2rpx;
@@ -1433,7 +1162,6 @@ export default {
}
.new-tag {
// margin-right: 10rpx;
padding: 1*2rpx 3*2rpx;
width: 29*2rpx;
height: 14*2rpx;
@@ -1457,17 +1185,14 @@ export default {
}
.index .wrapper.hot .newProducts {
// margin: 25rpx 25rpx 35rpx 25rpx;
margin: 10rpx 0rpx 0rpx 0rpx;
box-shadow: none;
background: none;
padding: 0rpx 0rpx 0rpx 0rpx;
// padding: 0;
}
.index .news {
margin: 0rpx 30rpx !important;
margin-bottom: 0;
border-radius: 8rpx !important;
background: #f7f7f7 !important;
border: none !important;
@@ -1482,10 +1207,6 @@ export default {
border: none;
}
.index .wrapper .title .text {
}
.index .wrapper .title .text .name {
font-size: 18*2rpx !important;
color: #fff !important;
@@ -1524,7 +1245,6 @@ export default {
margin-top: 20rpx;
}
.msg_content {
padding: 0.1*100rpx;
color: #080F1A;
@@ -1534,8 +1254,6 @@ export default {
.msg_btn {
padding: 10rpx;
font-size: 34rpx;
// border: 1px solid #333;
color: #38afef;
margin-top: 20rpx;
margin-bottom: 20rpx;
@@ -1609,13 +1327,13 @@ export default {
// v4
.fast-nav {
flex-wrap: wrap;
padding: 40rpx 32rpx 0;
padding: 40rpx 68rpx 0;
background: #fff;
.item {
width: 88rpx;
margin-right: 60rpx;
margin-bottom: 40rpx;
width: 86rpx;
margin-right: 46rpx;
margin-bottom: 36rpx;
}
.item:nth-child(5n) {
@@ -1623,17 +1341,16 @@ export default {
}
image {
width: 88rpx;
height: 88rpx;
width: 86rpx;
height: 86rpx;
margin-bottom: 10rpx;
}
.one-t {
width: 110rpx;
margin-top: 8rpx;
color: #666666;
font-size: 22rpx;
font-weight: 500;
line-height: 32rpx;
color: #666;
font-size: 26rpx;
line-height: 1;
text-align: center;
}
}
@@ -1649,7 +1366,7 @@ export default {
box-sizing: border-box;
margin: 0 20rpx;
padding-bottom: 14rpx;
box-shadow: 0px 6rpx 16rpx rgba(148, 148, 148, 0.16);
box-shadow: 0 6rpx 16rpx rgba(148, 148, 148, 0.16);
}
.money {
@@ -1826,7 +1543,6 @@ export default {
}
}
.desc-line {
display: flex;
align-items: center;
@@ -1917,7 +1633,6 @@ export default {
position: relative;
flex-direction: column;
width: 328rpx;
// height: 528rpx;
margin-top: 20rpx;
background: #fff;
@@ -1932,10 +1647,6 @@ export default {
height: 24rpx;
}
.content {
// position: relative;
}
.title {
display: -webkit-box;
-webkit-box-orient: vertical;