时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
7.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view>
  3. <!-- 商品信息 -->
  4. <block v-if="isRight(orderDetails)">
  5. <view class="bg-white">
  6. <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
  7. <view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
  8. <image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
  9. <view class="flex-sub padding-left-sm">
  10. <view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
  11. {{orderDetails.goods.name}}
  12. </view>
  13. <text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
  14. <view class="flex justify-between" style="margin-top: 28rpx;">
  15. <view class="text-red text-price lf-font-42 lf-font-bold" style="margin-top: 16rpx;">
  16. {{Number(orderDetails.selling_price || 0)}}
  17. </view>
  18. <view>
  19. <button v-if="orderDetails.state == 2" class="cu-btn line-orange text-orange round margin-left-sm lf-font-28" @tap="$routerGo('/pages/order/apply-refund?order_id='+orderDetails.id)">申请退款</button>
  20. <button v-else class="cu-btn line-gray bg-white border round margin-left-sm lf-font-28">{{orderDetails.state_text.text}}</button>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </skeleton>
  26. </view>
  27. <self-line/>
  28. <!-- 表单 -->
  29. <skeleton :loading="skeletonLoading" :row="16" :showAvatar="false" :showTitle="true">
  30. <view class="bg-white">
  31. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  32. <text class="text-gray lf-font-32">订单编号</text>
  33. <view>
  34. <text class="margin-right lf-font-32 text-black1">{{orderDetails.order_sn}}</text>
  35. <text class="text-orange lf-font-32" @click="copy(orderDetails.order_sn)">复制</text>
  36. </view>
  37. </view>
  38. <view class="cu-bar padding-lr solid-bottom">
  39. <text class="text-gray lf-font-32">下单时间</text>
  40. <text class="lf-font-32 text-black1">{{orderDetails.created_at_text}}</text>
  41. </view>
  42. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_at_text != ''">
  43. <text class="text-gray lf-font-32">付款时间</text>
  44. <text class="lf-font-32 text-black1">{{orderDetails.payment_at_text}}</text>
  45. </view>
  46. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_type != ''">
  47. <text class="text-gray lf-font-32">支付方式</text>
  48. <text class="lf-font-32 text-black1">{{orderDetails.payment_type}}</text>
  49. </view>
  50. </view>
  51. <self-line/>
  52. <view class="bg-white">
  53. <view class="cu-bar padding-lr solid-bottom">
  54. <text class="text-gray lf-font-32">优惠</text>
  55. <text class="lf-font-32 text-black1" v-if="orderDetails.coupons == null">暂无优惠</text>
  56. </view>
  57. </view>
  58. <view>
  59. <self-line/>
  60. <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb">
  61. <view>
  62. <tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="115" unit="px" background="#fff" foreground="#000"
  63. pdground="#000" :onval="true" :loadMake="true" />
  64. <!-- :icon="require('@/static/images/system/user-default.jpg')" -->
  65. </view>
  66. <view class="flex justify-around align-center text-center" style="margin-top: 10rpx;">
  67. <view @tap="refreshCode()" v-if="orderDetails.state==2">
  68. <image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
  69. </view>
  70. <view class="lf-font-32 text-black1">{{checkArea}}</view>
  71. <view v-if="orderDetails.state == 2" class="text-orange lf-font-28 margin-left" @tap="copy(checkArea)">复制</view>
  72. </view>
  73. <view style="margin-top: 10rpx;" class="text-gray lf-font-28" v-if="orderDetails.refund_text">
  74. {{orderDetails.refund_text}}
  75. </view>
  76. <view style="margin-top: 10rpx;" class="text-green lf-font-32" v-if="orderDetails.state == 2">
  77. {{orderDetails.confirm_code_text}}
  78. </view>
  79. </view>
  80. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top btn-bottom">
  81. <view class="flex align-center">
  82. <text class="text-gray lf-font-28" style="margin-right: 20rpx;">实付款</text>
  83. <view class="text-red text-price lf-font-42 lf-font-bold">
  84. {{Number(orderDetails.amount || 0)}}
  85. </view>
  86. </view>
  87. <view class="lf-font-32 text-black1">
  88. {{orderDetails.state_text.text}}
  89. </view>
  90. </view>
  91. </view>
  92. </skeleton>
  93. </block>
  94. </view>
  95. </template>
  96. <script>
  97. import tkiQrcode from "tki-qrcode" // 二维码生成器
  98. export default {
  99. components: {
  100. tkiQrcode
  101. },
  102. data() {
  103. return {
  104. base64Img: '', //
  105. skeletonLoading: true,
  106. loading: false,
  107. order_id:1,
  108. orderDetails: {},
  109. checkArea: '0'
  110. }
  111. },
  112. computed: {
  113. total(){
  114. return this.num * this.price
  115. },
  116. isRight(){
  117. return function(val){
  118. return this.$shared.isRight(val);
  119. }
  120. }
  121. },
  122. onLoad(e) {
  123. this.order_id = e.order_id
  124. if(this.order_id) {
  125. this.getOrderDetails()
  126. }
  127. },
  128. methods: {
  129. refreshCode() {
  130. this.getOrderDetails()
  131. },
  132. //二维码回调
  133. qrR(data) {
  134. this.base64Img = data;
  135. },
  136. getOrderDetails() {
  137. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => {
  138. if(res.code == 0) {
  139. this.orderDetails = res.data
  140. this.checkArea = res.data.confirm_code
  141. this.skeletonLoading = false
  142. }
  143. }).catch(err => {
  144. });
  145. },
  146. // 点击复制
  147. copy(text) {
  148. uni.setClipboardData({
  149. data: text
  150. });
  151. },
  152. submit(){
  153. this.$routerGo('/pages/order/order?type=all')
  154. },
  155. },
  156. created() {
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .tag-self {
  162. position: absolute!important;
  163. top: 0!important;
  164. border-radius: 20rpx 0 20rpx 0!important;
  165. width: max-content;
  166. height: 32rpx!important;
  167. }
  168. .title {
  169. font-size: 28rpx;
  170. color: $u-content-color;
  171. height: 80rpx;
  172. }
  173. // tab
  174. .ctab {
  175. width: 100%;
  176. margin: 20rpx 0 0rpx 0rpx;
  177. padding: 0 22rpx;
  178. }
  179. // 商品列表
  180. .com {
  181. width: 100%;
  182. overflow: hidden;
  183. .list {
  184. border-radius: 10rpx;
  185. overflow: hidden;
  186. margin: 20rpx 32rpx;
  187. background-color: #FFFFFF;
  188. // box-shadow: 0 0 10px 5px #e5e5e5;
  189. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  190. align-items: flex-start;
  191. .left {
  192. overflow: hidden;
  193. image {
  194. width: 186rpx;
  195. height: 186rpx;
  196. margin: 20rpx;
  197. border-radius: 10rpx;
  198. }
  199. }
  200. .right {
  201. overflow: hidden;
  202. width: 64%;
  203. .title {
  204. margin: 0rpx 20rpx 10rpx 0;
  205. color: #222222;
  206. font-size: 32rpx;
  207. }
  208. .tips {
  209. margin: 16rpx 0;
  210. overflow: hidden;
  211. .u-line-progress {
  212. width: 112rpx;
  213. overflow: hidden;
  214. margin-right: 20rpx;
  215. }
  216. .progress {
  217. color: #777777;
  218. font-size: 24rpx;
  219. }
  220. .bought {
  221. color: #777777;
  222. font-size: 24rpx;
  223. margin-right: 20rpx;
  224. }
  225. }
  226. .price {
  227. overflow: hidden;
  228. color: #FF0000;
  229. margin-top: 10rpx;
  230. button {
  231. width: 176rpx;
  232. height: 60rpx;
  233. background: #FE9903;
  234. border-radius: 15px;
  235. font-size: 24rpx;
  236. color: #FFFFFF;
  237. margin: 0rpx 20rpx 0rpx 20rpx;
  238. border: none;
  239. }
  240. }
  241. }
  242. }
  243. }
  244. </style>