多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

341 lines
11 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view>
  3. <global-loading/>
  4. <view v-if="ifShow">
  5. <view class="totalAward-topBackImg flex-items flex-column">
  6. <view class="totalAward-content flex-column font-color-FFF">
  7. <view class="flex-column-plus flex-items mar-top-40">
  8. <label class="mar-top-20 fs60 amount">{{ ZSalesOrderData.total }}</label>
  9. </view>
  10. <view class="flex-row-plus flex-sp-around fs24 mar-top-10">
  11. <view class="awardBox">
  12. <view class="fs36 font-color-FFF">{{ ZSalesOrderData.directPrice }}</view>
  13. <view class="awardTit font-color-FFF">直接奖励(</view>
  14. </view>
  15. <view class="awardBox">
  16. <view class="fs36 font-color-FFF">{{ ZSalesOrderData.indirectPrice }}</view>
  17. <view class="awardTit font-color-FFF">间接奖励(</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="awardType-box flex-center">
  23. <view class="awardType-content">
  24. <u-tabs :list="awardTypeList" bar-width="60" :bold="false" active-color="#C5AA7B" inactive-color="#999999"
  25. :is-scroll="false" :current="awardTypeFlag" @change="awardTypeActive"></u-tabs>
  26. </view>
  27. </view>
  28. <view v-if="awardTypeFlag == 0">
  29. <view v-if="ZStotallength>0">
  30. <view class="flex-center" v-for="(item, index) in ZSalesOrderDatalist" :key="index">
  31. <view class="directAward-box font-color-656 fs26" @click="arrowTypeChange1(index)">
  32. <view style="display: flex;" class="directAwardInfo">
  33. <view style="flex: 1;" class="flex-items flex-sp-between">
  34. <label class="orderId-box font-color-999">{{$t('common.orderno')}}{{ item.orderFormid }}</label>
  35. <view class="mar-right-50 font-color-999">
  36. 佣金<label class="font-color-C5AA7B">¥{{ item.commission }}</label>
  37. </view>
  38. </view>
  39. <view>
  40. <image v-if="item.ifOpen == false" class="arrow-down"
  41. src="https://ceres.zkthink.com/static/images/arrowDownIcon.png"></image>
  42. <image v-if="item.ifOpen == true" class="arrow-down"
  43. src="https://ceres.zkthink.com/static/images/arrowUpIcon.png"></image>
  44. </view>
  45. </view>
  46. <view v-if="item.ifOpen == true">
  47. <view class="flex-row-plus flex-items flex-sp-between mar-top-30">
  48. <label class="orderId-box font-color-999">{{$t('common.productnum')}}{{ item.products }}</label>
  49. <label class="commission-box mar-left-70 font-color-999">{{$t('Synthesis')}}¥{{ item.price }}</label>
  50. </view>
  51. <view class="flex-row-plus flex-items flex-sp-between mar-top-30">
  52. <label class="orderId-box font-color-999">{{$t('common.buyer')}}{{ item.customerName }}</label>
  53. <label class="commission-box mar-left-70">{{$t('common.status')}}
  54. <text class="state" :class="{current: item.state==0}">{{ item.state == 1 ? $t('common.unsettled') : $t('common.settled') }}
  55. </text>
  56. </label>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view v-else class="emptyCart-box flex-items-plus flex-column">
  63. <image class="emptyCart-img" src="https://ceres.zkthink.com/static/img/bgnull.png"></image>
  64. <label class="font-color-999 fs26 mar-top-30">{{$t('client.emptydata')}}</label>
  65. </view>
  66. </view>
  67. <view v-if="awardTypeFlag == 1">
  68. <view v-if="JStotallength>0">
  69. <view class="flex-center" v-for="(item,index) in JSalesOrderDatalist" :key="index">
  70. <view class="directAward-box font-color-656 fs26" @click="arrowTypeChange(index)">
  71. <view style="display: flex;" class="directAwardInfo">
  72. <view style="flex: 1;" class="flex-items flex-sp-between">
  73. <label class="orderId-box font-color-999">{{$t('common.orderno')}}{{ item.orderFormid }}</label>
  74. <view class="mar-right-50 font-color-999">
  75. 佣金<label class="font-color-C5AA7B">¥{{ item.commission }}</label>
  76. </view>
  77. </view>
  78. <view>
  79. <image v-if="item.ifOpen == false" class="arrow-down"
  80. src="https://ceres.zkthink.com/static/images/arrowDownIcon.png"></image>
  81. <image v-if="item.ifOpen == true" class="arrow-down"
  82. src="https://ceres.zkthink.com/static/images/arrowUpIcon.png"></image>
  83. </view>
  84. </view>
  85. <view v-if="item.ifOpen == true">
  86. <view class="flex-row-plus flex-items flex-sp-between mar-top-30">
  87. <label class="orderId-box font-color-999">{{$t('common.productnum')}}{{ item.products }}</label>
  88. <label class="commission-box mar-left-70 font-color-999">{{$t('Synthesis')}}¥{{ item.price }}</label>
  89. </view>
  90. <view class="flex-row-plus flex-items flex-sp-between mar-top-30">
  91. <label class="orderId-box font-color-999">{{$t('common.buyer')}}{{ item.customerName }}</label>
  92. <label class="commission-box mar-left-70">{{$t('common.status')}}
  93. <text class="state" :class="{current: item.state==0}">{{ item.state == 0 ? $t('common.unsettled') : $t('common.settled') }}
  94. </text>
  95. </label>
  96. </view>
  97. <view class="flex-row-plus flex-items mar-top-30">
  98. <label class="orderId-box font-color-999">{{$t('common.distributor')}}{{ item.distributorName }}</label>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <view v-else class="emptyCart-box flex-items-plus flex-column">
  105. <image class="emptyCart-img" src="https://ceres.zkthink.com/static/img/bgnull.png"></image>
  106. <label class="font-color-999 fs26 mar-top-30">{{$t('client.emptydata')}}</label>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </template>
  112. <script>
  113. const NET = require('../../utils/request')
  114. const API = require('../../config/api')
  115. export default {
  116. data() {
  117. return {
  118. awardTypeList: [{
  119. name: '直接奖励'
  120. }, {
  121. name: '间接奖励'
  122. }],
  123. awardTypeFlag: 0,
  124. item: {},
  125. SalesOrderQuery: {
  126. model: {
  127. tenantCode: '',
  128. type: ''
  129. },
  130. current: 0,
  131. size: 10
  132. },
  133. SalesOrderData: [],
  134. ZSalesOrderData: [],
  135. JSalesOrderData: [],
  136. shopId: 0,
  137. distributorId: 0,
  138. tenantCode: {},
  139. ZStotallength: 0,
  140. JStotallength: 0,
  141. page: 1,
  142. pageSize: 20,
  143. loadingType: 0,
  144. loadingType1: 0,
  145. ZSalesOrderDatalist: [],
  146. JSalesOrderDatalist: [],
  147. ifShow: false,
  148. ifEmpty: false
  149. }
  150. },
  151. onLoad: function (optins) {
  152. this.shopId = optins.shopId
  153. this.distributorId = optins.distributorId
  154. this.getZSalesOrderData()
  155. this.getJSalesOrderData()
  156. },
  157. onReachBottom() {
  158. if (this.awardTypeFlag == 0) {
  159. if (this.loadingType == 1) {
  160. uni.stopPullDownRefresh()
  161. } else {
  162. this.page = this.page + 1
  163. this.getZSalesOrderData()
  164. }
  165. } else {
  166. if (this.loadingType1 == 1) {
  167. uni.stopPullDownRefresh()
  168. } else {
  169. this.page = this.page + 1
  170. this.getJSalesOrderData()
  171. }
  172. }
  173. },
  174. methods: {
  175. getZSalesOrderData() {
  176. // uni.showLoading({
  177. // mask: true,
  178. // title: '加载中...'
  179. // })
  180. NET.request(API.FindSalesOrderPage, {
  181. shopId: this.shopId,
  182. distributorId: this.distributorId,
  183. type: 1,
  184. page: this.page,
  185. pageSize: this.pageSize
  186. }, 'GET').then(res => {
  187. uni.hideLoading()
  188. if (res.data.page.list.length == 0) {
  189. this.loadingType = 1
  190. this.page = this.page
  191. }
  192. this.ZSalesOrderDatalist = this.ZSalesOrderDatalist.concat(res.data.page.list)
  193. this.ZSalesOrderData = res.data
  194. this.ZStotallength = this.ZSalesOrderData.page.total
  195. this.ifShow = true
  196. }).catch(res => {
  197. uni.hideLoading()
  198. })
  199. },
  200. getJSalesOrderData() {
  201. // uni.showLoading({
  202. // mask: true,
  203. // title: '加载中...'
  204. // })
  205. NET.request(API.FindSalesOrderPage, {
  206. shopId: this.shopId,
  207. distributorId: this.distributorId,
  208. type: 2,
  209. page: this.page,
  210. pageSize: this.pageSize
  211. }, 'GET').then(res => {
  212. uni.hideLoading()
  213. if (res.data.page.list.length == 0) {
  214. this.loadingType1 = 1
  215. uni.showToast({
  216. title: '已加载全部···',
  217. duration: 2000,
  218. icon: 'none'
  219. });
  220. this.page = this.page
  221. }
  222. this.JSalesOrderDatalist = this.JSalesOrderDatalist.concat(res.data.page.list)
  223. this.JSalesOrderData = res.data
  224. this.JStotallength = this.JSalesOrderData.page.total
  225. }).catch(res => {
  226. uni.hideLoading()
  227. })
  228. },
  229. awardTypeActive(index) {
  230. this.awardTypeFlag = index
  231. this.page = 1
  232. },
  233. arrowTypeChange1(arrowTypeId) {
  234. this.ZSalesOrderData.page.list[arrowTypeId].ifOpen = this.ZSalesOrderData.page.list[arrowTypeId].ifOpen == false ? true : false
  235. },
  236. arrowTypeChange(arrowTypeId) {
  237. this.JSalesOrderData.page.list[arrowTypeId].ifOpen = this.JSalesOrderData.page.list[arrowTypeId].ifOpen == false ? true : false
  238. }
  239. }
  240. }
  241. </script>
  242. <style lang="scss">
  243. page {
  244. background: #333333;
  245. }
  246. .emptyCart-box {
  247. margin-top: 70 upx;
  248. .emptyCart-img {
  249. width: 216 rpx;
  250. height: 156 rpx;
  251. }
  252. }
  253. .totalAward-topBackImg {
  254. width: 100%;
  255. height: 360 rpx;
  256. background: url(https://ceres.zkthink.com/static/images/unliquidatedBg.png) no-repeat;
  257. background-size: 100%;
  258. margin-top: 30 rpx;
  259. .totalAward-content {
  260. width: 90%;
  261. .awardBox {
  262. text-align: center;
  263. .awardTit {
  264. opacity: 0.7;
  265. }
  266. }
  267. .amount {
  268. color: #FFEBC4;
  269. }
  270. }
  271. }
  272. .awardType-box {
  273. border-bottom: 1 upx solid #666666;
  274. .awardType-content {
  275. height: 80 upx;
  276. width: 500 upx;
  277. }
  278. }
  279. .directAward-box {
  280. width: 94%;
  281. border-bottom: 1 upx solid #666666;
  282. padding: 30 upx;
  283. display: flex;
  284. justify-content: flex-start;
  285. flex-direction: column;
  286. background: #FFFFFF;
  287. margin-top: 30 rpx;
  288. .orderId-box {
  289. display: flex;
  290. justify-content: flex-start;
  291. flex-direction: row;
  292. }
  293. .state {
  294. color: #16BB89;
  295. }
  296. .current {
  297. color: #C83732 !important;
  298. }
  299. .arrow-down {
  300. width: 24 upx;
  301. height: 24 upx;
  302. }
  303. .directAwardInfo {
  304. }
  305. }
  306. .totalAwardEmpty-box {
  307. margin-top: 65 upx;
  308. .totalAwardEmpty {
  309. width: 270 upx;
  310. height: 270 upx;
  311. }
  312. }
  313. </style>
  314. <style scoped>
  315. .awardType-box /deep/ .u-tabs {
  316. background: none !important;
  317. }
  318. </style>