morePage.vue 11 KB

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