api.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2024 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. /**
  16. * 获取主页数据 无需授权
  17. *
  18. */
  19. export function getIndexData()
  20. {
  21. return request.get("common/home",{},{ noAuth : true});
  22. }
  23. /**
  24. * 获取app版本
  25. */
  26. export function getAppVersion() {
  27. return request.get('appVersion',{},{noAuth:true});
  28. }
  29. /**
  30. * 获取登录授权login
  31. *
  32. */
  33. export function getLogo()
  34. {
  35. return request.get('wechat/get_logo', {}, { noAuth : true});
  36. }
  37. /**
  38. * 保存form_id
  39. * @param string formId
  40. */
  41. export function setFormId(formId) {
  42. return request.post("wechat/set_form_id", { formId: formId});
  43. }
  44. /**
  45. * 领取优惠卷
  46. * @param int couponId
  47. *
  48. */
  49. export function setCouponReceive(couponId){
  50. return request.post('coupon/receive/'+couponId);
  51. }
  52. /**
  53. * 商铺优惠券列表
  54. * @param object data
  55. */
  56. export function getShopCoupons(id){
  57. return request.get('coupon/store/'+id,{},{ noAuth: true})
  58. }
  59. /**
  60. * 商品优惠券列表
  61. * @param object data
  62. */
  63. export function getCoupons(data){
  64. return request.get('coupon/product',data,{ noAuth: true})
  65. }
  66. /**
  67. * 我的优惠券
  68. * @param int types 0全部 1未使用 2已使用
  69. */
  70. export function getUserCoupons(data){
  71. return request.get('coupon/list',data)
  72. }
  73. /**
  74. * 文章分类列表
  75. *
  76. */
  77. export function getArticleCategoryList(){
  78. return request.get('article/category/lst',{},{noAuth:true})
  79. }
  80. /**
  81. * 文章列表
  82. * @param int cid
  83. *
  84. */
  85. export function getArticleList(cid,data){
  86. return request.get('article/lst/' + cid, data,{noAuth:true})
  87. }
  88. /**
  89. * 文章 热门列表
  90. *
  91. */
  92. export function getArticleHotList(){
  93. return request.get('article/hot/list',{},{noAuth:true});
  94. }
  95. /**
  96. * 文章 轮播列表
  97. *
  98. */
  99. export function getArticleBannerList(){
  100. return request.get('article/banner/list',{},{noAuth:true})
  101. }
  102. /**
  103. * 文章详情
  104. * @param int id
  105. *
  106. */
  107. export function getArticleDetails(id){
  108. return request.get('article/detail/'+id,{},{noAuth:true});
  109. }
  110. /**
  111. * 手机号+验证码登录接口
  112. * @param object data
  113. */
  114. export function loginMobile(data){
  115. return request.post('login/mobile',data,{noAuth:true})
  116. }
  117. /**
  118. * 获取短信KEY
  119. * @param object phone
  120. */
  121. export function verifyCode(){
  122. return request.get('verify_code', {},{noAuth:true})
  123. }
  124. /**
  125. * 验证码发送
  126. * @param object phone
  127. */
  128. export function registerVerify(phone, reset, key, code){
  129. return request.post('register/verify', { phone: phone, type: reset === undefined ? 'reset' : reset, key: key, code: code },{noAuth:true})
  130. }
  131. /**
  132. * 手机号注册
  133. * @param object data
  134. *
  135. */
  136. export function phoneRegister(data){
  137. return request.post('register',data,{noAuth:true});
  138. }
  139. /**
  140. * 手机号修改密码
  141. * @param object data
  142. *
  143. */
  144. export function phoneRegisterReset(data){
  145. return request.post('register/reset',data,{noAuth:true})
  146. }
  147. /**
  148. * 手机号+密码登录
  149. * @param object data
  150. *
  151. */
  152. export function phoneLogin(data){
  153. return request.post('login',data,{noAuth:true})
  154. }
  155. /* h5切换公众号登陆 */
  156. export function switchH5Login(data) {
  157. return request.post("user/switch", data);
  158. }
  159. /** 绑定手机号 */
  160. export function bindingPhone(data){
  161. return request.post('user/binding',data);
  162. }
  163. /** 修改手机号 */
  164. export function modifyPhone(data){
  165. return request.post('user/change/phone',data);
  166. }
  167. /** 修改密码 */
  168. export function modifyPassword(data){
  169. return request.post('user/change/password',data);
  170. }
  171. /** 退出登錄 */
  172. export function logout(){
  173. return request.get('logout');
  174. }
  175. /** 获取订阅消息id */
  176. export function getTemlIds(){
  177. return request.get('wechat/teml_ids', {}, { noAuth:true});
  178. }
  179. /** 首页拼团数据 */
  180. export function pink(){
  181. return request.get('pink', {}, { noAuth:true});
  182. }
  183. /** 获取城市信息 */
  184. export function getCity() {
  185. return request.get('system/city/lst', { }, { noAuth: true });
  186. }
  187. export function getCityV2(pid) {
  188. return request.get('v2/system/city/lst/'+pid, {}, {noAuth: true});
  189. }
  190. export function getCityList(address){
  191. return request.get('v2/system/city', {address}, {noAuth: true});
  192. }
  193. /** 获取小程序直播列表 */
  194. export function getLiveList(page,limit) {
  195. return request.get('wechat/live', { page, limit}, { noAuth: true });
  196. }
  197. /* APP登录 */
  198. export function wechatAppAuth(data) {
  199. return request.post("auth/app", data, { noAuth: true });
  200. }
  201. /* APPLE登录 */
  202. export function appleAppAuth(data) {
  203. return request.post("auth/apple", data, { noAuth: true });
  204. }
  205. /* 小程序获取手机号解密 */
  206. export function appletsDecrypt(data) {
  207. return request.post("user/mp/binding", data);
  208. }
  209. /**
  210. * 获取首页DIY;
  211. */
  212. export function getDiy(data) {
  213. return request.get('diy',data,{ noAuth: true });
  214. }
  215. /**
  216. * 获取首页微页面;
  217. */
  218. export function getPageDiy(data) {
  219. return request.get(`micro`, data, {
  220. noAuth: true
  221. });
  222. }
  223. /**
  224. * 滑块信息
  225. * @param {Object} data
  226. */
  227. export function getAjcaptcha(data) {
  228. return request.get("ajcaptcha", data, {
  229. noAuth: true
  230. });
  231. }
  232. /**
  233. * 滑块验证
  234. * @param {Object} data
  235. */
  236. export function ajcaptchaCheck(data) {
  237. return request.post("ajcheck", data, {
  238. noAuth: true
  239. });
  240. }
  241. /**
  242. * 滑块信息
  243. * @param {Object} data
  244. */
  245. export function getOpenAdv() {
  246. return request.get("open_screen", {}, {
  247. noAuth: true
  248. });
  249. }
  250. /**
  251. * diy-秒杀
  252. * @param {Object} data
  253. */
  254. export function getSeckillData(data) {
  255. return request.get("diy/seckill", data, {
  256. noAuth: true
  257. });
  258. }
  259. /**
  260. * diy-预售
  261. * @param {Object} data
  262. */
  263. export function getPresellData(data) {
  264. return request.get("diy/presell", data, {
  265. noAuth: true
  266. });
  267. }
  268. /**
  269. * diy-助力
  270. * @param {Object} data
  271. */
  272. export function getAssistData(data) {
  273. return request.get("diy/assist",data, {
  274. noAuth: true
  275. });
  276. }
  277. /**
  278. * diy-拼团
  279. * @param {Object} data
  280. */
  281. export function getCombinationData(data) {
  282. return request.get("diy/group", data, {
  283. noAuth: true
  284. });
  285. }
  286. /**
  287. * diy-商品列表
  288. * @param {Object} data
  289. */
  290. export function getProductData(data) {
  291. return request.get("diy/spu", data, {
  292. noAuth: true
  293. });
  294. }
  295. /**
  296. * diy-社区列表
  297. * @param {Object} data
  298. */
  299. export function graphicLstData(data) {
  300. return request.get("diy/community",data, {
  301. noAuth: true
  302. });
  303. }
  304. /**
  305. * diy-商户列表
  306. * @param {Object} data
  307. */
  308. export function storeList(data) {
  309. return request.get("diy/store",data, {
  310. noAuth: true
  311. });
  312. }
  313. /**
  314. * diy-优惠券列表
  315. * @param {Object} data
  316. */
  317. export function getCouponData(data) {
  318. return request.get("diy/coupon", data, {
  319. noAuth: true
  320. });
  321. }
  322. /**
  323. * diy-小程序直播
  324. * @param {Object} data
  325. */
  326. export function getLiveData(data) {
  327. return request.get("diy/broadcast", data, {
  328. noAuth: true
  329. });
  330. }
  331. /**
  332. * diy-热卖排行
  333. * @param {Object} data
  334. */
  335. export function hotRankingList(data) {
  336. return request.get("diy/hot_top", data, {
  337. noAuth: true
  338. });
  339. }
  340. /**
  341. * diy-首页二级分类
  342. * @param {Object} data
  343. */
  344. export function getCateData(data) {
  345. return request.get("diy/category", data, {
  346. noAuth: true
  347. });
  348. }