You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

309 lines
5.8 KiB

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