Commit 2ca5b3a8 authored by Smile's avatar Smile Committed by wux

app会员升级提示

parent 64a46cdb
...@@ -145,6 +145,22 @@ ...@@ -145,6 +145,22 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="updatePopup" type="center" :mask-click="false">
<view class="ad-conten">
<image @click="closeAd" class="ad-bg" src="../../static/img/index_close.png"></image>
<view class="ad-title">{{ this.levelTitle }}</view>
<view class="ad-info">
<rich-text
:nodes="this.levelLeviteInfo"
></rich-text>
</view>
<view class="ad-btns">
<view class="ad-btn" @click="closeUpdate">
<view>{{ $lang.lang.index.know }}</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="choiceTransport" type="center" :mask-click="false"> <uni-popup ref="choiceTransport" type="center" :mask-click="false">
<view class="ad-conten type-1"> <view class="ad-conten type-1">
<image @click="closeTransport" class="ad-bg1" src="../../static/img/colse1.png"></image> <image @click="closeTransport" class="ad-bg1" src="../../static/img/colse1.png"></image>
...@@ -193,6 +209,7 @@ ...@@ -193,6 +209,7 @@
<script> <script>
import md5 from 'js-md5' import md5 from 'js-md5'
import {parseTime} from "@/utils";
export default { export default {
data() { data() {
...@@ -228,6 +245,10 @@ export default { ...@@ -228,6 +245,10 @@ export default {
statusData: [], statusData: [],
name: {}, name: {},
adData: {}, adData: {},
updateAdData: {},
membershipLevels:[],
levelLeviteInfo:'',
levelTitle:'',
noticeData: [], noticeData: [],
msgHave: false, msgHave: false,
version: '1.0.2', version: '1.0.2',
...@@ -244,6 +265,9 @@ export default { ...@@ -244,6 +265,9 @@ export default {
searchKey: '' //搜索关键词 searchKey: '' //搜索关键词
} }
}, },
created() {
this.getMembershipLevels()
},
onLoad(options) { onLoad(options) {
this.getIdcard() this.getIdcard()
this.getStatusData() this.getStatusData()
...@@ -263,6 +287,14 @@ export default { ...@@ -263,6 +287,14 @@ export default {
} }
}, },
methods: { methods: {
//获取等级列表
getMembershipLevels () {
this.$request.getConfig('membership_levels').then(res => {
if(res.code==0&&res.data&&res.data.list.length>0){
this.membershipLevels = res.data.list
}
})
},
toupdate() { toupdate() {
let that = this let that = this
if (that.showdownLine) return if (that.showdownLine) return
...@@ -356,6 +388,7 @@ export default { ...@@ -356,6 +388,7 @@ export default {
getUserInfo() { getUserInfo() {
let that = this let that = this
that.$request.get('/app-api/member/user/get').then((res) => { that.$request.get('/app-api/member/user/get').then((res) => {
let userInfo = res.data
console.log(res.data) console.log(res.data)
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
if (res.data.isSimplePassword) { if (res.data.isSimplePassword) {
...@@ -371,6 +404,7 @@ export default { ...@@ -371,6 +404,7 @@ export default {
}) })
} else if (!that.preLoginPage) { } else if (!that.preLoginPage) {
that.openAd() that.openAd()
that.getUpdateOpenAd(userInfo)
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (that.appVersion) { if (that.appVersion) {
that.openVe() that.openVe()
...@@ -381,6 +415,7 @@ export default { ...@@ -381,6 +415,7 @@ export default {
}) })
} else if (!that.preLoginPage) { } else if (!that.preLoginPage) {
that.openAd() that.openAd()
this.getUpdateOpenAd(userInfo)
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (that.appVersion) { if (that.appVersion) {
that.openVe() that.openVe()
...@@ -395,6 +430,51 @@ export default { ...@@ -395,6 +430,51 @@ export default {
} }
}) })
}, },
getUpdateOpenAd: function (data) {
//获取存储的会员等级信息
const levelRule = uni.getStorageSync('levelRule');
const user=data;
const params = {
memberId: data.id,
pageNo: 1,
pageSize: 10
}
let levelRule1 = '';
const that = this;
this.$request.post('/admin-api/member/level-details/page',params).then((res) => {
levelRule1 = res.data.list[0];
if (levelRule1!=null){
//升级展示 获取升级提示
this.$request.get('/app-api/system/need-know/getByKey',{key:'levelUpdate'}).then(res => {
if(res.code == 0 && res.data){
levelRule1.username=user.nickname;
const level = that.membershipLevels.find(
level => level.value === levelRule1.level.toString()
);
if (level) {
levelRule1.levelName = level[this.$lang.label];
}
levelRule1.validityPeriod=parseTime(levelRule1.validityPeriod,'{y}-{m}-{d}')
this.levelTitle=res.data[this.$lang.title]
this.levelLeviteInfo=this.replaceContent(res.data[this.$lang.content],levelRule1);
if (!levelRule){
//提示升级
this.$refs.updatePopup.open()
}else if ((levelRule1.level>levelRule.level)||(levelRule1.level==levelRule.level&&levelRule1.sort>levelRule.sort)){
//提示升级
}
}
})
uni.setStorageSync('levelRule', levelRule1);
}
})
},
replaceContent(content,levelRule){
return content.replace(/{(\w+)}/g, function(match, key) {
return levelRule[key] !== undefined ? levelRule[key] : match;
});
},
getOrder() { getOrder() {
this.$request.get('/app-api/member/user/angle-mark').then((res) => { this.$request.get('/app-api/member/user/angle-mark').then((res) => {
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
...@@ -433,6 +513,9 @@ export default { ...@@ -433,6 +513,9 @@ export default {
this.preLoginPage = false this.preLoginPage = false
this.$refs.adpopup.close() this.$refs.adpopup.close()
}, },
closeUpdate() {
this.$refs.updatePopup.close()
},
closeTransport() { closeTransport() {
this.$refs.choiceTransport.close() this.$refs.choiceTransport.close()
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment