Commit 5c7c3387 authored by mqf_0707's avatar mqf_0707

更新tbcc-sdk版本

parent 43f76188
...@@ -5345,9 +5345,9 @@ ...@@ -5345,9 +5345,9 @@
} }
}, },
"tbcc-sdk-ts": { "tbcc-sdk-ts": {
"version": "1.0.9", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.9.tgz", "resolved": "https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.10.tgz",
"integrity": "sha512-g4Rr6thIurH+fWlgaF4y8/aXu0ViVYoAzrZG7Rji5CguzDuZ2L8lH/uXCAzYtNXBmnB7IvtkR2i11xxe1YI8Dw==", "integrity": "sha512-z+6/SVclywLnlbIqndPzUDFuVj1NEbojFm9vQAqx1hiXvpJbBcf5Ioo9J7k0rjymXgk0+at+QsnjhwuWEq3o/g==",
"requires": { "requires": {
"@types/lodash": "^4.14.160", "@types/lodash": "^4.14.160",
"@types/node": "^14.6.0", "@types/node": "^14.6.0",
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
"react": "^17.0.0", "react": "^17.0.0",
"react-dom": "^17.0.0", "react-dom": "^17.0.0",
"taro-ui": "^3.0.0-alpha.3", "taro-ui": "^3.0.0-alpha.3",
"tbcc-sdk-ts": "^1.0.9" "tbcc-sdk-ts": "^1.0.10"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.8.0", "@babel/core": "^7.8.0",
......
import tbccTs from 'tbcc-sdk-ts' import tbccTs from 'tbcc-sdk-ts'
import API from '@/api' import API from '@/api'
const { getUserAddress, commonToast } = tbccTs.tb const { getUserAddress, showToast } = tbccTs.tb
export const noopFn = () => { } export const noopFn = () => { }
// 领取实物 // 领取实物
const getUerAddressParam = async () => { const getUerAddressParam = async () => {
const userAddress = await getUserAddress().catch(err => { const userAddress = await getUserAddress().catch(err => {
commonToast({ content: err.errorMessage}); showToast({ content: err.errorMessage});
}); });
if(!userAddress) return false if(!userAddress) return false
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {}; const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
...@@ -58,10 +58,10 @@ export const receiveObjectPrize = async (data) => { ...@@ -58,10 +58,10 @@ export const receiveObjectPrize = async (data) => {
} }
const { success, data, message } = await API.receiveObjectPrize({ ...params, ..._params }) const { success, data, message } = await API.receiveObjectPrize({ ...params, ..._params })
if (success) { if (success) {
commonToast({ content: successMsg}) showToast({ content: successMsg})
resolve(true) resolve(true)
}else { }else {
commonToast({content: errorMsg || message}) showToast({content: errorMsg || message})
resolve(false) resolve(false)
} }
}) })
...@@ -71,14 +71,14 @@ export const receiveEnamePrize = async (data) => { ...@@ -71,14 +71,14 @@ export const receiveEnamePrize = async (data) => {
const { params, successMsg, errorMsg } = data const { params, successMsg, errorMsg } = data
return new Promise(async (resolve,reject) => { return new Promise(async (resolve,reject) => {
const { success, data, message } = await API.receiveEnamePrize(params).catch(res => { const { success, data, message } = await API.receiveEnamePrize(params).catch(res => {
commonToast({ content: successMsg || res.message}) showToast({ content: successMsg || res.message})
resolve(false) resolve(false)
}); });
if (success) { if (success) {
commonToast({ content: successMsg}) showToast({ content: successMsg})
resolve(true) resolve(true)
}else { }else {
commonToast({ content: errorMsg || message}) showToast({ content: errorMsg || message})
resolve(false) resolve(false)
} }
}) })
...@@ -113,14 +113,14 @@ export const receiveMemberEname = async(data) => { ...@@ -113,14 +113,14 @@ export const receiveMemberEname = async(data) => {
if(result.businessSuccess) { if(result.businessSuccess) {
const { success, data, message } = await API.updateEnamePrizeReceived({ ...ext }) const { success, data, message } = await API.updateEnamePrizeReceived({ ...ext })
if(success) { if(success) {
commonToast({ content: successMsg || '奖品发放成功,请前往我的奖品处进行使用'}) showToast({ content: successMsg || '奖品发放成功,请前往我的奖品处进行使用'})
resolve(true) resolve(true)
}else { }else {
commonToast({ content: errorMsg || message}) showToast({ content: errorMsg || message})
resolve(false) resolve(false)
} }
}else{ }else{
commonToast({ content: result.errorMsg}) showToast({ content: result.errorMsg})
resolve(false) resolve(false)
} }
}) })
...@@ -129,7 +129,7 @@ export const receiveMemberEname = async(data) => { ...@@ -129,7 +129,7 @@ export const receiveMemberEname = async(data) => {
export const addStat = async(activityId, type)=> { export const addStat = async(activityId, type)=> {
return new Promise(async (resolve,reject) => { return new Promise(async (resolve,reject) => {
const result = await API.addStat({ activityId, type }).catch(res => { const result = await API.addStat({ activityId, type }).catch(res => {
commonToast({ content: res && res.message}); showToast({ content: res && res.message});
}); });
if (result && result.success) { if (result && result.success) {
resolve(true) resolve(true)
......
...@@ -13894,10 +13894,10 @@ taro-ui@^3.0.0-alpha.3: ...@@ -13894,10 +13894,10 @@ taro-ui@^3.0.0-alpha.3:
lodash "^4.17.10" lodash "^4.17.10"
prop-types "^15.7.2" prop-types "^15.7.2"
tbcc-sdk-ts@^1.0.9: tbcc-sdk-ts@^1.0.10:
version "1.0.9" version "1.0.10"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.9.tgz#36eedaa5f2d164c5e431cfe027dd8241d7622576" resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.10.tgz#8e1489176c843a43f95931aae3e04a5b6c1f8305"
integrity sha512-g4Rr6thIurH+fWlgaF4y8/aXu0ViVYoAzrZG7Rji5CguzDuZ2L8lH/uXCAzYtNXBmnB7IvtkR2i11xxe1YI8Dw== integrity sha512-z+6/SVclywLnlbIqndPzUDFuVj1NEbojFm9vQAqx1hiXvpJbBcf5Ioo9J7k0rjymXgk0+at+QsnjhwuWEq3o/g==
optionalDependencies: optionalDependencies:
"@types/lodash" "^4.14.160" "@types/lodash" "^4.14.160"
"@types/node" "^14.6.0" "@types/node" "^14.6.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment