merchant-detail1.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>详情-我的商户-创业帮</title>
  6. <meta name="keywords" content="详情-我的商户-创业帮">
  7. <meta name="description" content="详情-我的商户-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="详情-我的商户-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .van-pull-refresh__track{
  18. position:static;
  19. }
  20. .van-pull-refresh__head{
  21. z-index:-1;
  22. }
  23. .van-cell__value{
  24. flex:2;
  25. }
  26. .merchant_detail_list .van-pull-refresh{
  27. height:calc(100vh - 10.9rem) !important;
  28. }
  29. </style>
  30. </head>
  31. <body class="bgcfff pb0 ovh vh100" style="box-sizing:border-box;">
  32. <div class="iphonetitle"></div>
  33. <div class="merchant_current" id="app">
  34. <van-sticky>
  35. <van-nav-bar class="camp_title user_title_normal f16" title="商户信息" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
  36. <template #left>
  37. <van-icon name="arrow-left" color="#333" size="20"></van-icon>
  38. </template>
  39. </van-nav-bar>
  40. </van-sticky>
  41. <div class="merchant-header merchant-header-back"></div>
  42. <div class="merchant-info ml16 mr16 bgcfff" v-cloak>
  43. <div class="pt16 pb16 pl16 pr16">
  44. <van-cell :title="merchant.Name" center :border="false">
  45. <template #label><span class="mr16">{{merchant.MerRealName}}</span><span>{{merchant.Mobile}}</span></template>
  46. <template #icon>
  47. <van-image src="./static/images/merchant-header.png" fit="cover" lazy-load></van-image>
  48. </template>
  49. <template #right-icon>
  50. <div class="merchant-phone" @click="takephone"><img src="./static/images/icon-phone.png" alt="" width="100%"></div>
  51. </template>
  52. </van-cell>
  53. <div class="merchant-info-content mt16" v-cloak>
  54. <div class="merchant-info-desc ovh" :class="active ? '' : 'merchant-info-close'">
  55. <van-cell-group class="pb8" :border="false">
  56. <van-cell title="商户名称" :value="merchant.Name" :border="false"></van-cell>
  57. <van-cell title="企业法人" :value="merchant.LegalName" :border="false"></van-cell>
  58. <van-cell title="创建时间" :value="merchant.CreateDate" :border="false"></van-cell>
  59. </van-cell-group>
  60. </div>
  61. <div class="merchant-info-content-title tc pt16 van-hairline--top" @click="toggleMerchantInfo()"><img class="vm pl6 pr6" src="./static/images/icon-arrow-down@3x.png" alt="" :class="active ? 'toUp' : ''"><span class="f12 c999 vm">{{active ? '收起' : '商户详情'}}</span></div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="merchant-info-statistics mt16" ref="wrapper2">
  66. <div class="ml16 mr16 pt8 pb8 bgcfff">
  67. <van-cell class="merchant-info-statistics-cell mt8 mb20" title="总交易额" :value="merchant.TradeTotal + '元'" center :border="false"></van-cell>
  68. </div>
  69. <van-tabs v-model="merchantactive" color="#FFD500">
  70. <van-tab title="交易记录"></van-tab>
  71. <van-tab disabled></van-tab>
  72. <van-tab disabled></van-tab>
  73. </van-tabs>
  74. <div class="ml16 mr16 pt8 pb8 bgcfff">
  75. <div class="mt8 merchant_detail_list" ref="wrapper2">
  76. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height: 60vh;" :class="transactions.length === 0 ? 'isnodata':''">
  77. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  78. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  79. <van-cell-group :border="false">
  80. <van-cell v-for="item,index in transactions" center :title="item.TradeDate" :value="item.TradeAmt + '元'"></van-cell>
  81. </van-cell-group>
  82. </van-list>
  83. </van-pull-refresh>
  84. </div>
  85. </div>
  86. </div>
  87. <van-popup v-model="showDate" position="bottom" :style="{ height: '50%' }">
  88. <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" :formatter="formatter" @confirm="onConfirmDate"></van-datetime-picker>
  89. </van-popup>
  90. </div>
  91. <script src="./static/js/klm-vv.min.js"></script>
  92. <script src="./static/js/appfunc.min.js"></script>
  93. <script src="./static/js/klm-axios-config.js"></script>
  94. <script src="./static/js/publicfn.js"></script>
  95. <script>
  96. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  97. // 可以通过下面的方式手动注册
  98. Vue.use(vant.Lazyload);
  99. //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  100. // 在 #app 标签下渲染一个按钮组件
  101. let app = new Vue({
  102. el: '#app',
  103. data() {
  104. return {
  105. isnodata:false,
  106. toptitleisshow:true,
  107. active: false,
  108. merchantactive:0,
  109. merchant:{
  110. TradeTotal:0,
  111. },
  112. realMerchantMobile:'',
  113. showDate: false,
  114. minDate: new Date(2020, 0, 1),
  115. maxDate: new Date(2025, 10, 1),
  116. currentDate: new Date(),
  117. formatime:'',
  118. dateName: '本月',
  119. transactions: [
  120. ],
  121. pageinfo:{
  122. PageSize:10,
  123. PageNum:1
  124. },
  125. loading: false,
  126. finished: false,
  127. refreshing: false,
  128. allcount:{}
  129. };
  130. },
  131. created() {
  132. this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  133. this.getmerchantinfo();
  134. this.getmerchantdetail();
  135. },
  136. mounted(){
  137. this.$refs.wrapper2.style.height = `${document.documentElement.clientHeight - 450}px`;
  138. },
  139. methods: {
  140. toggleMerchantInfo(){
  141. this.active = !this.active;
  142. },
  143. onShowDate(){
  144. this.showDate = !this.showDate;
  145. },
  146. formatter(type, val) {
  147. if (type === 'year') {
  148. return `${val}年`;
  149. } else if (type === 'month') {
  150. return `${val}月`;
  151. }
  152. return val;
  153. },
  154. onConfirmDate() {
  155. this.transactions = [];
  156. this.showDate = false;
  157. this.dateName = this.currentDate.getFullYear() + '年' + (this.currentDate.getMonth() + 1) + '月';
  158. this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  159. this.getmerchantdetail();
  160. },
  161. onLoad() {
  162. if (this.refreshing) {
  163. this.transactions = [];
  164. this.refreshing = false;
  165. this.pageinfo.PageNum = 0;
  166. }
  167. this.pageinfo.PageNum++;
  168. this.getmerchantdetail();
  169. },
  170. onRefresh() {
  171. // 清空列表数据
  172. this.finished = false;
  173. // 重新加载数据
  174. // 将 loading 设置为 true,表示处于加载状态
  175. this.loading = true;
  176. this.onLoad();
  177. },
  178. async getmerchantinfo(){
  179. //- PublicLib.ShowLoading({Message:''});
  180. const Id = PublicLib.getCookieInfo('merchantId');
  181. const res = await getRequest('api/v1/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
  182. if(res.status !== '1') return tips('获取商户信息失败,请重试!');
  183. //- PublicLib.HideLoading();
  184. res.data.TradeTotal = res.data.TradeTotal.toFixed(2);
  185. this.merchant = res.data;
  186. this.realMerchantMobile = res.data.Mobile;
  187. //- this.merchant.Mobile = hidemiddlenum(res.data.Mobile,3,4);
  188. },
  189. async getmerchantdetail(){
  190. const MerchantId = PublicLib.getCookieInfo('merchantId');
  191. const res = await getRequest('api/v1/usertradedaysummary/merchanttradelist?t='+Math.random(6),JSON.stringify({...this.pageinfo,TradeMonth:this.formatime,MerchantId}));
  192. if(res.status !== '1') return tips('获取交易记录失败,请重试!');
  193. if(res.data.length < this.pageinfo.PageSize) {
  194. this.finished = true;
  195. };
  196. if(this.pageinfo.PageNum === 1){
  197. res.data.splice(0,1);
  198. };
  199. res.data.forEach(item=>{
  200. item.TradeAmt = item.TradeAmt.toFixed(2)
  201. });
  202. this.allcount = res;
  203. this.transactions.push(...res.data);
  204. this.loading = false;
  205. if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
  206. },
  207. goback(){
  208. PublicLib.GoBack({Level:1});
  209. },
  210. takephone(){
  211. PublicLib.PhoneCall(this.realMerchantMobile);
  212. }
  213. }
  214. });
  215. </script>
  216. </body>
  217. </html>