index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <view>
  3. <u-tabs :list="types" :activeStyle="{ fontWeight: 'bold', color: '#C30D23' }" lineColor="#C30D23"
  4. @change="changeStatus" />
  5. <view class="date-box">
  6. <view class="date" @click="openFilter">
  7. <text class="iconfont icon-sousuo" />
  8. 起始:
  9. <text class="value">
  10. {{ content.where.begindate_create || '' }}
  11. </text>
  12. </view>
  13. <view class="date" @click="openFilter">
  14. <text class="iconfont icon-sousuo" />
  15. 结束:
  16. <text class="value">
  17. {{ content.where.enddate_create || '' }}
  18. </text>
  19. </view>
  20. <view class="search" @click.stop="setSearchShow">
  21. <text class="iconfont icon-sousuo" />
  22. </view>
  23. </view>
  24. <u-transition :show="searchShow">
  25. <view class="My_search-box">
  26. <My_search :value="content.where.condition" @onSearch="onSearch">
  27. <view class="cancel" v-if="content.where.condition" hover-class="navigator-hover" @click="onSearch('')">
  28. 取消
  29. </view>
  30. <view v-else style="width: 5px;" />
  31. </My_search>
  32. </view>
  33. </u-transition>
  34. <filtrate ref="Filtrate" :filtrateList="filtrateList" @onFiltration="onFiltration" />
  35. <My_listbox ref="List" @getlist="getList">
  36. <navigator v-for="item in list" :key="item.sa_custorderid" class="item"
  37. :url="'/store/orderForm/detail?id=' + item.sa_custorderid" hover-class="navigator-hover">
  38. <view class="sonum">
  39. 订单号:{{ item.sonum }}
  40. <text :style="{ color: item.status == '待付款' ? '#E3041F' : '#666666' }">
  41. {{ item.status }}
  42. </text>
  43. </view>
  44. <view class="product">
  45. <u--image :src="item.cover" width="86" height="80" radius="8" lazy-load>
  46. <template v-slot:loading>
  47. <u-loading-icon color="red"></u-loading-icon>
  48. </template>
  49. </u--image>
  50. <view class="content">
  51. <view class="product-title u-line-1">
  52. {{ item.itemname }}
  53. </view>
  54. <view class="price">
  55. 总计 <text style="color: #E3041F;">¥</text>
  56. <text style="color: #E3041F;font-size: 18px;font-weight: bold;">
  57. {{ CNY(item.price, '') }}
  58. </text>
  59. <text style="color: #E3041F;">元</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="but-box" v-if="item.status == '待付款'">
  64. <view />
  65. <view class="but" hover-class="navigator-hover" hover-stop-propagation="false">
  66. 付款
  67. </view>
  68. </view>
  69. </navigator>
  70. </My_listbox>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. types: [
  78. { name: "全部" },
  79. { name: "待付款" },
  80. { name: "已付款" },
  81. ],
  82. searchShow: false,
  83. content: {
  84. "where": {
  85. "condition": "",
  86. "status": "",
  87. "begindate_create": this.daysAgo(1).begindate,
  88. "enddate_create": this.daysAgo(1).enddate
  89. }
  90. },
  91. list: [],
  92. filtrateList: [
  93. {
  94. type: "dateRange",
  95. title: "时间区间",//组名称
  96. day: 1,
  97. key: 'create',//提交时返回的Key
  98. begindate: this.daysAgo(1).begindate,
  99. enddate: this.daysAgo(1).enddate
  100. }
  101. ]
  102. }
  103. },
  104. created() {
  105. this.getList(true)
  106. uni.setNavigationBarTitle({
  107. title: '商城订单',
  108. })
  109. },
  110. methods: {
  111. getList(init = false) {
  112. if (this.paging(this.content, init)) return;
  113. this.$Http.basic({
  114. "id": "20240507100302",
  115. content: this.content
  116. }).then(res => {
  117. console.log("订单列表", res)
  118. this.$refs.List.RefreshToComplete()
  119. if (this.cutoff(res.msg)) return;
  120. res.data = res.data.map(v => {
  121. v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sa_fad") || v.attinfos[0]) : uni.getStorageSync("site").logo || ''
  122. return v
  123. })
  124. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data), this.colors;
  125. this.content = this.$refs.List.paging(this.content, res)
  126. })
  127. },
  128. changeStatus({ name }) {
  129. this.content.where.status = name == '全部' ? '' : name;
  130. this.getList(true)
  131. },
  132. openFilter() {
  133. this.$refs.Filtrate.changeShow();
  134. },
  135. onSearch(condition) {
  136. if (condition == this.content.where.condition) return;
  137. this.content.where.condition = condition;
  138. this.getList(true);
  139. },
  140. onFiltration(e) {
  141. this.content.where.begindate_create = e.create.begindate;
  142. this.content.where.enddate_create = e.create.enddate;
  143. this.getList(true);
  144. },
  145. setSearchShow() {
  146. this.searchShow = !this.searchShow;
  147. setTimeout(() => {
  148. this.$refs.List.setHeight()
  149. }, 300);
  150. }
  151. },
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .date-box {
  156. display: flex;
  157. width: 100vw;
  158. background: #fff;
  159. padding: 5px 16px;
  160. box-sizing: border-box;
  161. .date {
  162. flex: 1;
  163. line-height: 20px;
  164. font-size: 14px;
  165. .iconfont {
  166. margin-right: 5px;
  167. color: #707070;
  168. }
  169. .value {
  170. color: #C30D23;
  171. }
  172. }
  173. .search {
  174. color: #999999;
  175. font-size: 14px;
  176. line-height: 20px;
  177. padding-left: 10px;
  178. }
  179. }
  180. .item {
  181. width: 355px;
  182. padding: 10px;
  183. border-radius: 8px;
  184. background: #fff;
  185. box-sizing: border-box;
  186. margin: 10px auto 0;
  187. .sonum {
  188. display: flex;
  189. justify-content: space-between;
  190. height: 20px;
  191. font-family: Source Han Sans SC, Source Han Sans SC;
  192. font-size: 14px;
  193. color: #333333;
  194. }
  195. .product {
  196. display: flex;
  197. margin-top: 12px;
  198. .content {
  199. margin-left: 20px;
  200. .product-title {
  201. margin-top: 10px;
  202. line-height: 24px;
  203. font-family: Source Han Sans SC, Source Han Sans SC;
  204. font-weight: bold;
  205. font-size: 16px;
  206. color: #333333;
  207. }
  208. .price {
  209. margin-top: 10px;
  210. }
  211. }
  212. }
  213. .but-box {
  214. display: flex;
  215. justify-content: space-between;
  216. .but {
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. width: 100px;
  221. height: 40px;
  222. background: #C30D23;
  223. border-radius: 5px;
  224. font-family: PingFang SC, PingFang SC;
  225. font-size: 14px;
  226. color: #FFFFFF;
  227. }
  228. }
  229. }
  230. .My_search-box {
  231. background: #fff;
  232. width: 100vw;
  233. padding: 5px;
  234. padding-left: 10px;
  235. box-sizing: border-box;
  236. .cancel {
  237. line-height: 30px;
  238. margin-left: 10px;
  239. padding: 0 10px;
  240. font-family: Source Han Sans SC, Source Han Sans SC;
  241. font-size: 14px;
  242. color: #666666;
  243. border-radius: 4px;
  244. }
  245. }
  246. </style>