parent
c047a06d42
commit
b917f98738
7 changed files with 54 additions and 309 deletions
@ -1,216 +0,0 @@ |
||||
<template> |
||||
<view class="sp-new-header-wrap"> |
||||
<view class="heder-box" :class="{ active: isShowBlur }"> |
||||
<view class="heder-left" @click="gotoPage('../my/my', 1)"> |
||||
<view class="avatar-item"> |
||||
<image |
||||
mode="widthFix" |
||||
:src="securityInfo.avatar || '/static/img/avatar.png'" |
||||
/> |
||||
</view> |
||||
<view class="welcome-css" |
||||
>Hi , |
||||
{{ |
||||
isOkAuth || securityInfo.realName |
||||
? securityInfo.nickName |
||||
: $t("betPageTMy.notAuthText") |
||||
}}</view |
||||
> |
||||
<view class="auth-icon"> |
||||
<view |
||||
class="iconfont icon-renzheng" |
||||
:class="{ isOkAuth: isOkAuth }" |
||||
></view> |
||||
</view> |
||||
</view> |
||||
<view class="heder-right"> |
||||
<view class="right-item" @click="toChat"> |
||||
<view class="iconfont icon-support"></view> |
||||
</view> |
||||
<view class="right-item" @click="scanCode"> |
||||
<view class="iconfont icon-code"></view> |
||||
</view> |
||||
<view class="right-item" @click="gotoPage('../homeNotice/index')"> |
||||
<view class="iconfont icon-tongzhi"></view> |
||||
<view v-if="unreadNoticeIds" class="sp-header__alt-new">{{ |
||||
unreadNoticeIds |
||||
}}</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view v-if="isShowBlur" class="header-bar-css"> </view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: "BetoneNewHeader", |
||||
props: { |
||||
isShowBlur: { |
||||
type: Boolean, |
||||
default: false, |
||||
}, |
||||
userInfo: { |
||||
type: Object, |
||||
default: () => { |
||||
return { |
||||
realName: "", |
||||
avatar: "", |
||||
realName: "", |
||||
nickName: "", |
||||
}; |
||||
}, |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
securityInfo: {}, |
||||
unreadNoticeIds: 0, |
||||
}; |
||||
}, |
||||
computed: { |
||||
isOkAuth() { |
||||
return uni.getStorageSync("isOkAuth"); |
||||
}, |
||||
tCommonToast() { |
||||
return this.$t("tCommonToast"); |
||||
}, |
||||
}, |
||||
mounted() {}, |
||||
methods: { |
||||
// 由外部调用 |
||||
refresh(res, res2 = null, refreshSecurity = false) { |
||||
try { |
||||
const D = uni.getStorageSync("securityInfo"); |
||||
this.securityInfo = JSON.parse(D); |
||||
} catch (e) {} |
||||
if (!refreshSecurity) { |
||||
this.getMemberSecurityInfo(res); |
||||
} |
||||
this.findUnreadNoticeId(res2); |
||||
}, |
||||
findUnreadNoticeId(res2 = null) { |
||||
if (!res2) { |
||||
this.$u |
||||
.get("/message/findUnreadCount") |
||||
.then(this.findUnreadNoticeIdCallBack); |
||||
} else { |
||||
this.findUnreadNoticeIdCallBack(res2); |
||||
} |
||||
}, |
||||
findUnreadNoticeIdCallBack(res) { |
||||
var that = this; |
||||
that.unreadNoticeIds = res.data; |
||||
}, |
||||
getMemberSecurityInfo(res) { |
||||
if (res) { |
||||
this.rs(res); |
||||
} else { |
||||
this.$u.get("/member/getMemberSecurityInfo").then(this.rs); |
||||
} |
||||
}, |
||||
rs(res) { |
||||
this.securityInfo = res.data; |
||||
this.$emit("securityInfo", this.securityInfo); |
||||
try { |
||||
uni.setStorage({ |
||||
key: "securityInfo", |
||||
data: JSON.stringify(this.securityInfo), |
||||
}); |
||||
} catch (e) {} |
||||
}, |
||||
toChat() { |
||||
// uni.navigateTo({ |
||||
// url: "../csChat/csChat?vip=1", |
||||
// }); |
||||
uni.navigateTo({ |
||||
url: "/pages/cusservice/cusservice", |
||||
fail: (err) => { |
||||
uni.showToast({ |
||||
title: this.$t("tCommonToast").toast55, |
||||
icon: "none", |
||||
duration: 5000, |
||||
mask: true, |
||||
}); |
||||
}, |
||||
}); |
||||
}, |
||||
gotoPage(path, ack = 0) { |
||||
if (!ack) { |
||||
uni.navigateTo({ |
||||
url: path, |
||||
}); |
||||
} else { |
||||
uni.switchTab({ |
||||
url: path, |
||||
}); |
||||
} |
||||
}, |
||||
lockPreReceiptOrder() { |
||||
var that = this; |
||||
if (that.orderNo === null || that.orderNo === "") { |
||||
// 请输入订单号 |
||||
uni.showToast({ |
||||
title: this.tCommonToast.toast10, |
||||
icon: "none", |
||||
}); |
||||
return; |
||||
} |
||||
this.$u |
||||
.post("/transfer/lockPreReceiptOrder", { |
||||
orderNo: that.orderNo, |
||||
}) |
||||
.then((res) => { |
||||
that.showC2BModal = false; |
||||
uni.navigateTo({ |
||||
url: "../transferC2B/transferC2B?orderNo=" + that.orderNo, |
||||
}); |
||||
}); |
||||
}, |
||||
scanCode() { |
||||
var that = this; |
||||
// #ifdef APP-PLUS |
||||
uni.scanCode({ |
||||
scanType: ["qrCode"], |
||||
autoZoom: true, |
||||
success: function (res) { |
||||
if (res.result && 1) { |
||||
var reg = /^-?[0-9]\d*$/; |
||||
if (reg.test(res.result)) { |
||||
that.orderNo = res.result; |
||||
that.lockPreReceiptOrder(); |
||||
} else { |
||||
that.walletAddr = res.result; |
||||
uni.navigateTo({ |
||||
url: "../transferC2C/transferC2C?walletAddr=" + that.walletAddr, |
||||
}); |
||||
} |
||||
} else { |
||||
// uni.showToast({ |
||||
// title: "二维码错误", |
||||
// icon: "none", |
||||
// }); |
||||
} |
||||
}, |
||||
fail: function (res) { |
||||
// 扫码失败 |
||||
uni.showToast({ |
||||
title: that.tCommonToast.toast11, |
||||
icon: "none", |
||||
}); |
||||
}, |
||||
}); |
||||
// #endif |
||||
|
||||
// #ifdef H5 |
||||
uni.navigateTo({ |
||||
url: "../QRCodeReader/QRCodeReader", |
||||
}); |
||||
// #endif |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style> |
||||
</style> |
||||
@ -1,50 +0,0 @@ |
||||
<template> |
||||
<view class="null-box"> |
||||
<!-- <u-image |
||||
class="null-img" |
||||
mode="widthFix" |
||||
width="100%" |
||||
src="@/static/img/betone-sp-component/null.svg" |
||||
></u-image> |
||||
<view class="null-text">{{ nullText }}</view> --> |
||||
<u-empty :text="nullText" mode="list"></u-empty> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
export default { |
||||
name: "spNoData", |
||||
props: { |
||||
text: { |
||||
type: String, |
||||
default: "", |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
nullText: "", |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.nullText = this.text || '暂无数据'; |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.null-box { |
||||
width: 100%; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
.null-img { |
||||
width: 100%; |
||||
} |
||||
.null-text { |
||||
padding-top: 24rpx; |
||||
font-size: 32rpx; |
||||
font-family: PingFangSC-Medium, pingfang; |
||||
font-weight: 500; |
||||
color: #333333; |
||||
line-height: 44rpx; |
||||
} |
||||
} |
||||
</style> |
||||
Loading…
Reference in new issue