index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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>{{info.todayOrderAmount||0}}</text></view>
  16. <view>昨日¥{{info.yesterdayOrderAmount||0}}</view>
  17. </view>
  18. <view class="item">
  19. <view>退款金额</view>
  20. <view>¥<text>{{info.todayRefundAmount||0}}</text></view>
  21. <view>昨日¥{{info.yesterdayRefundAmount||0}}</view>
  22. </view>
  23. <view class="item">
  24. <view>成交订单数</view>
  25. <view>¥<text>{{info.todayOrders||0}}</text></view>
  26. <view>昨日{{info.yesterdayOrders||0}}</view>
  27. </view>
  28. <view class="item">
  29. <view>退款订单数</view>
  30. <view>¥<text>{{info.todayRefundOrders||0}}</text></view>
  31. <view>昨日{{info.yesterdayRefundOrders||0}}</view>
  32. </view>
  33. </view>
  34. <view class="numberData">
  35. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=0')">
  36. <text>{{info.todayObligationOrders||0}}</text>
  37. <text>待付款</text>
  38. </view>
  39. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=4')">
  40. <text>{{info.todayPendingOrders||0}}</text>
  41. <text>待使用</text>
  42. </view>
  43. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=3')">
  44. <text>{{info.todayOrders||0}}</text>
  45. <text>已完成</text>
  46. </view>
  47. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=-1')">
  48. <text>{{info.todayCancelledOrders||0}}</text>
  49. <text>已取消</text>
  50. </view>
  51. <view @click="toHref('/pagesHouse/Mine/ordersList/index?type=-3')">
  52. <text>{{info.todayRefundOrders||0}}</text>
  53. <text>退款售后</text>
  54. </view>
  55. </view>
  56. <view class="menus">
  57. <view @click="toHref('/pagesHouse/HotelMerchandise/index?merchantType='+merchantType)">
  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="item.pic"></image>
  90. <text>{{item.thingName}}</text>
  91. </view>
  92. <text>{{item.num}}</text>
  93. <text>¥{{item.price}}</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: 4,
  119. }
  120. },
  121. onLoad(opt) {
  122. this.merchantType=uni.getStorageSync('merchantType');
  123. console.log(merchantType);
  124. this.getData();
  125. this.getList();
  126. this.getType()
  127. },
  128. methods: {
  129. getType() {
  130. this.$api.post('/merchant/register/getMerchantStoreList').then(res => {
  131. if (res.data.code === 0) {
  132. this.shList = res.data.data;
  133. let shs = [];
  134. this.shList.forEach(d => shs.push(d.merchantName));
  135. this.nameList = [shs];
  136. let id = uni.getStorageSync('homestayId');
  137. if (!uni.getStorageSync('homestayId')) id = uni.getStorageSync('merchantId');
  138. let t = this.shList.find(d => d.merchantId == id);
  139. this.name = t ? t.merchantName : ''
  140. } else this.$showToast(res.data.msg);
  141. })
  142. },
  143. confirm(e) {
  144. this.name = e.value[0];
  145. this.shShow = false;
  146. let t = this.shList.find(d => d.merchantName == this.name);
  147. if (t) {
  148. uni.setStorageSync('merchantType',t.merchantType);
  149. if (t.merchantType != 2) { //酒店民宿
  150. uni.setStorageSync('homestayId', '');
  151. uni.setStorageSync('merchantId', t.merchantId);
  152. this.list = [];
  153. } else {
  154. this.item = null;
  155. this.list = [];
  156. uni.setStorageSync('homestayId', t.merchantId);
  157. uni.setStorageSync('merchantId', '');
  158. uni.navigateTo({
  159. url: '/pages/home/index'
  160. })
  161. }
  162. }
  163. },
  164. getData() {
  165. this.$api.get('/merchant/merchantFisherman/home/getMerchantFishermanAppHome/' + uni.getStorageSync(
  166. 'merchantId')).then(res => {
  167. if (res.data.code === 0) {
  168. this.info = res.data.data;
  169. }
  170. })
  171. },
  172. getList() {
  173. this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanOrderList', {
  174. dateTime: new Date().Format('yyyy-MM-dd'),
  175. dateType: '1',
  176. fishermanId: uni.getStorageSync('merchantId')
  177. }).then(res => {
  178. if (res.data.code === 0) {
  179. this.list = res.data.data;
  180. }
  181. })
  182. },
  183. toHref(url) {
  184. uni.redirectTo({
  185. url: url
  186. })
  187. },
  188. more() {
  189. uni.navigateTo({
  190. url: "/pagesHouse/home/orderList"
  191. })
  192. }
  193. }
  194. }
  195. </script>
  196. <style lang="less" scoped>
  197. .page {
  198. background: #F3F4F4;
  199. padding-bottom: 40rpx;
  200. box-sizing: border-box;
  201. width: 100%;
  202. overflow-x: hidden;
  203. .list {
  204. width: calc(100% - 36rpx);
  205. margin: 20rpx auto;
  206. padding: 0 20rpx 6rpx;
  207. background-color: #fff;
  208. border-radius: 24rpx;
  209. box-sizing: border-box;
  210. .tit {
  211. padding: 40rpx 0;
  212. display: flex;
  213. justify-content: space-between;
  214. align-items: center;
  215. text {
  216. &:first-child {
  217. font-size: 32rpx;
  218. color: #111;
  219. font-weight: bold;
  220. }
  221. &:nth-child(2) {
  222. margin-left: 17rpx;
  223. color: #666666;
  224. width: 100px;
  225. flex: 1;
  226. }
  227. }
  228. }
  229. .li {
  230. display: grid;
  231. grid-template-columns: 60% 20% 20%;
  232. align-items: center;
  233. margin-bottom: 24rpx;
  234. text {
  235. color: #333;
  236. font-size: 26rpx;
  237. }
  238. .avatar {
  239. display: flex;
  240. align-items: center;
  241. image {
  242. width: 90rpx;
  243. min-width: 90rpx;
  244. height: 90rpx;
  245. margin-right: 20rpx;
  246. }
  247. text {
  248. width: 100px;
  249. word-break: break-all;
  250. text-overflow: ellipsis;
  251. display: -webkit-box;
  252. -webkit-box-orient: vertical;
  253. -webkit-line-clamp: 2;
  254. font-size: 24rpx;
  255. line-height: 33rpx;
  256. /* 这里是超出几行省略 */
  257. overflow: hidden;
  258. }
  259. }
  260. &.first {
  261. margin-bottom: 30rpx;
  262. text {
  263. color: #666;
  264. }
  265. }
  266. }
  267. }
  268. .bg {
  269. width: 100%;
  270. height: auto;
  271. padding: 0 18rpx;
  272. background: url(https://i.ringzle.com/file/20240224/343febca7aa149c5aa0ee8c9365b2d3e.png) no-repeat;
  273. background-size: 100% 100%;
  274. box-sizing: border-box;
  275. .menus {
  276. display: flex;
  277. justify-content: space-around;
  278. height: 184rpx;
  279. border-radius: 24rpx;
  280. background-color: #fff;
  281. color: #333;
  282. align-items: center;
  283. &>view {
  284. image {
  285. width: 64rpx;
  286. height: 64rpx;
  287. display: block;
  288. margin: 0 auto 22rpx;
  289. }
  290. text {
  291. font-size: 26rpx;
  292. }
  293. }
  294. }
  295. .numberData {
  296. display: flex;
  297. justify-content: space-around;
  298. height: 150rpx;
  299. border-radius: 24rpx;
  300. background-color: #007A69;
  301. color: #fff;
  302. align-items: center;
  303. margin: 20rpx 0;
  304. &>view {
  305. text {
  306. display: block;
  307. text-align: center;
  308. font-size: 26rpx;
  309. color: #F0F8F6;
  310. &:first-child {
  311. font-size: 36rpx;
  312. color: #fff;
  313. margin-bottom: 20rpx;
  314. }
  315. }
  316. }
  317. }
  318. .dataBox {
  319. display: grid;
  320. /* 宽度平均分成4份 */
  321. grid-template-columns: repeat(2, 1fr);
  322. /* 高度平均分成3份 */
  323. grid-template-rows: repeat(2, 1fr);
  324. gap: 14rpx;
  325. .item {
  326. width: 340rpx;
  327. height: 180rpx;
  328. padding: 24rpx 0 0 26rpx;
  329. border-radius: 16rpx;
  330. background-color: rgba(255, 255, 255, .48);
  331. color: #777;
  332. &>view:nth-child(2) {
  333. color: #111;
  334. text {
  335. font-size: 36rpx;
  336. display: inline-block;
  337. margin: 12rpx 0;
  338. font-weight: bold;
  339. margin-left: -4rpx;
  340. }
  341. }
  342. }
  343. }
  344. }
  345. }
  346. /deep/.u-nav-slot {
  347. &>text {
  348. font-size: 36rpx;
  349. font-family: PingFang SC, PingFang SC;
  350. font-weight: bold;
  351. color: #333;
  352. }
  353. }
  354. </style>