index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <template>
  2. <view class="pagebox">
  3. <!-- #ifdef MP || APP-PLUS -->
  4. <workNavBar titleText="工作台" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack>
  5. <view class="word_header_text">
  6. <view class="text-box line1 wx-text-box">
  7. 骑手接单
  8. </view>
  9. <view class="icon-box" v-if="merchantEmployeeList.length>1" @click="toggle('bottom')">
  10. <text class="iconfont icon-xiangxia"></text>
  11. </view>
  12. </view>
  13. </workNavBar>
  14. <!-- #endif -->
  15. <view class="headerBg">
  16. <view :style="{ height: `${getHeight.barTop}px` }"></view>
  17. <view :style="{ height: `${getHeight.barHeight}px` }"></view>
  18. <view class="inner">
  19. </view>
  20. </view>
  21. <view class="page-content">
  22. <!-- #ifdef H5 -->
  23. <view class="word_header_text">
  24. <view class="popup-box">
  25. {{riderSelected.name}}
  26. </view>
  27. <view class="icon-box" @click="toggle('bottom')">
  28. <text class="iconfont icon-xiangxia"></text>
  29. </view>
  30. </view>
  31. <!-- #endif -->
  32. <view class="header acea-row row-middle">
  33. <image :src="riderSelected.avatar" class="avatar"></image>
  34. <view class="text-box">
  35. <view class="name">{{ riderSelected.name }}</view>
  36. <view class="phone">{{ riderSelected.phone }}</view>
  37. </view>
  38. <navigator url="/pages/admin/cancel/index" hover-class="none"
  39. v-if="selectMerchantRole.split(',').includes('5')">
  40. <text class="iconfont icon-ic_Scan"></text>
  41. </navigator>
  42. </view>
  43. <!-- 销售统计 -->
  44. <view class="today">
  45. <view class="title-box">
  46. <navigator class="link" hover-class="none">
  47. 今日收益(元)
  48. </navigator>
  49. <view class="money semiBold">{{homeData.sales?homeData.sales:0}}</view>
  50. </view>
  51. <view class="acea-row">
  52. <view class="item">
  53. <view class="num semiBold">{{homeData.allSales?homeData.allSales:0}} </view>
  54. <view class="">累计收益额(元)</view>
  55. </view>
  56. <view class="item semiBold">
  57. <view class="num">{{ homeData.orderNum?homeData.orderNum:0 }}</view>
  58. <view class="">今日接单量</view>
  59. </view>
  60. <view class="item semiBold">
  61. <view class="num">{{ homeData.allOrderNum?homeData.allOrderNum:0 }}</view>
  62. <view class="">累计接单量</view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 订单 -->
  67. <!--view class="goods acea-row" v-if="selectMerchantRole.split(',').includes('6')">
  68. <navigator url="/pages/rider_index/order/index" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  69. <view class="img-box">
  70. <view class="img positionImg">
  71. <image class="positionImg" :src="urlDomain+'crmebimage/presets/adminImg/daifahuo.png'"
  72. mode="">
  73. </image>
  74. <view :class="operatingData.notShippingOrderNum<10?'positonsNum':'positonsNumBig'">
  75. {{operatingData.notShippingOrderNum>99?'99+':operatingData.notShippingOrderNum}}
  76. </view>
  77. </view>
  78. </view>
  79. <view class="">去接单</view>
  80. </navigator>
  81. <navigator url="/pages/rider_index/order/index" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  82. <view class="img-box">
  83. <view class="img positionImg">
  84. <image :src="urlDomain+'crmebimage/presets/adminImg/daihexiao.png'" mode=""></image>
  85. <view :class="operatingData.awaitVerificationOrderNum<10?'positonsNum':'positonsNumBig'">
  86. {{operatingData.awaitVerificationOrderNum>99?'99+':operatingData.awaitVerificationOrderNum}}
  87. </view>
  88. </view>
  89. </view>
  90. <view class="">待取货</view>
  91. </navigator>
  92. <navigator url="/pages/rider_index/order/index" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('2')">
  93. <view class="img-box">
  94. <view class="img positionImg">
  95. <image :src="urlDomain+'crmebimage/presets/adminImg/daishenhe.png'" mode=""></image>
  96. <view :class="operatingData.refundingOrderNum<10?'positonsNum':'positonsNumBig'">
  97. {{operatingData.refundingOrderNum>99?'99+':operatingData.refundingOrderNum}}
  98. </view>
  99. </view>
  100. </view>
  101. <view class="">配送中</view>
  102. </navigator>
  103. </view-->
  104. <!-- 商品 -->
  105. <view class="product" v-if="riderSelected.jobScope.split(',').includes('0')">
  106. <view class="acea-row titleBottom">
  107. <image class="ddImg" :src="urlDomain+'crmebimage/presets/adminImg/ic-rider.png'" mode=""></image>
  108. <view class="title-box bottom-line">外卖订单</view>
  109. </view>
  110. <view class="goods acea-row">
  111. <navigator url="/pages/rider_index/order/index?type=await&orderType=0" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  112. <view class="img-box">
  113. <view class="img positionImg">
  114. <image class="positionImg" :src="urlDomain+'crmebimage/presets/adminImg/daifahuo.png'"
  115. mode="">
  116. </image>
  117. <view :class="operatingData.takeoutAwaitReceiveOrderNUm<10?'positonsNum':'positonsNumBig'">
  118. {{operatingData.takeoutAwaitReceiveOrderNUm>99?'99+':operatingData.takeoutAwaitReceiveOrderNUm}}
  119. </view>
  120. </view>
  121. </view>
  122. <view class="">去接单</view>
  123. </navigator>
  124. <navigator url="/pages/rider_index/order/index?type=pickUp&orderType=0" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  125. <view class="img-box">
  126. <view class="img positionImg">
  127. <image :src="urlDomain+'crmebimage/presets/adminImg/daihexiao.png'" mode=""></image>
  128. <view :class="operatingData.takeoutNotShippingOrderNum<10?'positonsNum':'positonsNumBig'">
  129. {{operatingData.takeoutNotShippingOrderNum>99?'99+':operatingData.takeoutNotShippingOrderNum}}
  130. </view>
  131. </view>
  132. </view>
  133. <view class="">待取货</view>
  134. </navigator>
  135. <navigator url="/pages/rider_index/order/index?type=delivery&orderType=0" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('2')">
  136. <view class="img-box">
  137. <view class="img positionImg">
  138. <image :src="urlDomain+'crmebimage/presets/adminImg/daishenhe.png'" mode=""></image>
  139. <view :class="operatingData.takeoutAwaitDeliveryOrderNum<10?'positonsNum':'positonsNumBig'">
  140. {{operatingData.takeoutAwaitDeliveryOrderNum>99?'99+':operatingData.takeoutAwaitDeliveryOrderNum}}
  141. </view>
  142. </view>
  143. </view>
  144. <view class="">配送中</view>
  145. </navigator>
  146. </view>
  147. </view>
  148. <view class="product" v-if="riderSelected.jobScope.split(',').includes('1')">
  149. <view class="acea-row titleBottom">
  150. <image class="ddImg" :src="urlDomain+'crmebimage/presets/adminImg/ic_shangpin.png'" mode=""></image>
  151. <view class="title-box bottom-line">代取快递订单</view>
  152. </view>
  153. <view class="goods acea-row">
  154. <navigator url="/pages/rider_index/order/index?type=await&orderType=1" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  155. <view class="img-box">
  156. <view class="img positionImg">
  157. <image class="positionImg" :src="urlDomain+'crmebimage/presets/adminImg/daifahuo.png'"
  158. mode="">
  159. </image>
  160. <view :class="operatingData.expAwaitReceiveOrderNUm<10?'positonsNum':'positonsNumBig'">
  161. {{operatingData.expAwaitReceiveOrderNUm>99?'99+':operatingData.expAwaitReceiveOrderNUm}}
  162. </view>
  163. </view>
  164. </view>
  165. <view class="">去接单</view>
  166. </navigator>
  167. <navigator url="/pages/rider_index/order/index?type=pickUp&orderType=1" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  168. <view class="img-box">
  169. <view class="img positionImg">
  170. <image :src="urlDomain+'crmebimage/presets/adminImg/daihexiao.png'" mode=""></image>
  171. <view :class="operatingData.expNotShippingOrderNum<10?'positonsNum':'positonsNumBig'">
  172. {{operatingData.expNotShippingOrderNum>99?'99+':operatingData.expNotShippingOrderNum}}
  173. </view>
  174. </view>
  175. </view>
  176. <view class="">待取货</view>
  177. </navigator>
  178. <navigator url="/pages/rider_index/order/index?type=delivery&orderType=1" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('2')">
  179. <view class="img-box">
  180. <view class="img positionImg">
  181. <image :src="urlDomain+'crmebimage/presets/adminImg/daishenhe.png'" mode=""></image>
  182. <view :class="operatingData.expAwaitDeliveryOrderNum<10?'positonsNum':'positonsNumBig'">
  183. {{operatingData.expAwaitDeliveryOrderNum>99?'99+':operatingData.expAwaitDeliveryOrderNum}}
  184. </view>
  185. </view>
  186. </view>
  187. <view class="">配送中</view>
  188. </navigator>
  189. </view>
  190. </view>
  191. </view>
  192. <footerPage></footerPage>
  193. <uni-popup ref="popup" type="bottom" background-color="rgba(0,0,0,0)" border-radius="10px 10px 0 0">
  194. <view class="popup-content">
  195. <view class="item" v-for="(item,index) in merchantEmployeeList" :key="index"
  196. :class="{bottom_border:index!=merchantEmployeeList.length-1}">
  197. <view class="item_main">
  198. <image :src="item.currentMerchant.avatar" mode="" class="item_img"></image>
  199. <view class="item_name" :class="{nameColor:item.merId==merId}">{{item.currentMerchant.name}}</view>
  200. </view>
  201. <text v-if="item.merId==merId" class="iconfont icon-xuanzhong11 icon-size icon_color"></text>
  202. <text v-else class="iconfont icon-weixuan icon-size" @click="radioChange(item)"></text>
  203. </view>
  204. </view>
  205. </uni-popup>
  206. </view>
  207. </template>
  208. <script>
  209. import {
  210. mapGetters
  211. } from "vuex";
  212. import {
  213. HTTP_REQUEST_URL
  214. } from '@/config/app';
  215. import Cache from '@/utils/cache';
  216. import {
  217. getMerIndexInfoApi
  218. } from '@/api/merchant.js';
  219. import {
  220. riderInfo,
  221. statisticsIndex,
  222. statisticsOperatingData
  223. } from '@/api/rider.js';
  224. import {
  225. merchantActive,
  226. productTabsHeaders
  227. } from '@/api/work.js';
  228. // #ifdef MP || APP-PLUS
  229. import workNavBar from '../components/workNavBar.vue';
  230. // #endif
  231. import footerPage from '../components/footerPage/index.vue';
  232. export default {
  233. components: {
  234. // #ifdef MP || APP-PLUS
  235. workNavBar,
  236. // #endif
  237. footerPage,
  238. },
  239. computed: {
  240. ...mapGetters(['merchantEmployeeList', 'selectMerId', 'selectMerchantRole']),
  241. },
  242. created() {
  243. //防止中途关闭权限
  244. this.merId = this.selectMerId
  245. this.role=this.selectMerchantRole
  246. this.selectRider()
  247. },
  248. mounted() {
  249. //this.toActive(this.merId)
  250. //this.geiHomeData()
  251. },
  252. data() {
  253. return {
  254. urlDomain: this.$Cache.get("imgHost"),
  255. role: null,
  256. popupName: null,
  257. merId: null,
  258. merchantSelected: {},
  259. riderSelected: {},
  260. imgHost: HTTP_REQUEST_URL,
  261. // #ifdef MP || APP-PLUS
  262. iconColor: '#FFFFFF',
  263. isScrolling: false,
  264. // #endif
  265. avatar: '',
  266. getHeight: this.$util.getWXStatusHeight(),
  267. homeData: {},
  268. operatingData: {},
  269. productStatusNum: '',
  270. }
  271. },
  272. methods: {
  273. geiHomeData() {
  274. statisticsIndex().then(res => {
  275. this.homeData = res.data
  276. }).catch(err=>{})
  277. statisticsOperatingData().then(res => {
  278. this.operatingData = res.data
  279. }).catch(err=>{})
  280. // productTabsHeaders().then(res => {
  281. // this.productStatusNum = res.data
  282. // }).catch(err=>{})
  283. },
  284. //商铺激活
  285. toActive(merId) {
  286. let that = this
  287. merchantActive(merId).then(res => {
  288. if (res.code == 200) {
  289. that.$store.commit('SET_MANAGER_TOKEN', {
  290. managerToken: res.data.token
  291. });
  292. Cache.set('electrPrintingSwitch', res.data.electrPrintingSwitch);
  293. this.geiHomeData()
  294. }
  295. })
  296. },
  297. selectRider(){
  298. riderInfo().then(res => {
  299. if (res.code == 200) {
  300. this.riderSelected=res.data;
  301. this.geiHomeData()
  302. }
  303. })
  304. },
  305. selectMerchantList() {
  306. let arr = JSON.parse(JSON.stringify(this.merchantEmployeeList))
  307. this.merchantSelected = arr.find(value => value.merId == this.merId)
  308. this.popupName = this.merchantSelected.currentMerchant.name
  309. },
  310. toggle(type) {
  311. this.type = type
  312. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  313. this.$refs.popup.open(type)
  314. },
  315. radioChange(item) {
  316. this.popupName = item.currentMerchant.name
  317. this.merId = item.merId
  318. this.role = item.role
  319. this.$store.commit('SetSelectMerId', this.merId);
  320. this.$store.commit('SetSelectMerchantRole', this.role);
  321. this.toActive(this.merId)
  322. this.selectMerchantList()
  323. this.$refs.popup.close()
  324. this.geiHomeData()
  325. }
  326. }
  327. }
  328. </script>
  329. <style lang="scss" scoped>
  330. .pagebox {
  331. position: relative;
  332. overflow: hidden;
  333. padding-bottom: 200rpx;
  334. }
  335. .headerBg {
  336. position: absolute;
  337. top: 0;
  338. left: -25%;
  339. width: 150%;
  340. border-bottom-right-radius: 100%;
  341. border-bottom-left-radius: 100%;
  342. background: linear-gradient(270deg, #01ABF8 0%, #2A7EFB 100%);
  343. .inner {
  344. height: 356rpx;
  345. }
  346. }
  347. .page-content {
  348. position: relative;
  349. padding: 0 20rpx;
  350. .header {
  351. padding: 22rpx 20rpx 32rpx 12rpx;
  352. .avatar {
  353. width: 80rpx;
  354. height: 80rpx;
  355. border-radius: 50%;
  356. }
  357. .text-box {
  358. flex: 1;
  359. padding-left: 16rpx;
  360. color: #FFFFFF;
  361. }
  362. .name {
  363. font-weight: 500;
  364. font-size: 32rpx;
  365. line-height: 44rpx;
  366. }
  367. .phone {
  368. margin-top: 4rpx;
  369. font-size: 22rpx;
  370. line-height: 30rpx;
  371. }
  372. .iconfont {
  373. font-size: 40rpx;
  374. color: #FFFFFF;
  375. }
  376. }
  377. .today {
  378. border-radius: 24rpx;
  379. background: #FFFFFF;
  380. .title-box {
  381. padding: 40rpx 0 0 40rpx;
  382. }
  383. .link {
  384. display: inline-block;
  385. vertical-align: middle;
  386. font-size: 24rpx;
  387. line-height: 34rpx;
  388. color: #999999;
  389. }
  390. .iconfont {
  391. margin-left: 4rpx;
  392. font-size: 24rpx;
  393. }
  394. .money {
  395. margin-top: 16rpx;
  396. font-size: 56rpx;
  397. line-height: 56rpx;
  398. color: #FF7E00;
  399. }
  400. .item {
  401. flex: 1;
  402. padding: 54rpx 0 38rpx;
  403. text-align: center;
  404. font-size: 24rpx;
  405. line-height: 34rpx;
  406. color: #999999;
  407. }
  408. .num {
  409. margin-bottom: 12rpx;
  410. font-size: 36rpx;
  411. line-height: 36rpx;
  412. color: #333333;
  413. }
  414. }
  415. .goods {
  416. border-radius: 24rpx;
  417. margin-top: 20rpx;
  418. background: #FFFFFF;
  419. justify-content: space-between;
  420. .item {
  421. width: 175rpx;
  422. padding: 30rpx 0 26rpx;
  423. text-align: center;
  424. font-size: 26rpx;
  425. line-height: 36rpx;
  426. color: #333333;
  427. }
  428. .img-box {
  429. position: relative;
  430. width: 76rpx;
  431. height: 76rpx;
  432. border-radius: 50%;
  433. margin: 0 auto 12rpx;
  434. // background: #F9A833;
  435. // text-align: center;
  436. // line-height: 76rpx;
  437. }
  438. .img {
  439. width: 100%;
  440. height: 100%;
  441. // border-radius: 50%;
  442. // background: rgba(255, 255, 255, 0.8);
  443. }
  444. .num {
  445. position: absolute;
  446. top: -6rpx;
  447. left: 58rpx;
  448. z-index: 2;
  449. min-width: 24rpx;
  450. height: 24rpx;
  451. padding: 0 8rpx;
  452. border-radius: 12rpx;
  453. background: #FF7E00;
  454. font-weight: 500;
  455. font-size: 18rpx;
  456. line-height: 24rpx;
  457. color: #FFFFFF;
  458. }
  459. image {
  460. width: 100%;
  461. height: 100%;
  462. // font-size: 38rpx;
  463. // color: #FF7E00;
  464. }
  465. }
  466. .manage {
  467. padding-bottom: 41rpx;
  468. border-radius: 24rpx;
  469. margin-top: 20rpx;
  470. background: #FFFFFF;
  471. padding: 40rpx;
  472. .title-box {
  473. font-weight: 500;
  474. font-size: 30rpx;
  475. color: #333333;
  476. }
  477. .num {
  478. margin-bottom: 12rpx;
  479. font-size: 32rpx;
  480. line-height: 36rpx;
  481. color: #333333;
  482. font-weight: 600;
  483. }
  484. .list {
  485. justify-content: space-between;
  486. margin-top: 30rpx;
  487. }
  488. }
  489. .product {
  490. padding-bottom: 41rpx;
  491. border-radius: 24rpx;
  492. margin-top: 20rpx;
  493. background: #FFFFFF;
  494. padding: 40rpx;
  495. .title-box {
  496. font-weight: 500;
  497. font-size: 30rpx;
  498. color: #333333;
  499. }
  500. .num {
  501. margin-bottom: 12rpx;
  502. font-size: 32rpx;
  503. line-height: 36rpx;
  504. color: #333333;
  505. font-weight: 600;
  506. }
  507. .product-box {
  508. flex-wrap: wrap;
  509. justify-content: space-between;
  510. &>view {
  511. margin-top: 40rpx;
  512. }
  513. .special {
  514. width: 140rpx;
  515. }
  516. .num{
  517. text-align: center;
  518. }
  519. }
  520. }
  521. }
  522. .word_header_text {
  523. /* #ifdef H5 */
  524. margin-top: 20rpx;
  525. /* #endif */
  526. color: #fff;
  527. text-align: center;
  528. display: flex;
  529. align-items: center;
  530. justify-content: center;
  531. .popup-box {
  532. text-align: right;
  533. width: 180rpx;
  534. overflow: hidden;
  535. white-space: nowrap;
  536. text-overflow: ellipsis;
  537. }
  538. .icon-xiangxia {
  539. font-size: 18rpx;
  540. }
  541. }
  542. .popup-content {
  543. border-radius: 16rpx 16rpx 0px 0px;
  544. .bottom_border {
  545. border-bottom: 1px solid #F5F5F5;
  546. }
  547. .item {
  548. display: flex;
  549. align-items: center;
  550. justify-content: space-between;
  551. padding: 20rpx;
  552. .icon_color {
  553. color: #2A7EFB;
  554. }
  555. .item_main {
  556. display: flex;
  557. align-items: center;
  558. .item_name {
  559. margin-left: 20rpx;
  560. font-weight: 500;
  561. font-size: 28rpx;
  562. }
  563. }
  564. .item_img {
  565. width: 60rpx;
  566. height: 60rpx;
  567. border-radius: 60rpx;
  568. }
  569. }
  570. }
  571. .icon-box {
  572. width: 30rpx;
  573. height: 30rpx;
  574. background: rgba(255, 255, 255, 0.3);
  575. border-radius: 15rpx;
  576. line-height: 20rpx;
  577. text-align: center;
  578. margin-right: 20rpx;
  579. margin-left: 10rpx;
  580. .icon-xiangxia {
  581. font-size: 12rpx;
  582. }
  583. }
  584. .ddImg {
  585. width: 36rpx;
  586. height: 36rpx;
  587. margin-right: 12rpx;
  588. margin-top: 2rpx;
  589. }
  590. .positionImg {
  591. position: relative;
  592. .positonsNum {
  593. position: absolute;
  594. right: -5rpx;
  595. top: 0;
  596. background: #FF7E00;
  597. border-radius: 40rpx;
  598. color: #fff;
  599. font-size: 18rpx;
  600. width: 24rpx;
  601. height: 24rpx;
  602. text-align: center;
  603. line-height: 24rpx;
  604. }
  605. .positonsNumBig{
  606. position: absolute;
  607. left: 50rpx;
  608. top: 0;
  609. background: #FF7E00;
  610. border-radius: 40rpx;
  611. color: #fff;
  612. font-size: 18rpx;
  613. // width: 34rpx;
  614. height: 24rpx;
  615. text-align: center;
  616. line-height: 24rpx;
  617. padding: 0 6rpx;
  618. }
  619. }
  620. .list-text {
  621. font-size: 24rpx;
  622. color: #999999;
  623. text-align: center;
  624. }
  625. .gz-box {
  626. // width: 100%;
  627. text-align: center;
  628. }
  629. .titleBottom{
  630. vertical-align: top;
  631. padding-bottom: 24rpx;
  632. border-bottom: 2rpx solid #f5f5f5;
  633. }
  634. .icon-size{
  635. width: 40rpx;
  636. height: 40rpx;
  637. }
  638. .nameColor{
  639. color: #2A7EFB;
  640. }
  641. .wx-text-box{
  642. max-width: 240rpx;
  643. }
  644. </style>