|
@@ -117,7 +117,7 @@
|
|
<div class="buy_button">
|
|
<div class="buy_button">
|
|
<button
|
|
<button
|
|
class="cu-btn lg bg-orange text-center margin yellowButt"
|
|
class="cu-btn lg bg-orange text-center margin yellowButt"
|
|
- @click="to_confirm(item)"
|
|
|
|
|
|
+ @click="to_confirm_vip(item)"
|
|
>购买{{item.goods_name}}</button>
|
|
>购买{{item.goods_name}}</button>
|
|
</div>
|
|
</div>
|
|
</view>
|
|
</view>
|
|
@@ -220,7 +220,7 @@
|
|
<div class="buy_button">
|
|
<div class="buy_button">
|
|
<button
|
|
<button
|
|
class="cu-btn lg bg-orange text-center margin yellowButt"
|
|
class="cu-btn lg bg-orange text-center margin yellowButt"
|
|
- @click="to_confirm(item)"
|
|
|
|
|
|
+ @click="to_confirm_time(item)"
|
|
>购买{{
|
|
>购买{{
|
|
item.goods_name
|
|
item.goods_name
|
|
}}
|
|
}}
|
|
@@ -284,8 +284,52 @@ export default {
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ to_confirm_vip($item) {
|
|
|
|
+ console.log("data", $item);
|
|
|
|
+ //实付
|
|
|
|
+ if ($item.coupon.type == 3) {
|
|
|
|
+ $item["total_price"] =
|
|
|
|
+ Math.round($item.price * $item.coupon.discount * 100) / 100;
|
|
|
|
+ } else if ($item.coupon.type == 2) {
|
|
|
|
+ $item["total_price"] =
|
|
|
|
+ Math.round(($item.price - $item.coupon.reduce) * 100) / 100;
|
|
|
|
+ } else if ($item.coupon.type == 4) {
|
|
|
|
+ $item["total_price"] =
|
|
|
|
+ Math.round(($item.price - $item.coupon.random) * 100) / 100;
|
|
|
|
+ } else {
|
|
|
|
+ $item["total_price"] =
|
|
|
|
+ Math.round($item.price * $item.discount * 100) / 100;
|
|
|
|
+ }
|
|
|
|
+ //减多少
|
|
|
|
+ if ($item.coupon.type == 3) {
|
|
|
|
+ $item["reduce"] =
|
|
|
|
+ Math.round(
|
|
|
|
+ ($item.price - $item.price * $item.coupon.discount) * 100
|
|
|
|
+ ) / 100;
|
|
|
|
+ } else if ($item.coupon.type == 2) {
|
|
|
|
+ $item["reduce"] = $item.coupon.reduce;
|
|
|
|
+ } else if ($item.coupon.type == 4) {
|
|
|
|
+ $item["reduce"] = $item.coupon.random;
|
|
|
|
+ }
|
|
|
|
+ // $item["total_price"] = ($item.price * $item.discount).toFixed(2);
|
|
|
|
+ if ($item.goods_id == 1) {
|
|
|
|
+ $item["add_price"] = 20;
|
|
|
|
+ $item["add_month"] = "一";
|
|
|
|
+ } else if ($item.goods_id == 2) {
|
|
|
|
+ $item["add_price"] = 30;
|
|
|
|
+ $item["add_month"] = "三";
|
|
|
|
+ } else if ($item.goods_id == 3) {
|
|
|
|
+ $item["add_price"] = 30;
|
|
|
|
+ $item["add_month"] = "三";
|
|
|
|
+ }
|
|
|
|
+ $this.selection_card = $item;
|
|
|
|
+ var data = JSON.stringify($item);
|
|
|
|
+ mpvue.navigateTo({
|
|
|
|
+ url: "/pages/user_center/confirmPay/main?data=" + data,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//确认订单
|
|
//确认订单
|
|
- to_confirm($item) {
|
|
|
|
|
|
+ to_confirm_time($item) {
|
|
// 判断家庭VIP是否过期
|
|
// 判断家庭VIP是否过期
|
|
check_vip().then((res) => {
|
|
check_vip().then((res) => {
|
|
console.log("vip", res);
|
|
console.log("vip", res);
|