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">
<u-col span="6" v-for="(item, gli) in goodList" :key="gli">
<view <view
v-for="(item, gli) in goodList"
:key="gli"
class="good-two" class="good-two"
@click="openGood(item)" @click="openGood(item)"
>
<view
:style="{ :style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', border:
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
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="tips" v-if="goodsInfo.showGoodsTag"
><image
:src="goodsInfo.goodsTagPicUrl"
mode="widthFix"
style="width: 100%"
/></view>
<view class="img-box"> <view class="img-box">
<view class="img-show"> <view class="img-show">
<image <image
style=" style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0"
width: 100%;
height: 100%;
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">{{ item.name }}</view> <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" v-if="item.subname">{{item.subname}}</view> -->
<!-- <view class="good-sub-name" style="height:30rpx;"> <!-- <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"
@click.stop="showSkuHandler(item)"
>
<u-icon
name="cart-o"
size="40"
:color="mainColor"
v-if="goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name="add-o"
size="40"
:color="mainColor"
v-else-if="goodsInfo.buyBtn == 'add'"
/>
<u-button <u-button
type="primary" type="primary"
size="mini" size="mini"
:ripple="true" :ripple="true"
:color="goodsInfo.buttonColor" :color="goodsInfo.buttonColor"
:custom-style="{ :custom-style="{
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor , backgroundColor:
'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF' 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" :plain="
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else v-else
> >
{{ goodsInfo.buyBtnText }} {{ goodsInfo.buyBtnText }}
...@@ -64,30 +99,38 @@ ...@@ -64,30 +99,38 @@
</view> </view>
</view> </view>
</view> </view>
</u-col> </view>
</u-row> <good-sku
v-if="showSku"
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> borderRadius="20"
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> v-model="showSku"
:good="sku"
:option-type="2"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view> </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() {
...@@ -97,37 +140,41 @@ export default { ...@@ -97,37 +140,41 @@ export default {
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 =
"/pages/jiuzhai/jz_LineDetail?tcid=" +
item.id +
"&configId=" +
item.subid;
uni.navigateTo({ uni.navigateTo({
url: url url: url,
}); });
} }
//酒店 //酒店
else if (item.goodType == 1) { else if (item.goodType == 1) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/hotel/detail?id=" + item.id url: "/pages/hotel/detail?id=" + item.id,
}); });
} }
//餐食 //餐食
else if (item.goodType == 2) { else if (item.goodType == 2) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/restaurant/detail?id=' + item.id url: "/pages/restaurant/detail?id=" + item.id,
}); });
} }
//景点 //景点
else if (item.goodType == 3) { else if (item.goodType == 3) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/ticketCoupons/detail?id=' + item.id url: "/pages/ticketCoupons/detail?id=" + item.id,
}); });
} }
}, },
showSkuHandler(g) { showSkuHandler(g) {
this.sku = g; this.sku = g;
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
nickName: '未登录', nickName: "未登录",
avatarUrl: '' avatarUrl: "",
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
...@@ -135,26 +182,27 @@ export default { ...@@ -135,26 +182,27 @@ export default {
} }
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth = false; // this.showAuth = false;
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth() { gbAuth() {
this.showAuth = false; this.showAuth = false;
} },
} },
}; };
</script> </script>
<style> <style>
.good-two { .good-two {
width: 48%;
position: relative; position: relative;
margin-bottom: 12px;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
margin: 0 6rpx;
margin-bottom: 12px;
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;
} }
...@@ -198,7 +246,7 @@ export default { ...@@ -198,7 +246,7 @@ export default {
/* 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;
...@@ -206,10 +254,15 @@ export default { ...@@ -206,10 +254,15 @@ export default {
-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;
...@@ -228,7 +281,7 @@ export default { ...@@ -228,7 +281,7 @@ export default {
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;
......
...@@ -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