api.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2025 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 getBottomNavigationApi()
  20. {
  21. return request.get("index/get/bottom/navigation",{},{ noAuth : true});
  22. }
  23. /**
  24. * 首页 第一级商品分类
  25. *
  26. */
  27. export function getCategoryFirst()
  28. {
  29. return request.get("product/category/get/first",{},{ noAuth : true});
  30. }
  31. /**
  32. * 首页 第三级商品分类
  33. *
  34. */
  35. export function getCategoryThird(id)
  36. {
  37. return request.get(`product/category/get/third/${id}`,{},{ noAuth : true});
  38. }
  39. /**
  40. * 获取主页数据 无需授权
  41. *
  42. */
  43. export function getIndexData()
  44. {
  45. return request.get("index/info",{},{ noAuth : true});
  46. }
  47. /**
  48. * 获取登录授权login
  49. *
  50. */
  51. export function getLogo()
  52. {
  53. return request.get('wechat/getLogo', {}, { noAuth : true});
  54. }
  55. /**
  56. * 保存form_id
  57. * @param string formId
  58. */
  59. export function setFormId(formId) {
  60. return request.post("wechat/set_form_id", { formId: formId});
  61. }
  62. /**
  63. * 领取优惠卷
  64. * @param int couponId
  65. *
  66. */
  67. export function setCouponReceive(couponId){
  68. return request.post(`coupon/receive/${couponId}`);
  69. }
  70. /**
  71. * 优惠券列表
  72. * @param object data
  73. */
  74. export function getCoupons(data){
  75. return request.get('coupon/page/list',data,{noAuth:true})
  76. }
  77. /**
  78. * 我的优惠券
  79. * @param int types 0全部 1未使用 2已使用
  80. */
  81. export function getUserCoupons(data){
  82. return request.get('coupon/user/list',data)
  83. }
  84. /**
  85. * 文章分类列表
  86. *
  87. */
  88. export function getArticleCategoryList(){
  89. return request.get('article/category/list',{},{noAuth:true})
  90. }
  91. /**
  92. * 文章列表
  93. * @param int cid
  94. *
  95. */
  96. export function getArticleList(cid,data){
  97. return request.get(`article/list/${cid}`, data,{noAuth:true})
  98. }
  99. /**
  100. * 文章 热门列表
  101. *
  102. */
  103. export function getArticleHotList(){
  104. return request.get('article/hot/list',{},{noAuth:true});
  105. }
  106. /**
  107. * 文章 轮播列表
  108. *
  109. */
  110. export function getArticleBannerList(){
  111. return request.get('article/banner/list',{},{noAuth:true})
  112. }
  113. /**
  114. * 文章详情
  115. * @param int id
  116. *
  117. */
  118. export function getArticleDetails(id){
  119. return request.get(`article/info/${id}`,{noAuth:true});
  120. }
  121. /**
  122. * 获取短信KEY
  123. * @param object phone
  124. */
  125. export function verifyCode(){
  126. return request.get('verify_code', {},{noAuth:true})
  127. }
  128. /**
  129. * 换绑手机号获取用户手机号验证码
  130. * @param object phone
  131. */
  132. export function registerVerify(phone){
  133. return request.post('user/phone/code', {noAuth:true})
  134. }
  135. /**
  136. * 换绑手机号获取验证码
  137. * @param object data
  138. */
  139. export function bindingPhoneCode(data){
  140. return request.post('user/update/binding/phone/code', data,{noAuth:true})
  141. }
  142. /**
  143. * 手机号修改密码获取验证码
  144. */
  145. export const updatePasswordCodeApi = () => {
  146. return request.post(`user/update/password/phone/code`,{},{noAuth:true})
  147. }
  148. /**
  149. * 手机号注册
  150. * @param object data
  151. *
  152. */
  153. export function phoneRegister(data){
  154. return request.post('register',data,{noAuth:true});
  155. }
  156. /**
  157. * 手机号修改密码
  158. * @param object data
  159. *
  160. */
  161. export function phoneRegisterReset(data){
  162. return request.post('user/register/reset',data,{noAuth:true})
  163. }
  164. /**
  165. * 手机号+密码登录
  166. * @param object data
  167. *
  168. */
  169. export function phoneLogin(data){
  170. return request.post('login',data,{noAuth:true})
  171. }
  172. /**
  173. * 切换H5登录
  174. * @param object data
  175. */
  176. // #ifdef MP
  177. export function switchH5Login(){
  178. return request.post('switch_h5', { 'from':'routine'});
  179. }
  180. // #endif
  181. /*
  182. * h5切换公众号登录
  183. * */
  184. // #ifdef H5
  185. export function switchH5Login() {
  186. return request.post("switch_h5", { 'from': "wechat" });
  187. }
  188. // #endif
  189. /**
  190. * 换绑手机号
  191. *
  192. */
  193. export function bindingPhone(data){
  194. return request.post('user/update/binding',data);
  195. }
  196. /**
  197. * 换绑手机号校验
  198. *
  199. */
  200. export function bindingVerify(data){
  201. return request.post('update/binding/verify',data);
  202. }
  203. /**
  204. * 获取订阅消息id
  205. */
  206. export function getTemlIds(data)
  207. {
  208. return request.get('wechat/program/my/temp/list', data , { noAuth:true});
  209. }
  210. /**
  211. * 首页拼团数据
  212. */
  213. export function pink()
  214. {
  215. return request.get('pink', {}, { noAuth:true});
  216. }
  217. /**
  218. * 获取城市信息
  219. */
  220. export function getCity(data) {
  221. return request.get('city/list', data, { noAuth: true });
  222. }
  223. /**
  224. * 获取小程序直播列表
  225. */
  226. export function getLiveList(page,limit) {
  227. return request.get('wechat/live', { page, limit}, { noAuth: true });
  228. }
  229. /**
  230. * 获取小程序二维码
  231. */
  232. export function mpQrcode(data) {
  233. return request.post('qrcode/get/wechat',data,{ noAuth: true });
  234. }
  235. /**
  236. * 获取主题换色配置
  237. */
  238. export function getTheme() {
  239. return request.get('index/color/config',{},{noAuth:true});
  240. }
  241. /**
  242. * 获取APP版本更新信息
  243. */
  244. export function getAppVersion() {
  245. return request.get('index/index/get/version',{},{noAuth:true});
  246. }
  247. /**
  248. * 获取全局本地图片域名
  249. */
  250. export function getImageDomain() {
  251. return request.get('image/domain',{},{noAuth:true});
  252. }
  253. /**
  254. * 商品排行榜
  255. */
  256. export function productRank(){
  257. return request.get('product/leaderboard',{},{noAuth:true});
  258. }
  259. /**
  260. * 协议详情
  261. */
  262. export function agreementInfo(info){
  263. return request.get(`agreement/${info}`,{},{noAuth:true});
  264. }
  265. /**
  266. * 校验token是否有效
  267. */
  268. export function tokenIsExistApi(){
  269. return request.post(`login/token/is/exist`,{},{noAuth:true});
  270. }
  271. /**
  272. * 获取DIY数据
  273. */
  274. export function getDiy(id){
  275. return request.get(`pagediy/info/${id}`,{},{noAuth:true});
  276. }
  277. /**
  278. * 首页优惠券
  279. */
  280. export function getIndexCoupon(num){
  281. return request.get(`index/coupon/info/${num}`,{},{noAuth:true});
  282. }
  283. /**
  284. * id获取系统表单
  285. */
  286. export function systemFromDetail(id){
  287. return request.get(`system/form/detail/${id}`,{},{noAuth:true});
  288. }
  289. /**
  290. * 获取开屏广告信息
  291. */
  292. export function getOpenAdvApi(){
  293. return request.get(`index/splash/ad/info`,{},{noAuth:true});
  294. }