DaMowang 2 years ago
parent
commit
199eda6018

+ 28 - 107
src/app.scss

@@ -1,14 +1,12 @@
 /**app.wxss**/
 page {
     min-height: 100%;
-    background: #f5f5f5;
+    background: #F5F6F8;
 }
 
-view,
-text,
-div {
-    word-break: break-all;
+view,text,div {
     color: #333;
+    word-break: break-all;
     font-family: "SourceHanSansSC-Regular";
     box-sizing: border-box;
 }
@@ -70,112 +68,35 @@ div {
 }
 
 // flex布局
-.flex_grow {
-    flex: 1;
-}
-
-.flex_wrap {
-    flex-wrap: wrap;
-}
-
-.flex_ac {
-    align-items: center;
-}
-
-.flex_ae {
-    align-items: flex-end;
-}
-
-.flex_as {
-    align-items: flex-start;
-}
-
-.flex_jc {
-    justify-content: center;
-}
-
-.flex_je {
-    justify-content: flex-end;
-}
-
-.flex_js {
-    justify-content: flex-start;
-}
-
-.flex_jb {
-    justify-content: space-between;
-}
-
-.flex_jse {
-    justify-content: space-evenly;
-}
-
-.flex_r {
-    display: flex;
-    flex-direction: row;
-}
-
-.flex_c {
-    display: flex;
-    flex-direction: column;
-}
-
+.flex_grow {flex: 1;}
+.flex_wrap {flex-wrap: wrap;}
+.flex_ac {align-items: center;}
+.flex_ae {align-items: flex-end;}
+.flex_as {align-items: flex-start;}
+.flex_jc {justify-content: center;}
+.flex_je {justify-content: flex-end;}
+.flex_js {justify-content: flex-start;}
+.flex_jb {justify-content: space-between;}
+.flex_jse {justify-content: space-evenly;}
+.flex_r {display: flex;flex-direction: row;}
+.flex_c {display: flex;flex-direction: column;}
 // flex布局-end
 
 
 // 边距
-.padd20 {
-    padding: 20rpx 0;
-}
-
-.mar_t10 {
-    margin-top: 10rpx;
-}
-
-.mar_t20 {
-    margin-top: 20rpx;
-}
-
-.mar_t30 {
-    margin-top: 30rpx;
-}
-
-.mar_t36 {
-    margin-top: 36rpx;
-}
-
-.mar_t50 {
-    margin-top: 50rpx;
-}
-
-.mar_t16 {
-    margin-top: 16rpx;
-}
-
-.mar_t-10 {
-    margin-top: -10rpx;
-}
-
-.padd_t30 {
-    padding-top: 30rpx;
-}
-
-.mar_b10 {
-    margin-bottom: 10rpx;
-}
-
-.mar_b20 {
-    margin-bottom: 20rpx;
-}
-
-.mar_b30 {
-    margin-bottom: 30rpx;
-}
-
-.padd_b0 {
-    padding-bottom: 0 !important;
-}
-
+.padd20 {padding: 20rpx 0;}
+.mar_t10 {margin-top: 10rpx;}
+.mar_t20 {margin-top: 20rpx;}
+.mar_t30 {margin-top: 30rpx;}
+.mar_t36 {margin-top: 36rpx;}
+.mar_t50 {margin-top: 50rpx;}
+.mar_t16 {margin-top: 16rpx;}
+.mar_t-10 {margin-top: -10rpx;}
+.padd_t30 {padding-top: 30rpx;}
+.mar_b10 {margin-bottom: 10rpx;}
+.mar_b20 {margin-bottom: 20rpx;}
+.mar_b30 {margin-bottom: 30rpx;}
+.padd_b0 {padding-bottom: 0 !important;}
 // 边距-end
 
 

+ 1 - 0
src/components/activation/activation.vue

@@ -50,6 +50,7 @@ export default {
         },
         close() {
             this.$refs.popup.close()
+            this.$emit('close');
         }
     },
     onLoad(da) {},

+ 8 - 13
src/main.js

@@ -7,7 +7,8 @@ Vue.config.productionTip = false
 // Vue.use(uView);
 
 // 此文件配置进入app即运行的方法
-require('@/utils/run_now.js');
+import "@/utils/run_now.js";
+// require('@/utils/run_now.js');
 
 import "@/static/font/DIN/din.css";
 
@@ -32,6 +33,12 @@ Vue.prototype.$h = highPrecision;
 import hosts from "@/request/config";
 Vue.prototype.$hosts = hosts;
 
+// 缓存封装
+import { setCache, getCache } from "@/utils/storage.js"
+Vue.prototype.setCache = setCache;
+Vue.prototype.getCache = getCache;
+
+
 // 上传
 import { up } from "@/utils/up";
 Vue.prototype.$up = up;
@@ -49,18 +56,6 @@ const app = new Vue({
 })
 app.$mount()
 
