| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <template>
- <view :style="vuex_skin">
- <!-- #ifdef MP-WEIXIN -->
- <u-navbar title-color="#000000" :is-back="true" title="设置"></u-navbar>
- <!-- #endif -->
- <u-cell-group>
- <u-cell-item v-for="(item,index) in menuList" :key="index" @click="jump(item)" :icon="item.icon"
- :title="item.title"></u-cell-item>
- </u-cell-group>
- <view v-if="vuex_userId" class="center" style="margin-top: 200rpx;">
- <button @click="logout" class="cu-btn flex text-lg bg-base radius" style="padding: 42rpx 0;width: 90%;">
- 退出登录
- </button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- menuList: [{
- icon: 'question-circle',
- title: '积分兑换规则', //显示的title
- name: '积分规则', //对应后端获取数据的title
- path: '/pages/introduce/notice'
- },
- {
- icon: 'bookmark',
- title: '用户隐私协议',
- name: '用户隐私协议',
- path: '/pages/introduce/notice'
- }
- ]
- }
- },
- onLoad() {
- // #ifdef MP-WEIXIN
- let obj = {
- icon: 'account',
- title: '用户授权设置',
- path: ''
- }
- this.menuList.push(obj)
- // #endif
- },
- methods: {
- jump(item) {
- if (item.title == '用户授权设置') {
- uni.openSetting({
- success(res) {
- console.log(res.authSetting)
- }
- });
- return
- }
- let params = {
- title: item.name,
- }
- if (item.name=='用户隐私协议') {
- params.isGlobal=true
- }
- uni.navigateTo({
- url: item.path + this.$u.queryParams(params)
- })
- },
- logout() {
- this.$cache.clear()
- this.$u.vuex('vuex_userId', null)
- this.$u.vuex('vuex_phone', null)
- this.$u.vuex('vuex_gzh_userOpenid', null)
- uni.reLaunch({
- url: "/pages/mine/mine"
- })
- },
- }
- }
- </script>
- <style>
- </style>
|