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

346 lines
9.7 KiB

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. <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" 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">微信支付</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. <image v-if="orderDetails.verify_qrcode" :src="orderDetails.verify_qrcode" mode="aspectFill" style="width: 300rpx;height: 300rpx;"></image>
  69. </view>
  70. <view class="lf-m-t-10">
  71. <view class="lf-font-28 text-black1">
  72. <text>{{checkArea}} </text>
  73. <text v-if="checkArea" class="lf-color-blue lf-font-28 lf-m-l-10" @tap="copy(checkArea)">复制</text>
  74. </view>
  75. </view>
  76. <view v-if="checkArea">
  77. <view class="lf-color-green lf-font-28 lf-flex lf-m-t-10">
  78. <text v-if="orderDetails.verify_code && orderDetails.status != 16">待使用</text>
  79. <text v-if="orderDetails.verify_code && orderDetails.status == 16">已使用</text>
  80. <!-- <text class="lf-iconfont lf-icon-shuaxin1 lf-font-40"
  81. style="color: #999;position: relative;left: 84rpx;top: -42rpx;display: inherit;"
  82. @tap="refreshCode()"></text> -->
  83. <!-- <image src="../../static/center/refresh.png"
  84. style="color: #999;position: relative;left: 28rpx;top: 0rpx;display: inherit; width: 30rpx;height: 30rpx;"
  85. @tap="refreshCode()">
  86. </image> -->
  87. </view>
  88. </view>
  89. <!-- <view style="margin-top: 44rpx;" v-else>
  90. <view class="lf-color-999 lf-font-28">
  91. </view>
  92. </view> -->
  93. </view>
  94. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  95. <view class="flex align-center">
  96. <text class="lf-color-555 lf-font-28" style="margin-right: 20rpx;">实付款</text>
  97. <lf-price :price="orderDetails.price" />
  98. </view>
  99. <!-- <button class="btn bg-green" v-if="orderDetails.status == 2 || orderDetails.status == 3">
  100. <text class="lf-font-32 text-white">立即使用</text>
  101. </button> -->
  102. <button class="btn bg-green" v-if="orderDetails.status == 0" @click="payAtonce()">
  103. <text class="lf-font-32 text-white">立即付款</text>
  104. </button>
  105. <!-- <button class="btn bg-blue" v-if="orderDetails.status == 16">
  106. <text class="lf-font-32 text-white">已使用</text>
  107. </button> -->
  108. <button class="btn lf-bg-gray" v-if="orderDetails.status == 6">
  109. <text class="lf-font-32 text-white">等待审核</text>
  110. </button>
  111. <button class="btn lf-bg-gray" v-if="orderDetails.status == 7">
  112. <text class="lf-font-32 text-white">退款成功</text>
  113. </button>
  114. <button class="btn lf-bg-gray" v-if="orderDetails.status == 8">
  115. <text class="lf-font-32 text-white">退款被拒绝</text>
  116. </button>
  117. <button class="btn lf-bg-gray" v-if="orderDetails.status == 4">
  118. <text class="lf-font-32 text-white">{{orderDetails.status_text}}</text>
  119. </button>
  120. <button class="btn lf-bg-gray" v-if="orderDetails.status == -1">
  121. <text class="lf-font-32 text-white">已取消</text>
  122. </button>
  123. <!-- <button class="btn lf-bg-gray" v-else>
  124. <text class="lf-font-32 text-white">{{orderDetails.status_text}}</text>
  125. </button> -->
  126. </view>
  127. </view>
  128. </block>
  129. </view>
  130. </template>
  131. <script>
  132. import tkiQrcode from "tki-qrcode" // 二维码生成器
  133. export default {
  134. components: {
  135. tkiQrcode
  136. },
  137. data() {
  138. return {
  139. base64Img: '', //
  140. skeletonLoading: true,
  141. loading: false,
  142. order_id: 1,
  143. orderDetails: {
  144. },
  145. checkArea: ''
  146. }
  147. },
  148. computed: {
  149. total(){
  150. return this.num * this.price
  151. },
  152. isRight(){
  153. return function(val){
  154. return this.$shared.isRight(val);
  155. }
  156. }
  157. },
  158. onLoad(e) {
  159. this.order_id = e.order_id
  160. if (this.order_id) {
  161. this.getOrderDetails()
  162. }
  163. },
  164. methods: {
  165. refreshCode() {
  166. this.getOrderDetails()
  167. this.$msg('刷新成功')
  168. },
  169. payAtonce() {
  170. this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {
  171. uni.requestPayment({
  172. orderInfo: res.data.order_num,
  173. timeStamp: res.data.timeStamp,
  174. nonceStr: res.data.nonceStr,
  175. package: res.data.package,
  176. signType: res.data.signType,
  177. paySign: res.data.paySign,
  178. success: (res) => {
  179. this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'})
  180. },
  181. fail: (err) => {
  182. this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'})
  183. },
  184. })
  185. }).catch(err => {})
  186. },
  187. //二维码回调
  188. qrR(data) {
  189. this.base64Img = data;
  190. },
  191. getOrderDetails() {
  192. this.$http(this.API.API_ORDER_DETAILS, {
  193. id: this.order_id
  194. }).then(res => {
  195. this.orderDetails = res.data
  196. this.checkArea = res.data.verify_code
  197. this.skeletonLoading = false
  198. console.log(res.data)
  199. }).catch(err => {
  200. setTimeout(() => {
  201. this.$toBack()
  202. }, 1000)
  203. });
  204. },
  205. // 点击复制
  206. copy(text) {
  207. uni.setClipboardData({
  208. data: text
  209. });
  210. },
  211. submit() {
  212. this.$routerGo('/pages/order/order?type=all')
  213. },
  214. },
  215. created() {
  216. }
  217. }
  218. </script>
  219. <style lang="scss" scoped>
  220. .btn{
  221. margin: 0;
  222. padding: 0;
  223. width: 212rpx;
  224. height: 82rpx;
  225. background-color: #1998FE;
  226. color: #FFFFFF;
  227. line-height: 80rpx;
  228. font-size: 32rpx;
  229. border-radius: 41rpx;
  230. }
  231. .tag-self {
  232. position: absolute !important;
  233. top: 0 !important;
  234. border-radius: 20rpx 0 20rpx 0 !important;
  235. width: max-content;
  236. height: 32rpx !important;
  237. }
  238. .title {
  239. font-size: 28rpx;
  240. color: $u-content-color;
  241. height: 90rpx;
  242. }
  243. // tab
  244. .ctab {
  245. width: 100%;
  246. margin: 20rpx 0 0rpx 0rpx;
  247. padding: 0 22rpx;
  248. }
  249. // 商品列表
  250. .com {
  251. width: 100%;
  252. overflow: hidden;
  253. .list {
  254. border-radius: 10rpx;
  255. overflow: hidden;
  256. margin: 20rpx 32rpx;
  257. background-color: #FFFFFF;
  258. // box-shadow: 0 0 10px 5px #e5e5e5;
  259. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  260. align-items: flex-start;
  261. .left {
  262. overflow: hidden;
  263. image {
  264. width: 186rpx;
  265. height: 186rpx;
  266. margin: 20rpx;
  267. border-radius: 10rpx;
  268. }
  269. }
  270. .right {
  271. overflow: hidden;
  272. width: 64%;
  273. .title {
  274. margin: 0rpx 20rpx 10rpx 0;
  275. color: #222222;
  276. font-size: 32rpx;
  277. }
  278. .tips {
  279. margin: 16rpx 0;
  280. overflow: hidden;
  281. .u-line-progress {
  282. width: 112rpx;
  283. overflow: hidden;
  284. margin-right: 20rpx;
  285. }
  286. .progress {
  287. color: #777777;
  288. font-size: 24rpx;
  289. }
  290. .bought {
  291. color: #777777;
  292. font-size: 24rpx;
  293. margin-right: 20rpx;
  294. }
  295. }
  296. .price {
  297. overflow: hidden;
  298. color: #FF0000;
  299. margin-top: 10rpx;
  300. button {
  301. width: 176rpx;
  302. height: 60rpx;
  303. background: #FE9903;
  304. border-radius: 15px;
  305. font-size: 24rpx;
  306. color: #FFFFFF;
  307. margin: 0rpx 20rpx 0rpx 20rpx;
  308. border: none;
  309. }
  310. }
  311. }
  312. }
  313. }
  314. </style>