Merge pull request 'gdpao' (#82) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/82
This commit is contained in:
		
						commit
						22901579b9
					
				@ -125,7 +125,7 @@
 | 
			
		||||
		<u-popup v-model="showExpress" mode="center" border-radius="10" class="delivery-popup">
 | 
			
		||||
			<view class="title">填写快递单号</view>
 | 
			
		||||
			<view class="input-info"><input type="text" style="color: #333; line-height: 1;" placeholder="请输入快递单号" v-model="pushid" /></view>
 | 
			
		||||
			<view class="btn" @click="showExpress = false">确认</view>
 | 
			
		||||
			<view class="btn" @click="saveDelivery">确认</view>
 | 
			
		||||
		</u-popup>
 | 
			
		||||
		<u-popup v-model="showRefunds" mode="center" border-radius="10" class="refunds-popup">
 | 
			
		||||
			<view v-if="cur == 1" class="popup-tips">
 | 
			
		||||
@ -262,6 +262,17 @@ export default {
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
        // 保存订单号
 | 
			
		||||
        saveDelivery() {
 | 
			
		||||
            if (!this.pushid) {
 | 
			
		||||
                uni.showToast({
 | 
			
		||||
                    title: "请填写快递单号!",
 | 
			
		||||
                    icon: "none"
 | 
			
		||||
                })
 | 
			
		||||
                return
 | 
			
		||||
            }
 | 
			
		||||
            this.showExpress = false;
 | 
			
		||||
        },
 | 
			
		||||
		// 取消退款
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.showRefunds = false;
 | 
			
		||||
 | 
			
		||||
@ -89,6 +89,7 @@ export default {
 | 
			
		||||
		loading() {},
 | 
			
		||||
		logins() {
 | 
			
		||||
			// 判断是否可以点击
 | 
			
		||||
            console.log(this.zhanghao);
 | 
			
		||||
			if(this.clickstate==false){
 | 
			
		||||
				this.clickstate=true
 | 
			
		||||
			}else{
 | 
			
		||||
 | 
			
		||||
@ -23,11 +23,15 @@
 | 
			
		||||
			<text>骑手投诉</text>
 | 
			
		||||
			<image src="/static/image/user/1.png"></image>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="nav" @click="is_loginout = true">
 | 
			
		||||
		<view class="nav" @click="clearCache">
 | 
			
		||||
			<text>清除缓存</text>
 | 
			
		||||
            <text>{{ fileSizeString }}</text>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="nav" @click="isLoginOut = true">
 | 
			
		||||
			<text>退出登录</text>
 | 
			
		||||
			<image src="/static/image/user/1.png"></image>
 | 
			
		||||
		</view>
 | 
			
		||||
        <u-modal v-model="is_loginout" show-confirm-button show-cancel-button :content="content" @confirm="loginOut"></u-modal>
 | 
			
		||||
        <u-modal v-model="isLoginOut" show-confirm-button show-cancel-button :content="content" @confirm="loginOut"></u-modal>
 | 
			
		||||
		<u-toast ref="uToast" />
 | 
			
		||||
    </view>
 | 
			
		||||
</template>
 | 
			
		||||
@ -37,17 +41,72 @@ export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			info:{},
 | 
			
		||||
            is_loginout: false,
 | 
			
		||||
            isLoginOut: false,
 | 
			
		||||
            content: "是否退出登录?",
 | 
			
		||||
			num:0
 | 
			
		||||
			num:0,
 | 
			
		||||
            fileSizeString: "", // 缓存大小
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
    watch: {
 | 
			
		||||
        isLoginOut() {
 | 
			
		||||
            // console.log(this.isLoginOut);
 | 
			
		||||
            if (this.isLoginOut) {
 | 
			
		||||
                uni.hideTabBar();
 | 
			
		||||
            } else {
 | 
			
		||||
                setTimeout(function() {
 | 
			
		||||
                    uni.showTabBar();
 | 
			
		||||
                },200)
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
	onLoad() {
 | 
			
		||||
        this.getCache();
 | 
			
		||||
        console.log(222);
 | 
			
		||||
	},
 | 
			
		||||
	onShow() {
 | 
			
		||||
		this.getmyinfo()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
        // 获取缓存
 | 
			
		||||
        getCache() {
 | 
			
		||||
            let _this = this;
 | 
			
		||||
            // #ifdef APP-PLUS
 | 
			
		||||
            plus.cache.calculate(function(size) {
 | 
			
		||||
                console.log(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
 | 
			
		||||
        },
 | 
			
		||||
		// 退出登陆
 | 
			
		||||
		loginOut(){
 | 
			
		||||
			uni.clearStorage();
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,10 @@
 | 
			
		||||
			<text>内容管理</text>
 | 
			
		||||
			<image src="/static/image/user/1.png"></image>
 | 
			
		||||
		</view>
 | 
			
		||||
        <view class="nav" @click="clearCache">
 | 
			
		||||
        	<text>清除缓存</text>
 | 
			
		||||
            <text>{{ fileSizeString }}</text>
 | 
			
		||||
        </view>
 | 
			
		||||
		<view class="nav" @click="is_loginout = true">
 | 
			
		||||
			<text>退出登录</text>
 | 
			
		||||
			<image src="/static/image/user/1.png"></image>
 | 
			
		||||
@ -59,28 +63,70 @@ export default {
 | 
			
		||||
	name:"user",
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			publishstate:false,
 | 
			
		||||
			publishstate: false,
 | 
			
		||||
            is_loginout: false,
 | 
			
		||||
            content: "是否退出登录?",
 | 
			
		||||
			info:{},
 | 
			
		||||
            fileSizeString: "", // 缓存大小
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	onShow(){
 | 
			
		||||
		this.getmyinfo()
 | 
			
		||||
	},
 | 
			
		||||
	onLoad() {
 | 
			
		||||
        this.getCache();
 | 
			
		||||
		const user = uni.getStorageSync('userinfo');
 | 
			
		||||
		console.log(user)
 | 
			
		||||
		this.imService.login(user.userId,user.member_nickname,user.member_avatar)
 | 
			
		||||
		this.imService.connectIM()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取缓存
 | 
			
		||||
		getCache() {
 | 
			
		||||
				let _this = this;
 | 
			
		||||
				// #ifdef APP-PLUS
 | 
			
		||||
				plus.cache.calculate(function(size) {
 | 
			
		||||
						console.log(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
 | 
			
		||||
		},
 | 
			
		||||
		navtos(){
 | 
			
		||||
			console.log(1212)
 | 
			
		||||
			this.$u.route({
 | 
			
		||||
				url:"/pages/messages/list"
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
    // 退出登录
 | 
			
		||||
		loginOut(){
 | 
			
		||||
			this.imService.disconnect()
 | 
			
		||||
			uni.clearStorage();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user