|
@@ -204,113 +204,6 @@
|
|
</view>
|
|
</view>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <!-- 确认订单 弹窗-->
|
|
|
|
- <van-popup
|
|
|
|
- :show="order_confirm"
|
|
|
|
- @close="close_order_confirm"
|
|
|
|
- round
|
|
|
|
- closeable
|
|
|
|
- >
|
|
|
|
- <div class="order_confirm padding">
|
|
|
|
- <view>
|
|
|
|
- <text class="text-sm text-gray">已选商品 水母星球-{{ selection_card.goods_name }}</text>
|
|
|
|
- <br>
|
|
|
|
- </view>
|
|
|
|
- <view>
|
|
|
|
- <text class="text-sm text-gray">商品价格 {{ selection_card.price }}元</text>
|
|
|
|
- <br>
|
|
|
|
-
|
|
|
|
- </view>
|
|
|
|
- <view>
|
|
|
|
- <text class="text-sm text-gray">支付方式 微信支付</text>
|
|
|
|
- <br>
|
|
|
|
-
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <view v-if="selection_card.goods_id < 4">
|
|
|
|
- <text class="text-lg text-red" style="font-weight: bold;">折扣 {{ selection_card.discount * 10 }}折</text>
|
|
|
|
- <br>
|
|
|
|
- </view>
|
|
|
|
- <view class="order_price_container">
|
|
|
|
- <text class="text-sm text-gray">实付(元) </text>
|
|
|
|
- <text class="mine_min">{{ selection_card.total_price }}</text>
|
|
|
|
- </view>
|
|
|
|
- <button
|
|
|
|
- class="cu-btn bg-primary lg text-white recharge_button"
|
|
|
|
- @click="success_pay"
|
|
|
|
- :disabled="btn_disabled"
|
|
|
|
- >立即充值</button>
|
|
|
|
- </div>
|
|
|
|
- </van-popup>
|
|
|
|
-
|
|
|
|
- <!-- 充值失败-->
|
|
|
|
- <van-popup
|
|
|
|
- :show="err_show"
|
|
|
|
- @close="close_err_pop"
|
|
|
|
- round
|
|
|
|
- :close-on-click-overlay="false"
|
|
|
|
- >
|
|
|
|
- <div class="err_container flex flex-direction align-center justify-around">
|
|
|
|
- <view>
|
|
|
|
- <text class="title">
|
|
|
|
- 充值失败,请再次尝试
|
|
|
|
- </text>
|
|
|
|
- </view>
|
|
|
|
- <img
|
|
|
|
- src="https://img.shuimuai.com/web/sign_notimeJfish.png"
|
|
|
|
- class="err_img"
|
|
|
|
- alt=""
|
|
|
|
- >
|
|
|
|
- <div class="button_group flex justify-around">
|
|
|
|
- <button
|
|
|
|
- class="cu-btn bg-gray text-white lg"
|
|
|
|
- @click="close_err_pop"
|
|
|
|
- >取消支付</button>
|
|
|
|
- <button
|
|
|
|
- class="cu-btn bg-primary text-white lg"
|
|
|
|
- @click="repay"
|
|
|
|
- :disabled="btn_disabled"
|
|
|
|
- >再次支付</button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </van-popup>
|
|
|
|
-
|
|
|
|
- <!-- 充值成功-->
|
|
|
|
- <van-popup
|
|
|
|
- :show="success_show"
|
|
|
|
- @close="close_success_pop"
|
|
|
|
- round
|
|
|
|
- :close-on-click-overlay="false"
|
|
|
|
- >
|
|
|
|
- <div class="err_container flex flex-direction align-center justify-around ext_container">
|
|
|
|
- <img
|
|
|
|
- src="https://img.shuimuai.com/web/boyya.png"
|
|
|
|
- class="boy_logo"
|
|
|
|
- alt=""
|
|
|
|
- >
|
|
|
|
- <view>
|
|
|
|
- <text class="title">
|
|
|
|
- 充值成功
|
|
|
|
- </text>
|
|
|
|
- </view>
|
|
|
|
- <view
|
|
|
|
- class="sub-title"
|
|
|
|
- v-if="selection_card.goods_id < 4"
|
|
|
|
- >
|
|
|
|
- <text class="text-gray">
|
|
|
|
- {{ selection_card.goods_name }},请到实体店店员处领取邀请卡
|
|
|
|
- </text>
|
|
|
|
- </view>
|
|
|
|
- <div class="button_group flex justify-around">
|
|
|
|
- <!-- <button class="cu-btn bg-gray text-white lg" @click="close_success_pop">以后再填</button>-->
|
|
|
|
- <!-- <button class="cu-btn bg-primary text-white lg" @click="to_write_address">填写地址</button>-->
|
|
|
|
- <button
|
|
|
|
- class="cu-btn bg-primary text-white lg"
|
|
|
|
- @click="to_index"
|
|
|
|
- >充值成功</button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </van-popup>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -325,10 +218,7 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
order: {},
|
|
order: {},
|
|
- order_confirm: false,
|
|
|
|
card_action_show: 0,
|
|
card_action_show: 0,
|
|
- err_show: false,
|
|
|
|
- success_show: false,
|
|
|
|
//时间卡列表
|
|
//时间卡列表
|
|
time_cards: [],
|
|
time_cards: [],
|
|
//次卡列表
|
|
//次卡列表
|
|
@@ -337,26 +227,16 @@ export default {
|
|
userinfo: {},
|
|
userinfo: {},
|
|
// 选中的充值卡
|
|
// 选中的充值卡
|
|
selection_card: {},
|
|
selection_card: {},
|
|
- //支付信息
|
|
|
|
- payment_info: {},
|
|
|
|
- //订单编号
|
|
|
|
- order_sn: "",
|
|
|
|
- btn_disabled: false,
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
methods: {
|
|
methods: {
|
|
- //弹出确认订单
|
|
|
|
- // to_confirm($item) {
|
|
|
|
- // $this.order_confirm = true;
|
|
|
|
- // $item["total_price"] = ($item.price * $item.discount).toFixed(2);
|
|
|
|
- // $this.selection_card = $item;
|
|
|
|
- // },
|
|
|
|
|
|
+ //确认订单
|
|
to_confirm($item) {
|
|
to_confirm($item) {
|
|
console.log("data",$item)
|
|
console.log("data",$item)
|
|
//实付
|
|
//实付
|
|
if($item.coupon.type==3){
|
|
if($item.coupon.type==3){
|
|
- $item["total_price"] = $item.price*$item.coupon.discount
|
|
|
|
|
|
+ $item["total_price"] = Math.round($item.price*$item.coupon.discount*100)/100
|
|
}else if($item.coupon.type==2){
|
|
}else if($item.coupon.type==2){
|
|
$item["total_price"] = $item.price-$item.coupon.reduce
|
|
$item["total_price"] = $item.price-$item.coupon.reduce
|
|
}else if($item.coupon.type==4){
|
|
}else if($item.coupon.type==4){
|
|
@@ -366,7 +246,7 @@ export default {
|
|
}
|
|
}
|
|
//减多少
|
|
//减多少
|
|
if($item.coupon.type==3){
|
|
if($item.coupon.type==3){
|
|
- $item["reduce"] = $item.price-$item.price*$item.coupon.discount
|
|
|
|
|
|
+ $item["reduce"] = Math.round(($item.price-$item.price*$item.coupon.discount)*100)/100
|
|
}else if($item.coupon.type==2){
|
|
}else if($item.coupon.type==2){
|
|
$item["reduce"] = $item.coupon.reduce
|
|
$item["reduce"] = $item.coupon.reduce
|
|
}else if($item.coupon.type==4){
|
|
}else if($item.coupon.type==4){
|
|
@@ -389,127 +269,6 @@ export default {
|
|
url: "/pages/user_center/confirmPay/main?data=" + data,
|
|
url: "/pages/user_center/confirmPay/main?data=" + data,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //关闭确认订单
|
|
|
|
- close_order_confirm() {
|
|
|
|
- $this.order_confirm = false;
|
|
|
|
- },
|
|
|
|
- //关闭充值失败窗口
|
|
|
|
- close_err_pop() {
|
|
|
|
- $this.err_show = false;
|
|
|
|
- },
|
|
|
|
- //取消充值
|
|
|
|
- cancel_recharge() {
|
|
|
|
- $this.close_err_pop();
|
|
|
|
-
|
|
|
|
- deleteOrder($this.order_sn).then(
|
|
|
|
- (res) => {
|
|
|
|
- let $res = res.data;
|
|
|
|
- },
|
|
|
|
- (err) => {
|
|
|
|
- console.log("删除订单错误", err);
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- // 打开充值成功窗口
|
|
|
|
- open_success_window() {
|
|
|
|
- $this.success_show = true;
|
|
|
|
- },
|
|
|
|
- //关闭充值成功窗口
|
|
|
|
- close_success_pop() {
|
|
|
|
- $this.success_show = false;
|
|
|
|
- },
|
|
|
|
- //再次付款
|
|
|
|
- repay() {
|
|
|
|
- $this.btn_disabled = true;
|
|
|
|
- let $payment = $this.payment_info;
|
|
|
|
- wx.requestPayment({
|
|
|
|
- timeStamp: $payment.timeStamp,
|
|
|
|
- nonceStr: $payment.nonceStr,
|
|
|
|
- package: $payment.package,
|
|
|
|
- signType: $payment.signType,
|
|
|
|
- paySign: $payment.sign,
|
|
|
|
- success(res) {
|
|
|
|
- //支付成功
|
|
|
|
- console.log("success支付成功调用:", res);
|
|
|
|
- //关闭确认订单窗口
|
|
|
|
- $this.close_order_confirm();
|
|
|
|
- $this.close_success_pop();
|
|
|
|
- //打开成功充值窗口
|
|
|
|
- $this.open_success_window();
|
|
|
|
- },
|
|
|
|
- fail(res) {
|
|
|
|
- console.log("success支付失败调用:", res);
|
|
|
|
-
|
|
|
|
- $this.cancel_recharge();
|
|
|
|
- $this.close_order_confirm();
|
|
|
|
- $this.err_show = true;
|
|
|
|
- },
|
|
|
|
- complete() {
|
|
|
|
- $this.btn_disabled = false;
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- to_index() {
|
|
|
|
- mpvue.reLaunch({
|
|
|
|
- url: "/pages/index/main",
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 成功支付
|
|
|
|
- success_pay() {
|
|
|
|
- $this.btn_disabled = true;
|
|
|
|
-
|
|
|
|
- // 支付成功后得回调方法
|
|
|
|
- let $params = {
|
|
|
|
- goods_id: $this.selection_card.goods_id,
|
|
|
|
- buy_num: 1,
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- wx.login({
|
|
|
|
- success(res1) {
|
|
|
|
- console.log("微信登陆", res1.code);
|
|
|
|
- let $code = res1.code;
|
|
|
|
- $params["js_code"] = $code;
|
|
|
|
- createOrder($params).then(
|
|
|
|
- (res) => {
|
|
|
|
- let $data = res.data;
|
|
|
|
- let $payment = $data.data;
|
|
|
|
- $this.order_sn = $payment["sn"];
|
|
|
|
- $this.payment_info = $payment;
|
|
|
|
- wx.requestPayment({
|
|
|
|
- timeStamp: $payment.timeStamp,
|
|
|
|
- nonceStr: $payment.nonceStr,
|
|
|
|
- package: $payment.package,
|
|
|
|
- signType: $payment.signType,
|
|
|
|
- paySign: $payment.sign,
|
|
|
|
- success(res) {
|
|
|
|
- //支付成功
|
|
|
|
- console.log("success", res);
|
|
|
|
- //关闭确认订单窗口
|
|
|
|
- $this.close_order_confirm();
|
|
|
|
- $this.close_success_pop();
|
|
|
|
- //打开成功充值窗口
|
|
|
|
- $this.open_success_window();
|
|
|
|
- },
|
|
|
|
- fail(res) {
|
|
|
|
- console.log("fail", res);
|
|
|
|
- $this.cancel_recharge();
|
|
|
|
- $this.close_order_confirm();
|
|
|
|
- $this.err_show = true;
|
|
|
|
- },
|
|
|
|
- complete() {
|
|
|
|
- $this.btn_disabled = false;
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- (err) => {
|
|
|
|
- console.log(err);
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // 接收回调方法后弹出支付成功
|
|
|
|
- },
|
|
|
|
//跳转填写地址
|
|
//跳转填写地址
|
|
to_write_address() {
|
|
to_write_address() {
|
|
mpvue.navigateTo({
|
|
mpvue.navigateTo({
|
|
@@ -553,6 +312,9 @@ export default {
|
|
$this.get_card_list();
|
|
$this.get_card_list();
|
|
$this.userinfo = wx.getStorageSync("userinfo");
|
|
$this.userinfo = wx.getStorageSync("userinfo");
|
|
},
|
|
},
|
|
|
|
+ onShow(){
|
|
|
|
+ $this.get_card_list();
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
$this = this;
|
|
$this = this;
|
|
},
|
|
},
|
|
@@ -565,9 +327,6 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
-.uc_recharge_container {
|
|
|
|
- /* padding: 0px 10px; */
|
|
|
|
-}
|
|
|
|
.mine {
|
|
.mine {
|
|
width: 330px;
|
|
width: 330px;
|
|
height: 84px;
|
|
height: 84px;
|