index_mall.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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(`共`)}}{{totalNum}}{{$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. totalNum: 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.totalNum = num
  160. }
  161. },
  162. mounted() {
  163. let num = 0
  164. this.$nextTick(() => {
  165. this.cartInfo.forEach((item, index) => {
  166. num += item.totalSales - 0
  167. })
  168. this.$set(this, 'totalNum', num)
  169. })
  170. },
  171. methods: {
  172. evaluateTap: function(unique, orderId) {
  173. uni.navigateTo({
  174. url: "/pages/goods/goods_comment_con/index?unique=" + unique + "&uni=" + orderId
  175. })
  176. },
  177. jumpCon(id) {
  178. if (this.jump) {
  179. uni.navigateTo({
  180. url: `/pages/goods_details/index?id=${id}`
  181. })
  182. } else if (this.jumpDetail) {
  183. uni.navigateTo({
  184. url: `/pages/goods/order_details/index?order_id=${this.orderId}`
  185. })
  186. }
  187. },
  188. logistics(order_id) {
  189. uni.navigateTo({
  190. url: '/pages/goods/goods_logistics/index?orderId=' + order_id
  191. })
  192. },
  193. confirmOrder(orderId) {
  194. this.$emit('confirmOrder', orderId)
  195. },
  196. changeOperation() {
  197. this.operationModel = !this.operationModel
  198. },
  199. openSubcribe(item) {
  200. let cartList = [];
  201. cartList.push({
  202. cart_id: item.id,
  203. cart_num: item.surplus_refund_num
  204. })
  205. let obj = JSON.stringify(cartList);
  206. this.$emit('openSubcribe',
  207. `/pages/goods/goods_return/index?orderId=${this.orderId}&id=${this.oid}&cartIds=${obj}`)
  208. },
  209. }
  210. }
  211. </script>
  212. <style scoped lang="scss">
  213. .fontcolor {
  214. color: #e93323;
  215. }
  216. .orderGoods {
  217. background-color: #fff;
  218. }
  219. .orderGoods .total {
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. width: 100%;
  224. // height: 86rpx;
  225. padding: 0 30rpx;
  226. border-bottom: 2rpx solid #f0f0f0;
  227. font-size: 30rpx;
  228. color: #282828;
  229. line-height: 86rpx;
  230. box-sizing: border-box;
  231. }
  232. .botton-btn {
  233. display: flex;
  234. align-items: right;
  235. justify-content: flex-end;
  236. padding: 0rpx 20rpx 20rpx 20rpx;
  237. }
  238. .rig-btn {
  239. display: flex;
  240. align-items: center;
  241. .refund {
  242. font-size: 26rpx;
  243. color: #e93323;
  244. }
  245. .done {
  246. font-size: 26rpx;
  247. color: #F19D2F;
  248. }
  249. }
  250. .logistics {
  251. // height: 46rpx;
  252. line-height: 30rpx;
  253. color: #666666;
  254. font-size: 20rpx;
  255. border: 1px solid #CCCCCC;
  256. border-radius: 30rpx;
  257. padding: 8rpx 22rpx;
  258. margin-left: 10rpx;
  259. }
  260. .sure {
  261. color: #e93323;
  262. border: 1px solid #e93323;
  263. }
  264. .more-operation {
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. padding: 10rpx 0;
  269. color: #bbb;
  270. }
  271. .b-top {
  272. margin-left: 30rpx;
  273. margin-right: 30rpx;
  274. border-top: 1px solid #f0f0f0
  275. }
  276. .fade-enter-active,
  277. .fade-leave-active {
  278. transition: all 0.1s;
  279. }
  280. .fade-enter,
  281. .fade-leave-to
  282. /* .fade-leave-active below version 2.1.8 */
  283. {
  284. opacity: 0;
  285. transform: translateY(-10px);
  286. }
  287. .op {
  288. opacity: 0.5;
  289. }
  290. .gray {
  291. filter: grayscale(100%);
  292. filter: gray;
  293. }
  294. .pic {
  295. display: flex;
  296. justify-content: space-between;
  297. }
  298. .valid {
  299. margin-left: 20rpx;
  300. font-size: 24rpx;
  301. }
  302. .pay-price {
  303. color: #E93323;
  304. }
  305. .refund {
  306. text-align: right;
  307. font-size: 26rpx;
  308. color: var(--view-theme);
  309. }
  310. </style>