index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="orderGoods">
  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="font-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)" @click.stop="refund(item)">申请退款</view>
  24. <view class="btn-item err" v-if="item.is_refund ==1">退款中</view>
  25. <view class='btn-item err' v-if="item.is_refund >1">已退款</view>
  26. <view class='btn-item' v-if='item.is_reply==0 && evaluate==2' @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 font-color">阶段一: 买家已付款</view>
  34. <view class="progress_price">商品定金 <text class="align_right">¥{{ orderData.pay_price }}</text></view>
  35. <view class="progress_pay">定金实付款<text class="align_right font-color">¥{{ orderData.pay_price }}</text></view>
  36. </view>
  37. <view class="progress_list">
  38. <view class="progress_name font-color">阶段二:
  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 font-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'>{{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 font-color' v-if="item.cart_info.product_type ==3">¥{{item.cart_info.productAssistAttr.assist_price}}</view>
  59. <view class='money font-color' v-else-if="item.cart_info.product_type ==4">¥{{item.cart_info.activeSku.active_price}}</view>
  60. <view class='money font-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" @click.stop="refund(item)">申请退款</view>
  63. <view class="btn-item err" v-if="item.is_refund ==1">退款中</view>
  64. <view class='btn-item err' v-if="item.is_refund >1">已退款</view>
  65. <view class='btn-item' v-if='item.is_reply==0 && evaluate==2' @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. import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
  76. import { goShopDetail } from '@/libs/order.js'
  77. import { initiateAssistApi } from '@/api/activity.js';
  78. export default {
  79. props: {
  80. evaluate: {
  81. type: Number,
  82. default: 0,
  83. },
  84. activityType: {
  85. type: Number,
  86. default: 0,
  87. },
  88. cartInfo: {
  89. type: Array,
  90. default: function() {
  91. return [];
  92. }
  93. },
  94. orderId: {
  95. type: String,
  96. default: '',
  97. },
  98. jump: {
  99. type: Boolean,
  100. default: false,
  101. },
  102. orderData: {
  103. type: Object,
  104. default: function() {
  105. return {};
  106. }
  107. }
  108. },
  109. data() {
  110. return {
  111. totalNmu:'',
  112. isTimePay: false, //是否到支付时间
  113. };
  114. },
  115. watch:{
  116. cartInfo:function(nVal,oVal){
  117. let num = 0
  118. nVal.forEach((item,index)=>{
  119. num += item.cart_num
  120. })
  121. this.totalNmu = num
  122. }
  123. },
  124. onShow() {
  125. this.isPayBalance()
  126. },
  127. mounted() {
  128. console.log(this.cartInfo,'cartInfo')
  129. },
  130. methods: {
  131. evaluateTap:function(unique,orderId){
  132. uni.navigateTo({
  133. url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
  134. })
  135. },
  136. // 判断是否到支付尾款时间
  137. isPayBalance(){
  138. let that = this;
  139. if(that.orderData.status === 10){
  140. if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
  141. that.isTimePay = false; //未开始
  142. }else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
  143. that.isTimePay = true; //立即支付
  144. }
  145. }
  146. },
  147. jumpCon:function(item){
  148. // if(this.jump){
  149. // if(this.activityType == 2){
  150. // uni.navigateTo({
  151. // url: `/pages/activity/presell_details/index?id=${id}`
  152. // })
  153. // }else{
  154. // uni.navigateTo({
  155. // url: `/pages/goods_details/index?id=${id}`
  156. // })
  157. // }
  158. // }
  159. if(item.product_type == 4)item.activity_id = item.cart_info && item.cart_info.activeSku.product_group_id
  160. goShopDetail(item).then(res => {
  161. initiateAssistApi(item.activity_id).then(res => {
  162. let id = res.data.product_assist_set_id;
  163. uni.hideLoading();
  164. // #ifndef MP
  165. uni.navigateTo({
  166. url: '/pages/activity/assist_detail/index?id=' + id
  167. });
  168. // #endif
  169. // #ifdef MP
  170. openBargainSubscribe().then(res => {
  171. uni.hideLoading();
  172. uni.navigateTo({
  173. url: '/pages/activity/assist_detail/index?id=' + id
  174. });
  175. }).catch((err) => {
  176. uni.hideLoading();
  177. });
  178. // #endif
  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){
  193. uni.navigateTo({
  194. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
  195. })
  196. }else{
  197. uni.navigateTo({
  198. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id
  199. })
  200. }
  201. }).catch(() => {
  202. uni.hideLoading();
  203. })
  204. // #endif
  205. // #ifdef H5
  206. if(this.evaluate == 0 || this.evaluate == 9){
  207. uni.navigateTo({
  208. url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
  209. })
  210. }else{
  211. uni.navigateTo({
  212. url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&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. .right-btn-box{
  225. position: absolute;
  226. right: 0;
  227. bottom: 0;
  228. display: flex;
  229. align-items: center;
  230. justify-content: flex-end;
  231. &.event_box{
  232. position: static;
  233. }
  234. .btn-item{
  235. display: flex;
  236. align-items: center;
  237. justify-content: center;
  238. width:140rpx;
  239. height:46rpx;
  240. margin-left: 20rpx;
  241. border:1px solid rgba(187,187,187,1);
  242. border-radius:23rpx;
  243. font-size: 24rpx;
  244. color: #282828;
  245. &.on{
  246. background:rgba(220,220,220,1);
  247. border-color: rgba(220,220,220,1);
  248. }
  249. &.err{
  250. background:rgba(247,247,247,1);
  251. border-color: rgba(247,247,247,1);
  252. color: #AAAAAA;
  253. }
  254. }
  255. }
  256. .event_bg{
  257. background: #FF7F00;
  258. }
  259. .event_color{
  260. color: #FF7F00;
  261. }
  262. .presell_item{
  263. height: auto;
  264. padding-bottom: 15rpx;
  265. }
  266. .event_progress{
  267. margin-top: 20rpx;
  268. background: #fff;
  269. .progress_name {
  270. padding-left: 30rpx;
  271. height: 60rpx;
  272. line-height: 60rpx;
  273. font-size: 24rpx;
  274. font-weight: bold;
  275. position: relative;
  276. &::before{
  277. content: "";
  278. display: inline-block;
  279. width: 5rpx;
  280. height: 34rpx;
  281. background: #E93323;
  282. position: absolute;
  283. top: 15rpx;
  284. left: 0;
  285. }
  286. }
  287. .align_right{
  288. float: right;
  289. font-weight: bold;
  290. }
  291. .progress_price{
  292. padding: 20rpx 30rpx;
  293. color: #999999;
  294. font-size: 22rpx;
  295. }
  296. .progress_pay{
  297. padding: 25rpx 30rpx;
  298. background: #FFF8F7;
  299. font-size: 26rpx;
  300. color: #282828;
  301. }
  302. }
  303. .event_name{
  304. display: inline-block;
  305. margin-right: 9rpx;
  306. color: #fff;
  307. font-size: 20rpx;
  308. padding: 0 8rpx;
  309. line-height: 30rpx;
  310. text-align: center;
  311. border-radius: 6rpx;
  312. }
  313. .event_ship{
  314. font-size: 20rpx;
  315. margin-top: 10rpx;
  316. }
  317. </style>