morePage.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view>
  3. <view class="morePages">
  4. <view class="list-box" v-if="$hasPermissions('M_stockQueryList_mini')||$hasPermissions('M_stockPut_mini')">
  5. <view class="list-title">
  6. <u-icon size="38" name="bag"></u-icon> <text>货品管理</text>
  7. </view>
  8. <u-cell-group :border="false">
  9. <u-cell-item title="库存查询" v-if="$hasPermissions('M_stockQueryList_mini')" @click="toPage('/pages/stockQuery/stockQuery')" :title-style="{fontSize:'1em'}">
  10. <text slot="icon"></text>
  11. </u-cell-item>
  12. <u-cell-item title="补货记录" v-if="$hasPermissions('M_stockPut_mini')" @click="toPage('/pages/digitalShelf/stockPut')" :title-style="{fontSize:'1em'}">
  13. <text slot="icon"></text>
  14. </u-cell-item>
  15. </u-cell-group>
  16. </view>
  17. <view class="list-box" v-if="$hasPermissions('M_shelfOrder_mini')||$hasPermissions('M_tempShelfOrder_mini')">
  18. <view class="list-title">
  19. <u-icon size="34" name="order"></u-icon> <text>订单管理</text>
  20. </view>
  21. <u-cell-group :border="false">
  22. <u-cell-item title="货架订单" v-if="$hasPermissions('M_shelfOrder_mini')" @click="toPage('/pages/digitalShelf/orderList')" :title-style="{fontSize:'1em'}">
  23. <text slot="icon"></text>
  24. </u-cell-item>
  25. <u-cell-item title="急送订单" v-if="$hasPermissions('M_tempShelfOrder_mini')" @click="toPage('/pages/digitalShelf/tempOrderList/tempOrderList')" :title-style="{fontSize:'1em'}">
  26. <text slot="icon"></text>
  27. </u-cell-item>
  28. </u-cell-group>
  29. </view>
  30. <view class="list-box" v-if="$hasPermissions('M_settlementRecord_mini')||$hasPermissions('M_settlementManage_mini')">
  31. <view class="list-title">
  32. <u-icon size="36" name="rmb-circle"></u-icon> <text>结算管理</text>
  33. </view>
  34. <u-cell-group :border="false">
  35. <u-cell-item title="结算记录" v-if="$hasPermissions('M_settlementRecord_mini')" @click="toPage('/pages/digitalShelf/settlementRecord/settlementRecord')" :title-style="{fontSize:'1em'}">
  36. <text slot="icon"></text>
  37. </u-cell-item>
  38. <u-cell-item title="付款结算" v-if="$hasPermissions('M_settlementManage_mini')" @click="toPage('/pages/digitalShelf/settlementManage/settlementManage')" :title-style="{fontSize:'1em'}">
  39. <text slot="icon"></text>
  40. </u-cell-item>
  41. </u-cell-group>
  42. </view>
  43. <view class="list-box" v-if="$hasPermissions('M_employee_mini')||$hasPermissions('M_roleSetting_mini')||$hasPermissions('M_priceShow_mini')">
  44. <view class="list-title">
  45. <u-icon size="32" name="home"></u-icon> <text>基础设置</text>
  46. </view>
  47. <u-cell-group :border="false">
  48. <u-cell-item title="员工管理" v-if="$hasPermissions('M_employee_mini')" @click="toPage('/pages/storeManage/personnel')" :title-style="{fontSize:'1em'}">
  49. <text slot="icon"></text>
  50. </u-cell-item>
  51. </u-cell-group>
  52. <u-cell-group :border="false">
  53. <u-cell-item title="岗位权限" v-if="$hasPermissions('M_roleSetting_mini')" @click="toPage('/pages/storeManage/roleSetting/roleSetting')" :title-style="{fontSize:'1em'}">
  54. <text slot="icon"></text>
  55. </u-cell-item>
  56. </u-cell-group>
  57. <u-cell-group :border="false">
  58. <u-cell-item title="价格显示设置" v-if="$hasPermissions('M_priceShow_mini')" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
  59. <text slot="icon"></text>
  60. </u-cell-item>
  61. </u-cell-group>
  62. </view>
  63. <view class="list-box" v-if="hasLogin&&dealerPhone">
  64. <view class="list-title flex justify_center phone" @click="call">
  65. <u-icon size="36" name="phone"></u-icon> <text>联系汽配商</text>
  66. </view>
  67. </view>
  68. <view class="list-box" v-if="hasLogin">
  69. <view class="list-title flex justify_center phone" @click="quitOut">
  70. <text>退出登录</text>
  71. </view>
  72. </view>
  73. <!-- 去认证 -->
  74. <u-popup v-model="showPopup" mode="center" :border-radius="20" closeable>
  75. <view style="background-color: #fff;padding: 1rem;">
  76. <u-image width="533" height="415" src="/static/authimg.jpg"></u-image>
  77. <view style="padding-top:1rem;" class="flex justify_center">
  78. <u-button @click="toAuthStore()" shape="circle" :custom-style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</u-button>
  79. </view>
  80. </view>
  81. </u-popup>
  82. </view>
  83. <u-tabbar :list="vuex_tabBarList" :before-switch="beforeSwitch" :mid-button="true"></u-tabbar>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. mapState,
  89. mapMutations
  90. } from 'vuex'
  91. export default {
  92. data() {
  93. return {
  94. dealerPhone: null,
  95. showPopup: false
  96. }
  97. },
  98. computed: {
  99. ...mapState(['hasLogin','vuex_vinScanNums','vuex_scanMaxNums','vuex_tabBarList']),
  100. hasShelf(){
  101. return !!this.$store.state.vuex_storeShelf
  102. },
  103. userInfo(){
  104. return this.$store.state.vuex_userInfo
  105. },
  106. storeApply(){
  107. return this.$store.state.vuex_storeAuthInfo
  108. }
  109. },
  110. onShow() {
  111. const shelfInfo = this.$store.state.vuex_storeShelf
  112. this.dealerPhone = shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
  113. },
  114. methods: {
  115. beforeSwitch(index){
  116. if(index==1){
  117. this.openCamera()
  118. }else{
  119. return true
  120. }
  121. },
  122. // 去扫描
  123. openCamera(){
  124. if(this.hasLogin){
  125. if(this.userInfo.sysUserFlag == '0'){
  126. if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
  127. uni.navigateTo({
  128. url: "/pages/scan-frame/scan-frame"
  129. })
  130. }else{
  131. uni.showModal({
  132. title: '提示',
  133. content: '个人用户扫描VIN仅限10次,您的次数已用完!',
  134. confirmText: '好的',
  135. showCancel: false,
  136. success(res) {}
  137. })
  138. }
  139. }else{
  140. uni.navigateTo({
  141. url: "/pages/scan-frame/scan-frame"
  142. })
  143. }
  144. }else{
  145. uni.navigateTo({
  146. url: '/pages/login/login'
  147. })
  148. }
  149. },
  150. toPage(path){
  151. const _this = this
  152. if(this.hasLogin){
  153. // 游客未认证
  154. if(this.userInfo.sysUserFlag == '0'){
  155. if(this.storeApply&&this.storeApply.auditStatus=='WAIT'){
  156. uni.showModal({
  157. title: '提示',
  158. content: '门店认证资料审核中,请耐心等待!',
  159. confirmText: '知道了',
  160. showCancel: false
  161. })
  162. }
  163. // 如果审核已通过
  164. else if(this.storeApply&&this.storeApply.auditStatus=='PASS'){
  165. uni.showModal({
  166. title: '提示',
  167. content: '门店认证审核已通过,请重新登录!',
  168. confirmText: '去登录',
  169. showCancel: false,
  170. success() {
  171. _this.$store.dispatch('userLogout');
  172. uni.redirectTo({
  173. url: '/pages/login/login'
  174. });
  175. }
  176. })
  177. }else{
  178. this.showPopup = true
  179. }
  180. }else{
  181. // 已有数字货架
  182. if(this.hasShelf){
  183. uni.navigateTo({
  184. url: path
  185. })
  186. }else{
  187. uni.showToast({
  188. icon:'none',
  189. title: '门店没有关联数字货架,无法使用此功能!'
  190. })
  191. }
  192. }
  193. }else{
  194. uni.navigateTo({
  195. url: '/pages/login/login'
  196. })
  197. }
  198. },
  199. toAuthStore(){
  200. this.showPopup = false
  201. uni.navigateTo({
  202. url: '/pages/storeManage/storeAuth'
  203. })
  204. },
  205. call(){
  206. this.callPhone(this.dealerPhone)
  207. },
  208. quitOut(){
  209. let _this = this
  210. uni.showModal({
  211. title: '提示',
  212. content: '确定退出登录吗?',
  213. success: (ret) => {
  214. if(ret.confirm){
  215. _this.$store.dispatch('userLogout');
  216. uni.navigateTo({
  217. url: '/pages/login/login'
  218. });
  219. }
  220. }
  221. })
  222. }
  223. }
  224. }
  225. </script>
  226. <style lang="less">
  227. .morePages{
  228. width: 100%;
  229. padding: 30rpx;
  230. background-image: linear-gradient(#86defa 0%,#cdeff9 20%,#f8f8f8 30%);
  231. .list-box{
  232. background: #ffffff;
  233. margin-bottom: 30rpx;
  234. border-radius: 25rpx;
  235. overflow: hidden;
  236. box-shadow: 2rpx 2rpx 5rpx #eee;
  237. .list-title{
  238. padding:30rpx 20rpx;
  239. font-size: 30rpx;
  240. border-bottom: 2rpx solid #f8f8f8;
  241. > text{
  242. margin-left: 10rpx;
  243. }
  244. }
  245. &:first-child{
  246. box-shadow: 2rpx 2rpx 5rpx #cdeff9;
  247. }
  248. }
  249. .phone{
  250. color: #00aaff;
  251. &:active{
  252. opacity: 0.8;
  253. transform:scale(0.9);
  254. }
  255. }
  256. }
  257. </style>