index.vue 9.0 KB

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