index.vue 10.0 KB

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