123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import request from '../utils/request.js'
- class activity extends request {
- static async getActivityList(nextPage,pageSize,status) {
- let params = {
- nextPage:nextPage,
- pageSize:pageSize,
- condition:{
- statusList:[status],
- source:"FREE_MINI_APP",
- }
- };
- const res = await this.postRequest(`${this.BASE_URL}open/activity/get-list`, params)
- return res.data
- }
- /**
- * 获取活动详情
- * @param {*} activityId 活动id
- */
- static async getActivityDetail(activityId) {
- let params = {
- activityId:activityId
- };
- const res = await this.getRequest(`${this.BASE_URL}open/activity/get`, params)
- return res.data
- }
-
- static async getSessionKeyFromApi(code) {
- let params = {
- appCode:getApp().globalData.appCode,
- sessionCode:code
- };
-
- const res = await this.postRequest(`${this.BASE_URL}open/wxapp/wx-login`, params)
- return res.data
- }
- /**
- * 解锁手机号
- * @param {*} orderSn
- */
- static async getAuthMobile(params) {
-
- const res = await this.postRequest(`${this.BASE_URL}open/wxapp/auth-mobile`, params)
- return res.data
- }
- /**
- * 保存用户信息
- * @param {*} openId
- * @param {*} mobile
- */
- static async saveUser(openId,mobile) {
- let params = {
- openid:openId,
- mobile:mobile,
- source:'FREE_MINI_APP'
- };
- const res = await this.postRequest(`${this.BASE_URL}open/activity/save-user`, params)
- return res.data
-
- }
- /**
- * 设置手机缓存
- * @param {*} mobile
- */
- static setMobileCache(mobile) {
- let data = {
- mobile:mobile,
- }
- wx.setStorageSync('userInfo',data);
- }
- static getMobileCache() {
- let userInfo = wx.getStorageSync('userInfo');
- if(userInfo) {
- return userInfo.mobile;
- }
- return '';
- }
- static getSessionKey() {
- return wx.getStorageSync('loginInfo').sessionKey;
- }
- /**
- * 获取用户openid
- */
- static getOpenId() {
- return wx.getStorageSync('loginInfo').openId;
- }
- }
- export default activity
|