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" @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">
  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" >
  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">
  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" >
  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">
  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" >
  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, #ff5500 0%, #ff5500 100%);
  343. //background: linear-gradient(270deg, #01ABF8 0%, #2A7EFB 100%);
  344. .inner {
  345. height: 356rpx;
  346. }
  347. }
  348. .page-content {
  349. position: relative;
  350. padding: 0 20rpx;
  351. .header {
  352. padding: 22rpx 20rpx 32rpx 12rpx;
  353. .avatar {
  354. width: 80rpx;
  355. height: 80rpx;
  356. border-radius: 50%;
  357. }
  358. .text-box {
  359. flex: 1;
  360. padding-left: 16rpx;
  361. color: #FFFFFF;
  362. }
  363. .name {
  364. font-weight: 500;
  365. font-size: 32rpx;
  366. line-height: 44rpx;
  367. }
  368. .phone {
  369. margin-top: 4rpx;
  370. font-size: 22rpx;
  371. line-height: 30rpx;
  372. }
  373. .iconfont {
  374. font-size: 40rpx;
  375. color: #FFFFFF;
  376. }
  377. }
  378. .today {
  379. border-radius: 24rpx;
  380. background: #FFFFFF;
  381. .title-box {
  382. padding: 40rpx 0 0 40rpx;
  383. }
  384. .link {
  385. display: inline-block;
  386. vertical-align: middle;
  387. font-size: 24rpx;
  388. line-height: 34rpx;
  389. color: #999999;
  390. }
  391. .iconfont {
  392. margin-left: 4rpx;
  393. font-size: 24rpx;
  394. }
  395. .money {
  396. margin-top: 16rpx;
  397. font-size: 56rpx;
  398. line-height: 56rpx;
  399. color: #FF7E00;
  400. }
  401. .item {
  402. flex: 1;
  403. padding: 54rpx 0 38rpx;
  404. text-align: center;
  405. font-size: 24rpx;
  406. line-height: 34rpx;
  407. color: #999999;
  408. }
  409. .num {
  410. margin-bottom: 12rpx;
  411. font-size: 36rpx;
  412. line-height: 36rpx;
  413. color: #333333;
  414. }
  415. }
  416. .goods {
  417. border-radius: 24rpx;
  418. margin-top: 20rpx;
  419. background: #FFFFFF;
  420. justify-content: space-between;
  421. .item {
  422. width: 175rpx;
  423. padding: 30rpx 0 26rpx;
  424. text-align: center;
  425. font-size: 26rpx;
  426. line-height: 36rpx;
  427. color: #333333;
  428. }
  429. .img-box {
  430. position: relative;
  431. width: 76rpx;
  432. height: 76rpx;
  433. border-radius: 50%;
  434. margin: 0 auto 12rpx;
  435. // background: #F9A833;
  436. // text-align: center;
  437. // line-height: 76rpx;
  438. }
  439. .img {
  440. width: 100%;
  441. height: 100%;
  442. // border-radius: 50%;
  443. // background: rgba(255, 255, 255, 0.8);
  444. }
  445. .num {
  446. position: absolute;
  447. top: -6rpx;
  448. left: 58rpx;
  449. z-index: 2;
  450. min-width: 24rpx;
  451. height: 24rpx;
  452. padding: 0 8rpx;
  453. border-radius: 12rpx;
  454. background: #FF7E00;
  455. font-weight: 500;
  456. font-size: 18rpx;
  457. line-height: 24rpx;
  458. color: #FFFFFF;
  459. }
  460. image {
  461. width: 100%;
  462. height: 100%;
  463. // font-size: 38rpx;
  464. // color: #FF7E00;
  465. }
  466. }
  467. .manage {
  468. padding-bottom: 41rpx;
  469. border-radius: 24rpx;
  470. margin-top: 20rpx;
  471. background: #FFFFFF;
  472. padding: 40rpx;
  473. .title-box {
  474. font-weight: 500;
  475. font-size: 30rpx;
  476. color: #333333;
  477. }
  478. .num {
  479. margin-bottom: 12rpx;
  480. font-size: 32rpx;
  481. line-height: 36rpx;
  482. color: #333333;
  483. font-weight: 600;
  484. }
  485. .list {
  486. justify-content: space-between;
  487. margin-top: 30rpx;
  488. }
  489. }
  490. .product {
  491. padding-bottom: 41rpx;
  492. border-radius: 24rpx;
  493. margin-top: 20rpx;
  494. background: #FFFFFF;
  495. padding: 40rpx;
  496. .title-box {
  497. font-weight: 500;
  498. font-size: 30rpx;
  499. color: #333333;
  500. }
  501. .num {
  502. margin-bottom: 12rpx;
  503. font-size: 32rpx;
  504. line-height: 36rpx;
  505. color: #333333;
  506. font-weight: 600;
  507. }
  508. .product-box {
  509. flex-wrap: wrap;
  510. justify-content: space-between;
  511. &>view {
  512. margin-top: 40rpx;
  513. }
  514. .special {
  515. width: 140rpx;
  516. }
  517. .num{
  518. text-align: center;
  519. }
  520. }
  521. }
  522. }
  523. .word_header_text {
  524. /* #ifdef H5 */
  525. margin-top: 20rpx;
  526. /* #endif */
  527. color: #fff;
  528. text-align: center;
  529. display: flex;
  530. align-items: center;
  531. justify-content: center;
  532. .popup-box {
  533. text-align: right;
  534. width: 180rpx;
  535. overflow: hidden;
  536. white-space: nowrap;
  537. text-overflow: ellipsis;
  538. }
  539. .icon-xiangxia {
  540. font-size: 18rpx;
  541. }
  542. }
  543. .popup-content {
  544. border-radius: 16rpx 16rpx 0px 0px;
  545. .bottom_border {
  546. border-bottom: 1px solid #F5F5F5;
  547. }
  548. .item {
  549. display: flex;
  550. align-items: center;
  551. justify-content: space-between;
  552. padding: 20rpx;
  553. .icon_color {
  554. color: #2A7EFB;
  555. }
  556. .item_main {
  557. display: flex;
  558. align-items: center;
  559. .item_name {
  560. margin-left: 20rpx;
  561. font-weight: 500;
  562. font-size: 28rpx;
  563. }
  564. }
  565. .item_img {
  566. width: 60rpx;
  567. height: 60rpx;
  568. border-radius: 60rpx;
  569. }
  570. }
  571. }
  572. .icon-box {
  573. width: 30rpx;
  574. height: 30rpx;
  575. background: rgba(255, 255, 255, 0.3);
  576. border-radius: 15rpx;
  577. line-height: 20rpx;
  578. text-align: center;
  579. margin-right: 20rpx;
  580. margin-left: 10rpx;
  581. .icon-xiangxia {
  582. font-size: 12rpx;
  583. }
  584. }
  585. .ddImg {
  586. width: 36rpx;
  587. height: 36rpx;
  588. margin-right: 12rpx;
  589. margin-top: 2rpx;
  590. }
  591. .positionImg {
  592. position: relative;
  593. .positonsNum {
  594. position: absolute;
  595. right: -5rpx;
  596. top: 0;
  597. background: #FF7E00;
  598. border-radius: 40rpx;
  599. color: #fff;
  600. font-size: 18rpx;
  601. width: 24rpx;
  602. height: 24rpx;
  603. text-align: center;
  604. line-height: 24rpx;
  605. }
  606. .positonsNumBig{
  607. position: absolute;
  608. left: 50rpx;
  609. top: 0;
  610. background: #FF7E00;
  611. border-radius: 40rpx;
  612. color: #fff;
  613. font-size: 18rpx;
  614. // width: 34rpx;
  615. height: 24rpx;
  616. text-align: center;
  617. line-height: 24rpx;
  618. padding: 0 6rpx;
  619. }
  620. }
  621. .list-text {
  622. font-size: 24rpx;
  623. color: #999999;
  624. text-align: center;
  625. }
  626. .gz-box {
  627. // width: 100%;
  628. text-align: center;
  629. }
  630. .titleBottom{
  631. vertical-align: top;
  632. padding-bottom: 24rpx;
  633. border-bottom: 2rpx solid #f5f5f5;
  634. }
  635. .icon-size{
  636. width: 40rpx;
  637. height: 40rpx;
  638. }
  639. .nameColor{
  640. color: #2A7EFB;
  641. }
  642. .wx-text-box{
  643. max-width: 240rpx;
  644. }
  645. </style>