orderinfo.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="page">
  3. <view class="info">
  4. <view class="u-flex u-row-between">
  5. <text class="shang">商品信息</text>
  6. <text class="more" @click="open" v-if="orderlist.length>3 && this.opena == false">展开</text>
  7. <text class="more" @click="open" v-if="orderlist.length>3 && this.opena==true">收起</text>
  8. </view>
  9. <!-- <view v-if="index==1" class="u-flex" style="margin-top: 32rpx;" :key="index">
  10. <view class="box">
  11. <image :src="item.image" style="width: 120rpx;height: 160rpx;" mode=""></image>
  12. </view>
  13. <view class=""
  14. style="margin-left: 20rpx;justify-content: space-between;display: flex;flex-direction: column;height: 160rpx;">
  15. <view class="" style="width: 500rpx;">
  16. <view class="title u-line-1" style="margin-bottom: 8rpx;">{{item.title}}</view>
  17. <view class="fufei">资源类型:付费资源</view>
  18. <view class="fufei">资源类型:免费资源</view>
  19. </view>
  20. <view class="money">¥{{item.price}}</view>
  21. </view>
  22. </view> -->
  23. <view class="u-flex" style="margin-top: 32rpx;" v-for="(item,index) in orderlist" :key="index">
  24. <view class="box">
  25. <image :src="item.good_item.image" style="width: 120rpx;height: 160rpx;" mode=""></image>
  26. </view>
  27. <view class=""
  28. style="margin-left: 20rpx;justify-content: space-between;display: flex;flex-direction: column;height: 160rpx;">
  29. <view class="" style="width: 500rpx;">
  30. <view class="title u-line-1" style="margin-bottom: 8rpx;">{{item.good_item.title}}</view>
  31. <view class="fufei" v-if="item.good_item.price>0">资源类型:付费资源</view>
  32. <view class="fufei" v-if="item.good_item.price==0">资源类型:免费资源</view>
  33. </view>
  34. <view class="money">¥{{item.good_item.price}}</view>
  35. </view>
  36. </view>
  37. <view class="jiner ">
  38. <view class="" style="margin-top: 24rpx;" class="u-flex u-row-between">
  39. <text class="sum">商品金额</text>
  40. <view class="">
  41. <text class="figure">¥</text>
  42. <text class="figure" style="font-size: 32rpx;font-weight: 400;">{{orderinfo.total_price}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="pay">
  48. <u-radio-group v-model="value" >
  49. <view class="u-flex u-row-between" style="width: 680rpx;">
  50. <view class="u-flex">
  51. <image src="/static/images/wei.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
  52. <view class="weipay">微信支付</view>
  53. </view>
  54. <view class="">
  55. <u-radio name="0">
  56. </u-radio>
  57. </view>
  58. </view>
  59. <view class="u-flex u-row-between"
  60. style="width: 680rpx;border-top: rgba(151, 151, 151, 0.1);margin-top: 30rpx;padding-top: 26rpx;">
  61. <view class="u-flex">
  62. <image src="/static/images/zhi.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
  63. <view class="weipay">支付宝支付</view>
  64. </view>
  65. <view class="">
  66. <u-radio name="1"></u-radio>
  67. </view>
  68. </view>
  69. </u-radio-group>
  70. </view>
  71. <view class="" style="height: 166rpx;"></view>
  72. <view class="bottom u-flex u-row-right">
  73. <view class="">
  74. <text>合计:</text>
  75. <text>¥</text>
  76. <text>{{orderinfo.total_price}}</text>
  77. </view>
  78. <view class="btn" @click="pay">
  79. 确认支付
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. value: 0,
  89. orderlist: [],
  90. orderinfo: {
  91. total_price: ''
  92. },
  93. order: {
  94. },
  95. index: '',
  96. opena: false
  97. };
  98. },
  99. onLoad(options) {
  100. this.orderid = options.id
  101. this.index = options.index
  102. this.getOrderList()
  103. },
  104. methods: {
  105. open() {
  106. this.opena = !this.opena
  107. },
  108. //获取订单列表
  109. getOrderList() {
  110. this.$u.post('api/order/getOrderInfo', {
  111. id: this.orderid
  112. }).then(res => {
  113. this.orderinfo = res.data
  114. if (this.opena) {
  115. this.orderlist = res.data.goods
  116. } else {
  117. this.orderlist = res.data.goods.slice(0, 3)
  118. }
  119. console.log(res);
  120. })
  121. },
  122. // 选中某个单选框时,由radio时触发
  123. radioChange(e) {
  124. // console.log(e);
  125. },
  126. // 选中任一radio时,由radio-group触发
  127. radioGroupChange(e) {
  128. // console.log(e);
  129. },
  130. pay() {
  131. uni.navigateTo({
  132. url: '/pages/index/pay/pay'
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .weipay {
  140. font-size: 26rpx;
  141. font-family: PingFangSC, PingFang SC;
  142. font-weight: 400;
  143. color: #333333;
  144. margin-left: 20rpx;
  145. }
  146. .bottom {
  147. width: 750rpx;
  148. height: 166rpx;
  149. background: #FFFFFF;
  150. position: fixed;
  151. bottom: 0;
  152. padding: 0 28rpx;
  153. left: 0;
  154. .btn {
  155. width: 212rpx;
  156. height: 88rpx;
  157. background: #06A971;
  158. border-radius: 12rpx;
  159. font-size: 32rpx;
  160. font-family: PingFangSC, PingFang SC;
  161. font-weight: 500;
  162. color: #FFFFFF;
  163. line-height: 88rpx;
  164. text-align: center;
  165. margin-left: 24rpx;
  166. }
  167. }
  168. .pay {
  169. width: 694rpx;
  170. height: 200rpx;
  171. background: #FFFFFF;
  172. border-radius: 16rpx;
  173. margin-top: 20rpx;
  174. padding: 32rpx 20rpx;
  175. }
  176. .jiner {
  177. width: 654rpx;
  178. // height: 2rpx;
  179. border-top: 2rpx solid rgba(151, 151, 151, 0.1);
  180. margin-top: 32rpx;
  181. .sum {
  182. font-size: 26rpx;
  183. font-family: PingFangSC, PingFang SC;
  184. font-weight: 400;
  185. color: #222222;
  186. }
  187. .figure {
  188. font-size: 26rpx;
  189. font-family: JDZhengHT, JDZhengHT;
  190. font-weight: 300;
  191. color: #222222;
  192. }
  193. }
  194. .shang {
  195. font-size: 26rpx;
  196. font-family: PingFangSC, PingFang SC;
  197. font-weight: 400;
  198. color: #222222;
  199. }
  200. .more {
  201. font-size: 26rpx;
  202. font-family: PingFangSC, PingFang SC;
  203. font-weight: 400;
  204. color: #06A971;
  205. }
  206. .fufei {
  207. font-size: 24rpx;
  208. font-family: PingFangSC, PingFang SC;
  209. font-weight: 400;
  210. color: #444444;
  211. }
  212. .money {
  213. font-size: 32rpx;
  214. font-family: SFPro, SFPro;
  215. font-weight: 400;
  216. color: #CF1534;
  217. }
  218. .title {
  219. font-size: 28rpx;
  220. font-family: PingFangSC, PingFang SC;
  221. font-weight: 500;
  222. color: #333333;
  223. }
  224. .info {
  225. width: 694rpx;
  226. // height: 944rpx;
  227. background: #FFFFFF;
  228. border-radius: 16rpx;
  229. padding: 24rpx 20rpx 30rpx;
  230. }
  231. .page {
  232. background-color: rgba(244, 244, 244, 1);
  233. padding: 20rpx 28rpx;
  234. min-height: 94vh;
  235. }
  236. .box {
  237. width: 160rpx;
  238. height: 160rpx;
  239. border: 2rpx solid rgba(151, 151, 151, 0.2);
  240. padding: 0 20rpx
  241. }
  242. </style>