index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <view class="orderGoods" :style="viewColor">
  3. <view class='goodWrapper' :class="'item'+orderData.order_type">
  4. <view v-if="orderData.order_type == 1" class="title acea-row row-between-wrapper">
  5. <view class="item-status" :class="'status'+evaluate">{{evaluate == 0 ? '待核销' : '已核销'}}</view>
  6. <view v-if="evaluate != 0 && orderData.verify_time" class="item-date">{{orderData.verify_time}}</view>
  7. </view>
  8. <view v-for="(item,index) in cartInfo" :key="index">
  9. <view v-if="activityType === 2">
  10. <view class='item presell_item'>
  11. <view class="acea-row row-between-wrapper">
  12. <view class='pictrue' @click="jumpCon(item)">
  13. <image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
  14. </view>
  15. <view class='text'>
  16. <view class='acea-row row-between-wrapper'>
  17. <view class='name line1' style="width: 360rpx;"><text class="event_name event_bg">预售</text>{{item.cart_info.product.store_name}}</view>
  18. <view class='num'><text class="p-color">¥{{item.cart_info.productPresellAttr.presell_price}}</text><br/>x {{item.product_num}}</view>
  19. </view>
  20. <view class='attr line1' v-if="item.cart_info.productAttr.sku" style="margin-top: 0;">{{item.cart_info.productAttr.sku}}</view>
  21. <view v-if="evaluate === 0 || evaluate === 10 || evaluate === 11" class="event_ship event_color">发货时间:
  22. <!--全款预售-->
  23. <text v-if="item.cart_info.productPresell.presell_type === 1">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
  24. <!--定金预售-->
  25. <text v-if="item.cart_info.productPresell.presell_type === 2">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
  26. </view>
  27. <view class="right-btn-box event_box">
  28. <view class="btn-item" v-if="item.refund_switch==1 && (item.is_refund ==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0)" @click.stop="refund(item)">申请退款</view>
  29. <view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
  30. <view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
  31. <view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.is_refund==0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
  32. <view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view v-if="orderData.status >= 10" class="event_progress">
  38. <view class="progress_list">
  39. <view class="progress_name">阶段一: 买家已付款</view>
  40. <view class="progress_price">商品定金 <text class="align_right">¥{{ orderData.pay_price }}</text></view>
  41. <view class="progress_pay">定金实付款<text class="align_right t-color">¥{{ orderData.pay_price }}</text></view>
  42. </view>
  43. <view class="progress_list">
  44. <view class="progress_name">阶段二:
  45. <text v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 0">未开始</text>
  46. <text v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 1">等待买家付尾款</text>
  47. <text v-if="orderData.status == 11 || orderData.presellOrder.activeStatus == 2">交易已关闭</text>
  48. </view>
  49. <view class="progress_price">商品尾款 <text class="align_right">¥{{ orderData.presellOrder.pay_price }}</text></view>
  50. <view class="progress_pay">尾款需付款<text class="align_right t-color">¥{{ orderData.presellOrder.pay_price }}</text></view>
  51. </view>
  52. </view>
  53. </view>
  54. <view v-else class='item'>
  55. <view class="acea-row row-between-wrapper">
  56. <view class='pictrue' @click="jumpCon(item)">
  57. <image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
  58. </view>
  59. <view class='text'>
  60. <view class='acea-row row-between-wrapper'>
  61. <view class='name line1'><text v-if="item.product_type != 0 && item.product_type != 10" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>{{item.cart_info.product.store_name}}</view>
  62. <view class='num'>x {{item.product_num}}</view>
  63. </view>
  64. <view class='attr line1' v-if="item.cart_info.productAttr.sku">{{item.cart_info.productAttr.sku}}</view>
  65. <view class='money p-color' v-if="item.cart_info.product_type ==3">¥{{item.cart_info.productAssistAttr.assist_price}}</view>
  66. <view class='money p-color' v-else-if="item.cart_info.product_type ==4">¥{{item.cart_info.activeSku.active_price}}</view>
  67. <view class='money acea-row row-middle' v-else>
  68. <text>¥{{item.cart_info.productAttr.price}}</text>
  69. <image v-if="item.cart_info.productAttr.show_svip_price" class="svip-img" :src="`${domain}/static/images/svip.png`"></image>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="right-btn-box">
  74. <view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
  75. <view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
  76. <view class="btn-item" v-if="item.refund_switch==1&& (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)" @click.stop="refund(item)">申请退款</view>
  77. <view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
  78. <view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. // +----------------------------------------------------------------------
  87. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  88. // +----------------------------------------------------------------------
  89. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  90. // +----------------------------------------------------------------------
  91. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  92. // +----------------------------------------------------------------------
  93. // | Author: CRMEB Team <admin@crmeb.com>
  94. // +----------------------------------------------------------------------
  95. import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
  96. import { goShopDetail } from '@/libs/order.js'
  97. import { initiateAssistApi } from '@/api/activity.js';
  98. import { mapGetters } from "vuex";
  99. import { HTTP_REQUEST_URL } from '@/config/app';
  100. export default {
  101. props: {
  102. evaluate: {
  103. type: Number,
  104. default: 0,
  105. },
  106. activityType: {
  107. type: Number,
  108. default: 0,
  109. },
  110. cartInfo: {
  111. type: Array,
  112. default: function() {
  113. return [];
  114. }
  115. },
  116. orderId: {
  117. type: String,
  118. default: '',
  119. },
  120. jump: {
  121. type: Boolean,
  122. default: false,
  123. },
  124. orderData: {
  125. type: Object,
  126. default: function() {
  127. return {};
  128. }
  129. }
  130. },
  131. computed: mapGetters(['viewColor']),
  132. data() {
  133. return {
  134. domain: HTTP_REQUEST_URL,
  135. totalNmu:'',
  136. isTimePay: false, //是否到支付时间
  137. };
  138. },
  139. watch:{
  140. cartInfo:function(nVal,oVal){
  141. let num = 0
  142. nVal.forEach((item,index)=>{
  143. num += item.cart_num
  144. })
  145. this.totalNmu = num
  146. }
  147. },
  148. onShow() {
  149. this.isPayBalance()
  150. },
  151. mounted() {},
  152. methods: {
  153. evaluateTap:function(unique,orderId){
  154. uni.navigateTo({
  155. url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
  156. })
  157. },
  158. // 判断是否到支付尾款时间
  159. isPayBalance(){
  160. let that = this;
  161. if(that.orderData.status === 10){
  162. if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
  163. that.isTimePay = false; //未开始
  164. }else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
  165. that.isTimePay = true; //立即支付
  166. }
  167. }
  168. },
  169. jumpCon:function(item){
  170. if(item.product_type == 4)item.activity_id = item.cart_info && item.cart_info.activeSku.product_group_id
  171. if(item.product_type == 3)item.activity_id = item.cart_info && item.cart_info.productAssistAttr.product_assist_id
  172. goShopDetail(item).then(res => {
  173. initiateAssistApi(item.activity_id).then(res => {
  174. let id = res.data.product_assist_set_id;
  175. uni.hideLoading();
  176. uni.navigateTo({
  177. url: '/pages/activity/assist_detail/index?id=' + id
  178. });
  179. }).catch((err) => {
  180. uni.showToast({
  181. title: err,
  182. icon: 'none'
  183. })
  184. });
  185. })
  186. },
  187. // 退款
  188. refund(item){
  189. // #ifdef MP
  190. openOrderRefundSubscribe().then(() => {
  191. uni.hideLoading();
  192. if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0){
  193. uni.navigateTo({
  194. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
  195. })
  196. }else{
  197. uni.navigateTo({
  198. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
  199. })
  200. }
  201. }).catch(() => {
  202. uni.hideLoading();
  203. })
  204. // #endif
  205. // #ifdef H5 || APP-PLUS
  206. if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0){
  207. uni.navigateTo({
  208. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
  209. })
  210. }else{
  211. uni.navigateTo({
  212. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
  213. })
  214. }
  215. // #endif
  216. }
  217. }
  218. }
  219. </script>
  220. <style scoped lang="scss">
  221. .orderGoods {
  222. background-color: #fff;
  223. }
  224. .p-color {
  225. color: var(--view-priceColor);
  226. }
  227. .t-color{
  228. color: var(--view-theme);
  229. }
  230. .svip-img{
  231. width: 65rpx;
  232. height: 28rpx;
  233. margin: 4rpx 0 0 4rpx;
  234. }
  235. .title{
  236. height: 86rpx;
  237. position: relative;
  238. padding: 0 30rpx;
  239. &::after{
  240. content: "";
  241. width: 750rpx;
  242. border-bottom: 2rpx dotted #D8D8D8;
  243. position: absolute;
  244. bottom: 0;
  245. left: 0;
  246. }
  247. .item-status{
  248. color: #999999;
  249. font-size: 30rpx;
  250. &.status0{
  251. color: #2291F8;
  252. }
  253. }
  254. .item-date{
  255. color: #666666;
  256. font-size: 28rpx;
  257. }
  258. }
  259. .right-btn-box{
  260. display: flex;
  261. align-items: center;
  262. justify-content: flex-end;
  263. &.event_box{
  264. position: static;
  265. }
  266. .btn-item{
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. width:140rpx;
  271. height:46rpx;
  272. margin-left: 10rpx;
  273. border:1px solid rgba(187,187,187,1);
  274. border-radius:23rpx;
  275. font-size: 24rpx;
  276. color: #282828;
  277. &.on{
  278. background:rgba(220,220,220,1);
  279. border-color: rgba(220,220,220,1);
  280. }
  281. &.err{
  282. background:rgba(247,247,247,1);
  283. border-color: rgba(247,247,247,1);
  284. color: #AAAAAA;
  285. }
  286. }
  287. }
  288. .event_bg{
  289. background: #FF7F00;
  290. }
  291. .event_color{
  292. color: #FF7F00;
  293. }
  294. .presell_item{
  295. height: auto;
  296. padding-bottom: 15rpx;
  297. }
  298. .event_progress{
  299. margin-top: 20rpx;
  300. background: #fff;
  301. .progress_name {
  302. padding-left: 30rpx;
  303. height: 60rpx;
  304. line-height: 60rpx;
  305. font-size: 24rpx;
  306. font-weight: bold;
  307. position: relative;
  308. color: var(--view-theme);
  309. &::before{
  310. content: "";
  311. display: inline-block;
  312. width: 5rpx;
  313. height: 34rpx;
  314. background: var(--view-theme);
  315. position: absolute;
  316. top: 15rpx;
  317. left: 0;
  318. }
  319. }
  320. .align_right{
  321. float: right;
  322. font-weight: bold;
  323. }
  324. .progress_price{
  325. padding: 20rpx 30rpx;
  326. color: #999999;
  327. font-size: 22rpx;
  328. }
  329. .progress_pay{
  330. padding: 25rpx 30rpx;
  331. background: var(--view-minorColor);
  332. font-size: 26rpx;
  333. color: #282828;
  334. }
  335. }
  336. .event_name{
  337. display: inline-block;
  338. margin-right: 9rpx;
  339. color: #fff;
  340. font-size: 20rpx;
  341. padding: 0 8rpx;
  342. line-height: 30rpx;
  343. text-align: center;
  344. border-radius: 6rpx;
  345. }
  346. .event_ship{
  347. font-size: 20rpx;
  348. margin-top: 10rpx;
  349. }
  350. .goodWrapper.item1{
  351. &::after{
  352. content: "";
  353. display: block;
  354. width: 750rpx;
  355. height: 14rpx;
  356. background: #F0F0F0;
  357. }
  358. }
  359. </style>