index.vue 8.1 KB

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