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