index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <view class="page" :style="{'min-height':(h-th)+'px'}">
  3. <u-navbar bgColor="transparent">
  4. <view class="u-nav-slot" slot="left" style="display: flex;" @tap="shShow=true">
  5. <text>{{name}}</text>
  6. <u-icon name="arrow-down" size="28" :bold="true" color="#fff"></u-icon>
  7. </view>
  8. </u-navbar>
  9. <u-picker :show="shShow" :columns="nameList" @close="shShow=false" @cancel="shShow=false" @confirm="confirm"
  10. :immediateChange="true" itemHeight="88"></u-picker>
  11. <view class="bg" :style="{'padding-top':(mt+10)+'px'}">
  12. <view class="dataBox">
  13. <view class="item">
  14. <view>成交金额</view>
  15. <view>¥<text>{{merchantType==10?info.numMoneyToday:info.todayOrderAmount}}</text></view>
  16. <view>昨日¥{{merchantType==10?info.numMoneyYesterday:info.yesterdayOrderAmount}}</view>
  17. </view>
  18. <view class="item">
  19. <view>退款金额</view>
  20. <view>¥<text>{{merchantType==10?info.numRefundMoneyToday:info.todayRefundAmount}}</text></view>
  21. <view>昨日¥{{merchantType==10?info.numRefundMoneyYesterday:info.yesterdayRefundAmount}}</view>
  22. </view>
  23. <view class="item">
  24. <view>成交订单数</view>
  25. <view>¥<text>{{merchantType==10?info.numOrderToday:info.todayOrders}}</text></view>
  26. <view>昨日{{merchantType==10?info.numOrderYesterday:info.yesterdayOrders}}</view>
  27. </view>
  28. <view class="item">
  29. <view>退款订单数</view>
  30. <view>¥<text>{{merchantType==10?info.numRefundOrderToday:info.todayRefundOrders}}</text></view>
  31. <view>昨日{{merchantType==10?info.numRefundOrderYesterday:info.yesterdayRefundOrders}}</view>
  32. </view>
  33. </view>
  34. <view class="numberData">
  35. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=0')">
  36. <text>{{merchantType==10?info.unPayNum:info.todayObligationOrders}}</text>
  37. <text>待付款</text>
  38. </view>
  39. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=4')">
  40. <text>{{merchantType==10?info.unUseNum:info.todayPendingOrders||0}}</text>
  41. <text>待使用</text>
  42. </view>
  43. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=3')">
  44. <text>{{merchantType==10?info.completeNum:info.todayOrders||0}}</text>
  45. <text>已完成</text>
  46. </view>
  47. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=-1')">
  48. <text>{{merchantType==10?info.joinNum:info.todayCancelledOrders||0}}</text>
  49. <text>{{merchantType==10?'拼团中':'已取消'}}</text>
  50. </view>
  51. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=-3')">
  52. <text>{{merchantType==10?info. refundNum:info.todayRefundOrders||0}}</text>
  53. <text>退款售后</text>
  54. </view>
  55. </view>
  56. <view class="menus">
  57. <view @click="toHref('/pagesHouse/HotelMerchandise/index')">
  58. <image :src="icons[0]"></image>
  59. <text>商品管理</text>
  60. </view>
  61. <view @click="toHref('/pagesHouse/home/bill')">
  62. <image :src="icons[1]"></image>
  63. <text>交易账单</text>
  64. </view>
  65. <view @click="toHref('/pagesHouse/home/moneyBill')">
  66. <image :src="icons[2]"></image>
  67. <text>资金账单</text>
  68. </view>
  69. <view @click="toHref('/pagesHouse/home/tj')">
  70. <image :src="icons[3]"></image>
  71. <text>数据统计</text>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="list">
  76. <view class="tit">
  77. <text>订单列表</text>
  78. <text>{{new Date().Format('yyyy-MM-dd')}}</text>
  79. <!-- <u-icon @click="more()" name="arrow-right" label="查看全部" labelPos="left" labelSize="13px"
  80. labelColor="#808080" color="#AAA"></u-icon> -->
  81. </view>
  82. <view class="li first">
  83. <text>订单信息</text>
  84. <text>销量</text>
  85. <text>成交金额</text>
  86. </view>
  87. <view class="li" v-for="(item,index) in list" :key="index">
  88. <view class="avatar">
  89. <image :src="merchantType==10?item.coverImg:item.productImg"></image>
  90. <text>{{merchantType==10?item.goodsName:item.productName}}</text>
  91. </view>
  92. <text>{{merchantType==10?item.countNum:item.num}}</text>
  93. <text>¥{{merchantType==10?item.sumNum:item.realityPay}}</text>
  94. </view>
  95. </view>
  96. <u-picker :show="shShow" :columns="nameList" @close="shShow=false" @cancel="shShow=false" @confirm="confirm"
  97. :immediateChange="true" itemHeight="88"></u-picker>
  98. <Tabbares :tabbarid="0"></Tabbares>
  99. </view>
  100. </template>
  101. <script>
  102. export default {
  103. data() {
  104. return {
  105. merchantName: uni.getStorageSync('merchantName'),
  106. emg: 'https://i.ringzle.com/file/20240224/91173dde1cb44b139129e12ad4971f1d.png',
  107. icons: ['https://i.ringzle.com/file/20240316/cb736aa1ebea42b68f73a0532bac1875.png',
  108. 'https://i.ringzle.com/file/20240224/70ab9f9d1a144c95927dedc6e84bcce7.png',
  109. 'https://i.ringzle.com/file/20240224/3f990c250f444ac9a5d9f334f322c98e.png',
  110. 'https://i.ringzle.com/file/20240224/7ca1bfa6e348438e83edc5af0589f847.png'
  111. ],
  112. info: {},
  113. list: [],
  114. nameList: [],
  115. shShow: false,
  116. shList: [],
  117. name: '',
  118. merchantType:'',
  119. }
  120. },
  121. onLoad(opt) {
  122. this.merchantType=uni.getStorageSync('merchantType');
  123. if(this.merchantType==10){
  124. this.getData();
  125. this.getList();
  126. }else{
  127. this.getData2();
  128. this.getList2();
  129. }
  130. this.getType()
  131. },
  132. methods: {
  133. getType() {
  134. this.$api.post('/merchant/register/getMerchantStoreList').then(res => {
  135. if (res.data.code === 0) {
  136. this.shList = res.data.data;
  137. let shs = [];
  138. this.shList.forEach(d => shs.push(d.merchantName));
  139. this.nameList = [shs];
  140. let id = uni.getStorageSync('homestayId');
  141. if (!uni.getStorageSync('homestayId')) id = uni.getStorageSync('merchantId');
  142. let t = this.shList.find(d => d.merchantId == id);
  143. this.name = t ? t.merchantName : ''
  144. } else this.$showToast(res.data.msg);
  145. })
  146. },
  147. confirm(e) {
  148. this.name = e.value[0];
  149. this.shShow = false;
  150. let t = this.shList.find(d => d.merchantName == this.name);
  151. if (t) {
  152. this.merchantType=4;
  153. uni.setStorageSync('merchantType',t.merchantType);
  154. if (t.merchantType != 2) { //酒店民宿
  155. uni.setStorageSync('homestayId', '');
  156. uni.setStorageSync('merchantId', t.merchantId);
  157. this.list = [];
  158. if(t.merchantType==10){
  159. this.getData();
  160. this.getList();
  161. }else{
  162. this.getData2();
  163. this.getList2();
  164. }
  165. } else {
  166. this.item = null;
  167. this.list = [];
  168. uni.setStorageSync('homestayId', t.merchantId);
  169. uni.setStorageSync('merchantId', '');
  170. uni.navigateTo({
  171. url: '/pages/home/index'
  172. })
  173. }
  174. }
  175. },
  176. //渔家乐统计
  177. getData() {
  178. this.$api.get('/merchant/fishering/merchantHomePageMoneyOrderCount/' + uni.getStorageSync(
  179. 'merchantId')).then(res => {
  180. console.log(res.data);
  181. if (res.data.code === 0) {
  182. this.info = res.data.data;
  183. }
  184. })
  185. },
  186. getList() {
  187. this.$api.get('/merchant/fishering/merchantHomePageGoodsList', {
  188. page: -1,
  189. limit:10,
  190. merchandId: uni.getStorageSync('merchantId')
  191. }).then(res => {
  192. if (res.data.code === 0) {
  193. this.list = res.data.data.list;
  194. }
  195. })
  196. },
  197. //餐饮美食统计
  198. getData2() {
  199. this.$api.get('/api/merchant/food/getMerchantFoodAppHome/' + uni.getStorageSync(
  200. 'merchantId')).then(res => {
  201. console.log(res.data);
  202. if (res.data.code === 0) {
  203. this.info = res.data.data;
  204. }
  205. })
  206. },
  207. getList2() {
  208. this.$api.post('/api/merchant/food/getMerchantFoodOrderList', {
  209. dateTime: new Date().Format('yyyy-MM-dd'),
  210. merchantId: uni.getStorageSync('merchantId')
  211. }).then(res => {
  212. if (res.data.code === 0) {
  213. this.list = res.data.data;
  214. }
  215. })
  216. },
  217. toHref(url) {
  218. uni.redirectTo({
  219. url: url
  220. })
  221. },
  222. more() {
  223. uni.navigateTo({
  224. url: "/pagesHouse/home/orderList"
  225. })
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="less" scoped>
  231. /deep/ .u-nav-slot {
  232. width: auto!important;
  233. background-color: none!important;
  234. }
  235. .page {
  236. background: #F3F4F4;
  237. padding-bottom: 40rpx;
  238. box-sizing: border-box;
  239. width: 100%;
  240. overflow-x: hidden;
  241. .list {
  242. width: calc(100% - 36rpx);
  243. margin: 20rpx auto;
  244. padding: 0 20rpx 6rpx;
  245. background-color: #fff;
  246. border-radius: 24rpx;
  247. box-sizing: border-box;
  248. .tit {
  249. padding: 40rpx 0;
  250. display: flex;
  251. justify-content: space-between;
  252. align-items: center;
  253. text {
  254. &:first-child {
  255. font-size: 32rpx;
  256. color: #111;
  257. font-weight: bold;
  258. }
  259. &:nth-child(2) {
  260. margin-left: 17rpx;
  261. color: #666666;
  262. width: 100px;
  263. flex: 1;
  264. }
  265. }
  266. }
  267. .li {
  268. display: grid;
  269. grid-template-columns: 60% 20% 20%;
  270. align-items: center;
  271. margin-bottom: 24rpx;
  272. text {
  273. color: #333;
  274. font-size: 26rpx;
  275. }
  276. .avatar {
  277. display: flex;
  278. align-items: center;
  279. image {
  280. width: 90rpx;
  281. min-width: 90rpx;
  282. height: 90rpx;
  283. margin-right: 20rpx;
  284. border-radius: 9rpx;
  285. }
  286. text {
  287. width: 100px;
  288. word-break: break-all;
  289. text-overflow: ellipsis;
  290. display: -webkit-box;
  291. -webkit-box-orient: vertical;
  292. -webkit-line-clamp: 2;
  293. font-size: 24rpx;
  294. line-height: 33rpx;
  295. /* 这里是超出几行省略 */
  296. overflow: hidden;
  297. }
  298. }
  299. &.first {
  300. margin-bottom: 30rpx;
  301. text {
  302. color: #666;
  303. }
  304. }
  305. }
  306. }
  307. .bg {
  308. width: 100%;
  309. height: auto;
  310. padding: 0 18rpx;
  311. background: url(https://i.ringzle.com/file/20240224/343febca7aa149c5aa0ee8c9365b2d3e.png) no-repeat;
  312. background-size: 100% 100%;
  313. box-sizing: border-box;
  314. .menus {
  315. display: flex;
  316. justify-content: space-around;
  317. height: 184rpx;
  318. border-radius: 24rpx;
  319. background-color: #fff;
  320. color: #333;
  321. align-items: center;
  322. &>view {
  323. image {
  324. width: 64rpx;
  325. height: 64rpx;
  326. display: block;
  327. margin: 0 auto 22rpx;
  328. }
  329. text {
  330. font-size: 26rpx;
  331. }
  332. }
  333. }
  334. .numberData {
  335. display: flex;
  336. justify-content: space-around;
  337. height: 150rpx;
  338. border-radius: 24rpx;
  339. background-color: #007A69;
  340. color: #fff;
  341. align-items: center;
  342. margin: 20rpx 0;
  343. &>view {
  344. text {
  345. display: block;
  346. text-align: center;
  347. font-size: 26rpx;
  348. color: #F0F8F6;
  349. &:first-child {
  350. font-size: 36rpx;
  351. color: #fff;
  352. margin-bottom: 20rpx;
  353. }
  354. }
  355. }
  356. }
  357. .dataBox {
  358. display: grid;
  359. /* 宽度平均分成4份 */
  360. grid-template-columns: repeat(2, 1fr);
  361. /* 高度平均分成3份 */
  362. grid-template-rows: repeat(2, 1fr);
  363. gap: 14rpx;
  364. .item {
  365. width: 340rpx;
  366. height: 180rpx;
  367. padding: 24rpx 0 0 26rpx;
  368. border-radius: 16rpx;
  369. background-color: rgba(255, 255, 255, .48);
  370. color: #777;
  371. &>view:nth-child(2) {
  372. color: #111;
  373. text {
  374. font-size: 36rpx;
  375. display: inline-block;
  376. margin: 12rpx 0;
  377. font-weight: bold;
  378. margin-left: -4rpx;
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. /deep/.u-nav-slot {
  386. &>text {
  387. font-size: 36rpx;
  388. font-family: PingFang SC, PingFang SC;
  389. font-weight: bold;
  390. color: #333;
  391. }
  392. }
  393. </style>