deliverGoods.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view class="page">
  3. <view class="goods-detail">
  4. <view class="order-num">
  5. <text>订单号:</text>
  6. <text>{{ orderDetail.order_no }}</text>
  7. </view>
  8. <view class="detail" v-for="item in orderDetail.goods">
  9. <image class="order-img" :src="item.goods_image" mode=""></image>
  10. <view class="detail-right">
  11. <view class="title-price">
  12. <view class="title"> {{ item.goods_name }} </view>
  13. <view class="price">
  14. <text style="font-size: 20rpx">¥</text>
  15. <text>{{ item.amount.split(".")[0] }}</text
  16. >.
  17. <text style="font-size: 20rpx">{{
  18. item.amount.split(".")[1]
  19. }}</text>
  20. </view>
  21. </view>
  22. <view class="specifications">
  23. <view class="title"> {{ item.sku_item.item }} </view>
  24. <text>x{{ item.goods_num }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="address" v-if="!isShow">
  29. <view class="name-address">
  30. {{
  31. orderDetail.address_name.split("")[0] +
  32. "**,***********," +
  33. orderDetail.full_address
  34. }}
  35. </view>
  36. <image
  37. class="eye-icon"
  38. @click="showContent"
  39. src="../../static/mine/347.png"
  40. mode=""
  41. ></image>
  42. </view>
  43. <view class="address" v-else>
  44. <view class="name-address">
  45. {{
  46. orderDetail.address_name +
  47. "," +
  48. orderDetail.address_mobile +
  49. "," +
  50. orderDetail.full_address
  51. }}
  52. </view>
  53. <u-icon name="eye" @click="showContent"></u-icon>
  54. </view>
  55. </view>
  56. <view class="express">
  57. <view class="_input-1 _input-2">
  58. <view class="_label">运单号</view>
  59. <u--input
  60. placeholder="请输入运单号或扫码获取"
  61. border="none"
  62. clearable
  63. ></u--input>
  64. <image
  65. @click="scanningNumber"
  66. class="scanning-icon"
  67. src="../../static/mine/348.png"
  68. mode=""
  69. ></image>
  70. </view>
  71. <view class="_input-1">
  72. <view class="_label">物流公司</view>
  73. <u--input
  74. placeholder="请输入物流公司"
  75. border="none"
  76. clearable
  77. ></u--input>
  78. </view>
  79. </view>
  80. <view class="footer">
  81. <button class="status-2" @click="immediateDelivery">立即发货</button>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. orderDetail: {},
  90. isShow: false,
  91. };
  92. },
  93. onLoad(options) {
  94. this.getDetail(options.id);
  95. },
  96. methods: {
  97. //扫描二维码
  98. scanningNumber() {
  99. let _this = this;
  100. //获取手机权限
  101. uni.authorize({
  102. scope: "scope.camera",
  103. success() {
  104. _this.scanQrCode();
  105. },
  106. fail() {
  107. //用户拒绝授权
  108. uni.showToast({
  109. title: "您拒绝了授权",
  110. icon: "none",
  111. });
  112. },
  113. });
  114. },
  115. immediateDelivery() {
  116. // uni;
  117. },
  118. //扫描条形码
  119. scanQrCode() {
  120. uni.scanCode({
  121. success(res) {
  122. if (res.result) {
  123. } else {
  124. uni.showToast({
  125. title: "扫描失败",
  126. icon: "none",
  127. });
  128. }
  129. },
  130. fail() {
  131. uni.showToast({
  132. title: "调用相机失败",
  133. icon: "none",
  134. });
  135. },
  136. });
  137. },
  138. //显示隐藏内容
  139. showContent() {
  140. this.isShow = !this.isShow;
  141. },
  142. //获取页面基础信息
  143. getDetail(id) {
  144. uni.$u.http.get(`/api/order/read?id=${id}`).then((res) => {
  145. this.orderDetail = res;
  146. });
  147. },
  148. },
  149. mounted() {
  150. uni.setNavigationBarTitle({
  151. title: "立即发货",
  152. });
  153. },
  154. };
  155. </script>
  156. <style lang="scss" scoped>
  157. .page {
  158. padding: 20rpx 24rpx;
  159. .goods-detail {
  160. background-color: #fff;
  161. border-radius: 16rpx;
  162. padding: 26rpx 20rpx;
  163. .order-num {
  164. font-size: 26rpx;
  165. color: #333;
  166. }
  167. .detail {
  168. margin-top: 28rpx;
  169. display: flex;
  170. padding-bottom: 20rpx;
  171. border-bottom: 2rpx solid #f4f4f4;
  172. .order-img {
  173. width: 180rpx;
  174. height: 180rpx;
  175. border-radius: 10rpx;
  176. margin-right: 20rpx;
  177. }
  178. .detail-right {
  179. width: 70%;
  180. .title-price {
  181. display: flex;
  182. font-size: 28rpx;
  183. justify-content: space-between;
  184. align-items: center;
  185. margin-bottom: 16rpx;
  186. .title {
  187. width: 330rpx;
  188. overflow: hidden;
  189. white-space: nowrap;
  190. text-overflow: ellipsis;
  191. }
  192. }
  193. .specifications {
  194. display: flex;
  195. justify-content: space-between;
  196. align-items: center;
  197. font-size: 28rpx;
  198. color: #777;
  199. margin-top: 10rpx;
  200. .title {
  201. width: 330rpx;
  202. overflow: hidden;
  203. white-space: nowrap;
  204. text-overflow: ellipsis;
  205. }
  206. }
  207. }
  208. }
  209. .address {
  210. display: flex;
  211. align-items: center;
  212. justify-content: space-between;
  213. margin-top: 20rpx;
  214. .name-address {
  215. font-size: 26rpx;
  216. color: #333;
  217. width: 72%;
  218. }
  219. .eye-icon {
  220. width: 32rpx;
  221. height: 32rpx;
  222. }
  223. }
  224. }
  225. .express {
  226. border-radius: 16rpx;
  227. background-color: #fff;
  228. padding: 0 20rpx;
  229. margin-top: 20rpx;
  230. ._input-1 {
  231. display: flex;
  232. align-items: center;
  233. height: 100rpx;
  234. ._label {
  235. font-size: 28rpx;
  236. color: #222;
  237. margin-right: 32rpx;
  238. width: 120rpx;
  239. }
  240. .scanning-icon {
  241. width: 32rpx;
  242. height: 32rpx;
  243. }
  244. }
  245. ._input-2 {
  246. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  247. }
  248. }
  249. }
  250. .footer {
  251. position: fixed;
  252. bottom: 0;
  253. left: 0;
  254. background-color: #fff;
  255. // display: flex;
  256. // justify-content: flex-end;
  257. // align-items: center;
  258. padding-top: 20rpx;
  259. padding-bottom: 80rpx;
  260. height: 66rpx;
  261. width: 100%;
  262. .status-2 {
  263. background-color: #f83224;
  264. border-radius: 34rpx;
  265. font-size: 28rpx;
  266. color: #fff;
  267. height: 68rpx;
  268. border: 2rpx solid #f83224;
  269. margin: 0 24rpx;
  270. line-height: 68rpx;
  271. padding: 0 34rpx;
  272. }
  273. }
  274. </style>