Merge pull request 'gyh' (#310) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/310
This commit is contained in:
		
						commit
						2d8e738164
					
				@ -22,7 +22,7 @@
 | 
				
			|||||||
									<view class="swiper-item uni-bg-red">
 | 
														<view class="swiper-item uni-bg-red">
 | 
				
			||||||
										<image :src=" 'https://' + item.launch_path"></image>
 | 
															<image :src=" 'https://' + item.launch_path"></image>
 | 
				
			||||||
									</view>
 | 
														</view>
 | 
				
			||||||
                                    <view class="btn-init" v-if="parseInt(index) == list.length" @click="goNext">立即体验</view>
 | 
														<view class="btn-init" v-if="parseInt(index) == list.length - 1" @click="goNext">立即体验</view>
 | 
				
			||||||
								</swiper-item>
 | 
													</swiper-item>
 | 
				
			||||||
							</swiper>
 | 
												</swiper>
 | 
				
			||||||
						</view>
 | 
											</view>
 | 
				
			||||||
 | 
				
			|||||||
@ -10,6 +10,10 @@
 | 
				
			|||||||
			<view>{{ item.title }}</view>
 | 
								<view>{{ item.title }}</view>
 | 
				
			||||||
			<image src="../static/mine/21.png"></image>
 | 
								<image src="../static/mine/21.png"></image>
 | 
				
			||||||
		</view>
 | 
							</view>
 | 
				
			||||||
 | 
					        <view class="list-item" @click="clearCache">
 | 
				
			||||||
 | 
					            <view>清除缓存</view>
 | 
				
			||||||
 | 
					            <view class="left-text">{{ fileSizeString }}</view>
 | 
				
			||||||
 | 
					        </view>
 | 
				
			||||||
		<view class="list-item" @click="sheetStatus=true">
 | 
							<view class="list-item" @click="sheetStatus=true">
 | 
				
			||||||
			<view>退出登录</view>
 | 
								<view>退出登录</view>
 | 
				
			||||||
			<image src="../static/mine/21.png"></image>
 | 
								<image src="../static/mine/21.png"></image>
 | 
				
			||||||
@ -76,9 +80,13 @@
 | 
				
			|||||||
					},
 | 
										},
 | 
				
			||||||
				],
 | 
									],
 | 
				
			||||||
				content: "是否退出登录!",
 | 
									content: "是否退出登录!",
 | 
				
			||||||
				show: false
 | 
									show: false,
 | 
				
			||||||
 | 
					                fileSizeString: "", // 缓存大小
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
					        onLoad() {
 | 
				
			||||||
 | 
					            this.getCache();
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
		methods: {
 | 
							methods: {
 | 
				
			||||||
			...mapMutations(['logout']),
 | 
								...mapMutations(['logout']),
 | 
				
			||||||
			// 退出登录选择 0:切换账号 | 1:退出登录
 | 
								// 退出登录选择 0:切换账号 | 1:退出登录
 | 
				
			||||||
@ -88,6 +96,45 @@
 | 
				
			|||||||
					this.show = true;
 | 
										this.show = true;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
 | 
					            // 获取缓存
 | 
				
			||||||
 | 
					            getCache() {
 | 
				
			||||||
 | 
					                let _this = this;
 | 
				
			||||||
 | 
					                // #ifdef APP-PLUS
 | 
				
			||||||
 | 
					                plus.cache.calculate(function(size) {
 | 
				
			||||||
 | 
					                    let sizeCache = size;
 | 
				
			||||||
 | 
					                    if (sizeCache == 0) {
 | 
				
			||||||
 | 
					                        _this.fileSizeString = "0B";
 | 
				
			||||||
 | 
					                    } else if (sizeCache < 1024) {
 | 
				
			||||||
 | 
					                        _this.fileSizeString = sizeCache + "B";
 | 
				
			||||||
 | 
					                    } else if (sizeCache < 1048576) {
 | 
				
			||||||
 | 
					                        _this.fileSizeString = (sizeCache / 1024).toFixed(2) + "KB";
 | 
				
			||||||
 | 
					                    } else if (sizeCache < 1073741824) {
 | 
				
			||||||
 | 
					                        _this.fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB";
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        _this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					                // #endif
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            // 清除缓存
 | 
				
			||||||
 | 
					            clearCache() {
 | 
				
			||||||
 | 
					                // #ifdef APP-PLUS
 | 
				
			||||||
 | 
					                uni.showModal({
 | 
				
			||||||
 | 
					                    title: "确定要清理缓存吗?",
 | 
				
			||||||
 | 
					                    cancelColor: "#999",
 | 
				
			||||||
 | 
					                    confirmColor: "#f00",
 | 
				
			||||||
 | 
					                    success: (res) => {
 | 
				
			||||||
 | 
					                        // console.log(res);
 | 
				
			||||||
 | 
					                        if (res.confirm) {
 | 
				
			||||||
 | 
					                            plus.cache.clear(function(e) {
 | 
				
			||||||
 | 
					                                console.log(e);
 | 
				
			||||||
 | 
					                            })
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        this.getCache();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
 | 
					                // #endif
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
			toNextPage(url, ...params) {
 | 
								toNextPage(url, ...params) {
 | 
				
			||||||
				uni.navigateTo({
 | 
									uni.navigateTo({
 | 
				
			||||||
					url: url
 | 
										url: url
 | 
				
			||||||
@ -125,6 +172,11 @@
 | 
				
			|||||||
				width: 14rpx;
 | 
									width: 14rpx;
 | 
				
			||||||
				height: 24rpx;
 | 
									height: 24rpx;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            .left-text {
 | 
				
			||||||
 | 
					                margin-left: auto;
 | 
				
			||||||
 | 
					                font-size: 28rpx;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 | 
				
			|||||||
@ -124,7 +124,7 @@
 | 
				
			|||||||
								"backgroundColor":"#ffffff",
 | 
													"backgroundColor":"#ffffff",
 | 
				
			||||||
								"buttons": [
 | 
													"buttons": [
 | 
				
			||||||
									{
 | 
														{
 | 
				
			||||||
										"type":"none",
 | 
															// "type":"none",
 | 
				
			||||||
										"text":"\ue636",
 | 
															"text":"\ue636",
 | 
				
			||||||
										"float":"right",
 | 
															"float":"right",
 | 
				
			||||||
										"fontSize":"18",
 | 
															"fontSize":"18",
 | 
				
			||||||
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user