orderDetail.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323
  1. <template>
  2. <view class="container">
  3. <view class="order-status">
  4. {{info.order_status==0?'待支付': info.order_status==1?'待配送' :info.order_status==2?'配送中':
  5. info.order_status==3?'已完成':info.order_status==4?'已取消':info.order_status==5?'已退款':
  6. info.order_status==6?'部分退款':info.order_status==7?'待自提':''}}
  7. <!-- {{info.is_pay == 1?info.cancel_status==2?'已退款':'已支付':'待支付'}} -->
  8. </view>
  9. <view class="page-block" v-if="info.state == 2 && info.is_pay == 1 &&info.cancel_status!=2">
  10. <view class="page-title-block">
  11. <view class="title">配送信息</view>
  12. </view>
  13. <view class="content">
  14. <view class="cell flex" v-if="info.is_send==0&&info.is_pay == 1">
  15. <view class="title-block required">
  16. <text>配送状态:</text>
  17. </view>
  18. <view class="desc flex-y-center box-pack-between">
  19. <text></text>
  20. <view class="info text-r flex-y-center" @click="bindSend('center')">
  21. {{info.is_send==1?'已配送':'点击开始配送'}}
  22. <view :class="info.is_send==0?'arr-r':''"></view>
  23. </view>
  24. </view>
  25. </view>
  26. <block v-if="info.is_send==1 && info.is_dd==2">
  27. <view class="cell flex flex-y-center" @click="bindOpen('bottom')">
  28. <view class="title-block required">
  29. <text>配送状态:</text>
  30. </view>
  31. <view class="desc arr-r flex-y-center">
  32. <view class="info" style="color: red;">{{juheInfo.statusMsg}}</view>
  33. </view>
  34. </view>
  35. </block>
  36. <block v-if="info.is_send==1 && info.is_dd==1">
  37. <view class="cell flex flex-y-center">
  38. <view class="title-block required">
  39. <text>配送状态:</text>
  40. </view>
  41. <view class="desc">
  42. <view class="info" style="color: red;">{{obj.statusMsg}}</view>
  43. </view>
  44. </view>
  45. <view class="cell flex flex-y-center" v-if="obj.transporterName">
  46. <view class="title-block required">
  47. <text>骑手名字:</text>
  48. </view>
  49. <view class="desc">
  50. <view class="info ">{{obj.transporterName}}</view>
  51. </view>
  52. </view>
  53. <view class="cell flex flex-y-center" v-if="obj.transporterPhone">
  54. <view class="title-block required">
  55. <text>联系方式:</text>
  56. </view>
  57. <view class="desc flex-y-center" @click="makePhoneCall(obj.transporterPhone)">
  58. <view class="info flex-y-center">
  59. <image src="../static/images/tel.png"></image> <text>{{obj.transporterPhone}}</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="cell flex flex-y-center" v-if="obj.transporterPhone">
  64. <view class="title-block required">
  65. <text>接单时间:</text>
  66. </view>
  67. <view class="desc">
  68. <view class="info">{{obj.acceptTime}}</view>
  69. </view>
  70. </view>
  71. </block>
  72. </view>
  73. </view>
  74. <view class="page-block">
  75. <view class="page-title-block">
  76. <view class="title">订单信息</view>
  77. </view>
  78. <view class="content">
  79. <view class="cell flex flex-y-center" v-if="info.state == 1">
  80. <view class="title-block required">
  81. <text>取单号:</text>
  82. </view>
  83. <view class="desc">
  84. <view class="flex flex-y-center">
  85. <view class="info">{{info.number||info.id}}</view>
  86. <view class="qc-btn" @click="onQucan" v-if="info.no_meal == 1">
  87. {{info.no_meal == 1?'请取餐':'再次通知取餐'}}
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="cell flex flex-y-center">
  93. <view class="title-block required">
  94. <text>总金额:</text>
  95. </view>
  96. <view class="desc">
  97. <view class="info" style="color:#FEAF44">¥{{info.total_price}}</view>
  98. </view>
  99. </view>
  100. <view class="cell flex flex-y-center" v-if="Number(info.member_discount)>0">
  101. <view class="title-block required">
  102. <text>会员折扣:</text>
  103. </view>
  104. <view class="desc">
  105. <view class="info" style="color:#FEAF44">{{info.discount}}折 | -¥{{info.member_discount}}</view>
  106. </view>
  107. </view>
  108. <view class="cell flex flex-y-center" v-if="info.coupon_content">
  109. <view class="title-block required">
  110. <text>优惠劵:</text>
  111. </view>
  112. <view class="desc">
  113. <view class="coupon-name">支付宝官方券</view>
  114. <view class="info" style="color:#FEAF44">扫码点餐立减券 -¥{{info.coupon_price}}</view>
  115. </view>
  116. </view>
  117. <view class="cell flex flex-y-center" v-if="info.coupon_id">
  118. <view class="title-block required">
  119. <text>优惠劵:</text>
  120. </view>
  121. <view class="desc">
  122. <view class="coupon-name">平台券</view>
  123. <view class="info" style="color:#FEAF44">-¥{{info.coupon_price}}</view>
  124. </view>
  125. </view>
  126. <view class="cell flex flex-y-center">
  127. <view class="title-block required">
  128. <text>支付金额:</text>
  129. </view>
  130. <view class="desc">
  131. <view class="info" style="color:#FEAF44">¥{{info.pay_price}}</view>
  132. </view>
  133. </view>
  134. <view class="cell flex flex-y-center" v-if="Number(info.delivery_price)>0">
  135. <view class="title-block required">
  136. <text>平台配送费:</text>
  137. </view>
  138. <view class="desc">
  139. <view class="info" style="color:#FEAF44">¥{{info.delivery_price}}</view>
  140. </view>
  141. </view>
  142. <view class="cell flex flex-y-center" v-if="Number(info.refund_price)>0">
  143. <view class="title-block required">
  144. <text>退款金额:</text>
  145. </view>
  146. <view class="desc">
  147. <view class="info" style="color:#FEAF44">¥{{info.refund_price}}</view>
  148. </view>
  149. </view>
  150. <view class="cell flex flex-y-center" v-if="info.remark">
  151. <view class="title-block required">
  152. <text>订单备注:</text>
  153. </view>
  154. <view class="desc">
  155. <view class="info">{{info.remark}}</view>
  156. </view>
  157. </view>
  158. <view class="cell flex flex-y-center" v-if="info.content&&info.is_pay == 2">
  159. <view class="title-block required">
  160. <text>金额备注:</text>
  161. </view>
  162. <view class="desc">
  163. <view class="info">{{info.content}}</view>
  164. </view>
  165. </view>
  166. <view class="cell flex flex-y-center" v-if="info.is_pay">
  167. <view class="title-block required">
  168. <text>支付方式:</text>
  169. </view>
  170. <view class="desc flex flex-y-center">
  171. <image
  172. :src="info.pay_type == 1?'../../static/images/wx.png':info.pay_type == 2?'../../static/images/ali.png':'../static/images/yu.png'"
  173. mode="aspectFit" class="pay-type-icon"></image>
  174. <view class="info">{{info.pay_type == 1?'微信支付': info.pay_type == 2?'支付宝支付':'余额支付'}}</view>
  175. </view>
  176. </view>
  177. <view class="cell flex flex-y-center">
  178. <view class="title-block required">
  179. <text>订单编号:</text>
  180. </view>
  181. <view class="desc">
  182. <view class="info">{{info.order_no}} <text @click="copy(info.order_no)"
  183. style="color:#00BFFF;margin-left: 20rpx;"> 复制</text></view>
  184. </view>
  185. </view>
  186. <view class="cell flex flex-y-center" v-if="info.check">
  187. <view class="title-block required">
  188. <text>交易单号:</text>
  189. </view>
  190. <view class="desc">
  191. <view class="info">{{info.check}}</view>
  192. <text @click="copy(info.check)" style="color:#00BFFF;margin-left: 20rpx;"> 复制</text>
  193. </view>
  194. </view>
  195. <view class="cell flex flex-y-center" v-if="info.is_pay">
  196. <view class="title-block required">
  197. <text>支付时间:</text>
  198. </view>
  199. <view class="desc">
  200. <view class="info">{{info.pay_time}}</view>
  201. </view>
  202. </view>
  203. <view class="cell flex flex-y-center">
  204. <view class="title-block required">
  205. <text>购买门店:</text>
  206. </view>
  207. <view class="desc">
  208. <view class="info">{{info.store_name}}</view>
  209. </view>
  210. </view>
  211. <view class="cell flex flex-y-center">
  212. <view class="title-block required">
  213. <text>下单方式:</text>
  214. </view>
  215. <view class="desc">
  216. <view class="info" v-if="info.state==1">堂食</view>
  217. <view class="info" v-else-if="info.state == 2">外卖</view>
  218. <view class="info" v-else-if="info.state == 3">自提</view>
  219. <view class="info" v-else>快速收款</view>
  220. </view>
  221. <view class="zt-btn" v-if="info.order_status == 7 && info.state ==3 " @click="confirmZiti">
  222. 确认自提
  223. </view>
  224. </view>
  225. <view class="cell flex flex-y-center" v-if="info.table_name">
  226. <view class="title-block required">
  227. <text>位置号:</text>
  228. </view>
  229. <view class="desc">
  230. <view class="info">{{info.table_name}}</view>
  231. </view>
  232. </view>
  233. <block v-if="info.state == 3">
  234. <view class="cell flex flex-y-center">
  235. <view class="title-block required">
  236. <text>自提人:</text>
  237. </view>
  238. <view class="desc">
  239. <view class="info">{{info.name}}</view>
  240. </view>
  241. </view>
  242. <view class="cell flex flex-y-center">
  243. <view class="title-block required">
  244. <text>联系电话:</text>
  245. </view>
  246. <view class="desc">
  247. <view class="info">{{info.mobile}}</view>
  248. </view>
  249. </view>
  250. </block>
  251. <block v-if="info.state == 2">
  252. <view class="cell flex flex-y-center">
  253. <view class="title-block required">
  254. <text>收货人:</text>
  255. </view>
  256. <view class="desc">
  257. <view class="info">{{info.name||''}}</view>
  258. </view>
  259. </view>
  260. <view class="cell flex flex-y-center">
  261. <view class="title-block required">
  262. <text>收货地址:</text>
  263. </view>
  264. <view class="desc">
  265. <view class="info">{{info.address||''}}</view>
  266. </view>
  267. </view>
  268. <view class="cell flex flex-y-center">
  269. <view class="title-block required">
  270. <text>联系电话:</text>
  271. </view>
  272. <view class="desc">
  273. <view class="info">{{info.mobile||''}}</view>
  274. </view>
  275. </view>
  276. </block>
  277. </view>
  278. <view class="content" v-if="is_stup_price&&info.is_pay == 0">
  279. <view class="cell flex flex-y-center">
  280. <view class="title-block required">
  281. <text>修改后的金额:</text>
  282. </view>
  283. <view class="desc" style="border: 1rpx solid #f1f1f1; padding: 20rpx 10rpx;">
  284. <input class="info" @input="getPrice" type="digit" placeholder="请输入修改金额"></input>
  285. </view>
  286. </view>
  287. <view class="cell flex flex-y-center">
  288. <view class="title-block required">
  289. <text>备注:</text>
  290. </view>
  291. <view class="desc" style="border: 1rpx solid #f1f1f1; padding: 20rpx 10rpx;">
  292. <input class="info" @input="getContent" placeholder="请输入备注"></input>
  293. </view>
  294. </view>
  295. </view>
  296. </view>
  297. <view class="page-block" v-if="info.type!= 3">
  298. <view class="page-title-block">
  299. <view class="title">商品信息</view>
  300. </view>
  301. <view class="content">
  302. <view class="goods flex box-pack-between" v-for="(item,index) in goods_list" :key="index">
  303. <view class="flex">
  304. <image class="goods_list-img" :src="URL+item.spec_image"></image>
  305. <view class="name">
  306. <text> {{item.name}}</text>
  307. <view class="">
  308. ×{{item.num}}
  309. </view>
  310. </view>
  311. </view>
  312. <view class="">
  313. <view class="price">
  314. ¥{{item.unit_price}}
  315. </view>
  316. <view class="ft26 text-r">
  317. {{item.is_refund==1?'已退款':''}}
  318. </view>
  319. </view>
  320. </view>
  321. </view>
  322. </view>
  323. <view class="btm-btn-block-content">
  324. <view class="box-pack-between btm-btn-block">
  325. <view class="btn btn12" v-if="info.is_pay == 1 &&info.cancel_status==3">
  326. 已驳回退款
  327. </view>
  328. <view class="btn btn12" :style="info.cancel_status==2?'width: 325rpx':''"
  329. v-if="info.is_pay == 1&&info.cancel_status==2">
  330. 已退款
  331. </view>
  332. <view class="btn btn11" @click="bindRefund"
  333. v-if="info.is_pay == 1 && info.cancel_status!=2&&info.cancel_status!=3">
  334. 退款
  335. </view>
  336. <view class="btn btn11" v-if="info.is_pay == 1&&info.cancel_status!=2"
  337. @click="bindPartRefund('center')">
  338. 部分退款
  339. </view>
  340. <view class="btn btn11" :style="info.cancel_status==2?'width: 325rpx':''" @click="bindPrinter"
  341. v-if="info.is_pay == 1">
  342. 打印小票
  343. </view>
  344. </view>
  345. <view class="box-pack-between btm-btn-block">
  346. <view class="btn btn11" :style="info.cancel_status==2?'width: 325rpx':''" @click="bindCancal"
  347. v-if="info.order_status==2">
  348. 取消配送
  349. </view>
  350. <view class="btn btn11" :style="info.cancel_status==2?'width: 325rpx':''" @click="bindShop"
  351. v-if="info.order_status==2">
  352. 改换商家配送
  353. </view>
  354. </view>
  355. <view class="btm-btn-block flex-center">
  356. <view class="btn btn11" style="width: 325rpx;" v-if="info.is_pay == 0" @click="bindStupPrice">
  357. {{is_stup_price?'确定修改金额':'修改订单金额'}}
  358. </view>
  359. <view class="btn btn11" style="width: 325rpx;margin-left:20rpx;"
  360. v-if="info.is_pay == 0 && info.state == 4" @click="getPayStatus">
  361. 查询支付结果
  362. </view>
  363. </view>
  364. </view>
  365. <!-- 纵向排列 -->
  366. <uni-popup ref="popup" :type="type">
  367. <view class="model-content" v-if="type=='bottom'">
  368. <view class="flex-y-center model-content-title box-pack-between">
  369. <text style="width: 50rpx;"></text>
  370. 订单跟踪
  371. <text @click="onClose" class="iconfont iconquchu"></text>
  372. </view>
  373. <scroll-view scroll-y="true" style="height: 700rpx;">
  374. <uni-steps :options="options" :active-color="setColor" direction="column"
  375. :active="Number(options.length)"></uni-steps>
  376. </scroll-view>
  377. </view>
  378. <view class="model-content-center" v-if="type=='center'">
  379. <block v-if="isRefund">
  380. <form @submit="onSubmit">
  381. <view class="model-refund-title">
  382. 部分退款
  383. </view>
  384. <view class="content">
  385. <view style="padding-left: 20rpx;">
  386. <view class="flex-y-center amount-text">
  387. 总金额:¥{{info.total_price}}
  388. </view>
  389. <view class="flex-y-center amount-text">
  390. 支付金额:¥{{info.pay_price}}
  391. </view>
  392. </view>
  393. <scroll-view scroll-y="true" style="height: 500rpx;">
  394. <view class="goods flex-y-center " v-for="(item,index) of refundGoods" :key="index">
  395. <view class="round" :data-i="item.checked" @click="bindRefundGoods(index)"
  396. v-if="is_refund">
  397. <view v-if="item.checked">
  398. <icon type="success_no_circle" size="16" />
  399. </view>
  400. </view>
  401. <view class="box-pack-between flex-grow-1">
  402. <view class="flex">
  403. <image class="goods_list-img" :src="URL+item.spec_image"></image>
  404. <view class="name">
  405. <text> {{item.name}}</text>
  406. <view>
  407. ×{{item.num}}
  408. </view>
  409. </view>
  410. </view>
  411. <view class="price">¥{{item.unit_price}}</view>
  412. </view>
  413. </view>
  414. </scroll-view>
  415. <view style="padding-left: 20rpx;">
  416. <view class="flex-y-center amount-text">
  417. 已退金额:¥{{info.refund_price}}
  418. </view>
  419. <view class="flex-y-center amount-refund amount-text">
  420. 退款金额: ¥
  421. <view class="amount-input">
  422. <input type="digit" name="refund_price" v-model="amountMoney"
  423. placeholder="请输入退款金额" />
  424. </view>
  425. </view>
  426. </view>
  427. </view>
  428. <view class="flex-y-center model-refund-btn">
  429. <view class="flex-grow-1 flex-center cancel" @click="cancel">
  430. 取消
  431. </view>
  432. <button hover-class="none" form-type="submit" class="flex-grow-1 flex-center submit">
  433. 确认退款
  434. </button>
  435. </view>
  436. </form>
  437. </block>
  438. <block v-if="isPeiSong">
  439. <view class="model-refund-title">
  440. 配送模式
  441. </view>
  442. <view class="flex" style="height: 250rpx;">
  443. <view class="flex-grow-1">
  444. <view class="model-content-peiSong" :class="peiType==item.type?'act':''"
  445. @click="bindPei(item.type)" v-for="(item,index) of peiArr" :key='index'>
  446. {{item.title}}
  447. </view>
  448. </view>
  449. <view v-if="peiType==3" class="flex-grow-1" style="border-left: 1px solid #F1F1F1;">
  450. <scroll-view scroll-y="true" style="height: 250rpx;">
  451. <view class="flex-center pd10 ft28" :class="logisticType==item.logistic?'act':''"
  452. v-for="(item,index) of peiDl" :key='index' @click="bindPeiTwp(item.logistic)">
  453. {{item.name}}
  454. </view>
  455. </scroll-view>
  456. </view>
  457. </view>
  458. <view class="flex-y-center model-refund-btn">
  459. <view class="flex-grow-1 flex-center cancel" @click="cancel">
  460. 取消
  461. </view>
  462. <button hover-class="none" @click="bindPeiCofig" class="flex-grow-1 flex-center submit">
  463. 立即配送
  464. </button>
  465. </view>
  466. </block>
  467. </view>
  468. </uni-popup>
  469. </view>
  470. </template>
  471. <script>
  472. export default {
  473. data() {
  474. return {
  475. URL: getApp().globalData.URL,
  476. id: "",
  477. info: {},
  478. goods_list: [],
  479. obj: {},
  480. is_stup_price: false,
  481. juheInfo: {},
  482. options: [],
  483. setColor: '#007AFF',
  484. type: 'center',
  485. refundGoods: [],
  486. is_refund: true,
  487. amountMoney: 0,
  488. ids: [],
  489. isRefund: false,
  490. isPeiSong: false,
  491. peiArr: [{
  492. title: "省钱",
  493. type: 1,
  494. }, {
  495. title: "最快",
  496. type: 2,
  497. }, {
  498. title: "指派",
  499. type: 3,
  500. }, {
  501. title: "价格从低到高依次呼叫",
  502. type: 4,
  503. }, ],
  504. peiDl: [{
  505. name: "美团",
  506. logistic: "mtps",
  507. },
  508. {
  509. name: "蜂鸟",
  510. logistic: "fengniao",
  511. },
  512. {
  513. name: "达达",
  514. logistic: "dada",
  515. },
  516. {
  517. name: "顺丰",
  518. logistic: "shunfeng",
  519. },
  520. {
  521. name: "闪送",
  522. logistic: "bingex",
  523. },
  524. {
  525. name: "UU跑腿",
  526. logistic: "uupt",
  527. }, {
  528. name: "点我达",
  529. logistic: "dianwoda",
  530. },
  531. {
  532. name: "爱跑腿",
  533. logistic: "aipaotui",
  534. },
  535. {
  536. name: "曹操",
  537. logistic: "caocao",
  538. },
  539. {
  540. name: "帮啦",
  541. logistic: "bangla",
  542. },
  543. ],
  544. peiType: null,
  545. logisticType: null,
  546. ps_mode: null
  547. }
  548. },
  549. onLoad(options) {
  550. this.id = options.id;
  551. this.getData()
  552. this.peisongset_list();
  553. },
  554. methods: {
  555. //刷新支付结果(扫码收款订单)
  556. getPayStatus() {
  557. this.request({
  558. url: 'smdcshop/searchWxOrder',
  559. data: {
  560. order_id: this.info.id
  561. }
  562. }).then(res => {
  563. if (res.code == "200") {
  564. uni.showModal({
  565. content: res.message,
  566. showCancel: false,
  567. success: r => {
  568. this.getData();
  569. }
  570. })
  571. }
  572. })
  573. },
  574. confirmZiti() {
  575. uni.showModal({
  576. title: '提示',
  577. content: '确定是否自提?',
  578. showCancel: true,
  579. cancelText: '取消',
  580. confirmText: '确认',
  581. success: res => {
  582. if (res.confirm) {
  583. this.request({
  584. url: 'Smdcshop/complete_ziti',
  585. data: {
  586. order_id: this.info.id
  587. }
  588. }).then(res => {
  589. if (res.code == "200") {
  590. uni.showToast({
  591. title: res.message,
  592. icon: 'none'
  593. })
  594. setTimeout(() => {
  595. this.getData();
  596. }, 2000)
  597. }
  598. })
  599. }
  600. }
  601. })
  602. },
  603. peisongset_list() {
  604. this.request({
  605. url: 'Smdcshop/peisongset_list',
  606. data: {
  607. store_id: uni.getStorageSync("store_id")
  608. }
  609. }).then(res => {
  610. if (res.code == "200") {
  611. this.ps_mode = res.data.ps_mode;
  612. }
  613. })
  614. },
  615. cancel() {
  616. this.$refs.popup.close();
  617. },
  618. bindPartRefund(type) {
  619. this.type = type;
  620. this.isRefund = true;
  621. this.isPeiSong = false;
  622. this.$refs.popup.open();
  623. },
  624. bindOpen(type) {
  625. this.type = type;
  626. this.$refs.popup.open();
  627. },
  628. onClose() {
  629. this.$refs.popup.close();
  630. },
  631. bindPei(e) {
  632. this.peiType = e;
  633. },
  634. bindPeiTwp(e) {
  635. this.logisticType = e;
  636. },
  637. onSubmit(e) {
  638. let ids = '';
  639. if (this.ids.length > 0) {
  640. ids = this.ids.join(",");
  641. }
  642. this.request({
  643. url: 'Smdcshop/partRefund',
  644. data: {
  645. id: this.info.id,
  646. ids: ids,
  647. refund_price: e.detail.value.refund_price,
  648. admin_id: uni.getStorageSync("admin_id"),
  649. }
  650. }).then(res => {
  651. uni.showToast({
  652. title: res.message,
  653. icon: 'none'
  654. })
  655. setTimeout(() => {
  656. this.getData();
  657. this.$refs.popup.close();
  658. }, 1000)
  659. })
  660. },
  661. bindRefundGoods(index) {
  662. let num = 0,
  663. arr = [];
  664. this.is_refund = false;
  665. this.refundGoods[index].checked = !this.refundGoods[index].checked;
  666. for (let i of this.refundGoods) {
  667. if (i.checked) {
  668. num += Number(i.unit_price);
  669. arr.push(i.id)
  670. }
  671. }
  672. this.amountMoney = num;
  673. this.ids = arr;
  674. this.is_refund = true;
  675. },
  676. getData() {
  677. this.request({
  678. url: 'Smdcshop/orderinfo',
  679. data: {
  680. id: this.id
  681. }
  682. }).then(res => {
  683. let info = res.data.info
  684. if(info.coupon_content){
  685. info.coupon_content = JSON.parse(info.coupon_content)
  686. }
  687. this.info = info;
  688. if (res.data.goods_list) {
  689. this.goods_list = res.data.goods_list;
  690. for (let i of res.data.goods_list) {
  691. i.checked = false
  692. }
  693. this.refundGoods = res.data.goods_list;
  694. }
  695. if (res.data.info.is_dd == 1 && res.data.info.is_send == 1) {
  696. this.GetDadaInfo(res.data.info.id);
  697. }
  698. if (res.data.info.is_dd == 2 && res.data.info.is_send == 1) {
  699. this.juheInfo = res.data.juhe_list[0];
  700. // console.log(res.data.juhe_list,"res.data.juhe_list")
  701. let options = [];
  702. for (let i of res.data.juhe_list) {
  703. options.push({
  704. title: i.statusMsg,
  705. logistic: i.logistic,
  706. desc: i.ctime,
  707. content: i.content,
  708. })
  709. }
  710. this.options = options
  711. }
  712. })
  713. },
  714. // - 如果 is_send=1并且is_dd=1 就是达达配送 请求达达接口
  715. // 如果 is_send=1并且is_dd=2 就是商家配送 不需要请求达达接口
  716. // 如果 is_send=0 就是还没配送
  717. GetDadaInfo(id) {
  718. this.request({
  719. url: 'Smdcshop/GetDadaInfo',
  720. data: {
  721. id: id
  722. }
  723. }).then(res => {
  724. this.obj = res.data;
  725. })
  726. },
  727. bindRefund(e) {
  728. uni.showModal({
  729. title: '提示',
  730. content: '是否同意退款?',
  731. showCancel: true,
  732. cancelText: '拒绝',
  733. confirmText: '同意',
  734. success: res => {
  735. let is_cancel = res.confirm ? 1 : 2;
  736. this.request({
  737. url: 'Smdcshop/cancel',
  738. data: {
  739. admin_id: uni.getStorageSync("admin_id"),
  740. id: this.info.id,
  741. is_cancel: is_cancel
  742. }
  743. }).then(res => {
  744. uni.showToast({
  745. title: res.message,
  746. icon: 'none'
  747. })
  748. setTimeout(() => {
  749. this.getData();
  750. }, 1000)
  751. })
  752. },
  753. fail: () => {},
  754. complete: () => {}
  755. });
  756. },
  757. bindPrinter(e) {
  758. this.request({
  759. url: 'Smdcshop/dyorder',
  760. data: {
  761. id: this.info.id
  762. }
  763. }).then(res => {
  764. uni.showToast({
  765. title: res.message,
  766. icon: 'none'
  767. })
  768. })
  769. },
  770. bindCancal(e) {
  771. uni.showModal({
  772. title: '提示',
  773. content: '是否取消配送?',
  774. showCancel: true,
  775. cancelText: '取消',
  776. confirmText: '确定',
  777. success: res => {
  778. if(res.confirm){
  779. this.request({
  780. url: 'Smdcshop/cancel_peisong',
  781. data: {
  782. id: this.info.id
  783. }
  784. }).then(res => {
  785. uni.showToast({
  786. title: res.message,
  787. icon: 'none'
  788. })
  789. setTimeout(() => {
  790. this.getData();
  791. }, 2000)
  792. })
  793. }
  794. }
  795. })
  796. },
  797. bindShop(e) {
  798. uni.showModal({
  799. title: '提示',
  800. content: '是否更换为商家配送?',
  801. showCancel: true,
  802. cancelText: '取消',
  803. confirmText: '确定',
  804. success: res => {
  805. if(res.confirm){
  806. this.request({
  807. url: 'Smdcshop/shangjiapeisong',
  808. data: {
  809. id: this.info.id
  810. }
  811. }).then(res => {
  812. uni.showToast({
  813. title: res.message,
  814. icon: 'none'
  815. })
  816. setTimeout(() => {
  817. this.getData();
  818. }, 2000)
  819. })
  820. }
  821. }
  822. })
  823. },
  824. bindPeiCofig() {
  825. this.request({
  826. url: 'Smdcshop/peisong',
  827. data: {
  828. id: this.info.id,
  829. admin_id: uni.getStorageSync("admin_id"),
  830. dispatch_mode: this.peiType,
  831. logistic: this.peiType == 3 ? this.logisticType : '',
  832. },
  833. }).then(res => {
  834. uni.showToast({
  835. title: res.message,
  836. icon: 'none'
  837. })
  838. setTimeout(() => {
  839. this.getData();
  840. this.$refs.popup.close();
  841. }, 2000)
  842. })
  843. },
  844. bindSend(type) {
  845. if (this.ps_mode == 3) {
  846. this.type = type;
  847. this.isRefund = false;
  848. this.isPeiSong = true;
  849. this.$refs.popup.open();
  850. return
  851. }
  852. uni.showModal({
  853. title: '提示',
  854. content: '确定进行配送吗?',
  855. showCancel: true,
  856. cancelText: '取消',
  857. confirmText: '配送',
  858. success: res => {
  859. if (res.confirm) {
  860. this.request({
  861. url: 'Smdcshop/peisong',
  862. data: {
  863. id: this.info.id,
  864. admin_id: uni.getStorageSync("admin_id"),
  865. },
  866. }).then(res => {
  867. uni.showToast({
  868. title: res.message,
  869. icon: 'none'
  870. })
  871. setTimeout(() => {
  872. this.getData();
  873. }, 2000)
  874. })
  875. }
  876. },
  877. fail: () => {},
  878. complete: () => {}
  879. });
  880. },
  881. bindStupPrice(e) {
  882. if (this.is_stup_price) {
  883. if (!this.pay_price) {
  884. uni.showToast({
  885. title: "请输入修改价格",
  886. icon: 'none'
  887. })
  888. return
  889. }
  890. this.request({
  891. url: 'Smdcshop/editprice',
  892. data: {
  893. id: this.info.id,
  894. pay_price: this.pay_price,
  895. content: this.content,
  896. }
  897. }).then(res => {
  898. uni.showToast({
  899. title: res.message,
  900. icon: 'none'
  901. })
  902. this.is_stup_price = false;
  903. setTimeout(() => {
  904. this.getData();
  905. }, 2000)
  906. })
  907. }
  908. this.is_stup_price = true;
  909. },
  910. getPrice(e) {
  911. this.pay_price = e.detail.value;
  912. },
  913. getContent(e) {
  914. this.content = e.detail.value;
  915. },
  916. makePhoneCall(tel) {
  917. uni.makePhoneCall({
  918. phoneNumber: tel //仅为示例
  919. });
  920. },
  921. copy(text) {
  922. // #ifdef MP-WEIXIN
  923. uni.setClipboardData({
  924. data: text,
  925. success: function() {
  926. console.log('success');
  927. }
  928. });
  929. // #endif
  930. // #ifdef H5
  931. let content = text;
  932. if (!document.queryCommandSupported('copy')) {
  933. // 不支持
  934. return false
  935. }
  936. let textarea = document.createElement("input")
  937. textarea.value = content
  938. textarea.readOnly = "readOnly"
  939. document.body.appendChild(textarea)
  940. textarea.select() // 选择对象
  941. textarea.setSelectionRange(0, content.length) //核心
  942. let result = document.execCommand("copy") // 执行浏览器复制命令
  943. textarea.remove();
  944. uni.showToast({
  945. title: "复制成功",
  946. icon: 'none'
  947. })
  948. return result
  949. // #endif
  950. },
  951. //提醒取餐
  952. onQucan() {
  953. this.request({
  954. url: 'merchant/take_meal',
  955. is_agent: 'agent',
  956. data: {
  957. order_id: this.info.id
  958. }
  959. }).then(res => {
  960. if (res.code == 200) {
  961. uni.showModal({
  962. content: "已提醒取餐",
  963. showCancel: false,
  964. success: r => {
  965. this.info.no_meal = 2
  966. }
  967. })
  968. }
  969. })
  970. }
  971. }
  972. }
  973. </script>
  974. <style>
  975. page {
  976. background-color: #F4F5F7;
  977. }
  978. page .act {
  979. color: #007AFF;
  980. }
  981. .model-content-center {
  982. width: 650rpx;
  983. background-color: #FFFFFF;
  984. border-radius: 16rpx;
  985. }
  986. .model-content-center .content {
  987. padding: 20rpx;
  988. }
  989. .model-content-center .round {
  990. border: 1rpx solid #CCCCCC;
  991. width: 40rpx;
  992. height: 40rpx;
  993. margin-right: 10rpx;
  994. border-radius: 4rpx;
  995. }
  996. .amount-text {
  997. font-size: 26rpx;
  998. padding-bottom: 20rpx;
  999. }
  1000. .amount-input {
  1001. padding: 10rpx;
  1002. border: 1rpx solid #F1F1F1;
  1003. }
  1004. .model-refund-title {
  1005. font-size: 36rpx;
  1006. text-align: center;
  1007. padding: 20rpx 0;
  1008. }
  1009. .model-refund-btn {
  1010. border-top-color: #f5f5f5;
  1011. border-top-style: solid;
  1012. border-top-width: 1px;
  1013. }
  1014. .model-refund-btn .cancel {
  1015. height: 90rpx;
  1016. }
  1017. .model-refund-btn .submit {
  1018. height: 90rpx;
  1019. border-left-color: #f0f0f0;
  1020. border-left-style: solid;
  1021. border-left-width: 1px;
  1022. }
  1023. button {
  1024. background-color: #fff;
  1025. padding: 0;
  1026. margin: 0;
  1027. line-height: 1rpx;
  1028. /* border: 1px solid #cccccc; */
  1029. min-height: 0;
  1030. font-size: 28rpx;
  1031. background: #fff;
  1032. border-radius: none;
  1033. }
  1034. button::after {
  1035. border: none;
  1036. }
  1037. .model-content-peiSong {
  1038. text-align: center;
  1039. padding: 10rpx 0;
  1040. border-bottom: 1rpx solid #F1F1F1;
  1041. font-size: 28rpx;
  1042. }
  1043. .pd10 {
  1044. padding: 10rpx 0;
  1045. }
  1046. .model {
  1047. width: 100%;
  1048. height: 100%;
  1049. position: fixed;
  1050. top: 0;
  1051. left: 0;
  1052. background: rgba(0, 0, 0, .5);
  1053. }
  1054. .model-content {
  1055. background: #FFFFFF;
  1056. height: 800rpx;
  1057. }
  1058. .model-content-title {
  1059. padding: 20rpx;
  1060. }
  1061. .text-r {
  1062. text-align: right;
  1063. color: red;
  1064. }
  1065. .info image {
  1066. width: 40rpx;
  1067. height: 50rpx;
  1068. }
  1069. .goods_list-img {
  1070. width: 100rpx;
  1071. height: 100rpx;
  1072. margin-right: 20rpx;
  1073. min-width: 100rpx;
  1074. }
  1075. .order-status {
  1076. width: 100%;
  1077. height: 130rpx;
  1078. background: url(../static/images/order_detail_bg.png) no-repeat center;
  1079. background-size: 100%;
  1080. text-align: center;
  1081. line-height: 130rpx;
  1082. font-size: 36rpx;
  1083. color: #fff;
  1084. font-weight: bold;
  1085. }
  1086. .page-block {}
  1087. .page-block .page-title-block {
  1088. height: 90rpx;
  1089. padding: 0 35rpx;
  1090. }
  1091. .page-block .page-title-block .title {
  1092. font-size: 32rpx;
  1093. line-height: 90rpx;
  1094. color: #999;
  1095. font-weight: bold;
  1096. }
  1097. .page-block .content {
  1098. padding: 30rpx 35rpx 0;
  1099. background-color: #fff;
  1100. overflow: hidden;
  1101. }
  1102. .page-block .cell {
  1103. min-height: 45rpx;
  1104. margin-bottom: 30rpx;
  1105. }
  1106. .page-block .cell .title-block {
  1107. width: 175rpx;
  1108. flex: none;
  1109. font-size: 30rpx;
  1110. line-height: 45rpx;
  1111. font-weight: 600;
  1112. color: #333;
  1113. }
  1114. .page-block .cell .desc {
  1115. flex: auto;
  1116. min-height: 45rpx;
  1117. line-height: 45rpx;
  1118. font-size: 32rpx;
  1119. color: #333;
  1120. }
  1121. .pay-type-icon {
  1122. display: block;
  1123. width: 30rpx;
  1124. height: 30rpx;
  1125. margin-right: 8rpx;
  1126. }
  1127. .goods {
  1128. font-size: 32rpx;
  1129. color: #333;
  1130. line-height: 45rpx;
  1131. margin-bottom: 30rpx;
  1132. }
  1133. .price {
  1134. color: red;
  1135. }
  1136. .btm-btn-block-content {
  1137. margin-top: 50rpx;
  1138. }
  1139. .btm-btn-block {
  1140. padding: 0 20rpx;
  1141. margin-bottom: 20rpx;
  1142. }
  1143. .btm-btn-block .btn {
  1144. flex: none;
  1145. /* width: 325rpx; */
  1146. width: 217rpx;
  1147. height: 98rpx;
  1148. border-radius: 8rpx;
  1149. text-align: center;
  1150. line-height: 98rpx;
  1151. font-size: 32rpx;
  1152. font-weight: 500;
  1153. }
  1154. .btm-btn-block .btn11 {
  1155. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  1156. box-shadow: 0 0 8rpx 0 rgba(51, 135, 255, 0.2);
  1157. color: #fff;
  1158. }
  1159. .btm-btn-block .btn12 {
  1160. background: linear-gradient(315deg, #999 2%, #999 99%);
  1161. box-shadow: 0 0 8rpx 0 rgba(51, 135, 255, 0.2);
  1162. color: #fff;
  1163. }
  1164. .zt-btn {
  1165. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  1166. box-shadow: 0 0 8rpx 0 rgba(51, 135, 255, 0.2);
  1167. color: #fff;
  1168. font-size: 24rpx;
  1169. padding: 10rpx 12rpx;
  1170. border-radius: 6rpx;
  1171. }
  1172. /* */
  1173. .qc-btn {
  1174. background-color: #3387FF;
  1175. color: #fff;
  1176. border-radius: 6rpx;
  1177. height: 48rpx;
  1178. line-height: 48rpx;
  1179. padding: 0 20rpx;
  1180. margin-left: 10rpx;
  1181. }
  1182. .coupon-name{
  1183. display: inline-block;
  1184. background-color: #3387FF;
  1185. color: #fff;
  1186. border-radius: 6rpx;
  1187. height: 48rpx;
  1188. line-height: 48rpx;
  1189. padding: 0 20rpx;
  1190. font-size: 24rpx;
  1191. }
  1192. </style>