|
|
|
@ -1,80 +1,90 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view class="lf-flex head"> |
|
|
|
<image class="user-img"></image> |
|
|
|
<image class="user-img" :src="info.avatar" @click="lookImg(info.avatar)" v-if="info.avatar"></image> |
|
|
|
<image class="user-img" src="../../static/logo.png" v-else></image> |
|
|
|
<view class="user-info"> |
|
|
|
<view class="lf-font-40 lf-font-bold" style="width: 500rpx;"> |
|
|
|
<text>时空网的忠实网友</text> |
|
|
|
<text class="user-label">商户</text> |
|
|
|
<text class="user-label">管理员</text> |
|
|
|
<text>{{ info.nickname }}</text> |
|
|
|
<text class="user-label" v-for="(item, index) in info.tags" :key="index">{{ item }}</text> |
|
|
|
</view> |
|
|
|
<view class="lf-m-t-20 lf-font-28"> |
|
|
|
<text>ID 78873</text> |
|
|
|
<text class="lf-m-l-30">135****7547</text> |
|
|
|
<text>ID {{ info.id }}</text> |
|
|
|
<text class="lf-m-l-30">{{ hidePhone(info.tel) }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list"> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="$url('/pages/collect/index')"> |
|
|
|
<view> |
|
|
|
<u-icon name="heart" size="50" class="lf-text-vertical"></u-icon> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">我的收藏</text> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/collect.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-20 lf-font-32">我的收藏</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="arrow-right" size="40" color="#777777"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="$url('/pages/contactService/index')"> |
|
|
|
<view> |
|
|
|
<u-icon name="heart" size="50" class="lf-text-vertical"></u-icon> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/service.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">联系客服</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="arrow-right" size="40" color="#777777"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity"> |
|
|
|
<view> |
|
|
|
<u-icon name="heart" size="50" class="lf-text-vertical"></u-icon> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/suggestion.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">意见反馈</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="arrow-right" size="40" color="#777777"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
<button class="feedback-btn" open-type="feedback"></button> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity"> |
|
|
|
<view> |
|
|
|
<u-icon name="heart" size="50" class="lf-text-vertical"></u-icon> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="$url('/pages/FQA/index')"> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/problem.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">常见问题</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="arrow-right" size="40" color="#777777"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- TODO 退出登录逻辑 --> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity"> |
|
|
|
<view> |
|
|
|
<u-icon name="heart" size="50" class="lf-text-vertical"></u-icon> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/loginout.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">退出登录</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="arrow-right" size="40" color="#777777"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 商家工具 --> |
|
|
|
<view class="shop-list"> |
|
|
|
<view class="lf-m-b-20 shop-list" v-if="isRight(info.store)"> |
|
|
|
<view class="lf-row-between lf-m-b-20"> |
|
|
|
<view class="lf-font-36 lf-font-bold">商家工具</view> |
|
|
|
<view class="lf-font-28" style="color: #555555;">李大叔家的店</view> |
|
|
|
<view class="lf-font-28" style="color: #555555;">{{ info.store.name }}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity"> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/order.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">商家订单</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="heart" size="50" class="lf-text-vertical"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="chargeOff"> |
|
|
|
<view class="lf-row-center"> |
|
|
|
<image class="icon-img" src="../../static/center/scan.png"></image> |
|
|
|
<text class="lf-text-vertical lf-m-l-16 lf-font-32">卡券核销</text> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-icon name="arrow-right" size="40" color="#777777"></u-icon> |
|
|
|
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-40"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -85,14 +95,70 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
|
|
|
|
info: { |
|
|
|
avatar: '', |
|
|
|
nickname: '', |
|
|
|
id: '', |
|
|
|
tel: '', |
|
|
|
tags: [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
hidePhone(){ |
|
|
|
return function(tel){ |
|
|
|
if(tel.length == 11){ |
|
|
|
var reg = /^(\d{3})\d{4}(\d{4})$/; |
|
|
|
var new_phone = tel.replace(reg, "$1****$2"); |
|
|
|
return new_phone; |
|
|
|
}else{ |
|
|
|
return tel; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
isRight(){ |
|
|
|
return function(val){ |
|
|
|
return this.$shared.isRight(val); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
this.verifyUserInfo(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
verifyUserInfo(){ |
|
|
|
let userInfo = uni.getStorageSync('userinfo') || {}; |
|
|
|
if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){ |
|
|
|
this.$url('/pages/login/index?type=userinfo'); |
|
|
|
} |
|
|
|
}, |
|
|
|
getData(){ |
|
|
|
this.$http(this.API.API_USER_CENTER).then(res => { |
|
|
|
console.log("res" , res); |
|
|
|
this.info = res.data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 预览图片 |
|
|
|
lookImg(img){ |
|
|
|
uni.previewImage({ |
|
|
|
urls: [img] |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 卡券核销 |
|
|
|
chargeOff(){ |
|
|
|
uni.scanCode({ |
|
|
|
complete: result => { |
|
|
|
console.log("resuly", result) |
|
|
|
if(result.errMsg == 'scanCode:ok'){ |
|
|
|
let content = result.result; // 核销码 |
|
|
|
this.$http(this.API.API_CONFIRM_CODE, {confirm_code: content}).then(res => { |
|
|
|
this.$msg(res.msg); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -115,7 +181,7 @@ |
|
|
|
width: 150rpx; |
|
|
|
height: 150rpx; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #EEEEEE; |
|
|
|
// background-color: #EEEEEE; |
|
|
|
margin-right: 20rpx; |
|
|
|
} |
|
|
|
.user-info{ |
|
|
|
@ -145,6 +211,10 @@ |
|
|
|
height: 110rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
position: relative; |
|
|
|
.icon-img{ |
|
|
|
width: 42rpx; |
|
|
|
height: 42rpx; |
|
|
|
} |
|
|
|
.feedback-btn{ |
|
|
|
position: absolute; |
|
|
|
width: 100%; |
|
|
|
|