| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- <template>
- <view class="storemanagement">
- <view class="storemanagement-header">
- <view class="storemanagement-header-text">
- 服务中心
- </view>
- <view class="storemanagement-list">
- <view class="storemanagement-list-yi" v-for="(item,index) in mnu" :key="index" @click="jinru(item.pages,item.name)" v-if="item.show">
- <view class="storemanagement-list-yi-text">
- {{item.name}}
- </view>
- <view class="storemanagement-list-yi-image">
- <image :src="item.url" mode="widthFix"></image>
- </view>
- </view>
- </view>
- <view class="listadd-annkiu" @click="logoutAction" v-if="uid && false">
- 退出登录
- </view>
- </view>
- </view>
- </template>
-
- <script>
- import { emConnect } from '@/EaseIM/emApis';
- import readAppInfo ,{getPhpToken}from '@/utils/readAppInfo.js';
- const { loginWithPassword,closeEaseIM } = emConnect();
- export default {
- data() {
- return {
- mnu: [
- {
- name: "分润设置",
- url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161807687.png",
- pages:"/shop/services/setting",
- show:true,
- id: "3",
- },
- // {
- // name: "我的音响",
- // url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161749139.png",
- // pages:"/shop/services/mystereo",
- // show:true,
- // id: "0",
- // },
- // {
- // name: "锁定用户",
- // url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161733260.png",
- // pages:"/shop/services/lockuser",
- // show:true,
- // id: "0",
- // },
- // {
- // name: "商品管理",
- // url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161733260.png",
- // pages:"/shop/productManagementModule/productManagement",
- // show:true,
- // id: "0",
- // }
- // {
- // name: "在线选品",
- // url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161733260.png",
- // pages:"/pages/onlineproductselection/onlineproductselection",
- // show:true,
- // id: "0",
- // }
- ],
- uid: '',
- authorization: ''
- }
- },
- async onLoad() {
- console.log('进了我的页面了')
- // uni.showLoading({
- // title: '加载中',
- // mask: true
- // });
-
- await readAppInfo();
- await getPhpToken()
- let jurisdiction = uni.getStorageSync('jurisdiction')
-
- console.log('jurisdiction', jurisdiction)
- let mnuList = this.mnu
- if (jurisdiction) {
- jurisdiction.forEach((res, index) => {
- mnuList.forEach((result, i) => {
- if (res == result.id) {
- result.show = true
- }
- return result
- })
- return res
- })
- this.mnu = mnuList
- }
-
- console.log(this.mnu)
-
- setTimeout(function() {
- uni.hideLoading();
- }, 700);
-
-
- console.log('我的show===>>>>>>')
-
-
- this.authorization = uni.getStorageSync('authorization')
- let userinfo = uni.getStorageSync('userinfo')
- this.uid = userinfo.uid
- console.log('onshow')
-
- let authorization = uni.getStorageSync('authorization')
- // let userinfo = uni.getStorageSync('userinfo')
- let selectmerchant = uni.getStorageSync('selectmerchant')
- let uid = userinfo.uid
- console.log(selectmerchant, authorization, userinfo)
- if (authorization && uid) {
- if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
- uni.redirectTo({
- url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
- });
- return
- } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
-
- return
- } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
- });
- return
- } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
- });
- return
- } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
- });
- return
- }
-
- }
- },
- onShow() {
- return;
-
- // 以下逻辑在onload处理
-
- this.authorization = uni.getStorageSync('authorization')
- let userinfo = uni.getStorageSync('userinfo')
- this.uid = userinfo.uid
-
- let authorization = uni.getStorageSync('authorization')
- // let userinfo = uni.getStorageSync('userinfo')
- let selectmerchant = uni.getStorageSync('selectmerchant')
- let uid = userinfo.uid
- console.log(selectmerchant, authorization, userinfo)
- if (authorization && uid) {
- if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
- uni.redirectTo({
- url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
- });
- return
- } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
-
- return
- } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
- });
- return
- } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
- });
- return
- } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
- });
- return
- }
-
- }
-
-
- },
- methods: {
- // 退出登录
- logoutAction(){
- uni.removeStorageSync('userinfo');//清除用户信息
- uni.removeStorageSync('authorization');//清除authorization
- uni.removeStorageSync('selectmerchant');//清除商户数据
- uni.removeStorageSync('storeStaff');//部门id对应权限
- uni.removeStorageSync('jurisdiction');//管理员状态
- uni.removeStorageSync('mer_id');//环信和项目连接的id,登录环信需要
- //断开连接
- closeEaseIM();
- // this.$store.commit('SET_PIN_CONVERSATION_LIST', []);
- this.authorization = ''
- this.uid = ''
-
-
-
- uni.showToast({
- title: "退出成功",
- icon: "none"
- })
- // setTimeout(function() {
- // uni.redirectTo({
- // url: "/pages/user/login/index"
- // });
- // }, 700);
- },
- jinru(n,p){
- let name = p
- let page = n
- if(name=="分润设置") {
- let authorization = uni.getStorageSync('authorization')
- let userinfo = uni.getStorageSync('userinfo')
- let selectmerchant = uni.getStorageSync('selectmerchant')
- let uid = userinfo.uid
- if (authorization && uid) {
- if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
- uni.redirectTo({
- url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
- });
- return
- } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
- uni.redirectTo({
- url:page
- })
- return
- } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
- });
- return
- } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
- });
- return
- } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
- uni.redirectTo({
- url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
- });
- return
- }
-
- } else {
- uni.navigateTo({
- url: "/pages/user/login/index?type=1"
- });
- return
- }
-
- }else if(name=="锁定用户"){
- uni.redirectTo({
- url:page
- })
- }else{
- uni.redirectTo({
- url:page
- })
- }
- }
- }
- }
- </script>
- <style>
- page {
- background-color: #F7F8FC;
- }
- </style>
- <style lang="scss" scoped>
- .storemanagement {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
-
- .storemanagement-header {
- width: 100%;
- height: 328rpx;
- background: linear-gradient(180deg, rgba(31, 124, 255, 0.2200) 0%, rgba(255, 255, 255, 0.1500) 100%);
- position: relative;
- display: flex;
- justify-content: center;
-
- .storemanagement-header-text {
- position: absolute;
- font-size: 46rpx;
- font-weight: 500;
- color: #333333;
- top: 60rpx;
- left: 64rpx;
- }
-
- .storemanagement-list {
- width: 690rpx;
- height: 262rpx;
- position: absolute;
- top: 298rpx;
- display: flex;
- flex-flow: wrap;
- justify-content: space-between;
-
- .storemanagement-list-yi {
- margin-bottom: 26rpx;
- width: 330rpx;
- height: 118rpx;
- background: #FFFFFF;
- border-radius: 8rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
-
- .storemanagement-list-yi-text {
- font-size: 26rpx;
- font-weight: 500;
- color: #333333;
- }
-
- .storemanagement-list-yi-image {
- width: 92rpx;
- height: 92rpx;
-
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- }
- .listadd-annkiu {
- width: 686rpx;
- height: 98rpx;
- background: #1F7CFF;
- border-radius: 8rpx;
- position: fixed;
- bottom: 150rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #FFFFFF;
- text-align: center;
- line-height: 98rpx;
- }
- }
- </style>
|