order-detail1.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <view class="order-detail1">
  3. <view url="../address-manage/address-manage?choose=1" class="address">
  4. <view class="address-info">
  5. <view class="top">
  6. <text class="name">收货人:{{ address.con_name }}</text>
  7. <text class="phone">{{ address.con_mobile }}</text>
  8. </view>
  9. <view class="detail ellipsis">{{ address | getAddressString }}</view>
  10. </view>
  11. <text class="cuIcon-right"></text>
  12. </view>
  13. <view class="border">
  14. <text style="margin-left: 0;"></text>
  15. <text v-for="item in 21" :key="item" :class="{ red: item % 2 === 1 }"></text>
  16. </view>
  17. <view class="order_num app-item">
  18. <text>订单编号:{{ order_num }}</text>
  19. <text class="basecolor">{{ status }}</text>
  20. </view>
  21. <view class="list" @click="toList">
  22. <view class="list-item" v-for="(item, index) in goodList" :key="index">
  23. <image :src="item.main_img" ></image>
  24. <view class="info">
  25. <text>尺码:{{ item.size.length }}</text>
  26. <text>数量:{{ item.num.reduce((t, e) => t + e, 0) }}</text>
  27. <text>共计金额:<text class="basecolor">¥{{ item.money * item.num.reduce((t, e) => t + e, 0) }}</text></text>
  28. </view>
  29. </view>
  30. </view>
  31. <view v-if="nopay">
  32. <view class="top app-item">
  33. <text>付款信息</text>
  34. </view>
  35. <view class="app-item">
  36. <text>订单金额</text>
  37. <text>¥{{ money }}</text>
  38. </view>
  39. <view class="app-item">
  40. <text>应付金额</text>
  41. <text>¥{{ money }}</text>
  42. </view>
  43. <view class="app-item pay">
  44. <text>已付:<text class="basecolor">¥0.00</text></text>
  45. <text class="paynow" @click="payNow">立即付款</text>
  46. </view>
  47. </view>
  48. <view class="app-item t">
  49. <text>下单时间</text>
  50. <text>{{ created_at }}</text>
  51. </view>
  52. <view class="app-item t">
  53. <text>物流公司</text>
  54. <text>{{ track_company }}</text>
  55. </view>
  56. <view class="app-item">
  57. <text>物流单号</text>
  58. <text>{{ track_number }}</text>
  59. </view>
  60. <view class="app-item">
  61. <text>发货时间</text>
  62. <text>{{ track_time }}</text>
  63. </view>
  64. <view class="app-item">
  65. <text style="width: 160px">物流备注</text>
  66. <text style="padding: 8px 0;">{{ track_remark }}</text>
  67. </view>
  68. <view class="app-item t" @click="showRemark">
  69. <text>订单备注</text>
  70. <text class="cuIcon-right"></text>
  71. </view>
  72. <navigator :url="'../order-detail1-log/order-detail1-log?order_num=' + order_num" class="app-item">
  73. <text>操作日志</text>
  74. <text class="cuIcon-right"></text>
  75. </navigator>
  76. <view class="submit" @click="buyAgain">
  77. <view class="right">再次购买</view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import { _API_GoodList } from '@/apis/good.js'
  83. import { _API_OrderDetail1 } from '@/apis/order.js'
  84. export default {
  85. data() {
  86. return {
  87. address: {},
  88. goodList: [],
  89. nopay: false,
  90. status: '',
  91. order_id:'',
  92. order_num: '',
  93. remark: '',
  94. money: '',
  95. created_at: '',
  96. track_company: '',
  97. track_number: '',
  98. track_remark: '',
  99. track_time: ''
  100. }
  101. },
  102. onLoad({ created_at, status, order_id, order_num, nopay, money }) {
  103. this.status = status
  104. this.money = money
  105. this.order_id = order_id
  106. this.order_num = order_num
  107. this.created_at = created_at
  108. if (nopay) {
  109. this.nopay = true
  110. }
  111. uni.loading()
  112. _API_OrderDetail1({ order_num }).then(({ code, data: { remark, address, list, track_company, track_number, track_remark, track_time } }) => {
  113. this.remark = remark
  114. this.address = address
  115. this.goodList = list
  116. this.track_company = track_company
  117. this.track_number = track_number
  118. this.track_remark = track_remark
  119. this.track_time = track_time
  120. })
  121. },
  122. methods: {
  123. showRemark() { // 点击备注
  124. if (this.remark) {
  125. uni.showModal({ title: '备注', content: this.remark, showCancel: false })
  126. } else {
  127. uni.toast('该订单无备注')
  128. }
  129. },
  130. toList() { // 点击查看商品详情
  131. uni.setStorageSync('lll', JSON.stringify(this.goodList))
  132. uni.navigateTo({ url: '../order-detail1-list/order-detail1-list' })
  133. },
  134. payNow() {
  135. uni.navigateTo({ url: `../pay-order/pay-order?order_num=${this.order_num}&money=${this.money}&order_id=${this.order_id}` })
  136. },
  137. buyAgain() {
  138. uni.showModal({
  139. title: '提示',
  140. content: '确定要再次购买?',
  141. success: (res) => {
  142. if (res.confirm) {
  143. uni.loading()
  144. _API_GoodList().then(({ data: { list: list1 } }) => {
  145. uni.loading()
  146. list1.forEach(e => e.cart = Array(e.size.length).fill(0))
  147. _API_OrderDetail1({ order_num: this.order_num }).then(({ data: { list: list2 } }) => {
  148. this.$store.commit('cart/CLEAR')
  149. list1.forEach((item, index) => {
  150. const findRes = list2.find(e => e.attr_id == item.attr_id)
  151. if (findRes) {
  152. findRes.size.forEach((size, sizeIndex) => {
  153. const goodItemSizeIndex = list1[index].size.findIndex(e => e === size)
  154. list1[index].cart[goodItemSizeIndex] = findRes.num[sizeIndex]
  155. })
  156. item.choosed = true
  157. item.sizeChoosed = Array(item.size.length).fill(true)
  158. this.$store.commit('cart/ADD', item)
  159. uni.switchTab({ url: '../shop-car1/shop-car1' })
  160. }
  161. })
  162. })
  163. })
  164. }
  165. }
  166. })
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. .order-detail1 {
  173. height: 100vh;
  174. overflow: auto;
  175. background: $app-base-bg;
  176. border-bottom: 100rpx solid transparent;
  177. .address {
  178. height: 120rpx;
  179. background: #FFFFFF;
  180. padding: 0 30rpx;
  181. box-sizing: border-box;
  182. @include flex();
  183. justify-content: space-between;
  184. .address-info {
  185. flex: 1;
  186. color: #181818;
  187. font-size: 28rpx;
  188. @include flex(column);
  189. align-items: flex-start;
  190. .name {
  191. font-size: 32rpx;
  192. font-weight: bold;
  193. }
  194. .phone {
  195. margin-left: 30rpx;
  196. }
  197. .detail {
  198. width: 654rpx;
  199. color: #666666;
  200. }
  201. }
  202. .choose {
  203. @include flex();
  204. justify-content: flex-start;
  205. .add {
  206. @include flex();
  207. background: $app-base-color;
  208. font-size: 40rpx;
  209. color: #FFFFFF;
  210. width: 60rpx;
  211. height: 60rpx;
  212. }
  213. .text {
  214. margin-left: 17rpx;
  215. color: 32rpx;
  216. }
  217. }
  218. .cuIcon-right {
  219. font-size: 38rpx;
  220. }
  221. }
  222. .border {
  223. @include flex();
  224. height: 6rpx;
  225. background: #FFFFFF;
  226. text {
  227. flex: 1;
  228. height: 100%;
  229. background: #3283FA;
  230. margin-left: 8rpx;
  231. &.red {
  232. background: #F56C6C;
  233. }
  234. }
  235. }
  236. .order_num {
  237. height: 90rpx;
  238. font-size: 28rpx;
  239. margin-top: 14rpx;
  240. font-weight: bold;
  241. background: #FFFFFF;
  242. }
  243. .list {
  244. .list-item {
  245. height: 200rpx;
  246. margin-top: 1rpx;
  247. background: #FFFFFF;
  248. box-sizing: border-box;
  249. padding: 30rpx;
  250. @include flex();
  251. image {
  252. width: 140rpx;
  253. height: 140rpx;
  254. border-radius: 6rpx;
  255. }
  256. .info {
  257. flex: 1;
  258. height: 100%;
  259. font-size: 28rpx;
  260. font-weight: bold;
  261. margin-left: 30rpx;
  262. @include flex(column);
  263. align-items: flex-start;
  264. justify-content: space-between;
  265. }
  266. }
  267. }
  268. .app-item {
  269. font-size: 28rpx;
  270. font-weight: bold;
  271. &.top {
  272. font-size: 32rpx;
  273. font-weight: bold;
  274. margin-top: 20rpx;
  275. }
  276. &.t {
  277. margin-top: 20rpx;
  278. }
  279. &.pay {
  280. justify-content: flex-end;
  281. .paynow {
  282. width: 156rpx;
  283. height: 54rpx;
  284. @include flex();
  285. color: #FFFFFF;
  286. margin-left: 28rpx;
  287. font-weight: normal;
  288. border-radius: 54rpx;
  289. background: $app-base-color;
  290. }
  291. }
  292. }
  293. .submit {
  294. @include flex();
  295. position: fixed;
  296. height: 100rpx;
  297. bottom: 0;
  298. font-size: 36rpx;
  299. width: 100vw;
  300. background: #FFFFFF;
  301. color: #FFFFFF;
  302. border-top: 1rpx solid #999999;
  303. .left {
  304. width: 190rpx;
  305. height: 100%;
  306. color: #666666;
  307. @include flex();
  308. }
  309. .center {
  310. flex: 1;
  311. @include flex();
  312. height: 100%;
  313. background: #F7BC54;
  314. }
  315. .right {
  316. height: 100%;
  317. flex: 1;
  318. @include flex();
  319. background: #F76454;
  320. }
  321. }
  322. }
  323. </style>