index.vue 33 KB

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