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

354 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
  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" 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">{{item}}</text>
  51. <view v-if="">
  52. <view class="grid col-3 grid-square flex-sub lf-m-t-30" v-if="item.type == 'image'">
  53. <view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(index)" :data-url="img_list[index]">
  54. <image :src="img_list[index]" mode="aspectFill"></image>
  55. <view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index">
  56. <!-- <text class='cuIcon-close'></text> -->
  57. <text class="lf-iconfont lf-icon-cuowu lf-font-40 lf-color-price"></text>
  58. </view>
  59. </view>
  60. <view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="solids" @tap="ChooseImage(item.field)" v-if="img_list.length<3">
  61. <text class='cuIcon-cameraadd'></text>
  62. </view>
  63. </view>
  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. refreshCode() {
  157. this.getOrderDetails()
  158. this.$msg('刷新成功')
  159. },
  160. payAtonce() {
  161. this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {
  162. console.log('从订单列表进入')
  163. if(res.data.jump) {
  164. wx.navigateToMiniProgram({
  165. appId: res.data.jump_appid,
  166. path: '/pages/order/confirm_atonce',
  167. envVersion: 'release',
  168. extraData: {
  169. order_id: res.data.id
  170. },
  171. success(res) {
  172. console.log('---res---')
  173. console.log(res)
  174. },
  175. fail(err) {
  176. console.log('---err---')
  177. console.log(err)
  178. }
  179. })
  180. }
  181. }).catch(err => {})
  182. },
  183. //二维码回调
  184. qrR(data) {
  185. this.base64Img = data;
  186. },
  187. getOrderDetails() {
  188. this.$http(this.API.API_ORDER_DETAILS, {
  189. id: this.order_id
  190. }).then(res => {
  191. this.orderDetails = res.data
  192. this.checkArea = res.data.verify_code
  193. this.skeletonLoading = false
  194. console.log(res.data)
  195. }).catch(err => {
  196. setTimeout(() => {
  197. this.$toBack()
  198. }, 1000)
  199. });
  200. },
  201. // 点击复制
  202. copy(text) {
  203. uni.setClipboardData({
  204. data: text
  205. });
  206. },
  207. submit() {
  208. this.$routerGo('/pages/order/order?type=all')
  209. },
  210. },
  211. created() {
  212. }
  213. }
  214. </script>
  215. <style lang="scss" scoped>
  216. .loading-more-text::before {
  217. height: 60rpx;
  218. width: 60rpx;
  219. }
  220. .qrcode-loading {
  221. width: 300rpx;
  222. height: 300rpx;
  223. background-color: rgba(25, 152, 254, 0.05);
  224. display: flex;
  225. align-items: center;
  226. text-align: center;
  227. flex-direction: column;
  228. justify-content: center;
  229. border-radius: 10rpx;
  230. }
  231. .filter-code{
  232. filter: blur(6rpx);
  233. }
  234. .btn{
  235. margin: 0;
  236. padding: 0;
  237. width: 212rpx;
  238. height: 82rpx;
  239. background-color: #1998FE;
  240. color: #FFFFFF;
  241. line-height: 80rpx;
  242. font-size: 32rpx;
  243. border-radius: 41rpx;
  244. }
  245. .tag-self {
  246. position: absolute !important;
  247. top: 0 !important;
  248. border-radius: 20rpx 0 20rpx 0 !important;
  249. width: max-content;
  250. height: 32rpx !important;
  251. }
  252. .title {
  253. font-size: 28rpx;
  254. color: $u-content-color;
  255. height: 90rpx;
  256. }
  257. // tab
  258. .ctab {
  259. width: 100%;
  260. margin: 20rpx 0 0rpx 0rpx;
  261. padding: 0 22rpx;
  262. }
  263. // 商品列表
  264. .com {
  265. width: 100%;
  266. overflow: hidden;
  267. .list {
  268. border-radius: 10rpx;
  269. overflow: hidden;
  270. margin: 20rpx 32rpx;
  271. background-color: #FFFFFF;
  272. // box-shadow: 0 0 10px 5px #e5e5e5;
  273. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  274. align-items: flex-start;
  275. .left {
  276. overflow: hidden;
  277. image {
  278. width: 186rpx;
  279. height: 186rpx;
  280. margin: 20rpx;
  281. border-radius: 10rpx;
  282. }
  283. }
  284. .right {
  285. overflow: hidden;
  286. width: 64%;
  287. .title {
  288. margin: 0rpx 20rpx 10rpx 0;
  289. color: #222222;
  290. font-size: 32rpx;
  291. }
  292. .tips {
  293. margin: 16rpx 0;
  294. overflow: hidden;
  295. .u-line-progress {
  296. width: 112rpx;
  297. overflow: hidden;
  298. margin-right: 20rpx;
  299. }
  300. .progress {
  301. color: #777777;
  302. font-size: 24rpx;
  303. }
  304. .bought {
  305. color: #777777;
  306. font-size: 24rpx;
  307. margin-right: 20rpx;
  308. }
  309. }
  310. .price {
  311. overflow: hidden;
  312. color: #FF0000;
  313. margin-top: 10rpx;
  314. button {
  315. width: 176rpx;
  316. height: 60rpx;
  317. background: #FE9903;
  318. border-radius: 15px;
  319. font-size: 24rpx;
  320. color: #FFFFFF;
  321. margin: 0rpx 20rpx 0rpx 20rpx;
  322. border: none;
  323. }
  324. }
  325. }
  326. }
  327. }
  328. </style>