index.vue 9.3 KB

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