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

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