<script>
	export default {
		// 全局变量定义
		globalData:{
			dflindex:0,
			xflid:0,
			dflid:0,
		},
		onLaunch() {
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(function (res) {
			  // 请求完新版本信息的回调
			  //console.log(res.hasUpdate);
			});
			
			updateManager.onUpdateReady(function (res) {
			  uni.showModal({
			    title: '更新提示',
			    content: '新版本已经准备好，是否重启应用？',
			    success(res) {
			      if (res.confirm) {
			        // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
			        updateManager.applyUpdate();
			      }
			    }
			  });
			
			});
			
			updateManager.onUpdateFailed(function (res) {
			  // 新的版本下载失败
			  uni.showModal({
			    title: '自动更新提示',
			    content: '新版本自动更新失败，请删除后重新进',
			    success(res) {
			      if (res.confirm) {
			        // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
			        updateManager.applyUpdate();
			      }
			    }
			  });
			});
		},
		onShow() {},
		onHide() {},
	}
</script>

<style  lang='scss'>
	/*每个页面公共css */
	@font-face {
		font-family: yticon;
		font-weight: normal;
		font-style: normal;
		src: url('https://at.alicdn.com/t/font_1078604_w4kpxh0rafi.ttf') format('truetype');
	}
	
	@import '/static/iconfont.css';
	/* 图片载入替代方案 */
	.image-wrapper {
		font-size: 0;
		background: #f3f3f3;
		border-radius: 4px;
	
		image {
			width: 100%;
			height: 100%;
			transition: .6s;
			opacity: 0;
	
			&.loaded {
				opacity: 1;
			}
		}
	}
	.yticon {
		font-family: "yticon" !important;
		font-size: 16px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}
	/* 购物车图标 */
	.icon-gouwuche_:before {
		content: "\e630";
	}
	.icon-gouwuche:before {
		content: "\e609";
	}
	/*收藏图标 */
	.icon-shoucang:before {
		content: "\e645";
	}
	/* 价格上下图标 */
	.icon-shang:before {
		content: "\e624";
	}
	.icon-fenlei1:before {
		content: "\e620";
	}
	/* 支付图标 */
	.icon-weixinzhifu:before {
		content: "\e61a";
	}
	.icon-erjiye-yucunkuan:before {
		content: "\e623";
	}
	.icon-xuanzhong2:before {
		content: "\e62f";
	}
	/* 订单图标 */
	.icon-shouye:before {
		content: "\e626";
	}
	.icon-daifukuan:before {
		content: "\e68f";
	}
	.icon-yishouhuo:before {
		content: "\e71a";
	}
	.icon-shouhoutuikuan:before {
		content: "\e631";
	}
	/* 浏览历史记录 */
	.icon-lishijilu:before {
		content: "\e6b9";
	}
	/* 收货地址 */
	.icon-dizhi:before {
		content: "\e614";
	}
	.icon-shoucang_xuanzhongzhuangtai:before {
		content: "\e6a9";
	}
	.icon-shezhi1:before {
		content: "\e61d";
	}
	/* 联系客服 */
	.icon-pinglun-copy:before {
		content: "\e612";
	}
	
</style>
