detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view class="RuKuContainer">
  3. <view class="RuKuContainer_top">
  4. <view class="bianhao">
  5. 订单编号:
  6. <text style="color:#3394F8;">{{ order_num }}</text>
  7. </view>
  8. <view v-if="item.track_status != 2" class="mingxi" @click="unShipped">
  9. 未发明细
  10. </view>
  11. </view>
  12. <view v-for="(btem,i) in get_express" :key="i" class="hideItem">
  13. <view class="box_fix" v-if="btem.is_gift === 1"></view>
  14. <view class="hideNum">
  15. <view class="num">第{{ i+1 }}箱</view>
  16. <view class="orderNum">单号:{{ btem.express_number }}</view>
  17. </view>
  18. <view class="control" v-if="btem.is_gift === 0">
  19. <view class="textBtn" @click="toInfo(btem)">
  20. 货物详情
  21. </view>
  22. <view class="textBtn" @click="logisticsQuery(btem)">
  23. 物流查询
  24. </view>
  25. <view class="btn" :class="!(item.is_per && !btem.put_status) ? 'disable' : ''"
  26. @click="toRuKu(item, btem)">
  27. 入库
  28. </view>
  29. </view>
  30. <view class="control" v-if="btem.is_gift === 1">
  31. <view class="searche" @click="giftsList(btem)">礼品详情</view>
  32. <view class="searcht" @click="logisticsQuery(btem)">物流查询</view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. goodsInfo
  40. } from "@/apis/stock.js"
  41. export default {
  42. data() {
  43. return {
  44. list: [],
  45. get_express: [],
  46. item: {},
  47. order_id: '',
  48. initOpenId: '',
  49. order_num: '',
  50. index: ''
  51. }
  52. },
  53. onLoad(options) {
  54. this.index = options.num
  55. this.order_num = options.order_num
  56. this.item = JSON.parse(decodeURIComponent(options.item))
  57. this.get_express = this.item.get_express
  58. console.log('单个', this.get_express)
  59. },
  60. methods: {
  61. unShipped() {
  62. uni.navigateTo({
  63. url: '../unshipped-detail/index?order_id=' + this.item.order_id
  64. })
  65. },
  66. giftsList(btem) {
  67. if (btem.remark === null) {
  68. btem.remark = ''
  69. }
  70. var obj = eval(btem.notes); //由JSON字符串转换为JSON对象
  71. uni.navigateTo({
  72. url: `../gifts_list/gifts_list?remark=${btem.remark}&item=${encodeURIComponent(JSON.stringify(obj))}`,
  73. });
  74. },
  75. // 获取详情
  76. getOrderInfo() {
  77. uni.showLoading()
  78. const _this = this
  79. goodsInfo({
  80. id: _this.data.order_id
  81. }).then(res => {
  82. uni.hideLoading()
  83. if (res.code === 200) {
  84. let openId = uni.getStorageSync('rukuOpenId')
  85. _this.list = res.data.list.map((item, idx) => {
  86. item.toggle = openId && Number(openId) === Number(item.id)
  87. idx == 0 ? this.$set(item, 'toggle', true) : this.$set(item, 'toggle', false);
  88. return item
  89. })
  90. } else {
  91. uni.showModal({
  92. content: res.message || "获取货物详情失败",
  93. showCancel: false
  94. })
  95. }
  96. }).catch(() => {
  97. uni.hideLoading()
  98. uni.showModal({
  99. content: "获取货物详情失败",
  100. showCancel: false
  101. })
  102. })
  103. },
  104. // 详情
  105. toInfo(data) {
  106. if (data.remark === null) {
  107. data.remark = ''
  108. }
  109. this.toUrlLink('stock/ing_ruku?status=0&order_id=' + data.id + '&remark=' + data.remark)
  110. },
  111. // 物流查询
  112. logisticsQuery(item) {
  113. uni.navigateTo({
  114. url: '../logistics-details/logistics-details?id=' + item.id + '&express_com=' + item
  115. .express_com + '&express_number=' + item.express_number
  116. });
  117. },
  118. // 入库
  119. toRuKu(item, btem) {
  120. if (!(item.is_per && !btem.put_status)) return false
  121. const _this = this
  122. uni.setStorage({
  123. key: 'rukuOpenId',
  124. data: item.id,
  125. success() {
  126. _this.toUrlLink('stock/ing_ruku?status=1&order_id=' + btem.id)
  127. }
  128. })
  129. },
  130. toUrlLink(url) {
  131. if (!url) return false
  132. uni.navigateTo({
  133. url: `../${url}`
  134. })
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. page {
  141. display: flex;
  142. flex-direction: column;
  143. }
  144. .RuKuContainer {
  145. width: 100%;
  146. flex: 1;
  147. background-color: #F9F9FB;
  148. padding: 30rpx;
  149. &_top {
  150. display: flex;
  151. justify-content: space-between;
  152. align-items: center;
  153. margin-bottom: 30rpx;
  154. .bianhao {
  155. font-size: 30rpx;
  156. font-weight: bold;
  157. }
  158. .mingxi {
  159. width: 140rpx;
  160. height: 56rpx;
  161. font-size: 28rpx;
  162. text-align: center;
  163. line-height: 56rpx;
  164. background: #FB231F;
  165. border-radius: 8rpx;
  166. color: #fff;
  167. }
  168. }
  169. .btn {
  170. width: 128rpx;
  171. height: 60rpx;
  172. border-radius: 8rpx;
  173. background-color: #EA4A41;
  174. color: #FFFFFF;
  175. font-size: 28rpx;
  176. line-height: 60rpx;
  177. text-align: center;
  178. }
  179. .hideItem {
  180. margin: 0 auto 30rpx auto;
  181. padding: 30rpx;
  182. box-sizing: border-box;
  183. background-color: #fff;
  184. border-radius: 24rpx;
  185. position: relative;
  186. &:nth-last-of-type(1) {
  187. margin-bottom: 0;
  188. }
  189. .box_fix {
  190. width: 6rpx;
  191. height: 84rpx;
  192. background: #FB231F;
  193. position: absolute;
  194. top: 56rpx;
  195. left: 0;
  196. }
  197. .hideNum {
  198. display: flex;
  199. align-items: center;
  200. justify-content: space-between;
  201. padding-bottom: 20rpx;
  202. border-bottom: 1px solid #EEEEEE;
  203. margin-bottom: 26rpx;
  204. color: #333333;
  205. font-size: 32rpx;
  206. line-height: 44rpx;
  207. .num {
  208. width: 120rpx;
  209. text-align: left;
  210. }
  211. .orderNum {
  212. flex: 1;
  213. min-width: 0;
  214. }
  215. }
  216. .control {
  217. width: 100%;
  218. display: flex;
  219. align-items: center;
  220. justify-content: space-between;
  221. .textBtn,
  222. .btn {
  223. width: calc((100% - 120rpx) / 3);
  224. }
  225. .searcht {
  226. color: $base-color;
  227. width: 100%;
  228. text-align: center;
  229. font-size: 28rpx;
  230. }
  231. .searche {
  232. color: $base-color;
  233. width: 100%;
  234. text-align: center;
  235. font-size: 28rpx;
  236. border-right: 2rpx solid #eee;
  237. }
  238. .textBtn {
  239. color: #FB231F;
  240. font-size: 32rpx;
  241. line-height: 44rpx;
  242. text-align: left;
  243. position: relative;
  244. margin-right: 60rpx;
  245. &::after {
  246. content: "";
  247. display: block;
  248. width: 1px;
  249. height: 26rpx;
  250. background-color: #EEEEEE;
  251. position: absolute;
  252. top: 50%;
  253. right: 0;
  254. transform: translateY(-50%);
  255. }
  256. }
  257. .btn {
  258. &.disable {
  259. background-color: #F9F9FB !important;
  260. color: #999999 !important;
  261. border: 1px solid #EEEEEE;
  262. box-sizing: border-box;
  263. }
  264. }
  265. }
  266. }
  267. }
  268. </style>