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

359 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
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. console.log('从订单列表进入')
  180. if(res.data.jump) {
  181. wx.navigateToMiniProgram({
  182. appId: res.data.jump_appid,
  183. path: '/pages/order/confirm_atonce',
  184. envVersion: 'release',
  185. extraData: {
  186. order_id: res.data.id
  187. },
  188. success(res) {
  189. console.log('---res---')
  190. console.log(res)
  191. },
  192. fail(err) {
  193. console.log('---err---')
  194. console.log(err)
  195. }
  196. })
  197. }
  198. }).catch(err => {})
  199. },
  200. //二维码回调
  201. qrR(data) {
  202. this.base64Img = data;
  203. },
  204. getOrderDetails() {
  205. this.$http(this.API.API_ORDER_DETAILS, {
  206. id: this.order_id
  207. }).then(res => {
  208. this.orderDetails = res.data
  209. this.checkArea = res.data.verify_code
  210. this.skeletonLoading = false
  211. console.log(res.data)
  212. }).catch(err => {
  213. setTimeout(() => {
  214. this.$toBack()
  215. }, 1000)
  216. });
  217. },
  218. // 点击复制
  219. copy(text) {
  220. uni.setClipboardData({
  221. data: text
  222. });
  223. },
  224. submit() {
  225. this.$routerGo('/pages/order/order?type=all')
  226. },
  227. },
  228. created() {
  229. }
  230. }
  231. </script>
  232. <style lang="scss" scoped>
  233. .btn{
  234. margin: 0;
  235. padding: 0;
  236. width: 212rpx;
  237. height: 82rpx;
  238. background-color: #1998FE;
  239. color: #FFFFFF;
  240. line-height: 80rpx;
  241. font-size: 32rpx;
  242. border-radius: 41rpx;
  243. }
  244. .tag-self {
  245. position: absolute !important;
  246. top: 0 !important;
  247. border-radius: 20rpx 0 20rpx 0 !important;
  248. width: max-content;
  249. height: 32rpx !important;
  250. }
  251. .title {
  252. font-size: 28rpx;
  253. color: $u-content-color;
  254. height: 90rpx;
  255. }
  256. // tab
  257. .ctab {
  258. width: 100%;
  259. margin: 20rpx 0 0rpx 0rpx;
  260. padding: 0 22rpx;
  261. }
  262. // 商品列表
  263. .com {
  264. width: 100%;
  265. overflow: hidden;
  266. .list {
  267. border-radius: 10rpx;
  268. overflow: hidden;
  269. margin: 20rpx 32rpx;
  270. background-color: #FFFFFF;
  271. // box-shadow: 0 0 10px 5px #e5e5e5;
  272. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  273. align-items: flex-start;
  274. .left {
  275. overflow: hidden;
  276. image {
  277. width: 186rpx;
  278. height: 186rpx;
  279. margin: 20rpx;
  280. border-radius: 10rpx;
  281. }
  282. }
  283. .right {
  284. overflow: hidden;
  285. width: 64%;
  286. .title {
  287. margin: 0rpx 20rpx 10rpx 0;
  288. color: #222222;
  289. font-size: 32rpx;
  290. }
  291. .tips {
  292. margin: 16rpx 0;
  293. overflow: hidden;
  294. .u-line-progress {
  295. width: 112rpx;
  296. overflow: hidden;
  297. margin-right: 20rpx;
  298. }
  299. .progress {
  300. color: #777777;
  301. font-size: 24rpx;
  302. }
  303. .bought {
  304. color: #777777;
  305. font-size: 24rpx;
  306. margin-right: 20rpx;
  307. }
  308. }
  309. .price {
  310. overflow: hidden;
  311. color: #FF0000;
  312. margin-top: 10rpx;
  313. button {
  314. width: 176rpx;
  315. height: 60rpx;
  316. background: #FE9903;
  317. border-radius: 15px;
  318. font-size: 24rpx;
  319. color: #FFFFFF;
  320. margin: 0rpx 20rpx 0rpx 20rpx;
  321. border: none;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. </style>