morePage.vue 10 KB

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