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

255 lines
5.9 KiB

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 class="cu-btn1 lf-color-gray lf-border-gray">申请退款</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">
  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">
  40. <text class="lf-color-555 lf-font-28">支付方式</text>
  41. <text class="lf-font-28 text-black1">微信支付</text>
  42. </view>
  43. </view>
  44. <!-- <self-line />
  45. <view class="bg-white">
  46. <view class="cu-bar padding-lr">
  47. <text class="lf-color-555 lf-font-28">优惠</text>
  48. <view v-if="orderDetails.coupon != ''">
  49. <text class="lf-color-price lf-font-28 lf-m-l-10" v-for="(item,index) of orderDetails.coupon">{{item.tag}}</text>
  50. </view>
  51. <view v-else>
  52. <text class="lf-color-price lf-font-28 lf-m-l-10">暂无优惠</text>
  53. </view>
  54. </view>
  55. </view> -->
  56. <view>
  57. <self-line />
  58. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  59. <view class="flex align-center">
  60. <text class="lf-color-555 lf-font-28" style="margin-right: 20rpx;">待付款</text>
  61. <lf-price :price="orderDetails.price" />
  62. </view>
  63. <button class="btn bg-red" @tap="submit" v-if="orderDetails.status == 1">
  64. <text class="lf-font-32 text-white">支付尾款</text>
  65. </button>
  66. </view>
  67. </view>
  68. </block>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. base64Img: '', //
  76. skeletonLoading: true,
  77. loading: false,
  78. order_id: 1,
  79. orderDetails: {},
  80. }
  81. },
  82. onLoad(e) {
  83. this.order_id = e.order_id
  84. if (this.order_id) {
  85. this.getOrderDetails()
  86. }
  87. },
  88. computed: {
  89. isRight(){
  90. return function(val){
  91. return this.$shared.isRight(val);
  92. }
  93. }
  94. },
  95. methods: {
  96. getOrderDetails() {
  97. this.$http(this.API.API_ORDER_DETAILS, {
  98. id: this.order_id
  99. }).then(res => {
  100. this.orderDetails = res.data
  101. console.log(this.orderDetails)
  102. }).catch(err => {
  103. setTimeout(() => {
  104. this.$toBack()
  105. }, 1000)
  106. });
  107. },
  108. submit() {
  109. this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {
  110. console.log('从订单列表进入')
  111. if(res.data.jump) {
  112. wx.navigateToMiniProgram({
  113. appId: res.data.jump_appid,
  114. path: '/pages/order/confirm_atonce',
  115. envVersion: 'release',
  116. extraData: {
  117. order_id: res.data.id
  118. },
  119. success(res) {
  120. console.log('---res---')
  121. console.log(res)
  122. },
  123. fail(err) {
  124. console.log('---err---')
  125. console.log(err)
  126. }
  127. })
  128. }
  129. }).catch(err => {})
  130. },
  131. },
  132. created() {
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .btn{
  138. margin: 0;
  139. padding: 0;
  140. width: 212rpx;
  141. height: 82rpx;
  142. background-color: #FF0000;
  143. color: #FFFFFF;
  144. line-height: 80rpx;
  145. font-size: 32rpx;
  146. border-radius: 41rpx;
  147. }
  148. .tag-self {
  149. position: absolute !important;
  150. top: 0 !important;
  151. border-radius: 20rpx 0 20rpx 0 !important;
  152. width: max-content;
  153. height: 32rpx !important;
  154. }
  155. .title {
  156. font-size: 28rpx;
  157. color: $u-content-color;
  158. height: 90rpx;
  159. }
  160. // tab
  161. .ctab {
  162. width: 100%;
  163. margin: 20rpx 0 0rpx 0rpx;
  164. padding: 0 22rpx;
  165. }
  166. // 商品列表
  167. .com {
  168. width: 100%;
  169. overflow: hidden;
  170. .list {
  171. border-radius: 10rpx;
  172. overflow: hidden;
  173. margin: 20rpx 32rpx;
  174. background-color: #FFFFFF;
  175. // box-shadow: 0 0 10px 5px #e5e5e5;
  176. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  177. align-items: flex-start;
  178. .left {
  179. overflow: hidden;
  180. image {
  181. width: 186rpx;
  182. height: 186rpx;
  183. margin: 20rpx;
  184. border-radius: 10rpx;
  185. }
  186. }
  187. .right {
  188. overflow: hidden;
  189. width: 64%;
  190. .title {
  191. margin: 0rpx 20rpx 10rpx 0;
  192. color: #222222;
  193. font-size: 32rpx;
  194. }
  195. .tips {
  196. margin: 16rpx 0;
  197. overflow: hidden;
  198. .u-line-progress {
  199. width: 112rpx;
  200. overflow: hidden;
  201. margin-right: 20rpx;
  202. }
  203. .progress {
  204. color: #777777;
  205. font-size: 24rpx;
  206. }
  207. .bought {
  208. color: #777777;
  209. font-size: 24rpx;
  210. margin-right: 20rpx;
  211. }
  212. }
  213. .price {
  214. overflow: hidden;
  215. color: #FF0000;
  216. margin-top: 10rpx;
  217. button {
  218. width: 176rpx;
  219. height: 60rpx;
  220. background: #FE9903;
  221. border-radius: 15px;
  222. font-size: 24rpx;
  223. color: #FFFFFF;
  224. margin: 0rpx 20rpx 0rpx 20rpx;
  225. border: none;
  226. }
  227. }
  228. }
  229. }
  230. }
  231. </style>