index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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" v-if="merchantType!=10">
  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" v-if="merchantType==10">
  57. <!-- <view v-if="merchantType==10" @click="toHref('/pagesHouse/home/boatList')">
  58. <image src="https://cdn.szhd.ycurm.top/island/20250703/595092c7af054d45a56aae6f3c2f6200.png"></image>
  59. <text>船只管理</text>
  60. </view> -->
  61. <!-- <view @click="toHref('/pagesHouse/HotelMerchandise/index')">
  62. <image :src="icons[0]"></image>
  63. <text>商品管理</text>
  64. </view> -->
  65. <view @click="toHref('/pagesHouse/Verification/record')" v-if="merchantType==10">
  66. <image :src="icons[1]" style="width: 86rpx;height: 86rpx;"></image>
  67. <text style="font-size: 36rpx;font-weight:500;">核销记录</text>
  68. </view>
  69. <!-- <view @click="toHref('/pagesHouse/Verification/recordCy')" v-if="merchantType==4">
  70. <image :src="icons[1]"></image>
  71. <text>核销记录</text>
  72. </view> -->
  73. <view @click="toHref('/pagesHouse/home/bill')">
  74. <image :src="icons[2]" style="width: 86rpx;height: 86rpx;"></image>
  75. <text style="font-size: 36rpx;font-weight:500;">交易账单</text>
  76. </view>
  77. <!-- <view @click="toHref('/pagesHouse/home/tj')">
  78. <image :src="icons[3]"></image>
  79. <text>数据统计</text>
  80. </view> -->
  81. </view>
  82. <view class="menus" v-else>
  83. <view v-if="merchantType==10" @click="toHref('/pagesHouse/home/boatList')">
  84. <image src="https://cdn.szhd.ycurm.top/island/20250703/595092c7af054d45a56aae6f3c2f6200.png">
  85. </image>
  86. <text>船只管理</text>
  87. </view>
  88. <view @click="toHref('/pagesHouse/HotelMerchandise/index')">
  89. <image :src="icons[0]"></image>
  90. <text>商品管理</text>
  91. </view>
  92. <view @click="toHref('/pagesHouse/Verification/record')" v-if="merchantType==10">
  93. <image :src="icons[1]"></image>
  94. <text>核销记录</text>
  95. </view>
  96. <view @click="toHref('/pagesHouse/Verification/recordCy')" v-if="merchantType==4">
  97. <image :src="icons[1]"></image>
  98. <text>核销记录</text>
  99. </view>
  100. <view @click="toHref('/pagesHouse/Verification/recordCoupon')" v-if="merchantType==12">
  101. <image :src="icons[1]"></image>
  102. <text>核销记录</text>
  103. </view>
  104. <view @click="toHref('/pagesHouse/home/bill')">
  105. <image :src="icons[2]"></image>
  106. <text>交易账单</text>
  107. </view>
  108. <view @click="toHref('/pagesHouse/home/checkStatistics')" v-if="merchantType==12">
  109. <image :src="icons[3]"></image>
  110. <text>核销统计</text>
  111. </view>
  112. <view @click="toHref('/pagesHouse/home/tj')" v-else>
  113. <image :src="icons[3]"></image>
  114. <text>数据统计</text>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="list" v-if="merchantType==10" style="background: transparent;">
  119. <view class="tit">
  120. <text style="font-size: 36rpx;">船只列表</text>
  121. <!-- <u-icon @click="more()" name="arrow-right" label="查看全部" labelPos="left" labelSize="13px"
  122. labelColor="#808080" color="#AAA"></u-icon> -->
  123. </view>
  124. <view style="display: flex;flex-wrap: wrap;justify-content: space-between;">
  125. <view class="li" v-for="(item,index) in shopList" :key="index"
  126. style="width: 326rpx;background-color: #fff;border-radius:10rpx;padding: 15rpx 30rpx;box-sizing: border-box;display: block;position: relative;">
  127. <div style="display: flex;align-items: flex-start;">
  128. <text style="font-size: 36rpx;width: 65%;display: inline-block;">{{item.boatNo}}</text>
  129. <text style="width: 35%;display: inline-block;">
  130. <text v-if="item.sailFlag==0" style="color: #3475C4;font-size: 30rpx;">在港</text>
  131. <text v-if="item.sailFlag==1" style="color: #859208;font-size: 30rpx;">已出航</text>
  132. </text>
  133. </div>
  134. <div style="margin-top: 20rpx;display: flex;justify-content: space-between">
  135. <text style="font-size: 32rpx;">{{item.touristDataList.length}}人</text>
  136. <text @click="back(item.boatNo)" v-if="item.sailFlag==1" style="border-radius: 4rpx;background: #6143FF;font-size: 23rpx;padding:4rpx 27rpx;color: #fff;">回港</text>
  137. </div>
  138. </view>
  139. </view>
  140. <view style="text-align: center;font-size: 30rpx;color:#777777">{{new Date().Format('yyyy-MM-dd')}}</view>
  141. </view>
  142. <view class="list" v-else-if="merchantType!=12" >
  143. <view class="tit">
  144. <text>订单列表</text>
  145. <text>{{new Date().Format('yyyy-MM-dd')}}</text>
  146. <!-- <u-icon @click="more()" name="arrow-right" label="查看全部" labelPos="left" labelSize="13px"
  147. labelColor="#808080" color="#AAA"></u-icon> -->
  148. </view>
  149. <view class="li first">
  150. <text>订单信息</text>
  151. <text>销量</text>
  152. <text>成交金额</text>
  153. </view>
  154. <view class="li" v-for="(item,index) in list" :key="index">
  155. <view class="avatar">
  156. <image :src="merchantType==10?item.coverImg:item.productImg"></image>
  157. <text>{{merchantType==10?item.goodsName:item.productName}}</text>
  158. </view>
  159. <text>{{merchantType==10?item.countNum:item.num}}</text>
  160. <text>¥{{merchantType==10?item.sumNum:item.realityPay}}</text>
  161. </view>
  162. </view>
  163. <u-picker :show="shShow" :columns="nameList" @close="shShow=false" @cancel="shShow=false" @confirm="confirm"
  164. :immediateChange="true" itemHeight="88"></u-picker>
  165. <Tabbares :tabbarid="0" :value="0"></Tabbares>
  166. </view>
  167. </template>
  168. <script>
  169. export default {
  170. data() {
  171. return {
  172. merchantName: uni.getStorageSync('merchantName'),
  173. emg: 'https://fsy.shengsi.gov.cn/file/20240224/91173dde1cb44b139129e12ad4971f1d.png',
  174. icons: ['https://fsy.shengsi.gov.cn/file/20240316/cb736aa1ebea42b68f73a0532bac1875.png',
  175. 'https://fsy.shengsi.gov.cn/file/20240224/70ab9f9d1a144c95927dedc6e84bcce7.png',
  176. 'https://fsy.shengsi.gov.cn/file/20240224/3f990c250f444ac9a5d9f334f322c98e.png',
  177. 'https://fsy.shengsi.gov.cn/file/20240224/7ca1bfa6e348438e83edc5af0589f847.png'
  178. ],
  179. info: {},
  180. list: [],
  181. nameList: [],
  182. shShow: false,
  183. shList: [],
  184. name: '',
  185. merchantType: '',
  186. shopList: []
  187. }
  188. },
  189. onLoad(opt) {
  190. this.merchantType = uni.getStorageSync('merchantType');
  191. if (this.merchantType == 10) {
  192. this.getData();
  193. this.getShopList();
  194. } else {
  195. this.getData2();
  196. this.getList2();
  197. }
  198. this.getType()
  199. },
  200. methods: {
  201. back(no){
  202. this.$api.get(`/scenic/api/boat/boatSailBack/${uni.getStorageSync('merchantId')}/${no}`).then(res=>{
  203. if(res.data.code==0){
  204. if(res.data.msg == 'success'){
  205. this.getShopList()
  206. }
  207. }else{
  208. this.$showToast(res.data.msg)
  209. }
  210. })
  211. },
  212. getShopList() {
  213. this.$api.get('/scenic/api/boat/page?page=1&limit=999&merchantId=' + uni.getStorageSync('merchantId'))
  214. .then(res => {
  215. if (res.data.code == 0) {
  216. console.log(res)
  217. this.shopList = res.data.data.list;
  218. }
  219. })
  220. },
  221. getType() {
  222. this.$api.post('/merchant/register/getMerchantStoreList').then(res => {
  223. if (res.data.code === 0) {
  224. this.shList = res.data.data;
  225. let shs = [];
  226. this.shList.forEach(d => shs.push(d.merchantName));
  227. this.nameList = [shs];
  228. let id = uni.getStorageSync('homestayId');
  229. if (!uni.getStorageSync('homestayId')) id = uni.getStorageSync('merchantId');
  230. let t = this.shList.find(d => d.merchantId == id);
  231. this.name = t ? t.merchantName : ''
  232. } else this.$showToast(res.data.msg);
  233. })
  234. },
  235. confirm(e) {
  236. this.name = e.value[0];
  237. this.shShow = false;
  238. let t = this.shList.find(d => d.merchantName == this.name);
  239. if (t) {
  240. this.merchantType = t.merchantType;
  241. uni.setStorageSync('merchantType', t.merchantType);
  242. if (t.merchantType != 2) { //酒店民宿
  243. uni.setStorageSync('homestayId', '');
  244. uni.setStorageSync('merchantId', t.merchantId);
  245. this.list = [];
  246. if (t.merchantType == 10) {
  247. this.getData();
  248. this.getList();
  249. } else {
  250. this.getData2();
  251. this.getList2();
  252. }
  253. } else {
  254. this.item = null;
  255. this.list = [];
  256. uni.setStorageSync('homestayId', t.merchantId);
  257. uni.setStorageSync('merchantId', '');
  258. uni.reLaunch({
  259. url: '/pages/home/index'
  260. })
  261. }
  262. }
  263. },
  264. //渔家乐统计
  265. getData() {
  266. this.$api.get('/merchant/fishering/merchantHomePageMoneyOrderCount/' + uni.getStorageSync(
  267. 'merchantId')).then(res => {
  268. console.log(res.data);
  269. if (res.data.code === 0) {
  270. this.info = res.data.data;
  271. }
  272. })
  273. },
  274. getList() {
  275. this.$api.get('/merchant/fishering/merchantHomePageGoodsList', {
  276. page: -1,
  277. limit: 10,
  278. merchantId: uni.getStorageSync('merchantId')
  279. }).then(res => {
  280. if (res.data.code === 0) {
  281. this.list = res.data.data.list;
  282. }
  283. })
  284. },
  285. //餐饮美食统计
  286. getData2() {
  287. this.$api.get('/api/merchant/food/getMerchantFoodAppHome/' + uni.getStorageSync(
  288. 'merchantId')).then(res => {
  289. console.log(res.data);
  290. if (res.data.code === 0) {
  291. this.info = res.data.data;
  292. }
  293. })
  294. },
  295. getList2() {
  296. this.$api.post('/api/merchant/food/getMerchantFoodOrderList', {
  297. dateTime: new Date().Format('yyyy-MM-dd'),
  298. merchantId: uni.getStorageSync('merchantId')
  299. }).then(res => {
  300. if (res.data.code === 0) {
  301. this.list = res.data.data;
  302. }
  303. })
  304. },
  305. toHref(url) {
  306. uni.navigateTo({
  307. url: url
  308. })
  309. },
  310. more() {
  311. uni.navigateTo({
  312. url: "/pagesHouse/home/orderList"
  313. })
  314. }
  315. }
  316. }
  317. </script>
  318. <style lang="less" scoped>
  319. .page {
  320. background: #F3F4F4;
  321. padding-bottom: 40rpx;
  322. box-sizing: border-box;
  323. width: 100%;
  324. overflow-x: hidden;
  325. .list {
  326. width: calc(100% - 36rpx);
  327. margin: 20rpx auto;
  328. padding: 0 20rpx 6rpx;
  329. background-color: #fff;
  330. border-radius: 24rpx;
  331. box-sizing: border-box;
  332. .tit {
  333. padding: 40rpx 0;
  334. display: flex;
  335. justify-content: space-between;
  336. align-items: center;
  337. text {
  338. &:first-child {
  339. font-size: 32rpx;
  340. color: #111;
  341. font-weight: bold;
  342. }
  343. &:nth-child(2) {
  344. margin-left: 17rpx;
  345. color: #666666;
  346. width: 100px;
  347. flex: 1;
  348. }
  349. }
  350. }
  351. .li {
  352. display: grid;
  353. grid-template-columns: 60% 20% 20%;
  354. align-items: center;
  355. margin-bottom: 24rpx;
  356. text {
  357. color: #333;
  358. font-size: 26rpx;
  359. }
  360. .avatar {
  361. display: flex;
  362. align-items: center;
  363. image {
  364. width: 90rpx;
  365. min-width: 90rpx;
  366. height: 90rpx;
  367. margin-right: 20rpx;
  368. border-radius: 9rpx;
  369. }
  370. text {
  371. width: 100px;
  372. word-break: break-all;
  373. text-overflow: ellipsis;
  374. display: -webkit-box;
  375. -webkit-box-orient: vertical;
  376. -webkit-line-clamp: 2;
  377. font-size: 24rpx;
  378. line-height: 33rpx;
  379. /* 这里是超出几行省略 */
  380. overflow: hidden;
  381. }
  382. }
  383. &.first {
  384. margin-bottom: 30rpx;
  385. text {
  386. color: #666;
  387. }
  388. }
  389. }
  390. }
  391. .bg {
  392. width: 100%;
  393. height: auto;
  394. padding: 0 18rpx;
  395. background: url(https://fsy.shengsi.gov.cn/file/20240224/343febca7aa149c5aa0ee8c9365b2d3e.png) no-repeat;
  396. background-size: 100% 100%;
  397. box-sizing: border-box;
  398. .menus {
  399. display: flex;
  400. justify-content: space-around;
  401. padding:30rpx 0;
  402. border-radius: 24rpx;
  403. background-color: #fff;
  404. color: #333;
  405. align-items: center;
  406. &>view {
  407. image {
  408. width: 64rpx;
  409. height: 64rpx;
  410. display: block;
  411. margin: 0 auto 22rpx;
  412. }
  413. text {
  414. font-size: 26rpx;
  415. }
  416. }
  417. }
  418. .numberData {
  419. display: flex;
  420. justify-content: space-around;
  421. height: 150rpx;
  422. border-radius: 24rpx;
  423. background-color: #007A69;
  424. color: #fff;
  425. align-items: center;
  426. margin: 20rpx 0;
  427. &>view {
  428. text {
  429. display: block;
  430. text-align: center;
  431. font-size: 30rpx;
  432. color: #F0F8F6;
  433. &:first-child {
  434. font-size: 40rpx;
  435. color: #fff;
  436. margin-bottom: 20rpx;
  437. font-weight: bold;
  438. }
  439. }
  440. }
  441. }
  442. .dataBox {
  443. display: grid;
  444. /* 宽度平均分成4份 */
  445. grid-template-columns: repeat(2, 1fr);
  446. /* 高度平均分成3份 */
  447. grid-template-rows: repeat(2, 1fr);
  448. gap: 14rpx;
  449. .item {
  450. width: 340rpx;
  451. height: 180rpx;
  452. padding: 24rpx 0 0 26rpx;
  453. border-radius: 16rpx;
  454. background-color: rgba(255, 255, 255, .48);
  455. color: #777;
  456. &>view:nth-child(2) {
  457. color: #111;
  458. text {
  459. font-size: 36rpx;
  460. display: inline-block;
  461. margin: 12rpx 0;
  462. font-weight: bold;
  463. margin-left: -4rpx;
  464. }
  465. }
  466. }
  467. }
  468. }
  469. }
  470. /deep/.u-nav-slot {
  471. &>text {
  472. font-size: 36rpx;
  473. font-family: PingFang SC, PingFang SC;
  474. font-weight: bold;
  475. color: #333;
  476. margin-right: 10rpx;
  477. }
  478. }
  479. </style>