merchant-detail.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. </head>
  17. <body class="bgcfff">
  18. <div class="merchant_current" id="app">
  19. <van-sticky>
  20. <van-nav-bar class="camp_title user_title_normal f16" title="商户信息" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
  21. <template #left>
  22. <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
  23. </template>
  24. </van-nav-bar>
  25. </van-sticky>
  26. <div class="merchant-header merchant-header-back"></div>
  27. <div class="merchant-info ml16 mr16 bgcfff" v-cloak>
  28. <div class="pt16 pb16 pl16 pr16">
  29. <van-cell :title="merchant.MerchantName" center :border="false">
  30. <template #label><span class="mr16">{{merchant.MerRealName}}</span><span>{{merchant.MerchantMobile}}</span></template>
  31. <template #icon>
  32. <van-image src="./static/images/merchant-header.png" fit="cover" lazy-load>
  33. <template v-slot:loading><img src="./static/images/logo-gray.png" alt=""></template>
  34. </van-image>
  35. </template>
  36. <template #right-icon>
  37. <div class="merchant-phone" @click="takephone"><img src="./static/images/icon-phone.png" alt="" width="100%"></div>
  38. </template>
  39. </van-cell>
  40. <div class="merchant-info-content mt16" v-cloak>
  41. <div class="merchant-info-desc ovh" :class="active ? '' : 'merchant-info-close'">
  42. <van-cell-group class="pb8" :border="false">
  43. <van-cell title="商户姓名" :value="merchant.MerRealName" :border="false"></van-cell>
  44. <van-cell title="商户名称" :value="merchant.MerchantName" :border="false"></van-cell>
  45. <van-cell class="mb6" title="商户类型" :value="merchant.MerUserType" :border="false"></van-cell>
  46. <van-cell title="来源产品" :value="merchant.ProductType" :border="false"></van-cell>
  47. <van-cell title="参与状态" :value="merchant.ActiveStatus" :border="false"></van-cell>
  48. <van-cell title="参与时间" :value="merchant.MerStandardDate" :border="false"></van-cell>
  49. <van-cell title="注册时间" :value="merchant.CreateDate" :border="false"></van-cell>
  50. <van-cell class="mb6" title="SN号" :value="merchant.KqSnNo" :border="false"></van-cell>
  51. <van-cell title="商户说明" :value="merchant.Remark" :border="false"></van-cell>
  52. <van-cell title="活动状态" :value="merchant.ActStatus" :border="false"></van-cell>
  53. </van-cell-group>
  54. </div>
  55. <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>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="merchant-info-statistics mt16">
  60. <div class="ml16 mr16 pt8 pb8 bgcfff">
  61. <van-cell class="merchant-info-statistics-cell mt8 mb20" title="总交易额" :value="merchant.TradeTotal" center :border="false"></van-cell>
  62. </div>
  63. <van-sticky>
  64. <van-tabs v-model="merchantactive">
  65. <van-tab title="交易记录"></van-tab>
  66. <van-tab disabled></van-tab>
  67. <van-tab disabled></van-tab>
  68. </van-tabs>
  69. </van-sticky>
  70. <div class="ml16 mr16 pt8 pb8 bgcfff">
  71. <van-cell class="merchant-info-cell mt8" value="32440.00元" center :border="false">
  72. <template #title><span class="f12 c999" @click="onShowDate">{{dateName}}&nbsp;&nbsp;&nbsp;&gt;</span></template>
  73. </van-cell>
  74. <div class="mt8 merchant_detail_list">
  75. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="transactions.length === 0 ? 'isnodata':''">
  76. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  77. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  78. <van-cell-group :border="false">
  79. <van-cell v-for="item,index in transactions" center :title="item.TradeDate" :value="item.TradeAmt + '元'"></van-cell>
  80. </van-cell-group>
  81. </van-list>
  82. </van-pull-refresh>
  83. </div>
  84. </div>
  85. </div>
  86. <van-popup v-model="showDate" position="bottom" :style="{ height: '50%' }">
  87. <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" :formatter="formatter" @confirm="onConfirmDate"></van-datetime-picker>
  88. </van-popup>
  89. </div>
  90. <script src="./static/js/klm-vv.min.js"></script>
  91. <script src="./static/js/klm-axios-config.js"></script>
  92. <script>
  93. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  94. // 可以通过下面的方式手动注册
  95. Vue.use(vant.Lazyload);
  96. // 在 #app 标签下渲染一个按钮组件
  97. let app = new Vue({
  98. el: '#app',
  99. data() {
  100. return {
  101. isnodata:false,
  102. toptitleisshow:false,
  103. active: false,
  104. merchantactive:0,
  105. merchant:{
  106. },
  107. realMerchantMobile:'',
  108. showDate: false,
  109. minDate: new Date(2020, 0, 1),
  110. maxDate: new Date(2025, 10, 1),
  111. currentDate: new Date(),
  112. formatime:'',
  113. dateName: '本月',
  114. transactions: [
  115. ],
  116. pageinfo:{
  117. PageSize:10,
  118. PageNum:1
  119. },
  120. loading: false,
  121. finished: false,
  122. refreshing: false,
  123. };
  124. },
  125. created() {
  126. this.toptitleisshow = toptitleisshow;
  127. this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  128. this.getmerchantinfo();
  129. this.getmerchantdetail();
  130. },
  131. methods: {
  132. toggleMerchantInfo(){
  133. this.active = !this.active;
  134. },
  135. onShowDate(){
  136. console.log(this.showDate);
  137. this.showDate = !this.showDate;
  138. },
  139. formatter(type, val) {
  140. if (type === 'year') {
  141. return `${val}年`;
  142. } else if (type === 'month') {
  143. return `${val}月`;
  144. }
  145. return val;
  146. },
  147. onConfirmDate() {
  148. this.transactions = [];
  149. this.showDate = false;
  150. this.dateName = this.currentDate.getFullYear() + '年' + (this.currentDate.getMonth() + 1) + '月';
  151. this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  152. this.getmerchantdetail();
  153. },
  154. onLoad() {
  155. if (this.refreshing) {
  156. this.transactions = [];
  157. this.refreshing = false;
  158. this.pageinfo.PageNum = 0;
  159. }
  160. this.pageinfo.PageNum++;
  161. this.getmerchantdetail();
  162. },
  163. onRefresh() {
  164. // 清空列表数据
  165. this.finished = false;
  166. // 重新加载数据
  167. // 将 loading 设置为 true,表示处于加载状态
  168. this.loading = true;
  169. this.onLoad();
  170. },
  171. async getmerchantinfo(){
  172. PublicLib.ShowLoading({Message:''});
  173. const Id = PublicLib.getCookieInfo('merchantId');
  174. const res = await getRequest('/api/v1/merchantinfo/detail',JSON.stringify({Id}));
  175. if(res.status !== '1') return tips('获取商户信息失败,请重试!');
  176. PublicLib.HideLoading();
  177. this.merchant = res.data;
  178. this.realMerchantMobile = res.data.MerchantMobile;
  179. this.merchant.MerchantMobile = hidemiddlenum(res.data.MerchantMobile,3,4);
  180. },
  181. async getmerchantdetail(){
  182. const MerchantId = PublicLib.getCookieInfo('merchantId');
  183. const res = await getRequest('/api/v1/usertradedaysummary/merchanttradelist',JSON.stringify({...this.pageinfo,TradeMonth:this.formatime,MerchantId}));
  184. if(res.status !== '1') return tips('获取交易记录失败,请重试!');
  185. if(res.data.length < this.pageinfo.PageSize) {
  186. this.finished = true;
  187. };
  188. this.transactions.push(...res.data);
  189. this.loading = false;
  190. if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
  191. },
  192. goback(){
  193. PublicLib.GoBack({Level:1});
  194. },
  195. takephone(){
  196. PublicLib.PhoneCall(this.realMerchantMobile);
  197. }
  198. }
  199. });
  200. </script>
  201. </body>
  202. </html>