index.vue 12 KB

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