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

344 lines
9.3 KiB

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