Browse Source

修改显示

zs 1 year ago
parent
commit
1b59458144

+ 1 - 1
pages/home/index.vue

@@ -7,7 +7,7 @@
 					<image class="image"
 					<image class="image"
 						v-if="item.url.indexOf('gif') != -1 || item.url.indexOf('jpg') != -1 || item.url.indexOf('png') != -1 || item.url.indexOf('jpeg') !=-1"
 						v-if="item.url.indexOf('gif') != -1 || item.url.indexOf('jpg') != -1 || item.url.indexOf('png') != -1 || item.url.indexOf('jpeg') !=-1"
 						:src="item.url" mode=""></image>
 						:src="item.url" mode=""></image>
-					<video class="image" :autoplay='true' :show-fullscreen-btn="false" :loop="true" controls v-else
+					<video class="image" :autoplay='false' :show-fullscreen-btn="false" :loop="false" controls v-else
 						:src="item.url"></video>
 						:src="item.url"></video>
 				</swiper-item>
 				</swiper-item>
 			</swiper>
 			</swiper>

+ 1 - 37
pagesHome/hotel/detail.vue

@@ -30,10 +30,6 @@
 				<view class="four_1">简介</view>
 				<view class="four_1">简介</view>
 				<rich-text :nodes="formatRichText(info.brief)"></rich-text>
 				<rich-text :nodes="formatRichText(info.brief)"></rich-text>
 			</view>
 			</view>
-			<view class="foot">
-				<view class="button" v-if="info.num==0"><text>售罄</text></view>
-				<view class="button" v-else @click="toBuy"><text>预订</text></view>
-			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -104,17 +100,6 @@
 					}).replace(/\<img/gi, '<img style="width:100%;"') // 对 img 元素增加 style 属性,并设置宽度为 100%
 					}).replace(/\<img/gi, '<img style="width:100%;"') // 对 img 元素增加 style 属性,并设置宽度为 100%
 				}
 				}
 			},
 			},
-			// 预订
-			toBuy(item) {
-				const that = this;
-				if (that.user && that.user._id) {
-					console.log("预订");
-				} else {
-					uni.navigateTo({
-						url: `/pagesIndex/login/index`
-					})
-				}
-			},
 			// 查询其他信息
 			// 查询其他信息
 			async searchOther() {
 			async searchOther() {
 				const that = this;
 				const that = this;
@@ -171,7 +156,7 @@
 			}
 			}
 
 
 			.thr {
 			.thr {
-				padding: 2vw;
+				padding: 0 2vw;
 
 
 				.thr_1 {
 				.thr_1 {
 					display: flex;
 					display: flex;
@@ -196,7 +181,6 @@
 
 
 			.four {
 			.four {
 				padding: 2vw;
 				padding: 2vw;
-				margin: 0 0 15vw 0;
 
 
 				.four_1 {
 				.four_1 {
 					font-weight: bold;
 					font-weight: bold;
@@ -205,25 +189,5 @@
 				}
 				}
 			}
 			}
 		}
 		}
-
-		.foot {
-			position: absolute;
-			bottom: 0;
-			left: 0;
-			right: 0;
-
-			.button {
-				display: flex;
-				justify-content: center;
-				background-color: var(--f3CColor);
-				padding: 4vw;
-
-				text {
-					font-size: var(--font16Size);
-					color: var(--mainColor);
-				}
-			}
-		}
-
 	}
 	}
 </style>
 </style>

+ 1 - 0
pagesHome/hotel/info.vue

