merchant-detail-pos.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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 pb0 ovh vh100" style="box-sizing:border-box;">
  18. <div class="iphonetitle"></div>
  19. <div class="merchant_current detail-pos" id="app" v-cloak>
  20. <van-sticky>
  21. <van-nav-bar class="camp_title user_title_normal f16" title="商户信息" @click-left="goback" v-if="toptitleisshow" right-text="完善资料" left-arrow @click-right="merchantinfo" v-cloak>
  22. <template #left>
  23. <van-icon name="arrow-left" color="#333" size="20"></van-icon>
  24. </template>
  25. </van-nav-bar>
  26. </van-sticky>
  27. <div class="merchant-header merchant-header-back"></div>
  28. <div class="merchant-info ml16 mr16 bgcfff" v-cloak>
  29. <div class="pt16 pb16 pl16 pr16">
  30. <van-cell center :border="false">
  31. <template #title>
  32. <div class="df aic"><span class="f14 mr8">{{merchant.MerchantName}}</span></div>
  33. </template>
  34. <template #label><span class="mr16" v-if="merchant.MerRealName">{{merchant.MerRealName}}</span><span>{{merchant.MerchantMobile}}</span></template>
  35. <template #icon>
  36. <van-image src="./static/images/merchant-header.png" fit="cover" lazy-load></van-image>
  37. </template>
  38. <template #right-icon>
  39. <div class="merchant-phone" @click="takephone">
  40. <van-icon name="phone" color="#ff502a"></van-icon>
  41. </div>
  42. </template>
  43. </van-cell>
  44. <div class="merchant-info-content mt16" v-cloak>
  45. <div class="merchant-info-desc ovh" :class="active ? '' : 'merchant-info-close'">
  46. <van-cell-group class="pb8" :border="false">
  47. <van-cell title="商户姓名" :value="merchant.MerRealName" :border="false"></van-cell>
  48. <van-cell title="商户名称" :value="merchant.MerchantName" :border="false"></van-cell>
  49. <van-cell title="商户类型" :value="merchant.MerUserType" :border="false"></van-cell>
  50. <van-cell title="来源产品" :value="merchant.ProductType" :border="false"></van-cell>
  51. <van-cell title="激活状态" :value="merchant.ActiveStatus" :border="false"></van-cell>
  52. <van-cell title="激活时间" :value="merchant.MerStandardDate" :border="false"></van-cell>
  53. <van-cell title="注册时间" :value="merchant.CreateDate" :border="false"></van-cell>
  54. <van-cell title="SN号" :value="merchant.KqSnNo" :border="false"></van-cell>
  55. <van-cell title="商户说明" :value="!merchant.Remark ? '无' : merchant.Remark" :border="false"></van-cell>
  56. <van-cell title="活动状态" :value="merchant.ActStatus" :border="false"></van-cell>
  57. </van-cell-group>
  58. </div>
  59. <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>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="merchant-info-statistics mt16">
  64. <div class="ml16 mr16 pt8 pb8 bgcfff">
  65. <van-cell class="merchant-info-statistics-cell mt8 mb20" title="总交易额" :value="abs(merchant.TradeTotal) + '元'" center :border="false"></van-cell>
  66. </div>
  67. <van-tabs v-model="merchantactive" color="#FFD500">
  68. <van-tab title="交易记录"></van-tab>
  69. <van-tab disabled></van-tab>
  70. <van-tab disabled></van-tab>
  71. </van-tabs>
  72. <div class="ml16 mr16 pt8 pb8 bgcfff">
  73. <van-cell class="merchant-info-cell mt8" center :border="false">
  74. <template #title><span class="f12 c999" @click="onShowDate">{{dateName}}&nbsp;&nbsp;&nbsp;&gt;</span></template>
  75. <template #default><span class="f12 c333">{{abs(MonthTradeAmt)}}元</span></template>
  76. </van-cell>
  77. <div class="mt8 merchant_detail_list" ref="wrapper2">
  78. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height: 10vh;height:100% !important" :class="transactions.length === 0 ? 'isnodata':''">
  79. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  80. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  81. <van-cell-group :border="false">
  82. <van-cell v-for="item,index in transactions" center :title="item.TradeDate" :value="abs(item.TradeAmt) + '元'"></van-cell>
  83. </van-cell-group>
  84. </van-list>
  85. </van-pull-refresh>
  86. </div>
  87. </div>
  88. </div>
  89. <van-popup v-model="showDate" position="bottom" :style="{ height: '50%' }">
  90. <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" :formatter="formatter" @confirm="onConfirmDate" @cancel="showDate = false"></van-datetime-picker>
  91. </van-popup>
  92. <van-overlay :show="nextshow" @click="closenextshow">
  93. <div class="unbindpop cm">
  94. <div class="unbindcard tc" @click.stop>
  95. <div class="f14 c333 title">转换规则</div>
  96. <div class="f12 c666 tl mt8">1.满足全部如下条件时方可转为商户型创客:</div>
  97. <div class="f12 c666 tl pl6 pt4">a.机具已激活且未进行过转换</div>
  98. <div class="f12 c666 tl pl6 pt4">b.该创客已完成实名认证</div>
  99. <div class="f12 c666 tl pl6 pt4">c.该创客注册手机号需要与机具绑定手机号一致</div>
  100. <div class="f12 c666 tl mt8">2.转商户型创客后该机具交易额将归属至该创客</div>
  101. <div class="f12 c666 tl mt8">3.<span style="color:red;">转换后无法撤销,请仔细核对SN号及姓名是否正确</span></div>
  102. <input type="text" v-model="createercode" placeholder="请输入创客编号" @focus="inputbtn" style="width:100%;">
  103. <div class="f12 tc c333 title" v-if="createrinfo.RealName !== ''">姓名:{{createrinfo.RealName}}</div>
  104. <div class="nextbutton cfff cm mt16 f14" @click="diaolignextbtn" style="color:#333;">{{createrinfo.RealName === ''? '下一步' : '确认转换'}}</div>
  105. </div>
  106. </div>
  107. </van-overlay>
  108. </div>
  109. <script src="./static/js/klm-vv.min.js"></script>
  110. <script src="./static/js/appfunc.min.js"></script>
  111. <script src="./static/js/klm-axios-config.js"></script>
  112. <script src="./static/js/publicfn.js"></script>
  113. <script>
  114. function OnStart(){
  115. app.getmerchantinfo();
  116. };
  117. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  118. // 可以通过下面的方式手动注册
  119. Vue.use(vant.Lazyload);
  120. //- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  121. // 在 #app 标签下渲染一个按钮组件
  122. let app = new Vue({
  123. el: '#app',
  124. data() {
  125. return {
  126. nextshow:false,
  127. MonthTradeAmt:0,
  128. isnodata:false,
  129. toptitleisshow:true,
  130. active: false,
  131. merchantactive:0,
  132. merchant:{
  133. TradeTotal:0,
  134. },
  135. realMerchantMobile:'',
  136. showDate: false,
  137. minDate: new Date(2022, 0, 1),
  138. maxDate: new Date(),
  139. currentDate: new Date(),
  140. formatime:'',
  141. dateName: '本月',
  142. transactions: [
  143. ],
  144. pageinfo:{
  145. PageSize:10,
  146. PageNum:1
  147. },
  148. createercode:'',
  149. createrinfo:{
  150. RealName:'',
  151. Id:'',
  152. },
  153. loading: false,
  154. finished: false,
  155. refreshing: false,
  156. };
  157. },
  158. created() {
  159. this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  160. this.getmerchantinfo();
  161. this.getmerchantdetail('refresh');
  162. },
  163. beforeUpdate(){
  164. this.$nextTick(() => {
  165. this.$refs.wrapper2.style.height = `${document.documentElement.clientHeight - 420}px`;
  166. });
  167. },
  168. methods: {
  169. inputbtn(){
  170. this.createrinfo.RealName = '';
  171. },
  172. closenextshow(){
  173. this.nextshow = false;
  174. this.createercode = '';
  175. this.createrinfo.RealName = '';
  176. },
  177. changebtn(snid){
  178. this.SnId = snid;
  179. this.nextshow = true;
  180. },
  181. diaolignextbtn:undebounce(async function(){
  182. console.log(this.result)
  183. if(this.createercode === '') return tips('请输入创客编号');
  184. if(this.createrinfo.RealName === '') {
  185. const res = await getRequest('api/v1/users/forcode?t='+Math.random(6),JSON.stringify({MakerCode:this.createercode}));
  186. if(res.status !== '1')return tips(res.info);
  187. this.createrinfo = res.data;
  188. console.log(this.createrinfo)
  189. } else{
  190. if(!this.createrinfo.RealName){
  191. return tips('请输入正确的创客编号!');
  192. };
  193. const res = await postRequest('api/v1/pos/posmachines/setmerchantmaker?t='+Math.random(6),JSON.stringify({SnId:this.SnId,UserId:this.createrinfo.Id}));
  194. if(res.status !== '1')return tips(res.info);
  195. tips('转换成功!');
  196. this.nextshow = false;
  197. this.createrinfo = {RealName:'',Id:''};
  198. this.createercode = '';
  199. this.onRefresh();
  200. }
  201. }),
  202. //- 商户补全
  203. merchantinfo(id){
  204. PublicLib.Goto({Url:'merchant-detail-pos-completion'});
  205. },
  206. toggleMerchantInfo(){
  207. this.active = !this.active;
  208. },
  209. onShowDate(){
  210. this.showDate = !this.showDate;
  211. },
  212. formatter(type, val) {
  213. if (type === 'year') {
  214. return `${val}年`;
  215. } else if (type === 'month') {
  216. return `${val}月`;
  217. }
  218. return val;
  219. },
  220. onConfirmDate() {
  221. //- this.transactions = [];
  222. this.showDate = false;
  223. this.dateName = this.currentDate.getFullYear() + '年' + (this.currentDate.getMonth() + 1) + '月';
  224. this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  225. this.pageinfo.PageNum = 1;
  226. this.getmerchantdetail('refresh');
  227. },
  228. onLoad() {
  229. console.log('load Event')
  230. if (this.refreshing) {
  231. this.refreshing = false;
  232. };
  233. this.pageinfo.PageNum++;
  234. this.getmerchantdetail();
  235. },
  236. onRefresh() {
  237. // 清空列表数据
  238. console.log('refresh event')
  239. this.finished = false;
  240. this.pageinfo.PageNum = 1;
  241. // 重新加载数据
  242. // 将 loading 设置为 true,表示处于加载状态
  243. this.loading = true;
  244. if (this.refreshing) {
  245. this.refreshing = false;
  246. };
  247. this.getmerchantdetail('refresh');
  248. },
  249. //- 获取商户详情
  250. async getmerchantinfo(){
  251. //- PublicLib.ShowLoading({Message:''});
  252. const Id = PublicLib.getCookieInfo('merchantId');
  253. const res = await getRequest('/api/v1/pos/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
  254. if(res.status !== '1') return tips('获取商户信息失败,请重试!');
  255. //- PublicLib.HideLoading();
  256. res.data.TradeTotal = res.data.TradeTotal.toFixed(2);
  257. this.merchant = res.data;
  258. this.realMerchantMobile = res.data.MerchantMobile;
  259. //- this.merchant.MerchantMobile = hidemiddlenum(res.data.MerchantMobile,3,4);
  260. },
  261. async getmerchantdetail(type='onload'){
  262. const MerchantId = PublicLib.getCookieInfo('merchantId');
  263. const res = await getRequest('/api/v1/pos/usertradedaysummary/merchanttradelist?t='+Math.random(6),JSON.stringify({...this.pageinfo,TradeMonth:this.formatime,MerchantId}));
  264. if(res.status !== '1') return tips('获取交易记录失败,请重试!');
  265. if(res.data.length < this.pageinfo.PageSize) {
  266. this.finished = true;
  267. };
  268. res.data.forEach(item=>{
  269. item.TradeAmt = item.TradeAmt.toFixed(2)
  270. });
  271. if(this.pageinfo.PageNum === 1){
  272. this.MonthTradeAmt = res.other.MonthTradeAmt.toFixed(2);
  273. };
  274. if(type === 'refresh'){
  275. this.transactions = res.data
  276. this.refreshing = false;
  277. }
  278. if(type === 'onload'){
  279. this.transactions.push(...res.data);
  280. }
  281. this.loading = false;
  282. if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
  283. },
  284. goback(){
  285. PublicLib.GoBack({Level:1});
  286. },
  287. takephone(){
  288. PublicLib.PhoneCall(this.realMerchantMobile);
  289. }
  290. }
  291. });
  292. </script>
  293. </body>
  294. </html>