index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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">
  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="margin: 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. },
  77. data() {
  78. return {
  79. lineHeight: 0,
  80. }
  81. },
  82. mounted() {
  83. const that = this;
  84. this.$nextTick(() => {
  85. const query = uni.createSelectorQuery().in(this);
  86. query.select('#myLineRef').boundingClientRect(data => {
  87. that.lineHeight = data.height;
  88. }).exec();
  89. });
  90. },
  91. methods: {
  92. formSubmit() {
  93. this.$emit('orderCilck', this.orderInfo.id);
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .order-item {
  100. background-color: #fff;
  101. border-radius: 23rpx;
  102. padding: 19rpx 38rpx;
  103. }
  104. .order-top {
  105. display: flex;
  106. align-items: center;
  107. justify-content: space-between;
  108. padding-bottom: 10rpx;
  109. border-bottom: 2rpx dashed #D6D7DC;
  110. }
  111. .bold-size {
  112. white-space: nowrap;
  113. overflow: hidden;
  114. text-overflow: ellipsis;
  115. font-weight: 500;
  116. font-size: 27rpx;
  117. color: #141414;
  118. }
  119. .onBold-size {
  120. font-weight: 400;
  121. font-size: 23rpx;
  122. color: #999999;
  123. }
  124. .order-content {
  125. padding: 45rpx 0;
  126. .box-item {
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. margin-bottom: 10rpx;
  131. }
  132. .order-info {
  133. width: 100%;
  134. background: #F8F9FB;
  135. padding: 19rpx 38rpx 45rpx 19rpx;
  136. .store-name {
  137. font-weight: 600;
  138. font-size: 27rpx;
  139. color: #141414;
  140. }
  141. .scroll-container {
  142. display: flex;
  143. flex-wrap: nowrap;
  144. margin: 20rpx 0;
  145. overflow-x: auto;
  146. /* 允许水平滚动 */
  147. white-space: nowrap;
  148. /* 防止项目换行 */
  149. -webkit-overflow-scrolling: touch;
  150. /* 在iOS上平滑滚动 */
  151. .item {
  152. display: flex;
  153. flex-direction: column;
  154. align-items: center;
  155. justify-content: center;
  156. margin-right: 19rpx;
  157. image {
  158. width: 115rpx;
  159. height: 115rpx;
  160. }
  161. text {
  162. font-weight: 400;
  163. font-size: 21rpx;
  164. color: #141414;
  165. margin-top: 9rpx;
  166. }
  167. }
  168. }
  169. .container2 {
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. font-weight: 500;
  174. font-size: 21rpx;
  175. color: #141414;
  176. view {
  177. display: flex;
  178. align-items: center;
  179. }
  180. .image2 {
  181. width: 42rpx;
  182. height: 42rpx;
  183. }
  184. }
  185. }
  186. }
  187. .order-dis {
  188. font-weight: 400;
  189. font-size: 23rpx;
  190. color: #141414;
  191. }
  192. .order-icon {
  193. display: inline-block;
  194. margin-left: 10rpx;
  195. margin-right: 20rpx;
  196. padding: 5rpx 10rpx;
  197. font-weight: 400;
  198. font-size: 23rpx;
  199. color: #FFFFFF;
  200. border-radius: 50%;
  201. background-color: $bg-color-primary;
  202. }
  203. .order-bottom {
  204. border-top: 2rpx dashed #D6D7DC;
  205. .bottom-but {
  206. padding: 39rpx 67rpx;
  207. .sub {
  208. width: 100%;
  209. background-color: $bg-color-primary;
  210. font-weight: 500;
  211. font-size: 31rpx;
  212. color: #FFFFFF;
  213. padding: 17rpx 0;
  214. }
  215. }
  216. }
  217. .icon-info {
  218. width: 8rpx;
  219. height: 31rpx;
  220. background: $bg-color-primary;
  221. margin-right: 15rpx;
  222. }
  223. .line {
  224. position: absolute;
  225. width: 2rpx;
  226. height: 100%;
  227. border-left: 2rpx dashed $bg-color-primary;
  228. }
  229. </style>