Browse Source

no message

DaMowang 2 years ago
parent
commit
77541b3165

+ 18 - 0
src/pages.json

@@ -314,6 +314,24 @@
 						"navigationBarTitleText": "我的电影票"
 					}
 				},
+				{
+					"path": "directCharge/index",
+					"style": {
+						"navigationBarTitleText": "音视频会员"
+					}
+				},
+				{
+					"path": "directCharge/payment",
+					"style": {
+						"navigationBarTitleText": "音视频会员"
+					}
+				},
+				{
+					"path": "directCharge/orderDetail",
+					"style": {
+						"navigationBarTitleText": ""
+					}
+				},
 
 				{
 					"path": "order/verificationCode",

+ 5 - 5
src/pages/orderingfood/tabs.js

@@ -14,6 +14,11 @@ export default [
       url: "/pagesB/cinema/cinemaList",
       tit: "影院"
   },
+  {
+      ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/97d00306c223bd7568335b93189d9b40a386fc12png",
+      url: "/pagesB/directCharge/index",
+      tit: "音视频"
+  },
   {
       ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/cd4f1a2815a87ed4e118b8fe496468f826eeb594png",
       url: "",
@@ -29,11 +34,6 @@ export default [
       url: "",
       tit: "酒店"
   },
-  {
-      ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/97d00306c223bd7568335b93189d9b40a386fc12png",
-      url: "",
-      tit: "音视频"
-  },
   {
       ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/3ef239b805b42b155d05ddeb3e3755c1a6522633png",
       url: "",

+ 129 - 75
src/pagesB/cinema/cinemaTicket.vue

@@ -19,16 +19,21 @@
             </div>
             <div class="card qupiao">
                 <div class="tit">取电影票</div>
-                <div class="codebar">
+                <div class="codebar" v-if="ticket.orderStatus=='GENERATE_SUCCESS'">
                     <swiper class="swiper" circular>
                         <swiper-item v-for="(i,s) in ticket.ticketCode" :key="s">
-                            <block  v-for="(a,b) in i.code" :key="b" v-show="a.text=='取票码'">
-                                <Uqrcode ref="uqcode" :code="a.value" :size="150" class="code-img"/>
+                            <block v-for="(a,b) in i.code" :key="b" v-show="a.text=='取票码'">
+                                <Uqrcode ref="uqcode" :code="a.value" :size="150" :class="{'code-img':true,opacity:HaveBeenShown}" />
                                 <div class="ticketCode">取票码:<span class="dinB">{{ a.value }}</span></div>
+                                <span class="ico" v-if="HaveBeenShown">已放映</span>
                             </block>
                         </swiper-item>
                     </swiper>
                 </div>
+                <div class="await" v-else-if="ticket.orderStatus=='DEALING'">
+                    <img class="await_img" src="http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/416c89124df9a69bb1cbfb55b1007b086031a57fpng" alt="">
+                    <div class="txt">待出票</div>
+                </div>
             </div>
             <div class="card detail">
                 <div class="tit">订单详情</div>
@@ -55,10 +60,10 @@
                 <div class="head_tit">{{ order.cinemaName }}</div>
                 <div class="head_con flex_r flex_jb">
                     <div class="info flex_c flex_jb">
-                            <p class="pt">{{ order.movieName }}</p>
-                            <p class="p">{{ order.amount }}张</p>
-                            <p class="p">原价 ¥{{ order.order_amount }}</p>
-                            <p class="p">{{ order.seatInfos }}</p>
+                        <p class="pt">{{ order.movieName }}</p>
+                        <p class="p">{{ order.amount }}张</p>
+                        <p class="p">原价 ¥{{ order.order_amount }}</p>
+                        <p class="p">{{ order.seatInfos }}</p>
                     </div>
                     <image class="poster" mode="aspectFill" :src="order.posterUrl" />
                 </div>
@@ -87,7 +92,6 @@
         </template>
     </div>
 </template>
-
 <script>
 import { ToPayOpre } from "@/utils/reqTools.js";
 let toPayOpre = new ToPayOpre();
@@ -107,18 +111,20 @@ export default {
             userinfo: uni.getStorageSync("userinfo"),
 
             ispay: false,
+            HaveBeenShown: false, //是否放映
         };
     },
     methods: {
-        getTicket(da){
+        getTicket(da) {
             // da = { tradeNo: "ML20230602756506924" }
-            post("local/orderMovie",da).then(res=>{
+            post("local/orderMovie", da).then(res => {
                 if (res.code == 0) {
-                    if(res.data.detail.code == 200){
+                    if (res.data.detail.code == 200) {
                         this.ticket = res.data.detail.data
+                        this.HaveBeenShown = this.$day().unix() > this.$day(this.ticket.showTime).unix()
                     }
-                    let da =  res.data.order
-                    if(da){
+                    let da = res.data.order
+                    if (da) {
                         let arr = JSON.parse(da.product_detail)
                         let obj = {
                             trade_no: da.trade_no,
@@ -139,25 +145,25 @@ export default {
                 }
             })
         },
-        getIntegral(){
-            post("local/getIntegral",{type:2}).then(res=>{
+        getIntegral() {
+            post("local/getIntegral", { type: 2 }).then(res => {
                 if (res.code == 0) {
                     let i1 = res.data.integral;
-                    this.Integral = this.$h.Mul(i1,100);
-                    this.deduction = this.$h.Mul(this.order.order_amount,i1).toFixed(2);
+                    this.Integral = this.$h.Mul(i1, 100);
+                    this.deduction = this.$h.Mul(this.order.order_amount, i1).toFixed(2);
                 }
             })
         },
         pay() {
-            post("local/goOrderPay", {trade_no: this.order.trade_no}).then(res => {
+            post("local/goOrderPay", { trade_no: this.order.trade_no }).then(res => {
                 if (res.code == 0 && res.data.data.prepayid) {
                     toPayOpre.toPay(res.data.data, (rea) => {
-                      if (!rea) {
-                        // 支付成功
-                        this.getTicket(this.pda);
-                      } else {
-                        // 支付失败
-                      }
+                        if (!rea) {
+                            // 支付成功
+                            this.getTicket(this.pda);
+                        } else {
+                            // 支付失败
+                        }
                     });
                 }
             })
@@ -173,119 +179,165 @@ export default {
     mounted() {},
 };
 </script>
-
 <style scoped lang='scss'>
-.cinemaTicket{
+.cinemaTicket {
     padding: 28rpx 30rpx;
 }
-.head{
+
+.head {
     border-radius: 20rpx;
     background-color: #fff;
     box-shadow: 4rpx 4rpx 26rpx 2rpx rgba(17, 18, 29, 0.1);
-    .head_tit{
+
+    .head_tit {
         font-size: 28rpx;
         padding: 25rpx 28rpx;
         // background-color: rgba($color: #000, $alpha: 0.05);
     }
-    .head_con{
+
+    .head_con {
         padding: 25rpx 28rpx;
     }
-    .info,.poster{
+
+    .info,
+    .poster {
         vertical-align: text-top;
     }
-    .info{
+
+    .info {
         width: calc(100% - 150rpx);
         padding-right: 30rpx;
         min-height: 220rpx;
-        p{
+
+        p {
             font-size: 26rpx;
             color: #666;
             margin-bottom: 8rpx;
         }
-        .pt{
+
+        .pt {
             font-weight: bold;
             color: #000;
             font-size: 30rpx;
             margin-bottom: 8rpx;
         }
-        .p{
+
+        .p {
             color: #000;
         }
     }
-    .poster{
+
+    .poster {
         width: 150rpx;
         height: 220rpx;
         border-radius: 12rpx;
     }
 }
-.qupiao{
+
+.qupiao {
+    position: relative;
     .code-img {
-      display: flex;
-      flex-direction: row;
-      justify-content: center;
-      margin: 0 auto;
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+        margin: 0 auto;
+    }
+
+    .opacity {
+        opacity: 0.25;
     }
-    .opacity{
-        opacity: 0.3;
+    .ico{
+        padding: 5rpx 16rpx;
+        color: #EB5A5F;
+        border: 4rpx solid #EB5A5F;
+        border-radius: 12rpx;
+        font-size: 30rpx;
+        font-weight: bold;
+        position: absolute;
+        left: calc(50% - 65rpx);
+        top: 130rpx;
+    }
+    .await{
+        text-align: center;
+        .await_img{
+            width: 280rpx;
+            height: 280rpx;
+        }
+        .txt{
+            font-size: 28rpx;
+            color: #666;
+        }
     }
 }
-.detail{
-    .label{
+
+.detail {
+    .label {
         margin-top: 15rpx;
     }
-    .title,.nums{
+
+    .title,
+    .nums {
         display: inline-block;
         font-size: 26rpx;
     }
-    .title{
+
+    .title {
         color: #888;
         width: 160rpx;
     }
 }
-.money{
-    .li{
+
+.money {
+    .li {
         margin-bottom: 16rpx;
-        &:last-child{
+
+        &:last-child {
             margin-bottom: 0;
         }
-        span{
+
+        span {
             font-size: 30rpx;
         }
     }
-    .corg{
+
+    .corg {
         color: #EB5A5F;
         margin-left: 5rpx;
     }
 }
-.btnbar{
-  width: calc(100% - 60rpx);
-  height: 80rpx;
-  background: #EB5A5F;
-  border-radius: 45rpx;
-  position: fixed;
-  bottom: 50rpx;
-  left: 30rpx;
-  color: #fff;
-  font-size: 36rpx;
-  text-align: center;
-  line-height: 80rpx;
-  .msg{
-    position: absolute;
-    top: -80rpx;
-    left: 0;
-    font-size: 25rpx;
-    color: #666;
-    width: 100%;
+
+.btnbar {
+    width: calc(100% - 60rpx);
+    height: 80rpx;
+    background: #EB5A5F;
+    border-radius: 45rpx;
+    position: fixed;
+    bottom: 50rpx;
+    left: 30rpx;
+    color: #fff;
+    font-size: 36rpx;
     text-align: center;
-  }
+    line-height: 80rpx;
+
+    .msg {
+        position: absolute;
+        top: -80rpx;
+        left: 0;
+        font-size: 25rpx;
+        color: #666;
+        width: 100%;
+        text-align: center;
+    }
 }
+
 .card {
     background-color: #fff;
     border-radius: 16rpx;
     margin-top: 30rpx;
     padding: 28rpx 30rpx;
     font-size: 32rpx;
-    .tit{
+
+    .tit {
         height: 30rpx;
         line-height: 30rpx;
         font-size: 30rpx;
@@ -295,13 +347,15 @@ export default {
     }
 }
 
-.swiper{
+.swiper {
     height: 360rpx;
-    .ticketCode{
+
+    .ticketCode {
         font-size: 25rpx;
         margin-top: 30rpx;
         text-align: center;
-        .dinB{
+
+        .dinB {
             font-size: 28rpx;
         }
     }

+ 0 - 3
src/pagesB/cinema/confirmOrder.vue

@@ -115,9 +115,6 @@ export default {
             this.cartTotal = this.$h.Add(this.cartTotal,p.Price)
         }
         this.getIntegral()
-
-        console.log(this.OrderDa);
-        console.log(this.cinemaInfo);
     },
     onShow() {},
     mounted() {},

+ 90 - 0
src/pagesB/directCharge/index.vue

@@ -0,0 +1,90 @@
+<template>
+    <div class="directCharge">
+        <div class="list">
+            <div class="t_item" v-for="(i,s) in brand" :key="s">
+                <div class="type_name">{{ i.name }}</div>
+                <div class="it_list">
+                    <div class="brand" v-for="(a,b) in i.list" :key="b" @click="ontab(a)">
+                        <img :src="a.img" class="b_img" alt="">
+                        <div class="b_name ellipsis">{{ a.name }}</div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import { post } from "@/request/api.js";
+export default {
+    name: "directCharge",
+    props: {},
+    components: {},
+    data() {
+        return {
+            brand: [],
+        };
+    },
+    methods: {
+        load(){
+            post("local/coupon/brandList",{type:1}).then(res=>{
+                if (res.code == 0) {
+                    this.brand = res.data
+                }
+            })
+        },
+        ontab(da){
+            uni.setStorageSync("topup_brand",da)
+            this.goto("/pagesB/directCharge/payment")
+        }
+    },
+    onLoad(da) {
+        this.load();
+    },
+    onShow() {},
+    mounted() {},
+};
+</script>
+
+<style scoped lang='scss'>
+.list{
+    padding: 30rpx;
+    .t_item{
+        margin-bottom: 30rpx;
+    }
+    .type_name{
+        font-size: 38rpx;
+        font-weight: 600;
+        margin-bottom: 10rpx;
+    }
+    .it_list{
+        margin: 0 -15rpx;
+    }
+    .brand{
+        display: inline-block;
+        width: calc(50% - 30rpx);
+        margin: 12rpx 15rpx;
+        background-color: #fff;
+        padding: 15rpx 0 15rpx 20rpx;
+        box-shadow: 4rpx 4rpx 26rpx 2rpx rgba(17, 18, 29, 0.1);
+        border-radius: 10rpx;
+        .b_img,.b_name{
+            display: inline-block;
+            vertical-align: top;
+        }
+        .b_img{
+            width: 120rpx;
+            height: 120rpx;
+            // border: 1px solid #e5e5e5;
+            border-radius: 50%;
+            box-sizing: border-box;
+            background-color: #e5e5e5;
+        }
+        .b_name{
+            width: calc(100% - 120rpx);
+            font-size: 28rpx;
+            padding-left: 20rpx;
+        }
+    }
+}
+</style>

+ 34 - 0
src/pagesB/directCharge/orderDetail.vue

@@ -0,0 +1,34 @@
+<template>
+    <div class="orderDetail">
+
+    </div>
+</template>
+
+<script>
+import { ToPayOpre } from "@/utils/reqTools.js";
+let toPayOpre = new ToPayOpre();
+import { post } from "@/request/api.js";
+export default {
+    name: "orderDetail",
+    props: {},
+    components: {},
+    data() {
+        return {};
+    },
+    methods: {
+        getOrderDetail(da) {
+            post("local/coupon/orderDetail", da).then(res => {
+                if (res.code == 0) {}
+            })
+        }
+    },
+    onLoad(da) {
+        this.getOrderDetail(da)
+    },
+    onShow() {},
+    mounted() {},
+};
+</script>
+
+<style scoped lang='scss'>
+</style>

+ 272 - 0
src/pagesB/directCharge/payment.vue

@@ -0,0 +1,272 @@
+<template>
+    <div class="payment">
+        <div class="headbar card">
+            <div class="l">
+                <div class="tit">充值账号</div>
+                <input class="inp" v-model="phone" :placeholder="`请输入${topupBrand.name}账号`" />
+            </div>
+            <img class="r_logo" :src="topupBrand.img" alt="">
+            <div class="msg">* 请确保充值账号无误,充值成功后不支持退换</div>
+        </div>
+        <div class="tags flex_r flex_jse">
+            <div :class="['tab',checked==i?'checked':'']" v-for="(i,s) in tags" :key="s" @click="checked = i">{{ i }}</div>
+        </div>
+        <div class="product clearfix">
+            <div :class="{li:true,checked:i.checked}" v-for="(i,s) in products" :key="s" @click="ontag(s)" v-show="showfun(i)">
+                <div class="p1">{{ i.product_name.replace(checked,"") }}</div>
+                <div class="p">{{ $h.Div(i.official_price, 100) }}</div>
+            </div>
+        </div>
+        <template v-if="cartTotal>0">
+            <div class="money card">
+                <div class="li flex_r flex_jb">
+                    <span>消费金额</span>
+                    <span>¥{{ cartTotal || 0 }}</span>
+                </div>
+                <div class="li flex_r flex_jb">
+                    <span>消费金抵扣<span class="corg">{{Integral}}%</span></span>
+                    <span class="corg">-¥{{ deduction || 0 }}</span>
+                </div>
+                <div class="li flex_r flex_jb">
+                    <span>实付金额</span>
+                    <span>¥{{ actuallypaid || 0 }}</span>
+                </div>
+            </div>
+            <div class="money card">
+                <div class="li flex_r flex_jb">
+                    <span>赠送茶宝</span>
+                    <span>{{ chabao || 0 }}</span>
+                </div>
+            </div>
+        </template>
+        <div class="msg" v-html="selectitem.use_explain"></div>
+        <div class="footbtn" @click="pay">立即充值</div>
+    </div>
+</template>
+
+<script>
+import { ToPayOpre } from "@/utils/reqTools.js";
+let toPayOpre = new ToPayOpre();
+import { post } from "@/request/api.js";
+export default {
+    name: "payment",
+    props: {},
+    components: {},
+    data() {
+        return {
+            phone: "",
+            products: [],
+            tags: [],
+            checked: "",
+            selectitem: {},
+            egral: {},
+            cartTotal: 0,
+            Integral: 0,
+            deduction: 0,
+            actuallypaid: 0,
+            chabao: 0,
+            topupBrand: {},
+        };
+    },
+    methods: {
+        showfun(da){
+            return this.checked ? this.checked == da.next_name : true
+        },
+        getIntegral(){
+            post("local/getIntegral",{type:2}).then(res=>{
+                if (res.code == 0) {
+                    this.egral = res.data;
+                }
+            })
+        },
+        load(va){
+            post("local/coupon/productList",{type_name:va,type:1}).then(res=>{
+                if (res.code == 0) {
+                    let a = res.data.next_name, b = res.data.product_list;
+                    if(a.length) this.checked = a[0];
+                    this.tags = a;
+                    this.products = b;
+                }
+            })
+        },
+        ontag(key) {
+            let da = this.products;
+			da.forEach(value => this.$set(value, 'checked', false));
+			da[key].checked = true;
+            this.selectitem = da[key];
+            this.egralfun()
+        },
+        egralfun(){
+            let i1 = this.egral.integral, i2 = this.egral.chabao;
+            this.Integral = this.$h.Mul(i1,100);
+            this.cartTotal = this.$h.Div(this.selectitem.official_price, 100)
+            this.deduction = this.$h.Mul(this.cartTotal,i1).toFixed(2);
+            this.actuallypaid = this.$h.Sub(this.cartTotal,this.deduction);
+            this.chabao = this.$h.Mul(this.actuallypaid,i2).toFixed(2);
+        },
+        pay() {
+            var reg =/^0?1[3|4|5|6|7|8][0-9]\d{8}$/;
+            if(!reg.test(this.phone)){
+                uni.showToast({title: `请输入正确的${this.topupBrand.name}账号`, icon: "none"})
+                return;
+            }
+            let da = {
+                count: 1,
+                phone: this.phone,
+                product_no: this.selectitem.product_no,
+            }
+            post("local/coupon/addOrder", da).then(res => {
+                if (res.code == 0 && res.data.prepayid) {
+                    toPayOpre.toPay(res.data, (rea) => {
+                        if (!rea) {
+                            // 支付成功
+                        this.goto("/pagesB/orderingfood/orderlist")
+                        } else {
+                            // 支付失败
+                        }
+                    });
+                }
+            })
+        },
+    },
+    onLoad(da) {
+        this.getIntegral()
+        let va = uni.getStorageSync("topup_brand");
+        uni.setNavigationBarTitle({ title: va.name });
+        this.load(va.name);
+        this.topupBrand = va;
+    },
+    onShow() {},
+    mounted() {},
+};
+</script>
+
+<style scoped lang='scss'>
+.payment{
+    padding: 30rpx 30rpx 160rpx;
+}
+.headbar{
+    .l,.r_logo{
+        display: inline-block;
+        vertical-align: top;
+    }
+    .l{
+        width: calc(100% - 150rpx);
+        .tit{
+            font-size: 30rpx;
+            font-weight: 600;
+            margin-bottom: 20rpx;
+        }
+        .inp{
+            font-size: 33rpx;
+            // font-weight: bold;
+            padding: 8rpx 0;
+        }
+    }
+    .r_logo{
+        width: 150rpx;
+        height: 150rpx;
+        border-radius: 10rpx;
+        // border: 1px  solid #e5e5e5;
+        box-sizing: border-box;
+    }
+    .msg{
+        border-top: 1px solid #e5e5e5;
+        margin-top: 12rpx;
+        padding: 10rpx 0 2rpx;
+        font-size: 24rpx;
+        color: #999;
+    }
+}
+.tags{
+    padding: 15rpx 0;
+   .tab{
+        // width: 180rpx;
+        min-width: 100rpx;
+        text-align: center;
+        font-size: 30rpx;
+        font-weight: 600;
+        color: #999;
+        padding: 6rpx 0;
+        &.checked{
+            color: #333;
+            position: relative;
+            border-bottom: 6rpx solid #18bb88;
+        }
+   } 
+}
+.product{
+    margin: 0 -15rpx 30rpx;
+    .li{
+        width: calc(50% - 30rpx);
+        background-color: #fff;
+        margin: 12rpx 15rpx;
+        padding: 20rpx 30rpx;
+        text-align: center;
+        float: left;
+        border-radius: 22rpx;
+        border: 4rpx solid #fff;
+        &.checked{
+            border: 4rpx solid #18bb88;
+        }
+    }
+    .p1{
+        font-size: 28rpx;
+        margin-bottom: 12rpx;
+    }
+    .p{
+        font-size: 32rpx;
+        font-weight: bold;
+        color: #18bb88;
+        &::before{
+            content: "¥";
+            font-size: 25rpx;
+        }
+    }
+}
+.card {
+    background-color: #fff;
+    border-radius: 26rpx;
+    margin-bottom: 30rpx;
+    padding: 28rpx 30rpx;
+    font-size: 32rpx;
+    box-shadow: 4rpx 4rpx 26rpx 2rpx rgba(17, 18, 29, 0.1);
+
+    &:last-child {
+        margin-bottom: 0;
+    }
+}
+.money{
+    .li{
+        margin-bottom: 16rpx;
+        &:last-child{
+            margin-bottom: 0;
+        }
+        span{
+            font-size: 30rpx;
+        }
+    }
+    .corg{
+        color: #18bb88;
+        margin-left: 5rpx;
+    }
+}
+.msg{
+    font-size: 26rpx;
+    margin-top: 50rpx;
+}
+
+.footbtn{
+  width: calc(100% - 60rpx);
+  height: 80rpx;
+  background: #17bb87;
+  border-radius: 45rpx;
+  position: fixed;
+  bottom: 50rpx;
+  left: 30rpx;
+  color: #fff;
+  font-size: 36rpx;
+  text-align: center;
+  line-height: 80rpx;
+}
+</style>

+ 17 - 3
src/pagesB/orderingfood/orderlist.vue

@@ -25,6 +25,12 @@
                     <image class="poster" mode="aspectFill" :src="a.product_img" />
                 </div>
             </div>
+            <div class="p2 flex_r flex_jb" v-else-if="i.type==2">
+                <div class="goods good2 ellipsis">
+                    <div class="p" v-for="(a,b) in i.orderGoods" :key="b">{{ a.product_name }}</div>
+                </div>
+                <div class="g_amount"><span class="amount dinB">{{ i.pay_amount }}</span></div>
+            </div>
             <div class="p3">下单时间:{{ i.create_time }}</div>
         </div>
     </div>
@@ -64,11 +70,14 @@ export default {
         },
         entrance(i) {
             if (i.type == 1) this.goto('/pagesB/cinema/cinemaTicket', { tradeNo: i.trade_no })
-            else this.goto('/pagesB/orderingfood/detail', { trade_no: i.trade_no, brand_id: i.brand_id })
+            else if (i.type == 0) this.goto('/pagesB/orderingfood/detail', { trade_no: i.trade_no, brand_id: i.brand_id })
+            // else if (i.type == 2) this.goto('/pagesB/directCharge/orderDetail', { trade_no: i.trade_no })
         },
         seatInfos(va){
-            let arr = JSON.parse(va)
-            return arr.map(item => item.seatName).join(",")
+            if(va){
+                let arr = JSON.parse(va)
+                return arr.map(item => item.seatName).join(",")
+            }
         }
     },
     onLoad(da) {
@@ -176,6 +185,11 @@ export default {
             border-radius: 12rpx;
         }
     }
+    .good2{
+        p{
+            font-size: 28rpx;
+        }
+    }
 
     .g_amount {
         display: flex;