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

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