morePage.vue 8.4 KB

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