@@ -115,6 +115,7 @@
 		onShow: async function(e) {
 		onShow: async function(e) {
 			const that = this;
 			const that = this;
 			await that.searchToken();
 			await that.searchToken();
+			await that.clearPage();
 			await that.search();
 			await that.search();
 		},
 		},
 		methods: {
 		methods: {

+ 1 - 1
pagesHome/ticket/index.vue

@@ -501,7 +501,7 @@
 						flex-direction: column;
 						flex-direction: column;
 						align-items: center;
 						align-items: center;
 						font-size: var(--font12Size);
 						font-size: var(--font12Size);
-						padding: 0 5vw 0 0;
+						padding: 0 2vw 0 0;
 
 
 						.iconfont {
 						.iconfont {
 							font-size: 20px;
 							font-size: 20px;

+ 23 - 0
pagesHome/type/info.vue

@@ -55,6 +55,7 @@
 
 
 <script>
 <script>
 	import moment from 'moment';
 	import moment from 'moment';
+	let innerAudioContext = uni.createInnerAudioContext();
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -77,6 +78,9 @@
 			await that.searchToken();
 			await that.searchToken();
 			await that.search();
 			await that.search();
 		},
 		},
+		onHide: function(e) {
+			innerAudioContext.destroy(); //销毁这个实例
+		},
 		methods: {
 		methods: {
 			searchToken() {
 			searchToken() {
 				const that = this;
 				const that = this;
@@ -102,6 +106,25 @@
 					if (res.errcode == '0') {
 					if (res.errcode == '0') {
 						const type = that.typeList.find(i => i.value == res.data.type)
 						const type = that.typeList.find(i => i.value == res.data.type)
 						if (type) res.data.zhType = type.label
 						if (type) res.data.zhType = type.label
+						// 播放语音
+						const voice = res.data.voice
+						if (voice && voice.length > 0) {
+							innerAudioContext.destroy(); //销毁这个实例
+							innerAudioContext = uni.createInnerAudioContext();
+							innerAudioContext.autoplay = true;
+							innerAudioContext.sessionCategory = "soloAmbient"
+							innerAudioContext.src = voice[0].url
+							innerAudioContext.onPlay(() => {
+								console.log('开始播放');
+							});
+							innerAudioContext.onError((res) => {
+								uni.showToast({
+									title: res.errMsg,
+									icon: 'error',
+									duration: 2000
+								});
+							});
+						}
 						that.$set(that, `info`, res.data)
 						that.$set(that, `info`, res.data)
 					} else {
 					} else {
 						uni.showToast({
 						uni.showToast({

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/hotel/detail.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/hotel/info.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/info/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/ticket/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/type/info.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 0 - 15
unpackage/dist/dev/mp-weixin/pagesHome/hotel/detail.js

@@ -191,10 +191,6 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
 //
 //
 //
 //
 //
 //
-//
-//
-//
-//
 var _default = {
 var _default = {
   data: function data() {
   data: function data() {
     return {
     return {
@@ -317,17 +313,6 @@ var _default = {
         }).replace(/\<img/gi, '<img style="width:100%;"'); // 对 img 元素增加 style 属性,并设置宽度为 100%
         }).replace(/\<img/gi, '<img style="width:100%;"'); // 对 img 元素增加 style 属性,并设置宽度为 100%
       }
       }
     },
     },
-    // 预订
-    toBuy: function toBuy(item) {
-      var that = this;
-      if (that.user && that.user._id) {
-        console.log("预订");
-      } else {
-        uni.navigateTo({
-          url: "/pagesIndex/login/index"
-        });
-      }
-    },
     // 查询其他信息
     // 查询其他信息
     searchOther: function searchOther() {
     searchOther: function searchOther() {
       var _this2 = this;
       var _this2 = this;

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/hotel/detail.wxml


+ 1 - 18
unpackage/dist/dev/mp-weixin/pagesHome/hotel/detail.wxss

@@ -30,7 +30,7 @@
   font-size: var(--font12Size);
   font-size: var(--font12Size);
 }
 }
 .main .bottom .thr.data-v-38f4bfe6 {
 .main .bottom .thr.data-v-38f4bfe6 {
-  padding: 2vw;
+  padding: 0 2vw;
 }
 }
 .main .bottom .thr .thr_1.data-v-38f4bfe6 {
 .main .bottom .thr .thr_1.data-v-38f4bfe6 {
   display: flex;
   display: flex;
@@ -50,27 +50,10 @@
 }
 }
 .main .bottom .four.data-v-38f4bfe6 {
 .main .bottom .four.data-v-38f4bfe6 {
   padding: 2vw;
   padding: 2vw;
-  margin: 0 0 15vw 0;
 }
 }
 .main .bottom .four .four_1.data-v-38f4bfe6 {
 .main .bottom .four .four_1.data-v-38f4bfe6 {
   font-weight: bold;
   font-weight: bold;
   font-size: var(--font16Size);
   font-size: var(--font16Size);
   padding: 0 0 1vw 0;
   padding: 0 0 1vw 0;
 }
 }
-.main .foot.data-v-38f4bfe6 {
-  position: absolute;
-  bottom: 0;
-  left: 0;
-  right: 0;
-}
-.main .foot .button.data-v-38f4bfe6 {
-  display: flex;
-  justify-content: center;
-  background-color: var(--f3CColor);
-  padding: 4vw;
-}
-.main .foot .button text.data-v-38f4bfe6 {
-  font-size: var(--font16Size);
-  color: var(--mainColor);
-}
 
 

+ 4 - 1
unpackage/dist/dev/mp-weixin/pagesHome/hotel/info.js

@@ -255,8 +255,11 @@ var _default = {
               return that.searchToken();
               return that.searchToken();
             case 3:
             case 3:
               _context2.next = 5;
               _context2.next = 5;
-              return that.search();
+              return that.clearPage();
             case 5:
             case 5:
+              _context2.next = 7;
+              return that.search();
+            case 7:
             case "end":
             case "end":
               return _context2.stop();
               return _context2.stop();
           }
           }

+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/ticket/index.wxss

@@ -83,7 +83,7 @@
   flex-direction: column;
   flex-direction: column;
   align-items: center;
   align-items: center;
   font-size: var(--font12Size);
   font-size: var(--font12Size);
-  padding: 0 5vw 0 0;
+  padding: 0 2vw 0 0;
 }
 }
 .main .bottom .two .two_3 .right .iconfont.data-v-1ae5c169 {
 .main .bottom .two .two_3 .right .iconfont.data-v-1ae5c169 {
   font-size: 20px;
   font-size: 20px;

+ 26 - 1
unpackage/dist/dev/mp-weixin/pagesHome/type/info.js

@@ -236,6 +236,8 @@ var _moment = _interopRequireDefault(__webpack_require__(/*! moment */ 52));
 //
 //
 //
 //
 //
 //
+
+var innerAudioContext = uni.createInnerAudioContext();
 var _default = {
 var _default = {
   data: function data() {
   data: function data() {
     return {
     return {
@@ -296,6 +298,10 @@ var _default = {
     }
     }
     return onShow;
     return onShow;
   }(),
   }(),
+  onHide: function onHide(e) {
+    innerAudioContext.destroy(); //销毁这个实例
+  },
+
   methods: {
   methods: {
     searchToken: function searchToken() {
     searchToken: function searchToken() {
       var that = this;
       var that = this;
@@ -315,7 +321,7 @@ var _default = {
     search: function search() {
     search: function search() {
       var _this = this;
       var _this = this;
       return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
       return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
-        var that, info, res, type;
+        var that, info, res, type, voice;
         return _regenerator.default.wrap(function _callee3$(_context3) {
         return _regenerator.default.wrap(function _callee3$(_context3) {
           while (1) {
           while (1) {
             switch (_context3.prev = _context3.next) {
             switch (_context3.prev = _context3.next) {
@@ -336,6 +342,25 @@ var _default = {
                     return i.value == res.data.type;
                     return i.value == res.data.type;
                   });
                   });
                   if (type) res.data.zhType = type.label;
                   if (type) res.data.zhType = type.label;
+                  // 播放语音
+                  voice = res.data.voice;
+                  if (voice && voice.length > 0) {
+                    innerAudioContext.destroy(); //销毁这个实例
+                    innerAudioContext = uni.createInnerAudioContext();
+                    innerAudioContext.autoplay = true;
+                    innerAudioContext.sessionCategory = "soloAmbient";
+                    innerAudioContext.src = voice[0].url;
+                    innerAudioContext.onPlay(function () {
+                      console.log('开始播放');
+                    });
+                    innerAudioContext.onError(function (res) {
+                      uni.showToast({
+                        title: res.errMsg,
+                        icon: 'error',
+                        duration: 2000
+                      });
+                    });
+                  }
                   that.$set(that, "info", res.data);
                   that.$set(that, "info", res.data);
                 } else {
                 } else {
                   uni.showToast({
                   uni.showToast({