orderDetail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="hflex acenter">
  5. <!-- <view class="state">{{pageData.status}}</view> -->
  6. <view class="state" v-if="pageData.status == 0">已取消</view>
  7. <view class="state" v-if="pageData.status == 1">预订单</view>
  8. <view class="state" v-if="pageData.status == 2">等待买家付款</view>
  9. <view class="state" v-if="pageData.status == 3">等待买家付款</view>
  10. <view class="state" v-if="pageData.status == 4">买家已付款</view>
  11. <view class="state" v-if="pageData.status == 5">等待买家收货</view>
  12. <view class="state" v-if="pageData.status == 6">已完成</view>
  13. <view class="state" v-if="pageData.status == 7">退款中</view>
  14. <view class="state" v-if="pageData.status == 8">已退款</view>
  15. <view class="hflex acenter blue_bg2" v-if="pageData.status == 2">
  16. <view class="blue_bg">剩余付款时间</view>
  17. <view class="hflex acenter">
  18. <u-count-down autoStart :time="time" format="mm:ss" @change="onChange">
  19. <view class="time">
  20. <!-- <text class="time__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}&nbsp;小时</text> -->
  21. <text class="time__item">{{ timeData.minutes>=10?timeData.minutes:'0'+timeData.minutes }}&nbsp;分钟</text>
  22. <text class="time__item">{{ timeData.seconds>=10?timeData.seconds:'0'+timeData.seconds }}&nbsp;秒</text>
  23. </view>
  24. </u-count-down>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="subTitle" v-if="pageData.status == 0">{{pageData.cancel_remark}}</view>
  29. <view class="subTitle" v-if="pageData.status == 4">已付款,等待商家发货</view>
  30. <view class="subTitle" v-if="pageData.status == 5">已发货,等待买家确认收货</view>
  31. </view>
  32. <view class="center">
  33. <view class="box">
  34. <view class="box_title">发货信息</view>
  35. <view class="hflex jbetween cell" >
  36. <view class="left">收货信息</view>
  37. <view class="right">{{pageData.user_address.address_name}} , {{pageData.user_address.address_phone}} , {{pageData.user_address.address_province}}{{pageData.user_address.address_city}}{{pageData.user_address.address_area}}{{pageData.user_address.address_content}}</view>
  38. </view>
  39. <view class="hflex jbetween cell" v-if="pageData.status == 5">
  40. <view class="left">物流单号</view>
  41. <view class="right hflex acenter">
  42. <view> {{pageData.express_no}}</view>
  43. <image src="/static/images/common/copy.png" style="width: 28rpx;height: 28rpx;" @click="copy(pageData.express_no)"></image>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="box">
  48. <view class="box_title">买家信息</view>
  49. <view class="hflex jbetween cell">
  50. <view class="left">买家昵称</view>
  51. <view class="right">{{pageData.user.nickname}}</view>
  52. </view>
  53. <view class="hflex jbetween cell">
  54. <view class="left">联系电话</view>
  55. <view class="right">{{pageData.user.phone}}</view>
  56. </view>
  57. </view>
  58. <view class="box">
  59. <view class="box_title">商品信息</view>
  60. <view >
  61. <block v-for="(item,index) in pageData.goods_item" :key="index">
  62. <view class="items hflex acenter">
  63. <image :src="item.goods_cover" class="item-img"></image>
  64. <view class="item-right">
  65. <view class="hflex acenter jbetween">
  66. <view class="item_name text_hide">{{item.goods_name}}</view>
  67. <view class="item_price">¥<span style="font-size: 30rpx;">{{item.price_selling}}</span></view>
  68. </view>
  69. <view class="hflex jbetween" style="padding: 20rpx 0 0;">
  70. <view class="norm">{{item.goods_spec}}</view>
  71. <view class="left_text">X{{item.stock_sales}}</view>
  72. </view>
  73. </view>
  74. </view>
  75. </block>
  76. </view>
  77. <view class="hflex acenter jbetween cell">
  78. <view class="left" style="color: #888888;">运费</view>
  79. <view class="right" style="color: #888888;">¥0.00</view>
  80. </view>
  81. <view class="hflex jend cell">
  82. <view class="right">
  83. 共{{pageData.goods_item.length}}件商品 实付款¥<span style="font-size: 32rpx;color: #222;">{{pageData.payment_amount}}</span>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="box">
  88. <view class="box_title">订单信息</view>
  89. <view class="hflex jbetween cell">
  90. <view class="left">订单编号</view>
  91. <view class="hflex acenter">
  92. <view class="right">{{pageData.order_no}} </view>
  93. <view class="right1" @click="copy(pageData.order_no)"> | 复制</view>
  94. </view>
  95. </view>
  96. <view class="hflex jbetween cell">
  97. <view class="left">下单时间</view>
  98. <view class="right">{{pageData.create_at}}</view>
  99. </view>
  100. <view class="hflex jbetween cell" v-if="pageData.status == 4 || pageData.status == 5 || pageData.status == 6">
  101. <view class="left">付款时间</view>
  102. <view class="right">{{pageData.payment_datetime}}</view>
  103. </view>
  104. <view class="hflex jbetween cell" v-if="pageData.status == 4 || pageData.status == 5 || pageData.status == 6">
  105. <view class="left">支付方式</view>
  106. <view class="right">{{pageData.payment_type}}</view>
  107. </view>
  108. <view class="hflex jbetween cell" v-if="pageData.status == 5 || pageData.status == 6">
  109. <view class="left">发货时间</view>
  110. <view class="right">{{pageData.user_address.send_datetime}}</view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="bottom hflex acenter jend">
  115. <view class="btn1 btn2 hflex acenter jcenter" v-if="pageData.status == 0 ||pageData.status == 2 || pageData.status == 3">联系买家</view>
  116. <view class="hflex acenter jend" v-if="pageData.status == 4">
  117. <view class="btn1 hflex acenter jcenter">联系买家</view>
  118. <view class="btn1 btn2 hflex acenter jcenter" @click="send(pageData.id)">立即发货</view>
  119. </view>
  120. <view class="btn1 hflex acenter jcenter" v-if="pageData.status == 5 ||pageData.status == 6">联系买家</view>
  121. </view>
  122. </view>
  123. </template>
  124. <script>
  125. import $api from '@/static/js/api.js'
  126. var that = ''
  127. export default {
  128. data() {
  129. return {
  130. id: '',
  131. pageData: {},
  132. time: 0,
  133. timeData: {},
  134. }
  135. },
  136. onLoad(options) {
  137. that = this
  138. that.id = options.id
  139. that.getData()
  140. },
  141. methods: {
  142. getData() {
  143. $api.req({
  144. url: '/data/api.business.Order/order_info',
  145. method: 'POST',
  146. data: {
  147. order_id: that.id
  148. }
  149. }, function(res) {
  150. if(res.code == 1) {
  151. that.pageData = res.data
  152. that.pageData.user_address.address_name = that.pageData.user_address.address_name.slice(0,1)+ '**'
  153. that.pageData.user_address.address_phone = '***********'
  154. that.pageData.user_address.address_content = that.pageData.user_address.address_content.slice(0,5) + '******'
  155. that.pageData.user.phone = that.pageData.user.phone.substring(0,3)+"****"+that.pageData.user.phone.substring(7);
  156. that.computTime()
  157. }
  158. })
  159. },
  160. // 倒计时
  161. onChange(e) {
  162. that.timeData = e
  163. },
  164. // 计算倒计时
  165. computTime() {
  166. var date = new Date(that.pageData.create_at).getTime() + ( 30 * 60 * 1000);
  167. var nowDate = new Date().getTime()
  168. that.time = date - nowDate
  169. },
  170. copy(value) {
  171. uni.setClipboardData({
  172. data: value,
  173. success: function () {
  174. $api.info('复制成功')
  175. }
  176. });
  177. },
  178. send(id) {
  179. $api.jump('/pages/order/send?id=' + id)
  180. },
  181. },
  182. }
  183. </script>
  184. <style lang="scss" scoped>
  185. .content {
  186. background: #F4F4F4;
  187. .top {
  188. width: 100%;
  189. padding: 20rpx 30rpx 24rpx;
  190. .state {
  191. font-size: 36rpx;
  192. font-weight: bold;
  193. color: #222222;
  194. line-height: 50rpx;
  195. padding-right: 24rpx;
  196. }
  197. .blue_bg {
  198. // width: 124rpx;
  199. padding: 0 14rpx;
  200. height: 32rpx;
  201. background: #506DFF;
  202. border-radius: 18rpx 0px 18rpx 18rpx;
  203. font-size: 16rpx;
  204. text-align: center;
  205. font-weight: 400;
  206. color: #FFFFFF;
  207. line-height: 32rpx;
  208. }
  209. .blue_bg2 {
  210. // width: 256rpx;
  211. padding: 0 14rpx;
  212. height: 32rpx;
  213. background: #E7EBFF;
  214. border-radius: 18rpx;
  215. font-size: 16rpx;
  216. font-weight: bold;
  217. color: #222222;
  218. line-height: 32rpx;
  219. }
  220. .time {
  221. padding-left: 16rpx;
  222. }
  223. .subTitle {
  224. font-size: 24rpx;
  225. font-weight: 400;
  226. color: #888888;
  227. line-height: 34rpx;
  228. }
  229. }
  230. .center {
  231. width: 100%;
  232. box-sizing: border-box;
  233. padding: 0 30rpx;
  234. .box {
  235. width: 100%;
  236. background: #FFFFFF;
  237. border-radius: 20rpx;
  238. box-sizing: border-box;
  239. padding: 0 20rpx;
  240. margin-top: 20rpx;
  241. .box_title {
  242. font-size: 32rpx;
  243. font-weight: 600;
  244. color: #222222;
  245. line-height: 44rpx;
  246. padding: 28rpx 0 24rpx;
  247. }
  248. .cell {
  249. padding-bottom: 24rpx;
  250. .left {
  251. width: 240rpx;
  252. font-size: 26rpx;
  253. font-weight: 400;
  254. color: #222222;
  255. line-height: 36rpx;
  256. }
  257. .right {
  258. font-size: 26rpx;
  259. font-weight: 400;
  260. color: #555555;
  261. line-height: 36rpx;
  262. }
  263. .right1 {
  264. font-size: 26rpx;
  265. font-weight: 400;
  266. color: #333333;
  267. line-height: 36rpx;
  268. }
  269. }
  270. .items {
  271. padding: 20rpx 0 32rpx;
  272. border-bottom: 1rpx solid #F4F4F4;
  273. .item-img {
  274. width: 160rpx;
  275. height: 160rpx;
  276. border-radius: 24rpx;
  277. }
  278. .item-right {
  279. width:calc(100% - 160rpx);
  280. padding-left: 20rpx;
  281. .item_name {
  282. font-size: 30rpx;
  283. font-weight: 400;
  284. color: #222222;
  285. line-height: 42rpx;
  286. }
  287. .item_price {
  288. font-size: 20rpx;
  289. font-weight: 600;
  290. color: #222222;
  291. line-height: 24rpx;
  292. }
  293. .norm {
  294. width: 288rpx;
  295. // height: 42px;
  296. background: #F5F5F5;
  297. border-radius: 12rpx;
  298. box-sizing: border-box;
  299. padding: 12rpx;
  300. font-size: 20rpx;
  301. font-weight: 400;
  302. color: #888888;
  303. line-height: 28rpx;
  304. }
  305. .left_text {
  306. font-size: 24rpx;
  307. font-weight: 500;
  308. color: #888888;
  309. line-height: 28rpx;
  310. }
  311. }
  312. }
  313. .items:nth-last-child(1) {
  314. border: none;
  315. }
  316. }
  317. .box:nth-last-child(1) {
  318. margin-bottom: 186rpx;
  319. }
  320. }
  321. .bottom {
  322. width: 100%;
  323. height: 166rpx;
  324. background: #FFFFFF;
  325. box-sizing: border-box;
  326. padding: 0 30rpx;
  327. position: fixed;
  328. z-index: 99;
  329. bottom: 0;
  330. .btn1 {
  331. width: 208rpx;
  332. height: 76rpx;
  333. border-radius: 38rpx;
  334. border: 1rpx solid #787878;
  335. font-size: 30rpx;
  336. font-weight: 400;
  337. color: #222222;
  338. line-height: 42rpx;
  339. margin-left: 20rpx;
  340. }
  341. .btn2 {
  342. background: #506DFF;
  343. border: none;
  344. color: #FFFFFF;
  345. }
  346. }
  347. }
  348. </style>