index.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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="pb0 bgcf5f5f5 ovh">
  18. <div class="index" id="app" v-cloak>
  19. <div class="iphonetitle rel">
  20. <div class="loginbgc abs" style="top:0;"></div>
  21. </div>
  22. <van-pull-refresh class="indexy iphonetitle" v-model="isLoading" @refresh="onRefresh" success="刷新完成">
  23. <div class="pl16 pr16" style="padding-bottom:10px;">
  24. <div class="index_title df">
  25. <div class="title_mame mb f14 c333">{{merchantname}}</div>
  26. <div @click="gofeedback"><img src="./static/images/index-btn1.png" alt=""></div>
  27. </div>
  28. <div class="audit_status bgcfff dib mt6" v-if="status === 2">
  29. <div class="roll fin dib"></div><span class="f12 more">审核通过</span>
  30. </div>
  31. <div class="audit_status bgcfff dib" @click="auditfaileddialogisshow = true" v-if="status === -1">
  32. <div class="roll un dib"></div><span class="f12 more">审核未通过</span>
  33. <van-icon name="arrow"> </van-icon>
  34. </div>
  35. <div class="audit_status bgcfff dib" @click="auditdialogisshow = true" v-if="status === 1">
  36. <div class="roll ing dib"></div><span class="f12 more">待签约</span>
  37. <van-icon name="arrow"></van-icon>
  38. </div>
  39. <div class="audit_status bgcfff dib" @click="examinedialogisshow = true" v-if="status === 0">
  40. <div class="roll ing dib"></div><span class="f12 more">审核中</span>
  41. <van-icon name="arrow"></van-icon>
  42. </div>
  43. <van-grid class="index_grid">
  44. <van-grid-item icon="./static/images/index-bind.png" text="绑定设备" @click="bindequipment"></van-grid-item>
  45. <van-grid-item icon="./static/images/index-bind-detail.png" text="已绑详情" @click="binddetail"></van-grid-item>
  46. <van-grid-item icon="./static/images/index-active.png" text="活动配置" @click="activeconfig"></van-grid-item>
  47. <van-grid-item icon="./static/images/index-vip.png" text="会员管理" @click="vipadministration"></van-grid-item>
  48. </van-grid>
  49. <div class="index_panel bgcfff">
  50. <div class="index_panel_title df">
  51. <div class="date_item df c333 f14">
  52. <div class="date" :class="chosedate === 1 ? 'chose':''" @click="chosedatefn(1)">今天</div>
  53. <div class="date" :class="chosedate === 2 ? 'chose':''" @click="chosedatefn(2)">近七天</div>
  54. <div class="date" :class="chosedate === 3 ? 'chose':''" @click="chosedatefn(3)">本月</div>
  55. </div>
  56. <div class="date_data c999 f12 df">
  57. <div v-if="chosedate !== 1"><span>{{oldmonth}}</span><span class="separate">/</span><span>{{oldday}}</span><span> ~ </span></div>
  58. <div><span>{{nowmounth}}</span><span class="separate">/</span><span>{{nowday}}</span></div>
  59. </div>
  60. </div>
  61. <div class="money_count_icon df"><img class="left" src="./static/images/index-getmoney.png" alt="">
  62. <div class="f12 c333">实收金额</div>
  63. </div>
  64. <div class="money_count_icon df mb money_count">
  65. <div class="f16 c333 mb6 mb">¥</div>
  66. <div class="count c333">{{moneycount | tofixed2}}</div>
  67. </div>
  68. <div class="money_count_detail df">
  69. <div class="data tc">
  70. <div class="c999 f12">订单总数</div>
  71. <div class="mb f16 mt6">{{ordercount}}</div>
  72. </div>
  73. <div class="line"></div>
  74. <div class="data tc">
  75. <div class="c999 f12">营收总额</div>
  76. <div class="mb f16 mt6">¥{{totalcount | tofixed2}}</div>
  77. </div>
  78. <div class="line"></div>
  79. <div class="data tc">
  80. <div class="c999 f12">新增会员</div>
  81. <div class="mb f16 mt6">{{vipcount}}</div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="index_panel bgcfff mt10 index_bottom_panel">
  86. <div class="title df" @click.stop="tips = true">
  87. <div class="mb c333 f16">当前活动参数</div><img src="./static/images/detail-btn.png" alt="">
  88. </div>
  89. <div class="indexcell" v-if="activeIsAll">
  90. <van-cell :title="item.title" :icon="item.icon" :value="item.data" v-for="item,index in listdata" :key="index">
  91. <template #default><span class="f18 mb" v-if="item.data.data !== '¥'">{{item.data.data}}</span><span class="f12 mb" v-if="item.data.data !== '¥'">{{item.data.icon}}</span><span class="f12 mb" v-if="item.data.data === '¥'">{{item.data.data}}</span><span class="f18 mb" v-if="item.data.data === '¥'">{{item.data.icon}}</span></template>
  92. </van-cell>
  93. </div>
  94. <div class="f14 tc mt16 c999" v-else>暂未开启活动</div>
  95. </div>
  96. </div>
  97. </van-pull-refresh>
  98. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="examinedialogisshow" title="审核中" message="您的门店信息正在审核中" @confirm="examinedialogisshow = false"> </van-dialog>
  99. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="auditfaileddialogisshow" title="审核进度" message="您的门店信息审核失败!请联系您的业务管家修改后重新提交" @confirm="auditfaileddialogisshow = false"> </van-dialog>
  100. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="auditdialogisshow" title="审核进度" message="您的门店审核进度如下:
  101. 微信-已通过-待签约
  102. 支付宝-已通过-待签约
  103. 请联系您的业务管家前往签约!" @confirm="auditdialogisshow = false"> </van-dialog>
  104. <van-dialog class="textl" style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="tips" title="名词解释" message="实收金额:消费金额-退款金额-手续费
  105. 订单总数:当日订单总笔数
  106. 新增会员:当日消费者会员卡领取数量
  107. 营收金额:用户消费后应该付的原价金额,未扣除优惠和退款" @confirm="tips = false"> </van-dialog>
  108. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="bindqrcode" message="绑定成功!" @confirm="bindqrcode = false"> </van-dialog>
  109. <van-dialog class="option" style="border-radius:4px;" width="300px" v-model="binddialogisshow" message="绑定成功,收款码暂未关联音响" cancel-button-text="暂时不要" confirm-button-text="去关联" show-cancel-button @confirm="gobind" @cancel="binddialogisshow = false"> </van-dialog>
  110. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="failbind" :message="failinfo" @confirm="failbind = false"> </van-dialog>
  111. <van-tabbar v-model="active" active-color="#FF502A" v-cloak v-if="tabsisshow">
  112. <van-tabbar-item icon="home-o">工作台
  113. <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
  114. </van-tabbar-item>
  115. <van-tabbar-item icon="home-o" @click="management">经营数据
  116. <template #icon="props"><img :src="props.active ? icon2.active : icon2.inactive"></template>
  117. </van-tabbar-item>
  118. <van-tabbar-item icon="friends-o" @click="notice">消息
  119. <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
  120. </van-tabbar-item>
  121. <van-tabbar-item icon="setting-o" @click="user">我的
  122. <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
  123. </van-tabbar-item>
  124. </van-tabbar>
  125. </div>
  126. <script src="./static/js/klm-vv.min.js"></script>
  127. <script src="./static/js/klm-axios-config.js"></script>
  128. <script>
  129. function OnStart(){
  130. let scanContent = PublicLib.getCookieInfo("ScanContent");
  131. //- 拿到扫描结果进行赋值传输
  132. if(scanContent !== undefined){
  133. if(scanContent !== '' && !verificationHost(scanContent)){
  134. PublicLib.putCookieInfo('ScanContent', '');
  135. PublicLib.ShowMsg({Title:'提示', Message:'请扫描创业帮收款码或音响码'});
  136. };
  137. if(scanContent !== '' && verificationHost(scanContent)){
  138. PublicLib.putCookieInfo('indexscandata', PublicLib.getCookieInfo("ScanContent"));
  139. PublicLib.putCookieInfo('ScanContent', '');
  140. PublicLib.ShowDialog({
  141. Title:'绑定设备',
  142. Message:'是否绑定该设备?',
  143. ConfirmText:'绑定设备',
  144. CancelText:'暂不绑定',
  145. ConfirmAction:'app.getcodeinfo()',
  146. CanelAction:''
  147. });
  148. };
  149. //- app.getcodeinfo(scanContent);
  150. };
  151. app.getmangementdetail();
  152. app.getmerchantdetail();
  153. app.getmangementdata();
  154. };
  155. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  156. // 可以通过下面的方式手动注册
  157. Vue.use(vant.Lazyload);
  158. // 在 #app 标签下渲染一个按钮组件
  159. let app = new Vue({
  160. el: '#app',
  161. data() {
  162. return {
  163. str:'',
  164. tips:false,
  165. isLoading:false,
  166. topisshow:false,
  167. bindqrcode:false,
  168. failbind:false,
  169. failinfo:'',
  170. binddialogisshow:false,
  171. examinedialogisshow:false,
  172. auditdialogisshow:false,
  173. auditfaileddialogisshow:false,
  174. chosedate:1,
  175. active: 0,
  176. moneycount:0,
  177. totalcount:0,
  178. ordercount:0,
  179. vipcount:0,
  180. activeIsAll:false,
  181. //- 扫描数据
  182. merchantname:'',
  183. icon1: {
  184. active: './static/images/tab-icon1-active.png',
  185. inactive: './static/images/tab-icon1-no.png',
  186. },
  187. icon2: {
  188. active: './static/images/tab-icon2-active.png',
  189. inactive: './static/images/tab-icon2-no.png',
  190. },
  191. icon3: {
  192. active: './static/images/tab-icon3-active.png',
  193. inactive: './static/images/tab-icon3-no.png',
  194. },
  195. icon4: {
  196. active: './static/images/tab-icon4-active.png',
  197. inactive: './static/images/tab-icon4-no.png',
  198. },
  199. tabsisshow:false,
  200. listdata:[
  201. {icon:'./static/images/index-list-icon4.png',title:'实收比例',data:{data:'0',icon:'%'}},
  202. {icon:'./static/images/index-list-icon4.png',title:'活动成本比例',data:{data:'0',icon:'%'}},
  203. {icon:'./static/images/index-list-icon2.png',title:'让利人数',data:{data:'0',icon:''}},
  204. {icon:'./static/images/index-list-icon3.png',title:'让利天数上限',data:{data:'0',icon:''}},
  205. {icon:'./static/images/index-list-icon1.png',title:'活动门槛',data:{data:'0',icon:''}},
  206. {icon:'./static/images/index-list-icon4.png',title:'订单最高返比',data:{data:'0',icon:'%'}},
  207. ],
  208. oldmonth:'',
  209. oldday:'',
  210. nowmounth:new Date().getMonth()+1,
  211. nowday:new Date().getDate(),
  212. status:'',
  213. };
  214. },
  215. created() {
  216. this.tabsisshow = bottomtabisshow;
  217. this.getmerchantdetail();
  218. this.getmangementdata();
  219. this.getmangementdetail();
  220. },
  221. methods: {
  222. // 解析获取到的信息,将解析数据发送到后台
  223. getcodeinfo(){
  224. const info = PublicLib.getCookieInfo("indexscandata");
  225. const data = info.split('?');
  226. const dataarr = data[1].split('&');
  227. let sn = '';
  228. let machine = '';
  229. dataarr.forEach(element => {
  230. if(element.split('=')[0] === 'sn'){
  231. sn = element.split('=')[1]
  232. }else if (element.split('=')[0] === 'machine'){
  233. machine = element.split('=')[1]
  234. }
  235. });
  236. this.scandealfn(sn,machine);
  237. },
  238. //- 获取商户详情
  239. async getmerchantdetail(){
  240. let Id = PublicLib.getCookieInfo('userId')
  241. const res = await getRequest('/api/v1/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
  242. if(res.status !== '1') return tips(res.info);
  243. //- console.log(res);
  244. this.merchantname = res.data.Name;
  245. this.status = res.data.Status;
  246. },
  247. //- 获取统计数据
  248. async getmangementdata(){
  249. let Id = PublicLib.getCookieInfo('userId')
  250. const res = await getRequest('/api/v1/merchantinfo/indexstat?t='+Math.random(6),JSON.stringify({Id,TimeType:this.chosedate}));
  251. if(res.status !== '1') return tips(res.info);
  252. this.moneycount = res.data.TotalAmount;
  253. this.ordercount = res.data.TotalOrder;
  254. this.vipcount = res.data.TotalUser;
  255. this.totalcount = res.data.TotalActual;
  256. },
  257. //- 商户活动参数
  258. async getmangementdetail(){
  259. let Id = PublicLib.getCookieInfo('userId')
  260. const res = await getRequest('/api/v1/merchantparamset/detail?t='+Math.random(6),JSON.stringify({Id}));
  261. if(res.status !== '1') return tips(res.info);
  262. //- console.log(res,11);
  263. this.listdata[0].data.data = res.data.GetPercent;
  264. this.listdata[0].data.icon = ' %';
  265. this.listdata[1].data.data = (100 - Number(res.data.GetPercent));
  266. this.listdata[1].data.icon = ' %';
  267. this.listdata[2].data.data = res.data.DiviPersons;
  268. this.listdata[3].data.data = res.data.ProfitDays;
  269. this.listdata[4].data.data = '¥';
  270. this.listdata[4].data.icon =Number(res.data.MinPayMoney).toFixed(2);
  271. this.listdata[5].data.data = Number(res.data.DiviPercent).toFixed(0);
  272. this.listdata[5].data.icon = ' %';
  273. this.activeIsAll = res.data.IsAll === 0 ? true:false;
  274. },
  275. //- 扫描二维码处理逻辑
  276. async scandealfn(SnNo,Machine){
  277. let MerchantId = PublicLib.getCookieInfo('userId');
  278. const res = await postRequest('/api/v1/merchantqrcode/bind?t='+Math.random(6),JSON.stringify({MerchantId,SnNo,Machine}));
  279. //- 失败
  280. if(res.status === '-1'){
  281. this.failinfo = res.info;
  282. this.failbind = true;
  283. }else if(res.status === '1') {
  284. //- 成功绑定,但无音响
  285. this.binddialogisshow = true;
  286. }else if(res.status === '2') {
  287. //- 成功
  288. this.bindqrcode = true;
  289. };
  290. },
  291. gobind(){
  292. //- 跳转绑定音响
  293. PublicLib.Goto({Url:'bind-detail-collection'});
  294. },
  295. //- 选择天数
  296. chosedatefn(num){
  297. if(num === this.chosedate) return;
  298. this.chosedate = num;
  299. this.getmangementdata();
  300. if(num === 2){
  301. const time = new Date();
  302. this.oldday = new Date(time - 518400000).getDate();
  303. this.oldmonth = new Date(time - 518400000).getMonth() + 1;
  304. }else if(num === 3){
  305. this.oldmonth = new Date().getMonth()+1;
  306. this.oldday = '1';
  307. }
  308. },
  309. //- 下拉刷新
  310. async onRefresh(){
  311. await this.getmerchantdetail();
  312. await this.getmangementdata();
  313. await this.getmangementdetail();
  314. this.isLoading = false;
  315. },
  316. //- 活动配置
  317. activeconfig(){
  318. PublicLib.Goto({Url:'active-config'});
  319. },
  320. //- 已绑详情
  321. binddetail(){
  322. PublicLib.Goto({Url:'bind-detail'});
  323. },
  324. //- 会员管理
  325. vipadministration(){
  326. PublicLib.Goto({Url:'vip-administration'});
  327. },
  328. //- 消息中心
  329. notice(){
  330. PublicLib.Goto({Url:'notice-center'});
  331. },
  332. //- 个人中心
  333. user(){
  334. PublicLib.Goto({Url:'user-center'});
  335. },
  336. //- 经营数据
  337. management(){
  338. PublicLib.Goto({Url:'management'});
  339. },
  340. //- 绑定设备
  341. bindequipment(){
  342. if(this.status !== 2){
  343. return tips('门店审核未通过,请等待审核通过之后进行绑定设备')
  344. };
  345. PublicLib.ScanQRCode();
  346. },
  347. //- 去反馈
  348. gofeedback(){
  349. PublicLib.Goto({Url:'user-feedback'});
  350. },
  351. }
  352. });
  353. </script>
  354. </body>
  355. </html>