Commit feed6cf5 by 李嘉林

新增会员码页面

parent d0e1fb2a
......@@ -14,7 +14,8 @@
"pages/tabBar4/main",
"pages/changeAdr/main",
"pages/downFile/main",
"pages/wxArticle/main"
"pages/wxArticle/main",
"pages/memberCode/main"
],
"subPackages": [
{
......
......@@ -184,7 +184,14 @@ wx.onAppRoute(res => {
}
if (!userId) { // 防止多次调用
// 获取当前用户 id
live.getUserInfo().then(res => { userId = res.data.data?res.data.data.userId:''})
live.getUserInfo().then(res => {
if (res.data.code == 200) {
wx.setStorageSync('loginUserInfo',res.data.data ? res.data.data : {})
console.log(Store.state.loginUserInfo.mobilephone,'--------------mobilephone---1')
userId = res.data.data ? res.data.data.userId : ''
}
})
}
userId && resolve()
}).then(() => {
......
// 会员码
<template>
<div class="memberCode">
<div class="main">
<div class="title flex">
<i class="iconfont icon-saomiaochenggong"></i>
<p>向商家展示会员码</p>
</div>
<div class="codeMain">
<!-- 条形码 -->
<div class="barCode">
</div>
<!-- 二维码 -->
<div class="qrCode">
</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: "memberCode",
data() {
return {
mobilephone: "",
getStep: 0,
};
},
components: {},
computed: {},
created() {
this.getSync();
},
mounted() {},
methods: {
// 获取缓存用户信息
getSync() {
if(this.getStep>10) return;
this.getStep++;
let loginUserInfo = wx.getStorageSync('loginUserInfo') || null;
if((loginUserInfo&& loginUserInfo.mobilephone) && !this.mobilephone) {
this.mobilephone = loginUserInfo.mobilephone
this.getStep = 0;
this.init();
} else {
setTimeout(() => {
this.getSync();
}, 200);
}
},
init() {
console.log("开始初始化")
}
},
};
</script>
<style lang="scss" scoped>
.memberCode {
width: 100vw;
height: 100vh;
background: #F3F3F3;
overflow: auto;
.main{
margin: 20px 12px;
background: #fff;
}
.title{
align-items: center;
padding: 16px 20px;
color: #666;
background: #FAFAFA;
font-size: 14px;
.iconfont{
font-size: 12px;
color: #333;
margin-right: 10px;
}
}
.codeMain{
padding: 20px 26px;
background: #fff;
}
}
</style>
import Vue from 'vue'
import App from './index'
const app = new Vue(App)
app.$mount()
{
"usingComponents": {
},
"navigationBarTitleText":"会员码",
"enablePullDownRefresh":false,
"backgroundColor":"#f5f5f5"
}
@font-face {
font-family: "iconfont"; /* Project id 1026419 */
src: url('//at.alicdn.com/t/font_1026419_8w19e9hrgtx.woff2?t=1636266763463') format('woff2'),
url('//at.alicdn.com/t/font_1026419_8w19e9hrgtx.woff?t=1636266763463') format('woff'),
url('//at.alicdn.com/t/font_1026419_8w19e9hrgtx.ttf?t=1636266763463') format('truetype');
src: url('//at.alicdn.com/t/font_1026419_paqabdn5xg.woff2?t=1650782206586') format('woff2'),
url('//at.alicdn.com/t/font_1026419_paqabdn5xg.woff?t=1650782206586') format('woff'),
url('//at.alicdn.com/t/font_1026419_paqabdn5xg.ttf?t=1650782206586') format('truetype');
}
.iconfont {
......@@ -13,6 +13,26 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-saomiaochenggong:before {
content: "\e737";
}
.icon-fuzhi:before {
content: "\e6a1";
}
.icon-wancheng:before {
content: "\e69d";
}
.icon-shizhong1:before {
content: "\e69f";
}
.icon-quxiao1:before {
content: "\e6a0";
}
.icon-gantanhao:before {
content: "\e69a";
}
......
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