时空网前端
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.

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