index.vue 9.4 KB

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