index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view class="storemanagement">
  3. <view class="storemanagement-header">
  4. <view class="storemanagement-header-text">
  5. 服务中心
  6. </view>
  7. <view class="storemanagement-list">
  8. <view class="storemanagement-list-yi" v-for="(item,index) in mnu" :key="index" @click="jinru(item.pages,item.name)" v-if="item.show">
  9. <view class="storemanagement-list-yi-text">
  10. {{item.name}}
  11. </view>
  12. <view class="storemanagement-list-yi-image">
  13. <image :src="item.url" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="listadd-annkiu" @click="logoutAction" v-if="uid">
  18. 退出登录
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { emConnect } from '@/EaseIM/emApis';
  25. import readAppInfo from '@/utils/readAppInfo.js';
  26. const { loginWithPassword,closeEaseIM } = emConnect();
  27. export default {
  28. data() {
  29. return {
  30. mnu: [{
  31. name: "分润设置",
  32. url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161807687.png",
  33. pages:"/shop/services/setting",
  34. show:true,
  35. id: "3",
  36. },
  37. {
  38. name: "我的音响",
  39. url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161749139.png",
  40. pages:"/shop/services/mystereo",
  41. show:true,
  42. id: "0",
  43. },
  44. {
  45. name: "锁定用户",
  46. url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161733260.png",
  47. pages:"/shop/services/lockuser",
  48. show:true,
  49. id: "0",
  50. }
  51. ],
  52. uid: '',
  53. authorization: ''
  54. }
  55. },
  56. async onLoad() {
  57. console.log('进了我的页面了')
  58. // uni.showLoading({
  59. // title: '加载中',
  60. // mask: true
  61. // });
  62. await readAppInfo();
  63. let jurisdiction = uni.getStorageSync('jurisdiction')
  64. console.log('jurisdiction', jurisdiction)
  65. let mnuList = this.mnu
  66. if (jurisdiction!=null) {
  67. jurisdiction.forEach((res, index) => {
  68. mnuList.forEach((result, i) => {
  69. if (res == result.id) {
  70. result.show = true
  71. }
  72. return result
  73. })
  74. return res
  75. })
  76. this.mnu = mnuList
  77. }
  78. console.log(this.mnu)
  79. setTimeout(function() {
  80. uni.hideLoading();
  81. }, 700);
  82. console.log('我的show===>>>>>>')
  83. this.authorization = uni.getStorageSync('authorization')
  84. let userinfo = uni.getStorageSync('userinfo')
  85. this.uid = userinfo.uid
  86. console.log('onshow')
  87. let authorization = uni.getStorageSync('authorization')
  88. // let userinfo = uni.getStorageSync('userinfo')
  89. let selectmerchant = uni.getStorageSync('selectmerchant')
  90. let uid = userinfo.uid
  91. console.log(selectmerchant, authorization, userinfo)
  92. if (authorization && uid) {
  93. if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
  94. uni.redirectTo({
  95. url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
  96. });
  97. return
  98. } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
  99. return
  100. } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
  101. uni.redirectTo({
  102. url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
  103. });
  104. return
  105. } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
  106. uni.redirectTo({
  107. url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
  108. });
  109. return
  110. } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
  111. uni.redirectTo({
  112. url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
  113. });
  114. return
  115. }
  116. }
  117. },
  118. onShow() {
  119. return;
  120. // 以下逻辑在onload处理
  121. this.authorization = uni.getStorageSync('authorization')
  122. let userinfo = uni.getStorageSync('userinfo')
  123. this.uid = userinfo.uid
  124. let authorization = uni.getStorageSync('authorization')
  125. // let userinfo = uni.getStorageSync('userinfo')
  126. let selectmerchant = uni.getStorageSync('selectmerchant')
  127. let uid = userinfo.uid
  128. console.log(selectmerchant, authorization, userinfo)
  129. if (authorization && uid) {
  130. if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
  131. uni.redirectTo({
  132. url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
  133. });
  134. return
  135. } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
  136. return
  137. } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
  138. uni.redirectTo({
  139. url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
  140. });
  141. return
  142. } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
  143. uni.redirectTo({
  144. url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
  145. });
  146. return
  147. } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
  148. uni.redirectTo({
  149. url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
  150. });
  151. return
  152. }
  153. }
  154. },
  155. methods: {
  156. // 退出登录
  157. logoutAction(){
  158. uni.removeStorageSync('userinfo');//清除用户信息
  159. uni.removeStorageSync('authorization');//清除authorization
  160. uni.removeStorageSync('selectmerchant');//清除商户数据
  161. uni.removeStorageSync('storeStaff');//部门id对应权限
  162. uni.removeStorageSync('jurisdiction');//管理员状态
  163. uni.removeStorageSync('mer_id');//环信和项目连接的id,登录环信需要
  164. //断开连接
  165. closeEaseIM();
  166. // this.$store.commit('SET_PIN_CONVERSATION_LIST', []);
  167. this.authorization = ''
  168. this.uid = ''
  169. uni.showToast({
  170. title: "退出成功",
  171. icon: "none"
  172. })
  173. // setTimeout(function() {
  174. // uni.redirectTo({
  175. // url: "/pages/user/login/index"
  176. // });
  177. // }, 700);
  178. },
  179. jinru(n,p){
  180. let name = p
  181. let page = n
  182. if(name=="分润设置") {
  183. let authorization = uni.getStorageSync('authorization')
  184. let userinfo = uni.getStorageSync('userinfo')
  185. let selectmerchant = uni.getStorageSync('selectmerchant')
  186. let uid = userinfo.uid
  187. if (authorization && uid) {
  188. if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
  189. uni.redirectTo({
  190. url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
  191. });
  192. return
  193. } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
  194. uni.redirectTo({
  195. url:page
  196. })
  197. return
  198. } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
  199. uni.redirectTo({
  200. url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
  201. });
  202. return
  203. } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
  204. uni.redirectTo({
  205. url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
  206. });
  207. return
  208. } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
  209. uni.redirectTo({
  210. url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
  211. });
  212. return
  213. }
  214. } else {
  215. uni.navigateTo({
  216. url: "/pages/user/login/index?type=1"
  217. });
  218. return
  219. }
  220. }else if(name=="锁定用户"){
  221. uni.redirectTo({
  222. url:page
  223. })
  224. }else{
  225. uni.redirectTo({
  226. url:page
  227. })
  228. }
  229. }
  230. }
  231. }
  232. </script>
  233. <style>
  234. page {
  235. background-color: #F7F8FC;
  236. }
  237. </style>
  238. <style lang="scss" scoped>
  239. .storemanagement {
  240. width: 100%;
  241. height: 100%;
  242. display: flex;
  243. flex-direction: column;
  244. align-items: center;
  245. .storemanagement-header {
  246. width: 100%;
  247. height: 328rpx;
  248. background: linear-gradient(180deg, rgba(31, 124, 255, 0.2200) 0%, rgba(255, 255, 255, 0.1500) 100%);
  249. position: relative;
  250. display: flex;
  251. justify-content: center;
  252. .storemanagement-header-text {
  253. position: absolute;
  254. font-size: 46rpx;
  255. font-weight: 500;
  256. color: #333333;
  257. top: 202rpx;
  258. left: 64rpx;
  259. }
  260. .storemanagement-list {
  261. width: 690rpx;
  262. height: 262rpx;
  263. position: absolute;
  264. top: 298rpx;
  265. display: flex;
  266. flex-flow: wrap;
  267. justify-content: space-between;
  268. .storemanagement-list-yi {
  269. margin-bottom: 26rpx;
  270. width: 330rpx;
  271. height: 118rpx;
  272. background: #FFFFFF;
  273. border-radius: 8rpx;
  274. display: flex;
  275. justify-content: space-around;
  276. align-items: center;
  277. .storemanagement-list-yi-text {
  278. font-size: 26rpx;
  279. font-weight: 500;
  280. color: #333333;
  281. }
  282. .storemanagement-list-yi-image {
  283. width: 92rpx;
  284. height: 92rpx;
  285. image {
  286. width: 100%;
  287. height: 100%;
  288. }
  289. }
  290. }
  291. }
  292. }
  293. .listadd-annkiu {
  294. width: 686rpx;
  295. height: 98rpx;
  296. background: #1F7CFF;
  297. border-radius: 8rpx;
  298. position: fixed;
  299. bottom: 26rpx;
  300. font-size: 36rpx;
  301. font-weight: 400;
  302. color: #FFFFFF;
  303. text-align: center;
  304. line-height: 98rpx;
  305. }
  306. }
  307. </style>