| xqd
@@ -13,12 +13,12 @@
|
|
|
</view>
|
|
|
<view class="nickname">{{userData.nickname}}</view>
|
|
|
<view class="mobile">
|
|
|
- {{userData.phone_num}}
|
|
|
<!--#ifdef MP-WEIXIN-->
|
|
|
<u-button size="mini"
|
|
|
v-if="!userData.phone_num"
|
|
|
:custom-style="{backgroundColor: '#097268'}"
|
|
|
type="success" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</u-button>
|
|
|
+ <text v-else>{{userData.phone_num}}</text>
|
|
|
<!--#endif-->
|
|
|
</view>
|
|
|
</view>
|
| xqd
@@ -40,6 +40,8 @@
|
|
|
<u-cell-item title="在线客服" :border-bottom="false" bg-color="#f9f9f9">
|
|
|
<view slot="icon" class="icon kefu"></view>
|
|
|
</u-cell-item>
|
|
|
+ <u-cell-item title="清除缓存" :border-bottom="false" icon="reload" bg-color="#f9f9f9" @click="handleClearCache">
|
|
|
+ </u-cell-item>
|
|
|
</u-cell-group>
|
|
|
<view class="qrcode dir-top-wrap cross-center">
|
|
|
<view class="img">
|
| xqd
@@ -52,6 +54,16 @@
|
|
|
<text class="title">扫描二维码联系客服</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <u-modal v-model="modal.show"
|
|
|
+ :show-cancel-button="true"
|
|
|
+ content="确定清除缓存?"
|
|
|
+ cancel-text="取消"
|
|
|
+ cancel-color="#CCCCCC"
|
|
|
+ confirm-text="确定"
|
|
|
+ confirm-color="#046E64"
|
|
|
+ @confirm="sureClearCache"
|
|
|
+ >
|
|
|
+ </u-modal>
|
|
|
</app-layout>
|
|
|
</template>
|
|
|
|
| xqd
@@ -64,12 +76,25 @@
|
|
|
data() {
|
|
|
return {
|
|
|
userData: this.vuex_user_data,
|
|
|
- setting: {}
|
|
|
+ setting: {},
|
|
|
+ modal: {
|
|
|
+ show : false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getPhoneNumber(phoneNumber){
|
|
|
- console.log('-->data',phoneNumber)
|
|
|
+ uni.checkSession({
|
|
|
+ success: data => {
|
|
|
+ this.$u.api.userBindPhone(phoneNumber.detail).then(data => {
|
|
|
+ this.$u.vuex(this.$const.USER_DATA,data)
|
|
|
+ this.userData = data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: err => {
|
|
|
+ this.sureClearCache()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
getUser(){
|
|
|
this.$u.api.userGet().then(data => {
|
| xqd
@@ -80,6 +105,14 @@
|
|
|
this.$u.api.settingGet().then(data => {
|
|
|
this.setting = data;
|
|
|
})
|
|
|
+ },
|
|
|
+ handleClearCache(){
|
|
|
+ this.modal.show = true
|
|
|
+ },
|
|
|
+ sureClearCache(){
|
|
|
+ this.$u.vuex(this.$const.USER_TOKEN,null)
|
|
|
+ this.$u.vuex(this.$const.USER_DATA,null)
|
|
|
+ this.$jump({url:'/pages/login/login?redirect=pages/my/index',type:'redirect'})
|
|
|
}
|
|
|
},
|
|
|
onLoad(){
|