morePage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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('/pagesB/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="hasLogin&&$hasPermissions('M_couponList_mini')">
  13. <view class="list-title flex align_center justify_between" @click="toPage('/pagesB/coupon')">
  14. <view><u-icon size="34" color="#ff7d0b" name="gift-fill"></u-icon> <text style="color: #ff7d0b;margin-left: 10rpx;">我的优惠券</text></view>
  15. <view>
  16. <u-icon size="28" color="#969799" name="arrow-right"></u-icon>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 网格图标 -->
  21. <view class="list-box" v-for="item in itemList" :key="item.id">
  22. <view class="list-title">
  23. <u-icon size="35" :name="item.icon"></u-icon> <text>{{item.text}}</text>
  24. </view>
  25. <view class="list-body">
  26. <uni-grid :column="item.column" :highlight="true" :show-border="false" :square="false" @change="e=>openPage(e,item.child)">
  27. <uni-grid-item v-for="(sub, idx) in item.child" :index="idx" :key="idx">
  28. <view class="grid-item-box">
  29. <u-icon class="icons" :color="sub.color" :name="sub.icon" custom-prefix="custom-icon"></u-icon>
  30. <text class="text">{{sub.text}}</text>
  31. </view>
  32. </uni-grid-item>
  33. </uni-grid>
  34. </view>
  35. </view>
  36. <view class="list-box" v-if="hasLogin&&dealerPhone">
  37. <view class="list-title flex justify_center phone" @click="call">
  38. <u-icon size="36" name="phone"></u-icon> <text>联系汽配商</text>
  39. </view>
  40. </view>
  41. <view class="list-box" v-if="hasLogin">
  42. <view class="list-title flex justify_center phone" @click="quitOut">
  43. <text>退出登录</text>
  44. </view>
  45. </view>
  46. <!-- 去认证弹框 -->
  47. <u-popup v-model="showPopup" mode="center" :border-radius="20" closeable>
  48. <view style="background-color: #fff;padding: 1rem;">
  49. <u-image width="533" height="415" src="/static/authimg.jpg"></u-image>
  50. <view style="padding-top:1rem;" class="flex justify_center">
  51. <u-button @click="toAuthStore()" shape="circle" :custom-style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</u-button>
  52. </view>
  53. </view>
  54. </u-popup>
  55. </view>
  56. <!-- tab -->
  57. <u-tabbar :list="vuex_tabBarList" :before-switch="beforeSwitch" :midButton="vuex_tabBarList.length==5"></u-tabbar>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. mapState,
  63. mapMutations
  64. } from 'vuex'
  65. import { queryQplsConfig } from '@/api/shelf.js'
  66. export default {
  67. data() {
  68. return {
  69. dealerPhone: null, // 经销商电话
  70. showPopup: false,
  71. showPriceSet: false,
  72. shelfSn: null,
  73. }
  74. },
  75. computed: {
  76. ...mapState(['hasLogin','vuex_vinScanNums','vuex_scanMaxNums','vuex_tabBarList']),
  77. hasShelf(){
  78. return !!this.$store.state.vuex_storeShelf
  79. },
  80. userInfo(){
  81. return this.$store.state.vuex_userInfo
  82. },
  83. storeApply(){
  84. return this.$store.state.vuex_storeAuthInfo
  85. },
  86. hasRedPacket(){
  87. const rule = this.$store.state.vuex_rewardRule
  88. return rule&&rule.ruleStatus == 'release'
  89. },
  90. itemList(){
  91. const list = [
  92. {
  93. text: '货架管理',
  94. icon: 'list-dot',
  95. auth: true,
  96. column: 4,
  97. child:[
  98. {
  99. text: '库存查询',
  100. icon: 'stockquery',
  101. auth: this.$hasPermissions('M_stockQueryList_mini'),
  102. path: '/pagesB/stockQuery/stockQuery',
  103. color: '#00aaff'
  104. },
  105. {
  106. text: '补货记录',
  107. icon: 'replenishment',
  108. auth: this.$hasPermissions('M_stockPut_mini'),
  109. path: '/pagesA/digitalShelf/stockPut',
  110. color: '#aa55ff'
  111. },
  112. {
  113. text: '结算记录',
  114. icon: 'settlement',
  115. auth: this.$hasPermissions('M_settlementRecord_mini'),
  116. path: '/pagesA/digitalShelf/settlementRecord/settlementRecord',
  117. color: '#00aaff'
  118. },
  119. {
  120. text: '付款结算',
  121. icon: 'payrecord',
  122. auth: this.$hasPermissions('M_settlementManage_mini'),
  123. path: '/pagesA/digitalShelf/settlementManage/settlementManage',
  124. color: '#ff5500'
  125. },
  126. ],
  127. },
  128. {
  129. text: '订单管理',
  130. icon: 'order',
  131. auth: true,
  132. column: 4,
  133. child:[
  134. {
  135. text: '货架订单',
  136. icon: 'shelforder',
  137. auth: this.$hasPermissions('M_shelfOrder_mini'),
  138. path: '/pagesA/digitalShelf/orderList',
  139. color: '#0055ff'
  140. },
  141. {
  142. text: '急送订单',
  143. icon: 'yijianshansong',
  144. auth: this.$hasPermissions('M_tempShelfOrder_mini'),
  145. path: '/pagesA/digitalShelf/tempOrderList/tempOrderList',
  146. color: '#ff7b1c'
  147. },
  148. {
  149. text: '采购订单',
  150. icon: 'purchaseorder',
  151. auth: this.$hasPermissions('M_procureOrder_mini'),
  152. path: '/pagesB/procureOrderList',
  153. color: '#00aa00'
  154. }
  155. ],
  156. },
  157. {
  158. text: '轮胎质保单',
  159. icon: 'file-text',
  160. auth: true,
  161. column: 4,
  162. child:[
  163. {
  164. text: '创建质保单',
  165. icon: 'zhibaodan',
  166. auth: this.$hasPermissions('M_creatWarranty_mini'),
  167. path: '/pagesA/qualityPolicy/creatOrder',
  168. color: '#5555ff'
  169. },
  170. {
  171. text: '质保单查询',
  172. icon: 'ordersearch',
  173. auth: this.$hasPermissions('M_searchWarranty_mini'),
  174. path: '/pagesA/qualityPolicy/searchOrder',
  175. color: '#ff557f'
  176. },
  177. ],
  178. },
  179. {
  180. text: '基础设置',
  181. icon: 'setting',
  182. auth: true,
  183. column: 4,
  184. child:[
  185. {
  186. text: '员工管理',
  187. icon: 'employee',
  188. auth: this.$hasPermissions('M_employee_mini'),
  189. path: '/pages/storeManage/personnel',
  190. color: '#0055ff'
  191. },
  192. {
  193. text: '岗位权限',
  194. icon: 'job',
  195. auth: this.$hasPermissions('M_roleSetting_mini'),
  196. path: '/pages/storeManage/roleSetting/roleSetting',
  197. color: '#55aa00'
  198. },
  199. {
  200. text: '价格显示设置',
  201. icon: 'permission',
  202. auth: this.$hasPermissions('M_priceShow_mini')&&this.showPriceSet,
  203. path: '/pages/storeManage/priceSetting/priceSetting',
  204. color: '#ff5500'
  205. },
  206. ],
  207. }
  208. ]
  209. // 计算父节点,权限
  210. list.forEach(item => {
  211. item.id = this.$u.guid()
  212. item.child = item.child.filter(c => c.auth)
  213. item.auth = item.child.length > 0
  214. })
  215. return list
  216. }
  217. },
  218. onShow() {
  219. // 获取货架信息
  220. const shelfInfo = this.$store.state.vuex_storeShelf
  221. this.shelfSn = shelfInfo ? shelfInfo.shelfSn : ''
  222. this.dealerPhone = shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
  223. if(this.shelfSn){
  224. this.getPriceCofig()
  225. }
  226. },
  227. // 页面卸载
  228. onUnload() {
  229. uni.$off('refashProm')
  230. },
  231. methods: {
  232. // tab单击
  233. beforeSwitch(index){
  234. const row = this.$store.state.vuex_tabBarList[index]
  235. if(row.text == '促销'){
  236. uni.$emit('refashProm')
  237. }
  238. if(row.text == '扫描VIN'){
  239. this.openCamera()
  240. }else{
  241. return true
  242. }
  243. },
  244. // 网格打开页面
  245. openPage(e,child){
  246. const item = child[e.detail.index]
  247. this.toPage(item.path)
  248. },
  249. // 获取价格配置
  250. getPriceCofig(){
  251. queryQplsConfig({shelfSn: this.shelfSn}).then(res => {
  252. this.$store.state.vuex_configPrice = res.data || null
  253. const ret = [false,false]
  254. ret[0]= res.data.shelf_cost_show == '1' || res.data.non_shelf_cost_show == '1'
  255. ret[1]= res.data.shelf_price_show == '1' || res.data.non_shelf_price_show == '1'
  256. this.showPriceSet = ret.filter(item => !!item).length > 0
  257. })
  258. },
  259. // 去扫描
  260. openCamera(){
  261. if(this.hasLogin){
  262. if(this.userInfo.sysUserFlag == '0'){
  263. if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
  264. uni.navigateTo({
  265. url: "/pages/scan-frame/scan-frame"
  266. })
  267. }else{
  268. uni.showModal({
  269. title: '提示',
  270. content: '个人用户扫描VIN仅限10次,您的次数已用完!',
  271. confirmText: '好的',
  272. showCancel: false,
  273. success(res) {}
  274. })
  275. }
  276. }else{
  277. uni.navigateTo({
  278. url: "/pages/scan-frame/scan-frame"
  279. })
  280. }
  281. }else{
  282. uni.navigateTo({
  283. url: '/pages/login/login'
  284. })
  285. }
  286. },
  287. // 跳转打开页面
  288. toPage(path){
  289. const _this = this
  290. if(this.hasLogin){
  291. // 游客未认证
  292. if(this.userInfo.sysUserFlag == '0'){
  293. if(this.storeApply&&this.storeApply.auditStatus=='WAIT'){
  294. uni.showModal({
  295. title: '提示',
  296. content: '门店认证资料审核中,请耐心等待!',
  297. confirmText: '知道了',
  298. showCancel: false
  299. })
  300. }
  301. // 如果审核已通过
  302. else if(this.storeApply&&this.storeApply.auditStatus=='PASS'){
  303. uni.showModal({
  304. title: '提示',
  305. content: '门店认证审核已通过,请重新登录!',
  306. confirmText: '去登录',
  307. showCancel: false,
  308. success() {
  309. _this.$store.dispatch('userLogout');
  310. uni.redirectTo({
  311. url: '/pages/login/login'
  312. });
  313. }
  314. })
  315. }else{
  316. this.showPopup = true
  317. }
  318. }else{
  319. // 已有数字货架
  320. if(this.hasShelf){
  321. uni.navigateTo({
  322. url: path
  323. })
  324. }else{
  325. uni.showToast({
  326. icon:'none',
  327. title: '门店没有关联数字货架,无法使用此功能!'
  328. })
  329. }
  330. }
  331. }else{
  332. uni.navigateTo({
  333. url: '/pages/login/login'
  334. })
  335. }
  336. },
  337. // 去认证
  338. toAuthStore(){
  339. this.showPopup = false
  340. uni.navigateTo({
  341. url: '/pages/storeManage/storeAuth'
  342. })
  343. },
  344. // 打电话
  345. call(){
  346. this.callPhone(this.dealerPhone)
  347. },
  348. // 退出登录
  349. quitOut(){
  350. let _this = this
  351. uni.showModal({
  352. title: '提示',
  353. content: '确定退出登录吗?',
  354. success: (ret) => {
  355. if(ret.confirm){
  356. _this.$store.dispatch('userLogout');
  357. uni.navigateTo({
  358. url: '/pages/login/login'
  359. });
  360. }
  361. }
  362. })
  363. }
  364. }
  365. }
  366. </script>
  367. <style lang="less">
  368. .morePages{
  369. width: 100%;
  370. padding: 30rpx;
  371. background-image: linear-gradient(#86defa 0%,#cdeff9 20%,#f8f8f8 30%);
  372. .list-box{
  373. background: #ffffff;
  374. margin-bottom: 20rpx;
  375. border-radius: 25rpx;
  376. overflow: hidden;
  377. box-shadow: 2rpx 2rpx 5rpx #eee;
  378. .list-title{
  379. padding: 25rpx 20rpx;
  380. font-size: 30rpx;
  381. > text{
  382. margin-left: 10rpx;
  383. }
  384. }
  385. &:first-child{
  386. box-shadow: 2rpx 2rpx 5rpx #cdeff9;
  387. }
  388. .list-body{
  389. padding: 0 20rpx 25rpx;
  390. }
  391. .grid-item-box{
  392. display: flex;
  393. flex-direction: column;
  394. align-items:center;
  395. justify-content: center;
  396. .text{
  397. text-align:center;
  398. color: #666;
  399. }
  400. .icons{
  401. font-size: 70rpx;
  402. width: 90rpx;
  403. height: 90rpx;
  404. text-align:center;
  405. display: flex;
  406. align-items: center;
  407. flex-direction: column;
  408. justify-content: center;
  409. }
  410. }
  411. }
  412. .phone{
  413. color: #00aaff;
  414. &:active{
  415. opacity: 0.8;
  416. transform:scale(0.9);
  417. }
  418. }
  419. }
  420. </style>