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

345 lines
9.7 KiB

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