index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view class="orderGoods">
  3. <view class='goodWrapper'>
  4. <view class="title">共{{cartInfo.length}}件商品</view>
  5. <view v-for="(item,index) in cartInfo" :key="index">
  6. <view class='item acea-row row-between-wrapper'>
  7. <view class='pictrue' @click="jumpCon(item.product_id)">
  8. <image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
  9. </view>
  10. <view class='text'>
  11. <view class='acea-row row-between-wrapper'>
  12. <view class='name line1'>{{item.cart_info.product.store_name}}</view>
  13. <view class='num'>x {{item.product_num}}</view>
  14. </view>
  15. <view class='attr line1' v-if="item.cart_info.productAttr.sku">{{item.cart_info.productAttr.sku}}</view>
  16. <view class='money font-color' >¥{{item.cart_info.productAttr.price}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. openOrderRefundSubscribe
  26. } from '@/utils/SubscribeMessage.js';
  27. export default {
  28. props: {
  29. evaluate: {
  30. type: Number,
  31. default: 0,
  32. },
  33. activityType: {
  34. type: Number,
  35. default: 0,
  36. },
  37. cartInfo: {
  38. type: Array,
  39. default: function() {
  40. return [];
  41. }
  42. },
  43. orderId: {
  44. type: String,
  45. default: '',
  46. },
  47. jump: {
  48. type: Boolean,
  49. default: false,
  50. },
  51. orderData: {
  52. type: Object,
  53. default: function() {
  54. return {};
  55. }
  56. }
  57. },
  58. data() {
  59. return {
  60. totalNmu:'',
  61. isTimePay: false, //是否到支付时间
  62. };
  63. },
  64. watch:{
  65. cartInfo:function(nVal,oVal){
  66. let num = 0
  67. nVal.forEach((item,index)=>{
  68. num += item.cart_num
  69. })
  70. this.totalNmu = num
  71. }
  72. },
  73. onShow() {
  74. this.isPayBalance()
  75. },
  76. mounted() {
  77. console.log(this.cartInfo,'cartInfo')
  78. },
  79. methods: {
  80. evaluateTap:function(unique,orderId){
  81. uni.navigateTo({
  82. url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
  83. })
  84. },
  85. // 判断是否到支付尾款时间
  86. isPayBalance(){
  87. let that = this;
  88. if(that.orderData.status === 10){
  89. if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
  90. that.isTimePay = false; //未开始
  91. }else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
  92. that.isTimePay = true; //立即支付
  93. }
  94. }
  95. },
  96. jumpCon:function(id){
  97. if(this.jump){
  98. if(this.activityType == 2){
  99. uni.navigateTo({
  100. url: `/pages/activity/presell_details/index?id=${id}`
  101. })
  102. }else{
  103. uni.navigateTo({
  104. url: `/pages/goods_details/index?id=${id}`
  105. })
  106. }
  107. }
  108. },
  109. // 退款
  110. refund(item){
  111. // #ifdef MP
  112. openOrderRefundSubscribe().then(() => {
  113. uni.hideLoading();
  114. if(this.evaluate == 0){
  115. uni.navigateTo({
  116. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
  117. })
  118. }else{
  119. uni.navigateTo({
  120. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id
  121. })
  122. }
  123. }).catch(() => {
  124. uni.hideLoading();
  125. })
  126. // #endif
  127. // #ifdef H5
  128. if(this.evaluate == 0){
  129. uni.navigateTo({
  130. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
  131. })
  132. }else{
  133. uni.navigateTo({
  134. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id
  135. })
  136. }
  137. // #endif
  138. }
  139. }
  140. }
  141. </script>
  142. <style scoped lang="scss">
  143. .orderGoods {
  144. background-color: #fff;
  145. }
  146. .goodWrapper{
  147. margin-top: 12rpx;
  148. .title{
  149. padding: 0 32rpx;
  150. border-bottom: 1px solid #f0f0f0;
  151. height: 86rpx;
  152. line-height: 86rpx;
  153. }
  154. }
  155. .right-btn-box{
  156. position: absolute;
  157. right: 0;
  158. bottom: 0;
  159. display: flex;
  160. align-items: center;
  161. justify-content: flex-end;
  162. &.event_box{
  163. position: static;
  164. }
  165. .btn-item{
  166. display: flex;
  167. align-items: center;
  168. justify-content: center;
  169. width:140rpx;
  170. height:46rpx;
  171. margin-left: 20rpx;
  172. border:1px solid rgba(187,187,187,1);
  173. border-radius:23rpx;
  174. font-size: 24rpx;
  175. color: #282828;
  176. &.on{
  177. background:rgba(220,220,220,1);
  178. border-color: rgba(220,220,220,1);
  179. }
  180. &.err{
  181. background:rgba(247,247,247,1);
  182. border-color: rgba(247,247,247,1);
  183. color: #AAAAAA;
  184. }
  185. }
  186. }
  187. .event_bg{
  188. background: #FF7F00;
  189. }
  190. .event_color{
  191. color: #FF7F00;
  192. }
  193. .presell_item{
  194. height: auto;
  195. padding-bottom: 15rpx;
  196. }
  197. .event_progress{
  198. margin-top: 20rpx;
  199. background: #fff;
  200. .progress_name {
  201. padding-left: 30rpx;
  202. height: 60rpx;
  203. line-height: 60rpx;
  204. font-size: 24rpx;
  205. font-weight: bold;
  206. position: relative;
  207. &::before{
  208. content: "";
  209. display: inline-block;
  210. width: 5rpx;
  211. height: 34rpx;
  212. background: #E93323;
  213. position: absolute;
  214. top: 15rpx;
  215. left: 0;
  216. }
  217. }
  218. .align_right{
  219. float: right;
  220. font-weight: bold;
  221. }
  222. .progress_price{
  223. padding: 20rpx 30rpx;
  224. color: #999999;
  225. font-size: 22rpx;
  226. }
  227. .progress_pay{
  228. padding: 25rpx 30rpx;
  229. background: #FFF8F7;
  230. font-size: 26rpx;
  231. color: #282828;
  232. }
  233. }
  234. .event_name{
  235. display: inline-block;
  236. margin-right: 9rpx;
  237. color: #fff;
  238. font-size: 20rpx;
  239. padding: 0 8rpx;
  240. line-height: 30rpx;
  241. text-align: center;
  242. border-radius: 6rpx;
  243. }
  244. .event_ship{
  245. font-size: 20rpx;
  246. margin-top: 10rpx;
  247. }
  248. </style>