Storesdetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <view>
  3. <view class="titlenav">
  4. <!-- <titlenav :flag="true"></titlenav> -->
  5. <view class="top">
  6. <view class="title1">{{ !Show ? '等待骑手取餐' : '待接单' }}</view>
  7. <view class="title2">{{ !Show ? '备餐完成,等待骑手取餐···' : '请您尽快接单,为用户备餐···' }}</view>
  8. </view>
  9. </view>
  10. <view class="borderTop"></view>
  11. <view class="conBox">
  12. <!-- 判断外卖方式 -->
  13. <template v-if="!Show">
  14. <view class="address rider" @click="show2 = true">
  15. <view class="name">骑手</view>
  16. <view class="choice">
  17. <view class="text1">{{ name }}</view>
  18. <image class="right" src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-28-15-55-07FUuECyGb.png" mode=""></image>
  19. </view>
  20. </view>
  21. <view class="Line"></view>
  22. </template>
  23. <view class="address address3">
  24. <view class="name">{{ !Show ? '配送地址' : '用户信息' }}</view>
  25. <view>
  26. <view class="text1" v-if="!Show">南京**江宁校区-4号宿舍楼</view>
  27. <view class="text1">奶盖 18789898888</view>
  28. </view>
  29. </view>
  30. <view class="address">
  31. <view class="name">{{ !Show ? '期望时间' : '自取时间' }}</view>
  32. <view class="text1 text2">{{ !Show ? '08:50送达' : '今天08:50' }}</view>
  33. </view>
  34. <view class="address address2">
  35. <view class="name">备注</view>
  36. <view class="text1 text2">{{ list.remark }}</view>
  37. </view>
  38. <view class="border2"></view>
  39. <view v-for="(item, index) in takeout" :key="index">
  40. <view class="store">
  41. <view class="title">
  42. <image class="imgBox1" src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-03-15-53-18gjxoMYNY.png" mode=""></image>
  43. <view class="canteen">益禾堂(一食堂)</view>
  44. </view>
  45. <view class="store1">共{{ takeout.length }}件商品</view>
  46. </view>
  47. <view class="border"></view>
  48. <view class="content">
  49. <view class="ImgBox">
  50. <image class="ImgBox2" :src="item.image" mode=""></image>
  51. <view>
  52. <view class="name">{{ item.name }}</view>
  53. <view class="name1">共{{ item.num }}件</view>
  54. </view>
  55. </view>
  56. <view class="money">¥{{ item.price }}</view>
  57. </view>
  58. </view>
  59. <view class="order">
  60. <view class="text1">打包费</view>
  61. <view class="text2">¥{{ list.packPrice }}</view>
  62. </view>
  63. <view class="order order2">
  64. <view class="text1">配送费</view>
  65. <view class="text2">¥{{ list.distributionPrice }}</view>
  66. </view>
  67. <view class="text">
  68. <view class="text1">合计:</view>
  69. <view class="text2">¥{{ list.total }}</view>
  70. </view>
  71. <view class="border2"></view>
  72. <view class="box">
  73. <view class="box-con">
  74. <p>支付方式</p>
  75. <view class="text2">微信支付</view>
  76. </view>
  77. </view>
  78. <view class="box">
  79. <view class="box-con">
  80. <p>订单编号</p>
  81. <view class="text1">
  82. <span @click="orderCopy">复制</span>
  83. <view class="text2">{{ list.transactionId }}</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="box">
  88. <view class="box-con">
  89. <p>下单时间</p>
  90. <view class="text2">{{ list.createdAt }}</view>
  91. </view>
  92. </view>
  93. <view class="box">
  94. <view class="box-con">
  95. <p>付款时间</p>
  96. <view class="text2">2021-05-20 07:52:36</view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="btn">
  101. <u-button block class="btn2" @click="submit">联系买家</u-button>
  102. <u-button block type="primary" @click="submit2">{{ !Show ? '联系骑手' : '接单' }}</u-button>
  103. </view>
  104. <u-popup v-model="show2" mode="bottom" border-radius="12">
  105. <view class="distribution">选择配送骑手</view>
  106. <u-cell-group>
  107. <view v-for="(item, index) in riderList" :key="index">
  108. <view class="conPup" @click="Addrider(item)">
  109. <view class="add">{{ item.name }} {{ item.phone }}</view>
  110. <!-- <image
  111. class="imgBox"
  112. :src="`https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/${item.rider ? '2021-09-29-15-24-20LcnkHdXx.png' : '2021-09-02-14-49-00OrkCuHPB.png'}`"
  113. mode=""
  114. ></image> -->
  115. </view>
  116. </view>
  117. </u-cell-group>
  118. <view class="popupBor"></view>
  119. <view class="distribution text2" @click="show2 = false">取消</view>
  120. </u-popup>
  121. </view>
  122. </template>
  123. <script>
  124. import { mapState } from 'vuex';
  125. import Titlenav from '../components/Titlenav.vue';
  126. export default {
  127. components: { Titlenav },
  128. data() {
  129. return {
  130. takeout: [],
  131. name: '郝贞伟',
  132. show: false,
  133. show2: false,
  134. riderList: [
  135. {
  136. name: '郝贞伟',
  137. phone: '18789898888',
  138. id: 1
  139. },
  140. {
  141. name: '张三',
  142. phone: '110',
  143. id: 2
  144. },
  145. {
  146. name: '李四',
  147. phone: '120',
  148. id: 3
  149. }
  150. ],
  151. list: {
  152. transactionId: '2019052035464',
  153. createdAt: '2021-09-03 14:18:26',
  154. remark: '麻烦送到宿舍楼下的桌子上',
  155. packPrice: '2',
  156. distributionPrice: '2',
  157. total: '15',
  158. lists: [
  159. {
  160. price: '11',
  161. name: '寿司',
  162. id: 2,
  163. num: '1',
  164. image: 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-13-15-54-36URxMKUXs.jpg'
  165. }
  166. ]
  167. }
  168. };
  169. },
  170. onLoad(option) {
  171. this.show = option.status;
  172. },
  173. computed: {
  174. ...mapState(['systemInfo']),
  175. Show() {
  176. if (this.show == 'false') {
  177. return false;
  178. } else {
  179. return true;
  180. }
  181. }
  182. },
  183. methods: {
  184. Addrider(item) {
  185. this.name = item.name;
  186. this.show2 = false;
  187. },
  188. orderCopy() {
  189. uni.setClipboardData({
  190. data: this.list.transactionId + '',
  191. success(res) {
  192. uni.getClipboardData({
  193. success(res) {
  194. uni.showToast({
  195. title: '复制成功'
  196. });
  197. }
  198. });
  199. }
  200. });
  201. }
  202. },
  203. created() {
  204. this.takeout = this.list.lists;
  205. }
  206. };
  207. </script>
  208. <style lang="scss" scoped>
  209. .titlenav {
  210. background: #214bbe;
  211. height: 102px;
  212. .top {
  213. text-align: center;
  214. .title1 {
  215. font-size: 24px;
  216. font-weight: bold;
  217. color: #ffffff;
  218. line-height: 34px;
  219. padding: 10px 0 8px;
  220. }
  221. .title2 {
  222. font-size: 14px;
  223. font-weight: 400;
  224. color: #ffffff;
  225. line-height: 24px;
  226. }
  227. }
  228. }
  229. .borderTop {
  230. height: 5px;
  231. background: #f5f7fa;
  232. }
  233. /deep/ .u-btn {
  234. width: 162px;
  235. height: 48px;
  236. font-size: 16px;
  237. font-weight: 400;
  238. color: #ffffff;
  239. border-radius: 4px;
  240. }
  241. /deep/ .uni-scroll-view {
  242. min-height: 200px;
  243. border-radius: 12px 12px 10px 10px;
  244. .distribution {
  245. margin: 20px 0;
  246. text-align: center;
  247. font-size: 16px;
  248. font-weight: 400;
  249. color: #c9c9c9;
  250. line-height: 24px;
  251. &.text2{
  252. font-size: 17px;
  253. color: #000000;
  254. }
  255. }
  256. .popupBor{
  257. height: 8px;
  258. background: #F2F2F2;
  259. }
  260. .conPup {
  261. height: 56px;
  262. line-height: 56px;
  263. display: flex;
  264. align-items: center;
  265. justify-content: space-between;
  266. padding: 0 20px;
  267. border-bottom: 1px solid #f5f7fa;
  268. .add {
  269. font-size: 16px;
  270. font-weight: 400;
  271. color: #000000;
  272. line-height: 22px;
  273. margin-left: 6px;
  274. }
  275. .imgBox {
  276. width: 24px;
  277. height: 24px;
  278. }
  279. }
  280. }
  281. .btn {
  282. display: flex;
  283. align-items: center;
  284. position: fixed;
  285. justify-content: space-between;
  286. left: 0;
  287. right: 0;
  288. bottom: 0;
  289. z-index: 100;
  290. padding: 6px 20px;
  291. padding-bottom: 34px;
  292. padding-bottom: calc(34px + constant(safe-area-inset-bottom)); // 兼容 IOS<11.2
  293. padding-bottom: calc(34px + env(safe-area-inset-bottom)); // 兼容 IOS>=11.2
  294. background-color: #ffffff;
  295. .btn2 {
  296. color: #214bbe;
  297. }
  298. }
  299. .conBox {
  300. // padding-top: 50px;
  301. padding-bottom: 150px;
  302. .store {
  303. display: flex;
  304. align-items: center;
  305. justify-content: space-between;
  306. padding: 0 16px;
  307. .title {
  308. display: flex;
  309. align-items: center;
  310. .imgBox1 {
  311. width: 18px;
  312. height: 18px;
  313. }
  314. .canteen {
  315. font-size: 14px;
  316. color: #000000;
  317. line-height: 24px;
  318. font-weight: 400;
  319. padding-left: 6px;
  320. }
  321. }
  322. .store1 {
  323. font-size: 14px;
  324. font-weight: 400;
  325. color: #ff6c00;
  326. line-height: 24px;
  327. }
  328. }
  329. .border {
  330. padding: 0 16px;
  331. border-bottom: 1px solid #f5f7fa;
  332. margin: 10px 16px 16px;
  333. }
  334. .content {
  335. display: flex;
  336. justify-content: space-between;
  337. padding: 0 16px;
  338. margin-bottom: 16px;
  339. .ImgBox {
  340. display: flex;
  341. .ImgBox2 {
  342. width: 80px;
  343. height: 80px;
  344. border-radius: 8px;
  345. margin-right: 18px;
  346. }
  347. .name {
  348. font-size: 14px;
  349. font-weight: bold;
  350. line-height: 24px;
  351. color: #1c1c1c;
  352. }
  353. .name1 {
  354. font-size: 14px;
  355. font-weight: 400;
  356. color: #c8c9cc;
  357. line-height: 24px;
  358. }
  359. }
  360. .money {
  361. font-size: 16px;
  362. font-weight: bold;
  363. color: #1c1c1c;
  364. line-height: 26px;
  365. }
  366. }
  367. .order {
  368. margin-bottom: 4px;
  369. display: flex;
  370. align-items: center;
  371. justify-content: space-between;
  372. padding: 0 16px;
  373. .text1 {
  374. font-size: 13px;
  375. font-weight: 400;
  376. color: #939599;
  377. line-height: 24px;
  378. }
  379. .text2 {
  380. font-size: 13px;
  381. font-weight: 400;
  382. line-height: 22px;
  383. color: #1c1c1c;
  384. }
  385. &.order2 {
  386. margin-bottom: 14px;
  387. }
  388. }
  389. .text {
  390. display: flex;
  391. align-items: center;
  392. padding-right: 16px;
  393. place-content: flex-end;
  394. font-weight: bold;
  395. .text1 {
  396. font-size: 14px;
  397. color: #c8c9cc;
  398. line-height: 24px;
  399. }
  400. .text2 {
  401. font-size: 16px;
  402. color: #000000;
  403. line-height: 26px;
  404. }
  405. }
  406. .border2 {
  407. height: 5px;
  408. margin: 18px 0 20px;
  409. background: #f5f7fa;
  410. }
  411. .Line {
  412. height: 5px;
  413. margin-top: 18px;
  414. background: #f5f7fa;
  415. }
  416. .address {
  417. display: flex;
  418. justify-content: space-between;
  419. margin-bottom: 35px;
  420. padding: 0 16px;
  421. .choice {
  422. display: flex;
  423. align-items: center;
  424. .text1 {
  425. font-size: 16px;
  426. font-weight: 400;
  427. color: #214bbe;
  428. line-height: 24px;
  429. }
  430. .right {
  431. width: 12px;
  432. height: 24px;
  433. margin-left: 6px;
  434. }
  435. }
  436. .name {
  437. font-size: 14px;
  438. font-weight: bold;
  439. color: #000000;
  440. line-height: 20px;
  441. }
  442. .text1 {
  443. text-align: right;
  444. font-size: 16px;
  445. font-weight: 400;
  446. color: #000000;
  447. line-height: 24px;
  448. &.text2 {
  449. color: #ff7f1f;
  450. }
  451. }
  452. &.address2 {
  453. margin-bottom: 0;
  454. }
  455. &.rider {
  456. margin-bottom: 0;
  457. margin-top: 18px;
  458. }
  459. &.address3 {
  460. margin-top: 15px;
  461. }
  462. }
  463. .box {
  464. margin-bottom: 16px;
  465. padding: 0 16px;
  466. .box-con {
  467. align-items: center;
  468. display: flex;
  469. justify-content: space-between;
  470. .text1 {
  471. display: flex;
  472. span {
  473. width: 38px;
  474. height: 18px;
  475. border-radius: 2px;
  476. border: 1px solid #c8c9cc;
  477. font-size: 12px;
  478. font-weight: 400;
  479. color: #c8c9cc;
  480. line-height: 18px;
  481. text-align: center;
  482. margin-right: 3px;
  483. }
  484. }
  485. p {
  486. font-size: 13px;
  487. font-weight: 400;
  488. color: #939599;
  489. line-height: 24px;
  490. }
  491. .text2 {
  492. height: 22px;
  493. font-size: 13px;
  494. font-weight: 400;
  495. color: #000000;
  496. line-height: 22px;
  497. }
  498. }
  499. }
  500. }
  501. </style>