|
|
@@ -37,11 +37,32 @@
|
|
|
</nuxt-link>
|
|
|
</div>
|
|
|
<remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
|
|
|
+ <div class="listAlert" ref="userContent" v-show="wechatInfo.enterprises">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item, index) in wechatInfo.enterprises" @click="clickItem(item)">
|
|
|
+ {{item.enName}}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { RemindBox } from '~components/mobile/common'
|
|
|
+ import BScroll from 'better-scroll'
|
|
|
+ // 实现深拷贝
|
|
|
+ function deepCopy(target) {
|
|
|
+ if (typeof target !== 'object') return
|
|
|
+ // 判断目标类型,来创建返回值
|
|
|
+ var newObj = target instanceof Array ? [] : {}
|
|
|
+ for (var item in target) {
|
|
|
+ // 只复制元素自身的属性,不复制原型链上的
|
|
|
+ if (target.hasOwnProperty(item)) {
|
|
|
+ newObj[item] = typeof target[item] === 'object' ? deepCopy(target[item]) : target[item]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return newObj
|
|
|
+ }
|
|
|
export default {
|
|
|
name: 'wechatView',
|
|
|
layout: 'mobileNoHeader',
|
|
|
@@ -56,10 +77,32 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- let info = localStorage.getItem('USOFTMALLWECHATINFO')
|
|
|
- this.$store.commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', JSON.parse(info))
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let info = localStorage.getItem('USOFTMALLWECHATINFO')
|
|
|
+ this.$store.commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', JSON.parse(info))
|
|
|
+ if (this.BScroll) {
|
|
|
+ this.BScroll.refresh()
|
|
|
+ } else {
|
|
|
+ this.BScroll = new BScroll(this.$refs.userContent, {
|
|
|
+ click: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
+ clickItem(item) {
|
|
|
+ let userAccount = deepCopy(this.$store.state.option.wechatInfo.data.userAccount)
|
|
|
+ userAccount.spaceUU = item.uu
|
|
|
+ this.$http.get('/newLogin/other', {params: userAccount}).then(res => {
|
|
|
+ this.$store.dispatch('loadUserInfo').then(() => {
|
|
|
+ if (this.$route.query.url && this.$route.query.url !== '') {
|
|
|
+ this.$router.replace(this.$route.query.url)
|
|
|
+ } else {
|
|
|
+ this.goLastPage()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
telphoneBlur() {
|
|
|
this.telerror = false
|
|
|
if (!/^1[3|5|7|8]\d{9}$/.test(this.telphoneNum)) {
|
|
|
@@ -72,7 +115,8 @@
|
|
|
}
|
|
|
let openid = this.$store.state.option.wechatInfo.data.openid
|
|
|
this.$http.post('/wx/bindUser', {userTel: this.telphoneNum, userPwd: this.passwordNum, openId: openid}).then(res => {
|
|
|
- console.log(res)
|
|
|
+ this.$store.commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', res.data)
|
|
|
+ localStorage.setItem('USOFTMALLWECHATINFO', JSON.stringify(res.data))
|
|
|
})
|
|
|
},
|
|
|
resgiter() {
|
|
|
@@ -88,10 +132,15 @@
|
|
|
},
|
|
|
computed: {
|
|
|
userName() {
|
|
|
+ // return ''
|
|
|
return this.$store.state.option.wechatInfo.data.nickname
|
|
|
},
|
|
|
headerImg() {
|
|
|
+ // return ''
|
|
|
return this.$store.state.option.wechatInfo.data.headimgurl
|
|
|
+ },
|
|
|
+ wechatInfo() {
|
|
|
+ return this.$store.state.option.wechatInfo.data
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -266,5 +315,21 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .listAlert {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: #fff;
|
|
|
+ padding: 0 0.2rem;
|
|
|
+ overflow: hidden;
|
|
|
+ z-index: 10000;
|
|
|
+ li {
|
|
|
+ line-height: 0.98rem;
|
|
|
+ height: 0.98rem;
|
|
|
+ border-bottom: 1px solid #dedede;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|