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

373 lines
11 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
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;" @click="$url('/pages/goodsDetail/index?goods_id='+orderDetails.agent_product_id)"></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" v-if="orderDetails.created_at">
  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" v-if="orderDetails.paid_at">
  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">{{orderDetails.pay_type_text}}</text>
  47. </view>
  48. <view class="cu-bar padding-lr">
  49. <text class="lf-color-555 lf-font-28">联系人</text>
  50. <text class="lf-font-28 text-black1">{{orderDetails.name}}</text>
  51. </view>
  52. <view class="cu-bar padding-lr">
  53. <text class="lf-color-555 lf-font-28">电话</text>
  54. <text class="lf-font-28 text-black1">{{orderDetails.mobile}}</text>
  55. </view>
  56. <self-line />
  57. <view class="cu-bar padding-lr">
  58. <text class="lf-color-555 lf-font-28">年龄</text>
  59. <text class="lf-font-28 text-black1">{{orderDetails.info.age}}</text>
  60. </view>
  61. <view class="cu-bar padding-lr">
  62. <text class="lf-color-555 lf-font-28">性别</text>
  63. <text class="lf-font-28 text-black1">{{orderDetails.info.sex}}</text>
  64. </view>
  65. <view class="cu-bar padding-lr">
  66. <text class="lf-color-555 lf-font-28">身份证号</text>
  67. <text class="lf-font-28 text-black1">{{orderDetails.info.id_card}}</text>
  68. </view>
  69. <view class="cu-bar padding-lr" v-if="orderDetails.info.arrival_time">
  70. <text class="lf-color-555 lf-font-28">到店时间</text>
  71. <text class="lf-font-28 text-black1">{{orderDetails.info.arrival_time}}</text>
  72. </view>
  73. <view class="cu-bar padding-lr" v-else>
  74. <text class="lf-color-555 lf-font-28">使用时间</text>
  75. <text class="lf-font-28 text-black1">{{orderDetails.info.departure_time}}</text>
  76. </view>
  77. <view class="cu-bar padding-lr" v-if="orderDetails.info.check_in_time">
  78. <text class="lf-color-555 lf-font-28">入住时间</text>
  79. <text class="lf-font-28 text-black1">{{orderDetails.info.check_in_time}}</text>
  80. </view>
  81. <view class="cu-bar padding-lr" v-if="orderDetails.info.check_out_time">
  82. <text class="lf-color-555 lf-font-28">离店时间</text>
  83. <text class="lf-font-28 text-black1">{{orderDetails.info.check_out_time}}</text>
  84. </view>
  85. </view>
  86. <view>
  87. <self-line />
  88. <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb"
  89. style="padding-bottom: 140rpx;">
  90. <view>
  91. <image v-if="orderDetails.verify_qrcode" :src="orderDetails.verify_qrcode" mode="aspectFill" style="width: 300rpx;height: 300rpx;" :class="!orderDetails.verify_qrcode?'filter-code':''"></image>
  92. <!-- <view class="qrcode-loading" v-else>
  93. <text class="lf-font-40 lf-color-333" :class="!orderDetails.verify_qrcode?'loading-more-text':''"></text>
  94. <view class="lf-m-t-40 lf-color-gray">核销码生成中</view>
  95. </view> -->
  96. </view>
  97. <view class="lf-m-t-10">
  98. <view class="lf-font-28 text-black1">
  99. <text>{{checkArea}} </text>
  100. <text v-if="checkArea" class="lf-color-blue lf-font-28 lf-m-l-10" @tap="copy(checkArea)">复制</text>
  101. </view>
  102. </view>
  103. <view v-if="checkArea">
  104. <view class="lf-color-green lf-font-28 lf-flex lf-m-t-10">
  105. <text v-if="orderDetails.verify_code && orderDetails.status != 16">待使用</text>
  106. <text v-if="orderDetails.verify_code && orderDetails.status == 16">已使用</text>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  111. <view class="flex align-center">
  112. <text class="lf-color-555 lf-font-28" style="margin-right: 20rpx;">实付款</text>
  113. <lf-price :price="orderDetails.price" />
  114. </view>
  115. <button class="btn bg-green" v-if="orderDetails.status == 0" @click="payAtonce()">
  116. <text class="lf-font-32 text-white">立即付款</text>
  117. </button>
  118. <button class="btn bg-green" v-if="orderDetails.status == 1" @click="payAtonce()">
  119. <text class="lf-font-32 text-white">支付尾款</text>
  120. </button>
  121. <button class="btn lf-bg-gray" v-if="orderDetails.status == 6">
  122. <text class="lf-font-32 text-white">等待审核</text>
  123. </button>
  124. <button class="btn lf-bg-gray" v-if="orderDetails.status == 7">
  125. <text class="lf-font-32 text-white">退款成功</text>
  126. </button>
  127. <button class="btn lf-bg-gray" v-if="orderDetails.status == 8">
  128. <text class="lf-font-32 text-white">退款被拒绝</text>
  129. </button>
  130. <button class="btn lf-bg-gray" v-if="orderDetails.status == 4">
  131. <text class="lf-font-32 text-white">{{orderDetails.status_text}}</text>
  132. </button>
  133. <button class="btn lf-bg-gray" v-if="orderDetails.status == -1">
  134. <text class="lf-font-32 text-white">已取消</text>
  135. </button>
  136. </view>
  137. </view>
  138. </block>
  139. </view>
  140. </template>
  141. <script>
  142. import tkiQrcode from "tki-qrcode" // 二维码生成器
  143. export default {
  144. components: {
  145. tkiQrcode
  146. },
  147. data() {
  148. return {
  149. base64Img: '', //
  150. skeletonLoading: true,
  151. loading: false,
  152. order_id: 1,
  153. orderDetails: {
  154. },
  155. checkArea: ''
  156. }
  157. },
  158. computed: {
  159. total(){
  160. return this.num * this.price
  161. },
  162. isRight(){
  163. return function(val){
  164. return this.$shared.isRight(val);
  165. }
  166. }
  167. },
  168. onLoad(e) {
  169. this.order_id = e.order_id
  170. if (this.order_id) {
  171. this.getOrderDetails()
  172. }
  173. },
  174. methods: {
  175. refreshCode() {
  176. this.getOrderDetails()
  177. this.$msg('刷新成功')
  178. },
  179. payAtonce() {
  180. this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {
  181. console.log('从订单列表进入')
  182. if(res.data.jump) {
  183. wx.navigateToMiniProgram({
  184. appId: res.data.jump_appid,
  185. path: '/pages/order/confirm_atonce',
  186. envVersion: 'release',
  187. extraData: {
  188. order_id: res.data.id
  189. },
  190. success(res) {
  191. console.log('---res---')
  192. console.log(res)
  193. },
  194. fail(err) {
  195. console.log('---err---')
  196. console.log(err)
  197. }
  198. })
  199. }
  200. }).catch(err => {})
  201. },
  202. //二维码回调
  203. qrR(data) {
  204. this.base64Img = data;
  205. },
  206. getOrderDetails() {
  207. this.$http(this.API.API_ORDER_DETAILS, {
  208. id: this.order_id
  209. }).then(res => {
  210. this.orderDetails = res.data
  211. this.checkArea = res.data.verify_code
  212. this.skeletonLoading = false
  213. console.log(res.data)
  214. }).catch(err => {
  215. setTimeout(() => {
  216. this.$toBack()
  217. }, 1000)
  218. });
  219. },
  220. // 点击复制
  221. copy(text) {
  222. uni.setClipboardData({
  223. data: text
  224. });
  225. },
  226. submit() {
  227. this.$routerGo('/pages/order/order?type=all')
  228. },
  229. },
  230. created() {
  231. }
  232. }
  233. </script>
  234. <style lang="scss" scoped>
  235. .loading-more-text::before {
  236. height: 60rpx;
  237. width: 60rpx;
  238. }
  239. .qrcode-loading {
  240. width: 300rpx;
  241. height: 300rpx;
  242. background-color: rgba(25, 152, 254, 0.05);
  243. display: flex;
  244. align-items: center;
  245. text-align: center;
  246. flex-direction: column;
  247. justify-content: center;
  248. border-radius: 10rpx;
  249. }
  250. .filter-code{
  251. filter: blur(6rpx);
  252. }
  253. .btn{
  254. margin: 0;
  255. padding: 0;
  256. width: 212rpx;
  257. height: 82rpx;
  258. background-color: #1998FE;
  259. color: #FFFFFF;
  260. line-height: 80rpx;
  261. font-size: 32rpx;
  262. border-radius: 41rpx;
  263. }
  264. .tag-self {
  265. position: absolute !important;
  266. top: 0 !important;
  267. border-radius: 20rpx 0 20rpx 0 !important;
  268. width: max-content;
  269. height: 32rpx !important;
  270. }
  271. .title {
  272. font-size: 28rpx;
  273. color: $u-content-color;
  274. height: 90rpx;
  275. }
  276. // tab
  277. .ctab {
  278. width: 100%;
  279. margin: 20rpx 0 0rpx 0rpx;
  280. padding: 0 22rpx;
  281. }
  282. // 商品列表
  283. .com {
  284. width: 100%;
  285. overflow: hidden;
  286. .list {
  287. border-radius: 10rpx;
  288. overflow: hidden;
  289. margin: 20rpx 32rpx;
  290. background-color: #FFFFFF;
  291. // box-shadow: 0 0 10px 5px #e5e5e5;
  292. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  293. align-items: flex-start;
  294. .left {
  295. overflow: hidden;
  296. image {
  297. width: 186rpx;
  298. height: 186rpx;
  299. margin: 20rpx;
  300. border-radius: 10rpx;
  301. }
  302. }
  303. .right {
  304. overflow: hidden;
  305. width: 64%;
  306. .title {
  307. margin: 0rpx 20rpx 10rpx 0;
  308. color: #222222;
  309. font-size: 32rpx;
  310. }
  311. .tips {
  312. margin: 16rpx 0;
  313. overflow: hidden;
  314. .u-line-progress {
  315. width: 112rpx;
  316. overflow: hidden;
  317. margin-right: 20rpx;
  318. }
  319. .progress {
  320. color: #777777;
  321. font-size: 24rpx;
  322. }
  323. .bought {
  324. color: #777777;
  325. font-size: 24rpx;
  326. margin-right: 20rpx;
  327. }
  328. }
  329. .price {
  330. overflow: hidden;
  331. color: #FF0000;
  332. margin-top: 10rpx;
  333. button {
  334. width: 176rpx;
  335. height: 60rpx;
  336. background: #FE9903;
  337. border-radius: 15px;
  338. font-size: 24rpx;
  339. color: #FFFFFF;
  340. margin: 0rpx 20rpx 0rpx 20rpx;
  341. border: none;
  342. }
  343. }
  344. }
  345. }
  346. }
  347. </style>