index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="order-item">
  3. <view class="order-top">
  4. <view>
  5. <text class="bold-size">配送费:¥ {{orderInfo.cost}}</text>
  6. </view>
  7. <view>
  8. <text class="onBold-size">期望时间:{{orderInfo.time}} 前送达</text>
  9. </view>
  10. </view>
  11. <view class="order-content">
  12. <view class="order-info" v-if="statusId !== 1">
  13. <text class="store-name">{{orderInfo.merName}}</text>
  14. <view class="scroll-container">
  15. <view class="item" v-for="(item, index) in orderInfo.orderInfoList" :key="index">
  16. <image :src="item.image" />
  17. <text>{{item.productName}}x{{item.payNum}}</text>
  18. </view>
  19. </view>
  20. <view class="container2">
  21. <view style="border-right: 2rpx solid #D5D6DC">
  22. <image src="/static/img/ic-iphone1.png" class="image2" />
  23. <text style="margin: 0 19rpx 0 15rpx;">联系商家</text>
  24. </view>
  25. <view>
  26. <text>客户姓名:{{orderInfo.name}}</text>
  27. </view>
  28. <view>
  29. <image src="/static/img/phone.png" class="image2" />
  30. <text style="margin-left: 15rpx">联系客户</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="bold-size flex-y-center" style="padding: 19rpx 0;">
  35. <view class="icon-info"></view>
  36. <text>配送详情</text>
  37. </view>
  38. <view style="padding-bottom: 39rpx;position: relative;" id="myLineRef">
  39. <view class="line"></view>
  40. <view class="box-item">
  41. <view class="bold-size">
  42. <text class="order-icon">取</text>{{orderInfo.merName}}
  43. </view>
  44. <!-- <view class="order-dis">{{orderInfo.shopDistance}} m</view> -->
  45. </view>
  46. <text class="onBold-size"><text class="order-icon" style="opacity: 0">取</text>{{orderInfo.merAddress}}</text>
  47. </view>
  48. <view>
  49. <view class="box-item">
  50. <view class="bold-size">
  51. <text class="order-icon">送</text>{{orderInfo.userAddress}}
  52. </view>
  53. <!-- <view class="order-dis">{{orderInfo.userDistance}} m</view> -->
  54. </view>
  55. <text class="onBold-size"><text class="order-icon" style="opacity: 0">送</text>备注:{{orderInfo.userRemarks}}</text>
  56. </view>
  57. </view>
  58. <view class="order-bottom" v-if="isButton">
  59. <view class="bottom-but">
  60. <button class="sub" @tap="formSubmit">接单</button>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. props: {
  68. orderInfo: {
  69. type: Object,
  70. default: {}
  71. },
  72. isButton: {
  73. type: Boolean,
  74. default: true
  75. },
  76. statusId: {
  77. type: Number,
  78. default: null
  79. }
  80. },
  81. data() {
  82. return {
  83. lineHeight: 0,
  84. }
  85. },
  86. mounted() {
  87. const that = this;
  88. this.$nextTick(() => {
  89. const query = uni.createSelectorQuery().in(this);
  90. query.select('#myLineRef').boundingClientRect(data => {
  91. that.lineHeight = data.height;
  92. }).exec();
  93. });
  94. },
  95. methods: {
  96. formSubmit() {
  97. this.$emit('orderCilck', this.orderInfo.id);
  98. }
  99. }
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. .order-item {
  104. background-color: #fff;
  105. border-radius: 23rpx;
  106. padding: 19rpx 38rpx;
  107. }
  108. .order-top {
  109. display: flex;
  110. align-items: center;
  111. justify-content: space-between;
  112. padding: 17rpx;
  113. border-bottom: 2rpx dashed #D6D7DC;
  114. }
  115. .bold-size {
  116. white-space: nowrap;
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. font-weight: 500;
  120. font-size: 27rpx;
  121. color: #141414;
  122. z-index: 9999;
  123. }
  124. .onBold-size {
  125. font-weight: 400;
  126. font-size: 23rpx;
  127. color: #999999;
  128. }
  129. .order-content {
  130. padding: 17rpx 0 38rpx 0;
  131. .box-item {
  132. display: flex;
  133. align-items: center;
  134. justify-content: space-between;
  135. margin-bottom: 10rpx;
  136. }
  137. .order-info {
  138. width: 100%;
  139. background: #F8F9FB;
  140. padding: 19rpx 38rpx 45rpx 19rpx;
  141. .store-name {
  142. font-weight: 600;
  143. font-size: 27rpx;
  144. color: #141414;
  145. }
  146. .scroll-container {
  147. display: flex;
  148. flex-wrap: nowrap;
  149. margin: 20rpx 0;
  150. overflow-x: auto;
  151. /* 允许水平滚动 */
  152. white-space: nowrap;
  153. /* 防止项目换行 */
  154. -webkit-overflow-scrolling: touch;
  155. /* 在iOS上平滑滚动 */
  156. .item {
  157. display: flex;
  158. flex-direction: column;
  159. align-items: center;
  160. justify-content: center;
  161. margin-right: 19rpx;
  162. image {
  163. width: 115rpx;
  164. height: 115rpx;
  165. }
  166. text {
  167. font-weight: 400;
  168. font-size: 21rpx;
  169. color: #141414;
  170. margin-top: 9rpx;
  171. }
  172. }
  173. }
  174. .container2 {
  175. display: flex;
  176. justify-content: space-between;
  177. align-items: center;
  178. font-weight: 500;
  179. font-size: 21rpx;
  180. color: #141414;
  181. view {
  182. display: flex;
  183. align-items: center;
  184. }
  185. .image2 {
  186. width: 42rpx;
  187. height: 42rpx;
  188. }
  189. }
  190. }
  191. }
  192. .order-dis {
  193. font-weight: 400;
  194. font-size: 23rpx;
  195. color: #141414;
  196. }
  197. .order-icon {
  198. display: inline-block;
  199. margin-left: 10rpx;
  200. margin-right: 20rpx;
  201. padding: 5rpx 10rpx;
  202. font-weight: 400;
  203. font-size: 23rpx;
  204. color: #FFFFFF;
  205. border-radius: 50%;
  206. background-color: $bg-color-primary;
  207. }
  208. .order-bottom {
  209. border-top: 2rpx dashed #D6D7DC;
  210. .bottom-but {
  211. padding: 39rpx 67rpx;
  212. .sub {
  213. width: 100%;
  214. background-color: $bg-color-primary;
  215. font-weight: 500;
  216. font-size: 31rpx;
  217. color: #FFFFFF;
  218. padding: 17rpx 0;
  219. }
  220. }
  221. }
  222. .icon-info {
  223. width: 8rpx;
  224. height: 31rpx;
  225. background: $bg-color-primary;
  226. margin-right: 15rpx;
  227. }
  228. .line {
  229. z-index: 1;
  230. position: absolute;
  231. left: 28rpx;
  232. width: 1rpx;
  233. height: 100%;
  234. border-left: 1rpx dashed $bg-color-primary;
  235. }
  236. </style>