index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view class="orderGoods">
  3. <view class='total' v-if="is_gift"><text>
  4. <text class="iconfont icon-ic_gift1 mr-8"></text>
  5. <text>{{ is_gift== 1 ? '送给好友' : '我的礼物'}}</text>
  6. </text>
  7. </view>
  8. <view class='total' v-else-if="is_behalf"><text>
  9. {{$t(`代付金额`)}}:
  10. <text class="pay-price">¥{{pay_price || 0}}</text>
  11. </text>
  12. </view>
  13. <view class='total' v-else-if="!split && !is_behalf">{{$t(`共`)}}{{totalNmu}}{{$t(`件商品`)}}</view>
  14. <view class='total' v-else-if="split">
  15. <text>{{$t(`订单包裹`)}} {{index + 1}}</text>
  16. <view class="rig-btn" v-if="status_type === -1">
  17. <view class="refund">{{$t(`申请退款中`)}}</view>
  18. </view>
  19. <view class="rig-btn" v-else-if="status_type === -2">
  20. <view class="refund">{{$t(`已退款`)}}</view>
  21. </view>
  22. <view class="rig-btn" v-else-if="status_type === 4">
  23. <view class="done">{{$t(`已完成`)}}</view>
  24. </view>
  25. </view>
  26. <view class='goodWrapper pt-24'>
  27. <view class='' :class="{op:!item.is_valid}" v-for="(item,index) in cartInfo" :key="index"
  28. @click="jumpCon(item)">
  29. <view class="item acea-row row-between-wrapper">
  30. <view class='pictrue' :class="{gray:!item.is_valid}">
  31. <image :src='item.productInfo.attrInfo.image' v-if="item.productInfo.attrInfo"></image>
  32. <image :src='item.productInfo.image' v-else></image>
  33. </view>
  34. <view class='text'>
  35. <view class='acea-row row-between-wrapper'>
  36. <view class='name line2'>{{item.productInfo.store_name}}</view>
  37. <view class='num'>x {{item.cart_num}}</view>
  38. </view>
  39. <view class='attr line1' v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}
  40. </view>
  41. <view class='money font-color pic' v-if="item.productInfo.attrInfo">
  42. <text v-show="is_gift != 2" :class="{gray:!item.is_valid}">
  43. {{$t(`¥`)}}{{item.productInfo.attrInfo.price}}
  44. </text>
  45. <view class="refund" v-if="item.refund_num && statusType !=-2">{{item.refund_num}}{{$t(`件退款中`)}}
  46. </view>
  47. <text class="valid" v-if="!item.is_valid && shipping_type === 0">{{$t(`不支持配送`)}}</text>
  48. <text class="valid" v-if="!item.productInfo.store_mention && shipping_type === 1">{{$t(`不支持自提`)}}</text>
  49. </view>
  50. <view class='money font-color pic' v-else>
  51. <text :class="{gray:!item.is_valid}">{{$t(`¥`)}}{{item.productInfo.price}}</text>
  52. <text class="valid" v-if="!item.is_valid && shipping_type === 0">{{$t(`仅支持到店`)}}</text>
  53. <text class="valid" v-if="!item.productInfo.store_mention && shipping_type === 1">{{$t(`仅支持配送`)}}</text>
  54. </view>
  55. <view class='evaluate' v-else-if="item.is_reply==1">{{$t(`已评价`)}}</view>
  56. </view>
  57. </view>
  58. <view class="botton-btn">
  59. <view class='logistics' v-if="item.is_reply==0 && evaluate==3 && pid != -1 && isShow"
  60. @click.stop="evaluateTap(item.unique,orderId)">
  61. {{$t(`评价`)}}</view>
  62. <view class='logistics'
  63. v-if="paid === 1 && refund_status === 0 && item.refund_num !=item.cart_num && !is_confirm && is_refund_available && isShow && (virtualType == 0 || (virtualType > 0 && statusType == 1)) && (is_gift != 2) && gift_uid == 0"
  64. @click.stop="openSubcribe(item)">
  65. {{$t(`申请退款`)}}</view>
  66. <view class="rig-btn" v-if="status_type === 2 && index === cartInfo.length - 1 || !split">
  67. <view v-if="delivery_type === 'express'" class="logistics" @click.stop="logistics(orderId)">{{$t(`查看物流`)}}
  68. </view>
  69. <view class="logistics sure" v-if="status_type === 2" @click.stop="confirmOrder(orderId)">{{$t(`确认收货`)}}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import { mapGetters } from 'vuex'
  79. export default {
  80. computed: mapGetters(['uid']),
  81. props: {
  82. // 订单状态
  83. statusType: {
  84. type: Number,
  85. default: 0,
  86. },
  87. virtualType: {
  88. type: Number,
  89. default: 0,
  90. },
  91. evaluate: {
  92. type: Number,
  93. default: 0,
  94. },
  95. oid: {
  96. type: Number,
  97. default: 0,
  98. },
  99. // 1已支付 0未支付
  100. paid: {
  101. type: Number,
  102. default: 0,
  103. },
  104. cartInfo: {
  105. type: Array,
  106. default: function() {
  107. return [];
  108. }
  109. },
  110. orderId: {
  111. type: String,
  112. default: '',
  113. },
  114. shipping_type: {
  115. type: Number,
  116. default: -1,
  117. },
  118. delivery_type: {
  119. type: String,
  120. default: '',
  121. },
  122. pay_price: {
  123. type: String,
  124. default: '',
  125. },
  126. jump: {
  127. type: Boolean,
  128. default: false,
  129. },
  130. is_confirm: {
  131. type: Boolean,
  132. default: false,
  133. },
  134. // is_behalf 是否是代付列表
  135. is_behalf: {
  136. type: Boolean,
  137. default: false,
  138. },
  139. split: {
  140. type: Boolean,
  141. default: false,
  142. },
  143. jumpDetail: {
  144. type: Boolean,
  145. default: false,
  146. },
  147. index: {
  148. type: Number,
  149. default: 0,
  150. },
  151. pid: {
  152. type: Number,
  153. default: 0,
  154. },
  155. is_gift: {
  156. type: Number | String,
  157. default: 0,
  158. },
  159. gift_uid: {
  160. type: Number,
  161. default: 0,
  162. },
  163. refund_status: {
  164. type: Number,
  165. default: 0,
  166. },
  167. status_type: {
  168. type: Number,
  169. default: 0,
  170. },
  171. isShow: {
  172. type: Boolean,
  173. default: true,
  174. },
  175. is_refund_available: {
  176. type: Boolean,
  177. default: true,
  178. },
  179. },
  180. data() {
  181. return {
  182. totalNmu: 0,
  183. operationModel: false,
  184. status: "",
  185. };
  186. },
  187. watch: {
  188. cartInfo: function(nVal, oVal) {
  189. let num = 0
  190. nVal.forEach((item, index) => {
  191. num += item.cart_num
  192. })
  193. this.totalNmu = num
  194. }
  195. },
  196. mounted() {
  197. let num = 0
  198. this.$nextTick(() => {
  199. this.cartInfo.forEach((item, index) => {
  200. num += item.cart_num
  201. })
  202. this.$set(this, 'totalNmu', num)
  203. })
  204. },
  205. methods: {
  206. evaluateTap: function(unique, orderId) {
  207. uni.navigateTo({
  208. url: "/pages/goods/goods_comment_con/index?unique=" + unique + "&uni=" + orderId
  209. })
  210. },
  211. jumpCon(item) {
  212. if (this.jump) {
  213. let url = '';
  214. if (item.type == 0) {
  215. url = `/pages/goods_details/index?id=${item.product_id}`
  216. } else if (item.type == 1) {
  217. url = `/pages/activity/goods_seckill_details/index?id=${item.seckill_id}&time_id=${item.productInfo.time_id}`
  218. } else if (item.type == 2) {
  219. url = `/pages/activity/goods_bargain_details/index?id=${item.bargain_id}&bargain=${this.uid}`
  220. } else if (item.type == 3) {
  221. url = `/pages/activity/goods_combination_details/index?id=${item.combination_id}`
  222. }
  223. uni.navigateTo({
  224. url
  225. })
  226. } else if (this.jumpDetail) {
  227. uni.navigateTo({
  228. url: `/pages/goods/order_details/index?order_id=${this.orderId}`
  229. })
  230. }
  231. },
  232. logistics(order_id) {
  233. uni.navigateTo({
  234. url: '/pages/goods/goods_logistics/index?orderId=' + order_id
  235. })
  236. },
  237. confirmOrder(orderId) {
  238. this.$emit('confirmOrder', orderId)
  239. },
  240. changeOperation() {
  241. this.operationModel = !this.operationModel
  242. },
  243. openSubcribe(item) {
  244. let cartList = [];
  245. cartList.push({
  246. cart_id: item.id,
  247. cart_num: item.surplus_refund_num
  248. })
  249. let obj = JSON.stringify(cartList);
  250. this.$emit('openSubcribe',
  251. `/pages/goods/goods_return/index?orderId=${this.orderId}&id=${this.oid}&cartIds=${obj}`)
  252. },
  253. }
  254. }
  255. </script>
  256. <style scoped lang="scss">
  257. .fontcolor {
  258. color: #e93323;
  259. }
  260. .orderGoods {
  261. background-color: #fff;
  262. }
  263. .orderGoods .total {
  264. display: flex;
  265. justify-content: space-between;
  266. align-items: center;
  267. width: 100%;
  268. // height: 86rpx;
  269. padding: 0 30rpx;
  270. border-bottom: 2rpx solid #f0f0f0;
  271. font-size: 30rpx;
  272. color: #333;
  273. line-height: 86rpx;
  274. box-sizing: border-box;
  275. }
  276. .botton-btn {
  277. display: flex;
  278. align-items: right;
  279. justify-content: flex-end;
  280. padding: 0rpx 20rpx 24rpx 20rpx;
  281. }
  282. .rig-btn {
  283. display: flex;
  284. align-items: center;
  285. .refund {
  286. font-size: 26rpx;
  287. color: #e93323;
  288. }
  289. .done {
  290. font-size: 26rpx;
  291. color: #F19D2F;
  292. }
  293. }
  294. .logistics {
  295. // height: 46rpx;
  296. line-height: 30rpx;
  297. color: #666666;
  298. font-size: 20rpx;
  299. border: 1px solid #CCCCCC;
  300. border-radius: 30rpx;
  301. padding: 8rpx 22rpx;
  302. margin-left: 10rpx;
  303. }
  304. .sure {
  305. color: #e93323;
  306. border: 1px solid #e93323;
  307. }
  308. .more-operation {
  309. display: flex;
  310. justify-content: center;
  311. align-items: center;
  312. padding: 10rpx 0;
  313. color: #bbb;
  314. }
  315. .b-top {
  316. margin-left: 30rpx;
  317. margin-right: 30rpx;
  318. border-top: 1px solid #f0f0f0
  319. }
  320. .fade-enter-active,
  321. .fade-leave-active {
  322. transition: all 0.1s;
  323. }
  324. .fade-enter,
  325. .fade-leave-to
  326. /* .fade-leave-active below version 2.1.8 */
  327. {
  328. opacity: 0;
  329. transform: translateY(-10px);
  330. }
  331. .op {
  332. opacity: 0.5;
  333. }
  334. .gray {
  335. filter: grayscale(100%);
  336. filter: gray;
  337. }
  338. .pic {
  339. display: flex;
  340. justify-content: space-between;
  341. }
  342. .valid {
  343. margin-left: 20rpx;
  344. font-size: 24rpx;
  345. }
  346. .pay-price {
  347. color: #E93323;
  348. }
  349. .refund {
  350. text-align: right;
  351. font-size: 26rpx;
  352. color: var(--view-theme);
  353. }
  354. </style>