海南旅游项目 前端仓库
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.

310 lines
8.2 KiB

  1. <template>
  2. <view>
  3. <!-- 商品信息 -->
  4. <block v-if="isRight(orderDetails)">
  5. <view class="bg-white">
  6. <view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
  7. <image :src="orderDetails.picture" mode="aspectFill"
  8. style="width: 240rpx; height: 240rpx;border-radius: 20rpx;"></image>
  9. <view class="flex-sub padding-left-sm">
  10. <view class="bref-box lf-line-2 text-black1 lf-font-28 lf-font-bold"
  11. style="height: 88rpx;line-height: 44rpx;">
  12. {{orderDetails.title}}
  13. </view>
  14. <text class="block lf-color-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量
  15. <text class="margin-left margin-right-xs lf-color-gray">x</text>{{orderDetails.num}}</text>
  16. <view class="flex justify-between" style="margin-top: 28rpx;">
  17. <lf-price :price="orderDetails.price" style="margin-top: 8rpx;" />
  18. <view>
  19. <button v-if="orderDetails.status == 2 || orderDetails.status == 3" class="cu-btn1 lf-color-gray lf-border-gray" @tap="$url('/pages/order/apply_refund?order_id='+orderDetails.id)">申请退款</button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <self-line />
  26. <!-- 表单 -->
  27. <view class="bg-white">
  28. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  29. <text class="lf-color-555 lf-font-28">订单编号</text>
  30. <view>
  31. <text class="margin-right lf-font-28 text-black1">{{orderDetails.order_no}}</text>
  32. <text class="text-orange lf-font-28" @click="copy(orderDetails.order_no)">复制</text>
  33. </view>
  34. </view>
  35. <view class="cu-bar padding-lr solid-bottom">
  36. <text class="lf-color-555 lf-font-28">下单时间</text>
  37. <text class="lf-font-28 text-black1">{{ orderDetails.created_at }}</text>
  38. </view>
  39. <view class="cu-bar padding-lr solid-bottom">
  40. <text class="lf-color-555 lf-font-28">付款时间</text>
  41. <text class="lf-font-28 text-black1" v-if="orderDetails.paid_at == 0">暂未付款</text>
  42. <text class="lf-font-28 text-black1" v-else>{{ orderDetails.paid_at }}</text>
  43. </view>
  44. <view class="cu-bar padding-lr">
  45. <text class="lf-color-555 lf-font-28">支付方式</text>
  46. <text class="lf-font-28 text-black1">微信支付</text>
  47. </view>
  48. </view>
  49. <self-line />
  50. <view class="bg-white">
  51. <view class="cu-bar padding-lr">
  52. <text class="lf-color-555 lf-font-28">优惠</text>
  53. <view v-if="orderDetails.coupon != ''">
  54. <text class="lf-color-price lf-font-28 lf-m-l-10" v-for="(item,index) of orderDetails.coupon">{{item.tag}}</text>
  55. </view>
  56. <view v-else>
  57. <text class="lf-color-price lf-font-28 lf-m-l-10">暂无优惠</text>
  58. </view>
  59. </view>
  60. </view>
  61. <view>
  62. <self-line />
  63. <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb"
  64. style="padding-bottom: 140rpx;">
  65. <view>
  66. <tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="115" unit="px" background="#fff"
  67. foreground="#000" pdground="#000" :onval="true" :loadMake="true" />
  68. </view>
  69. <view style="margin-top: 10rpx;position: relative;top: 26rpx;">
  70. <view class="lf-font-28 text-black1">
  71. {{checkArea}}
  72. <text v-if="false" style="position: relative;left: 172rpx;top: -36rpx;display: inherit;" class="lf-color-blue lf-font-28" @tap="copy(checkArea)">复制</text></view>
  73. </view>
  74. <view class="lf-m-t-32" v-if="false">
  75. <view class="lf-color-green lf-font-28 lf-flex">
  76. <text>待使用</text>
  77. <!-- <text class="lf-iconfont lf-icon-shuaxin1 lf-font-40"
  78. style="color: #999;position: relative;left: 84rpx;top: -42rpx;display: inherit;"
  79. @tap="refreshCode()"></text> -->
  80. <image src="../../static/center/refresh.png"
  81. style="color: #999;position: relative;left: 28rpx;top: 0rpx;display: inherit; width: 30rpx;height: 30rpx;"
  82. @tap="refreshCode()">
  83. </image>
  84. </view>
  85. </view>
  86. <view style="margin-top: 44rpx;" v-else>
  87. <view class="lf-color-999 lf-font-28">
  88. {{orderDetails.status_text}}
  89. </view>
  90. </view>
  91. </view>
  92. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  93. <view class="flex align-center">
  94. <text class="lf-color-555 lf-font-28" style="margin-right: 20rpx;">实付款</text>
  95. <lf-price :price="orderDetails.price" />
  96. </view>
  97. <button class="btn bg-green" v-if="orderDetails.status == 2 || orderDetails.status == 3">
  98. <text class="lf-font-32 text-white">立即使用</text>
  99. </button>
  100. <button class="btn bg-blue" v-if="orderDetails.status == 16">
  101. <text class="lf-font-32 text-white">已使用</text>
  102. </button>
  103. <button class="btn lf-bg-gray" v-if="orderDetails.status == 6">
  104. <text class="lf-font-32 text-white">等待审核</text>
  105. </button>
  106. <button class="btn lf-bg-gray" v-if="orderDetails.status == 7">
  107. <text class="lf-font-32 text-white">退款成功</text>
  108. </button>
  109. <button class="btn lf-bg-gray" v-if="orderDetails.status == -1">
  110. <text class="lf-font-32 text-white">已取消</text>
  111. </button>
  112. </view>
  113. </view>
  114. </block>
  115. </view>
  116. </template>
  117. <script>
  118. import tkiQrcode from "tki-qrcode" // 二维码生成器
  119. export default {
  120. components: {
  121. tkiQrcode
  122. },
  123. data() {
  124. return {
  125. base64Img: '', //
  126. skeletonLoading: true,
  127. loading: false,
  128. order_id: 1,
  129. orderDetails: {
  130. },
  131. checkArea: 'USI782936437829'
  132. }
  133. },
  134. computed: {
  135. total(){
  136. return this.num * this.price
  137. },
  138. isRight(){
  139. return function(val){
  140. return this.$shared.isRight(val);
  141. }
  142. }
  143. },
  144. onLoad(e) {
  145. this.order_id = e.order_id
  146. if (this.order_id) {
  147. this.getOrderDetails()
  148. }
  149. },
  150. methods: {
  151. refreshCode() {
  152. this.getOrderDetails()
  153. this.$msg('刷新成功')
  154. },
  155. //二维码回调
  156. qrR(data) {
  157. this.base64Img = data;
  158. },
  159. getOrderDetails() {
  160. this.$http(this.API.API_ORDER_DETAILS, {
  161. id: this.order_id
  162. }).then(res => {
  163. this.orderDetails = res.data
  164. this.checkArea = res.data.id
  165. this.skeletonLoading = false
  166. console.log(res.data)
  167. }).catch(err => {
  168. setTimeout(() => {
  169. this.$toBack()
  170. }, 1000)
  171. });
  172. },
  173. // 点击复制
  174. copy(text) {
  175. uni.setClipboardData({
  176. data: text
  177. });
  178. },
  179. submit() {
  180. this.$routerGo('/pages/order/order?type=all')
  181. },
  182. },
  183. created() {
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .btn{
  189. margin: 0;
  190. padding: 0;
  191. width: 212rpx;
  192. height: 82rpx;
  193. background-color: #1998FE;
  194. color: #FFFFFF;
  195. line-height: 80rpx;
  196. font-size: 32rpx;
  197. border-radius: 41rpx;
  198. }
  199. .tag-self {
  200. position: absolute !important;
  201. top: 0 !important;
  202. border-radius: 20rpx 0 20rpx 0 !important;
  203. width: max-content;
  204. height: 32rpx !important;
  205. }
  206. .title {
  207. font-size: 28rpx;
  208. color: $u-content-color;
  209. height: 90rpx;
  210. }
  211. // tab
  212. .ctab {
  213. width: 100%;
  214. margin: 20rpx 0 0rpx 0rpx;
  215. padding: 0 22rpx;
  216. }
  217. // 商品列表
  218. .com {
  219. width: 100%;
  220. overflow: hidden;
  221. .list {
  222. border-radius: 10rpx;
  223. overflow: hidden;
  224. margin: 20rpx 32rpx;
  225. background-color: #FFFFFF;
  226. // box-shadow: 0 0 10px 5px #e5e5e5;
  227. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  228. align-items: flex-start;
  229. .left {
  230. overflow: hidden;
  231. image {
  232. width: 186rpx;
  233. height: 186rpx;
  234. margin: 20rpx;
  235. border-radius: 10rpx;
  236. }
  237. }
  238. .right {
  239. overflow: hidden;
  240. width: 64%;
  241. .title {
  242. margin: 0rpx 20rpx 10rpx 0;
  243. color: #222222;
  244. font-size: 32rpx;
  245. }
  246. .tips {
  247. margin: 16rpx 0;
  248. overflow: hidden;
  249. .u-line-progress {
  250. width: 112rpx;
  251. overflow: hidden;
  252. margin-right: 20rpx;
  253. }
  254. .progress {
  255. color: #777777;
  256. font-size: 24rpx;
  257. }
  258. .bought {
  259. color: #777777;
  260. font-size: 24rpx;
  261. margin-right: 20rpx;
  262. }
  263. }
  264. .price {
  265. overflow: hidden;
  266. color: #FF0000;
  267. margin-top: 10rpx;
  268. button {
  269. width: 176rpx;
  270. height: 60rpx;
  271. background: #FE9903;
  272. border-radius: 15px;
  273. font-size: 24rpx;
  274. color: #FFFFFF;
  275. margin: 0rpx 20rpx 0rpx 20rpx;
  276. border: none;
  277. }
  278. }
  279. }
  280. }
  281. }
  282. </style>