orderPay.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="uni-flex uni-column cart order">
  3. <view class="uni-flex uni-column uni-flex-item" style="margin-bottom: 80upx;">
  4. <view class="uni-flex uni-column order-address">
  5. <view class="uni-flex uni-column order-address-box">
  6. <view class="uni-flex uni-flex-item uni-row">收货信息</view>
  7. <view class="uni-flex uni-flex-item uni-row">
  8. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  9. </view>
  10. </view>
  11. <view class="uni-flex uni-flex-item order-address-line">
  12. <image src="../../../static/cart/line.png" mode="widthFix"></image>
  13. </view>
  14. </view>
  15. <!-- 列表循环 -->
  16. <view class="uni-flex uni-column uni-flex-item cart-list" v-for="(item,m) in json" :key="item">
  17. <view class="uni-flex uni-column item-shop ">
  18. <!-- 商家 -->
  19. <view class="uni-flex uni-row order-line">
  20. {{item.sj}}
  21. </view>
  22. <!-- 图片产品名称价格数量展示 -->
  23. <view class="uni-flex uni-row order-item" v-for="pl in json[m].items" :key="pl">
  24. <!-- 商品图片 -->
  25. <view class="uni-flex uni-flex-item item-padding item-img">
  26. <image mode="widthFix" :src="pl.img"></image>
  27. </view>
  28. <view class="uni-flex uni-column item-padding uni-flex-item3">
  29. <view class="uni-flex uni-flex-item">
  30. {{pl.cp}}
  31. </view>
  32. <view class="uni-flex uni-flex-item">
  33. <view class="uni-flex text cart-attr" v-for="(attr,n) in pl.attr" :key="attr">
  34. {{attr.name}}:{{attr.value}}
  35. </view>
  36. </view>
  37. <view class="uni-flex uni-row uni-flex-item">
  38. <view class="uni-flex uni-flex-item5">¥{{pl.jg}}</view>
  39. <view class="uni-flex uni-flex-item ">x{{pl.sl}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="uni-flex uni-row order-line">
  44. 订单编号:快递
  45. </view>
  46. <view class="uni-flex uni-row order-line">
  47. 买家留言:{{item.message}}
  48. </view>
  49. <view class="uni-flex uni-row order-line">
  50. 配送方式:快递{{item.expressCost}}
  51. </view>
  52. <view class="uni-flex uni-row order-line">
  53. 支付金额:{{item.totalPrice}}
  54. </view>
  55. </view>
  56. </view>
  57. <view class="uni-flex uni-flex-item">
  58. <radio-group class="uni-flex-item" @change="radioChange">
  59. <label class="uni-list-cell uni-list-cell-pd">
  60. <view>
  61. <radio :value="1" checked="true" />
  62. </view>
  63. <view>金YY</view>
  64. </label>
  65. <label class="uni-list-cell uni-list-cell-pd">
  66. <view>
  67. <radio :value="1" />
  68. </view>
  69. <view>支付宝</view>
  70. </label>
  71. <label class="uni-list-cell uni-list-cell-pd">
  72. <view>
  73. <radio :value="1" />
  74. </view>
  75. <view>微信</view>
  76. </label>
  77. </radio-group>
  78. </view>
  79. </view>
  80. <view class="uni-flex uni-row footer">
  81. <view class="uni-flex-item3 uni-flex">付款金额: ¥{{allPrice}}</view>
  82. <view class="uni-flex uni-flex-item justify-flex-end">
  83. <view class="uni-flex uni-flex-item btn" @click='pay()'>立即支付</view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import {
  90. mapState,
  91. mapMutations
  92. } from 'vuex'
  93. import cart from '../../../common/cart.js';
  94. export default {
  95. computed: {
  96. ...mapState(['hasLogin', 'forcedLogin', 'jyyUser'])
  97. },
  98. data() {
  99. return {
  100. allPrice: '0.00',
  101. allNum: 0,
  102. json: [],
  103. user: {},
  104. };
  105. },
  106. onLoad(e) {
  107. if (!this.hasLogin) {
  108. uni.navigateTo({
  109. url: '../login/login',
  110. });
  111. } else {
  112. this.user = JSON.parse(this.jyyUser);
  113. this.json = cart.getOrder();
  114. this.price();
  115. if (this.debug) {
  116. console.log(this.json);
  117. }
  118. }
  119. },
  120. methods: {
  121. price() {
  122. let all = 0;
  123. for (let j = 0; j < this.json.length; j++) {
  124. all += parseFloat(this.json[j].expressCost) + parseFloat(this.json[j].totalPrice);
  125. }
  126. this.allPrice = all.toFixed(2); //返回数据
  127. },
  128. pay() {
  129. uni.showToast({
  130. icon: "none",
  131. title: "未完成"
  132. })
  133. }
  134. }
  135. }
  136. </script>
  137. <style>
  138. </style>