index.vue 10 KB

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