ship.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <view class="app-content">
  3. <view class="order-info_box">
  4. <view class="order-info-list">
  5. <view class="list-item">
  6. <text>订单号</text>
  7. <text>{{orderInfo.orderSn}}</text>
  8. </view>
  9. <view class="list-item">
  10. <text>下单时间</text>
  11. <text>{{orderInfo.addTime}}</text>
  12. </view>
  13. <!-- <view class="list-item">
  14. <text>商品名称</text>
  15. <text>{{2929323}}</text>
  16. </view> -->
  17. <view class="list-item">
  18. <text>金额</text>
  19. <text>{{orderInfo.actPrice}}</text>
  20. </view>
  21. </view>
  22. <image
  23. src="/static/images/default-img.png" mode="scaleToFill">
  24. </image>
  25. </view>
  26. <view class="step-content_box">
  27. <stepShip
  28. @sendConfirm="sendConfirm"
  29. @affirmSend="affirmSend"
  30. @selfSend="selfSend"
  31. @sendParcel="sendParcel"
  32. :orderComData="orderComData"
  33. :orderInfo="orderInfo">
  34. </stepShip>
  35. </view>
  36. <!-- 快递送 -->
  37. <modal-module
  38. :show="showSubmitModel"
  39. @cancel="modalCancel"
  40. @click="submitEvent"
  41. :title="titText"
  42. color="#333"
  43. :size="32"
  44. padding="30upx 30upx"
  45. >
  46. </modal-module>
  47. <!-- <kd-entrance></kd-entrance> -->
  48. </view>
  49. </template>
  50. <script>
  51. import stepShip from './components/stepShip'
  52. import { getDetB, orderSendDet, freight, thirdSend, selfSend, reachOrder,sendReach } from '@/api/order'
  53. import ModalModule from "@/components/plugin/modal";
  54. export default {
  55. name: 'admin-ship',
  56. components: {
  57. stepShip,
  58. ModalModule
  59. },
  60. data() {
  61. return {
  62. showSubmitModel: false,
  63. titText:'',
  64. orderInfo: {},
  65. orderComData: [],
  66. shipModal: false,
  67. form:{
  68. sendTime:'',
  69. sendSide: 2,
  70. sendCost: 0
  71. },
  72. sendSideText:'达达配送',
  73. deliveryList: [
  74. {
  75. text: "达达配送",
  76. key: 2
  77. },
  78. {
  79. text: "顺丰同城",
  80. key: 3
  81. },
  82. {
  83. text: "闪送",
  84. key: 4
  85. },
  86. {
  87. text: "美团",
  88. key: 5
  89. }
  90. ],
  91. timeList: [
  92. [
  93. "1",
  94. "2",
  95. "3",
  96. "4",
  97. "5",
  98. "6",
  99. "7",
  100. "8",
  101. "9",
  102. "10",
  103. "11",
  104. "12",
  105. "13",
  106. "14",
  107. "15",
  108. "16",
  109. "17",
  110. "18",
  111. "19",
  112. "20",
  113. "21",
  114. "22",
  115. "23",
  116. "24"
  117. ],
  118. ["00", "10", "20", "30", "40", "50"]
  119. ],
  120. currentTitType: {}
  121. }
  122. },
  123. onLoad() {
  124. // uni.showLoading({
  125. // title: '加载中...',
  126. // mask: true
  127. // })
  128. // this.init()
  129. },
  130. onShow(){
  131. // this.init()
  132. },
  133. methods: {
  134. init() {
  135. // this.showIndex = this.option.pageStatus || 0
  136. this._getDet()
  137. this._orderComDet()
  138. // this.freightCount()
  139. },
  140. sendConfirm(type){
  141. console.log(type)
  142. return sendReach({ id: this.option.id }).then(res => {
  143. this.init();
  144. })
  145. },
  146. _getDet() {
  147. // this.option.id
  148. return getDetB({ id: this.option.id }).then(res => {
  149. this.orderInfo = res.data
  150. console.log('res.data===>', res.data, this.orderInfo)
  151. })
  152. },
  153. _orderComDet() {
  154. orderSendDet({ id: this.option.id }).then(res => {
  155. this.orderComData = res.data
  156. })
  157. },
  158. // 快递送
  159. sendParcel(){
  160. this.pageTo({url: "/pagesOrder/shipInfo",query: {orderId:this.option.id,id: this.orderInfo.customId}});
  161. console.error('快递送')
  162. // this.shipModal = true;
  163. },
  164. // 计算运费
  165. freightCount(){
  166. freight({
  167. id: this.option.id,
  168. sendSide: this.form.sendSide,
  169. }).then(res=>{
  170. this.form.sendCost = res.data.sndCost
  171. })
  172. },
  173. //发货
  174. shipModalClick(e){
  175. if (e.index === 0){
  176. this.modalCancel()
  177. }else{
  178. thirdSend({
  179. id:this.option.id,
  180. ...this.form
  181. }).then(res=>{
  182. this.$msg('发货成功')
  183. this.init()
  184. this.modalCancel();
  185. })
  186. }
  187. },//关闭
  188. modalCancel(){
  189. this.shipModal = false;
  190. this.showSubmitModel = false
  191. }, // 自己送
  192. selfSend(val){
  193. let self = this;
  194. self.$util.confirmModal({content:'确定自己送货?'},() => {
  195. selfSend({
  196. id:self.option.id
  197. }).then(res=>{
  198. self.modalCancel()
  199. self.$msg('发货状态已更新')
  200. self.init()
  201. })
  202. })
  203. // // return;
  204. // this.currentTitType = val
  205. // this.titText = val.text;
  206. // this.showSubmitModel = true
  207. }, // 确认
  208. affirmSend(val){
  209. this.currentTitType = val
  210. this.titText = val.text;
  211. this.showSubmitModel = true
  212. }, // 确认送达 和 本店送
  213. submitEvent(e){
  214. if(e.index === 0) {
  215. this.modalCancel()
  216. }else{
  217. let updateStatue = this.currentTitType.type == 0? selfSend:reachOrder
  218. updateStatue({
  219. id:this.option.id
  220. }).then(res=>{
  221. this.modalCancel()
  222. this.$msg('发货状态已更新')
  223. this.init()
  224. })
  225. }
  226. },
  227. changeTimeFn(e){
  228. let oneIndex = e.detail.value[0] || 0;
  229. let twoIndex = e.detail.value[1] || 0;
  230. this.form.sendTime = this.timeList[0][oneIndex] + ":" + this.timeList[1][twoIndex];
  231. },
  232. changeDeliveryFn(e){
  233. this.form.sendSide = this.deliveryList[e.detail.value].key;
  234. this.sendSideText = this.deliveryList[e.detail.value].text;
  235. // 平台不同运费重新计算
  236. this.freightCount()
  237. },
  238. }
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. .app-content {
  243. // background-color: #fff;
  244. .ship-modal {
  245. .line-label {
  246. width: 140upx;
  247. }
  248. }
  249. }
  250. .order-info_box {
  251. display: flex;
  252. padding: 30upx;
  253. background-color: #FFFFFF;
  254. align-items: center;
  255. & .order-info-list {
  256. flex: 1;
  257. & .list-item {
  258. font-size: 28upx;
  259. font-weight: 400;
  260. & > text:nth-child(1) {
  261. color: #666666;
  262. display: inline-block;
  263. width: 140upx;
  264. }
  265. & > text:nth-child(1) {
  266. color: #333333;
  267. }
  268. }
  269. }
  270. & image {
  271. width: 146upx;
  272. height: 146upx;
  273. }
  274. }
  275. .order-fa_box {
  276. padding:20upx;
  277. border: 1upx solid #DDDDDD;
  278. border-radius: 4upx;
  279. margin-bottom: 20upx;
  280. & > .order-fa_info {
  281. padding-left: 20upx;
  282. & > .order-fa_top {
  283. display: flex;
  284. align-items: center;
  285. & > view:nth-child(1) {
  286. width: 40upx;
  287. height: 40upx;
  288. line-height: 40upx;
  289. text-align: center;
  290. background-color: #3385FF;
  291. color: #FFFFFF;
  292. font-size: 24upx;
  293. margin-right: 20upx;
  294. border-radius: 50%;
  295. }
  296. & > view:nth-child(2) {
  297. color: #333333;
  298. font-size: 32upx;
  299. font-weight: 600;
  300. color: #333333;
  301. }
  302. }
  303. & > view:nth-child(2) {
  304. padding-left: 60upx;
  305. text-align: left;
  306. color: #999999;
  307. font-size: 24upx;
  308. font-weight: 400;
  309. margin:25upx 0 19upx;
  310. }
  311. & > view:nth-child(3) {
  312. padding-left: 60upx;
  313. text-align: left;
  314. color: #333333;
  315. font-size: 24upx;
  316. font-weight: 400;
  317. margin:25upx 0 19upx;
  318. }
  319. }
  320. }
  321. </style>