index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view class="orderGoods">
  3. <view class='total' v-if="!split">共{{totalNmu}}件商品</view>
  4. <view class='total' v-if="split">
  5. <text>订单包裹{{index + 1}}</text>
  6. <!-- <view class="rig-btn" v-if="status_type === 2">
  7. <view class="logistics sure" @click="confirmOrder(orderId)">确认收货</view>
  8. <view v-if="delivery_type === 'express'" class="logistics" @click="logistics(orderId)">查看物流</view>
  9. </view> -->
  10. <view class="rig-btn" v-if="status_type === -1">
  11. <view class="refund">申请退款中</view>
  12. </view>
  13. <view class="rig-btn" v-else-if="status_type === -2">
  14. <view class="refund">已退款</view>
  15. </view>
  16. <view class="rig-btn" v-else-if="status_type === 4">
  17. <view class="done">已完成</view>
  18. </view>
  19. </view>
  20. <view class='goodWrapper'>
  21. <view class='' :class="{op:!item.is_valid}" v-for="(item,index) in cartInfo" :key="index"
  22. @click="jumpCon(item.product_id,item.advance_id)">
  23. <view class="item acea-row row-between-wrapper">
  24. <view class='pictrue'>
  25. <image :src='item.productInfo.attrInfo.image' v-if="item.productInfo.attrInfo"></image>
  26. <image :src='item.productInfo.image' v-else></image>
  27. </view>
  28. <view class='text'>
  29. <view class='acea-row row-between-wrapper'>
  30. <view class='name line1'>{{item.productInfo.store_name}}</view>
  31. <view class='num'>x {{item.cart_num}}</view>
  32. </view>
  33. <view class='attr line1' v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}
  34. </view>
  35. <view class='money font-color pic' v-if="item.productInfo.attrInfo">
  36. <text>
  37. ¥{{item.productInfo.attrInfo.price}}
  38. </text>
  39. <text class="valid" v-if="!item.is_valid">不送达</text>
  40. </view>
  41. <view class='money font-color pic' v-else>
  42. <text>¥{{item.productInfo.price}}</text>
  43. <text class="valid" v-if="!item.is_valid">不送达</text>
  44. </view>
  45. <view class='evaluate' v-if='item.is_reply==0 && evaluate==3 && pid != -1'
  46. @click.stop="evaluateTap(item.unique,orderId)">评价</view>
  47. <view class='evaluate' v-else-if="item.is_reply==1">已评价</view>
  48. </view>
  49. </view>
  50. <view class="botton-btn">
  51. <view class='logistics' v-if="cartInfo.length > 1 && !is_confirm && !split && !is_confirm && pid <= 0"
  52. @click.stop="openSubcribe(item.id)">
  53. 申请退款</view>
  54. <view class='logistics'
  55. v-else-if="!is_confirm && index === cartInfo.length - 1 && split && refund_status === 0"
  56. @click.stop="openSubcribeSplit()">
  57. 申请退款</view>
  58. <view class="rig-btn" v-if="status_type === 2 && index === cartInfo.length - 1 || !split">
  59. <view v-if="delivery_type === 'express'" class="logistics" @click.stop="logistics(orderId)">查看物流
  60. </view>
  61. <view class="logistics sure" v-if="status_type === 2" @click.stop="confirmOrder(orderId)">确认收货
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. props: {
  72. evaluate: {
  73. type: Number,
  74. default: 0,
  75. },
  76. cartInfo: {
  77. type: Array,
  78. default: function() {
  79. return [];
  80. }
  81. },
  82. orderId: {
  83. type: String,
  84. default: '',
  85. },
  86. delivery_type: {
  87. type: String,
  88. default: '',
  89. },
  90. jump: {
  91. type: Boolean,
  92. default: false,
  93. },
  94. is_confirm: {
  95. type: Boolean,
  96. default: false,
  97. },
  98. split: {
  99. type: Boolean,
  100. default: false,
  101. },
  102. jumpDetail: {
  103. type: Boolean,
  104. default: false,
  105. },
  106. index: {
  107. type: Number,
  108. default: 0,
  109. },
  110. pid: {
  111. type: Number,
  112. default: 0,
  113. },
  114. refund_status: {
  115. type: Number,
  116. default: 0,
  117. },
  118. status_type: {
  119. type: Number,
  120. default: 0,
  121. }
  122. },
  123. data() {
  124. return {
  125. totalNmu: 0,
  126. operationModel: false,
  127. status: ""
  128. };
  129. },
  130. watch: {
  131. cartInfo: function(nVal, oVal) {
  132. let num = 0
  133. nVal.forEach((item, index) => {
  134. num += item.cart_num
  135. })
  136. this.totalNmu = num
  137. }
  138. },
  139. mounted() {
  140. let num = 0
  141. this.$nextTick(() => {
  142. this.cartInfo.forEach((item, index) => {
  143. num += item.cart_num
  144. })
  145. this.$set(this, 'totalNmu', num)
  146. })
  147. },
  148. methods: {
  149. evaluateTap: function(unique, orderId) {
  150. uni.navigateTo({
  151. url: "/pages/users/goods_comment_con/index?unique=" + unique + "&uni=" + orderId
  152. })
  153. },
  154. jumpCon(id, advance_id) {
  155. if (advance_id) {
  156. uni.navigateTo({
  157. url: `/pages/activity/presell_details/index?id=${advance_id}`
  158. })
  159. } else if (this.jump) {
  160. uni.navigateTo({
  161. url: `/pages/goods_details/index?id=${id}`
  162. })
  163. } else if (this.jumpDetail) {
  164. uni.navigateTo({
  165. url: `/pages/users/order_details/index?order_id=${this.orderId}`
  166. })
  167. }
  168. },
  169. logistics(order_id) {
  170. uni.navigateTo({
  171. url: '/pages/users/goods_logistics/index?orderId=' + order_id
  172. })
  173. },
  174. confirmOrder(orderId) {
  175. this.$emit('confirmOrder', orderId)
  176. },
  177. changeOperation() {
  178. this.operationModel = !this.operationModel
  179. },
  180. openSubcribe(id) {
  181. this.$emit('openSubcribe', `/pages/users/goods_return/index?orderId=${this.orderId}&cart_id=${id}`)
  182. },
  183. openSubcribeSplit() {
  184. this.$emit('openSubcribe', `/pages/users/goods_return/index?orderId=${this.orderId}`)
  185. },
  186. }
  187. }
  188. </script>
  189. <style scoped lang="scss">
  190. .fontcolor {
  191. color: #e93323;
  192. }
  193. .orderGoods {
  194. background-color: #fff;
  195. margin-top: 12rpx;
  196. }
  197. .orderGoods .total {
  198. display: flex;
  199. justify-content: space-between;
  200. align-items: center;
  201. width: 100%;
  202. // height: 86rpx;
  203. padding: 0 30rpx;
  204. border-bottom: 2rpx solid #f0f0f0;
  205. font-size: 30rpx;
  206. color: #282828;
  207. line-height: 86rpx;
  208. box-sizing: border-box;
  209. }
  210. .botton-btn {
  211. display: flex;
  212. align-items: right;
  213. justify-content: flex-end;
  214. padding: 20rpx 20rpx;
  215. }
  216. .rig-btn {
  217. display: flex;
  218. align-items: center;
  219. .refund {
  220. font-size: 26rpx;
  221. color: #e93323;
  222. }
  223. .done {
  224. font-size: 26rpx;
  225. color: #F19D2F;
  226. }
  227. }
  228. .logistics {
  229. // height: 46rpx;
  230. line-height: 30rpx;
  231. color: #999999;
  232. font-size: 20rpx;
  233. border: 1px solid;
  234. border-radius: 30rpx;
  235. padding: 6rpx 12rpx;
  236. margin-left: 10rpx;
  237. }
  238. .sure {
  239. color: #e93323;
  240. border: 1px solid #e93323;
  241. }
  242. .more-operation {
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. padding: 10rpx 0;
  247. color: #bbb;
  248. }
  249. .b-top {
  250. margin-left: 30rpx;
  251. margin-right: 30rpx;
  252. border-top: 1px solid #f0f0f0
  253. }
  254. .fade-enter-active,
  255. .fade-leave-active {
  256. transition: all 0.1s;
  257. }
  258. .fade-enter,
  259. .fade-leave-to
  260. /* .fade-leave-active below version 2.1.8 */
  261. {
  262. opacity: 0;
  263. transform: translateY(-10px);
  264. }
  265. .op {
  266. opacity: 0.5;
  267. }
  268. .pic {
  269. display: flex;
  270. justify-content: space-between;
  271. }
  272. .valid {
  273. font-size: 24rpx;
  274. }
  275. </style>