order-sum.vue 8.1 KB

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