index_mall.vue 6.7 KB

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