api.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from "@/utils/request.js";
  11. /**
  12. * 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
  13. *
  14. */
  15. export function getAjcaptcha(data) {
  16. return request.get("ajcaptcha", data, {
  17. noAuth: true
  18. });
  19. }
  20. export function ajcaptchaCheck(data) {
  21. return request.post("ajcheck", data, {
  22. noAuth: true
  23. });
  24. }
  25. /**
  26. * 获取主页数据 无需授权
  27. *
  28. */
  29. export function getIndexData() {
  30. return request.get("v2/index", {}, {
  31. noAuth: true
  32. });
  33. }
  34. /**
  35. * 获取服务器类型
  36. *
  37. */
  38. export function getServerType() {
  39. return request.get("v2/site_serve", {}, {
  40. noAuth: true
  41. });
  42. }
  43. /**
  44. * 获取登录授权login
  45. *
  46. */
  47. export function getLogo() {
  48. return request.get('wechat/get_logo', {}, {
  49. noAuth: true
  50. });
  51. }
  52. /**
  53. * 保存form_id
  54. * @param string formId
  55. */
  56. export function setFormId(formId) {
  57. return request.post("wechat/set_form_id", {
  58. formId: formId
  59. });
  60. }
  61. /**
  62. * 领取优惠卷
  63. * @param int couponId
  64. *
  65. */
  66. export function setCouponReceive(couponId) {
  67. return request.post('coupon/receive', {
  68. couponId: couponId
  69. });
  70. }
  71. /**
  72. * 优惠券列表
  73. * @param object data
  74. */
  75. export function getCoupons(data) {
  76. return request.get('v2/coupons', data, {
  77. noAuth: true
  78. })
  79. }
  80. /**
  81. * 我的优惠券
  82. * @param int types 0全部 1未使用 2已使用
  83. */
  84. export function getUserCoupons(types, data) {
  85. return request.get('coupons/user/' + types, data)
  86. }
  87. /**
  88. * 首页新人优惠券
  89. *
  90. */
  91. export function getNewCoupon() {
  92. return request.get('v2/new_coupon')
  93. }
  94. /**
  95. * 文章分类列表
  96. *
  97. */
  98. export function getArticleCategoryList() {
  99. return request.get('article/category/list', {}, {
  100. noAuth: true
  101. })
  102. }
  103. /**
  104. * 文章列表
  105. * @param int cid
  106. *
  107. */
  108. export function getArticleList(cid, data) {
  109. return request.get('article/list/' + cid, data, {
  110. noAuth: true
  111. })
  112. }
  113. /**
  114. * 文章 热门列表
  115. *
  116. */
  117. export function getArticleHotList() {
  118. return request.get('article/hot/list', {}, {
  119. noAuth: true
  120. });
  121. }
  122. /**
  123. * 文章 轮播列表
  124. *
  125. */
  126. export function getArticleBannerList() {
  127. return request.get('article/banner/list', {}, {
  128. noAuth: true
  129. })
  130. }
  131. /**
  132. * 文章详情
  133. * @param int id
  134. *
  135. */
  136. export function getArticleDetails(id) {
  137. return request.get('article/details/' + id, {}, {
  138. noAuth: true
  139. });
  140. }
  141. /**
  142. * 手机号+验证码登录接口
  143. * @param object data
  144. */
  145. export function loginMobile(data) {
  146. return request.post('login/mobile', data, {
  147. noAuth: true
  148. })
  149. }
  150. /**
  151. * 获取短信KEY
  152. * @param object phone
  153. */
  154. export function verifyCode() {
  155. return request.get('verify_code', {}, {
  156. noAuth: true
  157. })
  158. }
  159. /**
  160. * 验证码发送
  161. * @param object phone
  162. */
  163. export function registerVerify(data) {
  164. return request.post('register/verify',data, {
  165. noAuth: true
  166. })
  167. }
  168. /**
  169. * 手机号注册
  170. * @param object data
  171. *
  172. */
  173. export function phoneRegister(data) {
  174. return request.post('register', data, {
  175. noAuth: true
  176. });
  177. }
  178. /**
  179. * 手机号修改密码
  180. * @param object data
  181. *
  182. */
  183. export function phoneRegisterReset(data) {
  184. return request.post('register/reset', data, {
  185. noAuth: true
  186. })
  187. }
  188. /**
  189. * 手机号+密码登录
  190. * @param object data
  191. *
  192. */
  193. export function phoneLogin(data) {
  194. return request.post('login', data, {
  195. noAuth: true
  196. })
  197. }
  198. /**
  199. * 切换H5登录
  200. * @param object data
  201. */
  202. // #ifdef MP
  203. export function switchH5Login() {
  204. return request.post('switch_h5', {
  205. 'from': 'routine'
  206. });
  207. }
  208. // #endif
  209. /*
  210. * h5切换公众号登陆
  211. * */
  212. // #ifdef H5
  213. export function switchH5Login() {
  214. return request.post("switch_h5", {
  215. 'from': "wechat"
  216. });
  217. }
  218. // #endif
  219. /**
  220. * 绑定手机号
  221. *
  222. */
  223. export function bindingPhone(data) {
  224. return request.post('binding', data, {
  225. noAuth: true
  226. });
  227. }
  228. /**
  229. * 绑定手机号
  230. *
  231. */
  232. export function bindingUserPhone(data) {
  233. return request.post('user/binding', data);
  234. }
  235. /**
  236. * 退出登錄
  237. *
  238. */
  239. export function logout() {
  240. return request.get('logout');
  241. }
  242. /**
  243. * 获取订阅消息id
  244. */
  245. export function getTemlIds() {
  246. return request.get('wechat/teml_ids', {}, {
  247. noAuth: true
  248. });
  249. }
  250. /**
  251. * 首页拼团数据
  252. */
  253. export function pink() {
  254. return request.get('pink', {}, {
  255. noAuth: true
  256. });
  257. }
  258. /**
  259. * 获取城市信息
  260. */
  261. export function getCity() {
  262. return request.get('city_list', {}, {
  263. noAuth: true
  264. });
  265. }
  266. /**
  267. * 获取省市区街道
  268. */
  269. export function getCityData(pid) {
  270. return request.get('city', {'pid':pid}, {
  271. noAuth: true
  272. });
  273. }
  274. /**
  275. * 获取小程序观看列表
  276. */
  277. export function getLiveList(page, limit) {
  278. return request.get('wechat/live', {
  279. page,
  280. limit
  281. }, {
  282. noAuth: true
  283. });
  284. }
  285. /**
  286. * 获取首页DIY;
  287. */
  288. export function getDiy(id) {
  289. return request.get('diy/get_diy/' + id, {}, {
  290. noAuth: true
  291. });
  292. }
  293. /**
  294. * 一键换色;
  295. */
  296. export function colorChange(name) {
  297. return request.get('v2/diy/color_change/' + name, {}, {
  298. noAuth: true
  299. });
  300. }
  301. /**
  302. * 获取公众号关注
  303. * @returns {*}
  304. */
  305. export function follow() {
  306. return request.get("wechat/follow", {}, {
  307. noAuth: true
  308. });
  309. }
  310. /**
  311. * 更换手机号码
  312. * @returns {*}
  313. */
  314. export function updatePhone(data) {
  315. return request.post("user/updatePhone", data, {
  316. noAuth: true
  317. });
  318. }
  319. /**
  320. * 首页优惠券弹窗
  321. * @returns {*}
  322. */
  323. export function getCouponV2() {
  324. return request.get("v2/get_today_coupon", {}, {
  325. noAuth: true
  326. });
  327. }
  328. /**
  329. * 新用户优惠券弹窗
  330. * @returns {*}
  331. */
  332. export function getCouponNewUser() {
  333. return request.get("v2/new_coupon", {}, {
  334. noAuth: true
  335. });
  336. }
  337. /**
  338. * 首页快速选择数据
  339. * @param {Object} data
  340. */
  341. export function category(data) {
  342. return request.get("category", data, {
  343. noAuth: true
  344. });
  345. }
  346. /**
  347. * 个人搜索历史
  348. * @param {Object} data
  349. */
  350. export function searchList(data) {
  351. return request.get('v2/user/search_list', data, {
  352. noAuth: true
  353. });
  354. }
  355. /**
  356. * 删除搜索历史
  357. */
  358. export function clearSearch() {
  359. return request.get('v2/user/clean_search');
  360. }
  361. /**
  362. * App微信登录
  363. * @returns {*}
  364. */
  365. export function wechatAppAuth(data) {
  366. return request.post("wechat/app_auth", data, {
  367. noAuth: true
  368. });
  369. }
  370. /**
  371. * 客服配置
  372. */
  373. export function customerType() {
  374. return request.get('get_customer_type',{},{
  375. noAuth: true
  376. });
  377. }
  378. /**
  379. * 获取开屏广告
  380. * @returns {*}
  381. */
  382. export function getOpenAdv(data) {
  383. return request.get("get_open_adv", {}, {
  384. noAuth: true
  385. });
  386. }
  387. /**
  388. * 获取版权
  389. *
  390. */
  391. export function copyRight() {
  392. return request.get('get_copyright', {}, {
  393. noAuth: true
  394. });
  395. }
  396. /**
  397. * 获取用户信息
  398. *
  399. */
  400. export function diyUserInfo() {
  401. return request.get('diy/user_info', {});
  402. }
  403. /**
  404. * 新人专享
  405. *
  406. */
  407. export function newcomerList(data) {
  408. return request.get('diy/newcomer_list', data,{
  409. noAuth: true
  410. });
  411. }
  412. /**
  413. * 获取DIY版本接口
  414. * @param {Object} id
  415. */
  416. export function getDiyVersion(id) {
  417. return request.get(`diy/diy_version/${id}`, {}, {
  418. noAuth: true
  419. });
  420. }
  421. /**
  422. * 商品分类类版本
  423. */
  424. export function getCategoryVersion() {
  425. return request.get('category_version', {}, {
  426. noAuth: true
  427. });
  428. }
  429. export function getCouponsNum() {
  430. return request.get('coupons/user/num', {}, {
  431. noAuth: true
  432. });
  433. }
  434. export function getSign() {
  435. return request.get('diy/sign', {}, {
  436. noAuth: true
  437. });
  438. }