index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <view class="page" :style="{'min-height':(h)+'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="#111"></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?typeTxt=待付款')">
  36. <text>{{merchantType==10?info.unPayNum:info.todayObligationOrders}}</text>
  37. <text>待支付</text>
  38. </view>
  39. <view @click="toHref('/pagesHouse/Mine/ordersList/index?typeTxt=待使用')">
  40. <text>{{merchantType==10?info.unUseNum:info.todayPendingOrders||0}}</text>
  41. <text>待使用</text>
  42. </view>
  43. <view @click="toHref('/pagesHouse/Mine/ordersList/index?typeTxt=已完成')">
  44. <text>{{merchantType==10?info.completeNum:info.todayFinishOrders||0}}</text>
  45. <text>已完成</text>
  46. </view>
  47. <view @click="toHref('/pagesHouse/Mine/ordersList/index?typeTxt=已取消')">
  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?typeTxt=退款售后')">
  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/Verification/record')" v-if="merchantType==10">
  62. <image :src="icons[1]"></image>
  63. <text>核销记录</text>
  64. </view>
  65. <view @click="toHref('/pagesHouse/Verification/recordCy')" v-if="merchantType==4">
  66. <image :src="icons[1]"></image>
  67. <text>核销记录</text>
  68. </view>
  69. <view @click="toHref('/pagesHouse/home/bill')">
  70. <image :src="icons[2]"></image>
  71. <text>交易账单</text>
  72. </view>
  73. <view @click="toHref('/pagesHouse/home/tj')">
  74. <image :src="icons[3]"></image>
  75. <text>数据统计</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="list">
  80. <view class="tit">
  81. <text>订单列表</text>
  82. <text>{{new Date().Format('yyyy-MM-dd')}}</text>
  83. <!-- <u-icon @click="more()" name="arrow-right" label="查看全部" labelPos="left" labelSize="13px"
  84. labelColor="#808080" color="#AAA"></u-icon> -->
  85. </view>
  86. <view class="li first">
  87. <text>订单信息</text>
  88. <text>销量</text>
  89. <text>成交金额</text>
  90. </view>
  91. <view class="li" v-for="(item,index) in list" :key="index">
  92. <view class="avatar">
  93. <image :src="merchantType==10?item.coverImg:item.productImg"></image>
  94. <text>{{merchantType==10?item.goodsName:item.productName}}</text>
  95. </view>
  96. <text>{{merchantType==10?item.countNum:item.num}}</text>
  97. <text>¥{{merchantType==10?item.sumNum:item.realityPay}}</text>
  98. </view>
  99. </view>
  100. <u-picker :show="shShow" :columns="nameList" @close="shShow=false" @cancel="shShow=false" @confirm="confirm"
  101. :immediateChange="true" itemHeight="88"></u-picker>
  102. <Tabbares :tabbarid="0" :value="0"></Tabbares>
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. data() {
  108. return {
  109. merchantName: uni.getStorageSync('merchantName'),
  110. emg: 'https://i.ringzle.com/file/20240224/91173dde1cb44b139129e12ad4971f1d.png',
  111. icons: ['https://i.ringzle.com/file/20240316/cb736aa1ebea42b68f73a0532bac1875.png',
  112. 'https://i.ringzle.com/file/20240224/70ab9f9d1a144c95927dedc6e84bcce7.png',
  113. 'https://i.ringzle.com/file/20240224/3f990c250f444ac9a5d9f334f322c98e.png',
  114. 'https://i.ringzle.com/file/20240224/7ca1bfa6e348438e83edc5af0589f847.png'
  115. ],
  116. info: {},
  117. list: [],
  118. nameList: [],
  119. shShow: false,
  120. shList: [],
  121. name: '',
  122. merchantType: '',
  123. }
  124. },
  125. onLoad(opt) {
  126. this.merchantType = uni.getStorageSync('merchantType');
  127. if (this.merchantType == 10) {
  128. this.getData();
  129. this.getList();
  130. } else {
  131. this.getData2();
  132. this.getList2();
  133. }
  134. this.getType()
  135. },
  136. methods: {
  137. getType() {
  138. this.$api.post('/merchant/register/getMerchantStoreList').then(res => {
  139. if (res.data.code === 0) {
  140. this.shList = res.data.data;
  141. let shs = [];
  142. this.shList.forEach(d => shs.push(d.merchantName));
  143. this.nameList = [shs];
  144. let id = uni.getStorageSync('homestayId');
  145. if (!uni.getStorageSync('homestayId')) id = uni.getStorageSync('merchantId');
  146. let t = this.shList.find(d => d.merchantId == id);
  147. this.name = t ? t.merchantName : ''
  148. } else this.$showToast(res.data.msg);
  149. })
  150. },
  151. confirm(e) {
  152. this.name = e.value[0];
  153. this.shShow = false;
  154. let t = this.shList.find(d => d.merchantName == this.name);
  155. if (t) {
  156. this.merchantType = t.merchantType;
  157. uni.setStorageSync('merchantType', t.merchantType);
  158. if (t.merchantType != 2) { //酒店民宿
  159. uni.setStorageSync('homestayId', '');
  160. uni.setStorageSync('merchantId', t.merchantId);
  161. this.list = [];
  162. if (t.merchantType == 10) {
  163. this.getData();
  164. this.getList();
  165. } else {
  166. this.getData2();
  167. this.getList2();
  168. }
  169. } else {
  170. this.item = null;
  171. this.list = [];
  172. uni.setStorageSync('homestayId', t.merchantId);
  173. uni.setStorageSync('merchantId', '');
  174. uni.reLaunch({
  175. url: '/pages/home/index'
  176. })
  177. }
  178. }
  179. },
  180. //渔家乐统计
  181. getData() {
  182. this.$api.get('/merchant/fishering/merchantHomePageMoneyOrderCount/' + uni.getStorageSync(
  183. 'merchantId')).then(res => {
  184. console.log(res.data);
  185. if (res.data.code === 0) {
  186. this.info = res.data.data;
  187. }
  188. })
  189. },
  190. getList() {
  191. this.$api.get('/merchant/fishering/merchantHomePageGoodsList', {
  192. page: -1,
  193. limit: 10,
  194. merchandId: uni.getStorageSync('merchantId')
  195. }).then(res => {
  196. if (res.data.code === 0) {
  197. this.list = res.data.data.list;
  198. }
  199. })
  200. },
  201. //餐饮美食统计
  202. getData2() {
  203. this.$api.get('/api/merchant/food/getMerchantFoodAppHome/' + uni.getStorageSync(
  204. 'merchantId')).then(res => {
  205. console.log(res.data);
  206. if (res.data.code === 0) {
  207. this.info = res.data.data;
  208. }
  209. })
  210. },
  211. getList2() {
  212. this.$api.post('/api/merchant/food/getMerchantFoodOrderList', {
  213. dateTime: new Date().Format('yyyy-MM-dd'),
  214. merchantId: uni.getStorageSync('merchantId')
  215. }).then(res => {
  216. if (res.data.code === 0) {
  217. this.list = res.data.data;
  218. }
  219. })
  220. },
  221. toHref(url) {
  222. uni.navigateTo({
  223. url: url
  224. })
  225. },
  226. more() {
  227. uni.navigateTo({
  228. url: "/pagesHouse/home/orderList"
  229. })
  230. }
  231. }
  232. }
  233. </script>
  234. <style lang="less" scoped>
  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. margin-right: 10rpx;
  392. }
  393. }
  394. </style>