index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259
  1. <template>
  2. <view class="order-details pos-order-details">
  3. <view class="header acea-row row-middle">
  4. <view class="state">{{ title }}</view>
  5. <view class="data">
  6. <view class="order-num">订单号:{{ orderInfo.order_id }}</view>
  7. <view>
  8. <span class="time">下单时间:{{ orderInfo._add_time }}</span>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="remarks acea-row" v-if="goname != 'looks'">
  13. <span class="iconfont icon-zhinengkefu-"></span>
  14. <div class="tip on" v-if="orderInfo.remark" @click="modify('1')">{{orderInfo.remark}}</div>
  15. <div class="tip" v-else @click="modify('1')">订单未备注,点击添加备注信息</div>
  16. </view>
  17. <view class="orderingUser acea-row row-middle">
  18. <span class="iconfont icon-yonghu2"></span>{{ orderInfo.uid?orderInfo.nickname:'游客' }}
  19. </view>
  20. <view class="address" v-if="orderInfo.real_name && orderInfo.user_phone && orderInfo.user_address">
  21. <view class="name">
  22. {{ orderInfo.real_name }}
  23. <span class="phone">{{ orderInfo.user_phone }}</span>
  24. <!-- #ifdef H5 -->
  25. <span class="copy copy-data"
  26. :data-clipboard-text="`${orderInfo.real_name} ${orderInfo.user_phone} ${orderInfo.user_address}`">复制</span>
  27. <!-- #endif -->
  28. <!-- #ifdef MP -->
  29. <span class="copy copy-data"
  30. @click="copyNum(`${orderInfo.real_name} ${orderInfo.user_phone} ${orderInfo.user_address}`)">复制</span>
  31. <!-- #endif -->
  32. </view>
  33. <view>{{ orderInfo.user_address }}</view>
  34. </view>
  35. <view class="line">
  36. <image src="/static/images/line.jpg" />
  37. </view>
  38. <!-- 拆单时 -->
  39. <view v-for="(j, indexw) in orderInfo.split" v-if="orderInfo.split && orderInfo.split.length">
  40. <view class="splitTitle acea-row row-between-wrapper">
  41. <view>订单包裹{{indexw + 1}}</view>
  42. <view class="title">{{j._status._title}}</view>
  43. </view>
  44. <view class="pos-order-goods">
  45. <navigator :url="`/pages/admin/orderDetail/index?id=${j.order_id}`" hover-class="none"
  46. class="goods acea-row row-between-wrapper" v-for="(item, index) in j.cartInfo" :key="index">
  47. <view class="picTxt acea-row row-between-wrapper">
  48. <view class="pictrue">
  49. <image :src="item.productInfo.attrInfo?item.productInfo.attrInfo.image:item.productInfo.image" />
  50. </view>
  51. <view class="text acea-row row-between row-column">
  52. <view class="info line2">
  53. {{ item.productInfo.store_name }}
  54. </view>
  55. <view class="attr">{{ item.productInfo.attrInfo.suk }}</view>
  56. </view>
  57. </view>
  58. <view class="money">
  59. <view class="x-money">¥{{ item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price }}</view>
  60. <view class="num">x{{ item.cart_num }}</view>
  61. <!-- <view class="y-money">¥{{ item.productInfo.ot_price }}</view> -->
  62. </view>
  63. </navigator>
  64. </view>
  65. </view>
  66. <!-- 结束 -->
  67. <!-- 未拆单时,正常单 -->
  68. <view class="pos-order-goods split" v-if="orderInfo.cartInfo && orderInfo.cartInfo.length">
  69. <view class="title acea-row row-between-wrapper" v-if="orderInfo.status == 4">
  70. <text>共{{totalNmu}}件商品</text>
  71. <!-- <navigator class="bnt" :url="'/pages/admin/store/deliverGoods/index?id='+orderInfo.order_id+'&listId='+orderInfo.id+'&totalNum='+orderInfo.total_num+'&orderStatus='+orderInfo.status+'&comeType=2'">去发货</navigator> -->
  72. </view>
  73. <view class="goods acea-row row-between-wrapper" v-for="(item, index) in orderInfo.cartInfo" :key="index">
  74. <view class="picTxt acea-row row-between-wrapper">
  75. <view class="pictrue">
  76. <image :src="item.productInfo.attrInfo?item.productInfo.attrInfo.image:item.productInfo.image" />
  77. </view>
  78. <view class="text acea-row row-between row-column">
  79. <view class="info line2">
  80. {{ item.productInfo.store_name }}
  81. </view>
  82. <view class="attr">{{ item.productInfo.attrInfo.suk }}</view>
  83. </view>
  84. </view>
  85. <view class="money">
  86. <view class="x-money">¥{{ item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price }}</view>
  87. <view class="num">x {{ item.cart_num }}</view>
  88. <view class="acea-row row-right">
  89. <view class="writeOff" v-if="item.refund_num && orderInfo.refund_type != 6">{{item.refund_num}}件退款中</view>
  90. <view class="writeOff" v-if="(orderInfo._status._type==1 || orderInfo._status._type==5) && orderInfo.shipping_type == 2">
  91. <text v-if="item.refund_num">,</text>
  92. <text class="on" v-if="item.is_writeoff">已核销</text>
  93. <text v-if="!item.is_writeoff && item.surplus_num<item.cart_num">核销{{parseInt(item.cart_num)-parseInt(item.surplus_num)}}件</text>
  94. <text v-if="!item.is_writeoff && item.surplus_num==item.cart_num">未核销</text>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="giveGoods">
  100. <view class="item acea-row row-between-wrapper" v-for="(item,index) in giveCartInfo" :key="index">
  101. <view class="picTxt acea-row row-middle">
  102. <view class="pictrue">
  103. <image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo"></image>
  104. <image :src="item.productInfo.image" v-else></image>
  105. </view>
  106. <view class="texts">
  107. <view class="name line1">[赠品]{{item.productInfo.store_name}}</view>
  108. <view class="limit line1" v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
  109. </view>
  110. </view>
  111. <view class="num">x{{item.cart_num}}</view>
  112. </view>
  113. <view class="item acea-row row-between-wrapper" v-for="(item,index) in giveData.give_coupon" :key="index" v-if="giveData.give_coupon.length">
  114. <view class="picTxt acea-row row-middle">
  115. <view class="pictrue acea-row row-center-wrapper">
  116. <text class="iconfont icon-pc-youhuiquan"></text>
  117. </view>
  118. <view class="texts">
  119. <view class="line1">[赠品]{{item.coupon_title}}</view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="item acea-row row-between-wrapper" v-if="giveData.give_integral>0">
  124. <view class="picTxt acea-row row-middle">
  125. <view class="pictrue acea-row row-center-wrapper">
  126. <text class="iconfont icon-pc-jifen"></text>
  127. </view>
  128. <view class="texts">
  129. <view class="line1">[赠品]{{giveData.give_integral}}积分</view>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="public-total" v-if="!orderInfo.split || !orderInfo.split.length">
  136. 共{{ orderInfo.total_num }}件商品,商品总价
  137. <span class="money">¥{{ sum }}</span> ( 邮费 ¥{{
  138. orderInfo.pay_postage
  139. }}
  140. )
  141. </view>
  142. <!-- 结束 -->
  143. <!-- <view v-if="types == 1" class="wrapper topnone">
  144. <view class="title">
  145. <view class="font">配送员信息</view>
  146. <view class="mapbtn"><span class="iconfont icon-weizhi"></span>查看地址</view>
  147. </view>
  148. <view class="item acea-row row-between">
  149. <view>联系人:</view>
  150. <view class="conter">啊哈啊</view>
  151. </view>
  152. <view class="item acea-row row-between">
  153. <view>联系电话:</view>
  154. <view class="conter">13007466338</view>
  155. </view>
  156. </view> -->
  157. <customForm :customForm="orderInfo.custom_form"></customForm>
  158. <view class="wrapper">
  159. <!-- <view class="title">
  160. <view class="font">订单信息</view>
  161. </view> -->
  162. <view class="item acea-row row-between">
  163. <view>订单编号:</view>
  164. <view class="conter acea-row row-middle row-right">
  165. {{ orderInfo.order_id
  166. }}
  167. <!-- #ifdef H5 -->
  168. <span class="copy copy-data" :data-clipboard-text="orderInfo.order_id">复制</span>
  169. <!-- #endif -->
  170. <!-- #ifdef MP -->
  171. <span class="copy copy-data" @click="copyNum(orderInfo.order_id)">复制</span>
  172. <!-- #endif -->
  173. </view>
  174. </view>
  175. <view class="item acea-row row-between">
  176. <view>下单时间:</view>
  177. <view class="conter">{{ orderInfo._add_time }}</view>
  178. </view>
  179. <view class="item acea-row row-between">
  180. <view>支付状态:</view>
  181. <view class="conter">
  182. {{ orderInfo.paid == 1 ? "已支付" : "未支付" }}
  183. </view>
  184. </view>
  185. <view class="item acea-row row-between">
  186. <view>支付方式:</view>
  187. <view class="conter">{{ payType }}</view>
  188. </view>
  189. <view class="item acea-row row-between" v-if="orderInfo.mark">
  190. <view v-if="statusType == -3">退款留言:</view>
  191. <view v-else>买家留言:</view>
  192. <view class="conter">{{ orderInfo.mark }}</view>
  193. </view>
  194. <view class="item acea-row row-between" v-if="orderInfo.refund_goods_explain">
  195. <view>退货留言:</view>
  196. <view class='conter'>{{orderInfo.refund_goods_explain}}</view>
  197. </view>
  198. <view class="item acea-row row-between" v-if="orderInfo.refund_img && orderInfo.refund_img.length">
  199. <view>退款凭证:</view>
  200. <view class="conter">
  201. <view class="pictrue" v-for="(item,index) in orderInfo.refund_img">
  202. <image :src="item" mode="aspectFill" @click='getpreviewImage(index,1)'></image>
  203. </view>
  204. </view>
  205. </view>
  206. <view class="item acea-row row-between" v-if="orderInfo.refund_goods_img && orderInfo.refund_goods_img.length">
  207. <view>退货凭证:</view>
  208. <view class="conter">
  209. <view class="pictrue" v-for="(item,index) in orderInfo.refund_goods_img">
  210. <image :src="item" mode="aspectFill" @click='getpreviewImage(index,0)'></image>
  211. </view>
  212. </view>
  213. </view>
  214. </view>
  215. <view class="wrapper">
  216. <view class="item acea-row row-between">
  217. <view>商品总价:</view>
  218. <view class="conter" v-if="statusType == -3">¥{{orderInfo.total_price}}</view>
  219. <view class="conter" v-else>¥{{(parseFloat(orderInfo.total_price)+parseFloat(orderInfo.vip_true_price)).toFixed(2)}}</view>
  220. </view>
  221. <view v-if="orderInfo.coupon_price>0" class="item acea-row row-between">
  222. <view>优惠券抵扣:</view>
  223. <view class="conter">-¥{{ orderInfo.coupon_price }}</view>
  224. </view>
  225. <view v-if="orderInfo.pay_postage>0" class="item acea-row row-between">
  226. <view>运费:</view>
  227. <view class="conter">¥{{ orderInfo.pay_postage }}</view>
  228. </view>
  229. <view v-if="orderInfo.deduction_price>0" class="item acea-row row-between">
  230. <view>积分抵扣金额:</view>
  231. <view class="conter">-¥{{ orderInfo.deduction_price }}</view>
  232. </view>
  233. <view v-if="orderInfo.vip_true_price>0" class="item acea-row row-between">
  234. <view>会员商品优惠:</view>
  235. <view class="conter">-¥{{ orderInfo.vip_true_price }}</view>
  236. </view>
  237. <view v-if="orderInfo.first_order_price>0" class="item acea-row row-between">
  238. <view>新人首单优惠:</view>
  239. <view class="conter">-¥{{ orderInfo.first_order_price }}</view>
  240. </view>
  241. <!-- <view v-if="orderInfo.promotions_price>0" class="item acea-row row-between">
  242. <view>活动优惠金额:</view>
  243. <view class="conter">-¥{{ orderInfo.promotions_price }}</view>
  244. </view> -->
  245. <view class='item acea-row row-between' v-for="(item,index) in orderInfo.promotions_detail" :key="index" v-if="parseFloat(item.promotions_price)">
  246. <view>{{item.title}}:</view>
  247. <view class='conter'>-¥{{parseFloat(item.promotions_price).toFixed(2)}}</view>
  248. </view>
  249. <view class="actualPay acea-row row-right">
  250. 实付款:<span class="money">¥{{ orderInfo.pay_price }}</span>
  251. </view>
  252. </view>
  253. <view class="wrapper" v-if="
  254. orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2 && (!orderInfo.split || !orderInfo.split.length)
  255. ">
  256. <view class="item acea-row row-between">
  257. <view>配送方式:</view>
  258. <view class="conter" v-if="orderInfo.delivery_type === 'express'">
  259. 快递
  260. </view>
  261. <view class="conter" v-if="orderInfo.delivery_type === 'send'">送货</view>
  262. </view>
  263. <view class="item acea-row row-between">
  264. <view v-if="orderInfo.delivery_type === 'express'">快递公司:</view>
  265. <view v-if="orderInfo.delivery_type === 'send'">送货人:</view>
  266. <view class="conter">{{ orderInfo.delivery_name }}</view>
  267. </view>
  268. <view class="item acea-row row-between">
  269. <view v-if="orderInfo.delivery_type === 'express'">快递单号:</view>
  270. <view v-if="orderInfo.delivery_type === 'send'">送货人电话:</view>
  271. <view class="conter">
  272. {{ orderInfo.delivery_id}}
  273. <!-- #ifdef H5 -->
  274. <span class="copy copy-data" :data-clipboard-text="orderInfo.delivery_id">复制</span>
  275. <!-- #endif -->
  276. <!-- #ifdef MP -->
  277. <span class="copy copy-data" @click="copyNum(orderInfo.delivery_id)">复制</span>
  278. <!-- #endif -->
  279. </view>
  280. </view>
  281. </view>
  282. <view class="height-add"></view>
  283. <view class="footer acea-row row-right row-middle">
  284. <view v-if="(types == 0 || types == 9) && orderInfo.is_del == 0 && !openErp" class="more btn cancel" @click="more">
  285. 更多
  286. <view class="more-box" v-if="moreBtn">
  287. <view class="more-btn" @click="del">删除订单</view>
  288. <view class="more-btn" @click="cancel">取消订单</view>
  289. </view>
  290. </view>
  291. <view class="bnt cancel" :class="openErp?'on':''" @click="modify('0')" v-if="types == 0 || types == 9">
  292. 一键改价
  293. </view>
  294. <!-- <view class="bnt cancel" @click="modify('0')" v-if="types == -1">
  295. 立即退款
  296. </view> -->
  297. <view class="bnt cancel" :class="openErp?'on':''" @click="modify('2',1)" v-if="orderInfo.type != 8 && (!orderInfo.refund || !orderInfo.refund.length) && (orderInfo.refund_type == 0 || orderInfo.refund_type == 1 || orderInfo.refund_type == 5) && orderInfo.paid && parseFloat(orderInfo.pay_price) >= 0">
  298. 立即退款
  299. </view>
  300. <view class="bnt cancel" :class="openErp?'on':''" @click="modify('2',0)" v-if="orderInfo.refund_type == 2">
  301. 同意退货
  302. </view>
  303. <view class="wait" :class="openErp?'on':''" v-if="orderInfo.refund_type == 4">待用户发货</view>
  304. <view class="bnt cancel" @click="modify('1')">订单备注</view>
  305. <view v-if="orderInfo.paid === 0 && types == 9" class="bnt delivery" :class="openErp?'on':''" @click="offlinePay">
  306. 确认付款
  307. </view>
  308. <view class="bnt delivery" :class="openErp?'on':''" v-if="types == 1 && (orderInfo.shipping_type === 1 || orderInfo.shipping_type === 3) && (orderInfo.pinkStatus === null || orderInfo.pinkStatus === 2)" @click="goDelivery(orderInfo)">去发货</view>
  309. </view>
  310. <PriceChange :change="change" :orderInfo="orderInfo" :isRefund="isRefund" v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)"
  311. v-on:savePrice="savePrice" :status="status"></PriceChange>
  312. </view>
  313. </template>
  314. <script>
  315. import PriceChange from "../../components/PriceChange/index.vue";
  316. import customForm from "@/components/customForm";
  317. // #ifdef H5
  318. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  319. // #endif
  320. import {
  321. OrderDetail,
  322. refundDetail,
  323. getOrderreMarkApi,
  324. getRefundMarkApi,
  325. getOrderPriceApi,
  326. getOrderOfflineApi,
  327. OrderDel,
  328. OrderCancel,
  329. setOrderRefund,
  330. storeRefundAgree
  331. } from "@/api/admin";
  332. import { erpConfig } from "@/api/esp.js";
  333. // import { required, num } from "@utils/validate";
  334. // import { validatorDefaultCatch } from "@utils/dialog";
  335. import {
  336. isMoney
  337. } from '@/utils/validate.js'
  338. export default {
  339. name: "orderDetail",
  340. components: {
  341. PriceChange,
  342. customForm
  343. },
  344. props: {},
  345. data: function() {
  346. return {
  347. openErp:false,
  348. giveData:{
  349. give_integral:0,
  350. give_coupon:[]
  351. },
  352. giveCartInfo:[],
  353. totalNmu:0,
  354. order: false,
  355. change: false,
  356. order_id: "",
  357. orderInfo: {
  358. _status: {}
  359. },
  360. status: "",
  361. title: "",
  362. payType: "",
  363. types: "",
  364. statusType:'',
  365. clickNum: 1,
  366. goname: '',
  367. moreBtn: false,
  368. sum: 0,
  369. isRefund:0, //1是仅退款;0是同意退货退款
  370. };
  371. },
  372. onLoad: function(option) {
  373. let self = this
  374. this.order_id = option.id;
  375. this.goname = option.goname
  376. this.statusType = option.types
  377. this.getErpConfig();
  378. this.getIndex();
  379. // #ifdef H5
  380. this.$nextTick(function() {
  381. var clipboard = new ClipboardJS('.copy-data');
  382. // var copybtn = document.getElementsByClassName("copy-data");
  383. // var clipboard = new Clipboard(copybtn);
  384. clipboard.on('success', function(e) {
  385. self.$util.Tips({
  386. title: '复制成功'
  387. })
  388. });
  389. clipboard.on('error', function(e) {
  390. self.$util.Tips({
  391. title: '复制失败'
  392. })
  393. });
  394. });
  395. // #endif
  396. },
  397. methods: {
  398. statusChange(e){
  399. this.status = e;
  400. },
  401. goDelivery(orderInfo){
  402. if(this.openErp) return
  403. uni.navigateTo({
  404. url: '/pages/admin/store/deliverGoods/index?id='+orderInfo.order_id+'&listId='+orderInfo.id+'&totalNum='+orderInfo.total_num+'&orderStatus='+orderInfo.status+'&comeType=2&productType='+orderInfo.product_type
  405. })
  406. },
  407. getErpConfig(){
  408. erpConfig().then(res=>{
  409. this.openErp = res.data.open_erp;
  410. }).catch(err=>{
  411. this.$util.Tips({
  412. title: err
  413. })
  414. })
  415. },
  416. getpreviewImage: function(index,num) {
  417. uni.previewImage({
  418. urls: num?this.orderInfo.refund_img:this.orderInfo.refund_goods_img,
  419. current: num?this.orderInfo.refund_img[index]:this.orderInfo.refund_goods_img[index]
  420. });
  421. },
  422. more: function() {
  423. // this.order = !this.order;
  424. this.moreBtn = !this.moreBtn
  425. },
  426. del :function() {
  427. OrderDel(this.order_id).then(res=>{
  428. this.$util.Tips({
  429. title: res.msg,
  430. icon: 'success'
  431. })
  432. }).catch(err=>{
  433. this.$util.Tips({
  434. title: err,
  435. icon: 'error'
  436. })
  437. })
  438. },
  439. cancel: function() {
  440. console.log(this.order_id)
  441. OrderCancel(this.order_id).then(res=>{
  442. this.$util.Tips({
  443. title: res.msg,
  444. icon: 'success'
  445. })
  446. }).catch(err=>{
  447. this.$util.Tips({
  448. title: err,
  449. icon: 'error'
  450. })
  451. })
  452. },
  453. modify: function(status,type) {
  454. if(this.openErp && status !=1) return
  455. this.change = true;
  456. this.status = status;
  457. if(status==2){
  458. this.isRefund = type
  459. }
  460. },
  461. changeclose: function(msg) {
  462. this.change = msg;
  463. },
  464. getIndex: function() {
  465. let that = this;
  466. let obj = '';
  467. if(that.statusType == -3){
  468. obj = refundDetail(that.order_id)
  469. }else{
  470. obj = OrderDetail(that.order_id);
  471. }
  472. obj.then(
  473. res => {
  474. let num = 0;
  475. that.sum = res.data.pay_price;
  476. that.types = res.data._status._type;
  477. that.title = res.data._status._title;
  478. that.payType = res.data._status._payType;
  479. that.giveData.give_coupon = res.data.give_coupon;
  480. that.giveData.give_integral = res.data.give_integral;
  481. let cartObj = [],giftObj = [];
  482. res.data.cartInfo.forEach((item, index) => {
  483. num += item.cart_num
  484. if(item.is_gift == 1){
  485. giftObj.push(item)
  486. }else{
  487. cartObj.push(item)
  488. }
  489. });
  490. this.totalNmu = num;
  491. res.data.cartInfo = cartObj;
  492. that.$set(that, 'giveCartInfo', giftObj);
  493. that.orderInfo = res.data;
  494. },
  495. err => {
  496. // that.$util.Tips({
  497. // title: err
  498. // }, {
  499. // tab: 3,
  500. // url: 1
  501. // });
  502. }
  503. );
  504. },
  505. objOrderRefund(data){
  506. let that = this;
  507. setOrderRefund(data).then(
  508. res => {
  509. that.change = false;
  510. that.$util.Tips({
  511. title: res.msg
  512. });
  513. that.getIndex();
  514. },
  515. err => {
  516. that.change = false;
  517. that.$util.Tips({
  518. title: err
  519. });
  520. }
  521. );
  522. },
  523. async savePrice(opt) {
  524. let that = this,
  525. data = {},
  526. price = opt.price,
  527. refund_price = opt.refund_price,
  528. refund_status = that.orderInfo.refund_status,
  529. remark = opt.remark;
  530. data.order_id = that.orderInfo.order_id;
  531. if (that.status == 0) {
  532. if (!isMoney(price)) {
  533. return that.$util.Tips({
  534. title: '请输入正确的金额'
  535. });
  536. }
  537. data.price = price;
  538. getOrderPriceApi(data).then(
  539. function() {
  540. that.change = false;
  541. that.$util.Tips({
  542. title: '改价成功',
  543. icon: 'success'
  544. })
  545. that.getIndex();
  546. },
  547. function() {
  548. that.change = false;
  549. that.$util.Tips({
  550. title: '改价失败',
  551. icon: 'none'
  552. })
  553. }
  554. );
  555. } else if (that.status == 2) {
  556. if(this.isRefund){
  557. if (!isMoney(refund_price)) {
  558. return that.$util.Tips({
  559. title: '请输入正确的金额'
  560. });
  561. }
  562. data.price = refund_price;
  563. data.type = opt.type;
  564. this.objOrderRefund(data);
  565. }else{
  566. if(opt.type==1){
  567. storeRefundAgree(this.orderInfo.id).then(res=>{
  568. that.change = false;
  569. that.$util.Tips({
  570. title: res.msg
  571. });
  572. that.getIndex();
  573. }).catch(err=>{
  574. that.change = false;
  575. that.$util.Tips({
  576. title: err
  577. });
  578. })
  579. }
  580. }
  581. } else if (that.status == 8) {
  582. data.type = opt.type;
  583. data.refuse_reason = opt.refuse_reason;
  584. this.objOrderRefund(data);
  585. } else {
  586. if (!remark) {
  587. return this.$util.Tips({
  588. title: '请输入备注'
  589. })
  590. }
  591. data.remark = remark;
  592. let obj = '';
  593. if(that.statusType == -3){
  594. obj = getRefundMarkApi(data);
  595. }else{
  596. obj = getOrderreMarkApi(data);
  597. }
  598. obj.then(
  599. res => {
  600. that.change = false;
  601. this.$util.Tips({
  602. title: res.msg,
  603. icon: 'success'
  604. })
  605. this.orderInfo.remark = remark;
  606. // that.getIndex();
  607. },
  608. err => {
  609. that.change = false;
  610. that.$util.Tips({
  611. title: err
  612. });
  613. }
  614. );
  615. }
  616. },
  617. offlinePay: function() {
  618. if(this.openErp) return
  619. getOrderOfflineApi({
  620. order_id: this.orderInfo.order_id
  621. }).then(
  622. res => {
  623. this.$util.Tips({
  624. title: res.msg,
  625. icon: 'success'
  626. });
  627. this.getIndex();
  628. },
  629. err => {
  630. this.$util.Tips({
  631. title: err
  632. });
  633. }
  634. );
  635. },
  636. // #ifdef MP
  637. copyNum(id) {
  638. uni.setClipboardData({
  639. data: id,
  640. success: function() {}
  641. });
  642. },
  643. // #endif
  644. // #ifdef H5
  645. webCopy(item, index) {
  646. let items = item
  647. let indexs = index
  648. let self = this
  649. if (self.clickNum == 1) {
  650. self.clickNum += 1
  651. self.webCopy(items, indexs)
  652. }
  653. }
  654. // #endif
  655. }
  656. };
  657. </script>
  658. <style lang="scss" scoped>
  659. .height-add {
  660. height:120upx;
  661. }
  662. .giveGoods{
  663. .item{
  664. padding: 14rpx 30rpx 14rpx 0;
  665. margin-left: 30rpx;
  666. border-top: 1px solid #eee;
  667. .picTxt{
  668. .pictrue{
  669. width: 76rpx;
  670. height: 76rpx;
  671. border-radius: 6rpx;
  672. background-color: #F5F5F5;
  673. color: #2a7efb;
  674. .iconfont{
  675. font-size: 34rpx;
  676. }
  677. image{
  678. width: 100%;
  679. height: 100%;
  680. border-radius: 6rpx;
  681. }
  682. margin-right: 16rpx;
  683. }
  684. .texts{
  685. width: 360rpx;
  686. color: #999999;
  687. font-size: 20rpx;
  688. .name{
  689. color: #333;
  690. }
  691. .limit{
  692. font-size: 20rpx;
  693. margin-top: 4rpx;
  694. }
  695. }
  696. }
  697. .num{
  698. color: #999999;
  699. font-size: 20rpx;
  700. }
  701. }
  702. }
  703. .splitTitle{
  704. width: 100%;
  705. height: 80rpx;
  706. line-height: 80rpx;
  707. background-color: #fff;
  708. margin-top: 17rpx;
  709. border-bottom: 1px solid #e5e5e5;
  710. padding: 0 30rpx;
  711. }
  712. .splitTitle .title{
  713. color: #2291f8;
  714. }
  715. /*商户管理订单详情*/
  716. .pos-order-details .header {
  717. background: linear-gradient(270deg, #1cd1dc 0%, #2291f8 100%);
  718. }
  719. .pos-order-details .header .state {
  720. font-size: 26upx;
  721. color: #fff;
  722. }
  723. .pos-order-details .header .data {
  724. margin-left: 35upx;
  725. font-size: 28upx;
  726. }
  727. .pos-order-details .header .data .order-num {
  728. font-size: 22upx;
  729. margin-bottom: 8upx;
  730. }
  731. .pos-order-details .remarks {
  732. width: 100%;
  733. background-color: #fff;
  734. padding: 20upx 30upx;
  735. }
  736. .pos-order-details .remarks .tip{
  737. font-size: 30upx;
  738. color: #CCCCCC;
  739. margin-left: 20upx;
  740. width: 620upx;
  741. }
  742. .pos-order-details .remarks .tip.on{
  743. color: #333;
  744. }
  745. .pos-order-details .remarks .iconfont {
  746. font-size: 40upx;
  747. color: #2a7efb;
  748. }
  749. .pos-order-details .remarks input {
  750. width: 630upx;
  751. height: 100%;
  752. font-size: 30upx;
  753. }
  754. .pos-order-details .remarks input::placeholder {
  755. color: #666;
  756. }
  757. .pos-order-details .orderingUser {
  758. font-size: 26upx;
  759. color: #282828;
  760. padding: 0 30upx;
  761. height: 67upx;
  762. background-color: #fff;
  763. margin-top: 16upx;
  764. border-bottom: 1px solid #f5f5f5;
  765. }
  766. .pos-order-details .orderingUser .iconfont {
  767. font-size: 40upx;
  768. color: #2a7efb;
  769. margin-right: 15upx;
  770. }
  771. .pos-order-details .address {
  772. margin-top: 0;
  773. }
  774. // .pos-order-details .pos-order-goods {
  775. // margin-top: 17upx;
  776. // }
  777. .pos-order-details .footer .more {
  778. font-size: 27upx;
  779. color: #aaa;
  780. width: 100upx;
  781. height: 64upx;
  782. text-align: center;
  783. line-height: 64upx;
  784. margin-right: 25upx;
  785. position: relative;
  786. }
  787. .pos-order-details .footer .delivery {
  788. background: linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  789. background: -webkit-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  790. background: -moz-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  791. }
  792. .pos-order-details .footer .more .order .arrow {
  793. width: 0;
  794. height: 0;
  795. border-left: 11upx solid transparent;
  796. border-right: 11upx solid transparent;
  797. border-top: 20upx solid #e5e5e5;
  798. position: absolute;
  799. left: 15upx;
  800. bottom: -18upx;
  801. }
  802. .pos-order-details .footer .more .order .arrow:before {
  803. content: '';
  804. width: 0;
  805. height: 0;
  806. border-left: 9upx solid transparent;
  807. border-right: 9upx solid transparent;
  808. border-top: 19upx solid #fff;
  809. position: absolute;
  810. left: -10upx;
  811. bottom: 0;
  812. }
  813. .pos-order-details .footer .more .order {
  814. width: 200upx;
  815. background-color: #fff;
  816. border: 1px solid #eee;
  817. border-radius: 10upx;
  818. position: absolute;
  819. top: -200upx;
  820. z-index: 9;
  821. }
  822. .pos-order-details .footer .more .order .item {
  823. height: 77upx;
  824. line-height: 77upx;
  825. }
  826. .pos-order-details .footer .more .order .item~.item {
  827. border-top: 1px solid #f5f5f5;
  828. }
  829. .pos-order-details .footer .more .moreName {
  830. width: 100%;
  831. height: 100%;
  832. }
  833. /*订单详情*/
  834. .order-details .header {
  835. padding: 0 30upx;
  836. height: 150upx;
  837. }
  838. .order-details .header.on {
  839. background-color: #666 !important;
  840. }
  841. .order-details .header .pictrue {
  842. width: 110upx;
  843. height: 110upx;
  844. }
  845. .order-details .header .pictrue image {
  846. width: 100%;
  847. height: 100%;
  848. }
  849. .order-details .header .data {
  850. color: rgba(255, 255, 255, 0.8);
  851. font-size: 24upx;
  852. margin-left: 27upx;
  853. }
  854. .order-details .header.on .data {
  855. margin-left: 0;
  856. }
  857. .order-details .header .data .state {
  858. font-size: 30upx;
  859. font-weight: bold;
  860. color: #fff;
  861. margin-bottom: 7upx;
  862. }
  863. /* .order-details .header .data .time{margin-left:20upx;} */
  864. .order-details .nav {
  865. background-color: #fff;
  866. font-size: 26upx;
  867. color: #282828;
  868. padding: 25upx 0;
  869. }
  870. .order-details .nav .navCon {
  871. padding: 0 40upx;
  872. }
  873. .order-details .nav .navCon .on {
  874. font-weight: bold;
  875. color: #e93323;
  876. }
  877. .order-details .nav .progress {
  878. padding: 0 65upx;
  879. margin-top: 10upx;
  880. }
  881. .order-details .nav .progress .line {
  882. width: 100upx;
  883. height: 2upx;
  884. background-color: #939390;
  885. }
  886. .order-details .nav .progress .iconfont {
  887. font-size: 25upx;
  888. color: #939390;
  889. margin-top: -2upx;
  890. width: 30upx;
  891. height: 30upx;
  892. line-height: 33upx;
  893. text-align: center;
  894. margin-right: 0 !important;
  895. }
  896. .order-details .address {
  897. font-size: 26upx;
  898. color: #868686;
  899. background-color: #fff;
  900. padding: 25upx 30upx 30upx 30upx;
  901. }
  902. .order-details .address .name {
  903. font-size: 30upx;
  904. color: #282828;
  905. margin-bottom: 0.1rem;
  906. }
  907. .order-details .address .name .phone {
  908. margin-left: 40upx;
  909. }
  910. .order-details .line {
  911. width: 100%;
  912. height: 3upx;
  913. }
  914. .order-details .line image {
  915. width: 100%;
  916. height: 100%;
  917. display: block;
  918. }
  919. .order-details .wrapper {
  920. background-color: #fff;
  921. margin-top: 12upx;
  922. padding: 30upx;
  923. }
  924. .order-details .topnone{padding-top: 0upx;}
  925. .order-details .wrapper .title{
  926. height: 100upx;
  927. display: flex;
  928. justify-content: space-between;
  929. align-items: center;
  930. border-bottom: 1upx solid #EEEEEE;
  931. margin-bottom: 34upx;
  932. }
  933. .order-details .wrapper .title .font{
  934. font-size: 32upx;
  935. font-weight: 600;
  936. color: #282828;
  937. }
  938. .order-details .wrapper .title .mapbtn{
  939. width: 176upx;
  940. height: 56upx;
  941. border: 1upx solid #1890FF;
  942. border-radius: 28upx;
  943. text-align: center;
  944. line-height: 50upx;
  945. color: #1890FF;
  946. font-size: 26upx;
  947. }
  948. .order-details .wrapper .item {
  949. font-size: 28upx;
  950. color: #282828;
  951. }
  952. .order-details .wrapper .item~.item {
  953. margin-top: 20upx;
  954. }
  955. .order-details .wrapper .item .conter {
  956. color: #868686;
  957. width: 484rpx;
  958. display: flex;
  959. flex-wrap: nowrap;
  960. justify-content: flex-end;
  961. text-align: right;
  962. .pictrue{
  963. width: 80rpx;
  964. height: 80rpx;
  965. margin-left: 6rpx;
  966. image{
  967. width: 100%;
  968. height: 100%;
  969. border-radius: 6rpx;
  970. }
  971. }
  972. }
  973. .order-details .wrapper .item .conter .copy {
  974. font-size: 20rpx;
  975. color: #333;
  976. border-radius: 3rpx;
  977. border: 1px solid #666;
  978. padding: 0rpx 15rpx;
  979. margin-left: 24rpx;
  980. // height: 40rpx;
  981. }
  982. .order-details .wrapper .actualPay {
  983. border-top: 1upx solid #eee;
  984. margin-top: 30upx;
  985. padding-top: 30upx;
  986. }
  987. .order-details .wrapper .actualPay .money {
  988. font-weight: bold;
  989. font-size: 30upx;
  990. color: #e93323;
  991. }
  992. .order-details .footer {
  993. width: 100%;
  994. height: 100upx;
  995. position: fixed;
  996. bottom: 0;
  997. left: 0;
  998. background-color: #fff;
  999. padding: 0 30upx;
  1000. border-top: 1px solid #eee;
  1001. }
  1002. .order-details .footer .wait{
  1003. color: #2a7efb;
  1004. margin-right: 30rpx;
  1005. }
  1006. .order-details .footer .bnt {
  1007. width: auto;
  1008. height: 60upx;
  1009. line-height: 60upx;
  1010. text-align: center;
  1011. line-height: upx;
  1012. border-radius: 50upx;
  1013. color: #fff;
  1014. font-size: 27upx;
  1015. padding: 0 3%;
  1016. &.on{
  1017. color: #c5c8ce!important;
  1018. background: #f7f7f7!important;
  1019. border: 1px solid #dcdee2!important;
  1020. }
  1021. }
  1022. .order-details .footer .bnt.cancel {
  1023. color: #aaa;
  1024. border: 1px solid #ddd;
  1025. }
  1026. .order-details .footer .bnt.default {
  1027. color: #444;
  1028. border: 1px solid #444;
  1029. }
  1030. .order-details .footer .bnt~.bnt {
  1031. margin-left: 18upx;
  1032. }
  1033. .pos-order-goods {
  1034. padding: 0 30upx;
  1035. background-color: #fff;
  1036. }
  1037. .pos-order-goods.split{
  1038. margin-top: 15upx;
  1039. padding: 0;
  1040. }
  1041. .pos-order-goods .title{
  1042. height: 80upx;
  1043. border-bottom: 1px solid #e5e5e5;
  1044. padding: 0 30upx;
  1045. }
  1046. .pos-order-goods .bnt{
  1047. padding: 7upx 20upx;
  1048. border: 1px solid #2a7efb;
  1049. color: #2a7efb;
  1050. border-radius: 30upx;
  1051. }
  1052. .pos-order-goods .goods {
  1053. height: 185upx;
  1054. }
  1055. .pos-order-goods.split .goods{
  1056. padding: 0 30upx;
  1057. }
  1058. .pos-order-goods .goods~.goods {
  1059. border-top: 1px dashed #e5e5e5;
  1060. }
  1061. .pos-order-goods .goods .picTxt {
  1062. width: 430upx;
  1063. }
  1064. .pos-order-goods .goods .picTxt .pictrue {
  1065. width: 130upx;
  1066. height: 130upx;
  1067. }
  1068. .pos-order-goods .goods .picTxt .pictrue image {
  1069. width: 100%;
  1070. height: 100%;
  1071. border-radius: 6upx;
  1072. }
  1073. .pos-order-goods .goods .picTxt .text {
  1074. width: 280upx;
  1075. display: flex;
  1076. justify-content: space-between;
  1077. flex-direction: column;
  1078. height: 130upx;
  1079. }
  1080. .pos-order-goods .goods .picTxt .text .info {
  1081. font-size: 28upx;
  1082. color: #282828;
  1083. }
  1084. .pos-order-goods .goods .picTxt .text .info .label{
  1085. color: #ff4c3c;
  1086. }
  1087. .pos-order-goods .goods .picTxt .text .attr {
  1088. font-size: 24upx;
  1089. color: #999;
  1090. width: 100%;
  1091. overflow: hidden;
  1092. white-space: nowrap;
  1093. text-overflow: ellipsis;
  1094. }
  1095. .pos-order-goods .goods .money {
  1096. width: 248upx;
  1097. height: 130upx;
  1098. text-align: right;
  1099. font-size: 28upx;
  1100. }
  1101. .pos-order-goods .goods .money .writeOff{
  1102. font-size: 24upx;
  1103. margin-top: 17upx;
  1104. color: #1890FF;
  1105. }
  1106. .pos-order-goods .goods .money .writeOff .on{
  1107. color: #FF7E00;
  1108. }
  1109. .pos-order-goods .goods .money .x-money {
  1110. color: #282828;
  1111. }
  1112. .pos-order-goods .goods .money .num {
  1113. color: #ff9600;
  1114. margin: 5upx 0;
  1115. }
  1116. .pos-order-goods .goods .money .y-money {
  1117. color: #999;
  1118. text-decoration: line-through;
  1119. }
  1120. .public-total {
  1121. font-size: 28upx;
  1122. color: #282828;
  1123. border-top: 1px solid #eee;
  1124. height: 92upx;
  1125. line-height: 92upx;
  1126. text-align: right;
  1127. padding: 0 30upx;
  1128. background-color: #fff;
  1129. }
  1130. .public-total .money {
  1131. color: #ff4c3c;
  1132. }
  1133. .copy-data {
  1134. font-size: 10px;
  1135. color: #333;
  1136. -webkit-border-radius: 1px;
  1137. border-radius: 1px;
  1138. border: 1px solid #666;
  1139. padding: 0px 7px;
  1140. margin-left: 12px;
  1141. // height: 20px;
  1142. }
  1143. .more-box {
  1144. color: #333;
  1145. position: absolute;
  1146. width: 180rpx;
  1147. left: 0rpx;
  1148. bottom: 110rpx;
  1149. background-color: #fff;
  1150. padding: 10rpx;
  1151. border-radius: 4rpx;
  1152. font-size: 24rpx;
  1153. -webkit-box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
  1154. -moz-box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
  1155. box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
  1156. .more-btn {
  1157. color: #aaa;
  1158. padding: 4rpx;
  1159. z-index: 9999;
  1160. border-bottom: 2rpx solid #f7f1f1 !important;
  1161. }
  1162. }
  1163. .more-box:before {
  1164. content: "";
  1165. width: 0rpx;
  1166. height: 0rpx;
  1167. border-top: 10rpx solid #fff;
  1168. border-bottom: 10rpx solid transparent;
  1169. border-left: 10rpx solid #fff;
  1170. position: absolute;
  1171. bottom: -10rpx;
  1172. left: 0px;
  1173. }
  1174. </style>