assistant.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <div class="iApp">
  3. <div class="log_list" :style="{ height: height }">
  4. <div class="list_box" v-for="(item, index) of list" :key="index">
  5. <div class="list_item flex_r flex_jb">
  6. <checkbox-group
  7. class="list_item_l flex_c flex_jc"
  8. @change="checkboxChange($event, item)"
  9. >
  10. <label class="option_box mar_t30">
  11. <checkbox
  12. :value="item.order_sn"
  13. :checked="item.isclick"
  14. color="#2DB389"
  15. style="transform: scale(0.7)"
  16. />
  17. </label>
  18. </checkbox-group>
  19. <div class="list_item_r">
  20. <div class="p1 flex_r flex_jb c05">
  21. <span>订单号:{{ item.order_sn }}</span>
  22. <span>{{ $day(item.add_time * 1000).format("YYYY-MM-DD") }}</span>
  23. </div>
  24. <div class="p2 flex_r flex_jb">
  25. <img :src="item.original_img" class="odr_img" alt />
  26. <div class="odr_info flex_c flex_jb">
  27. <div class="tit ellipsis1">{{ item.goods_name }}</div>
  28. <div class="num">数量 x{{ item.goods_num }}</div>
  29. <div class="money flex_r flex_jb">
  30. <span>金额{{ item.total_amount }}</span>
  31. <!-- <span>奖励茶宝36</span> -->
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="bottom">
  40. <div class="left">
  41. <span>共</span>
  42. <span class="green">{{ trueTotal }}</span>
  43. <span>笔订单,合计</span>
  44. <span class="green">¥{{ money }}</span>
  45. <span>元</span>
  46. </div>
  47. <div class="right">
  48. <div class="button" @click="toEditinvoice">
  49. <span>下一步</span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import { get, post } from "@/request/api.js";
  57. var app = getApp();
  58. var appEv = app.$vm.$options;
  59. export default {
  60. name: "iApp",
  61. components: {},
  62. data() {
  63. return {
  64. list: [],
  65. page: 1,
  66. rows: 10,
  67. selectedId: [],
  68. selectedLi: [],
  69. height: undefined,
  70. trueTotal: 0,
  71. money: 0,
  72. };
  73. },
  74. onLoad(option) {
  75. let that = this;
  76. uni.getSystemInfo({
  77. success: function (res) {
  78. that.height = res.windowHeight * 2 - 150 + "rpx";
  79. that.getList();
  80. },
  81. });
  82. },
  83. onLaunch() {},
  84. onShow() {},
  85. onHide() {},
  86. //页面上拉触底事件的处理函数
  87. onReachBottom() {
  88. if (this.page != -1) {
  89. var that = this;
  90. setTimeout(function () {
  91. that.page++;
  92. that.getList();
  93. }, 800);
  94. }
  95. },
  96. methods: {
  97. getList() {
  98. let data = {
  99. page: this.page,
  100. rows: this.rows,
  101. };
  102. post("invoice/orderList", data).then((res) => {
  103. if (res.code == 0) {
  104. this.list = this.list.concat(res.data.data);
  105. this.total = res.data.total;
  106. if (Math.ceil(this.total / this.rows) <= this.page) {
  107. this.page = -1;
  108. }
  109. }
  110. });
  111. },
  112. checkboxChange(e, item) {
  113. this.trueTotal = 0;
  114. this.money = 0;
  115. if (item.isclick == true) {
  116. this.$set(item, "isclick", false);
  117. } else {
  118. this.$set(item, "isclick", true);
  119. }
  120. for (let i of this.list) {
  121. if (i.isclick) {
  122. this.trueTotal++;
  123. this.money = this.money + i.total_amount * 1;
  124. }
  125. }
  126. },
  127. toEditinvoice() {
  128. if (this.trueTotal == 0) {
  129. appEv.errTips("请先选择订单");
  130. return;
  131. }
  132. let list = []
  133. ;
  134. for (let i of this.list) {
  135. if (i.isclick == true) {
  136. list.push(i.order_sn);
  137. }
  138. }
  139. console.log(list,"qqqq");
  140. uni.navigateTo({
  141. url: "/pagesB/invoice/editinvoice?icheckList="+ list.toString() + '&money=' + this.money,
  142. });
  143. // this.goto("/pagesB/invoice/editinvoice",{checkList : list.toString(),money:this.money});
  144. },
  145. },
  146. computed: {},
  147. watch: {},
  148. };
  149. </script>
  150. <style scoped lang='scss'>
  151. .iApp {
  152. width: 100%;
  153. height: 100%;
  154. .log_list {
  155. padding: 32rpx 32rpx;
  156. overflow: scroll;
  157. .log_title {
  158. line-height: 40rpx;
  159. margin-bottom: 20rpx;
  160. .tit {
  161. font-size: 36rpx;
  162. font-weight: bold;
  163. .log_num {
  164. font-size: 28rpx;
  165. margin-left: 10rpx;
  166. }
  167. .active {
  168. border-bottom: 4rpx solid #3a88ff;
  169. }
  170. }
  171. .mor {
  172. font-size: 24rpx;
  173. color: rgba($color: #000, $alpha: 0.5);
  174. .icofont {
  175. font-size: 22rpx;
  176. }
  177. }
  178. }
  179. .list_box {
  180. margin-top: 20rpx;
  181. .list_item {
  182. background: #fff;
  183. padding: 32rpx;
  184. border-radius: 16rpx;
  185. margin-bottom: 20rpx;
  186. border: 1px solid #ddd;
  187. .list_item_l {
  188. width: 68rpx;
  189. // text-align: center;
  190. .iconfont {
  191. font-size: 36rpx;
  192. }
  193. }
  194. .list_item_r {
  195. width: calc(100% - 68rpx);
  196. }
  197. &:last-child {
  198. margin-bottom: 0;
  199. }
  200. }
  201. .p1 {
  202. font-size: 25rpx;
  203. margin-bottom: 20rpx;
  204. }
  205. .p2 {
  206. .odr_img {
  207. object-fit: cover;
  208. width: 120rpx;
  209. height: 112rpx;
  210. }
  211. .odr_info {
  212. width: calc(100% - 120rpx - 20rpx);
  213. font-size: 24rpx;
  214. color: rgba($color: #000, $alpha: 0.5);
  215. .tit {
  216. color: rgba($color: #000, $alpha: 0.9);
  217. }
  218. }
  219. }
  220. }
  221. }
  222. .bottom {
  223. flex: 0 0 100rpx;
  224. // background-color: red;
  225. border-top: 1px solid #ddd;
  226. height: 100rpx;
  227. width: 100%;
  228. z-index: 999;
  229. display: flex;
  230. flex-direction: row;
  231. justify-content: space-between;
  232. align-items: center;
  233. padding: 0 32rpx;
  234. .left {
  235. display: flex;
  236. flex-direction: row;
  237. .green {
  238. color: #2db389;
  239. margin: 0 6rpx;
  240. }
  241. }
  242. .right {
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. .button {
  247. padding: 10rpx 20rpx;
  248. background-color: #2db389;
  249. border-radius: 10rpx;
  250. span {
  251. color: #fff;
  252. }
  253. }
  254. }
  255. }
  256. }
  257. </style>