order-sum.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view v-if="data" class="order-sum">
  3. <view class="topTittle">
  4. {{activeList[choosedActie].label}}
  5. </view>
  6. <view class="topBox flexB">
  7. <view class="topBox_left">
  8. <view class="text spec"><text>¥</text>{{ data.no_pay_money | numDot }}</view>
  9. <view class="text">未付金额</view>
  10. </view>
  11. <image src="../../static/img_new/gift.png" alt="" mode="widthFix" style="width: 140rpx;height: 140rpx;">
  12. </view>
  13. <view class="middata">
  14. <view class="middata_box left">
  15. <view class="text spec"><text>¥</text>{{ data.pay_money | numDot }}</view>
  16. <view class="text">已付金额</view>
  17. </view>
  18. <view class="middata_box right">
  19. <view class="text spec"><text>¥</text>{{ data.money | numDot }}</view>
  20. <view class="text">总金额</view>
  21. </view>
  22. </view>
  23. <view v-if="type == 0" class="data-detail">
  24. <view class="type-detal">
  25. <view class="detail-item bold">
  26. <view class="name">款式</view>
  27. <view class="num">订货数量</view>
  28. <view class="money">订货金额</view>
  29. </view>
  30. <view class="detail-item">
  31. <view class="name">精装版</view>
  32. <view class="num">{{ data.hard | numDot }}(套)</view>
  33. <view class="money">¥{{ data.hard_money | numDot }}</view>
  34. </view>
  35. <view class="detail-item">
  36. <view class="name">简约版</view>
  37. <view class="num">{{ data.simple | numDot }}(件)</view>
  38. <view class="money">¥{{ data.simple_money | numDot }}</view>
  39. </view>
  40. <view class="detail-item">
  41. <view class="name">高腰版</view>
  42. <view class="num">{{ data.old | numDot }}(件)</view>
  43. <view class="money">¥{{ data.old_money | numDot }}</view>
  44. </view>
  45. <view class="detail-item">
  46. <view class="name">纯棉版</view>
  47. <view class="num">{{ data.newold | numDot }}(件)</view>
  48. <view class="money">¥{{ data.newold_money | numDot }}</view>
  49. </view>
  50. <view class="detail-item">
  51. <view class="name">青春版</view>
  52. <view class="num">{{ data.youth | numDot }}(件)</view>
  53. <view class="money">¥{{ data.youth_money | numDot }}</view>
  54. </view>
  55. </view>
  56. </view>
  57. <uni-calendar ref="calendar" :insert="false" :lunar="true" @confirm="confirm" />
  58. <w-picker ref="Selector" mode="selector" themeColor="#F76454" :selectList="activeList" @confirm="confirmActice" />
  59. </view>
  60. </template>
  61. <script>
  62. import { _API_OrderSum, _API_OrderRank, _API_ActivityList } from '@/apis/fortune.js'
  63. import WPicker from '@/components/w-picker/w-picker.vue'
  64. import chartProgress from '@/components/charts/chart-progress.vue'
  65. import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
  66. export default {
  67. components: { WPicker, uniCalendar, chartProgress },
  68. data() {
  69. return {
  70. type: 0,
  71. date: {
  72. 0: '',
  73. 1: ''
  74. },
  75. data: null,
  76. rank: [],
  77. choosedActie: 0,
  78. activeList: []
  79. };
  80. },
  81. filters: {
  82. maxNickname(str) {
  83. return `${str.substr(0,4)}${str.length > 4 ? '...' : ''}`
  84. }
  85. },
  86. mounted() {
  87. if (this.$store.state.userinfo.user_type !== 3) {
  88. uni.navigateBack()
  89. setTimeout(() => uni.$emit('noopening'))
  90. return
  91. }
  92. this.getActivityList()
  93. },
  94. onPullDownRefresh() {
  95. this.requestOnload()
  96. this.type = 0
  97. },
  98. methods: {
  99. getActivityList() {
  100. _API_ActivityList().then(res => {
  101. if(res.code === 200) {
  102. this.activeList = res.data.map((item, index) => ({
  103. label: item.title.length > 26 ? item.title.slice(0,26) + '...' : item.title,
  104. value: index,
  105. start: item.start_time,
  106. end: item.end_time
  107. }))
  108. console.log(this.activeList)
  109. // const arr = [{label: '全部', value: '', start: '', end: ''}]
  110. // this.activeList = arr.concat(this.activeList)
  111. this.requestOnload()
  112. }
  113. })
  114. },
  115. requestOnload() {
  116. uni.loading()
  117. // { start: this.activeList[0].start, end: this.activeList[0].end }
  118. _API_OrderSum().then(({ data }) => {
  119. this.data = data
  120. _API_OrderRank().then(({ data: { list } }) => {
  121. list.sort((a, b) => b.all - a.all)
  122. this.rank = list
  123. })
  124. })
  125. },
  126. request() {
  127. uni.loading()
  128. if(this.choosedActie == 0) { // 选择全部时 不传参
  129. _API_OrderSum().then(({ data }) => {
  130. this.data = data
  131. uni.loading()
  132. _API_OrderRank().then(({ data: { list } }) => {
  133. list.sort((a, b) => b.all - a.all)
  134. this.rank = list
  135. })
  136. })
  137. } else {
  138. _API_OrderSum({ start: this.date[0], end: this.date[1] }).then(({ data }) => {
  139. this.data = data
  140. uni.loading()
  141. _API_OrderRank({ start: this.date[0], end: this.date[1] }).then(({ data: { list } }) => {
  142. list.sort((a, b) => b.all - a.all)
  143. this.rank = list
  144. })
  145. })
  146. }
  147. },
  148. chooseTime(type) {
  149. this.type = type
  150. this.$refs.calendar.open()
  151. },
  152. confirm({ fulldate }) {
  153. if (this.type == 0) {
  154. this.date[0] = fulldate
  155. } else if (this.type == 1) {
  156. this.date[1] = fulldate
  157. }
  158. },
  159. choosePicker() { // 点击选择商品
  160. this.$refs.Selector.show()
  161. },
  162. confirmActice({ defaultVal: [index] }) {
  163. this.choosedActie = index
  164. this.date[0] = this.activeList[index].start
  165. this.date[1] = this.activeList[index].end
  166. this.request()
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .order-sum {
  173. height: 100vh;
  174. padding-top: 22rpx;
  175. @include flex(column);
  176. background: #fff;
  177. .topTittle {
  178. width: 100%;
  179. padding: 0 24rpx;
  180. white-space: nowrap;
  181. text-overflow:ellipsis;
  182. overflow: hidden;
  183. font-size: 32rpx;
  184. font-family: PingFang SC-Bold, PingFang SC;
  185. font-weight: bold;
  186. color: #333333;
  187. }
  188. .topBox {
  189. width: 704rpx;
  190. height: 182rpx;
  191. margin: 26rpx auto 24rpx;
  192. background-image: url(../../static/img_new/bg.png);
  193. background-size:100% 100%;
  194. border-radius:16rpx 16rpx 16rpx 16rpx;//圆角四个角度
  195. padding: 0 50rpx;
  196. text {
  197. font-size: 32rpx;
  198. font-weight: 400;
  199. color: #fff;
  200. }
  201. .text {
  202. color: #fff;
  203. font-size: 32rpx;
  204. margin-top: 6rpx;
  205. }
  206. .spec {
  207. font-size: 56rpx;
  208. font-weight: bold;
  209. }
  210. }
  211. .middata {
  212. width: 100%;
  213. background: #FFFFFF;
  214. border-radius: 24rpx 24rpx 0px 0px;
  215. padding: 0 24rpx;
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. &_box {
  220. width: 340rpx;
  221. height: 156rpx;
  222. border-radius: 16rpx;
  223. display: flex;
  224. justify-content: center;
  225. align-items: center;
  226. flex-direction: column;
  227. text {
  228. font-size: 32rpx;
  229. font-weight: 400;
  230. color: #fff;
  231. }
  232. .text {
  233. color: #fff;
  234. font-size: 32rpx;
  235. }
  236. .spec {
  237. font-size: 48rpx;
  238. font-weight: bold;
  239. }
  240. }
  241. .left {
  242. background: linear-gradient(180deg, #5B50FF 0%, #8D3EFF 100%);
  243. }
  244. .right {
  245. background: linear-gradient(180deg, #3668FE 0%,#5291FE 100%);
  246. }
  247. }
  248. .data-detail {
  249. flex: 1;
  250. width: 100%;
  251. overflow-y: auto;
  252. margin-top: 24rpx;
  253. .type-detal {
  254. .bold {
  255. border: none !important;
  256. margin: 0 !important;
  257. background-color: #F8F8F8 !important;
  258. font-size: 30rpx !important;
  259. font-family: PingFang SC-Bold, PingFang SC;
  260. font-weight: bold !important;
  261. }
  262. .detail-item {
  263. border-bottom: 2rpx solid #EEEEEE;
  264. @include flex();
  265. height: 90rpx;
  266. background: #FFFFFF;
  267. margin-bottom: 1rpx;
  268. font-size: 32rpx;
  269. margin: 0 24rpx;
  270. > view {
  271. height: 100%;
  272. display: flex;
  273. flex: 1;
  274. @include flex();
  275. }
  276. }
  277. }
  278. }
  279. }
  280. </style>