index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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.product_id)">
  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. export default {
  74. props: {
  75. // 订单状态
  76. statusType: {
  77. type: Number,
  78. default: 0,
  79. },
  80. virtualType: {
  81. type: Number,
  82. default: 0,
  83. },
  84. evaluate: {
  85. type: Number,
  86. default: 0,
  87. },
  88. oid: {
  89. type: Number,
  90. default: 0,
  91. },
  92. // 1已支付 0未支付
  93. paid: {
  94. type: Number,
  95. default: 0,
  96. },
  97. cartInfo: {
  98. type: Array,
  99. default: function() {
  100. return [];
  101. }
  102. },
  103. orderId: {
  104. type: String,
  105. default: '',
  106. },
  107. shipping_type: {
  108. type: Number,
  109. default: -1,
  110. },
  111. delivery_type: {
  112. type: String,
  113. default: '',
  114. },
  115. pay_price: {
  116. type: String,
  117. default: '',
  118. },
  119. jump: {
  120. type: Boolean,
  121. default: false,
  122. },
  123. is_confirm: {
  124. type: Boolean,
  125. default: false,
  126. },
  127. // is_behalf 是否是代付列表
  128. is_behalf: {
  129. type: Boolean,
  130. default: false,
  131. },
  132. split: {
  133. type: Boolean,
  134. default: false,
  135. },
  136. jumpDetail: {
  137. type: Boolean,
  138. default: false,
  139. },
  140. index: {
  141. type: Number,
  142. default: 0,
  143. },
  144. pid: {
  145. type: Number,
  146. default: 0,
  147. },
  148. refund_status: {
  149. type: Number,
  150. default: 0,
  151. },
  152. status_type: {
  153. type: Number,
  154. default: 0,
  155. },
  156. isShow: {
  157. type: Boolean,
  158. default: true,
  159. },
  160. is_refund_available: {
  161. type: Boolean,
  162. default: true,
  163. },
  164. },
  165. data() {
  166. return {
  167. totalNmu: 0,
  168. operationModel: false,
  169. status: "",
  170. };
  171. },
  172. watch: {
  173. cartInfo: function(nVal, oVal) {
  174. let num = 0
  175. nVal.forEach((item, index) => {
  176. num += item.cart_num
  177. })
  178. this.totalNmu = num
  179. }
  180. },
  181. mounted() {
  182. let num = 0
  183. this.$nextTick(() => {
  184. this.cartInfo.forEach((item, index) => {
  185. num += item.cart_num
  186. })
  187. this.$set(this, 'totalNmu', num)
  188. })
  189. },
  190. methods: {
  191. evaluateTap: function(unique, orderId) {
  192. uni.navigateTo({
  193. url: "/pages/goods/goods_comment_con/index?unique=" + unique + "&uni=" + orderId
  194. })
  195. },
  196. jumpCon(id) {
  197. if (this.jump) {
  198. uni.navigateTo({
  199. url: `/pages/goods_details/index?id=${id}`
  200. })
  201. } else if (this.jumpDetail) {
  202. uni.navigateTo({
  203. url: `/pages/goods/order_details/index?order_id=${this.orderId}`
  204. })
  205. }
  206. },
  207. logistics(order_id) {
  208. uni.navigateTo({
  209. url: '/pages/goods/goods_logistics/index?orderId=' + order_id
  210. })
  211. },
  212. confirmOrder(orderId) {
  213. this.$emit('confirmOrder', orderId)
  214. },
  215. changeOperation() {
  216. this.operationModel = !this.operationModel
  217. },
  218. openSubcribe(item) {
  219. let cartList = [];
  220. cartList.push({
  221. cart_id: item.id,
  222. cart_num: item.surplus_refund_num
  223. })
  224. let obj = JSON.stringify(cartList);
  225. this.$emit('openSubcribe',
  226. `/pages/goods/goods_return/index?orderId=${this.orderId}&id=${this.oid}&cartIds=${obj}`)
  227. },
  228. }
  229. }
  230. </script>
  231. <style scoped lang="scss">
  232. .fontcolor {
  233. color: #e93323;
  234. }
  235. .orderGoods {
  236. background-color: #fff;
  237. }
  238. .orderGoods .total {
  239. display: flex;
  240. justify-content: space-between;
  241. align-items: center;
  242. width: 100%;
  243. // height: 86rpx;
  244. padding: 0 30rpx;
  245. border-bottom: 2rpx solid #f0f0f0;
  246. font-size: 30rpx;
  247. color: #282828;
  248. line-height: 86rpx;
  249. box-sizing: border-box;
  250. }
  251. .botton-btn {
  252. display: flex;
  253. align-items: right;
  254. justify-content: flex-end;
  255. padding: 0rpx 20rpx 20rpx 20rpx;
  256. }
  257. .rig-btn {
  258. display: flex;
  259. align-items: center;
  260. .refund {
  261. font-size: 26rpx;
  262. color: #e93323;
  263. }
  264. .done {
  265. font-size: 26rpx;
  266. color: #F19D2F;
  267. }
  268. }
  269. .logistics {
  270. // height: 46rpx;
  271. line-height: 30rpx;
  272. color: #666666;
  273. font-size: 20rpx;
  274. border: 1px solid #CCCCCC;
  275. border-radius: 30rpx;
  276. padding: 8rpx 22rpx;
  277. margin-left: 10rpx;
  278. }
  279. .sure {
  280. color: #e93323;
  281. border: 1px solid #e93323;
  282. }
  283. .more-operation {
  284. display: flex;
  285. justify-content: center;
  286. align-items: center;
  287. padding: 10rpx 0;
  288. color: #bbb;
  289. }
  290. .b-top {
  291. margin-left: 30rpx;
  292. margin-right: 30rpx;
  293. border-top: 1px solid #f0f0f0
  294. }
  295. .fade-enter-active,
  296. .fade-leave-active {
  297. transition: all 0.1s;
  298. }
  299. .fade-enter,
  300. .fade-leave-to
  301. /* .fade-leave-active below version 2.1.8 */
  302. {
  303. opacity: 0;
  304. transform: translateY(-10px);
  305. }
  306. .op {
  307. opacity: 0.5;
  308. }
  309. .gray {
  310. filter: grayscale(100%);
  311. filter: gray;
  312. }
  313. .pic {
  314. display: flex;
  315. justify-content: space-between;
  316. }
  317. .valid {
  318. margin-left: 20rpx;
  319. font-size: 24rpx;
  320. }
  321. .pay-price {
  322. color: #E93323;
  323. }
  324. .refund {
  325. text-align: right;
  326. font-size: 26rpx;
  327. color: var(--view-theme);
  328. }
  329. </style>