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

371 lines
11 KiB

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