|
@@ -235,15 +235,37 @@
|
|
<button class="text-white cu-btn round scan_btn" @click="to_scan">扫描</button>
|
|
<button class="text-white cu-btn round scan_btn" @click="to_scan">扫描</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
-<!-- 不能购买弹窗 -->
|
|
|
|
|
|
+ <!-- 购买vip提示弹窗 -->
|
|
|
|
+ <van-popup
|
|
|
|
+ :show="vip_err_show"
|
|
|
|
+ @close="close_err_pop"
|
|
|
|
+ round
|
|
|
|
+ >
|
|
|
|
+ <div class="err_container flex flex-direction align-center justify-around padding-top-xl padding-lr-sm">
|
|
|
|
+ <div v-text="cant_buy_vip" class="padding-lr-lg text-lg text-black" style="line-height:28px"></div>
|
|
|
|
+
|
|
|
|
+ <div class="button_group flex justify-around">
|
|
|
|
+ <button
|
|
|
|
+ class="cu-btn bg-gray text-white lg margin-right-lg btnFail"
|
|
|
|
+ @click="close_err_pop"
|
|
|
|
+ >取消</button>
|
|
|
|
+ <button
|
|
|
|
+ class="cu-btn bg-primary text-white lg btnFail"
|
|
|
|
+ @click="to_confirm(buy_vip_item)"
|
|
|
|
+ >确认</button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+<!-- 不能购买时间弹窗 -->
|
|
<van-popup
|
|
<van-popup
|
|
:custom-style='cant_buy_popup'
|
|
:custom-style='cant_buy_popup'
|
|
- :show="is_can_buy"
|
|
|
|
|
|
+ :show="is_cant_buy"
|
|
:round="true"
|
|
:round="true"
|
|
@close="onClosePopup">
|
|
@close="onClosePopup">
|
|
|
|
|
|
- <span class="margin-bottom-sm">您是家庭VIP会员</span>
|
|
|
|
- <span>无需购买时间包</span>
|
|
|
|
|
|
+ <div v-text="cant_buy_time"></div>
|
|
|
|
+
|
|
</van-popup>
|
|
</van-popup>
|
|
<van-toast id="van-toast"/>
|
|
<van-toast id="van-toast"/>
|
|
</div>
|
|
</div>
|
|
@@ -271,11 +293,17 @@ export default {
|
|
userinfo: {},
|
|
userinfo: {},
|
|
// 选中的充值卡
|
|
// 选中的充值卡
|
|
selection_card: {},
|
|
selection_card: {},
|
|
- // 不可购买弹窗
|
|
|
|
- is_can_buy: false,
|
|
|
|
|
|
+ // vip购买提示弹窗
|
|
|
|
+ vip_err_show:false,
|
|
|
|
+ cant_buy_vip:"",
|
|
|
|
+ buy_vip_item:{},
|
|
|
|
+ // 不可购买时间弹窗
|
|
|
|
+ is_cant_buy: false,
|
|
|
|
+ cant_buy_time:"",
|
|
cant_buy_popup: `height:120px;
|
|
cant_buy_popup: `height:120px;
|
|
width:70%;
|
|
width:70%;
|
|
display:flex;
|
|
display:flex;
|
|
|
|
+ padding:10px;
|
|
flex-direction:column;
|
|
flex-direction:column;
|
|
justify-content:center;
|
|
justify-content:center;
|
|
align-items:center
|
|
align-items:center
|
|
@@ -285,6 +313,38 @@ export default {
|
|
watch: {},
|
|
watch: {},
|
|
methods: {
|
|
methods: {
|
|
to_confirm_vip($item) {
|
|
to_confirm_vip($item) {
|
|
|
|
+ check_vip(1).then((res) => {
|
|
|
|
+ console.log("vip", res);
|
|
|
|
+
|
|
|
|
+ let $res = res.data
|
|
|
|
+ if ($res.code == 0) {
|
|
|
|
+ $this.to_confirm($item)
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ $this.cant_buy_vip = $res.errmsg
|
|
|
|
+ $this.buy_vip_item = $item
|
|
|
|
+ $this.vip_err_show = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //确认订单
|
|
|
|
+ to_confirm_time($item) {
|
|
|
|
+ // 判断家庭VIP是否过期
|
|
|
|
+ check_vip(2).then((res) => {
|
|
|
|
+ console.log("vip", res);
|
|
|
|
+
|
|
|
|
+ let $res = res.data
|
|
|
|
+ if ($res.code == 0) {
|
|
|
|
+ $this.to_confirm($item)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ $this.cant_buy_time = $res.errmsg
|
|
|
|
+ $this.is_cant_buy = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 支付通用
|
|
|
|
+ to_confirm($item){
|
|
console.log("data", $item);
|
|
console.log("data", $item);
|
|
//实付
|
|
//实付
|
|
if ($item.coupon.type == 3) {
|
|
if ($item.coupon.type == 3) {
|
|
@@ -328,62 +388,11 @@ export default {
|
|
url: "/pages/user_center/confirmPay/main?data=" + data,
|
|
url: "/pages/user_center/confirmPay/main?data=" + data,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //确认订单
|
|
|
|
- to_confirm_time($item) {
|
|
|
|
- // 判断家庭VIP是否过期
|
|
|
|
- check_vip().then((res) => {
|
|
|
|
- console.log("vip", res);
|
|
|
|
-
|
|
|
|
- if (res.code == 0) {
|
|
|
|
- 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,
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- $this.is_can_buy = true;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
onClosePopup() {
|
|
onClosePopup() {
|
|
- $this.is_can_buy = false;
|
|
|
|
|
|
+ $this.is_cant_buy = false;
|
|
|
|
+ },
|
|
|
|
+ close_err_pop(){
|
|
|
|
+ $this.vip_err_show = false;
|
|
},
|
|
},
|
|
//跳转填写地址
|
|
//跳转填写地址
|
|
to_write_address() {
|
|
to_write_address() {
|
|
@@ -460,6 +469,8 @@ export default {
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
$this.get_card_list();
|
|
$this.get_card_list();
|
|
|
|
+ $this.is_cant_buy = false
|
|
|
|
+ $this.vip_err_show = false;
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
$this = this;
|
|
$this = this;
|
|
@@ -571,6 +582,16 @@ export default {
|
|
background: #5959f8;
|
|
background: #5959f8;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.btnFail{
|
|
|
|
+ width: 146px;
|
|
|
|
+ height: 44px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.err_container {
|
|
|
|
+ width: 344px;
|
|
|
|
+ height: 312px;
|
|
|
|
+}
|
|
|
|
+
|
|
/* 专注时间包颜色 */
|
|
/* 专注时间包颜色 */
|
|
.relax_text {
|
|
.relax_text {
|
|
color: #eb7d07;
|
|
color: #eb7d07;
|