order-detail.vue 44 KB

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