index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view class="orderGoods" :style="viewColor">
  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="acea-row row-middle item-money">
  17. <view class='moneys'>¥{{item.cart_info.productAttr.price}}</view>
  18. <view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
  19. <view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. // +----------------------------------------------------------------------
  29. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  30. // +----------------------------------------------------------------------
  31. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  32. // +----------------------------------------------------------------------
  33. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  34. // +----------------------------------------------------------------------
  35. // | Author: CRMEB Team <admin@crmeb.com>
  36. // +----------------------------------------------------------------------
  37. import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
  38. import { mapGetters } from "vuex";
  39. export default {
  40. props: {
  41. evaluate: {
  42. type: Number,
  43. default: 0,
  44. },
  45. activityType: {
  46. type: Number,
  47. default: 0,
  48. },
  49. cartInfo: {
  50. type: Array,
  51. default: function() {
  52. return [];
  53. }
  54. },
  55. orderId: {
  56. type: String,
  57. default: '',
  58. },
  59. jump: {
  60. type: Boolean,
  61. default: false,
  62. },
  63. orderData: {
  64. type: Object,
  65. default: function() {
  66. return {};
  67. }
  68. }
  69. },
  70. computed: mapGetters(['viewColor']),
  71. data() {
  72. return {
  73. totalNmu:'',
  74. isTimePay: false, //是否到支付时间
  75. };
  76. },
  77. watch:{
  78. cartInfo:function(nVal,oVal){
  79. let num = 0
  80. nVal.forEach((item,index)=>{
  81. num += item.cart_num
  82. })
  83. this.totalNmu = num
  84. }
  85. },
  86. onShow() {
  87. this.isPayBalance()
  88. },
  89. mounted() {},
  90. methods: {
  91. evaluateTap:function(unique,orderId){
  92. uni.navigateTo({
  93. url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
  94. })
  95. },
  96. // 判断是否到支付尾款时间
  97. isPayBalance(){
  98. let that = this;
  99. if(that.orderData.status === 10){
  100. if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
  101. that.isTimePay = false; //未开始
  102. }else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
  103. that.isTimePay = true; //立即支付
  104. }
  105. }
  106. },
  107. jumpCon:function(id){
  108. if(this.jump){
  109. if(this.activityType == 2){
  110. uni.navigateTo({
  111. url: `/pages/activity/presell_details/index?id=${id}`
  112. })
  113. }else{
  114. uni.navigateTo({
  115. url: `/pages/goods_details/index?id=${id}`
  116. })
  117. }
  118. }
  119. },
  120. // 退款
  121. refund(item){
  122. // #ifdef MP
  123. openOrderRefundSubscribe().then(() => {
  124. uni.hideLoading();
  125. if(this.evaluate == 0){
  126. uni.navigateTo({
  127. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
  128. })
  129. }else{
  130. uni.navigateTo({
  131. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id
  132. })
  133. }
  134. }).catch(() => {
  135. uni.hideLoading();
  136. })
  137. // #endif
  138. // #ifdef H5
  139. if(this.evaluate == 0){
  140. uni.navigateTo({
  141. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
  142. })
  143. }else{
  144. uni.navigateTo({
  145. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id
  146. })
  147. }
  148. // #endif
  149. }
  150. }
  151. }
  152. </script>
  153. <style scoped lang="scss">
  154. .orderGoods {
  155. background-color: #fff;
  156. }
  157. .goodWrapper{
  158. margin-top: 12rpx;
  159. .title{
  160. padding: 0 32rpx;
  161. border-bottom: 1px solid #f0f0f0;
  162. height: 86rpx;
  163. line-height: 86rpx;
  164. }
  165. }
  166. .right-btn-box{
  167. position: absolute;
  168. right: 0;
  169. bottom: 0;
  170. display: flex;
  171. align-items: center;
  172. justify-content: flex-end;
  173. &.event_box{
  174. position: static;
  175. }
  176. .btn-item{
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. width:140rpx;
  181. height:46rpx;
  182. margin-left: 20rpx;
  183. border:1px solid rgba(187,187,187,1);
  184. border-radius:23rpx;
  185. font-size: 24rpx;
  186. color: #282828;
  187. &.on{
  188. background:rgba(220,220,220,1);
  189. border-color: rgba(220,220,220,1);
  190. }
  191. &.err{
  192. background:rgba(247,247,247,1);
  193. border-color: rgba(247,247,247,1);
  194. color: #AAAAAA;
  195. }
  196. }
  197. }
  198. .event_bg{
  199. background: #FF7F00;
  200. }
  201. .event_color{
  202. color: #FF7F00;
  203. }
  204. .item-money{
  205. margin-top: 20rpx;
  206. }
  207. .moneys {
  208. margin-top: 0;
  209. color: var(--view-priceColor);
  210. }
  211. .btn-item{
  212. display: flex;
  213. align-items: center;
  214. justify-content: center;
  215. width:140rpx;
  216. height:46rpx;
  217. margin-left: 10rpx;
  218. border:1px solid rgba(187,187,187,1);
  219. border-radius:23rpx;
  220. font-size: 24rpx;
  221. color: #282828;
  222. &.on{
  223. background:rgba(220,220,220,1);
  224. border-color: rgba(220,220,220,1);
  225. }
  226. &.err{
  227. background:rgba(247,247,247,1);
  228. border-color: rgba(247,247,247,1);
  229. color: #AAAAAA;
  230. }
  231. }
  232. .presell_item{
  233. height: auto;
  234. padding-bottom: 15rpx;
  235. }
  236. .event_progress{
  237. margin-top: 20rpx;
  238. background: #fff;
  239. .progress_name {
  240. padding-left: 30rpx;
  241. height: 60rpx;
  242. line-height: 60rpx;
  243. font-size: 24rpx;
  244. font-weight: bold;
  245. position: relative;
  246. &::before{
  247. content: "";
  248. display: inline-block;
  249. width: 5rpx;
  250. height: 34rpx;
  251. background: #E93323;
  252. position: absolute;
  253. top: 15rpx;
  254. left: 0;
  255. }
  256. }
  257. .align_right{
  258. float: right;
  259. font-weight: bold;
  260. }
  261. .progress_price{
  262. padding: 20rpx 30rpx;
  263. color: #999999;
  264. font-size: 22rpx;
  265. }
  266. .progress_pay{
  267. padding: 25rpx 30rpx;
  268. background: var(--view-minorColor);
  269. font-size: 26rpx;
  270. color: #282828;
  271. }
  272. }
  273. .event_name{
  274. display: inline-block;
  275. margin-right: 9rpx;
  276. color: #fff;
  277. font-size: 20rpx;
  278. padding: 0 8rpx;
  279. line-height: 30rpx;
  280. text-align: center;
  281. border-radius: 6rpx;
  282. }
  283. .event_ship{
  284. font-size: 20rpx;
  285. margin-top: 10rpx;
  286. }
  287. </style>