morePage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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">
  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('/pages/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')">
  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_tempShelfOrder_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. methods: {
  158. beforeSwitch(index){
  159. const row = this.$store.state.vuex_tabBarList[index]
  160. if(row.text == '扫描VIN'){
  161. this.openCamera()
  162. }else{
  163. return true
  164. }
  165. },
  166. // 获取价格配置
  167. getPriceCofig(){
  168. queryQplsConfig({shelfSn: this.shelfSn}).then(res => {
  169. this.$store.state.vuex_configPrice = res.data || null
  170. const ret = [false,false]
  171. ret[0]= res.data.shelf_cost_show == '1' || res.data.non_shelf_cost_show == '1'
  172. ret[1]= res.data.shelf_price_show == '1' || res.data.non_shelf_price_show == '1'
  173. this.showPriceSet = ret.filter(item => !!item).length > 0
  174. })
  175. },
  176. // 去扫描
  177. openCamera(){
  178. if(this.hasLogin){
  179. if(this.userInfo.sysUserFlag == '0'){
  180. if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
  181. uni.navigateTo({
  182. url: "/pages/scan-frame/scan-frame"
  183. })
  184. }else{
  185. uni.showModal({
  186. title: '提示',
  187. content: '个人用户扫描VIN仅限10次,您的次数已用完!',
  188. confirmText: '好的',
  189. showCancel: false,
  190. success(res) {}
  191. })
  192. }
  193. }else{
  194. uni.navigateTo({
  195. url: "/pages/scan-frame/scan-frame"
  196. })
  197. }
  198. }else{
  199. uni.navigateTo({
  200. url: '/pages/login/login'
  201. })
  202. }
  203. },
  204. toPage(path){
  205. const _this = this
  206. if(this.hasLogin){
  207. // 游客未认证
  208. if(this.userInfo.sysUserFlag == '0'){
  209. if(this.storeApply&&this.storeApply.auditStatus=='WAIT'){
  210. uni.showModal({
  211. title: '提示',
  212. content: '门店认证资料审核中,请耐心等待!',
  213. confirmText: '知道了',
  214. showCancel: false
  215. })
  216. }
  217. // 如果审核已通过
  218. else if(this.storeApply&&this.storeApply.auditStatus=='PASS'){
  219. uni.showModal({
  220. title: '提示',
  221. content: '门店认证审核已通过,请重新登录!',
  222. confirmText: '去登录',
  223. showCancel: false,
  224. success() {
  225. _this.$store.dispatch('userLogout');
  226. uni.redirectTo({
  227. url: '/pages/login/login'
  228. });
  229. }
  230. })
  231. }else{
  232. this.showPopup = true
  233. }
  234. }else{
  235. // 已有数字货架
  236. if(this.hasShelf){
  237. uni.navigateTo({
  238. url: path
  239. })
  240. }else{
  241. uni.showToast({
  242. icon:'none',
  243. title: '门店没有关联数字货架,无法使用此功能!'
  244. })
  245. }
  246. }
  247. }else{
  248. uni.navigateTo({
  249. url: '/pages/login/login'
  250. })
  251. }
  252. },
  253. toAuthStore(){
  254. this.showPopup = false
  255. uni.navigateTo({
  256. url: '/pages/storeManage/storeAuth'
  257. })
  258. },
  259. call(){
  260. this.callPhone(this.dealerPhone)
  261. },
  262. quitOut(){
  263. let _this = this
  264. uni.showModal({
  265. title: '提示',
  266. content: '确定退出登录吗?',
  267. success: (ret) => {
  268. if(ret.confirm){
  269. _this.$store.dispatch('userLogout');
  270. uni.navigateTo({
  271. url: '/pages/login/login'
  272. });
  273. }
  274. }
  275. })
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="less">
  281. .morePages{
  282. width: 100%;
  283. padding: 30rpx;
  284. background-image: linear-gradient(#86defa 0%,#cdeff9 20%,#f8f8f8 30%);
  285. .list-box{
  286. background: #ffffff;
  287. margin-bottom: 20rpx;
  288. border-radius: 25rpx;
  289. overflow: hidden;
  290. box-shadow: 2rpx 2rpx 5rpx #eee;
  291. .list-title{
  292. padding: 25rpx 20rpx;
  293. font-size: 30rpx;
  294. border-bottom: 2rpx solid #f8f8f8;
  295. > text{
  296. margin-left: 10rpx;
  297. }
  298. }
  299. &:first-child{
  300. box-shadow: 2rpx 2rpx 5rpx #cdeff9;
  301. }
  302. }
  303. .phone{
  304. color: #00aaff;
  305. &:active{
  306. opacity: 0.8;
  307. transform:scale(0.9);
  308. }
  309. }
  310. }
  311. </style>