Commit 79748862 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/zk123/jz_travel

# Conflicts:
#	components/goods/style1.vue
parents eb9cb869 3a8a3a32
...@@ -2,35 +2,23 @@ ...@@ -2,35 +2,23 @@
<view class="u-good-list"> <view class="u-good-list">
<u-row gutter="20"> <u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in g" :key="ci"> <u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx)"> <view class="good" @click="showSkuHandler(cx)">
<view class="good-img"> <view class="good-img">
<image mode="aspectFill" :src="cx.cover_pic" style="width: 100%; height: 100%;"> <image mode="aspectFill" :src="getImgs(cx.imgCover)" style="width: 100%; height: 100%;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/plugins-out.png" v-if="cx.totalStock==0&&setting.is_show_korea&&setting.is_show_korea==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image> </image>
</view> </view>
<view class="good-name" v-if="setting.is_show_goods_name==1"> <view class="good-name">
<view v-if="cx.marketingLogo.iswords && cx.marketingLogo.iswords==1&& cx.marketingLogo.words!=''" class="Logo" {{cx.title}}
:style="{color: cx.marketingLogo.wordsColor,
background:cx.marketingLogo.wordsBack ,}">{{cx.marketingLogo.words}}</view>
<image v-if="cx.marketingLogo.iswords&&cx.marketingLogo.iswords==2&& cx.marketingLogo.ico!=''" mode="heightFix"
:src="cx.marketingLogo.ico" style=" height: 12px;margin-right: 5px" />
<view style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;height: 32rpx;font-size: 20rpx;margin-right: 5rpx;"
v-if="cx.freeShippingFullMoneyPinkage>0 || cx.freeShippingFullNumPinkage>0">
{{cx.freeShippingFullMoneyPinkage>0 && cx.freeShippingFullNumPinkage==0?cx.freeShippingFullMoneyPinkage+'元包邮':''}}
{{cx.freeShippingFullMoneyPinkage==0 && cx.freeShippingFullNumPinkage>0?cx.freeShippingFullNumPinkage+'件包邮':''}}
</view>
{{ cx.name }}
</view> </view>
<view class="goodsSubName" v-if="setting&&setting.is_show_korea==1"> <view class="goodsSubName">
卖点:<text v-if="cx.subName">{{cx.subName}}</text> <text v-if="cx.productRecommend">{{cx.productRecommend}}</text>
</view> </view>
<view class="good-info" v-if="setting&&setting.is_show_korea==0"> <view class="good-info">
<view class="price" :style="{ color: mainColor }">¥{{cx.price}}</view> <view class="price">
<view class="sell">{{ cx.sales }}</view> {{$utils.getretailer()==true? cx.b2BPrice:cx.b2CPrice}}<text class="sell"></text>
<view v-if="setting.is_show_cart==1" class="cart" @click.stop="showSkuHandler(cx)"> </view>
<u-icon name="cart-o" size="40" :color="mainColor" /> <view class="cart">
<u-icon name="cart-o" color="#ff4544" size="40" />
</view> </view>
</view> </view>
</view> </view>
...@@ -60,6 +48,7 @@ ...@@ -60,6 +48,7 @@
mainColor: "", mainColor: "",
setting: {}, setting: {},
isShowKorea: 0, //是否显示韩国的 0显示 1不显示 isShowKorea: 0, //是否显示韩国的 0显示 1不显示
CityId:0
}; };
}, },
mounted() { mounted() {
...@@ -94,17 +83,9 @@ ...@@ -94,17 +83,9 @@
}, },
showSkuHandler(g) { showSkuHandler(g) {
this.sku = g; uni.navigateTo({
this.u = uni.getStorageSync("mall_UserInfo"); url: "/pages/jiuzhai/jz_LineDetail?tcid=" + g.tcid + '&configId=' + g.configId + '&cityId=' + this.CityId
if (!this.u) { });
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
this.showSku = true;
}
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
...@@ -113,6 +94,15 @@ ...@@ -113,6 +94,15 @@
gbAuth() { gbAuth() {
this.showAuth = false; this.showAuth = false;
}, },
//获取第一张图
getImgs(imgObj) {
if(imgObj){
let imgArr = JSON.parse(imgObj);
if (imgArr && imgArr.length > 0) {
return imgArr[0].Url
}
}
}
}, },
}; };
</script> </script>
...@@ -165,6 +155,7 @@ ...@@ -165,6 +155,7 @@
margin-bottom: 3px; margin-bottom: 3px;
font-size: 13px; font-size: 13px;
margin: 7px 10px; margin: 7px 10px;
font-weight: bold;
} }
.u-good-list .good .good-info { .u-good-list .good .good-info {
...@@ -185,6 +176,7 @@ ...@@ -185,6 +176,7 @@
font-size: 11px; font-size: 11px;
color: gray; color: gray;
flex: 1; flex: 1;
margin-left:3rpx;
} }
.u-good-list .good .good-info .cart { .u-good-list .good .good-info .cart {
...@@ -203,8 +195,9 @@ ...@@ -203,8 +195,9 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
font-size: 13px; font-size: 11px;
margin: -7px 10px 10px 10px; margin: 0 10px 5px 10px;
height:17px; height:17px;
color:#999999;
} }
</style> </style>
<template> <template>
<div <div
:style="{ :style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, 'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '', 'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}" }"
> >
<div <div
v-for="(item, gli) in goodList" v-for="(item, gli) in goodList"
:key="gli" :key="gli"
class="good-one" class="good-one"
@click="openGood(item)" @click="openGood(item)"
:style="{ :style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '', }"
}" >
> <div class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /></div>
<div class="tips" v-if="goodsInfo.showGoodsTag"> <image
<image style="width: calc(100vw - 24px); height: 50vw;border-top-left-radius: 10px; border-top-right-radius: 10px;"
:src="goodsInfo.goodsTagPicUrl" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
mode="widthFix" :src="item.picUrl"
style="width: 100%;border-top-left-radius: 10px; border-top-right-radius: 10px;" v-if="goodsInfo.goodsCoverProportion == '3-2'"
/> />
</div> <image
<image style="
style="width: calc(100vw - 24px); height: 50vw" width: calc(100vw - 24px);
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" height: 100vw;
:src="item.picUrl" border-radius: 10rpx 10rpx 0 0;
v-if="goodsInfo.goodsCoverProportion == '3-2'" border-top-left-radius: 10px; border-top-right-radius: 10px;
/> "
<image v-if="goodsInfo.goodsCoverProportion == '1-1'"
style=" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
width: calc(100vw - 24px); :src="item.picUrl"
height: 100vw; />
border-radius: 10rpx 10rpx 0 0; <div class="good-info">
" <div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div>
v-if="goodsInfo.goodsCoverProportion == '1-1'" <view class="good-sub-name" v-if="item.subname">{{item.subname}}</view>
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" <div class="good-price-info">
:src="item.picUrl" <span class="price">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}
/> <!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> -->
<div class="good-info"> </span>
<div class="good-name" v-if="goodsInfo.showGoodsName"> <span class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
{{ item.name }} <u-icon name="cart-o" size="40" style="color:#ff4544" v-if="goodsInfo.buyBtn == 'cart'" />
</div> <u-icon name="add-o" size="40" style="color:#ff4544" v-else-if="goodsInfo.buyBtn == 'add'" />
<view class="good-sub-name" v-if="item.subname">{{ <u-button
item.subname type="primary"
}}</view> size="mini"
<div class="good-price-info"> :ripple="true"
<span class="price" :style="{ color: mainColor }" :color="goodsInfo.buttonColor"
>{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : "" }}
<!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> --> :custom-style="{
</span> 'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
<span 'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
class="buy" }"
v-if="goodsInfo.showBuyBtn" :plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
@click.stop="showSkuHandler(item)" :shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
> v-else
<u-icon >
name="cart-o"
size="40" {{ goodsInfo.buyBtnText }}
:color="mainColor" </u-button>
v-if="goodsInfo.buyBtn == 'cart'" </span>
/> </div>
<u-icon </div>
name="add-o" </div>
size="40" <good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
:color="mainColor" <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
v-else-if="goodsInfo.buyBtn == 'add'" </div>
/>
<u-button
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="{
backgroundColor:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? '#FFF'
: goodsInfo.buttonColor,
color:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF',
}"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</span>
</div>
</div>
</div>
<good-sku
v-if="showSku"
:option-type="2"
borderRadius="20"
v-model="showSku"
:good="sku"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</div>
</template> </template>
<script> <script>
import goodSku from "../goods/goodsku"; import goodSku from '../goods/goodsku';
import auth from "@/components/auth/index.vue"; import auth from '@/components/auth/index.vue';
export default { export default {
components: { components: {
goodSku, goodSku,
auth, auth
}, },
props: ["goodList", "goodsInfo"], props: ['goodList', 'goodsInfo'],
data() { data() {
return { return {
mainColor: "", mainColor: '',
activeKey: 0, activeKey: 0,
showSku: false, showSku: false,
sku: {}, sku: {},
showAuth: false, showAuth: false,
u: {}, u: {}
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
openGood(item) { openGood(item) {
//线路 //线路
if (item.goodType == 4) { if (item.goodType == 4) {
var url = var url="/pages/jiuzhai/jz_LineDetail?tcid=" + item.id + '&configId=' + item.subid;
"/pages/jiuzhai/jz_LineDetail?tcid=" + console.log("url1",url)
item.id + uni.navigateTo({
"&configId=" + url:url
item.subid; });
console.log("url1", url); }
uni.navigateTo({ //酒店
url: url, else if (item.goodType == 1) {
}); uni.navigateTo({
} url: "/pages/hotel/detail?id=" + item.id
//酒店 });
else if (item.goodType == 1) { }
uni.navigateTo({ //餐食
url: "/pages/hotel/detail?id=" + item.id, else if (item.goodType == 2) {
}); uni.navigateTo({
} url: '/pages/restaurant/detail?id=' + item.id
//餐食 });
else if (item.goodType == 2) { }
uni.navigateTo({ //景点
url: "/pages/restaurant/detail?id=" + item.id, else if (item.goodType == 3) {
}); uni.navigateTo({
} url: '/pages/ticketCoupons/detail?id=' + item.id
//景点 });
else if (item.goodType == 3) { }
uni.navigateTo({ },
url: "/pages/ticketCoupons/detail?id=" + item.id, showSkuHandler(g) {
}); this.sku = g;
} this.u = uni.getStorageSync('mall_UserInfo');
}, if (!this.u) {
showSkuHandler(g) { this.u = {
this.sku = g; nickName: '未登录',
this.u = uni.getStorageSync("mall_UserInfo"); avatarUrl: ''
if (!this.u) { };
this.u = { this.showAuth = true;
nickName: "未登录", } else {
avatarUrl: "", this.showSku = true;
}; }
this.showAuth = true; },
} else { reloadUserinfo() {
this.showSku = true; this.u = uni.getStorageSync('mall_UserInfo');
} // this.showAuth = false;
}, },
reloadUserinfo() { //关闭登录窗口
this.u = uni.getStorageSync("mall_UserInfo"); gbAuth() {
// this.showAuth = false; this.showAuth = false;
}, }
//关闭登录窗口 }
gbAuth() {
this.showAuth = false;
},
},
}; };
</script> </script>
<style scoped> <style>
.good-one { .good-one {
margin: 12px; margin: 12px;
position: relative; position: relative;
...@@ -204,46 +157,56 @@ export default { ...@@ -204,46 +157,56 @@ export default {
box-shadow: 0 4px 10px 1px #D2D2D2; box-shadow: 0 4px 10px 1px #D2D2D2;
} }
.good-one .tips { .good-one .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-one .guding { .good-one .guding {
position: relative; position: relative;
} }
.good-one .guding .img-box { .good-one .guding .img-box {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
} }
.good-one .good-info { .good-one .good-info {
padding: 12rpx; padding: 12rpx;
padding-bottom: 0; padding-bottom: 0;
margin-top: -5px; margin-top: -5px;
} }
.good-one .good-info .good-name { .good-one .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-bottom: 13px; margin-bottom: 10px;
font-size:32rpx;
font-weight: bold;
}
.good-one .good-info .good-sub-name{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color:#999999;
margin-bottom: 10px;
} }
.good-one .good-info .good-price-info { .good-one .good-info .good-price-info {
display: flex; display: flex;
} }
.good-one .good-info .good-price-info .price { .good-one .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
font-size: 14px; font-size: 16px;
flex: 1; font-weight: 600;
flex: 1;
} }
.good-one .good-info .good-price-info .buy { .good-one .good-info .good-price-info .buy {
/* width: 24px; */ /* width: 24px; */
text-align: right; text-align: right;
} }
</style> </style>
<template> <template>
<view <view
style="padding: 12px; padding-bottom: 0" style="padding: 12px; padding-bottom: 0;"
:style="{ :style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, 'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '', 'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}" }"
> >
<u-row gutter="24"> <u-row gutter="24">
<u-col span="6" v-for="(item, gli) in goodList" :key="gli"> <u-col span="6" v-for="(item, gli) in goodList" :key="gli">
<view <view
class="good-two" class="good-two"
@click="openGood(item)" @click="openGood(item)"
:style="{ :style="{
border: border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
background: }"
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 >
? '#FFF' <view class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></view>
: '', <view class="img-box">
}" <view class="img-show">
> <image
<view class="tips" v-if="goodsInfo.showGoodsTag" style="
><image
:src="goodsInfo.goodsTagPicUrl"
mode="widthFix"
style="width: 100%"
/></view>
<view class="img-box">
<view class="img-show">
<image
style="
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx 10rpx 0 0; border-radius: 10rpx 10rpx 0 0;
" "
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl" :src="item.picUrl"
/> />
</view> </view>
</view> </view>
<view class="good-info"> <view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ <view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view>
item.name <!-- <view class="good-sub-name" v-if="item.subname">{{item.subname}}</view> -->
}}</view> <!-- <view class="good-sub-name" style="height:30rpx;">
<!-- <view class="good-sub-name" v-if="item.subname">{{item.subname}}</view> --> <template v-if="item.subname">{{item.subname}}</template>
<view class="good-sub-name" style="height: 30rpx"> </view> -->
<template v-if="item.subname">{{ item.subname }}</template> <view class="good-price-info">
</view> <view class="price">
<view class="good-price-info"> {{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}
<view class="price"> <!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> -->
{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : "" }} </view>
<!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> --> <view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
</view> <u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" />
<view <u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" />
class="buy" <u-button
v-if="goodsInfo.showBuyBtn" type="primary"
@click.stop="showSkuHandler(item)" size="mini"
> :ripple="true"
<u-icon :color="goodsInfo.buttonColor"
name="cart-o" :custom-style="{
size="40" 'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
:color="mainColor" 'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
v-if="goodsInfo.buyBtn == 'cart'" }"
/> :plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
<u-icon :shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
name="add-o" v-else
size="40" >
:color="mainColor" {{ goodsInfo.buyBtnText }}
v-else-if="goodsInfo.buyBtn == 'add'" </u-button>
/> </view>
<u-button </view>
type="primary" </view>
size="mini" </view>
:ripple="true" </u-col>
:color="goodsInfo.buttonColor" </u-row>
:custom-style="{
backgroundColor:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? '#FFF'
: goodsInfo.buttonColor,
color:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF',
}"
:plain="
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</view>
</view>
</view>
</u-col>
</u-row>
<good-sku <good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku>
v-if="showSku" <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
borderRadius="20" </view>
v-model="showSku"
:good="sku"
:option-type="2"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template> </template>
<script> <script>
import goodSku from "../goods/goodsku"; import goodSku from '../goods/goodsku';
import auth from "@/components/auth/index.vue"; import auth from '@/components/auth/index.vue';
export default { export default {
components: { components: {
goodSku, goodSku,
auth, auth
}, },
props: ["goodList", "goodsInfo"], props: ['goodList', 'goodsInfo'],
data() { data() {
return { return {
mainColor: "", mainColor: '',
activeKey: 0, activeKey: 0,
showSku: false, showSku: false,
sku: {}, sku: {},
showAuth: false, showAuth: false,
u: {}, u: {}
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
openGood(item) { openGood(item) {
//线路 //线路
if (item.goodType == 4) { if (item.goodType == 4) {
var url = var url="/pages/jiuzhai/jz_LineDetail?tcid=" + item.id + '&configId=' + item.subid;
"/pages/jiuzhai/jz_LineDetail?tcid=" + uni.navigateTo({
item.id + url: url
"&configId=" + });
item.subid; }
console.log("url2", url); //酒店
uni.navigateTo({ else if (item.goodType == 1) {
url: url, uni.navigateTo({
}); url: "/pages/hotel/detail?id=" + item.id
} });
//酒店 }
else if (item.goodType == 1) { //餐食
uni.navigateTo({ else if (item.goodType == 2) {
url: "/pages/hotel/detail?id=" + item.id, uni.navigateTo({
}); url: '/pages/restaurant/detail?id=' + item.id
} });
//餐食 }
else if (item.goodType == 2) { //景点
uni.navigateTo({ else if (item.goodType == 3) {
url: "/pages/restaurant/detail?id=" + item.id, uni.navigateTo({
}); url: '/pages/ticketCoupons/detail?id=' + item.id
} });
//景点 }
else if (item.goodType == 3) { },
uni.navigateTo({ showSkuHandler(g) {
url: "/pages/ticketCoupons/detail?id=" + item.id, this.sku = g;
}); this.u = uni.getStorageSync('mall_UserInfo');
} if (!this.u) {
}, this.u = {
showSkuHandler(g) { nickName: '未登录',
this.sku = g; avatarUrl: ''
this.u = uni.getStorageSync("mall_UserInfo"); };
if (!this.u) { this.showAuth = true;
this.u = { } else {
nickName: "未登录", this.showSku = true;
avatarUrl: "", }
}; },
this.showAuth = true; reloadUserinfo() {
} else { this.u = uni.getStorageSync('mall_UserInfo');
this.showSku = true; // this.showAuth = false;
} },
}, //关闭登录窗口
reloadUserinfo() { gbAuth() {
this.u = uni.getStorageSync("mall_UserInfo"); this.showAuth = false;
// this.showAuth = false; }
}, }
//关闭登录窗口
gbAuth() {
this.showAuth = false;
},
},
}; };
</script> </script>
<style scoped> <style>
.good-two { .good-two {
position: relative; position: relative;
margin-bottom: 12px; margin-bottom: 12px;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
padding-bottom: 10rpx; padding-bottom: 10rpx;
box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2); box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2);
border-radius: 20rpx; border-radius: 20rpx;
} }
.good-two .tips { .good-two .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-two .img-box { .good-two .img-box {
width: 100%; width: 100%;
height: 330rpx; height: 330rpx;
position: relative; position: relative;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.good-two .img-box .img-show { .good-two .img-box .img-show {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
.good-two .guding { .good-two .guding {
position: relative; position: relative;
} }
.good-two .guding .img-box { .good-two .guding .img-box {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
} }
.good-two .good-info { .good-two .good-info {
padding: 20rpx; padding: 20rpx;
/* margin-top: -5px; /* margin-top: -5px;
padding-bottom: 0; */ padding-bottom: 0; */
} }
.good-two .good-info .good-name { .good-two .good-info .good-name {
width: 100%; text-overflow: -o-ellipsis-lastline;
white-space: nowrap; overflow: hidden;
overflow: hidden; text-overflow: ellipsis;
text-overflow: ellipsis; display: -webkit-box;
margin-bottom: 10rpx; -webkit-line-clamp: 2;
font-size: 26rpx; line-clamp: 2;
font-weight: 600; -webkit-box-orient: vertical;
margin-bottom: 10rpx;
font-size: 26rpx;
font-weight: 600;
height: 68rpx;
} }
.good-two .good-info .good-sub-name { .good-two .good-info .good-sub-name {
width: 100%; overflow: hidden;
white-space: nowrap; text-overflow: ellipsis;
overflow: hidden; display: -webkit-box;
text-overflow: ellipsis; /* -webkit-line-clamp: 2;
-webkit-box-orient: vertical; */
margin-bottom: 10rpx; white-space: nowrap;
font-size: 22rpx; margin-bottom: 10rpx;
color: #999999; font-size: 22rpx;
color: #999999;
/* height: 37px; */
} }
.good-two .good-info .good-price-info { .good-two .good-info .good-price-info {
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
} }
.good-two .good-info .good-price-info .price { .good-two .good-info .good-price-info .price {
color: #ff3166; color: #FF3166;
/* flex: 1; */ /* flex: 1; */
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
text-align: right; text-align: right;
} }
.good-two .good-info .good-price-info .buy { .good-two .good-info .good-price-info .buy {
/* width: 24px; */ /* width: 24px; */
text-align: right; text-align: right;
} }
</style> </style>
<template> <template>
<view <view
class="her-scoller" class="her-scoller"
:style="{ :style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, 'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '', 'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}" }"
> >
<view <view
class="good-five" class="good-five"
@click="openGood(item)" @click="openGood(item)"
v-for="(item, gli) in goodList" v-for="(item, gli) in goodList"
:key="gli" :key="gli"
:style="{ :style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '', }"
}" >
> <view class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></view>
<view class="tips" v-if="goodsInfo.showGoodsTag" <view class="img-box">
><image <view class="img-show">
:src="goodsInfo.goodsTagPicUrl" <image style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" />
mode="widthFix" </view>
style="width: 100%" </view>
/></view> <view class="good-info">
<view class="img-box-style5"> <view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view>
<image <view class="good-sub-name" style="height:35rpx;">
style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0" <template v-if="item.subname">{{item.subname}}</template>
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" </view>
:src="item.picUrl" <view class="good-price-info">
/> <view class="price" :style="{ color: mainColor }">
</view> <view class="good-sub-name" style="flex:1;">{{item.thirdname}}</view>
<view class="good-info"> <span style="color: #111;">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ {{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}
item.name </span>
}}</view> <!-- <span style='text-decoration: line-through;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> -->
<view class="good-sub-name" v-if="item.subname">{{ </view>
item.subname <view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
}}</view> <u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" />
<view class="good-price-info"> <u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" />
<view class="price" :style="{ color: mainColor }"> <u-button
<view class="good-sub-name" style="flex: 1">{{ type="primary"
item.thirdname size="mini"
}}</view> :ripple="true"
<span style="color: #111"> :color="goodsInfo.buttonColor"
{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : "" }} :custom-style="
</span> `backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
<!-- <span style='text-decoration: line-through;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> --> "
</view> :plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
<view :shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
class="buy" v-else
v-if="goodsInfo.showBuyBtn" >
@click.stop="showSkuHandler(item)" {{ goodsInfo.buyBtnText }}
> </u-button>
<u-icon </view>
name="cart-o" </view>
size="40" </view>
:color="mainColor" </view>
v-if="goodsInfo.buyBtn == 'cart'" <good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
/> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<u-icon </view>
name="add-o"
size="40"
:color="mainColor"
v-else-if="goodsInfo.buyBtn == 'add'"
/>
<u-button
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="`backgroundColor:${goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
v-if="showSku"
:option-type="2"
borderRadius="20"
v-model="showSku"
:good="sku"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template> </template>
<script> <script>
import goodSku from "../goods/goodsku"; import goodSku from '../goods/goodsku';
import auth from "@/components/auth/index.vue"; import auth from '@/components/auth/index.vue';
export default { export default {
components: { components: {
goodSku, goodSku,
auth, auth
}, },
props: ["goodList", "goodsInfo"], props: ['goodList', 'goodsInfo'],
data() { data() {
return { return {
mainColor: "", mainColor: '',
activeKey: 0, activeKey: 0,
showSku: false, showSku: false,
sku: {}, sku: {},
showAuth: false, showAuth: false,
u: {}, u: {}
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
openGood(item) { openGood(item) {
//线路 //线路
if (item.goodType == 4) { if (item.goodType == 4) {
var url = var url="/pages/jiuzhai/jz_LineDetail?tcid=" + item.id + '&configId=' + item.subid;
"/pages/jiuzhai/jz_LineDetail?tcid=" + console.log("url5",url)
item.id + uni.navigateTo({
"&configId=" + url: url
item.subid; });
console.log("url5", url); }
uni.navigateTo({ //酒店
url: url, else if (item.goodType == 1) {
}); uni.navigateTo({
} url: "/pages/hotel/detail?id=" + item.id
//酒店 });
else if (item.goodType == 1) { }
uni.navigateTo({ //餐食
url: "/pages/hotel/detail?id=" + item.id, else if (item.goodType == 2) {
}); uni.navigateTo({
} url: '/pages/restaurant/detail?id=' + item.id
//餐食 });
else if (item.goodType == 2) { }
uni.navigateTo({ //景点
url: "/pages/restaurant/detail?id=" + item.id, else if (item.goodType == 3) {
}); uni.navigateTo({
} url: '/pages/ticketCoupons/detail?id=' + item.id
//景点 });
else if (item.goodType == 3) { }
uni.navigateTo({ },
url: "/pages/ticketCoupons/detail?id=" + item.id, showSkuHandler(g) {
}); this.sku = g;
} this.u = uni.getStorageSync('mall_UserInfo');
}, if (!this.u) {
showSkuHandler(g) { this.u = {
this.sku = g; nickName: '未登录',
this.u = uni.getStorageSync("mall_UserInfo"); avatarUrl: ''
if (!this.u) { };
this.u = { this.showAuth = true;
nickName: "未登录", } else {
avatarUrl: "", this.showSku = true;
}; }
this.showAuth = true; },
} else { reloadUserinfo() {
this.showSku = true; this.u = uni.getStorageSync('mall_UserInfo');
} // this.showAuth = false;
}, },
reloadUserinfo() { //关闭登录窗口
this.u = uni.getStorageSync("mall_UserInfo"); gbAuth() {
// this.showAuth = false; this.showAuth = false;
}, }
//关闭登录窗口 }
gbAuth() {
this.showAuth = false;
},
},
}; };
</script> </script>
<style scoped> <style>
.her-scoller { .her-scoller {
overflow-x: auto !important; overflow-x: auto !important;
padding: 12px; padding: 12px;
display: flex; /* display: flex; */
white-space: nowrap; white-space: nowrap;
} }
/* .her-scoller::after { /* .her-scoller::after {
clear: both; clear: both;
...@@ -196,67 +150,98 @@ export default { ...@@ -196,67 +150,98 @@ export default {
display: block; display: block;
} */ } */
.her-scoller .good-five { .her-scoller .good-five {
position: relative; position: relative;
margin-right: 30rpx; margin-right: 30rpx;
width: 560rpx; /* width: 30%; */
box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2); /* border: 1rpx solid transparent;
border-radius: 20rpx; border-radius: 10rpx;
padding-bottom: 10rpx; */
display:inline-block;
width: 560rpx;
box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2);
border-radius: 20rpx;
/* float: left; */
} }
.her-scoller .good-five .tips { .her-scoller .good-five .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.her-scoller .good-five .img-box-style5 { .her-scoller .good-five .img-box {
width: 100%; width: 100%;
height: 224rpx; /* height: 0;
border-radius: 20rpx; padding-top: 100%; */
overflow: hidden; position: relative;
height: 224rpx;
border-radius: 20rpx;
overflow: hidden;
}
.her-scoller .good-five .img-box .img-show {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 2;
}
.her-scoller .good-five .guding {
position: relative;
}
.her-scoller .good-five .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
} }
.her-scoller .good-five .good-info { .her-scoller .good-five .good-info {
padding: 30rpx; padding: 30rpx;
} }
.her-scoller .good-five .good-info .good-name { .her-scoller .good-five .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: block; display: block;
/* -webkit-line-clamp: 2; /* -webkit-line-clamp: 2;
-webkit-box-orient: vertical; */ -webkit-box-orient: vertical; */
white-space: nowrap; white-space: nowrap;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 26rpx; font-size: 26rpx;
width: 100%; width: 100%;
font-weight: 600; font-weight: 600;
} }
.her-scoller .good-five .good-info .good-sub-name { .her-scoller .good-five .good-info .good-sub-name{
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: block; display: block;
white-space: nowrap; white-space: nowrap;
font-size: 22rpx; font-size: 22rpx;
color: #999999; color: #999999;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.her-scoller .good-five .good-info .good-price-info { .her-scoller .good-five .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }
.her-scoller .good-five .good-info .good-price-info .price { .her-scoller .good-five .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
/* flex-direction: column; */ /* flex-direction: column; */
} }
.her-scoller .good-five .good-info .good-price-info .buy { .her-scoller .good-five .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
<text style="margin-left: 20rpx;">{{currentBrachName}}</text> <text style="margin-left: 20rpx;">{{currentBrachName}}</text>
</view> </view>
<view style="width: 1px; flex: 1;"> <view style="width: 1px; flex: 1;">
<u-search placeholder="目的地名称" v-model="msg.searchKey" input-align="left" :value="msg.searchKey" text-color="#111" <u-search placeholder="目的地名称" v-model="msg.searchKey" @search="getList" input-align="left" :value="msg.searchKey" text-color="#111"
bg-color="rgba(0,0,0,0)" :show-action="false"></u-search> bg-color="rgba(0,0,0,0)" :show-action="false"></u-search>
</view> </view>
</view> </view>
...@@ -389,10 +389,15 @@ ...@@ -389,10 +389,15 @@
<u-tag mode="plain" border-color="#DFBE6E" color="#DFBE6E" :text="`${item.dayNum}天`" size="mini"></u-tag> <u-tag mode="plain" border-color="#DFBE6E" color="#DFBE6E" :text="`${item.dayNum}天`" size="mini"></u-tag>
</view> </view>
</view> </view>
<view class="price"> <view class="price" style="display:flex;justify-content: space-between;align-items: center;">
<text></text> <view style="font-size:24rpx;color:#999999;">
<text class="money">{{$utils.getretailer()==true? item.b2BPrice:item.b2CPrice}}</text> 最近团期:{{item.startDate}}
<text></text> </view>
<view>
<text></text>
<text class="money">{{$utils.getretailer()==true? item.b2BPrice:item.b2CPrice}}</text>
<text></text>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -679,6 +684,7 @@ ...@@ -679,6 +684,7 @@
}, },
//获取数据 //获取数据
getList() { getList() {
this.dataList=[];
uni.showLoading({ uni.showLoading({
title:'加载中', title:'加载中',
icon:'none' icon:'none'
......
...@@ -521,14 +521,14 @@ ...@@ -521,14 +521,14 @@
style="margin-right: 20px" style="margin-right: 20px"
:key="sIndex2" :key="sIndex2"
v-if="subItem.childItem.useDinnerType == '1'" v-if="subItem.childItem.useDinnerType == '1'"
>{{ subItem.childItem.dinnerName }}</text >早餐:{{ subItem.childItem.dinnerName }}</text
> >
<text <text
style="margin-right: 20px" style="margin-right: 20px"
v-if="subItem.childItem.useDinnerType == '2'" v-if="subItem.childItem.useDinnerType == '2'"
>{{ subItem.childItem.dinnerName }}</text >午餐:{{ subItem.childItem.dinnerName }}</text
> >
<text v-if="subItem.childItem.useDinnerType == '3'">{{ <text v-if="subItem.childItem.useDinnerType == '3'">晚餐:{{
subItem.childItem.dinnerName subItem.childItem.dinnerName
}}</text> }}</text>
</template> </template>
......
<template> <template>
<view class="searchpage"> <view class="searchpage">
<view class="ctrl-box"> <view class="ctrl-box">
<u-search action-text="搜索" :focus="true" :clearabled="true" :show-action="true" radius="40" v-model="searchKey" <u-search action-text="搜索" :focus="true" :clearabled="true" :show-action="true" radius="40" v-model="msg.searchKey"
@search="searchHandler" @custom="searchHandler" @change="changeHandler"></u-search> @search="searchHandler" @custom="searchHandler" @change="changeHandler"></u-search>
</view> </view>
<view class="historys" v-if="searchKey == '' || !loadSearch"> <view class="historys" v-if="msg.searchKey == '' || !loadSearch">
<view class="title-box"> <view class="title-box">
<view class="title">搜索历史</view> <view class="title">搜索历史</view>
<view class="editor" v-if="searchHistory.length > 0"> <view class="editor" v-if="searchHistory.length > 0">
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
</scroll-view> </scroll-view>
<view v-if="!loading && g.length == 0" style="height: calc(100vh - 42px); overflow-y: auto;"> <view v-if="!loading && g.length == 0" style="height: calc(100vh - 42px); overflow-y: auto;">
<u-empty text="抱歉,没有找到商品额~" mode="search" font-size="24" img-width="120" margin-top="24" padding-top="0"></u-empty> <u-empty text="抱歉,没有找到商品额~" mode="search" font-size="24" img-width="120" margin-top="24" padding-top="0"></u-empty>
<view :style="{'padding': IsEducation!=1?'12px':0,}"> <!-- <view :style="{'padding': IsEducation!=1?'12px':0,}">
<view class="recommed" :style="{'padding-left': IsEducation==1?'12px':0,}"> <view class="recommed" :style="{'padding-left': IsEducation==1?'12px':0,}">
<view class="title">为你推荐</view> <view class="title">为你推荐</view>
</view> </view>
<goodlist :list="recommedGoods" v-if="IsEducation!=1"></goodlist> <goodlist :list="recommedGoods" v-if="IsEducation!=1"></goodlist>
<glist :list="recommedGoods" v-if="IsEducation==1"></glist> <glist :list="recommedGoods" v-if="IsEducation==1"></glist>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -74,6 +74,19 @@ ...@@ -74,6 +74,19 @@
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
msg: {
pageIndex: 1,
pageSize: 15,
orderBy: "",
team: [],
days: ['<100'],
startDate: '',
endDate: '',
startCityId: -1,
companyId: 0,
searchKey: '', //搜索数据
priceOrderByField:2
},
showLoading: false, showLoading: false,
g: [], g: [],
page: 1, page: 1,
...@@ -168,71 +181,88 @@ ...@@ -168,71 +181,88 @@
uni.setStorageSync("search_his", this.searchHistory); uni.setStorageSync("search_his", this.searchHistory);
this.page = 1; this.page = 1;
this.g = []; this.g = [];
this.searchKey = val; this.msg.searchKey=val;
this.loadSearch = true; this.loadSearch = true;
this.init(); this.init();
} else { } else {
this.searchKey = ""; this.msg.searchKey = "";
this.loadSearch = false; this.loadSearch = false;
} }
}, },
init() { init() {
this.isover = false; this.g=[];
this.loading = true; uni.showLoading({
this.showLoading = this.page != 1; title:'加载中',
var UserPageType = uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo").UserPageType : 0; icon:'none'
let url })
let StoreId = uni.getStorageSync("storeId")?uni.getStorageSync("storeId").storeId:0; this.apipost(
let IsOpenReserve = uni.getStorageSync("GetAppConfig")?uni.getStorageSync("GetAppConfig").IsOpenReserve:0 "b2b_get_GetB2BTravelPageList",
if(IsOpenReserve==0){//如果没开启 门店id赋值为0 this.msg,
StoreId=0 res => {
} uni.hideLoading();
if (res.resultCode == 1) {
if (this.IsEducation == 1) { this.g = res.data.pageData;
url = '/api/AppletSchool/GetAppletCoursePageList'; this.page_count = res.data.pageCount;
} else {
url = "/api/AppletGoods/GetAppletGoodsPageListForZY";
}
this.request2({
url: url,
data: {
pageIndex: this.page,
pageSize: 20,
Name: this.searchKey,
GoodsType: 0,
CategoryIds: '',
OrderBy: 1,
GoodsPageType: UserPageType,
StoreId:StoreId
},
},
(res) => {
console.log(res, '搜索ress');
this.showLoading = true;
if (res.data.pageData.length > 0) {
console.log(res.data.pageData)
res.data.pageData.forEach(x => {
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
if (x.attr && x.attr.length > 0) {
x.attr.forEach(j => {
x.totalStock += j.stock
})
}
})
}
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.isover = true;
this.status = "nomore";
} else {
this.status = "loadmore";
} }
this.loading = false; },
} null
); );
// this.isover = false;
// this.loading = true;
// this.showLoading = this.page != 1;
// var UserPageType = uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo").UserPageType : 0;
// let url
// let StoreId = uni.getStorageSync("storeId")?uni.getStorageSync("storeId").storeId:0;
// let IsOpenReserve = uni.getStorageSync("GetAppConfig")?uni.getStorageSync("GetAppConfig").IsOpenReserve:0
// if(IsOpenReserve==0){//如果没开启 门店id赋值为0
// StoreId=0
// }
// if (this.IsEducation == 1) {
// url = '/api/AppletSchool/GetAppletCoursePageList';
// } else {
// url = "/api/AppletGoods/GetAppletGoodsPageListForZY";
// }
// this.request2({
// url: url,
// data: {
// pageIndex: this.page,
// pageSize: 20,
// Name: this.searchKey,
// GoodsType: 0,
// CategoryIds: '',
// OrderBy: 1,
// GoodsPageType: UserPageType,
// StoreId:StoreId
// },
// },
// (res) => {
// console.log(res, '搜索ress');
// this.showLoading = true;
// if (res.data.pageData.length > 0) {
// console.log(res.data.pageData)
// res.data.pageData.forEach(x => {
// x.marketingLogo = JSON.parse(x.marketingLogo)
// x.totalStock = 0;
// if (x.attr && x.attr.length > 0) {
// x.attr.forEach(j => {
// x.totalStock += j.stock
// })
// }
// })
// }
// this.g = this.g.concat(res.data.pageData);
// this.page_count = res.data.pageCount;
// if (this.page_count == 1) {
// this.isover = true;
// this.status = "nomore";
// } else {
// this.status = "loadmore";
// }
// this.loading = false;
// }
// );
}, },
lower(e) { lower(e) {
if (this.page < this.page_count) { if (this.page < this.page_count) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment