index.vue 7.7 KB

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