Commit db24da2f authored by 罗超's avatar 罗超

1

parent acffdfef
......@@ -80,7 +80,7 @@
<view class="jz_TopPrice">
<view class="jz_LineTitle">
<text class="jz_renmin">¥</text
><text class="jz_B2bPrice">{{currentPrice.b2CPrice}}</text>
><text class="jz_B2bPrice">{{ currentPrice.b2CPrice }}</text>
<text style="color: #999999; font-size: 24rpx; font-weight: 400">
/人起</text
>
......@@ -100,8 +100,8 @@
<text v-if="dataList.title">{{ dataList.title }}</text>
</view>
<view class="jz_Maidian">
<text>{{dataList.productRecommend}}</text>
</view>
<text>{{ dataList.productRecommend }}</text>
</view>
</view>
<view class="jz_Service">
<view class="jz_Serflex">
......@@ -179,7 +179,7 @@
<view
v-if="item.remainNum > 0"
style="color: #ff3166; font-size: 26rpx"
>{{item.b2CPrice}}</view
>{{ item.b2CPrice }}</view
>
<view v-if="item.remainNum == 0" style="padding: 20rpx 0">
<text style="font-size: 32rpx; font-weight: 600">已售罄</text>
......@@ -914,6 +914,11 @@
</view>
</view>
</view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template>
<script>
......@@ -922,9 +927,11 @@ import canlendar from "./components/sign/index.vue";
// #ifdef MP-ALIPAY
import parseHtml from "../../plugin/htmlparse.js";
// #endif
import auth from "@/components/auth/index.vue";
export default {
components: {
canlendar,
auth,
},
data() {
return {
......@@ -958,6 +965,8 @@ export default {
currentPrice: {},
canCreateOrder: false,
finishFirstLoad: false,
showAuth: false,
U: {},
};
},
created() {},
......@@ -1047,6 +1056,13 @@ export default {
},
});
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
},
openOrderPreview() {
if (this.canCreateOrder && this.finishFirstLoad) {
this.showOrderPreviwe = true;
......@@ -1119,11 +1135,11 @@ export default {
res.data.tempImgCover = JSON.parse(res.data.imgCover);
// let tempPrice= res.data.priceList.filter(x=>x.remainNum>0)
// res.data.priceList=tempPrice
this.dataList = res.data;
this.scenicNum = 0;
//this.dataList.productRecommend=this.dataList.productRecommend.split('\n').join('&hc')
console.log(this.dataList.productRecommend)
//this.dataList.productRecommend=this.dataList.productRecommend.split('\n').join('&hc')
console.log(this.dataList.productRecommend);
this.dataList.dayList.forEach((x) => {
x.dayArray.forEach((y) => {
if (y.type == 2) {
......@@ -1254,28 +1270,36 @@ export default {
},
//立即预定
goReserce() {
let myObj={};
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
return;
}
let myObj = {};
// let myCurrentInfo = this.currentPrice;
// myCurrentInfo.startCityName = this.dataList.startCityName;
myObj.startCityName = this.dataList.startCityName
myObj.startDate = this.currentPrice.startDate;
myObj.dayNum = this.currentPrice.dayNum;
myObj.title = this.currentPrice.title;
myObj.b2BPrice = this.currentPrice.b2BPrice;
myObj.b2CPrice = this.currentPrice.b2CPrice;
myObj.childNeedPrice = this.currentPrice.childNeedPrice;
myObj.childNoNeedPrice = this.currentPrice.childNoNeedPrice;
myObj.babyPrice = this.currentPrice.babyPrice;
myObj.babyChargePrice = this.currentPrice.babyChargePrice;
myObj.b2BMemberPrice = this.currentPrice.b2BMemberPrice;
myObj.tcid = this.currentPrice.tcid;
myObj.startCityName = this.dataList.startCityName;
myObj.startDate = this.currentPrice.startDate;
myObj.dayNum = this.currentPrice.dayNum;
myObj.title = this.currentPrice.title;
myObj.b2BPrice = this.currentPrice.b2BPrice;
myObj.b2CPrice = this.currentPrice.b2CPrice;
myObj.childNeedPrice = this.currentPrice.childNeedPrice;
myObj.childNoNeedPrice = this.currentPrice.childNoNeedPrice;
myObj.babyPrice = this.currentPrice.babyPrice;
myObj.babyChargePrice = this.currentPrice.babyChargePrice;
myObj.b2BMemberPrice = this.currentPrice.b2BMemberPrice;
myObj.tcid = this.currentPrice.tcid;
let imgCover = JSON.parse(this.dataList.imgCover);
if (imgCover.length > 0) {
// myCurrentInfo.CoverImg = imgCover[0].Url;
myObj.CoverImg = imgCover[0].Url
myObj.CoverImg = imgCover[0].Url;
}
let myCurr = JSON.stringify(myObj);
let ren = {
crCount: this.crCount,
etCount: this.etCount,
......
......@@ -166,21 +166,32 @@
<view
class="jz_Zailai"
style="margin-right: 10rpx"
@click="gojz_List"
@click.stop="gojz_List"
>再来一单</view
>
<!-- #ifdef MP-WEIXIN -->
<view
v-if="item.orderState == 2"
class="jz_Zailai"
style="width: 110rpx; margin-right: 10rpx"
@click="goZhifu(item)"
@click="goZhifu.stop(item)"
>付款</view
>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view
v-if="item.orderState == 2"
class="jz_Zailai"
style="width: 110rpx; margin-right: 10rpx"
@click.stop="goZhifuAli(item)"
>付款</view
>
<!-- #endif -->
<view
v-if="item.isApplyForCancel != 1"
class="jz_Zailai"
style="width: 110rpx"
@click="goCancel(item)"
@click="goCancel.stop(item)"
>取消</view
>
</view>
......@@ -380,6 +391,7 @@ export default {
}
},
//付款
// #ifdef MP-WEIXIN
goZhifu(item) {
console.log(item, "item");
let url = "/api/WeChatPay/GetTravlePayInfo";
......@@ -432,6 +444,51 @@ export default {
},
});
},
// #endif
// #ifdef MP-ALIPAY
goZhifuAli(item) {
console.log(item, "item");
let url = "/api/WeChatPay/GetTravlePayInfo";
this.price = item.preferPrice;
this.request2(
{
url: url,
data: {
OrderId: item.orderId,
GoodsName: item.title,
OrderPayType: 2,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
this.goPayAli(res.data);
}
);
},
goPayAli(tradeNO) {
let that = this;
my.tradePay({
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
if (res.resultCode == "9000") {
that.getOrderInfo();
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
});
}
},
fail: function (err) {
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
},
// #endif
},
};
</script>
......@@ -295,7 +295,7 @@
<view class="label">联系电话</view>
<view class="val">
<input
type="text"
type="number"
v-model="contactMobile"
placeholder="输入电话号码"
/>
......@@ -341,7 +341,7 @@
<text style="margin-right: 30rpx">成人</text>
</view>
<view style="text-align: right"
>{{ orderMsg.ManNum }}人 × ¥{{currentPriceInfo.b2CPrice}}</view
>{{ orderMsg.ManNum }}人 × ¥{{ currentPriceInfo.b2CPrice }}</view
>
</view>
<view
......@@ -572,8 +572,8 @@ export default {
// } else {
// price = this.currentPriceInfo.b2CPrice;
// }
price = this.currentPriceInfo.b2CPrice;
price = this.currentPriceInfo.b2CPrice;
this.orderMsg.ChirdNum =
parseInt(this.orderMsg.ChirdNoBedNum) +
parseInt(this.orderMsg.ChirdNeedBedNum);
......@@ -775,7 +775,7 @@ export default {
var ContactMobile = this.contactMobile;
var CustomerType = 4;
var price = this.currentPriceInfo.b2CPrice;
let msg = {
OrderId: 0,
TCID: this.currentPriceInfo.tcid,
......@@ -852,7 +852,6 @@ export default {
querenAli(OrderId) {
let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.currentPriceInfo.title;
GoodsName = GoodsName.slice(0, 10);
this.request2(
{
url: url,
......@@ -873,7 +872,6 @@ export default {
duration: 2000,
});
}
console.log(873, res);
}
);
},
......@@ -883,41 +881,17 @@ export default {
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + price,
});
}, 100);
},
fail: function (err) {
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
return;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function (res) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + price,
if (res.resultCode == "9000") {
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
}, 1000);
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
});
}, 100);
}
},
fail: function (err) {
console.log("fail:", err);
......@@ -925,11 +899,6 @@ export default {
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/jz_SureOrder?orderId=" + OrderId,
});
}, 100);
},
});
},
......
......@@ -811,31 +811,11 @@ export default {
},
// #endif
// #ifdef MP-ALIPAY
// goFukuanAli() {
// if (this.submit || this.submitCancel) return;
// var that = this;
// var tempObj = uni.getStorageSync("basedata").mall.wechatmessage;
// var tmplIds = [];
// if (tempObj && tempObj.length > 0) {
// tempObj.forEach((x) => {
// if (x.Name == "下单成功提醒" || x.Name == "订单取消提醒") {
// tmplIds.push(x.MessageId);
// }
// });
// }
// uni.requestSubscribeMessage({
// tmplIds: tmplIds,
// complete(res) {
// that.goZhifu();
// },
// });
// },
//支付
//支付宝支付
goZhifuAli() {
this.submit = true;
let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.orderData.model.Title;
GoodsName = GoodsName.slice(0, 10);
this.request2(
{
url: url,
......@@ -847,8 +827,6 @@ export default {
},
},
(res) => {
let orderInfo = JSON.parse(res.data);
console.log(orderInfo);
if (res.data) {
this.goPayAli(res.data);
} else {
......@@ -860,45 +838,20 @@ export default {
}
);
},
goPayAli(orderInfo) {
goPayAli(tradeNO) {
let that = this;
my.tradePay({
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
that.submit = false;
//todo
that.initOrderInfo(that.orderData.model.OrderId);
},
fail: function (err) {
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
that.submit = false;
that.initOrderInfo(that.orderData.model.OrderId);
},
});
return;
uni.requestPayment({
provider: "wxpay",
timeStamp: orderInfo.timeStamp,
nonceStr: orderInfo.nonceStr,
package: orderInfo.package,
signType: orderInfo.signType,
paySign: orderInfo.sign,
success: function (res) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
that.submit = false;
//todo
that.initOrderInfo(that.orderData.model.OrderId);
if (res.resultCode == "9000") {
that.submit = false;
that.initOrderInfo(that.orderData.model.OrderId);
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
});
}
},
fail: function (err) {
console.log("fail:", 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