Commit 59232b8f authored by zhengke's avatar zhengke

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

parents 09525173 4c558210
<template> <template>
<view <view
style="padding: 12px; padding-bottom: 0;" style="padding: 12px; padding-bottom: 0; display: flex; flex-wrap: wrap"
: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"> <view
<u-col span="6" v-for="(item, gli) in goodList" :key="gli"> v-for="(item, gli) in goodList"
<view :key="gli"
class="good-two" class="good-two"
@click="openGood(item)" @click="openGood(item)"
:style="{ >
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', <view
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' :style="{
}" border:
> goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
<view class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></view> background:
<view class="img-box"> goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2
<view class="img-show"> ? '#FFF'
<image : '',
style=" }"
width: 100%; >
height: 100%; <view class="tips" v-if="goodsInfo.showGoodsTag"
border-radius: 10rpx 10rpx 0 0; ><image
" :src="goodsInfo.goodsTagPicUrl"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" mode="widthFix"
:src="item.picUrl" style="width: 100%"
/> /></view>
</view> <view class="img-box">
</view> <view class="img-show">
<view class="good-info"> <image
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view> style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0"
<!-- <view class="good-sub-name" v-if="item.subname">{{item.subname}}</view> --> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
<!-- <view class="good-sub-name" style="height:30rpx;"> :src="item.picUrl"
/>
</view>
</view>
<view class="good-info">
<view class="good-name-style2" v-if="goodsInfo.showGoodsName">{{
item.name
}}</view>
<!-- <view class="good-sub-name" v-if="item.subname">{{item.subname}}</view> -->
<!-- <view class="good-sub-name" style="height:30rpx;">
<template v-if="item.subname">{{item.subname}}</template> <template v-if="item.subname">{{item.subname}}</template>
</view> --> </view> -->
<view class="good-price-info"> <view class="good-price-info">
<view class="price"> <view class="price">
{{ goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : '' }} {{ goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : "" }}
<!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> --> <!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> -->
</view> </view>
<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'" /> class="buy"
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> v-if="goodsInfo.showBuyBtn"
<u-button @click.stop="showSkuHandler(item)"
type="primary" >
size="mini" <u-icon
:ripple="true" name="cart-o"
:color="goodsInfo.buttonColor" size="40"
:custom-style="{ :color="mainColor"
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor , v-if="goodsInfo.buyBtn == 'cart'"
'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF' />
}" <u-icon
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" name="add-o"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" size="40"
v-else :color="mainColor"
> v-else-if="goodsInfo.buyBtn == 'add'"
{{ goodsInfo.buyBtnText }} />
</u-button> <u-button
</view> type="primary"
</view> size="mini"
</view> :ripple="true"
</view> :color="goodsInfo.buttonColor"
</u-col> :custom-style="{
</u-row> backgroundColor:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> ? '#FFF'
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> : goodsInfo.buttonColor,
</view> 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>
</view>
<good-sku
v-if="showSku"
borderRadius="20"
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="/pages/jiuzhai/jz_LineDetail?tcid=" + item.id + '&configId=' + item.subid; var url =
uni.navigateTo({ "/pages/jiuzhai/jz_LineDetail?tcid=" +
url: url item.id +
}); "&configId=" +
} item.subid;
//酒店 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> <style>
.good-two { .good-two {
position: relative; width: 48%;
margin-bottom: 12px; position: relative;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
padding-bottom: 10rpx; margin: 0 6rpx;
margin-bottom: 12px;
box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2); padding-bottom: 10rpx;
border-radius: 20rpx; box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2);
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-style2 {
text-overflow: -o-ellipsis-lastline; text-overflow: -o-ellipsis-lastline;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-bottom: 10rpx; font-size: 26rpx;
font-size: 26rpx; font-weight: 600;
font-weight: 600; /* #ifdef MP-WEIXIN */
height: 68rpx; height: 68rpx;
/* #endif */
/* #ifdef MP-ALIPAY */
height: 60rpx;
margin: 6rpx 0;
/* #endif */
} }
.good-two .good-info .good-sub-name { .good-two .good-info .good-sub-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; */
white-space: nowrap; white-space: nowrap;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 22rpx; font-size: 22rpx;
color: #999999; color: #999999;
/* height: 37px; */ /* 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>
...@@ -669,7 +669,7 @@ export default { ...@@ -669,7 +669,7 @@ export default {
} }
.hotel-list .search-box .date { .hotel-list .search-box .date {
width: 80rpx; width: 82rpx;
height: 50rpx; height: 50rpx;
font-size: 22rpx; font-size: 22rpx;
font-weight: 500; font-weight: 500;
......
...@@ -870,6 +870,7 @@ ...@@ -870,6 +870,7 @@
> >
</view> </view>
<view style="display: flex; align-items: center"> <view style="display: flex; align-items: center">
<!-- #ifdef MP-WEIXIN -->
<button open-type="contact" class="jz_ConButton"> <button open-type="contact" class="jz_ConButton">
<img <img
style="width: 36rpx; height: 38rpx" style="width: 36rpx; height: 38rpx"
...@@ -878,6 +879,7 @@ ...@@ -878,6 +879,7 @@
/> />
<view style="color: #111111; font-size: 22rpx">客服</view> <view style="color: #111111; font-size: 22rpx">客服</view>
</button> </button>
<!-- #endif -->
<view class="jz_OrderNow" @click="goReserce()">立即预定</view> <view class="jz_OrderNow" @click="goReserce()">立即预定</view>
</view> </view>
</view> </view>
...@@ -896,6 +898,7 @@ ...@@ -896,6 +898,7 @@
<text style="font-size: 22rpx">/起</text> <text style="font-size: 22rpx">/起</text>
</view> </view>
<view style="display: flex; align-items: center"> <view style="display: flex; align-items: center">
<!-- #ifdef MP-WEIXIN -->
<button open-type="contact" class="jz_ConButton"> <button open-type="contact" class="jz_ConButton">
<img <img
style="width: 36rpx; height: 38rpx" style="width: 36rpx; height: 38rpx"
...@@ -904,6 +907,7 @@ ...@@ -904,6 +907,7 @@
/> />
<view style="color: #111111; font-size: 22rpx">客服</view> <view style="color: #111111; font-size: 22rpx">客服</view>
</button> </button>
<!-- #endif -->
<view <view
class="jz_OrderNow" class="jz_OrderNow"
@click="openOrderPreview" @click="openOrderPreview"
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
v-if="item.orderState == 2" v-if="item.orderState == 2"
class="jz_Zailai" class="jz_Zailai"
style="width: 110rpx; margin-right: 10rpx" style="width: 110rpx; margin-right: 10rpx"
@click="goZhifu.stop(item)" @click.stop="goZhifu(item)"
>付款</view >付款</view
> >
<!-- #endif --> <!-- #endif -->
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
v-if="item.isApplyForCancel != 1" v-if="item.isApplyForCancel != 1"
class="jz_Zailai" class="jz_Zailai"
style="width: 110rpx" style="width: 110rpx"
@click="goCancel.stop(item)" @click.stop="goCancel(item)"
>取消</view >取消</view
> >
</view> </view>
...@@ -472,7 +472,15 @@ export default { ...@@ -472,7 +472,15 @@ export default {
success: function (res) { success: function (res) {
console.log("success", res); console.log("success", res);
if (res.resultCode == "9000") { if (res.resultCode == "9000") {
that.getOrderInfo(); uni.showToast({
title: "支付成功",
});
uni.redirectTo({
url:
"/pages/jiuzhai/paysuccess?PreferPrice=" +
that.price +
"&isFrom=1",
});
} else if (res.resultCode == "6001") { } else if (res.resultCode == "6001") {
uni.showToast({ uni.showToast({
title: "支付取消", title: "支付取消",
......
...@@ -867,7 +867,16 @@ export default { ...@@ -867,7 +867,16 @@ export default {
(res) => { (res) => {
this.orderInfo = JSON.parse(res.data); this.orderInfo = JSON.parse(res.data);
if (res.data) { if (res.data) {
that.PayAli(res.data, data); // that.PayAli(res.data, data);
let cbObj = {
TradeNo: res.data,
OrderNo: data.OrderNo,
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
console.log(883, cbObj);
this.payAliCallback(cbObj);
console.log(884);
} else { } else {
uni.showToast({ uni.showToast({
title: "获取交易号失败", title: "获取交易号失败",
...@@ -907,7 +916,7 @@ export default { ...@@ -907,7 +916,7 @@ export default {
}); });
}, },
payAliCallback(obj) { payAliCallback(obj) {
console.log(893, Obj); console.log(893, obj);
this.request2( this.request2(
{ {
url: "/api/AliPay/ALiPayCallBackDmcNotify", url: "/api/AliPay/ALiPayCallBackDmcNotify",
...@@ -925,11 +934,6 @@ export default { ...@@ -925,11 +934,6 @@ export default {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + obj.PreferPrice, url: "/pages/jiuzhai/paysuccess?PreferPrice=" + obj.PreferPrice,
}); });
// setTimeout(() => {
// uni.redirectTo({
// url: "/pages/jiuzhai/jz_MyOrder",
// });
// }, 1000);
}, },
(err) => { (err) => {
console.log("cb2", err); console.log("cb2", err);
......
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