morePage.vue 9.3 KB

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