-Array.prototype.indexOf = function (val) {
-    for (var i = 0; i < this.length; i++) {
-        if (this[i] == val) return i;
-    }
-    return -1;
-};
-Array.prototype.remove = function (val) {
-    var index = this.indexOf(val);
-    if (index > -1) {
-        this.splice(index, 1);
-    }
-};
 Vue.directive('focus', {
     inserted: (el, binding) => {
         if (binding.value == true || binding.value == undefined) {

+ 12 - 0
src/pages.json

@@ -296,6 +296,18 @@
 						"navigationBarTitleText": "选座"
 					}
 				},
+				{
+					"path": "cinema/confirmOrder",
+					"style": {
+						"navigationBarTitleText": "确认订单"
+					}
+				},
+				{
+					"path": "cinema/cinemaTicket",
+					"style": {
+						"navigationBarTitleText": "我的电影票"
+					}
+				},
 
 				{
 					"path": "order/verificationCode",

+ 15 - 213
src/pages/autonym-pay/index.vue

@@ -1,219 +1,21 @@
 <template>
-	<view class="container">
-		<!-- 实名费用 -->
-		<view class="auto_cost flex_r flex_ac flex_jb mar_t20">
-			<view class="auto_name">实名费用</view>
-			<view class="price"><text>¥</text>{{price}}</view>
-		</view>
-		<!-- 实名费用-end -->
-
-		<!-- 微信支付 -->
-		<view class="option flex_c mar_t20">
-			<view class="list_name">充值方式</view>
-			<view class="option_con flex_r flex_ac flex_jb mar_t16" @tap="setPayWay">
-				<view class="way_con flex_r flex_ac">
-					<image class="way_img" src="/static/img/weixin_icon.png" mode=""></image>
-					<view class="way_text">微信支付</view>
-				</view>
-				<view class="way_radio" :class="isSelect ? 'select' : ''"></view>
-			</view>
-		</view>
-		<!-- 微信支付-end -->
-
-		<!-- 按钮 -->
-		<view class="btn flex_r flex_ac flex_jc" @tap="autoOrderPay">下一步</view>
-		<!-- 按钮-end -->
-	</view>
+    <div class=""></div>
 </template>
 
 <script>
-	let page = 1;
-	let app = getApp();
-	var appEv = app.$vm.$options;
-	import {
-		ToPayOpre
-	} from "@/utils/reqTools.js";
-	let toPayOpre = new ToPayOpre();
-	import {
-		post
-	} from "@/request/api.js";
-	export default {
-		data() {
-			return {
-				price: '',
-				isSelect: false,
-				payDetail:undefined,
-				
-			};
-		},
-		onLoad: function(e) {
-			// this.loadData()
-			console.log(e.payDetail,"aaaaaaaaaaaa")
-			this.payDetail = JSON.parse(decodeURIComponent(e.payDetail));
-			// console.log(this.payDetail,"支付信息" )
-			this.price = e.amount
-		},
-		methods: {
-			autoOrderPay() {
-				if (!this.isSelect) {
-					appEv.errTips('请选择支付方式')
-					return false
-				}
-				// // #ifdef  H5
-				// let type = "H5";
-				// // #endif
-				// // #ifdef  APP
-				// let type = "app";
-				// // #endif
-				// // #ifdef  MP-WEIXIN
-				// let type = "jsapi";
-				// // #endif
-				// let data = {
-				// 	trade_type: type
-				// };
-				toPayOpre.toPay(this.payDetail, (rea) => {
-					if (!rea) {
-						// 支付成功
-						appEv.errTips('实名认证中,请稍等')
-						uni.switchTab({
-						  url: "/pages/my/index",
-						});
-				
-					} else {
-						// 支付失败
-						appEv.errTips('支付已取消')
-					}
-				});
-				// let that = this;
-				// let data = {
-				// 	price:this.price * 100
-				// }
-				// return
-				// const info = reqApi.identifyPayment(data)
-				// if(info){
-				// 	info.then(res => {
-				// 		if(res.data.status == 200){
-				// 			toPayOpre.toPay(res.data.payParam, (rea) => {
-				// 				if (!rea) {
-				// 					// 支付成功
-				// 					uni.redirectTo({
-				// 						url: '/pages/autonym-submit/index'
-				// 					})
-				// 				} else {
-				// 					// 支付失败
-				// 					appEv.errTips('支付已取消')
-				// 				}
-				// 			});
-				// 		}
-				// 	})
-				// }
-			},
-			setPayWay: function() {
-				this.isSelect = !this.isSelect
-			}
-		}
-	}
+export default {
+    name: "",
+    props: {},
+    components: {},
+    data() {
+        return {};
+    },
+    methods: {},
+    onLoad(da) {},
+    onShow() {},
+    mounted() {},
+};
 </script>
 
-<style lang="scss">
-	// 页面配置
-	page {
-		background: #F4F4F4;
-	}
-
-	// 页面配置-end
-
-	// 实名费用
-	.price {
-		font-size: 36rpx;
-		color: #E75B25;
-		font-family: "SourceHanSansCN-Medium";
-	}
-
-	.auto_name {
-		font-size: 28rpx;
-		color: #121212;
-		font-family: "SourceHanSansCN-Medium";
-	}
-
-	.price text {
-		font-size: 24rpx;
-		color: #E75B25;
-		font-family: "SourceHanSansCN-Medium";
-	}
-
-	.auto_cost {
-		width: 100%;
-		height: 104rpx;
-		background: #fff;
-		padding: 0 30rpx;
-		box-sizing: border-box;
-	}
-
-	// 实名费用-end
-
-	// 微信支付
-	.option_con {
-		width: 100%;
-		overflow: hidden;
-	}
-
-	.way_img {
-		width: 52rpx;
-		height: 52rpx;
-		margin-right: 8rpx;
-	}
-
-	.way_text {
-		font-size: 22rpx;
-		color: #333333;
-		font-family: "SourceHanSansCN-Medium";
-	}
-
-	.list_name {
-		color: #333333;
-		font-size: 28rpx;
-		font-family: "SourceHanSansCN-Medium";
-		font-weight: 500;
-	}
-
-	.option {
-		width: 100%;
-		overflow: hidden;
-		padding: 20rpx 30rpx 60rpx;
-		box-sizing: border-box;
-		background: #fff;
-	}
-
-	.way_radio {
-		width: 39rpx;
-		height: 35rpx;
-		background: url("~@/static/img/weixuanzhong.png");
-		background-repeat: no-repeat;
-		background-size: 35rpx 35rpx;
-		background-position: center center;
-	}
-
-	.select {
-		background: url("~@/static/img/consent.png");
-		background-repeat: no-repeat;
-		background-size: 39rpx 35rpx;
-		background-position: center center;
-	}
-
-	// 微信支付-end
-
-	// 按钮
-	.btn {
-		width: 689rpx;
-		height: 92rpx;
-		background: #17BB87;
-		border-radius: 10rpx;
-		font-family: "SourceHanSansCN-Medium";
-		font-size: 42rpx;
-		color: #fff;
-		margin: 167rpx auto;
-	}
-
-	// 按钮-end
-</style>
+<style scoped lang='scss'>
+</style>

+ 2 - 2
src/pages/my/index.vue

@@ -164,10 +164,10 @@
             <image class="fun_img" src="/static/my/upgrade.png" mode=""></image>
             <view class="fun_text">激活升级</view>
           </navigator>
-          <navigator class="fun_list flex_c flex_ac" @click="getToCash('local')" hover-class="none">
+          <!-- <navigator class="fun_list flex_c flex_ac" @click="getToCash('local')" hover-class="none">
             <image class="fun_img" src="/static/my/deposit.png" mode=""></image>
             <view class="fun_text">提现</view>
-          </navigator>
+          </navigator> -->
         </view>
       </view>
       <view class="fun mar_t30">

+ 8 - 62
src/pages/orderingfood/merchantlist.vue

@@ -32,12 +32,11 @@
                 </div>
             </div>
         </div>
-        <activation ref="activation" tit="激活" />
+        <activation ref="activation" tit="激活" :close="isActivation"/>
     </div>
 </template>
 <script>
 import activation from "@/components/activation/activation.vue"
-import QQMapWX from '@/static/utils/qqmap-wx-jssdk.min.js'
 import tabs from './tabs'
 import { post } from "@/request/api.js";
 export default {
@@ -74,64 +73,11 @@ export default {
             })
         },
         // 获取当前位置
-        getLocation() {
-            const that = this;
-            // 获取位置信息
-            uni.getLocation({
-                type: 'wgs84',
-                success(res) {
-                    // 经纬度转化地址信息
-                    // const qqmap = require('@/pages/qqmap-wx-jssdk.min.js');
-                    console.log('位置信息:', res);
-                    const showmap = new QQMapWX({
-                        key: 'NWSBZ-ZUME4-LLTU6-XSQGB-YBKAT-U4FCZ'
-                    });
-                    // 逆地址解析reverseGeocoder
-                    showmap.reverseGeocoder({
-                        location: {
-                            latitude: res.latitude,
-                            longitude: res.longitude
-                        },
-                        success(result) {
-                            const adres = result.result.location;
-                            uni.setStorageSync("adres", adres)
-                            that.Query = { ...that.Query, ...adres };
-                            that.getlists();
-                            console.log('逆地址解析:', result);
-                        }
-                    });
-                },
-                fail(e) {
-                    let errMsgTit = '';
-                    if (e.errMsg === 'getLocation:fail auth deny') {
-                        errMsgTit = '你已拒绝授权,是否跳转至设置页面开启权限';
-                    } else {
-                        errMsgTit = '操作频繁提示,建议搭配onLocationChange()使用';
-                    }
-                    uni.showModal({
-                        title: '提示',
-                        content: `${errMsgTit}`,
-                        success(res) {
-                            if (res.confirm) {
-                                // 获取设置页面权限信息
-                                uni.getSetting({
-                                    success(res) {
-                                        console.log(res.authSetting);
-                                        // 判断是否开启获取位置权限
-                                        if (!res.authSetting['scope.userLocation']) {
-                                            // 如果没有开启,点击确认后打开设置页面
-                                            uni.openSetting({});
-                                        }
-                                    }
-                                });
-                                console.log('用户点击确定');
-                            } else if (res.cancel) {
-                                console.log('用户点击取消');
-                            }
-                        }
-                    });
-                }
-            });
+        async getLocation() {
+            let adres = await uni.Location();
+            console.log("adres",adres);
+            this.Query = { ...this.Query, ...adres };
+            this.getlists();
         },
         // 去店铺
         goMerchant(da) {
@@ -144,7 +90,6 @@ export default {
         // 是否激活本地生活
         isActivation() {
             post("local/isActivation", this.Query).then(res => {
-                console.log('是否激活本地生活', res);
                 if (res.code == -1) {
                     this.activation();
                 } else {
@@ -172,11 +117,12 @@ export default {
                     return ""
             }
         },
-        
+        // 打开激活弹窗
         activation(){
             this.$refs.activation.open()
         }
     },
+    onLoad(da){},
     onShow() {
         this.isActivation();
     },

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

@@ -11,7 +11,7 @@ export default [
   },
   {
       ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/e3d3719e646469f2615abce1ef61753ea7de0b19png",
-    //   url: "/pagesB/cinema/cinemaList",
+      url: "/pagesB/cinema/cinemaList",
       tit: "影院"
   },
   {

+ 1 - 6
src/pages/szw-order-details/index.vue

@@ -257,12 +257,7 @@ export default {
         },
 
         // 跳转物流详情
-        goLogistics() {
-            // uni.navigateTo({
-            //     url: "/pages/logistics/index?id=" +
-            //         this.orderInfo.orderDetail.orderDetaillId,
-            // });
-        },
+        goLogistics() {},
 
         removeItem(){
             let that = this;

+ 4 - 3
src/pages/szw-order-list/index.vue

@@ -129,14 +129,15 @@ export default {
 
     // 立即支付
     toPay(e) {
-      // #ifdef  H5
       let type = "H5";
+      // #ifdef  H5
+      type = "H5";
       // #endif
       // #ifdef  APP
-      let type = "app";
+      type = "app";
       // #endif
       // #ifdef  MP-WEIXIN
-      let type = "jsapi";
+      type = "jsapi";
       // #endif
       post("v1/goods/payOrder", {
         id: e.order_id,

+ 59 - 47
src/pagesB/cinema/choiceMovie.vue

@@ -1,12 +1,12 @@
 <template>
     <view>
-        <view class="movie-position">
-            <view class="position-text">{{cinemaInfo.restaurant_name}}</view>
+        <view class="movie-position flex_r flex_jb">
             <view class="position-item">
+                <view class="position-text">{{cinemaInfo.restaurant_name}}</view>
                 <view class="item-texts">{{cinemaInfo.restaurant_address}}</view>
-                <view class="item-img-list">
-                    <span @click="openm" class="iconfont">&#xe634;</span>
-                </view>
+            </view>
+            <view class="item-img-list">
+                <span @click="openm" class="iconfont collion">&#xe634;</span>
             </view>
         </view>
         <!-- 轮播盒子 start -->
@@ -18,8 +18,10 @@
             <div class="box"></div>
         </view>
         <!-- 轮播盒子 end -->
-        <view class="moive-name">{{chooseMovice.movieName}}</view>
-        <view class="moive-info">{{chooseMovice.duration}}分钟{{chooseMovice.movieType}}{{chooseMovice.cast}}</view>
+        <template v-if="chooseMovice.movieName">
+            <view class="moive-name">{{chooseMovice.movieName}}</view>
+            <view class="moive-info">{{chooseMovice.duration}}分钟{{chooseMovice.movieType}}{{chooseMovice.cast}}</view>
+        </template>
         <view class="moive-tab-list">
             <view class="tabs-list-item" :class="{'tab-sel':index==tabIndexs}" v-for="(value,index) in tabLists" :key="index" @click="getTimeTab(value,index)">
                 {{value.time}}
@@ -30,12 +32,12 @@
             <view style="width: 79%;">
                 <view class="ticet-left">
                     <view style="display: flex;align-items: center;">
-                        <text class="left-time">{{value.stopSellTime}}</text>
+                        <text class="left-time">{{tim(value.showTime)}}</text>
                         <text class="left-type">{{value.showVersionType}}</text>
                     </view>
                     <view style="display: flex;align-items: center;">
-                        <view class="ret-price"><text>¥</text>{{value.userPrice}}</view>
-                        <view class="ret-yuans">¥{{value.showPrice}}</view>
+                        <view class="ret-price">{{value.showPrice}}</view>
+                        <!-- <view class="ret-yuans">¥{{value.showPrice}}</view> -->
                     </view>
                 </view>
                 <view class="ticet-left" style="margin-top: 20rpx;">
@@ -43,10 +45,10 @@
                         <text>时长:{{value.duration}}分钟</text>
                         <text style="margin-left: 25rpx;">{{value.hallName}}</text>
                     </view>
-                    <view class="ticet-boom-ret">
+                    <!-- <view class="ticet-boom-ret">
                         <view class="sheng-text">省</view>
                         <view class="sheng-pirce">¥{{province(value.showPrice,value.userPrice)}}</view>
-                    </view>
+                    </view> -->
                 </view>
             </view>
             <view class="buy-btns" @click="getGou(value)">购票</view>
@@ -69,7 +71,8 @@ export default {
             cinemaInfo: {}, //影院信息
             tabLists: {},
             timeList: [], //排期数据
-            isLoad: false
+            isLoad: false,
+            allPreferential: {}, //当前影院所有场次
         }
     },
     onLoad(da) {
@@ -108,7 +111,6 @@ export default {
 						}
 						obj[i] = ar2
 					}
-					console.log(obj);
                     let movies = uni.getStorageSync("movies")
 					let MS = []
 					for (let m of movies) {
@@ -117,6 +119,8 @@ export default {
 					this.movieList = MS
         			this.chooseMovice = this.movieList[0]
 					this.tabLists = obj[this.chooseMovice.movieId];
+                    this.timeList = this.tabLists[0].list
+                    this.allPreferential = obj
                 }
             })
         },
@@ -135,8 +139,11 @@ export default {
 
         // 切换轮播改变背景
         setBackground(index) {
-            this.swiperCurrent = index
-            this.chooseMovice = this.movieList[index]
+            this.swiperCurrent = index;
+            this.chooseMovice = this.movieList[index];
+            this.tabLists = this.allPreferential[this.chooseMovice.movieId];
+            this.timeList = this.tabLists[0].list;
+            this.tabIndexs = 0;
         },
         getTimeTab(data,index){
         	if(this.tabIndexs!=index){
@@ -145,22 +152,27 @@ export default {
         	}
         },
         getGou(data) {
-            let _this = this
-            uni.navigateTo({
-                url: '/pages/movie/Seat?item=' + encodeURIComponent(JSON.stringify(data)) + '&cinemaId=' + this.cinemaInfo.cinemaId,
-                success(res) {
-                    res.eventChannel.emit('moviceDataFrom', { data: _this.chooseMovice })
-                }
-            })
+            uni.setStorageSync("SeatInfo",data);
+            uni.setStorageSync("chooseMovice",this.chooseMovice);
+            this.goto("/pagesB/cinema/selectSeat",{showId:data.showId})
         },
         province(original, price) {
             let val = original - price
             return Math.floor(val * 100) / 100
         },
+
+        tim(str){
+            return this.$day(str).format("HH:mm")
+        }
     }
 }
 </script>
 <style lang="scss">
+page {
+    min-height: 100vh;
+    background-color: #fff;
+}
+
 // 轮播图中间
 .swiper_main {
     position: relative;
@@ -215,37 +227,30 @@ export default {
 .movie-position {
     padding: 30rpx 32rpx;
 
+    .position-item{
+        width: calc(100% - 80rpx);
+    }
+
     .position-text {
         color: #2D3039;
         font-size: 32rpx;
-        font-weight: 550;
-    }
-
-    .position-item {
-        display: flex;
-        margin-top: 10rpx;
+        font-weight: bold;
     }
 
     .item-texts {
         color: #636775;
         font-size: 24rpx;
-        width: 72%;
     }
 
     .item-img-list {
-        margin-left: auto;
+        width: 80rpx;
         display: flex;
+        flex-direction: column;
+        justify-content: center;
+        text-align: right;
 
-        // align-items: center;
         .collion {
-            width: 48rpx;
-            height: 48rpx;
-            margin-right: 50rpx;
-        }
-
-        .locaion-img {
-            width: 44rpx;
-            height: 44rpx;
+            font-size: 50rpx;
         }
     }
 }
@@ -283,7 +288,7 @@ export default {
     }
 
     .tab-sel {
-        color: #FE602B !important;
+        color: #E8627B !important;
         font-size: 28rpx;
         font-weight: 550;
     }
@@ -296,7 +301,7 @@ export default {
         transform: translate(-50%, -50%);
         width: 52rpx;
         height: 8rpx;
-        background-color: #FE602B;
+        background-color: #E8627B;
         // border-radius: 5rpx 5rpx 0px 0px;
     }
 }
@@ -326,12 +331,19 @@ export default {
     }
 
     .ret-price {
-        color: #FE602B;
-        font-size: 42rpx;
-        font-weight: 550;
+        color: #E8627B;
+        font-size: 38rpx;
+        font-weight: bold;
+        &::before{
+            content: "¥";
+            font-size: 28rpx;
+        }
 
         text {
-            font-size: 28rpx;
+            color: #666;
+            font-size: 24rpx;
+            font-weight: 400;
+            margin-left: 12rpx;
         }
     }
 
@@ -375,7 +387,7 @@ export default {
     height: 58rpx;
     text-align: center;
     line-height: 58rpx;
-    background: linear-gradient(207deg, #FF9272 0%, #FC5421 100%);
+    background: linear-gradient(207deg, #EA525F 0%, #E8627B 100%);
     border-radius: 30rpx;
     color: #FFFFFF;
     font-size: 24rpx;

+ 10 - 4
src/pagesB/cinema/cinemaList.vue

@@ -36,7 +36,7 @@ export default {
     methods: {
         // 获取附近影院
         getlists() {
-            post("local/getCinema", this.Query).then(res => {
+            post("local/getCinemaList", this.Query).then(res => {
                 if (res.code == 0) {
                     this.loading = false
                     let cinemaList = res.data.data
@@ -47,6 +47,14 @@ export default {
                 }
             })
         },
+        // 获取当前位置
+        async getLocation() {
+            let adres = await uni.Location();
+            this.Query = { ...this.Query, ...adres };
+            this.getlists();
+        },
+
+        // 进入影院
         goCinema(da) {
             uni.setStorageSync("cinemaItem", da)
             this.goto("/pagesB/cinema/choiceMovie", {
@@ -64,9 +72,7 @@ export default {
         },
     },
     onLoad(da) {
-        let adres = uni.getStorageSync("adres")
-        this.Query = { ...this.Query, ...adres }
-        this.getlists();
+        this.getLocation();
         this.getFilm();
     },
     onShow() {},

+ 288 - 0
src/pagesB/cinema/cinemaTicket.vue

@@ -0,0 +1,288 @@
+<template>
+    <div class="cinemaTicket">
+        <template v-if="order.status != 0">
+            <div class="head">
+                <div class="head_tit">{{ ticket.cinemaName }}</div>
+                <div class="head_con flex_r flex_jb">
+                    <div class="info flex_c flex_jb">
+                        <div class="cb">
+                            <p class="pt">{{ ticket.movieName }}</p>
+                            <p>{{ticket.showVersionType}} {{ ticket.amount }}张</p>
+                        </div>
+                        <div class="cb">
+                            <p>{{ ticket.showTime }} 时长{{ ticket.duration }}分钟</p>
+                            <p class="p">{{ ticket.hallName }} {{ ticket.seatInfos }}</p>
+                        </div>
+                    </div>
+                    <image class="poster" mode="aspectFill" :src="ticket.posterUrl" />
+                </div>
+            </div>
+            <div class="card qupiao">
+                <div class="tit">取电影票</div>
+                <div class="codebar">
+                    <Uqrcode ref="uqcode" :size="150" class="code-img" />
+                </div>
+            </div>
+            <div class="card detail">
+                <div class="tit">订单详情</div>
+                <view class="label">
+                    <view class="title">实付金额:</view>
+                    <view class="nums">¥{{ order.pay_amount }}</view>
+                </view>
+                <view class="label">
+                    <view class="title">订单编号:</view>
+                    <view class="nums">{{ ticket.tradeNo }}</view>
+                </view>
+                <view class="label">
+                    <view class="title">购买时间:</view>
+                    <view class="nums">{{ ticket.orderTime }}</view>
+                </view>
+                <view class="label">
+                    <view class="title">手机号码:</view>
+                    <view class="nums">{{ ticket.phoneNumber }}</view>
+                </view>
+            </div>
+        </template>
+        <template v-else>
+            <div class="head">
+                <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>
+                    </div>
+                    <image class="poster" mode="aspectFill" :src="order.posterUrl" />
+                </div>
+            </div>
+            <div class="phone card flex_r flex_jb">
+                <span>联系方式</span>
+                <span>{{ userinfo.mobile }}</span>
+            </div>
+            <div class="money card">
+                <div class="li flex_r flex_jb">
+                    <span>消费金额</span>
+                    <span>¥{{ order.order_amount || 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>¥{{ order.pay_amount || 0 }}</span>
+                </div>
+            </div>
+            <div class="btnbar" v-if="ispay" @click="pay">立即支付
+                <div class="msg">请在 {{ $day(order.create_time).add(15, 'm').format("YYYY-MM-DD HH:mm") }} 前完成支付</div>
+            </div>
+        </template>
+    </div>
+</template>
+
+<script>
+import { ToPayOpre } from "@/utils/reqTools.js";
+let toPayOpre = new ToPayOpre();
+import Uqrcode from '@/components/uqrcode/uqrcode'
+import { post } from "@/request/api.js";
+export default {
+    name: "cinemaTicket",
+    props: {},
+    components: { Uqrcode },
+    data() {
+        return {
+            pda: {},
+            ticket: {},
+            order: {},
+            Integral: 0,
+            deduction: 0,
+            userinfo: uni.getStorageSync("userinfo"),
+
+            ispay: false,
+        };
+    },
+    methods: {
+        getTicket(da){
+            post("local/orderMovie",da).then(res=>{
+                if (res.code == 0) {
+                    if(res.data.detail.code == 200){
+                        this.ticket = res.data.detail.data
+                    }
+                    let da =  res.data.order
+                    let arr = JSON.parse(da.product_detail)
+                    let obj = {
+                        trade_no: da.trade_no,
+                        cinemaName: da.restaurant_name,
+                        movieName: da.orderGoods[0].product_name,
+                        amount: da.orderGoods[0].number,
+                        posterUrl: da.orderGoods[0].product_img,
+                        seatInfos: arr.map(item => item.seatName).join(","),
+                        pay_amount: da.pay_amount,
+                        order_amount: da.order_amount,
+                        create_time: da.create_time,
+                        status: da.status
+                    }
+                    this.order = obj;
+                    this.getIntegral();
+
+                    this.ispay = this.$day().unix() < this.$day(this.order.create_time).add(15, 'm').unix()
+                }
+            })
+        },
+        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);
+                }
+            })
+        },
+        pay() {
+            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 {
+                        // 支付失败
+                      }
+                    });
+                }
+            })
+        },
+    },
+    onLoad(da) {
+        this.pda = da;
+        this.getTicket(da)
+    },
+    onShow() {
+        // this.$refs.uqcode.createCode("kjsdgkhg");
+    },
+    mounted() {},
+};
+</script>
+
+<style scoped lang='scss'>
+.cinemaTicket{
+    padding: 28rpx 30rpx;
+}
+.head{
+    border-radius: 20rpx;
+    background-color: #fff;
+    box-shadow: 4rpx 4rpx 26rpx 2rpx rgba(17, 18, 29, 0.1);
+    .head_tit{
+        font-size: 28rpx;
+        padding: 25rpx 28rpx;
+        // background-color: rgba($color: #000, $alpha: 0.05);
+    }
+    .head_con{
+        padding: 25rpx 28rpx;
+    }
+    .info,.poster{
+        vertical-align: text-top;
+    }
+    .info{
+        width: calc(100% - 150rpx);
+        padding-right: 30rpx;
+        min-height: 220rpx;
+        p{
+            font-size: 26rpx;
+            color: #666;
+            margin-bottom: 8rpx;
+        }
+        .pt{
+            font-weight: bold;
+            color: #000;
+            font-size: 30rpx;
+            margin-bottom: 8rpx;
+        }
+        .p{
+            color: #000;
+        }
+    }
+    .poster{
+        width: 150rpx;
+        height: 220rpx;
+        border-radius: 12rpx;
+    }
+}
+.qupiao{
+    .code-img {
+      display: flex;
+      flex-direction: row;
+      justify-content: center;
+      margin: 0 auto;
+    }
+    .opacity{
+        opacity: 0.3;
+    }
+}
+.detail{
+    .label{
+        margin-top: 15rpx;
+    }
+    .title,.nums{
+        display: inline-block;
+        font-size: 26rpx;
+    }
+    .title{
+        color: #888;
+        width: 160rpx;
+    }
+}
+.money{
+    .li{
+        margin-bottom: 16rpx;
+        &:last-child{
+            margin-bottom: 0;
+        }
+        span{
+            font-size: 30rpx;
+        }
+    }
+    .corg{
+        color: #E8627B;
+        margin-left: 5rpx;
+    }
+}
+.btnbar{
+  width: calc(100% - 60rpx);
+  height: 80rpx;
+  background: #E8627B;
+  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{
+        height: 30rpx;
+        line-height: 30rpx;
+        font-size: 30rpx;
+        margin-bottom: 30rpx;
+        padding-left: 12rpx;
+        border-left: 6rpx solid #E8627B;
+    }
+}
+</style>

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

@@ -0,0 +1,206 @@
+<template>
+    <div class="confirmOrder">
+        <div class="MoviceInfo card">
+            <img :src="OrderDa.m.posterUrl" alt="" class="l_img">
+            <div class="r_info">
+                <div class="p_tit">{{ OrderDa.m.movieName }}</div>
+                <div class="p1 p_num">共{{OrderDa.oldArray.length}}张,原价¥{{cartTotal}}</div>
+                <div class="p1">{{ OrderDa.s.showTime }}</div>
+                <div class="p1">
+                    <span>{{ OrderDa.s.hallName }}</span>
+                    <span v-for="(i,s) in OrderDa.oldArray" :key="s">{{ i.seatNo }}</span>
+                </div>
+                <div class="p1">{{ cinemaInfo.restaurant_name }}</div>
+                <div class="p1">{{ cinemaInfo.restaurant_address }}</div>
+            </div>
+        </div>
+        <div class="phone card flex_r flex_jb">
+            <span>联系方式</span>
+            <span>{{ userinfo.mobile }}</span>
+        </div>
+        <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="msg card">
+            <div class="m_tit">购票须知</div>
+            <p>1.请确认场次和时间无误,购买成功后将不予退换</p>
+            <p>2.由于设备故障等不可抗力因素,存在少量场次取消的情况,会进行退票退款</p>
+            <p>3.由于影院系统不稳定等因素,存在出票失败的情况,会进行退款</p>
+            <p>4.取票码可以在“我的-本地生活-历史订单”中查看</p>
+        </div>
+
+        <div class="btnbar" @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: "confirmOrder",
+    props: {},
+    components: {},
+    data() {
+        return {
+            OrderDa: uni.getStorageSync("confirmOrder"),
+            cinemaInfo: uni.getStorageSync("cinemaItem"),
+            userinfo: uni.getStorageSync("userinfo"),
+            cartTotal: 0,
+            Integral: 0,
+            deduction: 0,
+            actuallypaid: 0,
+        };
+    },
+    methods: {
+        getIntegral(){
+            post("local/getIntegral",{type:2}).then(res=>{
+                if (res.code == 0) {
+                    let i1 = res.data.integral, i2 = res.data.chabao;
+                    this.Integral = this.$h.Mul(i1,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(){
+            let ar = []
+            for (let it of this.OrderDa.oldArray) {
+                ar.push({
+                    seatId: it.SeatCode,
+                    seatName: it.seatNo
+                })
+            }
+            let da = {
+                cinemaId: this.cinemaInfo.restaurant_id,
+                showId: this.OrderDa.s.showId,
+                phone: this.userinfo.mobile,
+                showInfor: JSON.stringify(ar)
+            }
+            post("local/cinemaOrder", 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) {
+        for (let p of this.OrderDa.oldArray) {
+            this.cartTotal = this.$h.Add(this.cartTotal,p.Price)
+        }
+        this.getIntegral()
+
+        console.log(this.OrderDa);
+        console.log(this.cinemaInfo);
+    },
+    onShow() {},
+    mounted() {},
+};
+</script>
+
+<style scoped lang='scss'>
+.confirmOrder{
+    padding: 30rpx;
+}
+.card {
+    background-color: #fff;
+    border-radius: 26rpx;
+    margin-bottom: 30rpx;
+    padding: 28rpx 30rpx;
+    font-size: 32rpx;
+
+    &:last-child {
+        margin-bottom: 0;
+    }
+}
+.MoviceInfo{
+    .l_img,.r_info{
+        display: inline-block;
+        vertical-align: top;
+    }
+    .l_img{
+        width: 188rpx;
+        height: 280rpx;
+        border-radius: 8rpx;
+    }
+    .r_info{
+        width: calc(100% - 188rpx);
+        padding-left: 28rpx;
+    }
+    .p_tit{
+        font-size: 36rpx;
+        font-weight: bold;
+        margin-bottom: 16rpx;
+    }
+    .p1{
+        margin-top: 6rpx;
+        font-size: 25rpx;
+        color: #666;
+        span{
+            margin-right: 16rpx;
+        }
+    }
+    .p_num{
+        font-size: 24rpx;
+        color: #999;
+    }
+}
+.money{
+    .li{
+        margin-bottom: 16rpx;
+        &:last-child{
+            margin-bottom: 0;
+        }
+        span{
+            font-size: 30rpx;
+        }
+    }
+    .corg{
+        color: #E8627B;
+        margin-left: 5rpx;
+    }
+}
+.msg{
+    .m_tit{
+        font-size: 30rpx;
+        margin-bottom: 12rpx;
+    }
+    p{
+        font-size: 24rpx;
+        color: #999;
+        margin-bottom: 6rpx;
+    }
+}
+.btnbar{
+  width: calc(100% - 60rpx);
+  height: 80rpx;
+  background: #E8627B;
+  border-radius: 45rpx;
+  position: fixed;
+  bottom: 50rpx;
+  left: 30rpx;
+  color: #fff;
+  font-size: 36rpx;
+  text-align: center;
+  line-height: 80rpx;
+}
+</style>

+ 119 - 37
src/pagesB/cinema/selectSeat.vue

@@ -3,12 +3,8 @@
         <view class="bg-f1 h-100vh">
             <view class="pt-f left-0 w-100 p-0-32 bg-white z1000" :style="'height: 132rpx;top:0'">
                 <view>
-                    <view class="fz-34 fw-b pt-20">
-                        三体2:黑暗森林
-                    </view>
-                    <view class="mt-10 fz-28 color-666">
-                        2021年1月22日 国语3D
-                    </view>
+                    <view class="fz-34 fw-b pt-20">{{ MoviceInfo.movieName }}</view>
+                    <view class="mt-10 fz-28 color-666">{{ SeatInfo.showTime }} {{ SeatInfo.showVersionType }}</view>
                 </view>
             </view>
             <movable-area :style="'height:'+(seatRow*40+350)+'rpx;width: 100vw;top:'+(rpxNum*132)+'px'" class="pt-f left-0">
@@ -31,18 +27,22 @@
             </movable-area>
             <view class="pt-f bottom-bar left-0 dp-f fd-cr z1000">
                 <view class="bg-white p-all-32">
-                    <view class="dp-f ai-c jc-c fz-28 color-333 mb-20" v-if="SelectNum===0">
+                    <view class="seatNo_box flex_r flex_ac" v-if="optArr.length">
+                        <view class="ti">已选</view>
+                        <view class="seatNos">
+                            <view class="seatNo" v-for="(optItem,optindex) in optArr" :key="optindex" @click="delSelectItem(optItem)">
+                                <view>{{ optItem.seatNo }}</view>
+                                <view class="Price">{{ optItem.Price }}</view>
+                                <view class="ico iconfont">&#xe609;</view>
+                            </view>
+                        </view>
+                    </view>
+                    <view class="dp-f ai-c jc-c fz-28 color-333 mb-20" v-else>
                         推荐选座
                         <view style="width: 106rpx;height: 60rpx;" class="b-1 br-5 dp-f ai-c jc-c fz-28 ml-20" v-for="(n,numindex) in 4" :key="n" @click="smartChoose(numindex+1)">
                             {{numindex+1}}人
                         </view>
                     </view>
-                    <view class="dp-f ai-c fw-w fz-28 color-333 mb-20" v-if="SelectNum>0">
-                        <text>已选</text>
-                        <view class="p-all-10 b-1 br-5 dp-f ai-c jc-c fz-28 ml-20" v-for="(optItem,optindex) in optArr" :key="optindex">
-                            {{optItem.RowNum+'排'+optItem.ColumnNum+'座'}}
-                        </view>
-                    </view>
                     <view style="width: 686rpx;height: 90rpx;" class="dp-f jc-c ai-c br-10 fz-34 color-fff" :class="SelectNum>0?'bg-red-1':'bg-unbtn'" @click="buySeat">
                         {{SelectNum>0?('¥ '+aPrice+' 确认座位'):'请选座位'}}
                     </view>
@@ -84,12 +84,15 @@ export default {
             mArr: [], //排数提示
             optArr: [], //选中的座位数组。
             isWXAPP: false,
+
+            aPrice: 0, //合计价格
+
+            restrictions: 0, //每次下单最多可选座位个数
+            MoviceInfo: uni.getStorageSync("chooseMovice"), //所选影片信息
+            SeatInfo: uni.getStorageSync("SeatInfo"), //所选场次信息
         };
     },
     computed: {
-        aPrice() {
-            return this.SelectNum * 36
-        },
         rpxNum() {
             return this.boxWidth / 750
         },
@@ -97,7 +100,7 @@ export default {
             return 750 / this.boxWidth
         },
     },
-    onLoad() {
+    onLoad(da) {
         let that = this
         //获取宽度
         uni.getSystemInfo({
@@ -108,25 +111,34 @@ export default {
                 //#endif
             }
         })
-        that.initData()
+        that.initData(da)
     },
     methods: {
-        async initData() {
+        async initData(da) {
             let arr = []
-            let res =  await post("local/getSeat",{showId:"bb27ce9b64c86d460007"})
-            if(res.code == 0){
+            let res = await post("local/getSeat", da)
+            if (res.code == 0) {
+                this.restrictions = res.data.data.restrictions
                 let da = res.data.data.seats
                 for (let it of da) {
+                    let pa = {}
+                    for (let p of this.SeatInfo.areaPrice) {
+                        pa[p.area] = p.showPrice
+                    }
+
+                    // let xy = it.seatNo.replace(/[^0-9]/ig, ",").split(",");
+                    let xy = it.seatNo.split("座")[0].split("排")
                     arr.push({
                         YCoord: it.rowNo,
                         XCoord: it.columnNo,
                         SeatCode: it.seatId,
                         Status: it.status == "N" ? 0 : it.status == "LK" ? 2 : -1,
-                        RowNum: it.seatNo.slice(0,1),
-                        ColumnNum: it.seatNo.slice(2,3)
+                        RowNum: xy[0], ColumnNum: xy[1],
+                        seatNo: it.seatNo,
+                        Price: pa[it.areaId] || this.SeatInfo.showPrice
                     })
                 }
-            }
+            } else return
 
             //假数据说明:SeatCode座位编号,RowNum-行号,ColumnNum-纵号,YCoord-Y坐标,XCoord-X坐标,Status-状态
             let row = 0
@@ -166,18 +178,15 @@ export default {
             let seat = this.seatList.slice()
             let arr = this.seatArray.slice()
             for (let num in seat) {
-                let status = 2 //-1为非座位,0为未购座位,1为已选座位(绿色),2为已购座位(红色)
-                if (seat[num].Status === 0) {
-                    status = 0
-                } else if (seat[num].Status === -1) {
-                    status = -1
-                }
+                let status = seat[num].Status //-1为非座位,0为未购座位,1为已选座位(绿色),2为已购座位(红色)
                 if (seat[num].YCoord) {
                     arr[parseInt(seat[num].YCoord) - this.minRow][parseInt(seat[num].XCoord) - this.minCol] = {
                         type: status,
                         SeatCode: seat[num].SeatCode,
+                        seatNo: seat[num].seatNo,
                         RowNum: seat[num].RowNum,
-                        ColumnNum: seat[num].ColumnNum
+                        ColumnNum: seat[num].ColumnNum,
+                        Price: seat[num].Price
                     }
                 }
             }
@@ -185,7 +194,7 @@ export default {
             let mArr = []
             for (let i in arr) {
                 let m = ''
-                if(arr[i][0]){
+                if (arr[i][0]) {
                     for (let n of arr[i]) {
                         if (n.SeatCode) {
                             m = n.RowNum
@@ -245,7 +254,8 @@ export default {
                     }
                 }
             }
-            console.log(oldArray);
+            uni.setStorageSync("confirmOrder",{ oldArray, m: this.MoviceInfo, s: this.SeatInfo })
+            this.goto("/pagesB/cinema/confirmOrder")
         },
         //处理座位选择逻辑
         handleChooseSeat: function(row, col) {
@@ -259,6 +269,10 @@ export default {
                 this.SelectNum--
                 this.getOptArr(newArray[row][col], 0)
             } else if (seatValue === 0) {
+                if(this.SelectNum == this.restrictions){
+                    uni.showToast({ title: `单次购票限制${this.restrictions}张`, icon: "none" });
+                    return
+                }
                 newArray[row][col].type = 1
                 this.SelectNum++
                 this.getOptArr(newArray[row][col], 1)
@@ -282,6 +296,20 @@ export default {
             }
             this.optArr = optArr.slice()
         },
+        delSelectItem(va){
+            let arr = [];
+            for (let a of this.optArr) {
+                if (va.SeatCode == a.SeatCode) {
+                    this.optArr.remove(a)
+                }else arr.push(a.seatNo)
+            }
+            this.SelectNum--;
+            for (let i of this.seatArray) {
+                for (const it of i) {
+                    if (va.SeatCode == it.SeatCode) it.type = 0
+                }
+            }
+        },
         //推荐选座,参数是推荐座位数目,
         smartChoose: function(num) {
             // 先重置
@@ -303,7 +331,7 @@ export default {
                 return
             }
             //提示用户无合法位置可选
-            alert('无合法位置可选!')
+            // alert('无合法位置可选!')
 
         },
 
@@ -416,10 +444,63 @@ export default {
             }
             this.seatArray = oldArray;
         },
-    }
+    },
+    watch: {
+        optArr: {
+            immediate: true,
+            deep: true,
+            handler(da) {
+                this.aPrice = 0;
+                for (let p of da) {
+                    this.aPrice = this.$h.Add(this.aPrice,p.Price)
+                }
+            }
+        }
+    },
 }
 </script>
 <style lang="scss" scoped>
+.seatNo_box{
+    padding: 26rpx 0;
+    .ti{
+        // width: 100rpx;
+        font-size: 26rpx;
+        margin-right: 16rpx;
+    }
+    .seatNos{
+        // width: calc(100% - 100rpx);
+        margin-bottom: -8rpx;
+    }
+    .seatNo{
+        display: inline-block;
+        font-size: 24rpx;
+        text-align: center;
+        background-color: rgba($color: #000, $alpha: 0.05);
+        border-radius: 8rpx;
+        padding: 4rpx 50rpx 4rpx 18rpx;
+        margin-right: 10rpx;
+        margin-bottom: 8rpx;
+        position: relative;
+        &:last-child{
+            margin-right: 0;
+        }
+        .Price{
+            font-size: 24rpx;
+            color: #E8627B;
+            &::before{
+                content: "¥";
+                font-size: 20rpx;
+            }
+        }
+    }
+    .ico{
+        position: absolute;
+        right: 8rpx;
+        top: 26rpx;
+        color: #999;
+    }
+}
+
 .p-all-10 {
     padding: 10rpx;
 }
@@ -433,11 +514,11 @@ export default {
 }
 
 .bg-unbtn {
-    background-color: #f9abb3;
+    background-color: #EA525F;
 }
 
 .bg-red-1 {
-    background-color: #F45664;
+    background-color: #E8627B;
 }
 
 .br-10 {
@@ -479,6 +560,7 @@ export default {
 
 .dp-ib {
     display: inline-block;
+    margin: 0 2rpx;
 }
 
 .mt-20 {

+ 0 - 2
src/pagesB/order/verificationCode.vue

@@ -19,8 +19,6 @@
 
 <script>
 import { post } from "@/request/api.js";
-var app = getApp();
-var appEv = app.$vm.$options;
 import uqcode from "@/components/uqrcode/uqrcode.vue";
 export default {
   name: "verificationCode",

+ 7 - 6
src/pagesB/orderingfood/detail.vue

@@ -13,10 +13,10 @@
                     <view class="statusBox">
                         <view class="status">
                             <icon type="daifukuan" size="30" :color="template.color.color5"></icon>
-                            <view style="font-size: 24rpx;" :style="'color:'+template.color.color5">请在 {{ $day(orderDetail.create_time).add(7, 'm').format("YYYY-MM-DD HH:mm") }} 前完成支付</view>
+                            <view style="font-size: 24rpx;" :style="'color:'+template.color.color5">请在 {{ $day(orderDetail.create_time).add(15, 'm').format("YYYY-MM-DD HH:mm") }} 前完成支付</view>
                         </view>
                     </view>
-                    <view class="button" v-if="$day().unix() < $day(orderDetail.create_time).add(7, 'm').unix()" :style="'background-color:'+template.color.color1" @click="paypalPrderTap(orderDetail.trade_no)">立即支付</view>
+                    <view class="button" v-if="$day().unix() < $day(orderDetail.create_time).add(15, 'm').unix()" :style="'background-color:'+template.color.color1" @click="paypalPrderTap(orderDetail.trade_no)">立即支付</view>
                 </view>
                 <view class="header" v-if="orderDetail.status==1">
                     <view class="title" :style="'color:'+template.color.color2">{{orderDetail.order_status=='OUT_MEAL'?"待自提":"待出餐"}}</view>
@@ -170,10 +170,12 @@ export default {
             Integral: 0,
             deduction: 0,
             actuallypaid: 0,
+            pda: {}
         }
     },
     onShow() {},
     onLoad(e) {
+        this.pda = e;
         this.getOrderDetail(e);
     },
     methods: {
@@ -208,7 +210,7 @@ export default {
             })
         },
         getIntegral(){
-            post("local/getIntegral").then(res=>{
+            post("local/getIntegral",{type:1}).then(res=>{
                 if (res.code == 0) {
                     let va = res.data.integral
                     this.Integral = this.$h.Mul(va,100);
@@ -229,10 +231,9 @@ export default {
                     toPayOpre.toPay(res.data.data, (rea) => {
                       if (!rea) {
                         // 支付成功
-                        uni.showToast({ title: "支付成功", icon: "none" });
+                        this.getOrderDetail(this.pda);
                       } else {
                         // 支付失败
-                        uni.showToast({ title: "支付已取消", icon: "none" });
                       }
                     });
                 }
@@ -370,7 +371,7 @@ page {
             padding-top: 30rpx;
 
             .store {
-                width: 70%;
+                width: 100%;
                 display: flex;
                 flex-direction: column;
                 align-content: center;

+ 1 - 3
src/pagesB/orderingfood/orderingfood.vue

@@ -417,7 +417,7 @@ export default {
                         arr.push(i);
                         obj[it.name] = i.name
                         spec_price = this.$h.Add(spec_price,i.price)
-                        if(i.mandatory) sku_id.push(i.id)
+                        if(it.mandatory) sku_id.push(i.id)
                         else accessories_id.push(i.id)
                     }
                 }
@@ -483,8 +483,6 @@ export default {
         // 添加购物袋
         addCartGoods(da, num, spec = []) {
             let json = {
-                // brand_id: this.MerchantInfo.brand_id,
-                // restaurant_id: this.MerchantInfo.restaurant_id,
                 ...this.mda,
                 product_id: da.product_id,
                 product_img: da.product_img,

+ 78 - 62
src/pagesB/orderingfood/orderlist.vue

@@ -1,128 +1,144 @@
 <template>
-  <div class="orderlist">
-    <div class="o_item" v-for="(i,s) in orderList" :key="s" @click="goto('/pagesB/orderingfood/detail',{trade_no:i.trade_no,brand_id:i.brand_id})">
-        <div class="p1 flex_r flex_jb">
-            <span class="name_tit ellipsis">{{ i.restaurant_name }}</span>
-            <span class="status">{{ typeto(i.status) }}</span>
-        </div>
-        <div class="p2 flex_r flex_jb">
-            <div class="goods ellipsis">
-                <div class="imgs" v-for="(a,b) in i.orderGoods" :key="b">
-                    <img :src="a.product_img" alt="" class="g_img">
-                    <div class="na ellipsis">{{ a.product_name }}</div>
+    <div class="orderlist">
+        <div class="o_item" v-for="(i,s) in orderList" :key="s" @click="entrance(i)">
+            <div class="p1 flex_r flex_jb">
+                <span class="name_tit ellipsis">{{ i.restaurant_name }}</span>
+                <span class="status">{{ typeto(i.status) }}</span>
+            </div>
+            <div class="p2 flex_r flex_jb">
+                <div class="goods ellipsis">
+                    <div class="imgs" v-for="(a,b) in i.orderGoods" :key="b">
+                        <img :src="a.product_img" alt="" class="g_img">
+                        <div class="na ellipsis">{{ a.product_name }}</div>
+                    </div>
                 </div>
+                <div class="g_amount"><span class="amount dinB">{{ i.order_amount }}</span></div>
             </div>
-            <div class="g_amount"><span class="amount dinB">{{ i.order_amount }}</span></div>
+            <div class="p3">下单时间:{{ i.create_time }}</div>
         </div>
-        <div class="p3">下单时间:{{ i.create_time }}</div>
     </div>
-  </div>
 </template>
-
 <script>
 import { post } from "@/request/api.js";
 export default {
-  name: "orderlist",
-  props: {},
-  components: {},
-  data() {
-    return {
-        orderList: [],
-    };
-  },
-  methods: {
-    getorderList() {
-        post("local/orderList").then(res => {
-            if (res.code == 0) {
-                this.orderList = res.data
-            }
-        })
+    name: "orderlist",
+    props: {},
+    components: {},
+    data() {
+        return {
+            orderList: [],
+        };
     },
-    typeto(va) {
-        switch (va) {
-            case 0: return "待支付";
-            case 1: return "已下单";
-            case 2: return "已出餐";
-            case 3: return "下单失败";
-            case 4: return "出餐失败";
-            default: return ""
+    methods: {
+        getorderList() {
+            post("local/orderList").then(res => {
+                if (res.code == 0) {
+                    this.orderList = res.data
+                }
+            })
+        },
+        typeto(va) {
+            switch (va) {
+                case 0: return "待支付";
+                case 1: return "已下单";
+                case 2: return "已完成";
+                case 3: return "下单失败";
+                case 4: return "失败";
+                default: return ""
+            }
+        },
+        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 })
         }
-    }
-  },
-  onLoad(da) {
-    this.getorderList()
-  },
-  onShow() {},
-  mounted() {},
+    },
+    onLoad(da) {
+        this.getorderList()
+    },
+    onShow() {},
+    mounted() {},
 };
 </script>
-
 <style scoped lang='scss'>
-.orderlist{
+.orderlist {
     padding: 28rpx 32rpx;
 }
-.o_item{
+
+.o_item {
     background-color: #fff;
     padding: 25rpx 30rpx;
     border-radius: 16rpx;
     margin-bottom: 20rpx;
-    &:last-child{
+
+    &:last-child {
         margin-bottom: 0;
     }
-    .p1{
-        .name_tit{
+
+    .p1 {
+        .name_tit {
             font-size: 36rpx;
             margin-bottom: 16rpx;
             width: calc(100% - 110rpx);
         }
-        .status{
+
+        .status {
             font-size: 26rpx;
             color: #666;
             width: 110rpx;
             text-align: right;
         }
     }
-    .p2{
+
+    .p2 {
         background-color: rgba($color: #000, $alpha: 0.06);
         border-radius: 10rpx;
         padding: 20rpx;
         margin-bottom: 16rpx;
     }
-    .goods{
+
+    .goods {
         width: calc(100% - 160rpx);
-        .imgs{
+
+        .imgs {
             width: 150rpx;
             margin-right: 16rpx;
             display: inline-block;
-            &:last-child{
+
+            &:last-child {
                 margin-right: 0;
             }
-            .g_img{
+
+            .g_img {
                 width: 150rpx;
                 height: 100rpx;
                 border-radius: 8rpx;
                 object-fit: cover;
             }
-            .na{
+
+            .na {
                 font-size: 24rpx;
             }
         }
     }
-    .g_amount{
+
+    .g_amount {
         display: flex;
         flex-direction: column;
         justify-content: center;
     }
-    .amount{
+
+    .amount {
         font-size: 32rpx;
         width: 160rpx;
         text-align: right;
-        &::before{
+
+        &::before {
             content: "¥";
             font-size: 24rpx;
         }
     }
-    .p3{
+
+    .p3 {
         font-size: 24rpx;
         color: #999;
     }

+ 3 - 6
src/pagesB/orderingfood/payTheBill.vue

@@ -61,7 +61,6 @@ export default {
             cartTotal: 0,
             userinfo: {},
             Integral: 0,
-
             deduction: 0,
             actuallypaid: 0,
             chabao: 0,
@@ -76,10 +75,10 @@ export default {
             })
         },
         getIntegral(){
-            post("local/getIntegral").then(res=>{
+            post("local/getIntegral",{type:1}).then(res=>{
                 if (res.code == 0) {
                     let i1 = res.data.integral, i2 = res.data.chabao;
-                    this.Integral = this.$h.Mul(va,100);
+                    this.Integral = this.$h.Mul(i1,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);
@@ -129,11 +128,9 @@ export default {
                     toPayOpre.toPay(res.data, (rea) => {
                       if (!rea) {
                         // 支付成功
-                        uni.showToast({ title: "支付成功", icon: "none" });
-                        this.goto("pagesB/orderingfood/orderlist")
+                        this.goto("/pagesB/orderingfood/orderlist")
                       } else {
                         // 支付失败
-                        uni.showToast({ title: "支付已取消", icon: "none" });
                       }
                     });
                 }

BIN
src/static/sgin/f_close.png


BIN
src/static/sgin/left.png


BIN
src/static/sgin/p_back.png


BIN
src/static/sgin/p_back2.png


BIN
src/static/sgin/right.png


+ 80 - 0
src/utils/getImageThemeColor.js

@@ -0,0 +1,80 @@
+/** 获取图片主题色
+ * @param path * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径
+ * @param canvasId * 画布表示
+ * @param callback * 回调函数,返回图片主题色的 RGB 颜色值
+*/
+export function getImageThemeColor(path, canvasId, callback) {
+    uni.getImageInfo({
+        src: path,
+        success(img) {
+            // 创建一个 Canvas 对象 
+            const ctx = uni.createCanvasContext(canvasId); // 将图片绘制到 Canvas 上
+            const imgWidth = 300; const imgHeight = 150;
+            ctx.drawImage(img.path, 0, 0, imgWidth, imgHeight);
+            ctx.save();
+            ctx.draw(true, () => {
+                uni.canvasGetImageData({
+                    canvasId: canvasId, x: 0, y: 0, width: imgWidth, height: imgHeight, success(res) {
+                        // let data = res.data; let arr = []; let r = 1, g = 1, b = 1;
+                        // // 取所有像素的平均值 
+                        // for (let row = 0; row < imgHeight; row++) {
+                        //     for (let col = 0; col < imgWidth; col++) {
+                        //         if (row == 0) {
+                        //             r += data[imgWidth * row + col];
+                        //             g += data[imgWidth * row + col + 1];
+                        //             b += data[imgWidth * row + col + 2];
+                        //             arr.push([r, g, b]);
+                        //         } else {
+                        //             r += data[(imgWidth * row + col) * 4];
+                        //             g += data[(imgWidth * row + col) * 4 + 1];
+                        //             b += data[(imgWidth * row + col) * 4 + 2];
+                        //             arr.push([r, g, b]);
+                        //         }
+                        //     }
+                        // }
+                        // // 求取平均值
+                        // r /= imgWidth * imgHeight; g /= imgWidth * imgHeight; b /= imgWidth * imgHeight;
+                        // // 将最终的值取整
+                        // r = Math.round(r); g = Math.round(g); b = Math.round(b);
+                        // // 返回图片主题色的 RGB 颜色值
+                        // if (!!callback) {
+                        //     callback(`${r},${g},${b}`);
+                        // }
+
+                        let imgData = res.data;
+                        var r = 1, g = 1, b = 1, a = 1;
+                        const arr = Array.prototype.slice.call(imgData, 0)
+                        for (var i = 0; i < arr.length; i += 4) {
+                            r += arr[i];
+                            g += arr[i + 1];
+                            b += arr[i + 2];
+                            a += arr[i + 3];
+                        }
+                        // 求取平均值
+                        r /= (imgWidth * imgHeight);
+                        g /= (imgWidth * imgHeight);
+                        b /= (imgWidth * imgHeight);
+                        a /= (imgWidth * imgHeight);
+                        // 将最终的值取整
+                        r = Math.round(r);
+                        g = Math.round(g);
+                        b = Math.round(b);
+                        a = Math.round(a);
+
+                        let obj = { r, g, b, a }
+                        console.log(obj)
+
+                        const linearGradientColor1 = `rgba(${r},${g},${b},${a})`
+                        const linearGradientColor2 = `rgba(${r},${g},${b},${a * .2})`
+                        let bgColorStr = `linear-gradient(${linearGradientColor1},${linearGradientColor2})`;
+                        console.log(bgColorStr);
+                        
+                        if (!!callback) {
+                            callback(bgColorStr);
+                        }
+                    },
+                });
+            });
+        },
+    });
+}

+ 8 - 28
src/utils/reqTools.js

@@ -1,50 +1,30 @@
-var app = getApp();
-var appEv = app.$vm.$options;
-
 class ToPayOpre {
-    // 支付
-    toPay(info = appEv.parameter("info"), callback) {
+    toPay(info, callback) {
         var that = this;
-		console.log('info',info)
         uni.requestPayment({
             ...info,
             success: function (res) {
                 that.payReturn(false, callback);
             },
             fail: function (res) {
-				console.log(res,"报错信息")
                 that.payReturn(true, callback);
             }
         })
     }
     payReturn(isFail, callback) {
         uni.hideLoading();
-        // 支付失败
         if (isFail) {
-            appEv.errTips('支付失败', 3000);
+            // 支付失败
+            uni.showToast({ title: "支付失败", duration: 3000, icon: "none" });
         } else {
             // 支付成功
-            uni.showToast({
-                title: '支付成功',
-                icon: 'success',
-                duration: 1200,
-                mask: true
-            })
+            uni.showToast({ title: '支付成功', duration: 2000, icon: 'success' })
         }
         
-        // 跳转订单列表
-        setTimeout(function () {
-            if (callback) {
-                callback(isFail);
-            } else {
-                uni.redirectTo({
-                    url: '/pages/chengbei-order-list/index'
-                })
-            }
-        }, 1200);
+        if (callback) {
+            callback(isFail);
+        }
     }
 }
 
-export {
-    ToPayOpre
-}
+export { ToPayOpre }

+ 73 - 1
src/utils/run_now.js

@@ -1,4 +1,5 @@
 import { post } from "@/request/api.js";
+import { setCache, getCache } from "@/utils/storage.js"
 // 此执行为获取实名认证的开关状态
 post("v1/isAuthentication").then(res => {
     if (res.code === 0) {
@@ -30,4 +31,75 @@ uni.Luserfun = () => {
             }
         });
     })
-}
+}
+
+// 获取位置信息
+uni.Location = () => {
+    return new Promise((resolve, reject) => {
+        let adres = getCache("location");
+        if (!adres) {
+            uni.getLocation({
+                type: 'wgs84',
+                success(res) {
+                    // latitude: 22.53270706658251 longitude: 113.94161660883711
+                    // {lat: 22.532707, lng: 113.941617}
+                    let location = { lat: res.latitude, lng: res.longitude };
+                    setCache("location", location, 60 * 2);
+                    resolve(location);
+                },
+                fail(e) {
+                    if (e.errMsg === 'getLocation:fail auth deny') {
+                        let errMsgTit = '你已拒绝授权,是否跳转至设置页面开启权限';
+                        uni.showModal({
+                            title: '提示',
+                            content: `${errMsgTit}`,
+                            success(res) {
+                                if (res.confirm) {
+                                    // 获取设置页面权限信息
+                                    uni.getSetting({
+                                        success(res) {
+                                            // 判断是否开启获取位置权限
+                                            if (!res.authSetting['scope.userLocation']) {
+                                                // 如果没有开启,点击确认后打开设置页面
+                                                uni.openSetting({});
+                                            }
+                                        }
+                                    });
+                                    console.log('用户点击确定');
+                                } else if (res.cancel) {
+                                    console.log('用户点击取消');
+                                }
+                            }
+                        });
+                    }
+                }
+            });
+        } else resolve(adres);
+    })
+}
+
+Array.prototype.indexOf = function (val) {
+    for (var i = 0; i < this.length; i++) {
+        if (this[i] == val) return i;
+    }
+    return -1;
+};
+Array.prototype.remove = function (val) {
+    var index = this.indexOf(val);
+    if (index > -1) {
+        this.splice(index, 1);
+    }
+};
+
+// // 逆地址解析reverseGeocoder
+// import QQMapWX from '@/static/utils/qqmap-wx-jssdk.min.js'
+// const showmap = new QQMapWX({ key: 'NWSBZ-ZUME4-LLTU6-XSQGB-YBKAT-U4FCZ' });
+// showmap.reverseGeocoder({
+//     location: {
+//         latitude: res.latitude,
+//         longitude: res.longitude
+//     },
+//     success(result) {
+//         console.log('逆地址解析:', result);
+//     }
+// });

+ 27 - 0
src/utils/storage.js

@@ -0,0 +1,27 @@
+/**
+   *
+   * @param {缓存key} key
+   * @param {需要存储的缓存值} value
+   * @param {过期时间,默认0表示永久有效} expire
+   */
+export const setCache = (key, value, expire = 0) => {
+    let obj = {
+        data: value, //存储的数据
+        time: Date.now() / 1000, //记录存储的时间戳
+        expire: expire //记录过期时间,单位秒
+    }
+    uni.setStorageSync(key, JSON.stringify(obj))
+}
+
+export const getCache = (key) => {
+    let val = uni.getStorageSync(key)
+    if (!val) {
+        return null
+    }
+    val = JSON.parse(val)
+    if (val.expire && Date.now() / 1000 - val.time > val.expire) {
+        uni.removeStorageSync(key)
+        return null
+    }
+    return val.data
+}