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

314 lines
8.4 KiB

5 years ago
  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="checkArea" 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="checkArea">
  75. <view class="lf-color-green lf-font-28 lf-flex">
  76. <text v-if="orderDetails.status == 3">待使用</text>
  77. <text v-else>{{orderDetails.status_text}}</text>
  78. <!-- <text class="lf-iconfont lf-icon-shuaxin1 lf-font-40"
  79. style="color: #999;position: relative;left: 84rpx;top: -42rpx;display: inherit;"
  80. @tap="refreshCode()"></text> -->
  81. <image src="../../static/center/refresh.png"
  82. style="color: #999;position: relative;left: 28rpx;top: 0rpx;display: inherit; width: 30rpx;height: 30rpx;"
  83. @tap="refreshCode()">
  84. </image>
  85. </view>
  86. </view>
  87. <!-- <view style="margin-top: 44rpx;" v-else>
  88. <view class="lf-color-999 lf-font-28">
  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. <button class="btn lf-bg-gray" v-else>
  113. <text class="lf-font-32 text-white">{{orderDetails.status_text}}</text>
  114. </button>
  115. </view>
  116. </view>
  117. </block>
  118. </view>
  119. </template>
  120. <script>
  121. import tkiQrcode from "tki-qrcode" // 二维码生成器
  122. export default {
  123. components: {
  124. tkiQrcode
  125. },
  126. data() {
  127. return {
  128. base64Img: '', //
  129. skeletonLoading: true,
  130. loading: false,
  131. order_id: 1,
  132. orderDetails: {
  133. },
  134. checkArea: ''
  135. }
  136. },
  137. computed: {
  138. total(){
  139. return this.num * this.price
  140. },
  141. isRight(){
  142. return function(val){
  143. return this.$shared.isRight(val);
  144. }
  145. }
  146. },
  147. onLoad(e) {
  148. this.order_id = e.order_id
  149. if (this.order_id) {
  150. this.getOrderDetails()
  151. }
  152. },
  153. methods: {
  154. refreshCode() {
  155. this.getOrderDetails()
  156. this.$msg('刷新成功')
  157. },
  158. //二维码回调
  159. qrR(data) {
  160. this.base64Img = data;
  161. },
  162. getOrderDetails() {
  163. this.$http(this.API.API_ORDER_DETAILS, {
  164. id: this.order_id
  165. }).then(res => {
  166. this.orderDetails = res.data
  167. this.checkArea = res.data.verify_code
  168. this.skeletonLoading = false
  169. console.log(res.data)
  170. }).catch(err => {
  171. setTimeout(() => {
  172. this.$toBack()
  173. }, 1000)
  174. });
  175. },
  176. // 点击复制
  177. copy(text) {
  178. uni.setClipboardData({
  179. data: text
  180. });
  181. },
  182. submit() {
  183. this.$routerGo('/pages/order/order?type=all')
  184. },
  185. },
  186. created() {
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. .btn{
  192. margin: 0;
  193. padding: 0;
  194. width: 212rpx;
  195. height: 82rpx;
  196. background-color: #1998FE;
  197. color: #FFFFFF;
  198. line-height: 80rpx;
  199. font-size: 32rpx;
  200. border-radius: 41rpx;
  201. }
  202. .tag-self {
  203. position: absolute !important;
  204. top: 0 !important;
  205. border-radius: 20rpx 0 20rpx 0 !important;
  206. width: max-content;
  207. height: 32rpx !important;
  208. }
  209. .title {
  210. font-size: 28rpx;
  211. color: $u-content-color;
  212. height: 90rpx;
  213. }
  214. // tab
  215. .ctab {
  216. width: 100%;
  217. margin: 20rpx 0 0rpx 0rpx;
  218. padding: 0 22rpx;
  219. }
  220. // 商品列表
  221. .com {
  222. width: 100%;
  223. overflow: hidden;
  224. .list {
  225. border-radius: 10rpx;
  226. overflow: hidden;
  227. margin: 20rpx 32rpx;
  228. background-color: #FFFFFF;
  229. // box-shadow: 0 0 10px 5px #e5e5e5;
  230. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  231. align-items: flex-start;
  232. .left {
  233. overflow: hidden;
  234. image {
  235. width: 186rpx;
  236. height: 186rpx;
  237. margin: 20rpx;
  238. border-radius: 10rpx;
  239. }
  240. }
  241. .right {
  242. overflow: hidden;
  243. width: 64%;
  244. .title {
  245. margin: 0rpx 20rpx 10rpx 0;
  246. color: #222222;
  247. font-size: 32rpx;
  248. }
  249. .tips {
  250. margin: 16rpx 0;
  251. overflow: hidden;
  252. .u-line-progress {
  253. width: 112rpx;
  254. overflow: hidden;
  255. margin-right: 20rpx;
  256. }
  257. .progress {
  258. color: #777777;
  259. font-size: 24rpx;
  260. }
  261. .bought {
  262. color: #777777;
  263. font-size: 24rpx;
  264. margin-right: 20rpx;
  265. }
  266. }
  267. .price {
  268. overflow: hidden;
  269. color: #FF0000;
  270. margin-top: 10rpx;
  271. button {
  272. width: 176rpx;
  273. height: 60rpx;
  274. background: #FE9903;
  275. border-radius: 15px;
  276. font-size: 24rpx;
  277. color: #FFFFFF;
  278. margin: 0rpx 20rpx 0rpx 20rpx;
  279. border: none;
  280. }
  281. }
  282. }
  283. }
  284. }
  285. </style>