index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <!-- +---------------------------------------------------------------------- -->
  2. <!-- | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -->
  3. <!-- +---------------------------------------------------------------------- -->
  4. <!-- | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -->
  5. <!-- +---------------------------------------------------------------------- -->
  6. <!-- | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -->
  7. <!-- +---------------------------------------------------------------------- -->
  8. <!-- | Author: CRMEB Team <admin@crmeb.com> -->
  9. <!-- +---------------------------------------------------------------------- -->
  10. {extend name="public/container"}
  11. {block name="title"}个人中心{/block}
  12. {block name="head"}
  13. <style>
  14. html {
  15. min-height: 100%;
  16. }
  17. body {
  18. padding-bottom: 1.1rem;
  19. padding-bottom: calc(1.1rem + constant(safe-area-inset-bottom));
  20. padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
  21. background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f5f5f5));
  22. background-image: linear-gradient(#fff, #f5f5f5);
  23. }
  24. .copyright {
  25. margin: .2rem;
  26. overflow: hidden;
  27. word-break: keep-all;
  28. text-align: center;
  29. font-size: .28rem;
  30. color: #BBBBBB;
  31. }
  32. a[href^="tel"] {
  33. color: #191C6E;
  34. }
  35. </style>
  36. {/block}
  37. {block name="content"}
  38. <div v-cloak id="app" class="user-page">
  39. <div class="user-section" @click="goUrl('{:Url('user_info')}', 1)">
  40. {if isset($userInfo['uid']) && $userInfo['uid']}
  41. <img class="img" src="{$userInfo.avatar}">
  42. {else}
  43. <img class="img" src="/wap/first/zsff/images/avatar_default.jpg">
  44. {/if}
  45. <div class="text-wrap">
  46. {if isset($userInfo['uid']) && $userInfo['uid']}
  47. <div class="name">{$userInfo.nickname}</div>
  48. {if $userInfo['level'] eq 1 && $userInfo['is_permanent'] neq 1}
  49. <!-- <div class="info">
  50. <img class="icon" src="/wap/first/zsff/images/user_member1.png">
  51. <span class="time">{$overdue_time}到期</span>
  52. </div> -->
  53. {elseif $userInfo['level'] eq 1 && $userInfo['is_permanent'] eq 1}
  54. <!-- <div class="info">
  55. <img class="icon" src="/wap/first/zsff/images/user_member1.png">
  56. <span class="time">永久会员</span>
  57. </div> -->
  58. {elseif $userInfo['level'] eq 0 && $userInfo['member_time'] neq 0}
  59. <!-- <div class="info">
  60. <img class="icon" src="/wap/first/zsff/images/user_member1.png">
  61. <span class="time">会员已过期</span>
  62. </div> -->
  63. {else /}
  64. <!-- <div class="info">
  65. <img class="icon" src="/wap/first/zsff/images/user_member1.png">
  66. <span class="time">未开通会员</span>
  67. </div> -->
  68. {/if}
  69. {else}
  70. <div class="name">请登录</div>
  71. {/if}
  72. </div>
  73. <div class="iconfont iconxiangyou"></div>
  74. </div>
  75. <!-- <div class="member-section" @click="memberUrl">
  76. <div >
  77. <img src="{__WAP_PATH}zsff/images/user_member2.png" >
  78. </div>
  79. <div>会员可享多项课程特权</div>
  80. {notempty name="$userInfo"}
  81. {if isset($userInfo['is_permanent']) && $userInfo['is_permanent'] neq 1}
  82. {if $userInfo['level'] eq 1 || $userInfo['member_time'] neq 0}
  83. <button >续费会员</button>
  84. {else}
  85. <button >立即激活</button>
  86. {/if}
  87. {/if}
  88. {else /}
  89. <button >立即激活</button>
  90. {/notempty}
  91. </div> -->
  92. <div class="tool-section">
  93. <a href="javascript:" @click="goUrl('{:Url('special/grade_special')}', 1)">
  94. <img src="{__WAP_PATH}zsff/images/wdkc.png">
  95. 我的课程
  96. </a>
  97. <a href="javascript:" @click="goUrl('{:Url('special/record')}', 1)">
  98. <img src="{__WAP_PATH}zsff/images/xxjl.png">
  99. 学习记录
  100. </a>
  101. <a href="javascript:" @click="goUrl('{:Url('special/order_store_list')}', 1)" v-show="is_store_switch==1">
  102. <img src="{__WAP_PATH}zsff/images/ddgl.png">
  103. 商品订单
  104. </a>
  105. </div>
  106. <div v-if="question.length" class="question-section">
  107. <a v-for="item in question" :key="item.id" href="javascript:" @click="goUrl(item.url, 1)">
  108. <div>
  109. <img :src="item.icon">
  110. </div>
  111. <div>
  112. <div>{{ item.title }}</div>
  113. <div>{{ item.explain }}</div>
  114. </div>
  115. </a>
  116. </div>
  117. <div class="serve-section">
  118. <div class="section-hd">我的服务</div>
  119. <div class="section-bd">
  120. <a v-for="item in menuList" :key="item.id" href="javascript:" @click="goUrl(item, 2)">
  121. <img :src="item.icon">
  122. {{ item.title }}
  123. </a>
  124. </div>
  125. </div>
  126. <div v-if="copyright && hasCopyright" class="copyright">{{ copyright }}</div>
  127. <img v-if="!copyright && hasCopyright" class="support" src="{__WAP_PATH}zsff/images/crmeb_my.png">
  128. {if $is_official_account_switch}
  129. <div v-show="isfollow">
  130. <div class="mask" @touchmove.prevent></div>
  131. <div class="follow">
  132. <div>立即绑定微信公众号用户</div>
  133. <img :src="codeUrl">
  134. <button @click.stop="skip">跳过</button>
  135. </div>
  136. </div>
  137. {/if}
  138. <base-login :login-show="loginShow" :site-name="site_name" @login-close="logComplete"></base-login>
  139. <!-- 申请讲师状态 -->
  140. <apply-dialog :show.sync="applyVisible" :status="applyStatus" :fail="failMessage"></apply-dialog>
  141. {include file="public/store_menu"}
  142. </div>
  143. <script>
  144. var site_name = '{$Auth_site_name}',store_switch = '{$store_switch}',isyue={$is_yue ? 'true' : 'false'},phone='{$phone}',isWechat='{$isWechat}',is_official_account_switch={$is_official_account_switch};
  145. require(['vue', 'helper', 'store', 'layer', 'axios', 'components/base-login/index', 'components/apply-dialog/index', '{__WAP_PATH}zsff/js/enter.js'], function (Vue, $h, store, layer, axios, BaseLogin, ApplyDialog) {
  146. new Vue({
  147. el: '#app',
  148. components: {
  149. 'base-login': BaseLogin,
  150. 'apply-dialog': ApplyDialog
  151. },
  152. data: {
  153. appear: true,
  154. codeUrl: '',
  155. isfollow: false,
  156. url: isWechat ? $h.U({ c: 'index', a: 'login' }) : $h.U({ c: 'login', a: 'phone_check' }),
  157. site_name: site_name,
  158. isyue: isyue,
  159. phone: phone,
  160. isWechat: isWechat,
  161. menuList: [],
  162. question: [],
  163. loginShow: false,
  164. is_store_switch:store_switch,
  165. applyStatus: null,
  166. failMessage: '',
  167. applyVisible: false,
  168. clickedLink: '',
  169. hasCopyright: false,
  170. copyright: ''
  171. },
  172. created: function () {
  173. this.getQuestion();
  174. this.getMenu();
  175. this.get_copyright();
  176. },
  177. methods: {
  178. getMenu: function () {
  179. var that = this;
  180. $h.loadFFF();
  181. store.baseGet($h.U({
  182. c: 'my',
  183. a: 'getPersonalCenterMenu'
  184. }), function(res) {
  185. $h.loadClear();
  186. that.menuList = res.data.data;
  187. }, function(err) {
  188. $h.loadClear();
  189. });
  190. },
  191. skip: function () {
  192. this.isfollow = false;
  193. this.appear = true;
  194. setTimeout(function () {
  195. window.location.reload();
  196. }, 800);
  197. },
  198. logComplete: function (data) {
  199. var that = this;
  200. that.loginShow = false;
  201. if (!data) {
  202. return;
  203. }
  204. if (!data.isfollow && is_official_account_switch) {
  205. that.codeUrl = data.url;
  206. that.isfollow = true;
  207. } else {
  208. window.location.reload();
  209. }
  210. },
  211. goUrl: function (item,type) {
  212. var vm = this;
  213. store.baseGet($h.U({
  214. c: 'index',
  215. a: 'login_user'
  216. }), function () {
  217. if (type === 1) {
  218. window.location.assign(item);
  219. }
  220. if (type === 2) {
  221. // 讲师申请
  222. if (item.link.indexOf('merchant/index') !== -1) {
  223. vm.is_apply(item.link);
  224. return false;
  225. }
  226. // 咨询客服
  227. if (item.link.indexOf('service/service_list') !== -1) {
  228. vm.public_data(item.link);
  229. return false;
  230. }
  231. window.location.assign(item.link);
  232. }
  233. }, function () {
  234. vm.loginShow = true;
  235. });
  236. },
  237. memberUrl:function(){
  238. var that = this;
  239. store.baseGet($h.U({ c: 'index', a: 'login_user' }), function (res) {
  240. window.location.assign($h.U({
  241. c: 'special',
  242. a: 'member_recharge'
  243. }));
  244. }, function () {
  245. that.appear = false;
  246. });
  247. },
  248. //所有插件回调处理事件
  249. changeVal: function (opt) {
  250. if (typeof opt != 'object') opt = {};
  251. var action = opt.action || '';
  252. var value = opt.value || '';
  253. this[action] && this[action](value);
  254. },
  255. enter: function () {
  256. this.appear = false;
  257. },
  258. change: function (title) {
  259. this.appear = title;
  260. },
  261. // 练习考试模块
  262. getQuestion: function () {
  263. var index = layer.load(1);
  264. axios.get('/wap/my/questionModule').then(function (res) {
  265. this.question = res.data.data;
  266. }.bind(this)).catch(function (err) {
  267. }).then(function () {
  268. layer.close(index);
  269. });
  270. },
  271. // 申请状态
  272. is_apply: function (link) {
  273. var vm = this;
  274. this.clickedLink = link;
  275. store.baseGet($h.U({
  276. c: 'merchant',
  277. a: 'is_apply'
  278. }), function (res) {
  279. if (res.data.data) {
  280. vm.applyStatus = res.data.data.status;
  281. if (res.data.data.status === null) {
  282. window.location.assign(link);
  283. } else {
  284. if (res.data.data.status === 2) {
  285. window.location.assign(link);
  286. } else {
  287. vm.applyVisible = true;
  288. if (res.data.data.status === -1) {
  289. vm.failMessage = res.data.data.fail_message;
  290. }
  291. }
  292. }
  293. } else {
  294. window.location.assign(link);
  295. }
  296. });
  297. },
  298. // 咨询客服
  299. public_data: function (link) {
  300. store.baseGet($h.U({
  301. c: 'public_api',
  302. a: 'public_data'
  303. }), function (res) {
  304. var data = res.data.data;
  305. if (data.customer_service === '3') {
  306. if (data.site_service_phone) {
  307. layer.confirm('是否拨打 <a href="tel:' + data.site_service_phone + '">' + data.site_service_phone + '</a> 进行咨询?', {
  308. title: false,
  309. closeBtn: false,
  310. btn: ['拨打', '取消']
  311. }, function (index) {
  312. window.location.assign('tel:' + data.site_service_phone);
  313. layer.close(index);
  314. });
  315. } else {
  316. layer.msg('抱歉,无法联系客服');
  317. }
  318. } else {
  319. window.location.assign(link);
  320. }
  321. });
  322. },
  323. goApply: function () {
  324. window.location.assign(this.clickedLink);
  325. },
  326. // 版权信息
  327. get_copyright: function () {
  328. var vm = this;
  329. store.baseGet($h.U({
  330. m: 'admin',
  331. c: 'login',
  332. a: 'get_copyright'
  333. }), function (res) {
  334. vm.hasCopyright = true;
  335. vm.copyright = res.data.data;
  336. }, function () {
  337. vm.hasCopyright = true;
  338. }, true);
  339. }
  340. }
  341. })
  342. })
  343. </script>
  344. {/block}