exchangeOrderDetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view class="container">
  3. <u-navbar title="详情" leftIconColor="#ffffff" titleStyle="color:#fff" :autoBack="true" placeholder></u-navbar>
  4. <view class="box">
  5. <view class="logistics" v-if="details.orderStatus!=30">
  6. <view class="title">物流</view>
  7. <view class="content" v-if="details.orderStatus==10">暂无物流信息</view>
  8. <view class="logistics_content" v-if="details.orderStatus==20" @click="goLogisticsInfo">
  9. <view class="logistics_content_l">{{details.orderPackages[0].expressContentJSON.list[0].status}}</view>
  10. <view class="logistics_content_r">
  11. <text class="iconfont icon-jiantou"></text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="logistics">
  16. <view class="title">收货地址</view>
  17. <view class="content">
  18. <view class="content_l">
  19. <u-icon name="map" color="#C90700" size="30"></u-icon>
  20. </view>
  21. <view class="content_r">
  22. <view class="content_r_text" v-if="details.shopOrderAddress.provinceName">{{details.shopOrderAddress.provinceName+details.shopOrderAddress.cityName+details.shopOrderAddress.areaName+details.shopOrderAddress.addressDetail}}</view>
  23. <view class="content_r_user" v-if="details.shopOrderAddress.receiverName">{{details.shopOrderAddress.receiverName}} <text>{{details.shopOrderAddress.receiverPhone}}</text></view>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- <view class="item">
  28. <view class="item_no">
  29. <view>
  30. <view class="item_no_lab">备注</view>
  31. <view class="item_no_val">{{details.buyerRemark}}</view>
  32. </view>
  33. </view>
  34. </view> -->
  35. <view class="item">
  36. <view class="item_t">订单号: <text>{{details.orderNo}}</text>
  37. </view>
  38. <view class="item_b" v-for="(v,i) in details.orderDetails" :key="i">
  39. <image :src="v.productCover" mode="" />
  40. <view class="item_b_r">
  41. <view class="item_b_r_title">{{v.productTitle}}</view>
  42. <view class="item_b_r_num">X1</view>
  43. <view class="item_b_r_price">
  44. <view class="item_b_r_price_l">¥{{v.productPriceTotal}}</view>
  45. <view class="item_b_r_price_r">{{v.pointsTotal}}兑换豆</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="item_line"></view>
  50. <view class="item_no">
  51. <view>
  52. <view class="item_no_lab">订单编号:</view>
  53. <view class="item_no_val">{{details.orderNo}}</view>
  54. </view>
  55. <view>
  56. <view class="item_no_lab">下单时间</view>
  57. <view class="item_no_val">{{details.orderTime?details.orderTime.replace(/-/g,'.'):'--'}}</view>
  58. </view>
  59. <template v-if="details.orderPackages&&details.orderPackages.length>0">
  60. <view>
  61. <view class="item_no_lab">快递单号:</view>
  62. <view class="item_no_val">{{details.orderPackages[0].expressNo}}</view>
  63. </view>
  64. <view>
  65. <view class="item_no_lab">发货时间:</view>
  66. <view class="item_no_val">{{details.orderPackages[0].shipTime.replace(/-/g,'.')}}</view>
  67. </view>
  68. </template>
  69. </view>
  70. </view>
  71. <view class="logistics">
  72. <view class="title">备注</view>
  73. <view class="content">{{details.buyerRemark||'无'}}</view>
  74. </view>
  75. </view>
  76. <view class="btnBox" v-if="details.orderStatus==20">
  77. <view class="red" @click="confirmReceipt">确认收货</view>
  78. </view>
  79. <view class="btnBox" v-if="details.orderStatus==30">
  80. <view class="gary" @click="goLogisticsInfo">查看物流</view>
  81. <view class="red" v-if="details.orderDetails[0].commentStatus==0" @click="goPath('/pages/mine/evaluate?orderId='+details.orderDetails[0].orderId+'&productTitle='+details.orderDetails[0].productTitle+'&productCover='+details.orderDetails[0].productCover+'&productId='+details.orderDetails[0].productId)">评价</view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import { shoporderInfo, simpleReceiving } from "@/api/giftPackageCenter.js"
  87. export default {
  88. data () {
  89. return {
  90. type: 2,//0 待发货详情 1已发货详情 2确认收货详情
  91. details: {
  92. shopOrderAddress: {},
  93. orderPackages: []
  94. },
  95. orderId: undefined
  96. }
  97. },
  98. onLoad (options) {
  99. if (options.orderId) {
  100. this.orderId = options.orderId;
  101. }
  102. },
  103. onShow () {
  104. this.getDetails()
  105. },
  106. methods: {
  107. goPath (path) {
  108. uni.navigateTo({
  109. url: path
  110. })
  111. },
  112. getDetails () {
  113. shoporderInfo(this.orderId).then(res => {
  114. if (res.data.orderPackages && res.data.orderPackages.length > 0) {
  115. res.data.orderPackages.map(v => {
  116. if (v.expressContent) {
  117. v.expressContentJSON = JSON.parse(v.expressContent)
  118. }
  119. })
  120. }
  121. console.log(res.data);
  122. this.details = res.data;
  123. })
  124. },
  125. goLogisticsInfo () {
  126. uni.navigateTo({
  127. url: '/pages/mine/logisticsInfo?packageId=' + this.details.orderPackages[0].packageId + '&address=' + this.details.shopOrderAddress.provinceName + this.details.shopOrderAddress.cityName + this.details.shopOrderAddress.areaName + this.details.shopOrderAddress.addressDetail
  128. })
  129. },
  130. // 确认收货
  131. confirmReceipt () {
  132. uni.showModal({
  133. title: '提示',
  134. content: '确定收到商品?',
  135. success: (res) => {
  136. if (res.confirm) {
  137. simpleReceiving({ orderId: this.details.orderId }).then(res => {
  138. uni.showToast({
  139. title: '确认收货成功',
  140. icon: 'none'
  141. })
  142. this.getDetails(this.details.orderId)
  143. })
  144. }
  145. }
  146. })
  147. },
  148. }
  149. }
  150. </script>
  151. <style lang='scss' scoped>
  152. ::v-deep .u-navbar__content,
  153. ::v-deep .u-status-bar {
  154. background-color: #c90700 !important;
  155. }
  156. .container {
  157. background: #f8f8f8;
  158. min-height: calc(100vh - 200rpx);
  159. padding-bottom: 150rpx;
  160. .box {
  161. padding: 30rpx;
  162. .logistics {
  163. background: #ffffff;
  164. border-radius: 30rpx;
  165. margin-bottom: 30rpx;
  166. .title {
  167. font-size: 30rpx;
  168. color: #242424;
  169. font-family: FZCuYuan-M03;
  170. padding: 38rpx 20rpx 23rpx;
  171. border-bottom: 1px solid #e6e6e6;
  172. }
  173. .logistics_content {
  174. display: flex;
  175. justify-content: space-between;
  176. align-items: center;
  177. padding: 27rpx 20rpx 48rpx;
  178. .logistics_content_l {
  179. font-size: 28rpx;
  180. color: #1a1a1a;
  181. }
  182. .logistics_content_r {
  183. text {
  184. font-size: 36rpx;
  185. color: #808080;
  186. }
  187. }
  188. }
  189. .content {
  190. padding: 27rpx 20rpx 48rpx;
  191. font-size: 28rpx;
  192. color: #808080;
  193. display: flex;
  194. .content_l {
  195. margin-right: 29rpx;
  196. }
  197. .content_r {
  198. .content_r_text {
  199. font-size: 28rpx;
  200. color: #1a1a1a;
  201. line-height: 38rpx;
  202. }
  203. .content_r_user {
  204. font-size: 24rpx;
  205. color: #1a1a1a;
  206. margin-top: 15rpx;
  207. text {
  208. font-size: 24rpx;
  209. color: #808080;
  210. display: inline-block;
  211. margin-left: 15rpx;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. .item {
  218. background: #ffffff;
  219. border-radius: 30rpx;
  220. margin-bottom: 32rpx;
  221. .item_t {
  222. font-size: 29rpx;
  223. color: #1a1a1a;
  224. font-family: FZCuYuan-M03;
  225. padding: 50rpx 20rpx 30rpx;
  226. border-bottom: 1px solid #cccccc;
  227. position: relative;
  228. text {
  229. color: #808080;
  230. font-family: FZCuYuan-M03;
  231. }
  232. .tag {
  233. width: 136rpx;
  234. height: 50rpx;
  235. border-radius: 0rpx 30rpx 0rpx 30rpx;
  236. font-size: 24rpx;
  237. line-height: 50rpx;
  238. text-align: center;
  239. position: absolute;
  240. top: 0;
  241. right: 0;
  242. }
  243. .red {
  244. background: #ffdbd9;
  245. color: #fb0b03;
  246. }
  247. .green {
  248. background: #e6ffec;
  249. color: #00bf02;
  250. }
  251. .gary {
  252. background: #e6e6e6;
  253. color: #333333;
  254. }
  255. }
  256. .item_b {
  257. display: flex;
  258. padding: 30rpx 20rpx 30rpx;
  259. > image {
  260. width: 172rpx;
  261. height: 172rpx;
  262. border-radius: 12rpx;
  263. margin-right: 20rpx;
  264. flex-shrink: 0;
  265. }
  266. .item_b_r {
  267. flex-grow: 1;
  268. .item_b_r_title {
  269. font-size: 28rpx;
  270. color: #1a1a1a;
  271. min-height: 74rpx;
  272. overflow: hidden;
  273. text-overflow: ellipsis;
  274. display: -webkit-box;
  275. -webkit-line-clamp: 2;
  276. -webkit-box-orient: vertical;
  277. line-height: 42rpx;
  278. }
  279. .item_b_r_num {
  280. font-size: 26rpx;
  281. color: #1a1a1a;
  282. margin-top: 10rpx;
  283. }
  284. .item_b_r_price {
  285. margin-top: 20rpx;
  286. display: flex;
  287. justify-content: space-between;
  288. align-items: baseline;
  289. .item_b_r_price_l {
  290. font-size: 26rpx;
  291. color: #1a1a1a;
  292. }
  293. .item_b_r_price_r {
  294. font-size: 32rpx;
  295. color: #fb0b03;
  296. font-family: FZCuYuan-M03;
  297. }
  298. }
  299. }
  300. }
  301. .item_line {
  302. width: 650rpx;
  303. height: 0rpx;
  304. border-bottom: 1rpx solid #e6e6e6;
  305. margin: auto;
  306. }
  307. .item_no {
  308. padding: 30rpx 20rpx;
  309. > view {
  310. display: flex;
  311. justify-content: space-between;
  312. align-items: center;
  313. padding: 12rpx 0;
  314. .item_no_lab {
  315. font-size: 26rpx;
  316. color: #1a1a1a;
  317. }
  318. .item_no_val {
  319. font-size: 26rpx;
  320. color: #666666;
  321. }
  322. }
  323. }
  324. }
  325. }
  326. }
  327. .btnBox {
  328. width: 100%;
  329. background: #ffffff;
  330. padding: 45rpx 50rpx 33rpx;
  331. box-sizing: border-box;
  332. border-top: 1rpx solid #e7e7e7;
  333. position: fixed;
  334. left: 0;
  335. bottom: 0;
  336. display: flex;
  337. justify-content: flex-end;
  338. > view {
  339. width: 200rpx;
  340. height: 70rpx;
  341. border-radius: 35rpx;
  342. text-align: center;
  343. font-size: 26rpx;
  344. line-height: 72rpx;
  345. text-align: center;
  346. color: #ffffff;
  347. margin-left: 25rpx;
  348. }
  349. .red {
  350. background: #fb0b03;
  351. }
  352. .gary {
  353. background: #999999;
  354. }
  355. }
  356. </style>