stepShip.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <view class="step-content_box">
  3. <view
  4. v-if="!$util.isEmpty(orderComData)"
  5. class="step-view_box"
  6. >
  7. <view
  8. v-for="(item,index) in orderComData"
  9. :key="index"
  10. class="step-li_box"
  11. >
  12. <view class="step-head_box">
  13. <view
  14. v-if="index == 0"
  15. class="step-icon_num"
  16. >
  17. <view class="dot"></view>
  18. </view>
  19. <view
  20. v-else
  21. class="step-icon-def"
  22. >
  23. <view class="dot"></view>
  24. </view>
  25. <view
  26. v-if="stepList.length - 1 !== index "
  27. class="step-line"
  28. ></view>
  29. </view>
  30. <view class="step-main_box">
  31. <view class="step-tit">{{item.actionName}}</view>
  32. <view class="step-content_box">
  33. <!-- 送达 -->
  34. <template v-if="item.actionSign === 'reach'">
  35. <view class="reach-content_box">
  36. <button
  37. @click="affirmSend(item)"
  38. v-if="item.status == 0"
  39. class="admin-button-com blue big"
  40. >
  41. 确认送达
  42. </button>
  43. <view
  44. v-else
  45. class="reach-time_box"
  46. >
  47. {{item.finishTime}}
  48. </view>
  49. </view>
  50. </template>
  51. <!-- 发货 -->
  52. <template v-else-if="item.actionSign === 'deliver'">
  53. <!-- 没有选择发货方式0 -->
  54. <view
  55. v-if="item.option == 0&&item.status == 0"
  56. class="deliver-opiton_0"
  57. >
  58. <button
  59. @click="selfSend"
  60. class="admin-button-com blue big"
  61. >
  62. 本店送
  63. </button>
  64. <button
  65. @click="sendParcel"
  66. class="admin-button-com blue big"
  67. v-if="orderInfo.customId != '0'"
  68. >
  69. 发快递
  70. </button>
  71. </view>
  72. <view
  73. v-else-if="item.option == 1"
  74. class="deliver-opiton_1"
  75. >
  76. <view class="shipments-status_box">
  77. <view class="reach-time_box">{{item.finishTime}}</view>
  78. <view>本店送</view>
  79. <button
  80. v-if="item.status!=1"
  81. @click="sendConfirm('本店送')"
  82. class="admin-button-com blue big"
  83. >确定送达</button>
  84. </view>
  85. </view>
  86. <view
  87. v-else-if="item.option == 2"
  88. class="deliver-opiton_1"
  89. >
  90. <view class="shipments-status_box">
  91. <view>配送方: {{item.sendInfo.expressName}}</view>
  92. <view>距离: {{item.sendInfo.distance}}km</view>
  93. <view>运费: {{item.sendInfo.cost}}</view>
  94. <view>小费: {{item.sendInfo.tip}}</view>
  95. <!--1待接单 2已接单 3已完成 4已取消-->
  96. <view>
  97. 状态: <text :class="[item.sendInfo.status==1||item.sendInfo.status==4?'colorRed':'colorBlue']">{{item.sendInfo.status==1?'待接单':item.sendInfo.status==2?'已接单':item.sendInfo.status==3?'已完成':'已取消'}} </text>
  98. </view>
  99. <button
  100. v-if="item.status!=1"
  101. @click="sendConfirm('发快递')"
  102. class="admin-button-com blue big"
  103. >确定送达</button>
  104. </view>
  105. </view>
  106. <!-- template -->
  107. </template>
  108. <!-- 下单 -->
  109. <template v-if="item.actionSign === 'placeOrder'">
  110. <view class="placeOrder-cotent_box">
  111. {{item.addTime}}
  112. </view>
  113. </template>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. export default {
  122. name: 'stepShip',
  123. comments: {
  124. },
  125. props: {
  126. orderComData: {
  127. type: Array,
  128. default: () => []
  129. },
  130. orderInfo: {
  131. type: Object,
  132. default: () => {}
  133. }
  134. },
  135. data () {
  136. return {
  137. }
  138. },
  139. mounted () {
  140. console.log('this.orderInfo===>', this.orderInfo)
  141. },
  142. methods: {
  143. // type 本店送-发快递
  144. // 确认送达
  145. sendConfirm (type) {
  146. let self = this;
  147. uni.showModal({
  148. title: '提示', content: type == '本店送' ? '确认送到了?' : '快递送到后会自动确认,需要自己确定?',
  149. success: function (res) {
  150. if (res.confirm) {
  151. self.$emit('sendConfirm', type)
  152. }
  153. }
  154. });
  155. },
  156. // 发快递
  157. sendParcel () {
  158. this.$emit('sendParcel')
  159. },
  160. // 本店送
  161. selfSend () {
  162. this.$emit('selfSend', {
  163. type: 0,
  164. text: '确认自己送货?'
  165. })
  166. },
  167. //确认送达
  168. affirmSend () {
  169. // "option": 【0没有选择 1本店送 2发快递】
  170. this.$emit('affirmSend', {
  171. type: 1,
  172. text: item.option == 1 ? '确认送到了吗?' : '快递送到后会自动帮你确认,确认要自己操作吗?'
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .step-content_box {
  180. padding-bottom: 50upx;
  181. }
  182. .step-view_box {
  183. margin-top: 20px;
  184. padding: 40px 25px 0px 20px;
  185. background-color: #ffffff;
  186. & .step-li_box {
  187. display: flex;
  188. & > .step-head_box {
  189. position: relative;
  190. & > .step-icon-def {
  191. width: 40px;
  192. height: 40px;
  193. background-color: transparent;
  194. position: relative;
  195. & .dot {
  196. width: 12upx;
  197. height: 12upx;
  198. background-color: #d8d8d8;
  199. border-radius: 50%;
  200. position: absolute;
  201. left: 50%;
  202. top: 50%;
  203. transform: translate(-50%, -50%);
  204. }
  205. }
  206. & > .step-icon_num {
  207. width: 40px;
  208. height: 40px;
  209. border-radius: 50%;
  210. background-color: #fdc3b8;
  211. // color: #FFFFFF;
  212. // font-size: 28px;
  213. position: relative;
  214. z-index: 50;
  215. & > .dot {
  216. width: 22upx;
  217. height: 22upx;
  218. border-radius: 50%;
  219. background-color: #f51608;
  220. position: absolute;
  221. left: 50%;
  222. top: 50%;
  223. transform: translate(-50%, -50%);
  224. }
  225. }
  226. & > .step-line {
  227. height: 100%;
  228. width: 0px;
  229. border-left: 1px solid #e2e4e8;
  230. position: absolute;
  231. left: 50%;
  232. top: 50%;
  233. transform: translate(-50%, -50%);
  234. z-index: 45;
  235. }
  236. }
  237. & > .step-main_box {
  238. flex: 1;
  239. padding-left: 20px;
  240. & .step-tit {
  241. color: #141f25;
  242. font-size: 32px;
  243. font-weight: 600;
  244. }
  245. & .step-content_box {
  246. & .reach-content_box {
  247. padding: 40upx 0 0upx;
  248. & > .admin-button-com {
  249. width: 100%;
  250. }
  251. & > .reach-time_box {
  252. color: #333333;
  253. font-size: 24;
  254. font-weight: 600;
  255. }
  256. }
  257. & .deliver-opiton_0 {
  258. padding: 60px 0 0px;
  259. & > .admin-button-com:nth-child(1) {
  260. margin-right: 20px;
  261. }
  262. & > .admin-button-com {
  263. width: 310px;
  264. height: 90px;
  265. padding: 0;
  266. line-height: 90px;
  267. text-align: center;
  268. }
  269. }
  270. & .shipments-status_box {
  271. padding-top: 20px;
  272. & > view {
  273. color: #666666;
  274. font-size: 24px;
  275. font-weight: 400;
  276. line-height: 50px;
  277. &.reach-time_box {
  278. font-weight: 600;
  279. }
  280. .colorRed {
  281. color: #f51608;
  282. }
  283. .colorBlue {
  284. color: #049e2c;
  285. }
  286. }
  287. }
  288. & .placeOrder-cotent_box {
  289. color: #666666;
  290. font-size: 24upx;
  291. font-weight: 600;
  292. padding-top: 20upx;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>