商城测试版v8
This commit is contained in:
+10
-2
@@ -109,16 +109,24 @@ export const retrieval = (data: any, rules?: Object, message: string="请填写
|
||||
title,icon: "error"
|
||||
})
|
||||
},
|
||||
loading(title: string){
|
||||
loading(title: string, mask: true|false = false){
|
||||
Taro.showToast({
|
||||
title,icon: "loading"
|
||||
title,icon: "loading",
|
||||
mask
|
||||
})
|
||||
},
|
||||
none(title: string){
|
||||
Taro.showToast({
|
||||
title,icon: "none"
|
||||
})
|
||||
|
||||
},
|
||||
showLoading(title: string, mask: true|false = true) {
|
||||
Taro.showLoading({title, mask})
|
||||
},
|
||||
hideLoading() {
|
||||
Taro.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 金额千位分割符
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
||||
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
|
||||
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
|
||||
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||
export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||
// export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
|
||||
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
|
||||
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
||||
@@ -12,7 +12,7 @@
|
||||
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
||||
export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||
// export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||
|
||||
// CDN
|
||||
// 生成密钥
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import Taro from "@tarojs/taro";
|
||||
import { useStore } from "vuex";
|
||||
import { computed } from "@vue/runtime-core";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} token
|
||||
*/
|
||||
export const setToken = (token) => {
|
||||
Taro.setStorageSync('token', token)
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {Object} userinfo
|
||||
*/
|
||||
export const setUserInfo = (userinfo) => {
|
||||
Taro.setStorageSync('userInfo', userinfo)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查登录
|
||||
*/
|
||||
export const checkLogin = () => {
|
||||
const store = useStore()
|
||||
const token = computed(() => store.state.token)
|
||||
console.log('checklogin token', token);
|
||||
|
||||
// 本地调试屏蔽
|
||||
if (token == '') {
|
||||
Taro.redirectTo({
|
||||
url: '/pages/login/index',
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
+37
-1
@@ -1,3 +1,7 @@
|
||||
import { formatImgUrl } from "./fotmat";
|
||||
import { analysisShortCodeApi } from "./shortCode";
|
||||
import Taro from '@tarojs/taro'
|
||||
|
||||
/**
|
||||
* 防抖
|
||||
* @param {*} fn
|
||||
@@ -102,4 +106,36 @@ export const throttle = (fn, delay) => {
|
||||
} else {
|
||||
return 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//全局分享监听
|
||||
export const shareShop = () => {
|
||||
const page = Taro.getCurrentInstance().page
|
||||
//当有分享参数时,绑定上下级
|
||||
if(page && page.options?.share) {
|
||||
analysisShortCodeApi(page.options.share)
|
||||
}
|
||||
if(page && page.onShareAppMessage) {
|
||||
page.onShareAppMessage = (res) => {
|
||||
let path = ''
|
||||
let title = ''
|
||||
let imageUrl = ''
|
||||
let sortCode = Taro.getStorageSync('sort_code')?JSON.parse(Taro.getStorageSync('sort_code')):''
|
||||
let pageInfo:any = page
|
||||
if(res.from === 'button') {
|
||||
path = `/pages/details/index?share=${sortCode.shareShortDetail.code}`
|
||||
title = sortCode.shareShortDetail.title
|
||||
imageUrl = sortCode.shareShortDetail.img
|
||||
} else {
|
||||
path = `/pages/index/index?share=${sortCode.shareShortPage.code}`
|
||||
title = sortCode.shareShortPage.title
|
||||
imageUrl = (pageInfo.route === 'pages/user/index')?formatImgUrl('/mall/share_img_02.png') : sortCode.shareShortPage.img
|
||||
}
|
||||
return {
|
||||
title,
|
||||
path,
|
||||
imageUrl,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user