index.vue 8.3 KB

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