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

372 lines
11 KiB

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