morePage.vue 9.8 KB

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