order-detail.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. <template>
  2. <app-layout>
  3. <image class="head-img" :src='adminImg.detail_bg'></image>
  4. <view v-if="status == 2" class="head-txt main-between">
  5. <view class="status-txt">{{detail.status_cn}}</view>
  6. </view>
  7. <view v-else class="head-txt main-between">
  8. <view class="status-txt" >{{orderStatus}}</view>
  9. <view v-if="order.auto_confirm > 0 && order.is_send == 1 && order.is_confirm == 0">剩余
  10. <text v-if="dd>0">{{dd}}天</text>
  11. <text v-if="hh>0 && dd==0">{{hh}}小时</text> {{mm}}分自动确认收货
  12. </view>
  13. <view v-else-if="order.auto_cancel > 0 && order.is_pay == 0 && order.pay_type != 2">剩余
  14. <text v-if="dd>0">{{dd}}天</text>
  15. <text v-if="hh>0 && dd==0">{{hh}}小时</text> {{mm}}分自动删除
  16. </view>
  17. <view v-else-if="order.auto_sales > 0 && order.is_sale == 0 && order.is_confirm == 1">剩余
  18. <text v-if="dd>0">{{dd}}天</text>
  19. <text v-if="hh>0 && dd==0">{{hh}}小时</text> {{mm}}分自动完成订单
  20. </view>
  21. </view>
  22. <view class="user-info" v-if="(order.address || order.send_type != 2) && (order.goods_type === 'goods' || order.goods_type === 'exchange')" :style="{padding: order.mobile ? '28rpx 24rpx 0' : '44rpx 24rpx 20rpx' }">
  23. <image class="localhost-img" src='./../image/localhost.png'></image>
  24. <view class="user-text">
  25. <text class="name">{{order.name ? order.name : order.user.nickname}}</text>
  26. <text v-if="order.address">{{order.mobile}}</text>
  27. </view>
  28. <view class='user-text address-info'>{{!order.address ? order.mobile : order.address}}</view>
  29. <view v-if="order.mobile" class='main-center area'>
  30. <view @click='toCall(order.mobile)' class="detail-btn box-grow-1">联系收货人</view>
  31. <view :class="[`${order.send_type == 2 ? 'line left-line':'line'}`]"></view>
  32. <view class="detail-btn box-grow-1" @click='copy'>{{!order.address ? '复制联系方式' : '复制地址'}}</view>
  33. <view class="line" v-if="order.send_type == 2" :class="[`${order.address ? 'line right-line':'line'}`]"></view>
  34. <view class="detail-btn box-grow-1" v-if="order.send_type == 2" @click='openMap'>地图导航</view>
  35. </view>
  36. </view>
  37. <view class="user-info" v-if="order.goods_type === 'ecard'">
  38. <view class="user-text" flex="cross: center">
  39. <image class="localhost-img" src='./../image/localhost.png'></image>
  40. <view class="name">{{order.name}}</view>
  41. </view>
  42. <view class='user-text address-info'>{{order.mobile}}</view>
  43. <view class='main-center area'>
  44. <view @click='toCall(order.mobile)' class="detail-btn box-grow-1">联系收货人</view>
  45. </view>
  46. </view>
  47. <view v-if="(detail.detailExpress && detail.detail && detail.detailExpress.length === 1 && detail.detail.length === 1) || (order.detailExpress && order.detail && order.detailExpress.length === 1 && order.detail.length === 1)">
  48. <view @click="toExpressInfo(detail)" class="express" v-if="detail.detailExpress && detail.detailExpress[0].express_no">
  49. <image class="logo" src='./../image/express.png'></image>
  50. <view class="express-company">{{detail.detailExpress[0].express}}</view>
  51. <view class="express-number">运单编号:{{detail.detailExpress[0].express_no}}</view>
  52. <image v-if="detail.detailExpress[0].express" class="to-more" src='/static/image/icon/arrow-right.png'></image>
  53. </view>
  54. <view @click="toExpressInfo(order)" class="express" v-else-if="order.detailExpress[0].express_no">
  55. <image class="logo" src='./../image/express.png'></image>
  56. <view class="express-company">{{order.detailExpress[0].express}}</view>
  57. <view v-if="order.detailExpress[0].express" class="express-number">运单编号:{{order.detailExpress[0].express_no}}</view>
  58. <image v-if="order.detailExpress[0].express" class="to-more" src='/static/image/icon/arrow-right.png'></image>
  59. </view>
  60. </view>
  61. <view class="express" v-if="(order.detailExpress && order.detailExpress.length > 1) || (order.is_send == 0 && order.detailExpress && order.detailExpress.length >= 1)" @click="toExpressMore(order)">
  62. <view class="showMore">该订单已拆成多个包裹发货,点击查看详情</view>
  63. <image class="to-more" src='/static/image/icon/arrow-right.png'></image>
  64. </view>
  65. <view class="express" v-else-if="(detail.detailExpress && detail.detailExpress.length > 1) || (detail.is_send == 0 && detail.detailExpress && detail.detailExpress.length >= 1)" @click="toExpressMore(detail)">
  66. <view class="showMore">该订单已拆成多个包裹发货,点击查看详情</view>
  67. <image class="to-more" src='/static/image/icon/arrow-right.png'></image>
  68. </view>
  69. <view class="composition" v-if="order.sign === 'composition'">
  70. <view v-for="(list,idx) in order.composition_list" class="composition-item" :key="idx">
  71. <view class="main-between composition-title">
  72. <view class="composition-type" v-if="list.type == 1">固定套餐</view>
  73. <view class="composition-type" v-else>搭配套餐</view>
  74. <view>套餐总价 ¥{{list.total_price}}</view>
  75. </view>
  76. <view v-if="list.show || index == 0" v-for="(goods,index) in list.goods_list" class="goods" :key="goods.id">
  77. <image class="goods-img" :src='goods.pic_url'></image>
  78. <view class='t-omit-two goods-name'>{{goods.name}}</view>
  79. <view class="goods-attr t-omit">
  80. <text v-for="attr in goods.attr_list" :key="item.attr_id">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
  81. </view>
  82. <view class="goods-num">x{{goods.num}}</view>
  83. <view class="goods-price">¥{{goods.total_price}}</view>
  84. </view>
  85. <view class="composition-open main-center">
  86. <view @click="toggle(idx)" class="composition-btn">
  87. <text>{{list.show ? '点击收起套餐详情' : '点击展开套餐详情'}}</text>
  88. <image v-if="!list.show" src="/static/image/icon/icon-down.png"></image>
  89. <image v-else src="/static/image/icon/icon-up.png"></image>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view :class="[`${!order.address && order.send_type != 1 ? 'goods-info card-info':'goods-info'}`]" :style="{marginTop: order.goods_type === 'goods' && order.address == '' && order.send_type == 2? '140rpx' : '24rpx'}">
  95. <view v-if="order.sign !== 'composition' || status == 2">
  96. <view class="goods-title">自营商品</view>
  97. <view v-for="(goods, dIndex) in order.detail" class="goods" :key="goods.id">
  98. <image class="goods-img" :src='goods.goods_info.goods_attr.pic_url ? goods.goods_info.goods_attr.pic_url : goods.goods_info.goods_attr.cover_pic'></image>
  99. <view class='t-omit goods-name'>{{goods.goods_info.goods_attr.name}}</view>
  100. <view class="goods-attr t-omit-two" v-if="order.goods_type === 'goods'">
  101. <text v-for="(attr,index) in goods.attr_list" :key="index">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
  102. </view>
  103. <view class="goods-num">x{{goods.num}}</view>
  104. <view class="goods-price">
  105. <span v-if="order.plugin_data && order.plugin_data.exchange_list && order.plugin_data.exchange_list.length">{{order.plugin_data.exchange_list[dIndex].value}}{{order.plugin_data.price_name}}+</span>
  106. <span>¥{{goods.total_original_price}}</span>
  107. </view>
  108. </view>
  109. </view>
  110. <view v-if="order.plugin_data && order.plugin_data.exchange_count == null" class="main-between price-item">
  111. <view class="price-label">商品总价</view>
  112. <view>¥{{ order.total_goods_original_price }}</view>
  113. </view>
  114. <view v-if="order.plugin_data && order.plugin_data.exchange_count" class="main-between price-item">
  115. <view class="price-label">兑换{{order.plugin_data.price_name}}</view>
  116. <view>{{ order.plugin_data.exchange_count }}</view>
  117. </view>
  118. <view v-if="order.plugin_data && order.plugin_data.exchange_count >= 0" class="main-between price-item">
  119. <view class="price-label">兑换金额</view>
  120. <view>¥{{ order.total_goods_original_price }}</view>
  121. </view>
  122. <view class="main-between price-item" v-if="order.goods_type !== 'ecard'">
  123. <view class="price-label">运费</view>
  124. <view>¥{{ order.express_price }}</view>
  125. </view>
  126. <view class="main-between price-item" v-if="order.member_discount_price > 0">
  127. <view class="price-label">会员折扣</view>
  128. <view>-¥{{ order.member_discount_price }}</view>
  129. </view>
  130. <view class="main-between price-item" v-if="order.integral_deduction_price > 0">
  131. <view class="price-label">积分抵扣</view>
  132. <view>-¥{{ order.integral_deduction_price }}</view>
  133. </view>
  134. <view class="main-between price-item" v-if="order.coupon_discount_price > 0">
  135. <view class="price-label">优惠券抵扣</view>
  136. <view>-¥{{ order.coupon_discount_price }}</view>
  137. </view>
  138. <block v-if="order.plugin_data && order.plugin_data.discount_list">
  139. <view class="main-between price-item" v-if="pluginData.value > 0 || pluginData.value < 0" v-for="(pluginData,index) in order.plugin_data.discount_list" :key="index">
  140. <view class="price-label">{{pluginData.label}}</view>
  141. <view v-if="pluginData.value > 0">-¥{{ pluginData.value }}</view>
  142. <view v-if="pluginData.value < 0">+¥{{ -pluginData.value }}</view>
  143. </view>
  144. </block>
  145. <view class="main-between price-item" v-if="order.full_reduce_price > 0">
  146. <view class="price-label">满减优惠</view>
  147. <view>-¥{{ order.full_reduce_price }}</view>
  148. </view>
  149. <view class="main-between price-item" v-if="order.back_price > 0">
  150. <view class="price-label">订单改价</view>
  151. <view v-if="order.back_price > 0">-¥{{ order.back_price }}</view>
  152. <view v-if="order.back_price < 0">+¥{{ -order.back_price }}</view>
  153. </view>
  154. <view class="main-between price-item" style='margin-bottom: 0'>
  155. <view class="price-label total-label">订单总价</view>
  156. <view class="total-price">
  157. <text v-if="order.plugin_data && order.plugin_data.exchange_count">{{order.plugin_data.exchange_count}}{{order.plugin_data.price_name}}+</text>
  158. <text>¥{{ order.total_pay_price }}</text>
  159. </view>
  160. </view>
  161. <view v-if="status== 2 && detail.type == 1" class="refund-info">申请退款 ¥{{detail.refund_price}} <text v-if="detail.is_refund == 1"> 实际退款 ¥{{detail.reality_refund_price}}</text></view>
  162. </view>
  163. <view class='goods-info' v-if="showForm && status == 2">
  164. <view v-for="(goods,idx) in order.detail" :class="['goods-form', `${idx == 0? 'more':''}`]" :key="goods.id">
  165. <view class='goods-title form-title'>表单内容</view>
  166. <view v-for="(item,index) in goods.form_data" v-if="item.value != null" :key="index" :class="[ `${item.key !== 'img_upload' ? 'dir-left-nowrap' : ''}`,`price-item`]">
  167. <view class="price-label">{{item.label}}:</view>
  168. <view v-if="item.key === 'img_upload'">
  169. <image v-show="!item.loadOver" @load="imageFormLoad(idx,index)" @click='look(item.value)' class="form-img" :src='item.value'></image>
  170. </view>
  171. <view v-else>{{item.value}}</view>
  172. </view>
  173. </view>
  174. </view>
  175. <view class='goods-info mch-goods' v-if="order.sign !== 'vip_card'">
  176. <view class='goods-title'>配送信息</view>
  177. <view class="dir-left-nowrap price-item">
  178. <view class="price-label">发货方式:</view>
  179. <view v-if="order.send_type == 0">快递配送</view>
  180. <view v-else-if="order.send_type == 1">上门自提</view>
  181. <view v-else-if="order.send_type == 2">同城配送</view>
  182. <view v-else-if="order.send_type == 3">自动发货</view>
  183. </view>
  184. <template v-if="order.send_type == 1">
  185. <view class="dir-left-nowrap price-item">
  186. <view class="price-label">门店名称:</view>
  187. <view>{{order.store.name}}</view>
  188. </view>
  189. <view class="dir-left-nowrap price-item">
  190. <view class="price-label">联系方式:</view>
  191. <view>{{order.store.mobile}}</view>
  192. </view>
  193. <view class="dir-left-nowrap price-item">
  194. <view class="price-label">门店地址:</view>
  195. <view>{{order.store.address}}</view>
  196. </view>
  197. </template>
  198. <template v-if="order.send_type == 2">
  199. <view class="dir-left-nowrap price-item">
  200. <view class="price-label">发货地址:</view>
  201. <view>{{order.city.address}}</view>
  202. </view>
  203. <view class="dir-left-nowrap price-item">
  204. <view class="price-label">联系方式:</view>
  205. <view>{{order.city.contact_way}}</view>
  206. </view>
  207. <view class="dir-left-nowrap price-item">
  208. <view class="price-label">配送说明:</view>
  209. <view>{{order.city.explain}}</view>
  210. </view>
  211. <view class="sc" v-if="((order.detailExpress && order.detailExpress.length == 1) || order.city_name) && order.is_send == 1">
  212. <view class="dir-left-nowrap cross-center city-service">
  213. <image class="head" src="/static/image/icon/deliveryman.png"></image>
  214. <template v-if="order.detailExpress[0].status == 101">
  215. <view class="await-man">等待分配骑手</view>
  216. </template>
  217. <template v-else>
  218. <view class="info-box dir-top-nowrap box-grow-1">
  219. <view class="info-label">配送员</view>
  220. <view class="info">{{order.city_name ? order.city_name : order.detailExpress[0].city_name}} {{order.city_mobile ? order.city_mobile : order.detailExpress[0].city_mobile}}</view>
  221. </view>
  222. <view class="icon-box">
  223. <app-jump-button open_type="tel" :number="order.city_mobile ? order.city_mobile : order.detailExpress[0].city_mobile">
  224. <image class="icon" src="/static/image/icon/store-tel.png"></image>
  225. </app-jump-button>
  226. </view>
  227. <!-- 第三方配送才有地图信息 -->
  228. <view v-if="order.detailExpress[0].send_type == 1" class="icon-box">
  229. <app-jump-button open_type="navigate" :url="'/pages/order/city-map/city-map?express_id=' + order.detailExpress[0].id">
  230. <image class="icon" src="/static/image/icon/see-location.png"></image>
  231. </app-jump-button>
  232. </view>
  233. </template>
  234. </view>
  235. </view>
  236. </template>
  237. </view>
  238. <view class='goods-info mch-goods'>
  239. <view class='goods-title'>订单信息</view>
  240. <view class="dir-left-nowrap price-item">
  241. <view class="price-label">下单时间:</view>
  242. <view>{{order.created_at}}</view>
  243. </view>
  244. <view class="dir-left-nowrap price-item">
  245. <view class="price-label">订单号:</view>
  246. <view>{{order.order_no}}</view>
  247. </view>
  248. <view class="dir-left-nowrap price-item" v-if="order.words || order.seller_remark">
  249. <view class="price-label">商家备注:</view>
  250. <view>{{order.words || order.seller_remark}}</view>
  251. </view>
  252. <view class="dir-left-nowrap price-item" v-if="order.remark && order.goods_type === 'goods'">
  253. <view class="price-label">买家留言:</view>
  254. <view style="word-break: break-all">{{order.remark}}</view>
  255. </view>
  256. <view v-if="order.detailExpress && order.detailExpress.length === 1 && (order.detailExpress[0].merchant_remark || order.detailExpress[0].express_contentd)" class="dir-left-nowrap price-item">
  257. <view class="price-label">卖家物流留言:</view>
  258. <view>{{order.detailExpress[0].merchant_remark || order.detailExpress[0].express_content}}</view>
  259. </view>
  260. <view class="dir-left-nowrap price-item">
  261. <view class="price-label">支付方式:</view>
  262. <view v-if="order.pay_type == 1">线上支付</view>
  263. <view v-else-if="order.pay_type == 3">余额支付</view>
  264. <view v-else-if="order.pay_type == 2">货到付款</view>
  265. <view v-else-if="order.pay_type == 4">现金</view>
  266. <view v-else-if="order.pay_type == 5">pos机</view>
  267. <view v-else>未支付</view>
  268. </view>
  269. <view class="dir-left-nowrap price-item" v-if="order.sign === 'exchange' && order.exchange_code">
  270. <view class="price-label">兑换码库:</view>
  271. <view>{{order.exchange_code.library_name}}</view>
  272. </view>
  273. <view class="dir-left-nowrap price-item" v-if="order.sign === 'exchange' && order.exchange_code">
  274. <view class="price-label">兑换码:</view>
  275. <view>{{order.exchange_code.code}}</view>
  276. </view>
  277. <view v-for="(item,index) in order.order_form" v-if="item.value && order.sign !== 'booking' && order.sign !== 'vip_card'" :key="index" class="dir-left-nowrap price-item">
  278. <view class="price-label">{{item.label}}:</view>
  279. <view v-if="item.key === 'img_upload'">
  280. <view v-if="Array.isArray(item.value)">
  281. <block v-for="(img,key) in item.value" :key="key">
  282. <image v-show="!item.loadOver" @load="imageLoad(index)" @click='look(img)' class="form-img" :src='img'></image>
  283. </block>
  284. </view>
  285. <view v-else>
  286. <image v-show="!item.loadOver" @load="imageLoad(index)" @click='look(item.value)' class="form-img" :src='item.value'></image>
  287. </view>
  288. </view>
  289. <view style="word-break: break-all" v-else>{{item.value}}</view>
  290. </view>
  291. </view>
  292. <view class='goods-info' v-if="showForm&& status == 1">
  293. <view class='goods-title form-title'>其他信息</view>
  294. <view v-for="(row,idx) in formList" :class="['goods-form', `${idx == 0? 'more':''}`]" :key="idx">
  295. <view v-for="(goods,index) in row" :key="goods.id">
  296. <view class="goods" v-if="formList.length > 1">
  297. <image class="goods-img" :src='goods.goods_info.goods_attr.pic_url ? goods.goods_info.goods_attr.pic_url : goods.goods_info.goods_attr.cover_pic'></image>
  298. <view class='t-omit-two goods-name'>{{goods.goods_info.goods_attr.name}}</view>
  299. <view class="goods-attr t-omit" v-if="order.goods_type === 'goods'">
  300. <text v-for="attr in goods.attr_list" :key="item.attr_id">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
  301. </view>
  302. <view class="goods-num">x{{goods.num}}</view>
  303. <view class="goods-price">¥{{goods.total_original_price}}</view>
  304. </view>
  305. </view>
  306. <view v-for="(item,index) in row[0].form_data" v-if="item.value && order.sign !== 'booking'" :key="index" :class="[ `${item.key !== 'img_upload' ? 'dir-left-nowrap' : ''}`,`price-item`]">
  307. <view class="price-label">{{item.label}}:</view>
  308. <view v-if="item.key === 'img_upload'">
  309. <view v-if="Array.isArray(item.value)">
  310. <block v-for="(img,key) in item.value" :key="key">
  311. <image v-show="!item.loadOver" @load="imageFormLoad(idx,index)" @click='look(img)' class="form-img" :src='img'></image>
  312. </block>
  313. </view>
  314. <view v-else>
  315. <image v-show="!item.loadOver" @load="imageFormLoad(idx,index)" @click='look(item.value)' class="form-img" :src='item.value'></image>
  316. </view>
  317. </view>
  318. <view style="word-break: break-all" v-else>{{item.value}}</view>
  319. </view>
  320. </view>
  321. <view v-for="(item,index) in order.order_form" v-if="item.value && (order.sign === 'booking' || order.sign === 'vip_card')" :key="index" :class="[ `${item.key !== 'img_upload' ? 'dir-left-nowrap' : ''}`,`price-item`]">
  322. <view class="price-label">{{item.label}}:</view>
  323. <view v-if="item.key === 'img_upload'">
  324. <view v-if="Array.isArray(item.value)">
  325. <block v-for="(img,key) in item.value" :key="key">
  326. <image v-if="img" v-show="!item.loadOver" @load="imageLoad(index)" @click='look(img)' class="form-img" :src='img'></image>
  327. </block>
  328. </view>
  329. <view v-else>
  330. <image v-if="item.value" v-show="!item.loadOver" @load="imageLoad(index)" @click='look(item.value)' class="form-img" :src='item.value'></image>
  331. </view>
  332. </view>
  333. <view style="word-break: break-all" v-else>{{item.value}}</view>
  334. </view>
  335. </view>
  336. <view :class="['bottom-place', `${iphone_x? 'iphone_x':''}`]"></view>
  337. <view :class="[`${(order.is_confirm != 1 && order.cancel_status == 0) || status == 2 ? 'btn': ''}`, `${iphone_x ? 'iphone_x':''}`]" v-if="(order.is_confirm != 1 && order.cancel_status == 0) || status == 2 || order.showMobile">
  338. <order-menu v-if="showSolt" :hiddenRemark="hiddenRemark" @change="cancel" :address="address" :status="status" @update="update" :item="status == 2 ? detail : order"></order-menu>
  339. </view>
  340. <view v-else-if="order.id > 0 && order.is_confirm != 1" :class="['btn', `${iphone_x ? 'iphone_x':''}`]">
  341. <order-menu v-if="showSolt" :hiddenRemark="hiddenRemark" @change="cancel" :address="address" :status="status" @update="update" :item="order"></order-menu>
  342. </view>
  343. </app-layout>
  344. </template>
  345. <script>
  346. import {mapState} from "vuex";
  347. import orderMenu from "../components/order-menu.vue";
  348. export default {
  349. data() {
  350. return {
  351. showSolt: false,
  352. order: {
  353. total_pay_price: '',
  354. express_price: '',
  355. total_goods_price: '',
  356. total_goods_original_price: ''
  357. },
  358. address: [],
  359. today: '',
  360. yesterday: '',
  361. weekday: '',
  362. detail: {},
  363. reset_time: 0,
  364. dd: 0,
  365. hh: 0,
  366. mm: 0,
  367. status: 1,
  368. hiddenRemark: true,
  369. showForm: false,
  370. first: true,
  371. iphone_x: false
  372. }
  373. },
  374. components: {
  375. "order-menu": orderMenu
  376. },
  377. computed: {
  378. ...mapState({
  379. userInfo: state => state.user.info,
  380. adminImg: state => state.mallConfig.__wxapp_img.app_admin,
  381. }),
  382. formList() {
  383. const self = this;
  384. let orderDetail = self.order.detail;
  385. let newArr = {};
  386. let form_ids = [];
  387. if (orderDetail && orderDetail.length) {
  388. for (let goods of orderDetail) {
  389. if (goods.form_id == '0') {
  390. continue;
  391. }
  392. if (form_ids.indexOf(goods.form_id) === -1) {
  393. form_ids.push(goods.form_id);
  394. newArr[goods.form_id] = [goods];
  395. } else {
  396. newArr[goods.form_id].push(goods);
  397. }
  398. }
  399. }
  400. return Object.values(newArr);
  401. },
  402. orderStatus: function() {
  403. if (this.order.is_sale == 1) {
  404. return '已完成';
  405. } else if (this.order.cancel_status == 1) {
  406. return '订单已取消';
  407. } else if (this.order.cancel_status == 2) {
  408. return '取消订单 待处理';
  409. } else if (this.order.is_pay == 0 && this.order.pay_type != 2) {
  410. return '等待买家付款';
  411. } else if (this.order.is_send == 0) {
  412. return '等待卖家发货';
  413. } else if (this.order.is_confirm == 0) {
  414. return '卖家已发货';
  415. } else if (this.order.is_confirm == 1) {
  416. return '买家已收货';
  417. }
  418. }
  419. },
  420. methods: {
  421. toExpressInfo(item) {
  422. uni.navigateTo({
  423. url: '/pages/app_admin/express/express?id='+item.id+'&express='+item.detailExpress[0].express+'&express_no='+item.detailExpress[0].express_no+'&customer_name='+item.detailExpress[0].customer_name
  424. })
  425. },
  426. toExpressMore(item) {
  427. uni.navigateTo({
  428. url: '/pages/order/express-list/express-list?order_id='+item.id
  429. })
  430. },
  431. cancel(e) {
  432. if(e && e.id > 0) {
  433. if(this.status == 2) {
  434. this.detail = e;
  435. }else {
  436. this.order = e;
  437. }
  438. }
  439. this.showSolt = false;
  440. setTimeout(()=>{
  441. this.showSolt = true;
  442. },0)
  443. this.$forceUpdate();
  444. },
  445. toCall(e) {
  446. if(this.status == 2) {
  447. this.detail.showMobile = true;
  448. }else {
  449. this.order.showMobile = true;
  450. }
  451. this.showSolt = false;
  452. setTimeout(()=>{
  453. this.showSolt = true;
  454. },0)
  455. this.$forceUpdate();
  456. },
  457. update(row) {
  458. uni.showLoading({
  459. mask: true,
  460. title: '加载中...'
  461. });
  462. this.getList();
  463. },
  464. toggle(index) {
  465. this.order.composition_list[index].show = !this.order.composition_list[index].show;
  466. },
  467. openMap() {
  468. let location = this.order.location.split(',');
  469. uni.openLocation({
  470. latitude: +location[1],
  471. longitude: +location[0]
  472. });
  473. },
  474. imageLoad(index) {
  475. this.order.order_form[index].loadOver = false;
  476. },
  477. // 查看图片
  478. look(e) {
  479. uni.previewImage({
  480. current: e, // 当前显示图片的http链接
  481. urls: [e] // 需要预览的图片http链接列表
  482. })
  483. },
  484. imageFormLoad(idx,index) {
  485. this.order.detail[idx].form_data[index].loadOver = false;
  486. },
  487. copy() {
  488. let address = `${this.order.name} ${this.order.mobile} ${this.order.address}`;
  489. this.$utils.uniCopy({
  490. data: address,
  491. success() {
  492. uni.showToast({
  493. title: '复制成功',
  494. duration: 1000
  495. });
  496. }
  497. })
  498. },
  499. getTime() {
  500. let reset_time = this.reset_time - 1;
  501. let dd = 0;
  502. let hh = parseInt(reset_time / 3600);
  503. if (reset_time > 86400) {
  504. dd = parseInt(reset_time / 86400);
  505. hh = parseInt((reset_time - 86400 * dd) / 3600);
  506. }
  507. let h = reset_time % 3600;
  508. let mm = parseInt(h / 60);
  509. if (hh < 10) {
  510. hh = '0' + hh.toString();
  511. }
  512. if (mm < 10) {
  513. mm = '0' + mm.toString();
  514. }
  515. this.reset_time = reset_time;
  516. this.dd = dd;
  517. this.hh = hh;
  518. this.mm = mm;
  519. },
  520. getList() {
  521. let that = this;
  522. that.about = '';
  523. that.$showLoading({
  524. type: 'global',
  525. text: '加载中...'
  526. });
  527. let para = {};
  528. if(that.status == 1) {
  529. para.order_id = that.id
  530. }else {
  531. para.refund_order_id = that.id
  532. }
  533. that.$request({
  534. url: that.status == 1 ?that.$api.app_admin.detail : that.$api.app_admin.refund_detail,
  535. data: para,
  536. method: 'post'
  537. }).then(response=>{
  538. uni.hideLoading();
  539. that.$hideLoading();
  540. if(response.code == 0) {
  541. that.showSolt = true;
  542. let order;
  543. if(that.status == 1) {
  544. order = response.data.order;
  545. order.showMobile = false;
  546. }else {
  547. that.detail = response.data.detail
  548. that.detail.showMobile = false;
  549. order = response.data.detail.order;
  550. order.detail = [];
  551. order.detail[0] = response.data.detail.detail
  552. }
  553. order.address = order.address.replace(/\s*/g, "");
  554. let reset_time = 0;
  555. if (order.auto_cancel > 0) {
  556. reset_time = order.auto_cancel;
  557. } else if (order.auto_confirm > 0) {
  558. reset_time = order.auto_confirm;
  559. } else if (order.auto_sales > 0) {
  560. reset_time = order.auto_sales;
  561. }
  562. if(that.first) {
  563. if(order.order_form !=null && order.order_form.length > 0) {
  564. for(let i = 0;i < order.order_form.length;i++) {
  565. if(order.order_form[i].key == 'img_upload') {
  566. order.order_form[i].loadOver = true;
  567. }
  568. }
  569. }
  570. that.first = false;
  571. }
  572. that.showForm = false;
  573. for(let i in order.detail) {
  574. if(order.detail[i].form_data != null && order.detail[i].form_data.length > 0) {
  575. for(let item of order.detail[i].form_data) {
  576. if(item.value != null) {
  577. that.showForm = true;
  578. }
  579. }
  580. }
  581. }
  582. if(order.sign === 'booking' || order.sign === 'vip_card') {
  583. if(order.order_form != null && order.order_form.length > 0) {
  584. for(let item of order.order_form) {
  585. if(item.value != null) {
  586. that.showForm = true;
  587. }
  588. }
  589. }
  590. }
  591. if (order.sign == 'composition') {
  592. for (let i in order.composition_list) {
  593. order.composition_list[i].show = false;
  594. }
  595. }
  596. that.order = order;
  597. if(reset_time > 0) {
  598. that.reset_time = reset_time;
  599. setInterval(function() {
  600. that.getTime();
  601. }, 1000)
  602. }
  603. }else {
  604. uni.showToast({
  605. title: response.msg,
  606. icon: 'none',
  607. duration: 1000
  608. });
  609. }
  610. }).catch(response => {
  611. uni.hideLoading();
  612. that.$hideLoading();
  613. });
  614. },
  615. getAddress() {
  616. let that = this;
  617. that.$request({
  618. url: that.$api.app_admin.refund_address
  619. }).then(response => {
  620. that.$hideLoading();
  621. if (response.code == 0) {
  622. that.address = response.data.list;
  623. } else {
  624. uni.showToast({
  625. title: response.msg,
  626. icon: 'none',
  627. duration: 1000
  628. });
  629. }
  630. }).catch(response => {
  631. that.$hideLoading();
  632. uni.showToast({
  633. title: response,
  634. icon: 'none',
  635. duration: 1000
  636. });
  637. });
  638. },
  639. },
  640. onShow: function() {
  641. this.getList();
  642. },
  643. onLoad(options) { this.$commonLoad.onload(options);
  644. let that = this;
  645. uni.getSystemInfo({
  646. success: function (res) {
  647. if(res.model.indexOf('iPhone X') > -1 || res.model.indexOf('iPhone 11') > -1 || res.model.indexOf('iPhone11') > -1 || res.model.indexOf('iPhone12') > -1 || res.model.indexOf('Unknown Device') > -1) {
  648. that.iphone_x = true;
  649. }
  650. }
  651. });
  652. that.id = options.id;
  653. that.status = +options.status;
  654. that.getAddress();
  655. }
  656. }
  657. </script>
  658. <style scoped lang="scss">
  659. .goods-form {
  660. border-top: #{2rpx solid #e2e2e2};
  661. margin-top: #{20rpx};
  662. .price-label {
  663. margin-right: #{10rpx};
  664. }
  665. }
  666. .goods-form.more {
  667. border-top: 0;
  668. margin-top: #{10rpx};
  669. }
  670. .sc {
  671. position: relative;
  672. margin: #{24rpx};
  673. background-color: #fff;
  674. padding: #{24rpx};
  675. border-radius: #{16rpx};
  676. .sc-info {
  677. padding-right: #{120rpx};
  678. width: 100%;
  679. .sc-icon {
  680. height: #{72rpx};
  681. width: #{72rpx};
  682. margin-right: #{24rpx};
  683. }
  684. .sc-about {
  685. font-size: #{24rpx};
  686. color: #999999;
  687. .sc-person {
  688. margin-top: #{10rpx};
  689. color: #666666;
  690. font-size: #{28rpx};
  691. .sc-name {
  692. margin-right: #{16rpx};
  693. }
  694. }
  695. }
  696. }
  697. .sc-to-call {
  698. position: absolute;
  699. top: 50%;
  700. right: 0;
  701. margin-top: #{-28rpx};
  702. height: #{56rpx};
  703. width: #{120rpx};
  704. border-left: #{2rpx} solid #e2e2e2;
  705. image {
  706. height: #{40rpx};
  707. width: #{40rpx};
  708. }
  709. }
  710. }
  711. .composition {
  712. padding: 0;
  713. margin-bottom: #{4rpx};
  714. .composition-item {
  715. background-color: #fff;
  716. margin: #{24rpx};
  717. padding: #{24rpx};
  718. padding-top: 0;
  719. border-radius: #{16rpx};
  720. margin-bottom: #{20rpx};
  721. .composition-open {
  722. text-align: center;
  723. background-color: #fff;
  724. height: #{84rpx};
  725. .composition-btn {
  726. display: inline-block;
  727. border: #{2rpx} solid #bbbbbb;
  728. font-size: #{24rpx};
  729. color: #999999;
  730. padding: 0 #{24rpx};
  731. margin: #{12rpx} 0 #{16rpx};
  732. height: #{56rpx};
  733. line-height: #{54rpx};
  734. border-radius: #{28rpx};
  735. image {
  736. width: #{22rpx};
  737. height: #{12rpx};
  738. margin-left: #{16rpx};
  739. }
  740. }
  741. }
  742. .goods-list {
  743. padding: 0 #{24rpx};
  744. }
  745. .composition-title {
  746. height: #{80rpx};
  747. line-height: #{80rpx};
  748. font-size: #{24rpx};
  749. color: #353535;
  750. margin-bottom: #{24rpx};
  751. }
  752. }
  753. }
  754. .goods {
  755. height: #{160rpx};
  756. margin-top: #{24rpx};
  757. position: relative;
  758. font-size: #{24rpx};
  759. color: #353535;
  760. margin-bottom: #{24rpx};
  761. .goods-img {
  762. height: #{160rpx};
  763. width: #{160rpx};
  764. float: left;
  765. margin-right: #{20rpx};
  766. border-radius: #{4rpx};
  767. }
  768. .goods-attr {
  769. font-size: #{24rpx};
  770. color: #999;
  771. width: 70%;
  772. position: absolute;
  773. width: 70%;
  774. top: #{40rpx};
  775. left: #{180rpx};
  776. text {
  777. margin-right: #{20rpx};
  778. }
  779. }
  780. .goods-num {
  781. font-size: #{24rpx};
  782. color: #999;
  783. position: absolute;
  784. top: #{126rpx};
  785. left: #{180rpx};
  786. }
  787. .goods-price {
  788. font-size: #{24rpx};
  789. color: #353535;
  790. position: absolute;
  791. bottom: 0;
  792. right: 0;
  793. }
  794. }
  795. .head-img {
  796. height: #{220rpx};
  797. width: 100%;
  798. position: absolute;
  799. top: 0;
  800. left: 0;
  801. z-index: 1;
  802. }
  803. .head-txt {
  804. font-size: #{28rpx};
  805. color: #fff;
  806. position: absolute;
  807. top: #{45rpx};
  808. left: #{48rpx};
  809. right: #{48rpx};
  810. line-height: #{40rpx};
  811. height: #{40rpx};
  812. z-index: 2;
  813. }
  814. .status-txt {
  815. font-size: #{32rpx};
  816. }
  817. .user-info {
  818. position: relative;
  819. background-color: #fff;
  820. margin: #{140rpx} #{24rpx} 0;
  821. border-radius: #{16rpx};
  822. padding: #{28rpx} #{24rpx} 0;
  823. z-index: 2;
  824. font-size: #{26rpx};
  825. color: #353535;
  826. }
  827. .localhost-img {
  828. height: #{44rpx};
  829. width: #{44rpx};
  830. position: absolute;
  831. top: #{40rpx};
  832. left: #{24rpx};
  833. }
  834. .user-text {
  835. padding-left: #{68rpx};
  836. }
  837. .user-text:last-of-type {
  838. margin: #{10rpx} 0 #{28rpx};
  839. }
  840. .area {
  841. height: #{72rpx};
  842. border-top: #{1rpx} solid #e2e2e2;
  843. position: relative;
  844. }
  845. .detail-btn {
  846. // width: 50%;
  847. height: #{72rpx};
  848. text-align: center;
  849. line-height: #{72rpx};
  850. color: #446dfd;
  851. font-size: #{24rpx};
  852. }
  853. .line {
  854. position: absolute;
  855. top: #{16rpx};
  856. left: 50%;
  857. width: #{1rpx};
  858. margin-left: #{-1rpx};
  859. background-color: #e2e2e2;
  860. height: #{40rpx};
  861. }
  862. .line.left-line {
  863. left: 36%;
  864. width: #{2rpx};
  865. }
  866. .line.right-line {
  867. left: 68%;
  868. width: #{2rpx};
  869. }
  870. .logo {
  871. height: #{100rpx};
  872. width: #{100rpx};
  873. float: left;
  874. margin-right: #{34rpx};
  875. }
  876. .express {
  877. margin: #{24rpx};
  878. display: block;
  879. margin-bottom: 0;
  880. padding: #{32rpx};
  881. padding-left: #{24rpx};
  882. position: relative;
  883. font-size: #{32rpx};
  884. background-color: #fff;
  885. color: #353535;
  886. border-radius: #{16rpx};
  887. .showMore {
  888. font-size: #{28rpx};
  889. }
  890. .showMore+.to-more {
  891. margin-top: #{-12rpx};
  892. }
  893. }
  894. .to-more {
  895. height: #{24rpx};
  896. width: #{12rpx};
  897. position: absolute;
  898. right: #{24rpx};
  899. top: 50%;
  900. margin-top: #{-6rpx};
  901. }
  902. .goods-info {
  903. padding: #{24rpx};
  904. background-color: #fff;
  905. margin: #{24rpx};
  906. margin-bottom: 0;
  907. }
  908. .goods-info.card-info {
  909. position: relative;
  910. z-index: 10;
  911. border-top-left-radius: #{16rpx};
  912. border-top-right-radius: #{16rpx};
  913. }
  914. .goods-title {
  915. color: #353535;
  916. font-size: #{24rpx};
  917. &.form-title {
  918. margin-bottom: #{10rpx};
  919. }
  920. }
  921. .price-item {
  922. margin-bottom: #{10rpx};
  923. font-size: #{24rpx};
  924. color: #353535;
  925. }
  926. .refund-info {
  927. margin-top: #{15rpx};
  928. background-color: #f7f7f7;
  929. padding: #{15rpx} #{25rpx};
  930. font-size: #{24rpx};
  931. }
  932. .price-label {
  933. flex-shrink: 0;
  934. color: #999;
  935. font-size: #{24rpx};
  936. }
  937. .total-price {
  938. font-size: #{28rpx};
  939. color: #446dfd;
  940. font-weight: bold;
  941. }
  942. .btn.iphone_x {
  943. height: #{146rpx};
  944. padding-bottom: #{50rpx};
  945. }
  946. .btn {
  947. height: #{96rpx};
  948. position: fixed;
  949. bottom: 0;
  950. width: 100%;
  951. right: 0;
  952. border-top: #{1rpx} solid #e2e2e2;
  953. z-index: 10;
  954. padding: #{24rpx};
  955. background-color: #fff;
  956. }
  957. .bottom-place {
  958. height: #{120rpx};
  959. }
  960. .bottom-place.iphone_x {
  961. height: #{170rpx};
  962. }
  963. .name {
  964. margin-right: #{20rpx};
  965. }
  966. .express-company {
  967. margin-top: #{10rpx};
  968. }
  969. .express-number {
  970. color: #666666;
  971. font-size: #{28rpx};
  972. margin-top: #{10rpx}
  973. }
  974. .total-label {
  975. font-size: #{24rpx};
  976. color: #353535;
  977. }
  978. .mch-goods {
  979. .sc {
  980. margin: 0;
  981. border-radius: 0;
  982. border-top: #{2rpx} solid #e2e2e2;
  983. margin-top: #{30rpx};
  984. padding-right: 0;
  985. }
  986. .goods-title {
  987. margin-bottom: #{24rpx};
  988. }
  989. .price-label {
  990. margin-right: #{20rpx};
  991. }
  992. }
  993. .form-img {
  994. height: #{120rpx};
  995. width: #{120rpx};
  996. margin-right: #{10rpx};
  997. margin-top: #{10rpx};
  998. }
  999. .goods-name {
  1000. padding-top: #{5rpx};
  1001. }
  1002. .address-info {
  1003. margin-bottom: #{28rpx};
  1004. word-break: break-all;
  1005. }
  1006. .city-service {
  1007. width: 100%;
  1008. margin-bottom: 10#{rpx};
  1009. .info-box {
  1010. margin-left: #{12rpx};
  1011. .label {
  1012. margin-bottom: #{10rpx};
  1013. color: #999999;
  1014. font-size: #{28rpx};
  1015. }
  1016. }
  1017. .head {
  1018. width: #{75rpx};
  1019. height: #{75rpx};
  1020. }
  1021. .icon-box {
  1022. padding: 0 #{30rpx};
  1023. border-left: #{2rpx} solid #e2e2e2;
  1024. .icon {
  1025. width: #{45rpx};
  1026. height: #{45rpx};
  1027. }
  1028. }
  1029. }
  1030. .city-service {
  1031. width: 100%;
  1032. margin-bottom: 10#{rpx};
  1033. .await-man {
  1034. margin-left: #{12rpx};
  1035. font-size: #{28rpx};
  1036. color: #666666;
  1037. }
  1038. .info-box {
  1039. margin-left: #{12rpx};
  1040. .info-label {
  1041. margin-bottom: #{10rpx};
  1042. color: #999999;
  1043. font-size: #{28rpx};
  1044. }
  1045. .info {
  1046. color: #666666;
  1047. font-size: 28rpx;
  1048. }
  1049. }
  1050. .head {
  1051. width: #{75rpx};
  1052. height: #{75rpx};
  1053. }
  1054. .icon-box {
  1055. padding: 0 #{30rpx};
  1056. border-left: #{2rpx} solid #e2e2e2;
  1057. .icon {
  1058. width: #{45rpx};
  1059. height: #{45rpx};
  1060. }
  1061. }
  1062. }
  1063. </style>