加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.vue 7.49 KB
一键复制 编辑 原始数据 按行查看 历史
Former. 提交于 2021-06-02 18:00 . 修复bug
<script>
export default {
globalData: {
text: 'text'
},
onLaunch: function() {
// 锁定竖屏
// #ifdef APP-PLUS
plus.screen.lockOrientation("portrait-primary");
// #endif
this.$bus.userInfo = {};
// let faCode=this.common.GetUrlParam("shareCode");
// let fromType=this.common.GetUrlParam("fromType");
let self = this;
// let url=window.location.href;
// uni.setStorage({
// key:"userInfo",
// data:{"userId":"21514",tokenId:'939784e28f73453e8fc549c39c05354a',"userCode":"00362699","realName":"kkgo","telephone":"13011275782"}
// });
// this.$bus.userInfo={"userId":"21514",tokenId:'939784e28f73453e8fc549c39c05354a',"reCode":"138","userTel":"13011275782"};
// if(url.indexOf('login')==-1&&url.indexOf('register')==-1){//未登录,进入登录页面
uni.getStorage({
key: 'userInfo',
success: res => {
console.log(res);
if (res.data && res.data.userId) {
self.$nextTick(function() {
self.$bus.userInfo = res.data;
});
// 登录im
var WebIM = this.$WebIM;
// var options = {
// apiUrl: WebIM.config.apiURL,
// user: 'group' + res.data.userId,
// pwd: 'group123',
// appKey: WebIM.config.appkey,
// success:function(token){
// console.log("login:"+token)
// console.log(token)
// },
// fail:function(err){
// console.log(err)
// }
// };
// WebIM.conn.open(options);
//#ifdef APP-PLUS
uniCloud.callFunction({
name: 'chb-check-update',
data: {
appid: plus.runtime.appid,
version: plus.runtime.version
},
success(e) {
if (e.result.isUpdate) {
//需要更新
// 提醒用户更新
uni.showModal({
title: '更新提示',
content: e.result.note ? e.result.note : '是否选择更新',
success: ee => {
if (ee.confirm) {
if (e.result.wgtUrl) {
uni.downloadFile({
url: e.result.wgtUrl,
success: downloadResult => {
if (downloadResult.statusCode === 200) {
plus.runtime.install(
downloadResult.tempFilePath,
{
force: false
},
function() {
console.log('install success...');
plus.runtime.restart();
},
function(e) {
console.error('install fail...');
}
);
}
}
});
} else {
plus.runtime.openURL(e.result.url);
}
}
}
});
}
}
});
//#endif
} else {
uni.redirectTo({
url: '/pages/login/login'
});
}
},
fail: err => {
uni.redirectTo({
url: '/pages/login/login'
});
}
});
// }else{
//}
},
onShow: function() {},
onHide: function() {}
};
</script>
<style lang="scss">
/*每个页面公共css*/
@import '/static/iconfont/font.scss';
// map info
.amap-info-content {
padding: 20upx !important;
border-radius: 15upx;
background: rgba(255, 255, 255, 0.8);
max-width: 300upx;
}
.amap-info-content .amap-info-close {
top: 10upx;
right: 20upx !important;
}
.storeMap.input-item {
display: flex;
width: 100%;
box-sizing: border-box;
justify-content: space-between;
padding: 15upx 0 0;
.industry {
color: #75b1ff;
border: 1px solid #75b1ff;
border-radius: 10upx;
padding: 4upx;
}
.agentId {
padding: 4upx 10upx;
border-radius: 24upx;
color: #fff;
background: #75b1ff;
}
}
// spec
body .specTags {
display: inline-block;
max-width: 160upx !important;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
// shop
.shopList .scrollView22 .uni-scroll-view > div {
display: flex;
}
.endDate .uni-input-input,
.startDate .uni-input-input {
font-size: 24upx;
}
.amap-logo,
.amap-copyright {
display: none !important;
visibility: hidden !important;
}
.amap-geolocation-con {
bottom: 200upx !important;
top: auto !important;
}
#storeMap .amap-geolocation-con .amap-geo {
display: none;
}
.noData {
padding: 100upx 0;
width: 100%;
text-align: center;
font-size: 30upx;
color: #999;
}
.ellipsis {
display: block;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ellipsis2 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.wuliuMesList {
position: fixed;
width: 100%;
height: 100%;
top: 0;
bottom: 0;
left: 0;
z-index: 999;
background: rgba(0, 0, 0, 0.8);
.wListC {
width: 80%;
height: 75%;
background: #fff;
border-radius: 10upx;
padding: 30upx 20upx;
margin: 10% auto 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
overflow-scrolling: touch;
}
.closeWuliu {
display: block;
width: 60upx;
height: 60upx;
margin: 50upx auto 0;
}
}
page {
background: #f1f1f1;
}
::-webkit-scrollbar {
width: 0;
height: 0;
}
// 精品推荐这种样式的标题
.commonTitle {
width: 100%;
display: flex;
color: #595757;
justify-content: space-between;
padding: 30upx;
position: relative;
box-sizing: border-box;
&::before {
content: '';
width: 10upx;
height: 40upx;
background: rgba(230, 68, 61, 1);
border-radius: 5upx;
position: absolute;
left: 25upx;
top: 32upx;
}
view {
display: block;
height: 100%;
// width:50%;
box-sizing: border-box;
line-height: 40upx;
font-size: 36upx;
font-weight: bold;
&:first-child {
padding-left: 20upx;
text-align: left;
}
&.cRight {
font-size: 28upx;
// padding-left: 20upx;
text-align: right;
image {
width: 30upx;
height: 28upx;
}
}
}
}
// 为你推荐
.introduce {
width: 100%;
font-size: 30upx;
text-align: center;
font-family: PingFang SC;
font-weight: bold;
color: rgba(89, 87, 87, 1);
padding: 30upx 0;
}
.scrollView {
width: 100%;
height: 90upx !important;
display: flex;
justify-content: space-between;
align-items: center;
.swiper-box {
width: 92%;
height: 100%;
overflow: hidden;
font-size: 30upx;
//兼容ios,微信小程序
position: relative;
z-index: 1;
display: flex;
align-items: center;
scroll-view {
width: 100%;
// height: 90upx;
white-space: nowrap;
view {
padding: 0 20upx 12upx;
display: inline-block;
position: relative;
font-size: 26upx;
color: #3e3a39;
&.active {
color: rgba(235, 69, 63, 1);
font-size: 30upx;
}
&.active:after {
position: absolute;
bottom: 0upx;
left: 50%;
transform: translateX(-50%);
content: '';
width: 43upx;
height: 6upx;
background: rgba(235, 69, 63, 1);
border-radius: 3upx;
}
}
}
}
.typeItem {
width: 130upx;
height: 44upx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24upx;
line-height: 1;
text {
padding-bottom: 2px;
}
image {
width: 44upx;
height: 100%;
// margin-top: 4upx;
margin-right: -4upx;
}
}
}
// 九宫格
.category-list {
width: 100%;
margin: 0 auto;
// padding: 0 0 30upx 0;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.category {
width: 20%;
margin: 40upx 0 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.img {
width: 100%;
display: flex;
justify-content: center;
image {
min-width: 80upx;
min-height: 80upx;
width: 80upx;
height: 80upx;
}
}
.text {
margin-top: 20upx;
width: 100%;
display: flex;
justify-content: center;
font-size: 26upx;
color: #595757;
}
}
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化