assistant.vue 6.7 KB

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